mirror of
https://github.com/Michael-Prince-Sharpe/bsnes-classic.git
synced 2025-04-02 10:21:42 -04:00
(should fix #33, and let's mask WM_SYSCOMMAND's param correctly while i'm at it just in case)
25 lines
603 B
C++
25 lines
603 B
C++
#include <nall/utf8.hpp>
|
|
|
|
bool Application::App::winEventFilter(MSG *msg, long *result) {
|
|
//supress screen saver from activating during gameplay
|
|
if(msg->message == WM_SYSCOMMAND) {
|
|
WPARAM wParam = msg->wParam & 0xFFF0;
|
|
|
|
if(wParam == SC_SCREENSAVE || wParam == SC_MONITORPOWER) {
|
|
*result = 0;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
//prevent DirectSound audio buffer from looping during Windows modal events
|
|
if(msg->message == WM_ENTERMENULOOP || msg->message == WM_ENTERSIZEMOVE) {
|
|
audio.clear();
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
void supressScreenSaver() {
|
|
//handled by event filter above
|
|
}
|
|
|