Re: Virtual displaying of images

new topic     » goto parent     » topic index » view thread      » older message » newer message

> Thanks, I'll try your code. The method I want doesn't need to be so
> complex, I'm trying to do a game in the Warcraft style, a background that
> scrolls one tile at a time (not like Command & Conquer, that scrolls pixel
> by pixel). I'm testing to see wich is the best method: Reading a map
> variable and displaying tile by tile the current screen or displaying the
> entire region of the map, like a bitmap.
        Reading a map and only having image data for each different tile in
memory if more memory-friendly and it will not be a lot of speed
difference. Esspecially with win95 or when there is low mem, then the
memory swapping would be so slow that it would make the game
unplayable.

> If I use the last method, I would need a 4096 X 4096 image (if the map size
> if 128 X 128 tiles and each tile is 32 X 32 pixels), but when I fill this
> huge image with the map data, it takes a lot of time using my code.
> I think Warcraft II uses the second method, Am I right ?

        Yes, i think so too, if you want to scroll pixel by pixel you can
have a map of 1 tile horizontally and 1 tile vertically more on a
virtual screen. It would be memory-friendly, smooth scrolling and
fast enough for a 386. (with extensive background processing of AI
and other stuff)

        Anyway, you shouldn't have a large map anyway, memory will be more
of a problem than speed.
        If you want to i can write a fast routine to display the tiles on
the screen, however if you have the code by Micheal Bolin (his
extended memcopy) you don't even have to worry about speed at all.
Just one advise, in mode 19, use allocated memory, in all other
graphics mode you should use 2 or more dimension sequences. (If you
need to cut it in weird pieces a 3-dimensional image (??!!?) can be
a lot faster than a 2-dimensional image)
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
~~~~>> Ralf Nieuwenhuijsen <<~~~~
 ~~~>> nieuwen at xs4all.nl <<~~~~

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu