comparison render_sdl.c @ 230:d3266cee02c9

Implemented shadow hilight mode.
author Mike Pavone <pavone@retrodev.com>
date Mon, 22 Apr 2013 19:39:38 -0700
parents d60837a7d18a
children f456ee23d372
comparison
equal deleted inserted replaced
229:d60837a7d18a 230:d3266cee02c9
32 fprintf(stderr, "BlastEm requires at least a 16-bit surface, SDL returned a %d-bit surface\n", screen->format->BytesPerPixel * 8); 32 fprintf(stderr, "BlastEm requires at least a 16-bit surface, SDL returned a %d-bit surface\n", screen->format->BytesPerPixel * 8);
33 exit(1); 33 exit(1);
34 } 34 }
35 uint8_t b,g,r; 35 uint8_t b,g,r;
36 for (uint16_t color = 0; color < (1 << 12); color++) { 36 for (uint16_t color = 0; color < (1 << 12); color++) {
37 b = levels[(color >> 8) & 0xE]; 37 if (color & FBUF_SHADOW) {
38 g = levels[(color >> 4) & 0xE]; 38 b = levels[(color >> 9) & 0x7];
39 r = levels[color & 0xE]; 39 g = levels[(color >> 5) & 0x7];
40 r = levels[(color >> 1) & 0x7];
41 } else if(color & FBUF_HILIGHT) {
42 b = levels[((color >> 9) & 0x7) + 7];
43 g = levels[((color >> 5) & 0x7) + 7];
44 r = levels[((color >> 1) & 0x7) + 7];
45 } else {
46 b = levels[(color >> 8) & 0xE];
47 g = levels[(color >> 4) & 0xE];
48 r = levels[color & 0xE];
49 }
40 color_map[color] = SDL_MapRGB(screen->format, r, g, b); 50 color_map[color] = SDL_MapRGB(screen->format, r, g, b);
41 } 51 }
42 min_delay = 0; 52 min_delay = 0;
43 for (int i = 0; i < 20; i++) { 53 for (int i = 0; i < 20; i++) {
44 uint32_t start = SDL_GetTicks(); 54 uint32_t start = SDL_GetTicks();