Move GRF global var init to common function
This commit is contained in:
@@ -160,6 +160,15 @@ void CheckExternalFiles()
|
|||||||
if (add_pos != error_msg) ShowInfoF("%s", error_msg);
|
if (add_pos != error_msg) ShowInfoF("%s", error_msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void InitGRFGlobalVars()
|
||||||
|
{
|
||||||
|
extern uint _extra_station_names_used;
|
||||||
|
_extra_station_names_used = 0;
|
||||||
|
|
||||||
|
extern uint8 _extra_station_names_probability;
|
||||||
|
_extra_station_names_probability = 0;
|
||||||
|
}
|
||||||
|
|
||||||
/** Actually load the sprite tables. */
|
/** Actually load the sprite tables. */
|
||||||
static void LoadSpriteTables()
|
static void LoadSpriteTables()
|
||||||
{
|
{
|
||||||
@@ -228,11 +237,7 @@ static void LoadSpriteTables()
|
|||||||
/* Initialize the unicode to sprite mapping table */
|
/* Initialize the unicode to sprite mapping table */
|
||||||
InitializeUnicodeGlyphMap();
|
InitializeUnicodeGlyphMap();
|
||||||
|
|
||||||
extern uint _extra_station_names_used;
|
InitGRFGlobalVars();
|
||||||
_extra_station_names_used = 0;
|
|
||||||
|
|
||||||
extern uint8 _extra_station_names_probability;
|
|
||||||
_extra_station_names_probability = 0;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Load the base and extra NewGRF with OTTD required graphics as first NewGRF.
|
* Load the base and extra NewGRF with OTTD required graphics as first NewGRF.
|
||||||
|
@@ -98,10 +98,9 @@ void InitializeGame(uint size_x, uint size_y, bool reset_date, bool reset_settin
|
|||||||
_game_load_date_fract = 0;
|
_game_load_date_fract = 0;
|
||||||
_game_load_tick_skip_counter = 0;
|
_game_load_tick_skip_counter = 0;
|
||||||
_game_load_time = 0;
|
_game_load_time = 0;
|
||||||
_extra_station_names_used = 0;
|
|
||||||
_extra_station_names_probability = 0;
|
|
||||||
_extra_aspects = 0;
|
_extra_aspects = 0;
|
||||||
_aspect_cfg_hash = 0;
|
_aspect_cfg_hash = 0;
|
||||||
|
InitGRFGlobalVars();
|
||||||
_loadgame_DBGL_data.clear();
|
_loadgame_DBGL_data.clear();
|
||||||
if (reset_settings) MakeNewgameSettingsLive();
|
if (reset_settings) MakeNewgameSettingsLive();
|
||||||
|
|
||||||
|
@@ -441,4 +441,6 @@ struct GrfSpecFeatureRef {
|
|||||||
const char *GetFeatureString(GrfSpecFeatureRef feature);
|
const char *GetFeatureString(GrfSpecFeatureRef feature);
|
||||||
const char *GetFeatureString(GrfSpecFeature feature);
|
const char *GetFeatureString(GrfSpecFeature feature);
|
||||||
|
|
||||||
|
void InitGRFGlobalVars();
|
||||||
|
|
||||||
#endif /* NEWGRF_H */
|
#endif /* NEWGRF_H */
|
||||||
|
@@ -485,10 +485,9 @@ static void ShutdownGame()
|
|||||||
_game_load_date_fract = 0;
|
_game_load_date_fract = 0;
|
||||||
_game_load_tick_skip_counter = 0;
|
_game_load_tick_skip_counter = 0;
|
||||||
_game_load_time = 0;
|
_game_load_time = 0;
|
||||||
_extra_station_names_used = 0;
|
|
||||||
_extra_station_names_probability = 0;
|
|
||||||
_extra_aspects = 0;
|
_extra_aspects = 0;
|
||||||
_aspect_cfg_hash = 0;
|
_aspect_cfg_hash = 0;
|
||||||
|
InitGRFGlobalVars();
|
||||||
_loadgame_DBGL_data.clear();
|
_loadgame_DBGL_data.clear();
|
||||||
_loadgame_DBGC_data.clear();
|
_loadgame_DBGC_data.clear();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user