Changeset - r15515:db92a54a178e
[Not reviewed]
master
0 5 0
rubidium - 14 years ago 2010-07-19 15:51:06
rubidium@openttd.org
(svn r20184) -Codechange: make _trees_tick_ctr and _disaster_delay not use VARDEF and put them in a more logical location
5 files changed with 9 insertions and 6 deletions:
0 comments (0 inline, 0 general)
src/disaster_cmd.cpp
Show inline comments
 
@@ -39,24 +39,27 @@
 
#include "vehicle_func.h"
 
#include "sound_func.h"
 
#include "effectvehicle_func.h"
 
#include "roadveh.h"
 
#include "ai/ai.hpp"
 
#include "company_base.h"
 
#include "core/random_func.hpp"
 
#include "core/backup_type.hpp"
 

	
 
#include "table/strings.h"
 
#include "table/sprites.h"
 

	
 
/** Delay counter for considering the next disaster. */
 
uint16 _disaster_delay;
 

	
 
enum DisasterSubType {
 
	ST_ZEPPELINER,
 
	ST_ZEPPELINER_SHADOW,
 
	ST_SMALL_UFO,
 
	ST_SMALL_UFO_SHADOW,
 
	ST_AIRPLANE,
 
	ST_AIRPLANE_SHADOW,
 
	ST_HELICOPTER,
 
	ST_HELICOPTER_SHADOW,
 
	ST_HELICOPTER_ROTORS,
 
	ST_BIG_UFO,
 
	ST_BIG_UFO_SHADOW,
src/saveload/misc_sl.cpp
Show inline comments
 
@@ -17,24 +17,26 @@
 
#include "../vehicle_func.h"
 
#include "../window_gui.h"
 
#include "../window_func.h"
 
#include "../viewport_func.h"
 
#include "../gfx_func.h"
 
#include "../company_base.h"
 
#include "../core/random_func.hpp"
 
#include "../fios.h"
 

	
 
#include "saveload.h"
 

	
 
extern TileIndex _cur_tileloop_tile;
 
extern uint16 _disaster_delay;
 
extern byte _trees_tick_ctr;
 

	
 
/* Keep track of current game position */
 
int _saved_scrollpos_x;
 
int _saved_scrollpos_y;
 
ZoomLevelByte _saved_scrollpos_zoom;
 

	
 
void SaveViewportBeforeSaveGame()
 
{
 
	const Window *w = FindWindowById(WC_MAIN_WINDOW, 0);
 

	
 
	if (w != NULL) {
 
		_saved_scrollpos_x = w->viewport->scrollpos_x;
src/saveload/oldloader_sl.cpp
Show inline comments
 
@@ -1543,24 +1543,26 @@ static bool LoadTTDPatchExtraChunks(Load
 

	
 
			default:
 
				DEBUG(oldloader, 4, "Skipping unknown extra chunk %X", id);
 
				while (len-- != 0) ReadByte(ls);
 
				break;
 
		}
 
	}
 

	
 
	return !ls->failed;
 
}
 

	
 
extern TileIndex _cur_tileloop_tile;
 
extern uint16 _disaster_delay;
 
extern byte _trees_tick_ctr;
 
static const OldChunks main_chunk[] = {
 
	OCL_ASSERT( OC_TTD, 0 ),
 
	OCL_ASSERT( OC_TTO, 0 ),
 
	OCL_VAR ( OC_FILE_U16 | OC_VAR_U32, 1, &_date ),
 
	OCL_VAR ( OC_UINT16,   1, &_date_fract ),
 
	OCL_NULL( 600 ),            ///< TextEffects
 
	OCL_VAR ( OC_UINT32,   2, &_random.state ),
 

	
 
	OCL_ASSERT( OC_TTD, 0x264 ),
 
	OCL_ASSERT( OC_TTO, 0x264 ),
 

	
 
	OCL_CCHUNK( OC_TTD, 70, LoadOldTown ),
src/tree_cmd.cpp
Show inline comments
 
@@ -43,24 +43,26 @@ enum TreePlacer {
 
	TP_NONE,     ///< No tree placer algorithm
 
	TP_ORIGINAL, ///< The original algorithm
 
	TP_IMPROVED, ///< A 'improved' algorithm
 
};
 

	
 
/** Where to place trees while in-game? */
 
enum ExtraTreePlacement {
 
	ETP_NONE,       ///< Place trees on no tiles
 
	ETP_RAINFOREST, ///< Place trees only on rainforest tiles
 
	ETP_ALL,        ///< Place trees on all tiles
 
};
 

	
 
/** Determines when to consider building more trees. */
 
byte _trees_tick_ctr;
 

	
 
/**
 
 * Tests if a tile can be converted to MP_TREES
 
 * This is true for clear ground without farms or rocks.
 
 *
 
 * @param tile the tile of interest
 
 * @param allow_desert Allow planting trees on CLEAR_DESERT?
 
 * @return true if trees can be built.
 
 */
 
static bool CanPlantTreesOnTile(TileIndex tile, bool allow_desert)
 
{
 
	switch (GetTileType(tile)) {
src/variables.h
Show inline comments
 
@@ -10,30 +10,24 @@
 
/** @file variables.h Messing file that will cease to exist some time in the future. */
 

	
 
#ifndef VARIABLES_H
 
#define VARIABLES_H
 

	
 
#ifndef VARDEF
 
#define VARDEF extern
 
#endif
 

	
 
/* Amount of game ticks */
 
VARDEF uint16 _tick_counter;
 

	
 
/* Also save scrollpos_x, scrollpos_y and zoom */
 
VARDEF uint16 _disaster_delay;
 

	
 
/* Determines how often to run the tree loop */
 
VARDEF byte _trees_tick_ctr;
 

	
 
/* NOSAVE: Used in palette animations only, not really important. */
 
VARDEF int _palette_animation_counter;
 

	
 
VARDEF uint32 _realtime_tick;
 

	
 
VARDEF byte _display_opt;
 

	
 
VARDEF bool _rightclick_emulate;
 

	
 
/* IN/OUT parameters to commands */
 
VARDEF bool _generating_world;
 

	
0 comments (0 inline, 0 general)