Mail Archives: djgpp/1997/12/30/16:45:39
> Inside the constructor...
>
> > /* clear the array */
> > for(y=0;y<Y_SIZE;y++)
> > for(x=0;x<X_SIZE;x++)
> > *(tile_data + (y * Y_SIZE) + x) = 0;
>
> Each line is X_SIZE in width... so why are you multipling the Y
> coordinate by the number of lines (Y_SIZE) rather than the width of each
> line? (X_SIZE) :-)
Oh.. OH.. OH... (font_size += 9.87654321) *OH* heh, man.. why is the
obvious always so !obvious. 8-)
>
> for(y=0;y<Y_SIZE;y++) {
> for(x=0;x<X_SIZE;x++) {
> printf("%d",*(tile_data+(y*X_SIZE)+x));
> }// ^^^^^^^^ <--- note!
> printf("\n");
> }
Okay, got it =)
>
> As an alternative approach, which would leave out all that
<snip!>
> which has the advantage of being much easier to read!
>
Thank you!,
/Jonas
- Raw text -