|
@@ -1,3 +1,4 @@
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -27,7 +28,12 @@ SDL_Surface *gpScreen = NULL;
|
|
|
SDL_Surface *gpScreenBak = NULL;
|
|
|
|
|
|
|
|
|
+#if SDL_VERSION_ATLEAST(2,0,0)
|
|
|
+static SDL_Window *gpWindow = NULL;
|
|
|
+static SDL_Renderer *gpRenderer = NULL;
|
|
|
+#else
|
|
|
static SDL_Surface *gpScreenReal = NULL;
|
|
|
+#endif
|
|
|
|
|
|
#if (defined (__SYMBIAN32__) && !defined (__S60_5X__)) || defined (PSP) || defined (GEKKO)
|
|
|
static BOOL bScaleScreen = FALSE;
|
|
@@ -76,6 +82,9 @@ VIDEO_Init(
|
|
|
g_wInitialWidth = wScreenWidth;
|
|
|
g_wInitialHeight = wScreenHeight;
|
|
|
|
|
|
+#if SDL_VERSION_ATLEAST(2,0,0)
|
|
|
+
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
@@ -145,6 +154,81 @@ VIDEO_Init(
|
|
|
SDL_FreeSurface(gpScreenReal);
|
|
|
return -2;
|
|
|
}
|
|
|
+*/
|
|
|
+
|
|
|
+#else
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+#if defined (NDS)
|
|
|
+ gpScreenReal = SDL_SetVideoMode(293, 196, 8, SDL_SWSURFACE | SDL_FULLSCREEN);
|
|
|
+#elif defined (__SYMBIAN32__)
|
|
|
+#ifdef __S60_5X__
|
|
|
+ gpScreenReal = SDL_SetVideoMode(640, 360, 8,
|
|
|
+ SDL_SWSURFACE | (fFullScreen ? SDL_FULLSCREEN : 0));
|
|
|
+#else
|
|
|
+ gpScreenReal = SDL_SetVideoMode(320, 240, 8,
|
|
|
+ SDL_SWSURFACE | (fFullScreen ? SDL_FULLSCREEN : 0));
|
|
|
+#endif
|
|
|
+#elif defined (GEKKO)
|
|
|
+ gpScreenReal = SDL_SetVideoMode(640, 480, 8,
|
|
|
+ SDL_SWSURFACE | (fFullScreen ? SDL_FULLSCREEN : 0));
|
|
|
+#elif defined (PSP)
|
|
|
+ gpScreenReal = SDL_SetVideoMode(320, 240, 8, SDL_SWSURFACE | SDL_FULLSCREEN);
|
|
|
+#else
|
|
|
+ gpScreenReal = SDL_SetVideoMode(wScreenWidth, wScreenHeight, 8,
|
|
|
+ SDL_HWSURFACE | SDL_RESIZABLE | (fFullScreen ? SDL_FULLSCREEN : 0));
|
|
|
+#endif
|
|
|
+
|
|
|
+ if (gpScreenReal == NULL)
|
|
|
+ {
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ gpScreenReal = SDL_SetVideoMode(640, 480, 8,
|
|
|
+ SDL_SWSURFACE | (fFullScreen ? SDL_FULLSCREEN : 0));
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (gpScreenReal == NULL)
|
|
|
+ {
|
|
|
+ return -1;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ gpScreen = SDL_CreateRGBSurface(gpScreenReal->flags & ~SDL_HWSURFACE, 320, 200, 8,
|
|
|
+ gpScreenReal->format->Rmask, gpScreenReal->format->Gmask,
|
|
|
+ gpScreenReal->format->Bmask, gpScreenReal->format->Amask);
|
|
|
+
|
|
|
+ gpScreenBak = SDL_CreateRGBSurface(gpScreenReal->flags & ~SDL_HWSURFACE, 320, 200, 8,
|
|
|
+ gpScreenReal->format->Rmask, gpScreenReal->format->Gmask,
|
|
|
+ gpScreenReal->format->Bmask, gpScreenReal->format->Amask);
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ if (gpScreen == NULL || gpScreenBak == NULL)
|
|
|
+ {
|
|
|
+ if (gpScreen != NULL)
|
|
|
+ {
|
|
|
+ SDL_FreeSurface(gpScreen);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (gpScreenBak != NULL)
|
|
|
+ {
|
|
|
+ SDL_FreeSurface(gpScreenBak);
|
|
|
+ }
|
|
|
+
|
|
|
+ SDL_FreeSurface(gpScreenReal);
|
|
|
+ return -2;
|
|
|
+ }
|
|
|
+
|
|
|
+#endif
|
|
|
|
|
|
if (fFullScreen)
|
|
|
{
|
|
@@ -185,11 +269,15 @@ VIDEO_Shutdown(
|
|
|
}
|
|
|
gpScreenBak = NULL;
|
|
|
|
|
|
+#if SDL_VERSION_ATLEAST(2,0,0)
|
|
|
+
|
|
|
+#else
|
|
|
if (gpScreenReal != NULL)
|
|
|
{
|
|
|
SDL_FreeSurface(gpScreenReal);
|
|
|
}
|
|
|
gpScreenReal = NULL;
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
VOID
|