Skip to content
Permalink
Browse files

-Fix: Check that video buffer finished initializing before memcmp/memcpy

  • Loading branch information...
miniupnp committed Oct 3, 2015
1 parent 6dff8b6 commit 0006a11e02ff9a9db570f78fba6b6ab5689e48a8
Showing with 5 additions and 4 deletions.
  1. +5 −4 src/video/video_sdl.c
@@ -666,10 +666,12 @@ void Video_Tick(void)

#ifdef _DEBUG
if (!s_showFPS) {
if (!GFX_Screen_IsDirty(SCREEN_0) && memcmp(GFX_Screen_Get_ByIndex(SCREEN_0), s_gfx_screen8, SCREEN_WIDTH * SCREEN_HEIGHT) != 0) {
Warning("**** SCREEN0 DIRTY NOT DETECTED ! ****\n");
if (GFX_Screen_Get_ByIndex(SCREEN_0) != NULL) {
if (!GFX_Screen_IsDirty(SCREEN_0) && memcmp(GFX_Screen_Get_ByIndex(SCREEN_0), s_gfx_screen8, SCREEN_WIDTH * SCREEN_HEIGHT) != 0) {
Warning("**** SCREEN0 DIRTY NOT DETECTED ! ****\n");
}
memcpy(s_gfx_screen8, GFX_Screen_Get_ByIndex(SCREEN_0), SCREEN_WIDTH * SCREEN_HEIGHT);
}
memcpy(s_gfx_screen8, GFX_Screen_Get_ByIndex(SCREEN_0), SCREEN_WIDTH * SCREEN_HEIGHT);
}
#endif /* _DEBUG */

@@ -689,7 +691,6 @@ void Video_Tick(void)
GFX_Screen_SetClean(SCREEN_0);
s_screen_needrepaint = false;
}

s_video_lock = false;
}

0 comments on commit 0006a11

Please sign in to comment.
You can’t perform that action at this time.