Mercurial > hg > forks > pwpunix
comparison pwplib/sdl.c @ 40:32559c69f6e5
Cosmetics.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Mon, 24 May 2010 02:55:17 +0300 |
parents | d83239a98d1e |
children | ea44e1d9eb7c |
comparison
equal
deleted
inserted
replaced
39:f17a3dc38f2a | 40:32559c69f6e5 |
---|---|
18 #define PWP_NCOLORS 256 | 18 #define PWP_NCOLORS 256 |
19 | 19 |
20 struct { | 20 struct { |
21 int width, height, vflags; | 21 int width, height, vflags; |
22 SDL_Surface *screen; | 22 SDL_Surface *screen; |
23 SDL_Color cols[PWP_NCOLORS]; | 23 SDL_Color pal[PWP_NCOLORS]; |
24 Uint32 lookup[256]; | 24 Uint32 lookup[PWP_NCOLORS]; |
25 } pwp_SDL; | 25 } pwp_SDL; |
26 | 26 |
27 | 27 |
28 static void pwp_SDL_dump_rast_4x4() | 28 static void pwp_SDL_dump_rast_4x4() |
29 { | 29 { |
128 /* Generate palette and rasterization lookup table */ | 128 /* Generate palette and rasterization lookup table */ |
129 for (i = 0; i < PWP_NCOLORS; i++) | 129 for (i = 0; i < PWP_NCOLORS; i++) |
130 { | 130 { |
131 int r, g, b; | 131 int r, g, b; |
132 rast2rgb(i, 255, &r, &g, &b); | 132 rast2rgb(i, 255, &r, &g, &b); |
133 pwp_SDL.cols[i].r = r; | 133 pwp_SDL.pal[i].r = r; |
134 pwp_SDL.cols[i].g = g; | 134 pwp_SDL.pal[i].g = g; |
135 pwp_SDL.cols[i].b = b; | 135 pwp_SDL.pal[i].b = b; |
136 pwp_SDL.lookup[i] = i | (i << 8) | (i << 16) | (i << 24); | 136 pwp_SDL.lookup[i] = i | (i << 8) | (i << 16) | (i << 24); |
137 } | 137 } |
138 SDL_SetColors(pwp_SDL.screen, pwp_SDL.cols, 0, PWP_NCOLORS); | 138 SDL_SetColors(pwp_SDL.screen, pwp_SDL.pal, 0, PWP_NCOLORS); |
139 | 139 |
140 pwpwrite("* SDL video (%d x %d, pitch=%d)\n", pwp_SDL.screen->w, pwp_SDL.screen->h, pwp_SDL.screen->pitch); | 140 pwpwrite("* SDL video (%d x %d, pitch=%d)\n", pwp_SDL.screen->w, pwp_SDL.screen->h, pwp_SDL.screen->pitch); |
141 | 141 |
142 return 1; | 142 return 1; |
143 } | 143 } |