• Advertisement

Archived

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

Got a Problem with the way Graphics are updating

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

If you intended to correct an error in the post then please contact us.

Recommended Posts

Character1 to the SouthWest of the Character2, moved North 1 tile and when this happens it drags half of the Character2 up the screen while the move is being performed. Every move of the charcter is made in 8 little jumps to give the illusion that the character moves smothly, but when two characters are close together, the moving character distorts the stationary one while the move takes place. I have a gut feeling that the problem is beening cause by Unioning both the Unit tilesets together. //CODE ****** //calculate the extent rect RECT rcExtent; CopyRect(&rcExtent,&tsBack.GetTileList()[0].rcDstExt); UnionRect(&rcExtent,&rcExtent,&tsUnit1.GetTileList([0].rcDstExt) ; UnionRect(&rcExtent,&rcExtent,&tsUnit2.GetTileList([0].rcDstExt) ; UnionRect(&rcExtent,&rcExtent,&tsTree.GetTileList( [0].rcDstExt); //union with tree extent I will post other bits of the code if required. Below there is a shot of Character2 who is standing 2 tiles directly above Character1 and when Character2 moves south 1 tile his imagie slides down but also the top half of Character2 image slides down and covers the top of character1. It's all very annoying Thanks for your time Louise [edited by - Louise on April 18, 2002 1:18:18 PM] [edited by - Louise on April 18, 2002 1:22:39 PM]

Share this post


Link to post
Share on other sites
Advertisement
You can''t display an image on the web linked direct from your harddrive (or whatever you drive b: is). You''ll have to get some webspace and upload it to there.

Share this post


Link to post
Share on other sites
will fix it asap...just stick with me for an hour guys

Thanks Louise

Share this post


Link to post
Share on other sites
What is the deal with your image... it''s crashing my Opera browser! This time the page seemed to load OK, but the top half of your top image is kaput.

Share this post


Link to post
Share on other sites
Do you redraw the screen each frame? If you are, I would suggest to add some sort of loop to your program which sorts the characters according to the y coordinate they are on the screen. If you then draw the topmost character, after that the character below that one, and so on, you can be sure no character covers another character while it shouldn''t.

Share this post


Link to post
Share on other sites
No the whole screen does not update all the time only rects that have a change in them update.

Thats why i think it could be some thing got to do with this code
as it is only the images of the units that get messed up every time a unit moves when it is close to another.

The trees graphic never get messed but the unit graphics do!



//calculate the extent rect
RECT rcExtent;
CopyRect(&rcExtent,&tsBack.GetTileList()[0].rcDstExt);
UnionRect(&rcExtent,&rcExtent,&tsUnit1.GetTileList([0].rcDstExt)
;
UnionRect(&rcExtent,&rcExtent,&tsUnit2.GetTileList([0].rcDstExt)
;
UnionRect(&rcExtent,&rcExtent,&tsTree.GetTileList( [0].rcDstExt); //union with tree extent

Thanks Louise

Share this post


Link to post
Share on other sites
EEmmm, No ideas then, i will give the graphics Forum a shot, maybe it would be more in there feild of knowledge.

Thanks for trying.
Louise

[edited by - Louise on April 20, 2002 8:02:20 AM]

Share this post


Link to post
Share on other sites
Don''t know exactly how you calculate your dirty rectangles but if you are moving a rectangle (portion of bitmap) rather than recalculating it, then if your rectangle is large enough to cover bits of the second character.......

Also you say the problem dos not occur with trees, are trees held on the same bitmap as characters, if not then thats the reason assuming the above is correct.

If you are using a different method then just ignore this post. I''m assuming you overlap layers of bitmaps to form the end image.

,Jay

Share this post


Link to post
Share on other sites

  • Advertisement