spritecache.cpp File Reference

#include "stdafx.h"
#include "openttd.h"
#include "variables.h"
#include "debug.h"
#include "spritecache.h"
#include "fileio.h"
#include "spriteloader/grf.hpp"
#include "core/alloc_func.hpp"
#include "core/math_func.hpp"
#include "blitter/factory.hpp"
#include "table/sprites.h"

Go to the source code of this file.

Data Structures

struct  SpriteCache
struct  MemBlock

Defines

#define S_FREE_MASK   1

Functions

static SpriteCache * GetSpriteCache (uint index)
static SpriteCache * AllocateSpriteCache (uint index)
static void CompactSpriteCache ()
 Called when holes in the sprite cache should be removed.
void SkipSpriteData (byte type, uint16 num)
 Skip the given amount of sprite graphics data.
static bool ReadSpriteHeaderSkipData ()
 Read the sprite header data and then skip the real payload.
bool SpriteExists (SpriteID id)
void * AllocSprite (size_t)
static void * ReadSprite (SpriteCache *sc, SpriteID id, bool real_sprite)
bool LoadNextSprite (int load_index, byte file_slot, uint file_sprite_id)
void DupSprite (SpriteID old_spr, SpriteID new_spr)
static MemBlock * NextBlock (MemBlock *block)
static uint32 GetSpriteCacheUsage ()
void IncreaseSpriteLRU ()
static void DeleteEntryFromSpriteCache ()
const void * GetRawSprite (SpriteID sprite, bool real_sprite)
void GfxInitSpriteMem ()

Variables

uint _sprite_cache_size = 4
static uint _spritecache_items = 0
static SpriteCache * _spritecache = NULL
static uint _sprite_lru_counter
static MemBlock * _spritecache_ptr
static int _compact_cache_counter


Detailed Description

Definition in file spritecache.cpp.


Function Documentation

static void CompactSpriteCache (  )  [static]

Called when holes in the sprite cache should be removed.

That is accomplished by moving the cached data.

Definition at line 349 of file spritecache.cpp.

static bool ReadSpriteHeaderSkipData (  )  [static]

Read the sprite header data and then skip the real payload.

Returns:
true if the sprite is a pseudo sprite.

Definition at line 104 of file spritecache.cpp.

References SkipSpriteData().

void SkipSpriteData ( byte  type,
uint16  num 
)

Skip the given amount of sprite graphics data.

Parameters:
type the type of sprite (compressed etc)
num the amount of sprites to skip

Definition at line 80 of file spritecache.cpp.

Referenced by ReadSpriteHeaderSkipData().


Generated on Wed Oct 1 17:03:31 2008 for openttd by  doxygen 1.5.6