Permalink
Browse files

Switched to latest SDL2 (now support D&D out of the box) for Windows

  • Loading branch information...
1 parent e79b0cf commit 216d126d8fede0bcf87c5a80e9201a87a55f95c8 @stg committed Mar 13, 2013
Showing with 3 additions and 1 deletion.
  1. BIN bin-win/SDL2.dll
  2. BIN bin-win/gui.exe
  3. +3 −1 gui/renderer.c
View
BIN bin-win/SDL2.dll
Binary file not shown.
View
BIN bin-win/gui.exe
Binary file not shown.
View
4 gui/renderer.c
@@ -118,6 +118,8 @@ static SDL_Surface *get_bg() {
temp=bg;
#ifdef SDL2
bg=SDL_ConvertSurface(temp,screen->format,0);
+ // SDL2 crashes on SDL_BlitSurface without this...
+ SDL_SetColorKey(bg,SDL_TRUE,SDL_MapRGB(screen->format,0xFF,0x00,0xFF));
#else
bg=SDL_DisplayFormat(temp);
#endif
@@ -211,10 +213,10 @@ void r_draw() {
unsigned char x, y;
unsigned char i, j;
Uint32 SDL_color;
- SDL_BlitSurface(bg,NULL,screen,NULL);
write_index = 0;
SDL_Rect srcrect;
SDL_Rect dstrect;
+ SDL_BlitSurface(bg,NULL,screen,NULL);
srcrect.w = 16;
srcrect.h = 16;
for( y = 0; y < r_h; y++ ) {

0 comments on commit 216d126

Please sign in to comment.