Original Post
ok, i was reading Jim Adam's tutorial so that i can add smooth scolling to my tile engine...and im not sure that i understand it all that well. here's my code (sorry that its so hard to understand)
void draw_map(void)
{
LPDIRECTDRAWSURFACE pdds;
HRESULT ddrval;
RECT mike;
haxor = 1;
for(int blah_y = 0; blah_y < 16; blah_y++)
{
for(int blah_x = 0; blah_x < 16; blah_x++)
{
offset_y = tile_y & 15;
offset_x = tile_x & 15;
mike.top = blah_y * 22 - offset_y;
mike.left = blah_x * 22 - offset_x;
mike.right = 44;
mike.bottom = 44;
pdds = lpddstiles[map[pos_y + blah_y][pos_x + blah_x]];
ddrval = lpddsback->BltFast(tile_x, tile_y, pdds, &mike, DDBLTFAST_SRCCOLORKEY);
tile_x = tile_x + 44;
}
if(haxor == 1)
{
tile_y = tile_y + 22;
tile_x = 22;
}
if(haxor == 2)
{
tile_y = tile_y + 22;
tile_x = 0;
}
if(haxor == 1) { haxor = 2; }
else haxor = 1;
}
tile_x = 0;
tile_y = 0;
}
well, as you could have guessed, its not working all of that well. i get messed-up results each time i try to change anything.
i know that i'm right on the edge of getting this right...there must be somthing that i'm incorrectly calculating.
any ideas?
(btw, the haxor integer is for my isometric stuff, so ignore it)
Edited by - gameprogrammerwiz on 7/2/00 11:52:28 AM