|
@@ -31,6 +31,7 @@ SDL_Surface *gpScreenBak = NULL;
|
|
#if SDL_VERSION_ATLEAST(2,0,0)
|
|
#if SDL_VERSION_ATLEAST(2,0,0)
|
|
static SDL_Window *gpWindow = NULL;
|
|
static SDL_Window *gpWindow = NULL;
|
|
static SDL_Renderer *gpRenderer = NULL;
|
|
static SDL_Renderer *gpRenderer = NULL;
|
|
|
|
+static SDL_Texture *gpTouchOverlay = NULL;
|
|
#else
|
|
#else
|
|
static SDL_Surface *gpScreenReal = NULL;
|
|
static SDL_Surface *gpScreenReal = NULL;
|
|
#endif
|
|
#endif
|
|
@@ -83,6 +84,10 @@ VIDEO_Init(
|
|
|
|
|
|
--*/
|
|
--*/
|
|
{
|
|
{
|
|
|
|
+#if SDL_VERSION_ATLEAST(2,0,0)
|
|
|
|
+ SDL_Surface *overlay;
|
|
|
|
+#endif
|
|
|
|
+
|
|
g_wInitialWidth = wScreenWidth;
|
|
g_wInitialWidth = wScreenWidth;
|
|
g_wInitialHeight = wScreenHeight;
|
|
g_wInitialHeight = wScreenHeight;
|
|
|
|
|
|
@@ -114,7 +119,7 @@ VIDEO_Init(
|
|
|
|
|
|
#if defined (__IOS__)
|
|
#if defined (__IOS__)
|
|
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0);
|
|
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, 0);
|
|
- // SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 1);
|
|
|
|
|
|
+ SDL_GL_SetAttribute(SDL_GL_RETAINED_BACKING, 1);
|
|
#endif
|
|
#endif
|
|
|
|
|
|
//
|
|
//
|
|
@@ -149,6 +154,15 @@ VIDEO_Init(
|
|
return -2;
|
|
return -2;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ overlay = SDL_LoadBMP(PAL_PREFIX "overlay.bmp");
|
|
|
|
+ if (overlay != NULL)
|
|
|
|
+ {
|
|
|
|
+ SDL_SetColorKey(overlay, SDL_RLEACCEL, SDL_MapRGB(overlay->format, 255, 0, 255));
|
|
|
|
+ gpTouchOverlay = SDL_CreateTextureFromSurface(gpRenderer, overlay);
|
|
|
|
+ SDL_SetTextureAlphaMod(gpTouchOverlay, 120);
|
|
|
|
+ SDL_FreeSurface(overlay);
|
|
|
|
+ }
|
|
|
|
+
|
|
#else
|
|
#else
|
|
|
|
|
|
//
|
|
//
|
|
@@ -362,6 +376,10 @@ VIDEO_UpdateScreen(
|
|
{
|
|
{
|
|
SDL_RenderCopy(gpRenderer, pTexture, NULL, NULL);
|
|
SDL_RenderCopy(gpRenderer, pTexture, NULL, NULL);
|
|
}
|
|
}
|
|
|
|
+ if (gpTouchOverlay)
|
|
|
|
+ {
|
|
|
|
+ SDL_RenderCopy(gpRenderer, gpTouchOverlay, NULL, NULL);
|
|
|
|
+ }
|
|
SDL_RenderPresent(gpRenderer);
|
|
SDL_RenderPresent(gpRenderer);
|
|
SDL_DestroyTexture(pTexture);
|
|
SDL_DestroyTexture(pTexture);
|
|
}
|
|
}
|
|
@@ -893,6 +911,10 @@ VIDEO_SwitchScreen(
|
|
pTexture = SDL_CreateTextureFromSurface(gpRenderer, gpScreenBak);
|
|
pTexture = SDL_CreateTextureFromSurface(gpRenderer, gpScreenBak);
|
|
SDL_RenderClear(gpRenderer);
|
|
SDL_RenderClear(gpRenderer);
|
|
SDL_RenderCopy(gpRenderer, pTexture, NULL, NULL);
|
|
SDL_RenderCopy(gpRenderer, pTexture, NULL, NULL);
|
|
|
|
+ if (gpTouchOverlay)
|
|
|
|
+ {
|
|
|
|
+ SDL_RenderCopy(gpRenderer, gpTouchOverlay, NULL, NULL);
|
|
|
|
+ }
|
|
SDL_RenderPresent(gpRenderer);
|
|
SDL_RenderPresent(gpRenderer);
|
|
SDL_DestroyTexture(pTexture);
|
|
SDL_DestroyTexture(pTexture);
|
|
|
|
|
|
@@ -1048,6 +1070,10 @@ VIDEO_FadeScreen(
|
|
pTexture = SDL_CreateTextureFromSurface(gpRenderer, gpScreenBak);
|
|
pTexture = SDL_CreateTextureFromSurface(gpRenderer, gpScreenBak);
|
|
SDL_RenderClear(gpRenderer);
|
|
SDL_RenderClear(gpRenderer);
|
|
SDL_RenderCopy(gpRenderer, pTexture, &srcrect, &dstrect);
|
|
SDL_RenderCopy(gpRenderer, pTexture, &srcrect, &dstrect);
|
|
|
|
+ if (gpTouchOverlay)
|
|
|
|
+ {
|
|
|
|
+ SDL_RenderCopy(gpRenderer, gpTouchOverlay, NULL, NULL);
|
|
|
|
+ }
|
|
SDL_RenderPresent(gpRenderer);
|
|
SDL_RenderPresent(gpRenderer);
|
|
SDL_DestroyTexture(pTexture);
|
|
SDL_DestroyTexture(pTexture);
|
|
|
|
|
|
@@ -1057,6 +1083,10 @@ VIDEO_FadeScreen(
|
|
{
|
|
{
|
|
pTexture = SDL_CreateTextureFromSurface(gpRenderer, gpScreenBak);
|
|
pTexture = SDL_CreateTextureFromSurface(gpRenderer, gpScreenBak);
|
|
SDL_RenderCopy(gpRenderer, pTexture, NULL, NULL);
|
|
SDL_RenderCopy(gpRenderer, pTexture, NULL, NULL);
|
|
|
|
+ if (gpTouchOverlay)
|
|
|
|
+ {
|
|
|
|
+ SDL_RenderCopy(gpRenderer, gpTouchOverlay, NULL, NULL);
|
|
|
|
+ }
|
|
SDL_RenderPresent(gpRenderer);
|
|
SDL_RenderPresent(gpRenderer);
|
|
SDL_DestroyTexture(pTexture);
|
|
SDL_DestroyTexture(pTexture);
|
|
}
|
|
}
|