Archived

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

soehrimnir

scrolling and large objects

Recommended Posts

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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...

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
So, what should the code look like after? Which file do you correct?

Share this post


Link to post
Share on other sites