Commit 93c4b9c1 authored by pickle136's avatar pickle136

Improved way to check scale when the resolution changes

parent 8dcf4118
......@@ -69,14 +69,21 @@ void createScreen () {
#if defined(WIZ) || defined(GP2X)
screen = SDL_SetVideoMode(320, 240, 8, V_FULLSCREEN);
#else
#ifdef FULLSCREEN_ONLY
screen = SDL_SetVideoMode(screenW, screenH, 8, V_FULLSCREEN);
#else
screen = SDL_SetVideoMode(screenW, screenH, 8, fullscreen? V_FULLSCREEN: V_WINDOWED);
#ifdef FULLSCREEN_ONLY
screen = SDL_SetVideoMode(screenW, screenH, 8, V_FULLSCREEN);
#else
screen = SDL_SetVideoMode(screenW, screenH, 8, fullscreen? V_FULLSCREEN: V_WINDOWED);
#endif
#endif
#ifdef SCALE
// Check that the scale will fit in the current resolution
while ( ((screenW/320 < scaleFactor) || (screenH/200 < scaleFactor)) && (scaleFactor > 1) ) {
scaleFactor--;
}
if (scaleFactor > 1) {
canvasW = screenW / scaleFactor;
......@@ -113,7 +120,7 @@ void createScreen () {
return;
}
}
void usePalette (SDL_Color *palette) {
......
......@@ -445,13 +445,6 @@ int Menu::setupScaling () {
if ((controls.release(C_UP) || controls.release(C_RIGHT)) && (scaleFactor < MAX_SCALE)) scaleFactor++;
// Check that the scale will fit in the current resolution
if ( screenW/320 < scaleFactor || screenH/200 < scaleFactor ) {
scaleFactor = oldScaleFactor;
}
// Check for a scaling change
if (scaleFactor != oldScaleFactor) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment