Root/dgclock/patches/002-fix-bpp-on-nn.patch

1diff -ruN dgclock-091222/src/main.c dgclock-091222.mod/src/main.c
2--- dgclock-091222/src/main.c 2010-02-10 11:51:51.000000000 +0100
3+++ dgclock-091222.mod/src/main.c 2010-02-10 15:27:40.000000000 +0100
4@@ -7,7 +7,7 @@
5 #include "text.h"
6 #include "settime.h"
7 
8-SDL_Surface *gSurfaceMain = NULL;
9+SDL_Surface *gSurfaceMain, *gRealScreen = NULL;
10 TTF_Font *gTTFFont = NULL;
11 TTF_Font *gTTFSmall = NULL;
12 
13@@ -46,8 +46,9 @@
14         return -1;
15     }
16     
17- gSurfaceMain = SDL_SetVideoMode(320,240,16,0);
18-
19+ gSurfaceMain = SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 240, 16, 0, 0, 0, 0);
20+ gRealScreen = SDL_SetVideoMode(320,240,32,0);
21+
22     if (!gSurfaceMain)
23         return -1;
24     
25@@ -560,7 +561,8 @@
26     SDL_Surface *pSurfaceText = NULL;
27     
28     
29- SDL_Flip(gSurfaceMain);
30+ SDL_BlitSurface(gSurfaceMain,NULL,gRealScreen,NULL);
31+ SDL_Flip(gRealScreen);
32     
33     i = 0;
34     quit_flag = 0;
35@@ -612,8 +614,10 @@
36                 app_make_time(&lctm);
37             }
38 
39- SDL_Flip(gSurfaceMain);
40- SDL_Flip(gSurfaceMain); // seems double buffer
41+ SDL_BlitSurface(gSurfaceMain,NULL,gRealScreen,NULL);
42+ SDL_Flip(gRealScreen);
43+ SDL_Flip(gRealScreen);
44+
45             update_flag = 0;
46         }
47         
48

Archive Download this file



interactive