Date:2010-02-11 01:13:38 (11 years 14 days ago)
Author:Mirko Vogt
Commit:3cc708a0554c5bffff5140d0afd8e7a8354b516d
Message:fix display issues because of wrong bpp settings on nanonote (thanks to zear)

Files: dgclock/patches/002-fix-bpp-on-nn.patch (1 diff)

Change Details

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@@ -7,7 +7,7 @@
4 #include "text.h"
5 #include "settime.h"
6
7-SDL_Surface *gSurfaceMain = NULL;
8+SDL_Surface *gSurfaceMain, *gRealScreen = NULL;
9 TTF_Font *gTTFFont = NULL;
10 TTF_Font *gTTFSmall = NULL;
11
12@@ -46,8 +46,9 @@
13         return -1;
14     }
15
16- gSurfaceMain = SDL_SetVideoMode(320,240,16,0);
17-
18+ gSurfaceMain = SDL_CreateRGBSurface(SDL_SWSURFACE, 320, 240, 16, 0, 0, 0, 0);
19+ gRealScreen = SDL_SetVideoMode(320,240,32,0);
20+
21     if (!gSurfaceMain)
22         return -1;
23
24@@ -560,7 +561,8 @@
25     SDL_Surface *pSurfaceText = NULL;
26
27
28- SDL_Flip(gSurfaceMain);
29+ SDL_BlitSurface(gSurfaceMain,NULL,gRealScreen,NULL);
30+ SDL_Flip(gRealScreen);
31
32     i = 0;
33     quit_flag = 0;
34@@ -612,8 +614,10 @@
35                 app_make_time(&lctm);
36             }
37
38- SDL_Flip(gSurfaceMain);
39- SDL_Flip(gSurfaceMain); // seems double buffer
40+ SDL_BlitSurface(gSurfaceMain,NULL,gRealScreen,NULL);
41+ SDL_Flip(gRealScreen);
42+ SDL_Flip(gRealScreen);
43+
44             update_flag = 0;
45         }
46

Archive Download the corresponding diff file



interactive