diff options
author | Arisotura <thetotalworm@gmail.com> | 2019-09-04 15:41:42 +0200 |
---|---|---|
committer | Arisotura <thetotalworm@gmail.com> | 2019-09-04 15:41:42 +0200 |
commit | 1b40149b0a39d55ed64831050766f0b35a6f2e24 (patch) | |
tree | a234814f4b1ac7aa1f76b286dd357971d6f459e5 | |
parent | a4f9187b9b06ef3babb7659bf563b809a328e6e5 (diff) |
blarg
here, have code
-rw-r--r-- | src/libui_sdl/PlatformConfig.cpp | 4 | ||||
-rw-r--r-- | src/libui_sdl/PlatformConfig.h | 1 | ||||
-rw-r--r-- | src/libui_sdl/main.cpp | 18 |
3 files changed, 20 insertions, 3 deletions
diff --git a/src/libui_sdl/PlatformConfig.cpp b/src/libui_sdl/PlatformConfig.cpp index fb31ccd..c8ec19f 100644 --- a/src/libui_sdl/PlatformConfig.cpp +++ b/src/libui_sdl/PlatformConfig.cpp @@ -47,6 +47,7 @@ int ScreenVSync; int ScreenRatio; int LimitFPS; +int AudioSync; int ShowOSD; int DirectBoot; @@ -122,7 +123,8 @@ ConfigEntry PlatformConfigFile[] = {"ScreenVSync", 0, &ScreenVSync, 0, NULL, 0}, {"ScreenRatio", 0, &ScreenRatio, 0, NULL, 0}, - {"LimitFPS", 0, &LimitFPS, 1, NULL, 0}, + {"LimitFPS", 0, &LimitFPS, 0, NULL, 0}, + {"AudioSync", 0, &AudioSync, 1, NULL, 0}, {"ShowOSD", 0, &ShowOSD, 1, NULL, 0}, {"DirectBoot", 0, &DirectBoot, 1, NULL, 0}, diff --git a/src/libui_sdl/PlatformConfig.h b/src/libui_sdl/PlatformConfig.h index 2aede24..842e72a 100644 --- a/src/libui_sdl/PlatformConfig.h +++ b/src/libui_sdl/PlatformConfig.h @@ -58,6 +58,7 @@ extern int ScreenVSync; extern int ScreenRatio; extern int LimitFPS; +extern int AudioSync; extern int ShowOSD; extern int DirectBoot; diff --git a/src/libui_sdl/main.cpp b/src/libui_sdl/main.cpp index 7fd02bb..c4cc542 100644 --- a/src/libui_sdl/main.cpp +++ b/src/libui_sdl/main.cpp @@ -93,6 +93,7 @@ uiMenuItem* MenuItem_ScreenSizing[4]; uiMenuItem* MenuItem_ScreenFilter; uiMenuItem* MenuItem_LimitFPS; +uiMenuItem* MenuItem_AudioSync; uiMenuItem* MenuItem_ShowOSD; SDL_Thread* EmuThread; @@ -2198,6 +2199,13 @@ void OnSetLimitFPS(uiMenuItem* item, uiWindow* window, void* blarg) else Config::LimitFPS = false; } +void OnSetAudioSync(uiMenuItem* item, uiWindow* window, void* blarg) +{ + int chk = uiMenuItemChecked(item); + if (chk != 0) Config::AudioSync = true; + else Config::AudioSync = false; +} + void OnSetShowOSD(uiMenuItem* item, uiWindow* window, void* blarg) { int chk = uiMenuItemChecked(item); @@ -2442,11 +2450,16 @@ void CreateMainWindowMenu() MenuItem_ScreenFilter = uiMenuAppendCheckItem(menu, "Screen filtering"); uiMenuItemOnClicked(MenuItem_ScreenFilter, OnSetScreenFiltering, NULL); + MenuItem_ShowOSD = uiMenuAppendCheckItem(menu, "Show OSD"); + uiMenuItemOnClicked(MenuItem_ShowOSD, OnSetShowOSD, NULL); + + uiMenuAppendSeparator(menu); + MenuItem_LimitFPS = uiMenuAppendCheckItem(menu, "Limit framerate"); uiMenuItemOnClicked(MenuItem_LimitFPS, OnSetLimitFPS, NULL); - MenuItem_ShowOSD = uiMenuAppendCheckItem(menu, "Show OSD"); - uiMenuItemOnClicked(MenuItem_ShowOSD, OnSetShowOSD, NULL); + MenuItem_AudioSync = uiMenuAppendCheckItem(menu, "Audio sync"); + uiMenuItemOnClicked(MenuItem_AudioSync, OnSetAudioSync, NULL); } void CreateMainWindow(bool opengl) @@ -2688,6 +2701,7 @@ int main(int argc, char** argv) uiMenuItemSetChecked(MenuItem_ScreenFilter, Config::ScreenFilter==1); uiMenuItemSetChecked(MenuItem_LimitFPS, Config::LimitFPS==1); + uiMenuItemSetChecked(MenuItem_AudioSync, Config::AudioSync==1); uiMenuItemSetChecked(MenuItem_ShowOSD, Config::ShowOSD==1); AudioFreq = 48000; // TODO: make configurable? |