PDA

View Full Version : Flickering



krayhze
27-09-2003, 05:34 PM
Hi

I'm doing in delphix a game with tiles. My problem is:
When I move the map in any direction, the map has to be redraw , and when I'm moving the map I note a flickering (maybe because redraw takes some time) and a distorcion of a map. It isnt very good to see that distorcion so,
what can I do to resolve this problem?








:oops: Sorry my bad english :?

anubis79
27-09-2003, 05:48 PM
Hi

I'm doing in delphix a game with tiles. My problem is:
When I move the map in any direction, the map has to be redraw , and when I'm moving the map I note a flickering (maybe because redraw takes some time) and a distorcion of a map. It isnt very good to see that distorcion so,
what can I do to resolve this problem?

Are you working on Fullscreen mode. So for Fastest and Best graphical output try that :
DXDraw1.Options := DXDraw1.Options + [DoFlip];

Avatar
27-09-2003, 07:09 PM
I guess you're rendering the whole map each refresh.

If you're using an array(I'm sure you're using an array ^^) Just try to find, which tiles to render, this will speed up the render :)

To find which one you have to render is quite easy, just get your position in the world, then divide it by the width/height of your tiles, do the same adding to the base value widht/height of the screen, and you'll have the rectangle of tiles you have to render !

I'm not sure I'm clear ^^ Let me know if you don't understand, I'll try to give you a piece of code !

Bye
Avatar

Alimonster
28-09-2003, 11:49 AM
I guess you're rendering the whole map each refresh.

If you're using an array(I'm sure you're using an array ^^) Just try to find, which tiles to render, this will speed up the render :)

To find which one you have to render is quite easy, just get your position in the world, then divide it by the width/height of your tiles, do the same adding to the base value widht/height of the screen, and you'll have the rectangle of tiles you have to render !

I'm not sure I'm clear ^^ Let me know if you don't understand, I'll try to give you a piece of code !

Bye
Avatar
Here's a [url=http://terraqueous.f2o.org/dgdev/viewtopic.php?t=352]] to another thread where this (drawing only the visible parts of the map) was discussed, which may save you some coding time ;),

Avatar
28-09-2003, 12:19 PM
lol right ;)

krayhze
28-09-2003, 02:49 PM
Now it is much better.
Thanks =)