diff --git a/desktop_version/src/Screen.cpp b/desktop_version/src/Screen.cpp index ea86a1a6..85185d49 100644 --- a/desktop_version/src/Screen.cpp +++ b/desktop_version/src/Screen.cpp @@ -17,23 +17,27 @@ extern "C" ); } -void Screen::init( - int windowWidth, - int windowHeight, - bool fullscreen, - bool useVsync, - int stretch, - bool linearFilter, - bool badSignal -) { +ScreenSettings::ScreenSettings() +{ + windowWidth = 320; + windowHeight = 240; + fullscreen = false; + useVsync = false; + stretch = 0; + linearFilter = false; + badSignal = false; +} + +void Screen::init(const ScreenSettings& settings) +{ m_window = NULL; m_renderer = NULL; m_screenTexture = NULL; m_screen = NULL; - isWindowed = !fullscreen; - stretchMode = stretch; - isFiltered = linearFilter; - vsync = useVsync; + isWindowed = !settings.fullscreen; + stretchMode = settings.stretch; + isFiltered = settings.linearFilter; + vsync = settings.useVsync; filterSubrect.x = 1; filterSubrect.y = 1; filterSubrect.w = 318; @@ -84,9 +88,9 @@ void Screen::init( 240 ); - badSignalEffect = badSignal; + badSignalEffect = settings.badSignal; - ResizeScreen(windowWidth, windowHeight); + ResizeScreen(settings.windowWidth, settings.windowHeight); } void Screen::LoadIcon() diff --git a/desktop_version/src/Screen.h b/desktop_version/src/Screen.h index e4546724..4f934eaa 100644 --- a/desktop_version/src/Screen.h +++ b/desktop_version/src/Screen.h @@ -3,18 +3,12 @@ #include +#include "ScreenSettings.h" + class Screen { public: - void init( - int windowWidth, - int windowHeight, - bool fullscreen, - bool useVsync, - int stretch, - bool linearFilter, - bool badSignal - ); + void init(const ScreenSettings& settings); void LoadIcon(); diff --git a/desktop_version/src/ScreenSettings.h b/desktop_version/src/ScreenSettings.h new file mode 100644 index 00000000..4ec77128 --- /dev/null +++ b/desktop_version/src/ScreenSettings.h @@ -0,0 +1,17 @@ +#ifndef SCREENSETTINGS_H +#define SCREENSETTINGS_H + +struct ScreenSettings +{ + ScreenSettings(); + + int windowWidth; + int windowHeight; + bool fullscreen; + bool useVsync; + int stretch; + bool linearFilter; + bool badSignal; +}; + +#endif /* SCREENSETTINGS_H */