OS4 DepotLogo by Alkaron 
(anonymous IP:,2219) 

   Bug tracker
   Locale browser


   o Audio (343)
   o Datatype (51)
   o Demo (203)
   o Development (600)
   o Document (22)
   o Driver (97)
   o Emulation (148)
   o Game (1005)
   o Graphics (499)
   o Library (116)
   o Network (233)
   o Office (66)
   o Utility (927)
   o Video (69)

Total files: 4379

Full index file
Recent index file



Support the site

 Readme for:  Demo » Misc » parallax4.lha


Description: Multilayer parallax SDL demo
Download: parallax4.lha       (TIPS: Use the right click menu if your browser takes you back here all the time)
Size: 258kb
Date: 06 Sep 2005
Author: david@olofson.net (David Olofson), Amiga port by Ventzislav Tzvetkov
Submitter: Ventzislav Tzvetkov
Category: demo/misc
License: GPL
Distribute: yes
Min OS Version: 4.0
FileID: 1012
Comments: 0
Snapshots: 0
Videos: 0
Downloads: 582  (Current version)
581  (Accumulated)
Votes: 0 (0/0)  (30 days/7 days)

Show comments Show snapshots Show videos Show content Show crashlogs Replace file 
 Parallax Scrolling IV - Overdraw Elimination +

    This is the fourth of the SDL scrolling
    examples, and uses an improved version
    of the recursive overdraw eliminating
    algorithm from Parallax Scrolling III.

Just as Parallax Scrolling III, this version
renders the screen from front to back, adjusting
the target surface clip rectangle to keep the
"underlying" graphics from covering the areas
already rendered.

The difference is that instead of working with
one tile at a time (which results in lots of
recursions and clipping overhead), this version
looks ahead, and processes runs of similar tiles
in "batches". Only one recursive call per run is
required, as opposed to one per tile.

Just as before, there are three classes of tiles;

  1. Fully opaque.
 Very simple: The tile is drawn as defined
 in the map data, and no further action is
 taken. This case terminates recursion.

  2. Fully transparent.
 Recursion is done in order to render the
 next layer. No further action is taken.

  3. Partially transparent.
 Recursion to the next layer is done as for
 case 2. Then the color keyed or blended
 tile is rendered on top of the result,
 after the recursive call chain returns.

The "run detector" treats 2 and 3 the same, so
there are effectively only two kinds of runs;
opaque runs (that terminate recursion), and
partially transparent runs (containing both empty
and partially transparent tiles), which requires
a recursive call to the underlying layer(s)
before being rendered.

This version scales *much* better than Parallax
Scrolling III, but honestly, it still sucks.
Some day, I'm probably going to go all the way,
and create a heavily optimized version, with all
the hairiness you could expect from such a beast.

Or why not try to beat me to it? ;-)

The program supports a few command line options:

 -f Fullscreen
 -d Double buffer
 -<n> Depth = <n> bits
 -l<n> Use <n> layers (default = 7)
 -b "Bounce-around" mode
 -w Wrap maps instead of bouncing
 -a<n> Alpha for non-opaque tiles = <n>
 -v<n> Verbosity level <n> (default = 0)
 -np Don't use planet layers
 -nr Don't use the "run detector".
 (This makes the algorithm work
 like the previous version; one
 tile at a time.)

 //David Olofson  <david()olofson.net>
        //Ventzislav Tzvetkov http://drhirudo.hit.bg

Copyright © 2004-2024 by Björn Hagström All Rights Reserved