Skip to content

Commit

Permalink
Fixed the aliasing/confusion between the engine vs game side R_Init r…
Browse files Browse the repository at this point in the history
…outines exhibited under gcc. Renamed the games' R_Init to R_InitRefresh, now called by G_PostInit.
  • Loading branch information
danij committed Dec 15, 2007
1 parent e6d6e6e commit e260c13
Show file tree
Hide file tree
Showing 21 changed files with 18 additions and 29 deletions.
1 change: 0 additions & 1 deletion doomsday/engine/api/dd_api.h
Expand Up @@ -98,7 +98,6 @@ typedef struct {
void (*G_Drawer) (void);
void (*G_Drawer2) (void);
void (*ConsoleBackground) (int *width, int *height);
void (*R_Init) (void);

// Miscellaneous.
void (*MobjThinker) ();
Expand Down
3 changes: 0 additions & 3 deletions doomsday/engine/portable/src/r_main.c
Expand Up @@ -175,9 +175,6 @@ void R_Init(void)
R_InitModels();
R_InitSkyMap();
R_InitTranslationTables();
// Call the game DLL's refresh initialization, if necessary.
if(gx.R_Init)
gx.R_Init();
Rend_Init();
frameCount = 0;
R_InitViewBorder();
Expand Down
3 changes: 3 additions & 0 deletions doomsday/plugins/common/src/g_game.c
Expand Up @@ -509,6 +509,9 @@ void G_PreInit(void)
*/
void G_PostInit(void)
{
Con_Message("R_InitRefresh: Loading data for referesh.\n");
R_InitRefresh();

// Init the save system and create the game save directory
SV_Init();

Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/common/src/g_update.c
Expand Up @@ -151,7 +151,7 @@ void G_UpdateState(int step)

case DD_POST:
G_RestoreState();
R_Init();
R_InitRefresh();
P_Init();
//// \fixme Detect gamemode changes (GM_DOOM -> GM_DOOM2, for instance).
#if !__JHEXEN__
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/doom64tc/include/doomdef.h
Expand Up @@ -283,7 +283,7 @@ void G_IdentifyVersion(void);
int G_GetInteger(int id);
void *G_GetVariable(int id);

void R_Init(void);
void R_InitRefresh(void);
void R_SetViewSize(int blocks, int detail);

#endif
2 changes: 0 additions & 2 deletions doomsday/plugins/doom64tc/src/d_api.c
Expand Up @@ -45,7 +45,6 @@
// Initialization
void D_PreInit(void);
void D_PostInit(void);
void R_Init(void);

// Timeing loop
void D_Ticker(timespan_t ticLength);
Expand Down Expand Up @@ -215,7 +214,6 @@ game_export_t *GetGameAPI(game_import_t *imports)
#undef Get
gx.GetInteger = G_GetInteger;
gx.GetVariable = G_GetVariable;
gx.R_Init = R_Init;

gx.NetServerStart = D_NetServerStarted;
gx.NetServerStop = D_NetServerClose;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/doom64tc/src/d_refresh.c
Expand Up @@ -103,7 +103,7 @@ static void initTranslation(void)
}
}

void R_Init(void)
void R_InitRefresh(void)
{
initTranslation();
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jdoom/include/doomdef.h
Expand Up @@ -258,7 +258,7 @@ void G_IdentifyVersion(void);
int G_GetInteger(int id);
void *G_GetVariable(int id);

void R_Init(void);
void R_InitRefresh(void);
void R_SetViewSize(int blocks, int detail);

#endif
2 changes: 0 additions & 2 deletions doomsday/plugins/jdoom/src/d_api.c
Expand Up @@ -45,7 +45,6 @@
// Initialization
void D_PreInit(void);
void D_PostInit(void);
void R_Init(void);

// Timeing loop
void D_Ticker(timespan_t ticLength);
Expand Down Expand Up @@ -215,7 +214,6 @@ game_export_t *GetGameAPI(game_import_t * imports)
#undef Get
gx.GetInteger = G_GetInteger;
gx.GetVariable = G_GetVariable;
gx.R_Init = R_Init;

gx.NetServerStart = D_NetServerStarted;
gx.NetServerStop = D_NetServerClose;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jdoom/src/d_refresh.c
Expand Up @@ -105,7 +105,7 @@ static void initTranslation(void)
}
}

