diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-09-05 16:31:49 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-09-05 16:31:49 (GMT) |
| commit | d61690bc091af0e253abe18832cc06f6c998724a (patch) | |
| tree | bc152e2abb2790d03d9c24b9576954d307fbcafc /src/PowderToySDL.cpp | |
| parent | d379390d066add46513da73a690ef20414b6627b (diff) | |
| download | powder-d61690bc091af0e253abe18832cc06f6c998724a.zip powder-d61690bc091af0e253abe18832cc06f6c998724a.tar.gz | |
Prevent setting double scale on smaller screens. Fixes #166
Diffstat (limited to 'src/PowderToySDL.cpp')
| -rw-r--r-- | src/PowderToySDL.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/PowderToySDL.cpp b/src/PowderToySDL.cpp index 61ca94d..75c1861 100644 --- a/src/PowderToySDL.cpp +++ b/src/PowderToySDL.cpp @@ -50,6 +50,8 @@ using namespace std; extern "C" IMAGE_DOS_HEADER __ImageBase; #endif +int desktopWidth = 1280, desktopHeight = 1024; + SDL_Surface * sdl_scrn; int scale = 1; bool fullscreen = false; @@ -173,6 +175,9 @@ int SDLOpen() fprintf(stderr, "Initializing SDL: %s\n", SDL_GetError()); return 1; } + const SDL_VideoInfo * vidInfo = SDL_GetVideoInfo(); + desktopWidth = vidInfo->current_w; + desktopHeight = vidInfo->current_h; SDL_EnableUNICODE(1); #if defined(WIN) && defined(WINCONSOLE) //On Windows, SDL redirects stdout to stdout.txt, which can be annoying when debugging, here we redirect back to the console @@ -492,6 +497,7 @@ int main(int argc, char * argv[]) ui::Engine::Ref().Fullscreen = fullscreen; engine = &ui::Engine::Ref(); + engine->SetMaxSize(desktopWidth, desktopHeight); engine->Begin(XRES+BARSIZE, YRES+MENUSIZE); GameController * gameController = new GameController(); |
