Skip to content

Commit

Permalink
SDL2: Fix video updating to work as it does for SDL1, to fully refres…
Browse files Browse the repository at this point in the history
…h the screen after mode change and update relative portions properly
  • Loading branch information
joncampbell123 committed Jul 12, 2018
1 parent 4acc780 commit c5b51ea
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
8 changes: 6 additions & 2 deletions src/output/output_surface.cpp
Expand Up @@ -174,12 +174,16 @@ void OUTPUT_SURFACE_EndUpdate(const Bit16u *changedLines)
if (changedLines && (changedLines[0] == sdl.draw.height)) if (changedLines && (changedLines[0] == sdl.draw.height))
return; return;
if (!menu.hidecycles && !sdl.desktop.fullscreen) frames++; if (!menu.hidecycles && !sdl.desktop.fullscreen) frames++;
#if !defined(C_SDL2) #if defined(C_SDL2)
SDL_UpdateWindowSurface(sdl.window);
#else
SDL_Flip(sdl.surface); SDL_Flip(sdl.surface);
#endif #endif
} }
else if (sdl.must_redraw_all) { else if (sdl.must_redraw_all) {
#if !defined(C_SDL2) #if defined(C_SDL2)
if (changedLines != NULL) SDL_UpdateWindowSurface(sdl.window);
#else
if (changedLines != NULL) SDL_Flip(sdl.surface); if (changedLines != NULL) SDL_Flip(sdl.surface);
#endif #endif
} }
Expand Down
5 changes: 4 additions & 1 deletion src/output/output_surface_sdl2.cpp
Expand Up @@ -72,6 +72,10 @@ Bitu OUTPUT_SURFACE_SetSize()
retFlags = GFX_CAN_32; retFlags = GFX_CAN_32;
break; break;
} }

sdl.deferred_resize = false;
sdl.must_redraw_all = true;

/* Fix a glitch with aspect=true occuring when /* Fix a glitch with aspect=true occuring when
changing between modes with different dimensions */ changing between modes with different dimensions */
SDL_FillRect(sdl.surface, NULL, SDL_MapRGB(sdl.surface->format, 0, 0, 0)); SDL_FillRect(sdl.surface, NULL, SDL_MapRGB(sdl.surface->format, 0, 0, 0));
Expand All @@ -81,7 +85,6 @@ Bitu OUTPUT_SURFACE_SetSize()
mainMenu.setRedraw(); mainMenu.setRedraw();
GFX_DrawSDLMenu(mainMenu, mainMenu.display_list); GFX_DrawSDLMenu(mainMenu, mainMenu.display_list);
#endif #endif
SDL_UpdateWindowSurface(sdl.window);


return retFlags; return retFlags;
} }
Expand Down
6 changes: 3 additions & 3 deletions vs2015/config_package.h
@@ -1,8 +1,8 @@
#define PACKAGE "dosbox-x" #define PACKAGE "dosbox-x"
#define PACKAGE_BUGREPORT "https://github.com/joncampbell123/dosbox-x/issues" #define PACKAGE_BUGREPORT "https://github.com/joncampbell123/dosbox-x/issues"
#define PACKAGE_NAME "dosbox-x" #define PACKAGE_NAME "dosbox-x"
#define PACKAGE_STRING "dosbox-x 0.82.4" #define PACKAGE_STRING "dosbox-x 0.82.8"
#define PACKAGE_TARNAME "dosbox-x" #define PACKAGE_TARNAME "dosbox-x"
#define PACKAGE_URL "http://dosbox-x.software" #define PACKAGE_URL "http://dosbox-x.software"
#define PACKAGE_VERSION "0.82.4" #define PACKAGE_VERSION "0.82.8"
#define VERSION "0.82.4" #define VERSION "0.82.8"

0 comments on commit c5b51ea

Please sign in to comment.