Changeset - r5340:373ab51af938
[Not reviewed]
master
0 3 0
glx - 17 years ago 2006-12-18 15:34:12
glx@openttd.org
(svn r7506) -Codechange: [NewGRF] Add action 7/9/D variable 0x81 (current year)
3 files changed with 12 insertions and 4 deletions:
0 comments (0 inline, 0 general)
genworld.c
Show inline comments
 
@@ -15,6 +15,7 @@
 
#include "debug.h"
 
#include "settings.h"
 
#include "heightmap.h"
 
#include "date.h"
 

	
 
void GenerateLandscape(byte mode);
 
void GenerateClearTile(void);
 
@@ -252,11 +253,14 @@ void GenerateWorld(int mode, uint size_x
 
	/* Make sure everything is done via OWNER_NONE */
 
	_current_player = OWNER_NONE;
 

	
 
	/* Set the date before loading sprites as some newgrfs check it */
 
	SetDate(ConvertYMDToDate(_patches.starting_year, 0, 1));
 

	
 
	/* Load the right landscape stuff */
 
	GfxLoadSprites();
 
	LoadStringWidthTable();
 

	
 
	InitializeGame(IG_DATE_RESET, _gw.size_x, _gw.size_y);
 
	InitializeGame(IG_NONE, _gw.size_x, _gw.size_y);
 
	PrepareGenerateWorldProgress();
 

	
 
	/* Re-init the windowing system */
newgrf.c
Show inline comments
 
@@ -2193,6 +2193,9 @@ static void GraphicsNew(byte *buf, int l
 
static uint32 GetParamVal(byte param, uint32 *cond_val)
 
{
 
	switch (param) {
 
		case 0x81: /* current year */
 
			return clamp(_cur_year, ORIGINAL_BASE_YEAR, ORIGINAL_MAX_YEAR) - ORIGINAL_BASE_YEAR;
 

	
 
		case 0x83: /* current climate, 0=temp, 1=arctic, 2=trop, 3=toyland */
 
			return _opt.landscape;
 

	
openttd.c
Show inline comments
 
@@ -1164,6 +1164,10 @@ bool AfterLoadGame(void)
 
	/* Check all NewGRFs are present */
 
	if (!IsGoodGRFConfigList()) return false;
 

	
 
	/* Update current year
 
	 * must be done before loading sprites as some newgrfs check it */
 
	SetDate(_date);
 

	
 
	// Load the sprites
 
	GfxLoadSprites();
 
	LoadStringWidthTable();
 
@@ -1175,9 +1179,6 @@ bool AfterLoadGame(void)
 
	/* Connect front and rear engines of multiheaded trains */
 
	ConnectMultiheadedTrains();
 

	
 
	// Update current year
 
	SetDate(_date);
 

	
 
	// reinit the landscape variables (landscape might have changed)
 
	InitializeLandscapeVariables(true);
 

	
0 comments (0 inline, 0 general)