Skip to content

Commit

Permalink
Refactor: Moved translation tables to resource/colorpalettes.cpp/h
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Nov 26, 2012
1 parent 63782ff commit 381250f
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 25 deletions.
10 changes: 0 additions & 10 deletions doomsday/engine/include/resource/r_data.h
Expand Up @@ -44,11 +44,6 @@ extern "C" {
struct texture_s;
struct font_s;

// Maximum number of palette translation tables.
#define NUM_TRANSLATION_CLASSES 3
#define NUM_TRANSLATION_MAPS_PER_CLASS 7
#define NUM_TRANSLATION_TABLES (NUM_TRANSLATION_CLASSES * NUM_TRANSLATION_MAPS_PER_CLASS)

// Flags for material decorations.
#define DCRF_NO_IWAD 0x1 // Don't use if from IWAD.
#define DCRF_PWAD 0x2 // Can use if from PWAD.
Expand Down Expand Up @@ -158,14 +153,9 @@ typedef struct {
extern int levelFullBright;

extern byte precacheMapMaterials, precacheSprites, precacheSkins;

extern byte* translationTables;

extern int gameDataFormat;

void R_UpdateData(void);
void R_InitTranslationTables(void);
void R_UpdateTranslationTables(void);

void R_InitSystemTextures(void);
void R_InitPatchComposites(void);
Expand Down
15 changes: 0 additions & 15 deletions doomsday/engine/src/resource/r_data.c
Expand Up @@ -73,8 +73,6 @@ byte precacheSkins = true;
byte precacheMapMaterials = true;
byte precacheSprites = true;

byte* translationTables = NULL;

int gameDataFormat; // Use a game-specifc data format where applicable.

// PRIVATE DATA DEFINITIONS ------------------------------------------------
Expand Down Expand Up @@ -1550,19 +1548,6 @@ void R_UpdateData(void)
R_UpdateRawTexs();
}

void R_InitTranslationTables(void)
{
// The translation tables consist of a number of translation maps, each
// containing 256 palette indices.
translationTables = Z_Calloc(NUM_TRANSLATION_TABLES * 256, PU_REFRESHTRANS, 0);
}

void R_UpdateTranslationTables(void)
{
Z_FreeTags(PU_REFRESHTRANS, PU_REFRESHTRANS);
R_InitTranslationTables();
}

/**
* @return @c true, if the given light decoration definition
* is valid.
Expand Down

0 comments on commit 381250f

Please sign in to comment.