Skip to content

Commit

Permalink
forgot what i did
Browse files Browse the repository at this point in the history
  • Loading branch information
nex committed Mar 16, 2010
1 parent f432668 commit 18cac91
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ static int process_events() {
}

static void display(int* cell, SDL_Surface* screen) {
Uint32 colour[] = {
Uint32 colour[8] = {
SDL_MapRGB(screen->format, 0, 0, 0),
SDL_MapRGB(screen->format, 255, 255, 255),
SDL_MapRGB(screen->format, 255, 0, 0),
Expand All @@ -66,7 +66,7 @@ static void display(int* cell, SDL_Surface* screen) {
for (int x = 0; x < CFG_WIDTH; x++) {
for (int y = 0; y < CFG_HEIGHT; y++) {
Uint32* pixPos = (Uint32 *)screen->pixels + y*screen->pitch/4 + x;
*pixPos = colour[cell[x + 1 + (y + 1) * (CFG_WIDTH + 2)]];
*pixPos = colour[cell[x + 1 + (y + 1) * (CFG_WIDTH + 2)] % 8];
}
}
if (SDL_MUSTLOCK(screen)) SDL_UnlockSurface(screen);
Expand Down Expand Up @@ -176,4 +176,6 @@ int main(int argc, char** argv) {
free(rule);
teardown_sdl();
return EXIT_SUCCESS;
}
}

// http://www.argentum.freeserve.co.uk/lex_l.htm#lidka

0 comments on commit 18cac91

Please sign in to comment.