Logo Search packages:      
Sourcecode: freecraft version File versions  Download package

_tileset_ Struct Reference

#include <tileset.h>

List of all members.


Detailed Description

Tileset definition.

#include "tileset.h"

typedef struct _tileset_ Tileset;

This structure contains all informations about the tileset of the map. It defines the look and properties of the tiles. Currently only one tileset pro map is supported. In the future it is planned to support multiple tilesets on the same map. Also is planned to support animated tiles. Currently the tilesize is fixed to 32x32 pixels, to support later other sizes please use always the constants TileSizeX and TileSizeY.

The tileset structure members:

Tileset::Ident

Unique identifier (FE.: tileset-summer, tileset-winter) for the tileset. Used by the map to define which tileset should be used. Like always the identifier should only be used during configuration and not during runtime!

See also:
WorldMap, WorldMap::TerrainName.
Tileset::Class

Identifier for the tileset class. All exchangable tilesets should have the same class. Can be used by the level editor.

Tileset::Name

Long name of the tileset. Can be used by the level editor.

Tileset::File

Name of the graphic file, containing all tiles. Following widths are supported:

Tileset::PaletteFile

Name of the palette file, containing the RGB colors to use as global sytem palette.

See also:
GlobalPalette, VideoSetPalette.
Tileset::NumTiles

The number of different tiles in the tables.

Tileset::Table

Table to map the abstract level (PUD) tile numbers, to tile numbers in the graphic file (Tileset::File). FE. 16 (solid light water) in pud to 328 in png.

Tileset::FlagsTable

Table of the tile flags used by the editor.

See also:
MapField::Flags
Tileset::BasicNameTable

Index to name of the basic tile type. FE. "light-water". If the index is 0, the tile is not used.

See also:
Tileset::TileNames
Tileset::MixedNameTable

Index to name of the mixed tile type. FE. "light-water". If this index is 0, the tile is a solid tile.

See also:
Tileset::TileNames
Tileset::TileTypeTable

Lookup table of the tile type. Maps the graphic file tile number back to a tile type (TileTypeWood, TileTypeWater, ...)

Note:
The creation of this table is currently hardcoded in the engine. It should be calculated from the flags in the tileset configuration (CCL). And it is created for the map and not for the tileset.

I'm not sure if this table is needed in the future.

See also:
TileType.
Tileset::AnimationTable

Contains the animation of tiles.

Note:
This is currently not used.
Tileset::NumNames

Number of different tile names.

Tileset::TileNames

The different tile names. FE "light-grass", "dark-water".

Tileset::ExtraTrees[6]

This are six extra tile numbers, which are needed for lumber chopping.

Tileset::TopOneTree

The tile number of tile only containing the top part of a tree. Is created on the map by lumber chopping.

Tileset::MidOneTree

The tile number of tile only containing the connection of the top part to the bottom part of tree. Is created on the map by lumber chopping.

Tileset::BotOneTree

The tile number of tile only containing the bottom part of a tree. Is created on the map by lumber chopping.

Tileset::RemovedTree

The tile number of the tile placed where trees are removed. Is created on the map by lumber chopping.

Tileset::GrowingTree[2]

Contains the tile numbers of a growing tree from small to big.

Note:
Not yet used.
Tilset::WoodTable[20]

Table for wood removable. This table contains the tile which is placed after a tree removement, depending on the surrounding.

Tileset::MixedLookupTable[MaxTilesInTileset] Table for finding what part of the tile contains wood/rock, and which part is grass or bare ground.

Tileset::ExtraRocks[6]

This are six extra tile numbers, which are needed if rocks are destroyed.

Tileset::TopOneRock

The tile number of tile only containing the top part of a rock. Is created on the map by destroying rocks.

Tileset::MidOneRock

The tile number of tile only containing the connection of the top part to the bottom part of a rock. Is created on the map by destroying rocks.

Tileset::BotOneRock

The tile number of tile only containing the bottom part of a rock. Is created on the map by destroying rocks.

Tileset::RemovedRock

The tile number of the tile placed where rocks are removed. Is created on the map by destroying rocks.

Tileset::RockTable[20]

Table for rock removable. Depending on the surrinding this table contains the new tile to be placed.

Todo:
Johns: I don't think this table or routines look correct. But they work correct.
Tileset::HumanWallTable

Table of human wall tiles, index depends on the surroundings.

Tileset::OrcWallTable

Table of orc wall tiles, index depends on the surroundings.

Tileset::ItemsHash

Hash table of item numbers to unit names.

Definition at line 260 of file tileset.h.


Public Member Functions

 hashtable (char *, 128) ItemsHash
 Orc wall placement table.

Public Attributes

unsigned short * AnimationTable
 For fast lookup of tile type.
unsigned char * BasicNameTable
 Flag table for editor.
unsigned BotOneRock
 Tile for one rock middle.
unsigned BotOneTree
 Tile for one tree middle.
char * Class
 CCL file containing tileset data.
unsigned ExtraRocks [6]
 Lookup for what part of tile used.
unsigned ExtraTrees [6]
 Tile names/types.
char * File
 Tileset identifier.
unsigned short * FlagsTable
 Pud to internal conversion table.
unsigned GrowingTree [2]
 Tile placed where trees are gone.
unsigned HumanWallTable [16]
 Removed rock placement table.
char * Ident
char * ImageFile
 Nice name to display.
unsigned MidOneRock
 Tile for one rock top.
unsigned MidOneTree
 Tile for one tree top.
int MixedLookupTable [MaxTilesInTileset]
 Table for tree removable.
unsigned char * MixedNameTable
 Basic tile name/type.
char * Name
 Class for future extensions.
int NumNames
 Tile animation sequences.
int NumTiles
 File containing the global palette.
unsigned OrcWallTable [16]
 Human wall placement table.
char * PaletteFile
 File containing image data.
int RemovedRock
 Tile for one rock bottom.
int RemovedTree
 Tile for one tree bottom.
int RockTable [20]
 Tile placed where rocks are gone.
unsigned short * Table
 Number of tiles in the tables.
char ** TileNames
 Number of different tile names.
unsigned char * TileTypeTable
 Mixed tile name/type.
unsigned TopOneRock
 Extra rock tiles for removing.
unsigned TopOneTree
 Extra tree tiles for removing.
int WoodTable [20]
 Growing tree tiles.

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

Generated by  Doxygen 1.6.0   Back to index