(svn r9390) -Documentation : correct Doxygen of comments and @file inclusion. This time, brought to you by the letter O

This commit is contained in:
belugas 2007-03-21 15:19:33 +00:00
parent d7f56f1550
commit 57557ba599
8 changed files with 159 additions and 144 deletions

View File

@ -1,5 +1,7 @@
/* $Id$ */ /* $Id$ */
/** @file oldloader.cpp */
#include "stdafx.h" #include "stdafx.h"
#include "openttd.h" #include "openttd.h"
#include "station_map.h" #include "station_map.h"
@ -415,11 +417,11 @@ static const OldChunks town_chunk[] = {
OCL_SVAR( OC_UINT16, Town, townnametype ), OCL_SVAR( OC_UINT16, Town, townnametype ),
OCL_SVAR( OC_UINT32, Town, townnameparts ), OCL_SVAR( OC_UINT32, Town, townnameparts ),
OCL_SVAR( OC_UINT8, Town, grow_counter ), OCL_SVAR( OC_UINT8, Town, grow_counter ),
OCL_NULL( 1 ), // sort_index, no longer in use OCL_NULL( 1 ), ///< sort_index, no longer in use
OCL_NULL( 4 ), // sign-coordinates, no longer in use OCL_NULL( 4 ), ///< sign-coordinates, no longer in use
OCL_NULL( 2 ), // namewidth, no longer in use OCL_NULL( 2 ), ///< namewidth, no longer in use
OCL_SVAR( OC_UINT16, Town, flags12 ), OCL_SVAR( OC_UINT16, Town, flags12 ),
OCL_NULL( 10 ), // radius, no longer in use OCL_NULL( 10 ), ///< radius, no longer in use
OCL_SVAR( OC_UINT16, Town, ratings[0] ), OCL_SVAR( OC_UINT16, Town, ratings[0] ),
OCL_SVAR( OC_UINT16, Town, ratings[1] ), OCL_SVAR( OC_UINT16, Town, ratings[1] ),
@ -458,7 +460,7 @@ static const OldChunks town_chunk[] = {
OCL_SVAR( OC_UINT8, Town, road_build_months ), OCL_SVAR( OC_UINT8, Town, road_build_months ),
OCL_SVAR( OC_UINT8, Town, fund_buildings_months ), OCL_SVAR( OC_UINT8, Town, fund_buildings_months ),
OCL_NULL( 8 ), // some junk at the end of the record OCL_NULL( 8 ), ///< some junk at the end of the record
OCL_END() OCL_END()
}; };
@ -538,7 +540,7 @@ static const OldChunks cargo_payment_rate_chunk[] = {
OCL_VAR ( OC_INT32, 1, &_old_price ), OCL_VAR ( OC_INT32, 1, &_old_price ),
OCL_VAR ( OC_UINT16, 1, &_old_price_frac ), OCL_VAR ( OC_UINT16, 1, &_old_price_frac ),
OCL_NULL( 2 ), // Junk OCL_NULL( 2 ), ///< Junk
OCL_END() OCL_END()
}; };
@ -577,19 +579,19 @@ static const OldChunks station_chunk[] = {
OCL_SVAR( OC_TILE, Station, xy ), OCL_SVAR( OC_TILE, Station, xy ),
OCL_VAR ( OC_UINT32, 1, &_old_town_index ), OCL_VAR ( OC_UINT32, 1, &_old_town_index ),
OCL_NULL( 4 ), // bus/lorry tile OCL_NULL( 4 ), ///< bus/lorry tile
OCL_SVAR( OC_TILE, Station, train_tile ), OCL_SVAR( OC_TILE, Station, train_tile ),
OCL_SVAR( OC_TILE, Station, airport_tile ), OCL_SVAR( OC_TILE, Station, airport_tile ),
OCL_SVAR( OC_TILE, Station, dock_tile ), OCL_SVAR( OC_TILE, Station, dock_tile ),
OCL_VAR ( OC_UINT8, 1, &_old_platforms ), OCL_VAR ( OC_UINT8, 1, &_old_platforms ),
OCL_NULL( 1 ), // sort-index, no longer in use OCL_NULL( 1 ), ///< sort-index, no longer in use
OCL_NULL( 2 ), // sign-width, no longer in use OCL_NULL( 2 ), ///< sign-width, no longer in use
OCL_VAR ( OC_UINT16, 1, &_old_string_id ), OCL_VAR ( OC_UINT16, 1, &_old_string_id ),
OCL_NULL( 4 ), // sign left/top, no longer in use OCL_NULL( 4 ), ///< sign left/top, no longer in use
OCL_SVAR( OC_UINT16, Station, had_vehicle_of_type ), OCL_SVAR( OC_UINT16, Station, had_vehicle_of_type ),
@ -607,9 +609,9 @@ static const OldChunks station_chunk[] = {
*/ */
OCL_NULL( 4 ), OCL_NULL( 4 ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Station, airport_flags ), OCL_SVAR( OC_FILE_U16 | OC_VAR_U32, Station, airport_flags ),
OCL_NULL( 2 ), // last_vehicle. now last_vehicle_type OCL_NULL( 2 ), ///< last_vehicle. now last_vehicle_type
OCL_NULL( 4 ), // Junk at end of chunk OCL_NULL( 4 ), ///< Junk at end of chunk
OCL_END() OCL_END()
}; };
@ -682,7 +684,7 @@ static const OldChunks industry_chunk[] = {
OCL_SVAR( OC_UINT16, Industry, counter ), OCL_SVAR( OC_UINT16, Industry, counter ),
OCL_SVAR( OC_UINT8, Industry, was_cargo_delivered ), OCL_SVAR( OC_UINT8, Industry, was_cargo_delivered ),
OCL_NULL( 9 ), // Random junk at the end of this chunk OCL_NULL( 9 ), ///< Random junk at the end of this chunk
OCL_END() OCL_END()
}; };
@ -769,7 +771,7 @@ static const OldChunks player_ai_build_rec_chunk[] = {
OCL_SVAR( OC_UINT8, AiBuildRec, direction ), OCL_SVAR( OC_UINT8, AiBuildRec, direction ),
OCL_SVAR( OC_UINT8, AiBuildRec, cargo ), OCL_SVAR( OC_UINT8, AiBuildRec, cargo ),
OCL_NULL( 8 ), // Junk... OCL_NULL( 8 ), ///< Junk...
OCL_END() OCL_END()
}; };
@ -789,14 +791,14 @@ static bool OldLoadAIBuildRec(LoadgameState *ls, int num)
} }
static const OldChunks player_ai_chunk[] = { static const OldChunks player_ai_chunk[] = {
OCL_SVAR( OC_UINT8, PlayerAI, state ), OCL_SVAR( OC_UINT8, PlayerAI, state ),
OCL_NULL( 1 ), // Junk OCL_NULL( 1 ), ///< Junk
OCL_SVAR( OC_UINT8, PlayerAI, state_mode ), OCL_SVAR( OC_UINT8, PlayerAI, state_mode ),
OCL_SVAR( OC_UINT16, PlayerAI, state_counter ), OCL_SVAR( OC_UINT16, PlayerAI, state_counter ),
OCL_SVAR( OC_UINT16, PlayerAI, timeout_counter ), OCL_SVAR( OC_UINT16, PlayerAI, timeout_counter ),
OCL_CHUNK( 4, OldLoadAIBuildRec ), OCL_CHUNK( 4, OldLoadAIBuildRec ),
OCL_NULL( 20 ), // More junk OCL_NULL( 20 ), ///< More junk
OCL_SVAR( OC_UINT8, PlayerAI, cargo_type ), OCL_SVAR( OC_UINT8, PlayerAI, cargo_type ),
OCL_SVAR( OC_UINT8, PlayerAI, num_wagons ), OCL_SVAR( OC_UINT8, PlayerAI, num_wagons ),
@ -805,9 +807,9 @@ static const OldChunks player_ai_chunk[] = {
OCL_SVAR( OC_UINT8, PlayerAI, num_loco_to_build ), OCL_SVAR( OC_UINT8, PlayerAI, num_loco_to_build ),
OCL_SVAR( OC_UINT8, PlayerAI, num_want_fullload ), OCL_SVAR( OC_UINT8, PlayerAI, num_want_fullload ),
OCL_NULL( 14 ), // Oh no more junk :| OCL_NULL( 14 ), ///< Oh no more junk :|
OCL_NULL( 2 ), // Loco-id, not used OCL_NULL( 2 ), ///< Loco-id, not used
OCL_SVAR( OC_UINT16, PlayerAI, wagon_list[0] ), OCL_SVAR( OC_UINT16, PlayerAI, wagon_list[0] ),
OCL_SVAR( OC_UINT16, PlayerAI, wagon_list[1] ), OCL_SVAR( OC_UINT16, PlayerAI, wagon_list[1] ),
@ -934,7 +936,7 @@ static const OldChunks player_chunk[] = {
OCL_SVAR( OC_UINT8, Player, share_owners[2] ), OCL_SVAR( OC_UINT8, Player, share_owners[2] ),
OCL_SVAR( OC_UINT8, Player, share_owners[3] ), OCL_SVAR( OC_UINT8, Player, share_owners[3] ),
OCL_NULL( 8 ), // junk at end of chunk OCL_NULL( 8 ), ///< junk at end of chunk
OCL_END() OCL_END()
}; };
@ -996,7 +998,7 @@ static const OldChunks vehicle_train_chunk[] = {
OCL_SVAR( OC_UINT16, VehicleRail, crash_anim_pos ), OCL_SVAR( OC_UINT16, VehicleRail, crash_anim_pos ),
OCL_SVAR( OC_UINT8, VehicleRail, railtype ), OCL_SVAR( OC_UINT8, VehicleRail, railtype ),
OCL_NULL( 5 ), // Junk OCL_NULL( 5 ), ///< Junk
OCL_END() OCL_END()
}; };
@ -1010,7 +1012,7 @@ static const OldChunks vehicle_road_chunk[] = {
OCL_SVAR( OC_UINT16, VehicleRoad, crashed_ctr ), OCL_SVAR( OC_UINT16, VehicleRoad, crashed_ctr ),
OCL_SVAR( OC_UINT8, VehicleRoad, reverse_ctr ), OCL_SVAR( OC_UINT8, VehicleRoad, reverse_ctr ),
OCL_NULL( 1 ), // Junk OCL_NULL( 1 ), ///< Junk
OCL_END() OCL_END()
}; };
@ -1018,7 +1020,7 @@ static const OldChunks vehicle_road_chunk[] = {
static const OldChunks vehicle_ship_chunk[] = { static const OldChunks vehicle_ship_chunk[] = {
OCL_SVAR( OC_UINT8, VehicleShip, state ), OCL_SVAR( OC_UINT8, VehicleShip, state ),
OCL_NULL( 9 ), // Junk OCL_NULL( 9 ), ///< Junk
OCL_END() OCL_END()
}; };
@ -1029,7 +1031,7 @@ static const OldChunks vehicle_air_chunk[] = {
OCL_SVAR( OC_UINT16, VehicleAir, crashed_counter ), OCL_SVAR( OC_UINT16, VehicleAir, crashed_counter ),
OCL_SVAR( OC_UINT8, VehicleAir, state ), OCL_SVAR( OC_UINT8, VehicleAir, state ),
OCL_NULL( 5 ), // Junk OCL_NULL( 5 ), ///< Junk
OCL_END() OCL_END()
}; };
@ -1047,13 +1049,13 @@ static const OldChunks vehicle_disaster_chunk[] = {
OCL_SVAR( OC_UINT16, VehicleDisaster, image_override ), OCL_SVAR( OC_UINT16, VehicleDisaster, image_override ),
OCL_SVAR( OC_UINT16, VehicleDisaster, unk2 ), OCL_SVAR( OC_UINT16, VehicleDisaster, unk2 ),
OCL_NULL( 6 ), // Junk OCL_NULL( 6 ), ///< Junk
OCL_END() OCL_END()
}; };
static const OldChunks vehicle_empty_chunk[] = { static const OldChunks vehicle_empty_chunk[] = {
OCL_NULL( 10 ), // Junk OCL_NULL( 10 ), ///< Junk
OCL_END() OCL_END()
}; };
@ -1090,8 +1092,8 @@ static const OldChunks vehicle_chunk[] = {
OCL_SVAR( OC_UINT8, Vehicle, type ), OCL_SVAR( OC_UINT8, Vehicle, type ),
OCL_SVAR( OC_UINT8, Vehicle, subtype ), OCL_SVAR( OC_UINT8, Vehicle, subtype ),
OCL_NULL( 2 ), // Hash, calculated automatically OCL_NULL( 2 ), ///< Hash, calculated automatically
OCL_NULL( 2 ), // Index, calculated automatically OCL_NULL( 2 ), ///< Index, calculated automatically
OCL_VAR ( OC_UINT32, 1, &_old_order_ptr ), OCL_VAR ( OC_UINT32, 1, &_old_order_ptr ),
OCL_VAR ( OC_UINT16, 1, &_old_order ), OCL_VAR ( OC_UINT16, 1, &_old_order ),
@ -1120,7 +1122,7 @@ static const OldChunks vehicle_chunk[] = {
OCL_SVAR( OC_TILE, Vehicle, tile ), OCL_SVAR( OC_TILE, Vehicle, tile ),
OCL_SVAR( OC_UINT16, Vehicle, cur_image ), OCL_SVAR( OC_UINT16, Vehicle, cur_image ),
OCL_NULL( 8 ), // Vehicle sprite box, calculated automatically OCL_NULL( 8 ), ///< Vehicle sprite box, calculated automatically
OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, Vehicle, vehstatus ), OCL_SVAR( OC_FILE_U16 | OC_VAR_U8, Vehicle, vehstatus ),
OCL_SVAR( OC_UINT16, Vehicle, cur_speed ), OCL_SVAR( OC_UINT16, Vehicle, cur_speed ),
@ -1163,7 +1165,7 @@ static const OldChunks vehicle_chunk[] = {
OCL_CHUNK( 1, LoadOldVehicleUnion ), OCL_CHUNK( 1, LoadOldVehicleUnion ),
OCL_NULL( 20 ), // Junk at end of struct (TTDPatch has some data in it) OCL_NULL( 20 ), ///< Junk at end of struct (TTDPatch has some data in it)
OCL_END() OCL_END()
}; };
@ -1221,7 +1223,7 @@ static const OldChunks sign_chunk[] = {
OCL_SVAR( OC_FILE_U16 | OC_VAR_I32,Sign, y ), OCL_SVAR( OC_FILE_U16 | OC_VAR_I32,Sign, y ),
OCL_SVAR( OC_FILE_U16 | OC_VAR_I8, Sign, z ), OCL_SVAR( OC_FILE_U16 | OC_VAR_I8, Sign, z ),
OCL_NULL( 6 ), // Width of sign, no longer in use OCL_NULL( 6 ), ///< Width of sign, no longer in use
OCL_END() OCL_END()
}; };
@ -1252,7 +1254,7 @@ static const OldChunks engine_chunk[] = {
OCL_SVAR( OC_UINT8, Engine, preview_player ), OCL_SVAR( OC_UINT8, Engine, preview_player ),
OCL_SVAR( OC_UINT8, Engine, preview_wait ), OCL_SVAR( OC_UINT8, Engine, preview_wait ),
OCL_NULL( 2 ), // Junk OCL_NULL( 2 ), ///< Junk
OCL_END() OCL_END()
}; };
@ -1385,7 +1387,8 @@ static bool LoadTTDPatchExtraChunks(LoadgameState *ls, int num)
AppendStaticGRFConfigs(&_grfconfig); AppendStaticGRFConfigs(&_grfconfig);
} break; } break;
case 0x3: { /* TTDPatch version and configuration */ /* TTDPatch version and configuration */
case 0x3: {
uint32 ttdpv = ReadUint32(ls); uint32 ttdpv = ReadUint32(ls);
DEBUG(oldloader, 3, "Game saved with TTDPatch version %d.%d.%d r%d", GB(ttdpv, 24, 8), GB(ttdpv, 20, 4), GB(ttdpv, 16, 4), GB(ttdpv, 0, 16)); DEBUG(oldloader, 3, "Game saved with TTDPatch version %d.%d.%d r%d", GB(ttdpv, 24, 8), GB(ttdpv, 20, 4), GB(ttdpv, 16, 4), GB(ttdpv, 0, 16));
len -= 4; len -= 4;
@ -1407,7 +1410,7 @@ static const OldChunks main_chunk[] = {
OCL_ASSERT( 0 ), OCL_ASSERT( 0 ),
OCL_VAR ( OC_FILE_U16 | OC_VAR_U32, 1, &_date ), OCL_VAR ( OC_FILE_U16 | OC_VAR_U32, 1, &_date ),
OCL_VAR ( OC_UINT16, 1, &_date_fract ), OCL_VAR ( OC_UINT16, 1, &_date_fract ),
OCL_NULL( 600 ), // TextEffects OCL_NULL( 600 ), ///< TextEffects
OCL_VAR ( OC_UINT32, 2, &_random_seeds[0] ), OCL_VAR ( OC_UINT32, 2, &_random_seeds[0] ),
OCL_ASSERT( 0x264 ), OCL_ASSERT( 0x264 ),
@ -1417,14 +1420,14 @@ static const OldChunks main_chunk[] = {
OCL_ASSERT( 0x4328 ), OCL_ASSERT( 0x4328 ),
OCL_VAR ( OC_TILE, 256, &_animated_tile_list[0] ), OCL_VAR ( OC_TILE, 256, &_animated_tile_list[0] ),
OCL_NULL( 4 ), // old end-of-order-list-pointer, no longer in use OCL_NULL( 4 ), ///< old end-of-order-list-pointer, no longer in use
OCL_CHUNK( 255, LoadOldDepot ), OCL_CHUNK( 255, LoadOldDepot ),
OCL_ASSERT( 0x4B26 ), OCL_ASSERT( 0x4B26 ),
OCL_VAR ( OC_UINT32, 1, &_old_cur_town_ctr ), OCL_VAR ( OC_UINT32, 1, &_old_cur_town_ctr ),
OCL_NULL( 2 ), // timer_counter, no longer in use OCL_NULL( 2 ), ///< timer_counter, no longer in use
OCL_NULL( 2 ), // land_code, no longer in use OCL_NULL( 2 ), ///< land_code, no longer in use
OCL_VAR ( OC_FILE_U16 | OC_VAR_U8, 1, &_age_cargo_skip_counter ), OCL_VAR ( OC_FILE_U16 | OC_VAR_U8, 1, &_age_cargo_skip_counter ),
OCL_VAR ( OC_UINT16, 1, &_tick_counter ), OCL_VAR ( OC_UINT16, 1, &_tick_counter ),
@ -1451,7 +1454,7 @@ static const OldChunks main_chunk[] = {
OCL_VAR ( OC_UINT8, 32 * 500, &_name_array[0] ), OCL_VAR ( OC_UINT8, 32 * 500, &_name_array[0] ),
OCL_NULL( 0x2000 ), // Old hash-table, no longer in use OCL_NULL( 0x2000 ), ///< Old hash-table, no longer in use
OCL_CHUNK( 40, LoadOldSign ), OCL_CHUNK( 40, LoadOldSign ),
OCL_CHUNK(256, LoadOldEngine ), OCL_CHUNK(256, LoadOldEngine ),
@ -1471,12 +1474,12 @@ static const OldChunks main_chunk[] = {
OCL_VAR ( OC_UINT16, 1, &_disaster_delay ), OCL_VAR ( OC_UINT16, 1, &_disaster_delay ),
OCL_NULL( 144 ), // cargo-stuff, calculated in InitializeLandscapeVariables OCL_NULL( 144 ), ///< cargo-stuff, calculated in InitializeLandscapeVariables
OCL_VAR ( OC_UINT16, 256, &_engine_name_strings[0] ), OCL_VAR ( OC_UINT16, 256, &_engine_name_strings[0] ),
OCL_NULL( 144 ), // AI cargo-stuff, calculated in InitializeLandscapeVariables OCL_NULL( 144 ), ///< AI cargo-stuff, calculated in InitializeLandscapeVariables
OCL_NULL( 2 ), // Company indexes of players, no longer in use OCL_NULL( 2 ), ///< Company indexes of players, no longer in use
OCL_VAR ( OC_FILE_U8 | OC_VAR_U16, 1, &_station_tick_ctr ), OCL_VAR ( OC_FILE_U8 | OC_VAR_U16, 1, &_station_tick_ctr ),
@ -1484,8 +1487,8 @@ static const OldChunks main_chunk[] = {
OCL_VAR ( OC_UINT8, 1, &_opt.units ), OCL_VAR ( OC_UINT8, 1, &_opt.units ),
OCL_VAR ( OC_FILE_U8 | OC_VAR_U32, 1, &_cur_player_tick_index ), OCL_VAR ( OC_FILE_U8 | OC_VAR_U32, 1, &_cur_player_tick_index ),
OCL_NULL( 2 ), // Date stuff, calculated automatically OCL_NULL( 2 ), ///< Date stuff, calculated automatically
OCL_NULL( 8 ), // Player colors, calculated automatically OCL_NULL( 8 ), ///< Player colors, calculated automatically
OCL_VAR ( OC_UINT8, 1, &_economy.infl_amount ), OCL_VAR ( OC_UINT8, 1, &_economy.infl_amount ),
OCL_VAR ( OC_UINT8, 1, &_economy.infl_amount_pr ), OCL_VAR ( OC_UINT8, 1, &_economy.infl_amount_pr ),
@ -1502,11 +1505,11 @@ static const OldChunks main_chunk[] = {
OCL_VAR ( OC_UINT8, 1, &_opt.landscape ), OCL_VAR ( OC_UINT8, 1, &_opt.landscape ),
OCL_VAR ( OC_UINT8, 1, &_trees_tick_ctr ), OCL_VAR ( OC_UINT8, 1, &_trees_tick_ctr ),
OCL_NULL( 1 ), // Custom vehicle types yes/no, no longer used OCL_NULL( 1 ), ///< Custom vehicle types yes/no, no longer used
OCL_VAR ( OC_UINT8, 1, &_opt.snow_line ), OCL_VAR ( OC_UINT8, 1, &_opt.snow_line ),
OCL_NULL( 32 ), // new_industry_randtable, no longer used (because of new design) OCL_NULL( 32 ), ///< new_industry_randtable, no longer used (because of new design)
OCL_NULL( 36 ), // cargo-stuff, calculated in InitializeLandscapeVariables OCL_NULL( 36 ), ///< cargo-stuff, calculated in InitializeLandscapeVariables
OCL_ASSERT( 0x77179 ), OCL_ASSERT( 0x77179 ),

View File

@ -1,5 +1,7 @@
/* $Id$ */ /* $Id$ */
/** @file oldpool.cpp */
#include "stdafx.h" #include "stdafx.h"
#include "openttd.h" #include "openttd.h"
#include "debug.h" #include "debug.h"

View File

@ -1,5 +1,7 @@
/* $Id$ */ /* $Id$ */
/** @file oldpool.h */
#ifndef OLDPOOL_H #ifndef OLDPOOL_H
#define OLDPOOL_H #define OLDPOOL_H

View File

@ -1,5 +1,7 @@
/* $Id$ */ /* $Id$ */
/** @file openttd.cpp */
#include "stdafx.h" #include "stdafx.h"
#define VARDEF #define VARDEF
#include "string.h" #include "string.h"
@ -220,17 +222,17 @@ static int MyGetOpt(MyGetOptData *md)
md_continue_here:; md_continue_here:;
s++; s++;
if (*s != 0) { if (*s != 0) {
// Found argument, try to locate it in options. /* Found argument, try to locate it in options. */
if (*s == ':' || (r = strchr(md->options, *s)) == NULL) { if (*s == ':' || (r = strchr(md->options, *s)) == NULL) {
// ERROR! /* ERROR! */
return -2; return -2;
} }
if (r[1] == ':') { if (r[1] == ':') {
// Item wants an argument. Check if the argument follows, or if it comes as a separate arg. /* Item wants an argument. Check if the argument follows, or if it comes as a separate arg. */
if (!*(t = s + 1)) { if (!*(t = s + 1)) {
// It comes as a separate arg. Check if out of args? /* It comes as a separate arg. Check if out of args? */
if (--md->numleft < 0 || *(t = *md->argv) == '-') { if (--md->numleft < 0 || *(t = *md->argv) == '-') {
// Check if item is optional? /* Check if item is optional? */
if (r[2] != ':') if (r[2] != ':')
return -2; return -2;
md->numleft++; md->numleft++;
@ -248,7 +250,7 @@ md_continue_here:;
return *s; return *s;
} }
} else { } else {
// This is currently not supported. /* This is currently not supported. */
return -2; return -2;
} }
} }
@ -305,11 +307,11 @@ static void LoadIntroGame()
_opt_ptr = &_opt_newgame; _opt_ptr = &_opt_newgame;
ResetGRFConfig(false); ResetGRFConfig(false);
// Setup main window /* Setup main window */
ResetWindowSystem(); ResetWindowSystem();
SetupColorsAndInitialWindow(); SetupColorsAndInitialWindow();
// Generate a world. /* Generate a world. */
snprintf(filename, lengthof(filename), "%sopntitle.dat", _paths.data_dir); snprintf(filename, lengthof(filename), "%sopntitle.dat", _paths.data_dir);
#if defined SECOND_DATA_DIR #if defined SECOND_DATA_DIR
if (SaveOrLoad(filename, SL_LOAD) != SL_OK) { if (SaveOrLoad(filename, SL_LOAD) != SL_OK) {
@ -328,7 +330,7 @@ static void LoadIntroGame()
_cursor.fix_at = false; _cursor.fix_at = false;
MarkWholeScreenDirty(); MarkWholeScreenDirty();
// Play main theme /* Play main theme */
if (_music_driver->is_song_playing()) ResetMusic(); if (_music_driver->is_song_playing()) ResetMusic();
} }
@ -362,10 +364,10 @@ int ttd_main(int argc, char *argv[])
_dedicated_forks = false; _dedicated_forks = false;
_config_file = NULL; _config_file = NULL;
// The last param of the following function means this: /* The last param of the following function means this:
// a letter means: it accepts that param (e.g.: -h) * a letter means: it accepts that param (e.g.: -h)
// a ':' behind it means: it need a param (e.g.: -m<driver>) * a ':' behind it means: it need a param (e.g.: -m<driver>)
// a '::' behind it means: it can optional have a param (e.g.: -d<debug>) * a '::' behind it means: it can optional have a param (e.g.: -d<debug>) */
optformat = "m:s:v:hD::n::eit:d::r:g::G:c:xl:" optformat = "m:s:v:hD::n::eit:d::r:g::G:c:xl:"
#if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(WIN32) #if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(WIN32)
"f" "f"
@ -438,7 +440,7 @@ int ttd_main(int argc, char *argv[])
CheckExternalFiles(); CheckExternalFiles();
#if defined(UNIX) && !defined(__MORPHOS__) #if defined(UNIX) && !defined(__MORPHOS__)
// We must fork here, or we'll end up without some resources we need (like sockets) /* We must fork here, or we'll end up without some resources we need (like sockets) */
if (_dedicated_forks) if (_dedicated_forks)
DedicatedFork(); DedicatedFork();
#endif #endif
@ -447,7 +449,7 @@ int ttd_main(int argc, char *argv[])
CheckConfig(); CheckConfig();
LoadFromHighScore(); LoadFromHighScore();
// override config? /* override config? */
if (!StrEmpty(musicdriver)) ttd_strlcpy(_ini_musicdriver, musicdriver, sizeof(_ini_musicdriver)); if (!StrEmpty(musicdriver)) ttd_strlcpy(_ini_musicdriver, musicdriver, sizeof(_ini_musicdriver));
if (!StrEmpty(sounddriver)) ttd_strlcpy(_ini_sounddriver, sounddriver, sizeof(_ini_sounddriver)); if (!StrEmpty(sounddriver)) ttd_strlcpy(_ini_sounddriver, sounddriver, sizeof(_ini_sounddriver));
if (!StrEmpty(videodriver)) ttd_strlcpy(_ini_videodriver, videodriver, sizeof(_ini_videodriver)); if (!StrEmpty(videodriver)) ttd_strlcpy(_ini_videodriver, videodriver, sizeof(_ini_videodriver));
@ -461,13 +463,13 @@ int ttd_main(int argc, char *argv[])
if (_dedicated_forks && !dedicated) _dedicated_forks = false; if (_dedicated_forks && !dedicated) _dedicated_forks = false;
#endif /* ENABLE_NETWORK */ #endif /* ENABLE_NETWORK */
// enumerate language files /* enumerate language files */
InitializeLanguagePacks(); InitializeLanguagePacks();
// initialize screenshot formats /* initialize screenshot formats */
InitializeScreenshotFormats(); InitializeScreenshotFormats();
// initialize airport state machines /* initialize airport state machines */
InitializeAirports(); InitializeAirports();
/* initialize all variables that are allocated dynamically */ /* initialize all variables that are allocated dynamically */
@ -476,7 +478,7 @@ int ttd_main(int argc, char *argv[])
/* start the AI */ /* start the AI */
AI_Initialize(); AI_Initialize();
// Sample catalogue /* Sample catalogue */
DEBUG(misc, 1, "Loading sound effects..."); DEBUG(misc, 1, "Loading sound effects...");
MxInitialize(11025); MxInitialize(11025);
SoundInitialize("sample.cat"); SoundInitialize("sample.cat");
@ -484,7 +486,7 @@ int ttd_main(int argc, char *argv[])
/* Initialize FreeType */ /* Initialize FreeType */
InitFreeType(); InitFreeType();
// This must be done early, since functions use the InvalidateWindow* calls /* This must be done early, since functions use the InvalidateWindow* calls */
InitWindowSystem(); InitWindowSystem();
/* Initialize game palette */ /* Initialize game palette */
@ -496,7 +498,7 @@ int ttd_main(int argc, char *argv[])
LoadDriver(VIDEO_DRIVER, _ini_videodriver); // load video last, to prevent an empty window while sound and music loads LoadDriver(VIDEO_DRIVER, _ini_videodriver); // load video last, to prevent an empty window while sound and music loads
_savegame_sort_order = SORT_BY_DATE | SORT_DESCENDING; _savegame_sort_order = SORT_BY_DATE | SORT_DESCENDING;
// restore saved music volume /* restore saved music volume */
_music_driver->set_volume(msf.music_vol); _music_driver->set_volume(msf.music_vol);
NetworkStartUp(); // initialize network-core NetworkStartUp(); // initialize network-core
@ -530,7 +532,7 @@ int ttd_main(int argc, char *argv[])
UpdatePatches(); UpdatePatches();
} }
// initialize the ingame console /* initialize the ingame console */
IConsoleInit(); IConsoleInit();
_cursor.in_window = true; _cursor.in_window = true;
InitializeGUI(); InitializeGUI();
@ -714,7 +716,7 @@ static void StartScenario()
{ {
_game_mode = GM_NORMAL; _game_mode = GM_NORMAL;
// invalid type /* invalid type */
if (_file_to_saveload.mode == SL_INVALID) { if (_file_to_saveload.mode == SL_INVALID) {
DEBUG(sl, 0, "Savegame is obsolete or invalid format: '%s'", _file_to_saveload.name); DEBUG(sl, 0, "Savegame is obsolete or invalid format: '%s'", _file_to_saveload.name);
ShowErrorMessage(INVALID_STRING_ID, STR_4009_GAME_LOAD_FAILED, 0, 0); ShowErrorMessage(INVALID_STRING_ID, STR_4009_GAME_LOAD_FAILED, 0, 0);
@ -722,14 +724,14 @@ static void StartScenario()
return; return;
} }
// Reinitialize windows /* Reinitialize windows */
ResetWindowSystem(); ResetWindowSystem();
SetupColorsAndInitialWindow(); SetupColorsAndInitialWindow();
ResetGRFConfig(true); ResetGRFConfig(true);
// Load game /* Load game */
if (SaveOrLoad(_file_to_saveload.name, _file_to_saveload.mode) != SL_OK) { if (SaveOrLoad(_file_to_saveload.name, _file_to_saveload.mode) != SL_OK) {
LoadIntroGame(); LoadIntroGame();
ShowErrorMessage(INVALID_STRING_ID, STR_4009_GAME_LOAD_FAILED, 0, 0); ShowErrorMessage(INVALID_STRING_ID, STR_4009_GAME_LOAD_FAILED, 0, 0);
@ -739,7 +741,7 @@ static void StartScenario()
_opt_ptr->diff = _opt_newgame.diff; _opt_ptr->diff = _opt_newgame.diff;
_opt.diff_level = _opt_newgame.diff_level; _opt.diff_level = _opt_newgame.diff_level;
// Inititalize data /* Inititalize data */
StartupEconomy(); StartupEconomy();
StartupPlayers(); StartupPlayers();
StartupEngines(); StartupEngines();
@ -777,9 +779,9 @@ bool SafeSaveOrLoad(const char *filename, int mode, int newgm)
void SwitchMode(int new_mode) void SwitchMode(int new_mode)
{ {
#ifdef ENABLE_NETWORK #ifdef ENABLE_NETWORK
// If we are saving something, the network stays in his current state /* If we are saving something, the network stays in his current state */
if (new_mode != SM_SAVE) { if (new_mode != SM_SAVE) {
// If the network is active, make it not-active /* If the network is active, make it not-active */
if (_networking) { if (_networking) {
if (_network_server && (new_mode == SM_LOAD || new_mode == SM_NEWGAME)) { if (_network_server && (new_mode == SM_LOAD || new_mode == SM_NEWGAME)) {
NetworkReboot(); NetworkReboot();
@ -790,13 +792,13 @@ void SwitchMode(int new_mode)
} }
} }
// If we are a server, we restart the server /* If we are a server, we restart the server */
if (_is_network_server) { if (_is_network_server) {
// But not if we are going to the menu /* But not if we are going to the menu */
if (new_mode != SM_MENU) { if (new_mode != SM_MENU) {
NetworkServerStart(); NetworkServerStart();
} else { } else {
// This client no longer wants to be a network-server /* This client no longer wants to be a network-server */
_is_network_server = false; _is_network_server = false;
} }
} }
@ -890,7 +892,7 @@ void SwitchMode(int new_mode)
case SM_GENRANDLAND: /* Generate random land within scenario editor */ case SM_GENRANDLAND: /* Generate random land within scenario editor */
SetLocalPlayer(OWNER_NONE); SetLocalPlayer(OWNER_NONE);
GenerateWorld(GW_RANDOM, 1 << _patches.map_x, 1 << _patches.map_y); GenerateWorld(GW_RANDOM, 1 << _patches.map_x, 1 << _patches.map_y);
// XXX: set date /* XXX: set date */
MarkWholeScreenDirty(); MarkWholeScreenDirty();
break; break;
} }
@ -901,13 +903,13 @@ void SwitchMode(int new_mode)
} }
// State controlling game loop. /* State controlling game loop.
// The state must not be changed from anywhere * The state must not be changed from anywhere
// but here. * but here.
// That check is enforced in DoCommand. * That check is enforced in DoCommand. */
void StateGameLoop() void StateGameLoop()
{ {
// dont execute the state loop during pause /* dont execute the state loop during pause */
if (_pause_game) return; if (_pause_game) return;
if (IsGeneratingWorld()) return; if (IsGeneratingWorld()) return;
@ -918,8 +920,8 @@ void StateGameLoop()
CallWindowTickEvent(); CallWindowTickEvent();
NewsLoop(); NewsLoop();
} else { } else {
// All these actions has to be done from OWNER_NONE /* All these actions has to be done from OWNER_NONE
// for multiplayer compatibility * for multiplayer compatibility */
PlayerID p = _current_player; PlayerID p = _current_player;
_current_player = OWNER_NONE; _current_player = OWNER_NONE;
@ -958,12 +960,12 @@ static void DoAutosave()
SetDParam(2, _date); SetDParam(2, _date);
s = GetString(s, STR_4004, lastof(buf)); s = GetString(s, STR_4004, lastof(buf));
strecpy(s, ".sav", lastof(buf)); strecpy(s, ".sav", lastof(buf));
} else { /* generate a savegame name and number according to _patches.max_num_autosaves */ } else { // generate a savegame name and number according to _patches.max_num_autosaves
snprintf(buf, lengthof(buf), "%s%sautosave%d.sav", _paths.autosave_dir, PATHSEP, _autosave_ctr); snprintf(buf, lengthof(buf), "%s%sautosave%d.sav", _paths.autosave_dir, PATHSEP, _autosave_ctr);
_autosave_ctr++; _autosave_ctr++;
if (_autosave_ctr >= _patches.max_num_autosaves) { if (_autosave_ctr >= _patches.max_num_autosaves) {
// we reached the limit for numbers of autosaves. We will start over /* we reached the limit for numbers of autosaves. We will start over */
_autosave_ctr = 0; _autosave_ctr = 0;
} }
} }
@ -986,21 +988,21 @@ static void ScrollMainViewport(int x, int y)
static const int8 scrollamt[16][2] = { static const int8 scrollamt[16][2] = {
{ 0, 0}, { 0, 0},
{-2, 0}, // 1 : left {-2, 0}, ///< 1 : left
{ 0, -2}, // 2 : up { 0, -2}, ///< 2 : up
{-2, -1}, // 3 : left + up {-2, -1}, ///< 3 : left + up
{ 2, 0}, // 4 : right { 2, 0}, ///< 4 : right
{ 0, 0}, // 5 : left + right { 0, 0}, ///< 5 : left + right
{ 2, -1}, // 6 : right + up { 2, -1}, ///< 6 : right + up
{ 0, -2}, // 7 : left + right + up = up { 0, -2}, ///< 7 : left + right + up = up
{ 0 ,2}, // 8 : down { 0 ,2}, ///< 8 : down
{-2 ,1}, // 9 : down+left {-2 ,1}, ///< 9 : down+left
{ 0, 0}, // 10 : impossible { 0, 0}, ///< 10 : impossible
{-2, 0}, // 11 : left + up + down = left {-2, 0}, ///< 11 : left + up + down = left
{ 2, 1}, // 12 : down+right { 2, 1}, ///< 12 : down+right
{ 0, 2}, // 13 : left + right + down = down { 0, 2}, ///< 13 : left + right + down = down
{ 0, -2}, // 14 : left + right + up = up { 0, -2}, ///< 14 : left + right + up = up
{ 0, 0}, // 15 : impossible { 0, 0}, ///< 15 : impossible
}; };
static void HandleKeyScrolling() static void HandleKeyScrolling()
@ -1017,20 +1019,20 @@ void GameLoop()
if ((message = OTTD_PollThreadEvent()) != 0) ProcessSentMessage(message); if ((message = OTTD_PollThreadEvent()) != 0) ProcessSentMessage(message);
// autosave game? /* autosave game? */
if (_do_autosave) { if (_do_autosave) {
_do_autosave = false; _do_autosave = false;
DoAutosave(); DoAutosave();
RedrawAutosave(); RedrawAutosave();
} }
// handle scrolling of the main window /* handle scrolling of the main window */
HandleKeyScrolling(); HandleKeyScrolling();
// make a screenshot? /* make a screenshot? */
if (IsScreenshotRequested()) ShowScreenshotResult(MakeScreenshot()); if (IsScreenshotRequested()) ShowScreenshotResult(MakeScreenshot());
// switch game mode? /* switch game mode? */
if (_switch_mode != SM_NONE) { if (_switch_mode != SM_NONE) {
SwitchMode(_switch_mode); SwitchMode(_switch_mode);
_switch_mode = SM_NONE; _switch_mode = SM_NONE;
@ -1050,19 +1052,19 @@ void GameLoop()
CursorTick(); CursorTick();
#ifdef ENABLE_NETWORK #ifdef ENABLE_NETWORK
// Check for UDP stuff /* Check for UDP stuff */
if (_network_available) NetworkUDPGameLoop(); if (_network_available) NetworkUDPGameLoop();
if (_networking && !IsGeneratingWorld()) { if (_networking && !IsGeneratingWorld()) {
// Multiplayer /* Multiplayer */
NetworkGameLoop(); NetworkGameLoop();
} else { } else {
if (_network_reconnect > 0 && --_network_reconnect == 0) { if (_network_reconnect > 0 && --_network_reconnect == 0) {
// This means that we want to reconnect to the last host /* This means that we want to reconnect to the last host
// We do this here, because it means that the network is really closed * We do this here, because it means that the network is really closed */
NetworkClientConnectGame(_network_last_host, _network_last_port); NetworkClientConnectGame(_network_last_host, _network_last_port);
} }
// Singleplayer /* Singleplayer */
StateGameLoop(); StateGameLoop();
} }
#else #else
@ -1110,7 +1112,7 @@ static void ConvertTownOwner()
} }
} }
// before savegame version 4, the name of the company determined if it existed /* before savegame version 4, the name of the company determined if it existed */
static void CheckIsPlayerActive() static void CheckIsPlayerActive()
{ {
Player *p; Player *p;
@ -1120,7 +1122,7 @@ static void CheckIsPlayerActive()
} }
} }
// since savegame version 4.1, exclusive transport rights are stored at towns /* since savegame version 4.1, exclusive transport rights are stored at towns */
static void UpdateExclusiveRights() static void UpdateExclusiveRights()
{ {
Town *t; Town *t;
@ -1146,7 +1148,7 @@ static const byte convert_currency[] = {
16, 22, 21, 7, 15, 16, 22, 21, 7, 15,
18, 2, 20, }; 18, 2, 20, };
// since savegame version 4.2 the currencies are arranged differently /* since savegame version 4.2 the currencies are arranged differently */
static void UpdateCurrencies() static void UpdateCurrencies()
{ {
_opt.currency = convert_currency[_opt.currency]; _opt.currency = convert_currency[_opt.currency];
@ -1163,7 +1165,7 @@ static void UpdateVoidTiles()
for (i = 0; i < MapSizeX(); ++i) MakeVoid(MapSizeX() * MapMaxY() + i); for (i = 0; i < MapSizeX(); ++i) MakeVoid(MapSizeX() * MapMaxY() + i);
} }
// since savegame version 6.0 each sign has an "owner", signs without owner (from old games are set to 255) /* since savegame version 6.0 each sign has an "owner", signs without owner (from old games are set to 255) */
static void UpdateSignOwner() static void UpdateSignOwner()
{ {
Sign *si; Sign *si;
@ -1186,16 +1188,16 @@ bool AfterLoadGame()
ViewPort *vp; ViewPort *vp;
Player *p; Player *p;
// in version 2.1 of the savegame, town owner was unified. /* in version 2.1 of the savegame, town owner was unified. */
if (CheckSavegameVersionOldStyle(2, 1)) ConvertTownOwner(); if (CheckSavegameVersionOldStyle(2, 1)) ConvertTownOwner();
// from version 4.1 of the savegame, exclusive rights are stored at towns /* from version 4.1 of the savegame, exclusive rights are stored at towns */
if (CheckSavegameVersionOldStyle(4, 1)) UpdateExclusiveRights(); if (CheckSavegameVersionOldStyle(4, 1)) UpdateExclusiveRights();
// from version 4.2 of the savegame, currencies are in a different order /* from version 4.2 of the savegame, currencies are in a different order */
if (CheckSavegameVersionOldStyle(4, 2)) UpdateCurrencies(); if (CheckSavegameVersionOldStyle(4, 2)) UpdateCurrencies();
// from version 6.1 of the savegame, signs have an "owner" /* from version 6.1 of the savegame, signs have an "owner" */
if (CheckSavegameVersionOldStyle(6, 1)) UpdateSignOwner(); if (CheckSavegameVersionOldStyle(6, 1)) UpdateSignOwner();
/* In old version there seems to be a problem that water is owned by /* In old version there seems to be a problem that water is owned by
@ -1210,7 +1212,7 @@ bool AfterLoadGame()
} }
} }
// convert road side to my format. /* convert road side to my format. */
if (_opt.road_side) _opt.road_side = 1; if (_opt.road_side) _opt.road_side = 1;
/* Check if all NewGRFs are present, we are very strict in MP mode */ /* Check if all NewGRFs are present, we are very strict in MP mode */
@ -1227,7 +1229,7 @@ bool AfterLoadGame()
* must be done before loading sprites as some newgrfs check it */ * must be done before loading sprites as some newgrfs check it */
SetDate(_date); SetDate(_date);
// Load the sprites /* Load the sprites */
GfxLoadSprites(); GfxLoadSprites();
LoadStringWidthTable(); LoadStringWidthTable();
@ -1238,33 +1240,33 @@ bool AfterLoadGame()
/* Connect front and rear engines of multiheaded trains */ /* Connect front and rear engines of multiheaded trains */
ConnectMultiheadedTrains(); ConnectMultiheadedTrains();
// reinit the landscape variables (landscape might have changed) /* reinit the landscape variables (landscape might have changed) */
InitializeLandscapeVariables(true); InitializeLandscapeVariables(true);
// Update all vehicles /* Update all vehicles */
AfterLoadVehicles(); AfterLoadVehicles();
// Update all waypoints /* Update all waypoints */
if (CheckSavegameVersion(12)) FixOldWaypoints(); if (CheckSavegameVersion(12)) FixOldWaypoints();
UpdateAllWaypointSigns(); UpdateAllWaypointSigns();
// in version 2.2 of the savegame, we have new airports /* in version 2.2 of the savegame, we have new airports */
if (CheckSavegameVersionOldStyle(2, 2)) UpdateOldAircraft(); if (CheckSavegameVersionOldStyle(2, 2)) UpdateOldAircraft();
UpdateAllStationVirtCoord(); UpdateAllStationVirtCoord();
// Setup town coords /* Setup town coords */
AfterLoadTown(); AfterLoadTown();
UpdateAllSignVirtCoords(); UpdateAllSignVirtCoords();
// make sure there is a town in the game /* make sure there is a town in the game */
if (_game_mode == GM_NORMAL && !ClosestTownFromTile(0, (uint)-1)) { if (_game_mode == GM_NORMAL && !ClosestTownFromTile(0, (uint)-1)) {
_error_message = STR_NO_TOWN_IN_SCENARIO; _error_message = STR_NO_TOWN_IN_SCENARIO;
return false; return false;
} }
// Initialize windows /* Initialize windows */
ResetWindowSystem(); ResetWindowSystem();
SetupColorsAndInitialWindow(); SetupColorsAndInitialWindow();
@ -1278,17 +1280,17 @@ bool AfterLoadGame()
vp->virtual_width = vp->width << vp->zoom; vp->virtual_width = vp->width << vp->zoom;
vp->virtual_height = vp->height << vp->zoom; vp->virtual_height = vp->height << vp->zoom;
// in version 4.1 of the savegame, is_active was introduced to determine /* in version 4.1 of the savegame, is_active was introduced to determine
// if a player does exist, rather then checking name_1 * if a player does exist, rather then checking name_1 */
if (CheckSavegameVersionOldStyle(4, 1)) CheckIsPlayerActive(); if (CheckSavegameVersionOldStyle(4, 1)) CheckIsPlayerActive();
// the void tiles on the southern border used to belong to a wrong class (pre 4.3). /* the void tiles on the southern border used to belong to a wrong class (pre 4.3). */
if (CheckSavegameVersionOldStyle(4, 3)) UpdateVoidTiles(); if (CheckSavegameVersionOldStyle(4, 3)) UpdateVoidTiles();
// If Load Scenario / New (Scenario) Game is used, /* If Load Scenario / New (Scenario) Game is used,
// a player does not exist yet. So create one here. * a player does not exist yet. So create one here.
// 1 exeption: network-games. Those can have 0 players * 1 exeption: network-games. Those can have 0 players
// But this exeption is not true for network_servers! * But this exeption is not true for network_servers! */
if (!_players[0].is_active && (!_networking || (_networking && _network_server))) if (!_players[0].is_active && (!_networking || (_networking && _network_server)))
DoStartupNewPlayer(false); DoStartupNewPlayer(false);
@ -1584,15 +1586,15 @@ bool AfterLoadGame()
wp->grfid = statspec->grfid; wp->grfid = statspec->grfid;
wp->localidx = statspec->localidx; wp->localidx = statspec->localidx;
} else { } else {
// No custom graphics set, so set to default. /* No custom graphics set, so set to default. */
wp->stat_id = 0; wp->stat_id = 0;
wp->grfid = 0; wp->grfid = 0;
wp->localidx = 0; wp->localidx = 0;
} }
// Move ground type bits from m2 to m4. /* Move ground type bits from m2 to m4. */
_m[wp->xy].m4 = GB(_m[wp->xy].m2, 0, 4); _m[wp->xy].m4 = GB(_m[wp->xy].m2, 0, 4);
// Store waypoint index in the tile. /* Store waypoint index in the tile. */
_m[wp->xy].m2 = wp->index; _m[wp->xy].m2 = wp->index;
} }
} }
@ -1609,15 +1611,15 @@ bool AfterLoadGame()
switch (GetTileType(t)) { switch (GetTileType(t)) {
case MP_RAILWAY: case MP_RAILWAY:
if (HasSignals(t)) { if (HasSignals(t)) {
// convert PBS signals to combo-signals /* convert PBS signals to combo-signals */
if (HASBIT(_m[t].m2, 2)) SetSignalType(t, SIGTYPE_COMBO); if (HASBIT(_m[t].m2, 2)) SetSignalType(t, SIGTYPE_COMBO);
// move the signal variant back /* move the signal variant back */
SetSignalVariant(t, HASBIT(_m[t].m2, 3) ? SIG_SEMAPHORE : SIG_ELECTRIC); SetSignalVariant(t, HASBIT(_m[t].m2, 3) ? SIG_SEMAPHORE : SIG_ELECTRIC);
CLRBIT(_m[t].m2, 3); CLRBIT(_m[t].m2, 3);
} }
// Clear PBS reservation on track /* Clear PBS reservation on track */
if (!IsTileDepotType(t, TRANSPORT_RAIL)) { if (!IsTileDepotType(t, TRANSPORT_RAIL)) {
SB(_m[t].m4, 4, 4, 0); SB(_m[t].m4, 4, 4, 0);
} else { } else {
@ -1625,13 +1627,11 @@ bool AfterLoadGame()
} }
break; break;
case MP_STREET: case MP_STREET: /* Clear PBS reservation on crossing */
// Clear PBS reservation on crossing
if (IsLevelCrossing(t)) CLRBIT(_m[t].m5, 0); if (IsLevelCrossing(t)) CLRBIT(_m[t].m5, 0);
break; break;
case MP_STATION: case MP_STATION: /* Clear PBS reservation on station */
// Clear PBS reservation on station
CLRBIT(_m[t].m3, 6); CLRBIT(_m[t].m3, 6);
break; break;

View File

@ -1,5 +1,7 @@
/* $Id$ */ /* $Id$ */
/** @file order_cmd.cpp */
#include "stdafx.h" #include "stdafx.h"
#include "openttd.h" #include "openttd.h"
#include "order.h" #include "order.h"

View File

@ -1,5 +1,7 @@
/* $Id$ */ /* $Id$ */
/** @file order_gui.cpp */
#include "stdafx.h" #include "stdafx.h"
#include "openttd.h" #include "openttd.h"
#include "road_map.h" #include "road_map.h"

View File

@ -1,5 +1,7 @@
/* $Id$ */ /* $Id$ */
/** @file os2.cpp */
#include "stdafx.h" #include "stdafx.h"
#include "openttd.h" #include "openttd.h"
#include "variables.h" #include "variables.h"

View File

@ -1,5 +1,7 @@
/* $Id$ */ /* $Id$ */
/** @file os_timer.cpp */
#include "stdafx.h" #include "stdafx.h"
#undef RDTSC_AVAILABLE #undef RDTSC_AVAILABLE