aboutsummaryrefslogtreecommitdiff
path: root/sdl.cpp
diff options
context:
space:
mode:
authorJames Brown2002-04-13 04:39:04 +0000
committerJames Brown2002-04-13 04:39:04 +0000
commit94670b2eefb8e65351c1a237b40ec84039fd3ec8 (patch)
treeeebb261073fe58a232d3e0bfc75fba5331ac3c7d /sdl.cpp
parent44d4c1ac6082eb3c3e11217d8fecd8a2713995ca (diff)
downloadscummvm-rg350-94670b2eefb8e65351c1a237b40ec84039fd3ec8.tar.gz
scummvm-rg350-94670b2eefb8e65351c1a237b40ec84039fd3ec8.tar.bz2
scummvm-rg350-94670b2eefb8e65351c1a237b40ec84039fd3ec8.zip
Fix various warnings, and things preventing non-win32 platforms from compiling.
svn-id: r3916
Diffstat (limited to 'sdl.cpp')
-rw-r--r--sdl.cpp55
1 files changed, 27 insertions, 28 deletions
diff --git a/sdl.cpp b/sdl.cpp
index b13c0bfb8b..749ce9f456 100644
--- a/sdl.cpp
+++ b/sdl.cpp
@@ -2,7 +2,6 @@
#include "stdafx.h"
#include "scumm.h"
-#include "gui.h"
#include "SDL_thread.h"
#include "gameDetector.h"
@@ -208,40 +207,17 @@ void OSystem_SDL::load_gfx_mode() {
scaling = 1;
_internal_scaling = 1;
_driver_flags = 0;
-
+
+ _sai_func = NULL;
switch(_driver) {
case GFX_2XSAI:
_sai_func = _2xSaI;
- goto def_2xsai_drv;
+ break;
case GFX_SUPER2XSAI:
_sai_func = Super2xSaI;
- goto def_2xsai_drv;
+ break;
case GFX_SUPEREAGLE:
_sai_func = SuperEagle;
- def_2xsai_drv:;
-
- _driver_flags = DF_FORCE_FULL_ON_PALETTE | DF_WANT_RECT_OPTIM | DF_2xSAI | DF_SEPARATE_HWSCREEN;
-
- Init_2xSaI(565);
- sdl_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 200, 8, 0, 0, 0, 0);
- if (sdl_screen == NULL)
- error("SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 200, 8, 0, 0, 0, 0) failed");
-
- sdl_hwscreen = SDL_SetVideoMode(640, 400, 16, SDL_SWSURFACE);
- if (sdl_hwscreen == NULL)
- error("sdl_hwscreen failed");
-
- {
- /* Need some extra bytes around when using 2XSAI */
- uint16 *tmp_screen = (uint16*)calloc(320*204 + 16,sizeof(uint16));
- sdl_tmpscreen = SDL_CreateRGBSurfaceFrom(tmp_screen + TMP_SCREEN_OFFS, 320, 200, 16,
- 320*2, 0,0,0,0);
- if (sdl_tmpscreen == NULL)
- error("sdl_tmpscreen failed");
- }
-
- dirty_checksums = (uint32*)calloc(CKSUM_NUM*2, sizeof(uint32));
- scaling = 2;
break;
case GFX_DOUBLESIZE:
@@ -268,6 +244,29 @@ void OSystem_SDL::load_gfx_mode() {
error("sdl_screen failed");
break;
}
+
+ if (_sai_func) {
+ uint16 *tmp_screen = (uint16*)calloc(320*204 + 16,sizeof(uint16));
+ _driver_flags = DF_FORCE_FULL_ON_PALETTE | DF_WANT_RECT_OPTIM | DF_2xSAI | DF_SEPARATE_HWSCREEN;
+
+ Init_2xSaI(565);
+ sdl_screen = SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 200, 8, 0, 0, 0, 0);
+ if (sdl_screen == NULL)
+ error("SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 200, 8, 0, 0, 0, 0) failed");
+
+ sdl_hwscreen = SDL_SetVideoMode(640, 400, 16, SDL_SWSURFACE);
+ if (sdl_hwscreen == NULL)
+ error("sdl_hwscreen failed");
+
+ /* Need some extra bytes around when using 2XSAI */
+ sdl_tmpscreen = SDL_CreateRGBSurfaceFrom(tmp_screen + TMP_SCREEN_OFFS, 320, 200, 16,
+ 320*2, 0,0,0,0);
+ if (sdl_tmpscreen == NULL)
+ error("sdl_tmpscreen failed");
+
+ dirty_checksums = (uint32*)calloc(CKSUM_NUM*2, sizeof(uint32));
+ scaling = 2;
+ }
}
void OSystem_SDL::unload_gfx_mode() {