Results 1 to 6 of 6

Thread: Flickering

  1. #1

    Flickering

    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?








    ops: Sorry my bad english :?

  2. #2

    Re: Flickering

    Quote Originally Posted by krayhze
    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];

  3. #3

    Flickering

    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

  4. #4

    Flickering

    Quote Originally Posted by Avatar
    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 ,
    "All paid jobs absorb and degrade the mind."
    <br />-- Aristotle

  5. #5

  6. #6

    Flickering

    Now it is much better.
    Thanks =)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •