void MainWnd::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) { CWnd::OnActivate(nState, pWndOther, bMinimized); bool a = (nState == WA_ACTIVE) || (nState == WA_CLICKACTIVE); if(a && theApp.input) { theApp.active = a; theApp.input->activate(); if(!theApp.paused) { if(emulating) { theApp.disablePowerManagement(); soundResume(); } } } else { theApp.wasPaused = true; if(theApp.pauseWhenInactive) { if(emulating) { theApp.enablePowerManagement(); soundPause(); } theApp.active = a; } memset(theApp.delta,255,sizeof(theApp.delta)); } if(theApp.paused && emulating) systemDrawScreen(); }
void MainWnd::OnActivate(UINT nState, CWnd* pWndOther, BOOL bMinimized) { CWnd::OnActivate(nState, pWndOther, bMinimized); bool a = (nState == WA_ACTIVE) || (nState == WA_CLICKACTIVE); if(a && theApp.input) { theApp.active = a; theApp.input->activate(); if(!theApp.paused && emulating) { soundResume(); } } else { theApp.wasPaused = true; if(theApp.pauseWhenInactive) { if(emulating) { soundPause(); } theApp.active = a; } memset(theApp.delta,255,sizeof(theApp.delta)); } if(theApp.paused && emulating) { theApp.painting = true; systemDrawScreen(); theApp.painting = false; theApp.renderedFrames--; } }
void MainWnd::OnPaint() { CPaintDC dc(this); // device context for painting if(emulating) { theApp.painting = true; systemDrawScreen(); theApp.painting = false; theApp.renderedFrames--; } }
void MainWnd::OnSize(UINT nType, int cx, int cy) { CWnd::OnSize(nType, cx, cy); bool redraw = ( ( cx < theApp.surfaceSizeX ) || ( cy < theApp.surfaceSizeY ) ); if(!theApp.changingVideoSize) { if(this) { if(!IsIconic()) { if(theApp.iconic) { if(emulating) { soundResume(); theApp.paused = false; } } if(theApp.videoOption <= VIDEO_6X) { theApp.surfaceSizeX = cx; theApp.surfaceSizeY = cy; theApp.adjustDestRect(); if(theApp.display) theApp.display->resize(theApp.dest.right-theApp.dest.left, theApp.dest.bottom-theApp.dest.top); if( redraw && emulating ) { theApp.painting = true; systemDrawScreen(); theApp.painting = false; theApp.renderedFrames--; } } } else { if(emulating) { if(!theApp.paused) { theApp.paused = true; soundPause(); } } theApp.iconic = true; } } } }