#### Archived

This topic is now archived and is closed to further replies.

# arggh, scrolling question

This topic is 6924 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I''m a little embarassed about asking this question, because it''s pretty simple and I''ve gotten it to work before but now I can''t. Well, in my tile-based, vertically scrolling game, I''ve strayed away from using the clipper and started to modify my RECTS for blitting partial tiles. BTW, TILESIZE = 32;  for (x = 0; x < 21; x++) { for (y = 0; y < 19; y++) { //define the offset //find the correct tile to blit //define the .left and .right of RECT''s //etc, etc, etc. //THIS WORKS CORRECTLY, FOR THE TOP LINE if (y == 0) { tile_area_source.top = off_y; tile_area_source.bottom = TILESIZE; lpddssecondary->BltFast(x * TILESIZE, 0, lpddsoffscreentiles, &tile_area_source, DDBLTFAST_SRCCOLORKEY); } //THIS DOES NOT WORK, BOTTOM LINE OF TILES if (y == 18) { tile_area_source.top = 0; tile_area_source.bottom = off_y; lpddssecondary->BltFast(x * TILESIZE, 18 * TILESIZE, lpddsoffscreentiles, &tile_area_source, DDBLTFAST_SRCCOLORKEY); }  I have a feeling that I''m setting up the RECT''s correctly, but I''m just blitting the row to the wrong position. Thanks, Martin

##### Share on other sites
Hi!

In wich resolution are you in? 18*32 will be y=576, adding
32 will result in 608. If you have set up your surface to
800*600 or 640*480, this tile will go out of range in y.
A good idea is to assign a DDClipper to the destination
surface (or clip the last line of tiles yourself), that will prevent the blitter from writing outside the surface and make the program to crash.
And another thing! When the clipper is attached, use the
ordinary blt function instead to make it work!

Hope this helps!

/ Tooon

• 15
• 13
• 35
• 39