removed support for non-renderer graphics for SDL2 target
authorHolger Schemel <info@artsoft.org>
Thu, 31 Mar 2016 17:55:16 +0000 (19:55 +0200)
committerHolger Schemel <info@artsoft.org>
Thu, 31 Mar 2016 17:55:16 +0000 (19:55 +0200)
src/libgame/sdl.c

index 786368d28d1f0264e30d6577a51ee0eb66fefb1e..39920c8350fc739fb2a6a473348512ffce4209ff 100644 (file)
@@ -36,8 +36,6 @@ static SDL_Texture *sdl_texture_target = NULL;
 static SDL_Texture *sdl_texture = NULL;
 #endif
 static boolean fullscreen_enabled = FALSE;
-
-#define USE_RENDERER   TRUE
 #endif
 
 /* stuff needed to work around SDL/Windows fullscreen drawing bug */
@@ -125,7 +123,6 @@ static void UpdateScreen(SDL_Rect *rect)
 #endif
 
 #if defined(TARGET_SDL2)
-#if USE_RENDERER
   if (rect)
   {
     int bytes_x = screen->pitch / video.width;
@@ -179,14 +176,6 @@ static void UpdateScreen(SDL_Rect *rect)
   // show render target buffer on screen
   SDL_RenderPresent(sdl_renderer);
 
-#else
-
-  if (rect)
-    SDL_UpdateWindowSurfaceRects(sdl_window, rect, 1);
-  else
-    SDL_UpdateWindowSurface(sdl_window);
-#endif
-
 #else  // TARGET_SDL
   if (rect)
     SDL_UpdateRects(screen, 1, rect);
@@ -662,7 +651,6 @@ static SDL_Surface *SDLCreateScreen(DrawBuffer **backbuffer,
   // store if initial screen mode is fullscreen mode when changing screen size
   video.fullscreen_initial = fullscreen;
 
-#if USE_RENDERER
   float window_scaling_factor = (float)setup.window_scaling_percent / 100;
 #if !USE_DESKTOP_FULLSCREEN
   float screen_scaling_factor = (fullscreen ? 1 : window_scaling_factor);
@@ -791,21 +779,6 @@ static SDL_Surface *SDLCreateScreen(DrawBuffer **backbuffer,
     Error(ERR_WARN, "SDL_CreateWindow() failed: %s", SDL_GetError());
   }
 
-#else
-
-  if (sdl_window)
-    SDL_DestroyWindow(sdl_window);
-
-  sdl_window = SDL_CreateWindow(program.window_title,
-                               SDL_WINDOWPOS_CENTERED,
-                               SDL_WINDOWPOS_CENTERED,
-                               width, height,
-                               surface_flags);
-
-  if (sdl_window != NULL)
-    new_surface = SDL_GetWindowSurface(sdl_window);
-#endif
-
 #else
   new_surface = SDL_SetVideoMode(width, height, video.depth, surface_flags);
 #endif
@@ -1142,7 +1115,6 @@ void SDLBlitTexture(Bitmap *bitmap,
                    int dst_x, int dst_y, int mask_mode)
 {
 #if defined(TARGET_SDL2)
-#if USE_RENDERER
   SDL_Texture *texture;
   SDL_Rect src_rect;
   SDL_Rect dst_rect;
@@ -1165,7 +1137,6 @@ void SDLBlitTexture(Bitmap *bitmap,
 
   SDL_RenderCopy(sdl_renderer, texture, &src_rect, &dst_rect);
 #endif
-#endif
 }
 
 void SDLFillRectangle(Bitmap *dst_bitmap, int x, int y, int width, int height,