[SDL] SDL_SetColors (segfault)
Dan
moos at pt.lu
Fri Jan 4 02:17:00 PST 2002
for ( i = 0; i < COLORS; ++i ) {
colors[i].r = white.r + (i*rdiff)/4;
colors[i].r = white.g + (i*gdiff)/4;
colors[i].r = white.b + (i*bdiff)/4;
}
colors[i].r 3 times? copy/paste is bad ;) this could be the problem because
SDL_SetColors could try to access the g and b values but there arent!
for ( i = 0; i < COLORS; ++i ) {
colors[i].r = white.r + (i*rdiff)/4;
colors[i].g = white.g + (i*gdiff)/4;
colors[i].b = white.b + (i*bdiff)/4;
}
could go!
More information about the SDL
mailing list