libspades
Ace of Spades library
SpanHeader Struct Reference

A span for the map file format used by ace of spades. More...

Data Fields

uint8_t length
 The amount of 4 byte wide items in the span.
 
uint8_t topColorStart
 
uint8_t topColorEnd
 
uint8_t airStart
 

Detailed Description

A span for the map file format used by ace of spades.

But what is a span supposed to mean to me? Imagine this:

Each X and Y position has a column along the Z axis. A span is like a run-length encoded piece of data for that column. A span can contain any of these:

  • Open air
  • Solid blocks of a certain color
  • Filled (solid but colorless) blocks
  • And some other mysterious kind of colored blocks.

A span also contains how many of the contained block type will occur in a row, to prevent having too many spans. The blocks start from Z=0 and go to Z=63. Once a span is read which extends down to Z=63, the current column is over and the following spans will contain data for the next.

actually the above is wrong for some reason

i think it is more like this air start (air end is top start - 1) (bottom end is air start - 1) (bottom start is air start+(n-topcount)+1) (filled end is next air start-(n-topcount)-1) top start top end (filled start is top end + 1) filled crap bottom stuff

Each span has a header, and contains SpanHeader.length items in it, including the header. Each item is four octets long, and can either be a SpanHeader, or a Vector4Uint8 with blue, green, red and alpha values respectively. The alpha value is mostly unused however, and can be safely ignored.

Field Documentation

◆ length

uint8_t SpanHeader::length

The amount of 4 byte wide items in the span.

This includes the header, and all BGRA color data.


The documentation for this struct was generated from the following file: