sprite.cpp File Reference

Handling of sprites. More...

#include "stdafx.h"
#include "sprite.h"
#include "viewport_func.h"
#include "landscape.h"
#include "spritecache.h"
#include "core/alloc_func.hpp"
#include "core/mem_func.hpp"

Go to the source code of this file.

Functions

void DrawCommonTileSeq (const TileInfo *ti, const DrawTileSprites *dts, TransparencyOption to, int32 orig_offset, uint32 newgrf_offset, PaletteID default_palette, bool child_offset_is_unsigned)
 Draws a tile sprite sequence.
void DrawCommonTileSeqInGUI (int x, int y, const DrawTileSprites *dts, int32 orig_offset, uint32 newgrf_offset, PaletteID default_palette, bool child_offset_is_unsigned)
 Draws a tile sprite sequence in the GUI.
const DrawTileSeqStructCopyDrawTileSeqStruct (const DrawTileSeqStruct *dtss)
 Create a copy of an existing DrawTileSeqStruct array.

Detailed Description

Handling of sprites.

Definition in file sprite.cpp.


Function Documentation

const DrawTileSeqStruct* CopyDrawTileSeqStruct ( const DrawTileSeqStruct dtss  ) 

Create a copy of an existing DrawTileSeqStruct array.

Definition at line 115 of file sprite.cpp.

References foreach_draw_tile_seq, and MemCpyT().

void DrawCommonTileSeq ( const TileInfo ti,
const DrawTileSprites dts,
TransparencyOption  to,
int32  orig_offset,
uint32  newgrf_offset,
PaletteID  default_palette,
bool  child_offset_is_unsigned 
)

Draws a tile sprite sequence.

Parameters:
ti The tile to draw on
dts Sprite and subsprites to draw
to The transparancy bit that toggles drawing of these sprites
orig_offset Sprite-Offset for original sprites
newgrf_offset Sprite-Offset for NewGRF defined sprites
default_palette The default recolour sprite to use (typically company colour)
child_offset_is_unsigned Whether child sprite offsets are interpreted signed or unsigned

Definition at line 31 of file sprite.cpp.

References AddChildSpriteScreen(), AddSortableSpriteToDraw(), DrawTileSeqStruct::delta_x, DrawGroundSprite(), foreach_draw_tile_seq, GB(), HasBit(), IsInvisibilitySet(), IsTransparencySet(), PalSpriteID::pal, PALETTE_MODIFIER_TRANSPARENT, DrawTileSprites::seq, SetBit(), PalSpriteID::sprite, SPRITE_MODIFIER_CUSTOM_SPRITE, SPRITE_MODIFIER_OPAQUE, SPRITE_WIDTH, SpriteLayoutPaletteTransform(), TileInfo::x, TileInfo::y, and TileInfo::z.

Referenced by DrawNewGRFTileSeq(), DrawOrigTileSeq(), and DrawRailTileSeq().

void DrawCommonTileSeqInGUI ( int  x,
int  y,
const DrawTileSprites dts,
int32  orig_offset,
uint32  newgrf_offset,
PaletteID  default_palette,
bool  child_offset_is_unsigned 
)

Draws a tile sprite sequence in the GUI.

Parameters:
x X position to draw to
y Y position to draw to
dts Sprite and subsprites to draw
orig_offset Sprite-Offset for original sprites
newgrf_offset Sprite-Offset for NewGRF defined sprites
default_palette The default recolour sprite to use (typically company colour)
child_offset_is_unsigned Whether child sprite offsets are interpreted signed or unsigned

Definition at line 84 of file sprite.cpp.

References DrawTileSeqStruct::delta_x, DrawSprite(), foreach_draw_tile_seq, GB(), HasBit(), PalSpriteID::pal, RemapCoords(), DrawTileSprites::seq, PalSpriteID::sprite, SPRITE_MASK, SPRITE_MODIFIER_CUSTOM_SPRITE, SPRITE_WIDTH, SpriteLayoutPaletteTransform(), ST_NORMAL, Sprite::x_offs, and Sprite::y_offs.

Referenced by DrawNewGRFTileSeqInGUI(), DrawOrigTileSeqInGUI(), and DrawRailTileSeqInGUI().


Generated on Fri Mar 18 23:17:52 2011 for OpenTTD by  doxygen 1.6.1