gfxinit.cpp File Reference

Initializing of the (GRF) graphics. More...

#include "stdafx.h"
#include "fios.h"
#include "newgrf.h"
#include "3rdparty/md5/md5.h"
#include "fontcache.h"
#include "gfx_func.h"
#include "base_media_func.h"
#include "table/sprites.h"
#include "table/palette_convert.h"
#include "table/landscape_sprite.h"

Go to the source code of this file.

Defines

#define SET_TYPE   "graphics"

Functions

static uint LoadGrfFile (const char *filename, uint load_index, int file_index)
static void LoadSpritesIndexed (int file_index, uint *sprite_id, const SpriteID *index_tbl)
static void LoadGrfIndexed (const char *filename, const SpriteID *index_tbl, int file_index)
void CheckExternalFiles ()
 Checks whether the MD5 checksums of the files are correct.
static void LoadSpriteTables ()
void GfxLoadSprites ()
void UpdateNewGRFConfigPalette ()
 Update the palettes of the graphics from the config file.

Variables

PaletteType _use_palette = PAL_AUTODETECT
 The currently used palette.
bool _palette_remap_grf [MAX_FILE_SLOTS]
 Whether the given NewGRFs must get a palette remap or not.
const byte * _palette_remap = NULL
 Palette map to go from the !_use_palette to the _use_palette.
const byte * _palette_reverse_remap = NULL
 Palette map to go from the _use_palette to the !_use_palette.
static const SpriteID *const _landscape_spriteindexes []
static const char *const _graphics_file_names [] = { "base", "logos", "arctic", "tropical", "toyland", "extra" }
 Names corresponding to the GraphicsFileType.

Detailed Description

Initializing of the (GRF) graphics.

Definition in file gfxinit.cpp.


Function Documentation

void CheckExternalFiles (  ) 
void UpdateNewGRFConfigPalette (  ) 

Update the palettes of the graphics from the config file.

This is needed because the config file gets read and parsed before the palette is chosen (one can configure the base graphics set governing the palette in the config after all). As a result of this we update the settings from the config once we have determined the palette.

Definition at line 274 of file newgrf_config.cpp.

References GRFConfig::next.

Referenced by BaseGraphics::DeterminePalette().


Variable Documentation

const SpriteID* const _landscape_spriteindexes[] [static]
Initial value:
 {
  _landscape_spriteindexes_1,
  _landscape_spriteindexes_2,
  _landscape_spriteindexes_3,
}

Definition at line 37 of file gfxinit.cpp.

bool _palette_remap_grf[MAX_FILE_SLOTS]

Whether the given NewGRFs must get a palette remap or not.

Definition at line 29 of file gfxinit.cpp.

Referenced by SpriteLoaderGrf::LoadSprite(), and ReadSprite().


Generated on Thu Apr 14 00:48:26 2011 for OpenTTD by  doxygen 1.6.1