Complete.Org: Mailing Lists: Archives: freeciv-dev: January 2004:
[Freeciv-Dev] (PR#7297) Caching map canvas
Home

[Freeciv-Dev] (PR#7297) Caching map canvas

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: undisclosed-recipients: ;
Subject: [Freeciv-Dev] (PR#7297) Caching map canvas
From: "Raimar Falke" <i-freeciv-lists@xxxxxxxxxxxxx>
Date: Fri, 23 Jan 2004 11:06:12 -0800
Reply-to: rt@xxxxxxxxxxx

<URL: http://rt.freeciv.org/Ticket/Display.html?id=7297 >


Idea: have a backing store of the size of map which contains the whole
drawn into it.

Purpose: allow fast changing of the mapview origin by just copying
relevant parts of the backing store to the screen in the right places.

You have the problem of wrapping (after the eastmost tile comes the
westmost one). But this is easy for non-iso tilesets. Non-iso tilesets
have another advantage: they have no overlapping between tiles.

For iso tilesets the idea is to have a larger backing store. 9 times
the place required for drawing the complete map. So around the primary
instance of the map in the backing store you place 8 other copies of
it around. At the border you do the correct overlapping drawing.

A little picture for the iso case:


      a                b               c


          +---------------+
      d   |            e  |            f
          |               |
          |               |
          +---------------+
      g                h               i

where the rectangle is the part which is drawn to the screen. And a-i
are the instances of the map.

Advantages:
  - fast change of map origin
  - pixel based position of the view quite easy

Disadvantages:
  - large memory usage
  - updating of a tiles is more expensive in the iso case

        Raimar

-- 
 email: rf13@xxxxxxxxxxxxxxxxx
  A supercomputer is a computer running an endless loop in just a second




[Prev in Thread] Current Thread [Next in Thread]
  • [Freeciv-Dev] (PR#7297) Caching map canvas, Raimar Falke <=