void R_Init(void)
void R_InitRefresh(void)
{
initTranslation();
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jheretic/include/doomdef.h
Expand Up @@ -300,7 +300,7 @@ void G_IdentifyVersion(void);
int G_GetInteger(int id);
void *G_GetVariable(int id);

void R_Init(void);
void R_InitRefresh(void);
void R_SetViewSize(int blocks, int detail);

// Most damage defined using HITDICE
Expand Down
2 changes: 0 additions & 2 deletions doomsday/plugins/jheretic/src/h_api.c
Expand Up @@ -56,7 +56,6 @@
// Initialization
void H_PreInit(void);
void H_PostInit(void);
void R_Init(void);

// Timeing loop
void H_Ticker(timespan_t ticLength);
Expand Down Expand Up @@ -231,7 +230,6 @@ game_export_t *GetGameAPI(game_import_t *imports)
#undef Get
gx.GetInteger = G_GetInteger;
gx.GetVariable = G_GetVariable;
gx.R_Init = R_Init;

gx.NetServerStart = D_NetServerStarted;
gx.NetServerStop = D_NetServerClose;
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jheretic/src/h_refresh.c
Expand Up @@ -109,7 +109,7 @@ static void initTranslation(void)
}
}

void R_Init(void)
void R_InitRefresh(void)
{
initTranslation();
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jhexen/include/h2def.h
Expand Up @@ -372,7 +372,7 @@ void H2_Main(void);
void G_IdentifyVersion(void);
void R_SetFilter(int filter);
int R_GetFilterColor(int filter);
void R_Init(void);
void R_InitRefresh(void);

int G_GetInteger(int id);
void *G_GetVariable(int id);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jhexen/src/hrefresh.c
Expand Up @@ -109,7 +109,7 @@ gamestate_t wipegamestate = GS_DEMOSCREEN;

// CODE --------------------------------------------------------------------

void R_Init(void)
void R_InitRefresh(void)
{
// Nothing to do.
}
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/jhexen/src/p_mapinfo.c
Expand Up @@ -312,7 +312,7 @@ void P_InitMapInfo(void)
}

/**
* Special early initializer needed to start sound before R_Init()
* Special early initializer needed to start sound before R_InitRefresh()
*/
void P_InitMapMusicInfo(void)
{
Expand Down
2 changes: 0 additions & 2 deletions doomsday/plugins/jhexen/src/x_api.c
Expand Up @@ -56,7 +56,6 @@
// Initialization
void H2_PreInit(void);
void H2_PostInit(void);
void R_Init(void);

// Timeing loop
void H2_Ticker(timespan_t ticLength);
Expand Down Expand Up @@ -251,7 +250,6 @@ game_export_t *GetGameAPI(game_import_t *imports)
gx.NetPlayerEvent = D_NetPlayerEvent;
gx.NetWorldEvent = D_NetWorldEvent;
gx.HandlePacket = D_HandlePacket;
gx.R_Init = R_Init;

// The structure sizes.
gx.ticcmd_size = sizeof(ticcmd_t);
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/wolftc/include/doomdef.h
Expand Up @@ -271,7 +271,7 @@ void G_IdentifyVersion(void);
int G_GetInteger(int id);
void *G_GetVariable(int id);

void R_Init(void);
void R_InitRefresh(void);
void R_SetViewSize(int blocks, int detail);

#endif // __DOOMDEF__
2 changes: 0 additions & 2 deletions doomsday/plugins/wolftc/src/d_api.c
Expand Up @@ -45,7 +45,6 @@
// Initialization
void D_PreInit(void);
void D_PostInit(void);
void R_Init(void);

// Timeing loop
void D_Ticker(timespan_t ticLength);
Expand Down Expand Up @@ -215,7 +214,6 @@ game_export_t *GetGameAPI(game_import_t *imports)
#undef Get
gx.GetInteger = G_GetInteger;
gx.GetVariable = G_GetVariable;
gx.R_Init = R_Init;

gx.NetServerStart = D_NetServerStarted;
gx.NetServerStop = D_NetServerClose;
Expand Down
6 changes: 3 additions & 3 deletions doomsday/plugins/wolftc/src/d_main.c
Expand Up @@ -516,9 +516,9 @@ void D_PreInit(void)
G_PreInit();
}

/*
* Post Engine Initialization routine.
* All game-specific actions that should take place at this time go here.
/**
* Post Engine Initialization routine.
* All game-specific actions that should take place at this time go here.
*/
void D_PostInit(void)
{
Expand Down
2 changes: 1 addition & 1 deletion doomsday/plugins/wolftc/src/d_refresh.c
Expand Up @@ -104,7 +104,7 @@ static void initTranslation(void)
}
}

void R_Init(void)
void R_InitRefresh(void)
{
initTranslation();
}
Expand Down

0 comments on commit e260c13

Please sign in to comment.