void VideoOutputVDPAU::TearDown(void) { QMutexLocker locker(&m_lock); DeinitPIPS(); DeinitPIPLayer(); DeleteBuffers(); RestoreDisplay(); DeleteRender(); }
int main( int argc, char **argv ) { POINTER mem_lock; uintptr_t size = 0; TEXTCHAR *myname = StrDup( pathrchr( DupCharToText( argv[0] ) ) ); TEXTCHAR *endname; TEXTCHAR lockname[256]; if( myname ) myname++; else myname = DupCharToText( argv[0] ); // go to the .exe extension endname = (TEXTCHAR*)StrRChr( myname, '.' ); if( endname ) { // remove .exe extension endname[0] = 0; // go to the .stop extension endname = (TEXTCHAR*)StrRChr( myname, '.' ); } if( endname ) { // remove .stop extension endname[0] = 0; } else { // this would be an invalid name. return 0; } snprintf( lockname, sizeof( lockname ), WIDE( "%s.instance.lock" ), myname ); lprintf( WIDE( "Checking lock %s" ), lockname ); mem_lock = OpenSpace( lockname , NULL //, WIDE("memory.delete") , &size ); if( mem_lock ) { #ifdef WIN32 PRENDER_INTERFACE pri = GetDisplayInterface(); PVIDEO video = (PVIDEO)mem_lock; if( video->hWndOutput ) { ForceDisplayFocus( video ); RestoreDisplay( video ); } else { // region found, but no content... } #endif } else lprintf( WIDE("lock region not found.") ); return 0; }
void CPROC tick( uintptr_t psv ) { uint32_t now = GetTickCount(); if( target_in_start ) { if( now >= target_in_start ) { if( !target_in ) { //lprintf( "Begin fading in the new image..." ); target_in = target_in_start + g.fade_in; g.currents[g.next_up] = g.current_image; g.current_image++; if( g.current_image >= g.nImages ) g.current_image = 0; //lprintf( "(!)Setting fade to..> %d", 255 - (255*(now-target_in_start))/(target_in-target_in_start) ); SetDisplayFade( g.displays[g.next_up], 255 - (255*(now-target_in_start))/(target_in-target_in_start) ); g.is_up[g.next_up] = 1; RestoreDisplay( g.displays[g.next_up] ); //ForceDisplayFront( g.displays[g.next_up] ); } else { if( target_in && now > target_in ) { //lprintf( "Fade is is complete, set alpha to 0, and hide old display..." ); SetDisplayFade( g.displays[g.next_up], 0 ); UpdateDisplay( g.displays[g.next_up] ); target_in_start = now + g.show_time; target_in = 0; g.next_up++; if( g.next_up >= 2 ) // two displayss g.next_up = 0; //lprintf( "Next up is %d", g.next_up ); // hide the old display... //lprintf( "hiding old display..." ); g.is_up[g.next_up] = 0; HideDisplay( g.displays[g.next_up] ); } else { //lprintf( "Setting fade to..> %d", 255 - (255*(now-target_in_start))/(target_in-target_in_start) ); SetDisplayFade( g.displays[g.next_up], 255 - (255*(now-target_in_start))/(target_in-target_in_start) ); UpdateDisplay( g.displays[g.next_up] ); } } } } }
// // End the cineractive // void Cineractive::Terminate() { LOG_VIEWER(("Terminate: %d left", cineractives.GetCount() - 1)) // Delete primitives primitiveList.DisposeAll(); done = TRUE; Vid::renderState.status.alphaNear = alphaNearStart; // if this is the last one if (cineractives.GetCount() == 1) { // Restore everything DisableIFace(FALSE); DisableInput(FALSE); DisableShroud(FALSE); RestoreDisplay(); ASSERT(!flags) flags = 0; } }
// // Execute a block of commands // void Cineractive::ExecBlock(FScope *fScope) { FScope *sScope; while ((sScope = fScope->NextFunction()) != NULL) { LOG_VIEWER(("Exec: [%s]", sScope->NameStr())) switch (sScope->NameCrc()) { case 0x9D71F205: // "Movie" { // Disable movies in multiplayer campaigns if (!MultiPlayer::Data::Online()) { if (moviePrim) { delete moviePrim; } moviePrim = new Movie(this, sScope); } break; } case 0x0DA67726: // "AlphaNear" Vid::renderState.status.alphaNear = alphaNear = sScope->NextArgInteger(); break; case 0x70600744: // "DisableIFace" { DisableIFace(sScope->NextArgInteger()); break; } case 0x72C1779F: // "DisableHUD" { DisableHUD(sScope->NextArgInteger()); break; } case 0x288F19CB: // "DisableInput" { DisableInput(sScope->NextArgInteger()); break; } case 0xAA268B85: // "DisableShroud" { DisableShroud(sScope->NextArgInteger()); break; } case 0x47518EE4: // "EndCineractive" { Terminate(); break; } case 0x7E8E3E05: // "SkipPoint" { RestoreDisplay(); break; } case 0xEA4227E1: // "SetBookmark" { SetBookmark(sScope); break; } case 0xDDD6437A: // "DefaultCamera" { LOG_VIEWER(("DefaultCamera")) if (Demo::IsPlaying()) { SetCurrent("Playback0", StdLoad::TypeU32(sScope, U32(FALSE), Range<U32>::flag), sScope); } else { SetCurrent("default", StdLoad::TypeU32(sScope, U32(FALSE), Range<U32>::flag), sScope); } break; } case 0xF4356EC8: // "SetCamera" { SetCurrent(sScope->NextArgString(), FALSE, sScope); break; } case 0x9805A0A6: // "Mesh" { AddPrim(primitiveList, new Mesh(this, sScope)); break; } case 0x16556EBC: // "Letterbox" { AddPrim(primitiveList, new Letterbox(this, sScope)); break; } case 0x10A95B64: // "Fade" { AddPrim(primitiveList, new Fade(this, sScope)); break; } case 0x76802A4E: // "Image" { AddPrim(primitiveList, new Image(this, sScope)); break; } case 0x64DD3931: // "Wallpaper" { AddPrim(primitiveList, new Wallpaper(this, sScope)); break; } case 0xCB28D32D: // "Text" { AddPrim(primitiveList, new Text(this, sScope)); break; } case 0x8E18DC65: // "Subtitle" { AddPrim(primitiveList, new Subtitle(this, sScope)); break; } case 0x37345010: // "Pause" { if (!GameTime::Paused()) { GameTime::Pause(FALSE); } break; } case 0x0642D599: // "Unpause" { if (GameTime::Paused()) { GameTime::Pause(FALSE); } break; } case 0x3F159CC9: // "DefineDebriefing" { debriefings.Add(Crc::CalcStr(sScope->NextArgString()), sScope); break; } case 0x311D74EF: // "Debrief" { ProcessDebrief(sScope); break; } case 0x06A3B1BA: // "Action" { // Execute an objective action block ::Action::Execute(team, sScope); break; } default: { LOG_WARN(("Unknown function [%s] in Cineractive", sScope->NameStr())) break; } } } }
SaneWinMain(argc, argv ) //int main( int argc, char **argv ) { int x = 0; int y = 0; uint32_t width, height; int w, h; g.pdi = GetDisplayInterface(); g.pii = GetImageInterface(); RegisterIcon( NULL ); GetDisplaySize( &width, &height ); w = width; h = height; y = x = 0; { int state = 0; int arg; g.fade_in = 500; g.show_time = 1000; for( arg = 1; arg < argc; arg++ ) { if( argv[arg][0] == '-' ) { if( argv[arg][1] == 'i' ) { g.flags.bShowInverted = 1; } else { switch( state ) { case 0: x = atoi( argv[arg]+1 ); break; case 1: y = atoi( argv[arg]+1 ); break; case 2: w = atoi( argv[arg]+1 ); break; case 3: h = atoi( argv[arg]+1 ); break; case 4: g.show_time = atoi( argv[arg]+1 ); break; case 5: g.fade_in = atoi( argv[arg]+1 ); break; } state++; } } else { Image x = LoadImageFile( argv[arg] ); if( x ) { g.nImages++; AddLink( &g.images, x ); } } } } if( g.nImages ) { g.displays[0] = OpenDisplaySizedAt( DISPLAY_ATTRIBUTE_LAYERED|DISPLAY_ATTRIBUTE_CHILD|DISPLAY_ATTRIBUTE_NO_MOUSE|DISPLAY_ATTRIBUTE_NO_AUTO_FOCUS , w //width , h //height , x //0 , y //0 ); g.displays[1] = OpenDisplaySizedAt( DISPLAY_ATTRIBUTE_LAYERED|DISPLAY_ATTRIBUTE_CHILD|DISPLAY_ATTRIBUTE_NO_MOUSE|DISPLAY_ATTRIBUTE_NO_AUTO_FOCUS , w //width , h //height , x //0 , y //0 ); SetRedrawHandler( g.displays[0], Output, 0 ); SetRedrawHandler( g.displays[1], Output, 1 ); if( g.nImages > 1 ) { target_in_start = GetTickCount(); AddTimer( 33, tick, 0 ); } else { //lprintf( "Show the first and only the first image." ); g.is_up[0] = 1; RestoreDisplay( g.displays[0] ); UpdateDisplay( g.displays[0] ); } while( 1 ) WakeableSleep( 10000 ); } else { } return 0; }