Changeset - r15882:30fbd9be7c68
[Not reviewed]
master
0 6 0
rubidium - 14 years ago 2010-08-19 20:58:30
rubidium@openttd.org
(svn r20574) -Codechange: a little over 1 million vehicles should be enough for the forseeable future
6 files changed with 15 insertions and 7 deletions:
0 comments (0 inline, 0 general)
src/ai/api/ai_types.hpp
Show inline comments
 
@@ -94,13 +94,13 @@ typedef OverflowSafeInt64 Money; ///< Mo
 
typedef uint16 SignID;       ///< The ID of a sign.
 
typedef uint16 StationID;    ///< The ID of a station.
 
typedef uint16 StringID;     ///< The ID of a string.
 
typedef uint16 SubsidyID;    ///< The ID of a subsidy.
 
typedef uint32 TileIndex;    ///< The ID of a tile (just named differently).
 
typedef uint16 TownID;       ///< The ID of a town.
 
typedef uint16 VehicleID;    ///< The ID of a vehicle.
 
typedef uint32 VehicleID;    ///< The ID of a vehicle.
 

	
 
/* Types we defined ourself, as the OpenTTD core doesn't have them (yet) */
 
typedef uint AIErrorType;    ///< The types of errors inside the NoAI framework.
 
typedef BridgeType BridgeID; ///< The ID of a bridge.
 

	
 
#endif /* AI_TYPES_HPP */
src/ai/api/ai_vehicle.hpp
Show inline comments
 
@@ -94,13 +94,13 @@ public:
 
		VS_BROKEN,         ///< The vehicle has broken down and will start running again in a while.
 
		VS_CRASHED,        ///< The vehicle is crashed (and will never run again).
 

	
 
		VS_INVALID = 0xFF, ///< An invalid vehicle state.
 
	};
 

	
 
	static const VehicleID VEHICLE_INVALID = 0xFFFF; ///< Invalid VehicleID.
 
	static const VehicleID VEHICLE_INVALID = 0xFFFFF; ///< Invalid VehicleID.
 

	
 
	/**
 
	 * Checks whether the given vehicle is valid and owned by you.
 
	 * @param vehicle_id The vehicle to check.
 
	 * @return True if and only if the vehicle is valid.
 
	 */
src/cargopacket.h
Show inline comments
 
@@ -20,14 +20,14 @@
 
#include <list>
 

	
 
/** Unique identifier for a single cargo packet. */
 
typedef uint32 CargoPacketID;
 
struct CargoPacket;
 

	
 
/** Type of the pool for cargo packets. */
 
typedef Pool<CargoPacket, CargoPacketID, 1024, 1048576, true, false> CargoPacketPool;
 
/** Type of the pool for cargo packets for a little over 16 million packets. */
 
typedef Pool<CargoPacket, CargoPacketID, 1024, 0xFFF000, true, false> CargoPacketPool;
 
/** The actual pool with cargo packets */
 
extern CargoPacketPool _cargopacket_pool;
 

	
 
template <class Tinst> class CargoList;
 
extern const struct SaveLoad *GetCargoPacketDesc();
 

	
src/script/squirrel.hpp
Show inline comments
 
@@ -86,12 +86,18 @@ public:
 
	void AddConst(const char *var_name, int value);
 

	
 
	/**
 
	 * Adds a const to the stack. Depending on the current state this means
 
	 *  either a const to a class or to the global space.
 
	 */
 
	void AddConst(const char *var_name, uint value) { this->AddConst(var_name, (int)value); }
 

	
 
	/**
 
	 * Adds a const to the stack. Depending on the current state this means
 
	 *  either a const to a class or to the global space.
 
	 */
 
	void AddConst(const char *var_name, bool value);
 

	
 
	/**
 
	 * Adds a class to the global scope. Make sure to call AddClassEnd when you
 
	 *  are done adding methods.
 
	 */
 
@@ -123,12 +129,13 @@ public:
 
	 * Tell the VM to do a garbage collection run.
 
	 */
 
	void CollectGarbage();
 

	
 
	void InsertResult(bool result);
 
	void InsertResult(int result);
 
	void InsertResult(uint result) { this->InsertResult((int)result); }
 

	
 
	/**
 
	 * Call a method of an instance, in various flavors.
 
	 * @return False if the script crashed or returned a wrong type.
 
	 */
 
	bool CallMethod(HSQOBJECT instance, const char *method_name, HSQOBJECT *ret, int suspend = -1);
src/vehicle_base.h
Show inline comments
 
@@ -50,13 +50,14 @@ struct VehicleCache {
 
	uint32 cached_var40; ///< Cache for NewGRF var 40
 
	uint32 cached_var41; ///< Cache for NewGRF var 41
 
	uint32 cached_var42; ///< Cache for NewGRF var 42
 
	uint32 cached_var43; ///< Cache for NewGRF var 43
 
};
 

	
 
typedef Pool<Vehicle, VehicleID, 512, 64000> VehiclePool;
 
/** A vehicle pool for a little over 1 million vehicles. */
 
typedef Pool<Vehicle, VehicleID, 512, 0xFF000> VehiclePool;
 
extern VehiclePool _vehicle_pool;
 

	
 
/* Some declarations of functions, so we can make them friendly */
 
struct SaveLoad;
 
extern const SaveLoad *GetVehicleDescription(VehicleType vt);
 
struct LoadgameState;
src/vehicle_type.h
Show inline comments
 
@@ -11,13 +11,13 @@
 

	
 
#ifndef VEHICLE_TYPE_H
 
#define VEHICLE_TYPE_H
 

	
 
#include "core/enum_type.hpp"
 

	
 
typedef uint16 VehicleID;
 
typedef uint32 VehicleID;
 

	
 
/** Available vehicle types. */
 
enum VehicleType {
 
	VEH_TRAIN,          ///< %Train vehicle type.
 
	VEH_ROAD,           ///< Road vehicle type.
 
	VEH_SHIP,           ///< %Ship vehicle type.
 
@@ -42,13 +42,13 @@ struct DisasterVehicle;
 

	
 
struct BaseVehicle
 
{
 
	VehicleTypeByte type;    ///< Type of vehicle
 
};
 

	
 
static const VehicleID INVALID_VEHICLE = 0xFFFF; ///< Constant representing a non-existing vehicle.
 
static const VehicleID INVALID_VEHICLE = 0xFFFFF; ///< Constant representing a non-existing vehicle.
 

	
 
/** Pathfinding option states */
 
enum VehiclePathFinders {
 
	VPF_OPF  = 0, ///< The Original PathFinder (only for ships)
 
	VPF_NPF  = 1, ///< New PathFinder
 
	VPF_YAPF = 2, ///< Yet Another PathFinder
0 comments (0 inline, 0 general)