View Single Post
Old 02-08-2010, 09:33 PM   #2
Kippesoep
Forum hobbit
 
Kippesoep's Avatar


 
Join Date: Nov 2007
Location: Etten, Netherlands
Posts: 42
Default

It took me a while to find the problem as the code seems messy to me, but the actual root cause is quite simple:

Code:
//This is in the header
char pal57_init[3][769]={ ... }
//that's pal57_init[0], pal57_init[1] and pal57_init[2]

//This makes use of it
for (int i=5; i<8; i++)
{
	memcpy(pcx_palette[i], pal57_init[i], 769);
}
//that's pal57_init[5], pal57_init[6] and pal57_init[7]
//which haven't been defined. The following would work:

for (int i=5; i<8; i++)
{
	memcpy(pcx_palette[i], pal57_init[i-5], 769);
}
Kippesoep is offline                         Send a private message to Kippesoep
Reply With Quote