Skip to main content
GameDev.net gamedev.net
🔒 Locked

scrolling and large objects

Started by soehrimnir Jun 28, 2001 at 3:43 AM 7 replies 1.2k views
Original Post
soehrimnir
soehrimnir
Hello all, I have bought and read the iso book of TANSTAAFL. I used his CRenderer class which has a method ScrollFrame. This method will only update the needed rects when you scroll in a certain direction. Now, I add a large object in my map which is about three tiles high. Then I scroll down, until the building has disappeared. After that I scroll up again to show the building. That''s where the strange thing happens, as you can see on the image: Can anyone tell me what I should do to remove this error. I tried to enlarge the rcUpdate rects but it didn''t matter. I also did an entire repaint of the ScreenSpace and that worked well (CRenderer::AddRect(scroller->GetScreenSpace())). Only my FPS are going down very fast, so that''s not a good solution. thanks
TANSTAAFL
TANSTAAFL
try a larger extent rect.
Get off my lawn!
soehrimnir
soehrimnir
My extent rects seem to be OK. I thought, maybe I implemented the ISO classes wrong, so I run one of your examples (IsoHex17_2.exe). I altered the code a bit so there wouldn''t be trees all over the place and I replaced the tree image with one of the soldier dudes. And guess what: it gives the same problem as in my code when I scroll upwards, the head dissappears or isn''t redrawn again. See the image again:

This time I have put some numbers on it, because I found another interesting fact about this problem. The heads only get cut off when they are positioned in row 1. When you put them in row 2, they are blitted correctly.
TANSTAAFL
TANSTAAFL
weird.

could you send me the code that is giving you those results? i''d like to get to the bottom of what is going on...
Get off my lawn!
TANSTAAFL
TANSTAAFL
actually, i do have an inkling of what is going on... the crenderer may not be going far down enough to properly update very tall sprites/buildings. you may need to move the lower corners of the crenderer scan down by an additional tile.
Get off my lawn!
soehrimnir
soehrimnir
Hey, sorry I reply so late, but I can only go on the internet at work, that means no internet in the weekend.
Anyway, I''ll first try your last suggestion and if it still wouldn''t work, I''ll send you some code.

soehrimnir
soehrimnir
Hey, thank you very much Tan!! You were correct, moving the lowerleft corner southwards was everything you needed to do.

Maybe another question. In the renderer you compute the four corners needed to know what to update. What I don''t understand, is why you compute the lowerrigth corner, since it''s never used later on in the code. Just a question...
TANSTAAFL
TANSTAAFL
true, it doesnt actually get used. when i wrote the code, i did intend for its use, which is why it was calculated. in the end, i only had to test for the bottom left corner, so i didnt really need the bottom right, it just kind of got left in there.
Get off my lawn!

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.