PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

I think theres a bug in tute no. 5 (I think)

for following code from tute 4:

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 :)]
your changes seem correct to me:) Haven't read the whole tutorial so I might miss something thru...
Yep, you made the right correction. You got promoted to class B. :)
brendan · 17 Jan 2002, 23:10 UTC — :)
Ohh goodie! ;) is that from class A or C ? ;)

-brendan