Skip to content

Commit

Permalink
Fixed: PLAYPAL not loaded early enough during game startup
Browse files Browse the repository at this point in the history
To initialize models the engine needs to know the dimensions of
the sprites they map to. In order to calculate sprite dimensions
the engine needs to prepare them. Thus the color palette used by
the sprite needs to be made available during pre-init, not post.
  • Loading branch information
danij-deng committed Jan 12, 2012
1 parent cf89506 commit cd8ba96
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions doomsday/plugins/common/src/g_game.c
Expand Up @@ -165,6 +165,9 @@ void H2_AdvanceDemo(void);

void G_StopDemo(void);

void R_LoadColorPalettes(void);
void R_LoadVectorGraphics(void);

int Hook_DemoStop(int hookType, int val, void* paramaters);

// PRIVATE FUNCTION PROTOTYPES ---------------------------------------------
Expand Down Expand Up @@ -470,14 +473,15 @@ gameaction_t G_GameAction(void)
*/
void G_CommonPreInit(void)
{
int i, j;

quitInProgress = false;
verbose = ArgExists("-verbose");

// Register hooks.
Plug_AddHook(HOOK_DEMO_STOP, Hook_DemoStop);

// Setup the players.
{ int i, j;
for(i = 0; i < MAXPLAYERS; ++i)
{
player_t* pl = players + i;
Expand All @@ -493,11 +497,15 @@ void G_CommonPreInit(void)
pl->pSprites[j].state = NULL;
pl->plr->pSprites[j].statePtr = NULL;
}
}}
}

G_RegisterBindClasses();
G_RegisterPlayerControls();
P_RegisterMapObjs();

R_LoadVectorGraphics();
R_LoadColorPalettes();

P_InitPicAnims();

// Add our cvars and ccmds to the console databases.
Expand Down Expand Up @@ -833,9 +841,6 @@ void R_InitRefresh(void)
{
VERBOSE( Con_Message("R_InitRefresh: Loading data for referesh.\n") );

R_LoadColorPalettes();
R_LoadVectorGraphics();

// Setup the view border.
cfg.screenBlocks = cfg.setBlocks;
{ Uri* paths[9];
Expand Down

0 comments on commit cd8ba96

Please sign in to comment.