for following code from tute 4:
does not work, and should read: ( I think, it's the only way I can get it to work
-brendan
yes / no ?
[admin edit: use [ CODE ] blocks for code.. works much better
]
- Code:
int spritexpos = 50;
int spriteypos = 50;
PIXEL* source = spritebuffer;
PIXEL* dst = destination + spritexpos + spriteypos * 240;
for ( int y = 0; y < 20; y++ )
{
for ( int x = 0; x < 20; x++ )
{
PIXEL spritepixel = *spritebuffer++;
if (spritepixel != 0) *dst = spritepixel;
dst++;
}
dst += 220;
}
does not work, and should read: ( I think, it's the only way I can get it to work
- Code:
int spritexpos = 50;
int spriteypos = 50;
PIXEL* source = spritebuffer;
PIXEL* dst = destination + spritexpos + spriteypos * 240;
for ( int y = 0; y < 20; y++ )
{
for ( int x = 0; x < 20; x++ )
{
PIXEL spritepixel = *source++; //error here
if (spritepixel != 0) *dst = spritepixel;
dst++;
}
dst += 220;
}
-brendan
yes / no ?
[admin edit: use [ CODE ] blocks for code.. works much better