summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormatthijs <matthijs@openttd.org>2012-02-07 10:27:48 +0000
committermatthijs <matthijs@openttd.org>2012-02-07 10:27:48 +0000
commit311413a0913a8002d50aebf643dc3934357d3af4 (patch)
treef73d0db2cbf7a44ea97156a03c91eaaaeaf71f92 /src
parentcba6390973f27410b5dc32923bc697ed9ff1d2cc (diff)
downloadopenttd-311413a0913a8002d50aebf643dc3934357d3af4.tar.xz
(svn r23910) -Fix: [SDL] Handle the SDL_VIDEOEXPOSE event.
- It seems this event is never triggered when using 1.2 (it has some autorefresh feature which seems to have been removed in 1.3), but in theory this event could also trigger on 1.2. - Note that this fixes redraw issues when compiling against SDL 1.3, but it still uses the "compatibility" rendering API using SDL_SetVideoMode and SDL_UpdateRects. Eventually (when 1.3 is stable and released as 2.0), this should probably be rewritting to use the new Windows and Renderers available in SDL 1.3.
Diffstat (limited to 'src')
-rw-r--r--src/video/sdl_v.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/video/sdl_v.cpp b/src/video/sdl_v.cpp
index d22ad512e..663de4ebf 100644
--- a/src/video/sdl_v.cpp
+++ b/src/video/sdl_v.cpp
@@ -473,6 +473,13 @@ static int PollEvent()
CreateMainSurface(w, h);
break;
}
+ case SDL_VIDEOEXPOSE: {
+ /* Force a redraw of the entire screen. Note
+ * that SDL 1.2 seems to do this automatically
+ * in most cases, but 1.3 / 2.0 does not. */
+ _num_dirty_rects = MAX_DIRTY_RECTS + 1;
+ break;
+ }
}
return -1;
}