mirror of https://github.com/OpenTTD/OpenTTD
(svn r6204) -Cleanup: replace non-indentation with spaces; like '}<TAB>else {' -> '} else {', tabs between code and comment, etc.
parent
8cc7aa9aa0
commit
27cee58ab8
|
@ -2499,8 +2499,8 @@ static bool AiCheckRoadResources(TileIndex tile, const AiDefaultBlockData *p, by
|
||||||
int rad;
|
int rad;
|
||||||
|
|
||||||
if (_patches.modified_catchment) {
|
if (_patches.modified_catchment) {
|
||||||
rad = CA_TRUCK; //Same as CA_BUS at the moment?
|
rad = CA_TRUCK; // Same as CA_BUS at the moment?
|
||||||
} else { //change that at some point?
|
} else { // change that at some point?
|
||||||
rad = 4;
|
rad = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3011,9 +3011,9 @@ do_some_terraform:
|
||||||
bridge_len = GetBridgeLength(tile, p->ai.cur_tile_a); // tile
|
bridge_len = GetBridgeLength(tile, p->ai.cur_tile_a); // tile
|
||||||
|
|
||||||
/* Figure out what (road)bridge type to build
|
/* Figure out what (road)bridge type to build
|
||||||
start with best bridge, then go down to worse and worse bridges
|
* start with best bridge, then go down to worse and worse bridges
|
||||||
unnecessary to check for worse bridge (i=0), since AI will always build that.
|
* unnecessary to check for worse bridge (i=0), since AI will always build that.
|
||||||
AI is so fucked up that fixing this small thing will probably not solve a thing
|
*AI is so fucked up that fixing this small thing will probably not solve a thing
|
||||||
*/
|
*/
|
||||||
for (i = 10; i != 0; i--) {
|
for (i = 10; i != 0; i--) {
|
||||||
if (CheckBridge_Stuff(i, bridge_len)) {
|
if (CheckBridge_Stuff(i, bridge_len)) {
|
||||||
|
@ -3320,8 +3320,8 @@ static bool AiCheckAirportResources(TileIndex tile, const AiDefaultBlockData *p,
|
||||||
int rad;
|
int rad;
|
||||||
|
|
||||||
if (_patches.modified_catchment) {
|
if (_patches.modified_catchment) {
|
||||||
rad = CA_AIR_LARGE; //I Have NFI what airport the
|
rad = CA_AIR_LARGE; // I Have NFI what airport the
|
||||||
} else { //AI is going to build here
|
} else { // AI is going to build here
|
||||||
rad = 4;
|
rad = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2105,7 +2105,7 @@ void UpdateAirplanesOnNewStation(Station *st)
|
||||||
if (v->type == VEH_Aircraft && v->subtype <= 2) {
|
if (v->type == VEH_Aircraft && v->subtype <= 2) {
|
||||||
if (v->u.air.targetairport == st->index) { // if heading to this airport
|
if (v->u.air.targetairport == st->index) { // if heading to this airport
|
||||||
/* update position of airplane. If plane is not flying, landing, or taking off
|
/* update position of airplane. If plane is not flying, landing, or taking off
|
||||||
you cannot delete airport, so it doesn't matter
|
*you cannot delete airport, so it doesn't matter
|
||||||
*/
|
*/
|
||||||
if (v->u.air.state >= FLYING) { // circle around
|
if (v->u.air.state >= FLYING) { // circle around
|
||||||
v->u.air.pos = v->u.air.previous_pos = ap->entry_point;
|
v->u.air.pos = v->u.air.previous_pos = ap->entry_point;
|
||||||
|
|
|
@ -340,7 +340,7 @@ static int32 ClearTile_Industry(TileIndex tile, byte flags)
|
||||||
{
|
{
|
||||||
Industry *i = GetIndustryByTile(tile);
|
Industry *i = GetIndustryByTile(tile);
|
||||||
|
|
||||||
/* * water can destroy industries
|
/* water can destroy industries
|
||||||
* in editor you can bulldoze industries
|
* in editor you can bulldoze industries
|
||||||
* with magic_bulldozer cheat you can destroy industries
|
* with magic_bulldozer cheat you can destroy industries
|
||||||
* (area around OILRIG is water, so water shouldn't flood it
|
* (area around OILRIG is water, so water shouldn't flood it
|
||||||
|
|
|
@ -62,10 +62,6 @@ extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
//
|
|
||||||
************************************************************************/
|
|
||||||
|
|
||||||
/* Memory required for the wrkmem parameter.
|
/* Memory required for the wrkmem parameter.
|
||||||
* When the required size is 0, you can also pass a NULL pointer.
|
* When the required size is 0, you can also pass a NULL pointer.
|
||||||
*/
|
*/
|
||||||
|
|
2
npf.c
2
npf.c
|
@ -64,7 +64,7 @@ static uint NTPHash(uint key1, uint key2)
|
||||||
/**
|
/**
|
||||||
* Calculates a hash value for use in the NPF.
|
* Calculates a hash value for use in the NPF.
|
||||||
* @param key1 The TileIndex of the tile to hash
|
* @param key1 The TileIndex of the tile to hash
|
||||||
* @param key1 The Trackdir of the track on the tile.
|
* @param key2 The Trackdir of the track on the tile.
|
||||||
*
|
*
|
||||||
* @todo Think of a better hash.
|
* @todo Think of a better hash.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -341,7 +341,7 @@ static bool ini_save(const char *filename, IniFile *ini)
|
||||||
assert(item->value != NULL);
|
assert(item->value != NULL);
|
||||||
if (item->comment != NULL) fputs(item->comment, f);
|
if (item->comment != NULL) fputs(item->comment, f);
|
||||||
|
|
||||||
//*Don't give an equal sign to list items that don't have a parameter */
|
/* Don't give an equal sign to list items that don't have a parameter */
|
||||||
if (group->type == IGT_LIST && *item->value == '\0') {
|
if (group->type == IGT_LIST && *item->value == '\0') {
|
||||||
fprintf(f, "%s\n", item->name);
|
fprintf(f, "%s\n", item->name);
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -30,8 +30,8 @@ static FileList files_dos = {
|
||||||
{ "dosdummy.grf", {0x07, 0x01, 0xe6, 0xc4, 0x07, 0x6a, 0x5b, 0xc3, 0xf4, 0x9f, 0x01, 0xad, 0x21, 0x6c, 0xa0, 0xc2} }, // 4890 - 4895 inclusive
|
{ "dosdummy.grf", {0x07, 0x01, 0xe6, 0xc4, 0x07, 0x6a, 0x5b, 0xc3, 0xf4, 0x9f, 0x01, 0xad, 0x21, 0x6c, 0xa0, 0xc2} }, // 4890 - 4895 inclusive
|
||||||
{ "nsignalsw.grf", {0x65, 0xb9, 0xd7, 0x30, 0x56, 0x06, 0xcc, 0x9e, 0x27, 0x57, 0xc8, 0xe4, 0x9b, 0xb3, 0x66, 0x81} }, // 4896 - 5381 inclusive
|
{ "nsignalsw.grf", {0x65, 0xb9, 0xd7, 0x30, 0x56, 0x06, 0xcc, 0x9e, 0x27, 0x57, 0xc8, 0xe4, 0x9b, 0xb3, 0x66, 0x81} }, // 4896 - 5381 inclusive
|
||||||
{ NULL, { 0 } }
|
{ NULL, { 0 } }
|
||||||
},
|
}, {
|
||||||
{ { "TRGC.GRF", {0xed, 0x44, 0x66, 0x37, 0xe0, 0x34, 0x10, 0x4c, 0x55, 0x59, 0xb3, 0x2c, 0x18, 0xaf, 0xe7, 0x8d} },
|
{ "TRGC.GRF", {0xed, 0x44, 0x66, 0x37, 0xe0, 0x34, 0x10, 0x4c, 0x55, 0x59, 0xb3, 0x2c, 0x18, 0xaf, 0xe7, 0x8d} },
|
||||||
{ "TRGH.GRF", {0xee, 0x66, 0x16, 0xfb, 0x0e, 0x6e, 0xf6, 0xb2, 0x48, 0x92, 0xc5, 0x8c, 0x93, 0xd8, 0x6f, 0xc9} },
|
{ "TRGH.GRF", {0xee, 0x66, 0x16, 0xfb, 0x0e, 0x6e, 0xf6, 0xb2, 0x48, 0x92, 0xc5, 0x8c, 0x93, 0xd8, 0x6f, 0xc9} },
|
||||||
{ "TRGT.GRF", {0xfc, 0xde, 0x1d, 0x7e, 0x8a, 0x74, 0x19, 0x7d, 0x72, 0xa6, 0x26, 0x95, 0x88, 0x4b, 0x90, 0x9e} }
|
{ "TRGT.GRF", {0xfc, 0xde, 0x1d, 0x7e, 0x8a, 0x74, 0x19, 0x7d, 0x72, 0xa6, 0x26, 0x95, 0x88, 0x4b, 0x90, 0x9e} }
|
||||||
}
|
}
|
||||||
|
@ -44,8 +44,8 @@ static FileList files_win = {
|
||||||
{ "nsignalsw.grf", {0x65, 0xb9, 0xd7, 0x30, 0x56, 0x06, 0xcc, 0x9e, 0x27, 0x57, 0xc8, 0xe4, 0x9b, 0xb3, 0x66, 0x81} }, // 4896 - 5381 inclusive
|
{ "nsignalsw.grf", {0x65, 0xb9, 0xd7, 0x30, 0x56, 0x06, 0xcc, 0x9e, 0x27, 0x57, 0xc8, 0xe4, 0x9b, 0xb3, 0x66, 0x81} }, // 4896 - 5381 inclusive
|
||||||
{ NULL, { 0 } },
|
{ NULL, { 0 } },
|
||||||
{ NULL, { 0 } }
|
{ NULL, { 0 } }
|
||||||
},
|
}, {
|
||||||
{ { "TRGCR.GRF", {0x36, 0x68, 0xf4, 0x10, 0xc7, 0x61, 0xa0, 0x50, 0xb5, 0xe7, 0x09, 0x5a, 0x2b, 0x14, 0x87, 0x9b} },
|
{ "TRGCR.GRF", {0x36, 0x68, 0xf4, 0x10, 0xc7, 0x61, 0xa0, 0x50, 0xb5, 0xe7, 0x09, 0x5a, 0x2b, 0x14, 0x87, 0x9b} },
|
||||||
{ "TRGHR.GRF", {0x06, 0xbf, 0x2b, 0x7a, 0x31, 0x76, 0x6f, 0x04, 0x8b, 0xaa, 0xc2, 0xeb, 0xe4, 0x34, 0x57, 0xb1} },
|
{ "TRGHR.GRF", {0x06, 0xbf, 0x2b, 0x7a, 0x31, 0x76, 0x6f, 0x04, 0x8b, 0xaa, 0xc2, 0xeb, 0xe4, 0x34, 0x57, 0xb1} },
|
||||||
{ "TRGTR.GRF", {0xde, 0x53, 0x65, 0x05, 0x17, 0xfe, 0x66, 0x1c, 0xea, 0xa3, 0x13, 0x8c, 0x6e, 0xdb, 0x0e, 0xb8} }
|
{ "TRGTR.GRF", {0xde, 0x53, 0x65, 0x05, 0x17, 0xfe, 0x66, 0x1c, 0xea, 0xa3, 0x13, 0x8c, 0x6e, 0xdb, 0x0e, 0xb8} }
|
||||||
}
|
}
|
||||||
|
|
10
train_gui.c
10
train_gui.c
|
@ -454,7 +454,7 @@ static void DrawTrainDepotWindow(Window *w)
|
||||||
|
|
||||||
// Number of wagons relative to a standard length wagon (rounded up)
|
// Number of wagons relative to a standard length wagon (rounded up)
|
||||||
SetDParam(0, (v->u.rail.cached_total_length + 7) / 8);
|
SetDParam(0, (v->u.rail.cached_total_length + 7) / 8);
|
||||||
DrawStringRightAligned(w->widget[6].right - 1, y + 4, STR_TINY_BLACK, 0); //Draw the counter
|
DrawStringRightAligned(w->widget[6].right - 1, y + 4, STR_TINY_BLACK, 0); // Draw the counter
|
||||||
|
|
||||||
/* Draw the pretty flag */
|
/* Draw the pretty flag */
|
||||||
DrawSprite(v->vehstatus & VS_STOPPED ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, x + 15, y);
|
DrawSprite(v->vehstatus & VS_STOPPED ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, x + 15, y);
|
||||||
|
@ -474,9 +474,9 @@ static void DrawTrainDepotWindow(Window *w)
|
||||||
/*Draw the train counter */
|
/*Draw the train counter */
|
||||||
i = 0;
|
i = 0;
|
||||||
u = v;
|
u = v;
|
||||||
do i++; while ( (u=u->next) != NULL); //Determine length of train
|
do i++; while ( (u=u->next) != NULL); // Determine length of train
|
||||||
SetDParam(0, i); //Set the counter
|
SetDParam(0, i); // Set the counter
|
||||||
DrawStringRightAligned(w->widget[6].right - 1, y + 4, STR_TINY_BLACK, 0); //Draw the counter
|
DrawStringRightAligned(w->widget[6].right - 1, y + 4, STR_TINY_BLACK, 0); // Draw the counter
|
||||||
y += 14;
|
y += 14;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1171,7 +1171,7 @@ static void DrawTrainDetailsWindow(Window *w)
|
||||||
} while ((u = GetNextVehicle(u)) != NULL);
|
} while ((u = GetNextVehicle(u)) != NULL);
|
||||||
|
|
||||||
/* set scroll-amount seperately from counting, as to not
|
/* set scroll-amount seperately from counting, as to not
|
||||||
compute num double for more carriages of the same type
|
* compute num double for more carriages of the same type
|
||||||
*/
|
*/
|
||||||
if (det_tab == 3) {
|
if (det_tab == 3) {
|
||||||
for (i = 0; i != NUM_CARGO; i++) {
|
for (i = 0; i != NUM_CARGO; i++) {
|
||||||
|
|
|
@ -414,8 +414,8 @@ not_valid_below:;
|
||||||
YapfNotifyTrackLayoutChange(tile_start, AxisToTrack(direction));
|
YapfNotifyTrackLayoutChange(tile_start, AxisToTrack(direction));
|
||||||
|
|
||||||
/* for human player that builds the bridge he gets a selection to choose from bridges (DC_QUERY_COST)
|
/* for human player that builds the bridge he gets a selection to choose from bridges (DC_QUERY_COST)
|
||||||
It's unnecessary to execute this command every time for every bridge. So it is done only
|
* It's unnecessary to execute this command every time for every bridge. So it is done only
|
||||||
and cost is computed in "bridge_gui.c". For AI, Towns this has to be of course calculated
|
* and cost is computed in "bridge_gui.c". For AI, Towns this has to be of course calculated
|
||||||
*/
|
*/
|
||||||
if (!(flags & DC_QUERY_COST)) {
|
if (!(flags & DC_QUERY_COST)) {
|
||||||
const Bridge *b = &_bridge[bridge_type];
|
const Bridge *b = &_bridge[bridge_type];
|
||||||
|
|
|
@ -44,7 +44,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define CMD_BUILD_VEH(x) _veh_build_proc_table[ x - VEH_Train]
|
#define CMD_BUILD_VEH(x) _veh_build_proc_table[ x - VEH_Train]
|
||||||
#define CMD_SELL_VEH(x) _veh_sell_proc_table[ x - VEH_Train]
|
#define CMD_SELL_VEH(x) _veh_sell_proc_table [ x - VEH_Train]
|
||||||
#define CMD_REFIT_VEH(x) _veh_refit_proc_table[ x - VEH_Train]
|
#define CMD_REFIT_VEH(x) _veh_refit_proc_table[ x - VEH_Train]
|
||||||
|
|
||||||
static const uint32 _veh_build_proc_table[] = {
|
static const uint32 _veh_build_proc_table[] = {
|
||||||
|
@ -339,7 +339,7 @@ Vehicle *AllocateVehicle(void)
|
||||||
/** Allocates a lot of vehicles and frees them again
|
/** Allocates a lot of vehicles and frees them again
|
||||||
* @param vl pointer to an array of vehicles to get allocated. Can be NULL if the vehicles aren't needed (makes it test only)
|
* @param vl pointer to an array of vehicles to get allocated. Can be NULL if the vehicles aren't needed (makes it test only)
|
||||||
* @param num number of vehicles to allocate room for
|
* @param num number of vehicles to allocate room for
|
||||||
* returns true if there is room to allocate all the vehicles
|
* @return true if there is room to allocate all the vehicles
|
||||||
*/
|
*/
|
||||||
bool AllocateVehicles(Vehicle **vl, int num)
|
bool AllocateVehicles(Vehicle **vl, int num)
|
||||||
{
|
{
|
||||||
|
@ -1759,7 +1759,7 @@ static int32 ReplaceVehicle(Vehicle **w, byte flags)
|
||||||
* (used to be called autorenew)
|
* (used to be called autorenew)
|
||||||
* @param v The vehicle to replace
|
* @param v The vehicle to replace
|
||||||
* if the vehicle is a train, v needs to be the front engine
|
* if the vehicle is a train, v needs to be the front engine
|
||||||
* return value is a pointer to the new vehicle, which is the same as the argument if nothing happened
|
* @return pointer to the new vehicle, which is the same as the argument if nothing happened
|
||||||
*/
|
*/
|
||||||
static void MaybeReplaceVehicle(Vehicle *v)
|
static void MaybeReplaceVehicle(Vehicle *v)
|
||||||
{
|
{
|
||||||
|
|
|
@ -465,7 +465,8 @@ static int CDECL VehicleValueSorter(const void *a, const void *b)
|
||||||
|
|
||||||
/* if show_outdated is selected, it do not sort psudo engines properly but it draws all engines
|
/* if show_outdated is selected, it do not sort psudo engines properly but it draws all engines
|
||||||
* if used compined with show_cars set to false, it will work as intended. Replace window do it like that
|
* if used compined with show_cars set to false, it will work as intended. Replace window do it like that
|
||||||
* this was a big hack even before show_outdated was added. Stupid newgrf :p */
|
* this was a big hack even before show_outdated was added. Stupid newgrf :p
|
||||||
|
*/
|
||||||
static void train_engine_drawing_loop(int *x, int *y, int *pos, int *sel, EngineID *selected_id, RailType railtype,
|
static void train_engine_drawing_loop(int *x, int *y, int *pos, int *sel, EngineID *selected_id, RailType railtype,
|
||||||
uint8 lines_drawn, bool is_engine, bool show_cars, bool show_outdated, bool show_compatible)
|
uint8 lines_drawn, bool is_engine, bool show_cars, bool show_outdated, bool show_compatible)
|
||||||
{
|
{
|
||||||
|
|
|
@ -94,7 +94,7 @@ static const VkMapping _vk_mapping[] = {
|
||||||
AS(VK_ESCAPE, WKC_ESC),
|
AS(VK_ESCAPE, WKC_ESC),
|
||||||
AS(VK_PAUSE, WKC_PAUSE),
|
AS(VK_PAUSE, WKC_PAUSE),
|
||||||
AS(VK_BACK, WKC_BACKSPACE),
|
AS(VK_BACK, WKC_BACKSPACE),
|
||||||
AM(VK_INSERT,VK_DELETE,WKC_INSERT, WKC_DELETE),
|
AM(VK_INSERT, VK_DELETE, WKC_INSERT, WKC_DELETE),
|
||||||
|
|
||||||
AS(VK_SPACE, WKC_SPACE),
|
AS(VK_SPACE, WKC_SPACE),
|
||||||
AS(VK_RETURN, WKC_RETURN),
|
AS(VK_RETURN, WKC_RETURN),
|
||||||
|
@ -105,7 +105,7 @@ static const VkMapping _vk_mapping[] = {
|
||||||
|
|
||||||
// Numeric part.
|
// Numeric part.
|
||||||
// What is the virtual keycode for numeric enter??
|
// What is the virtual keycode for numeric enter??
|
||||||
AM(VK_NUMPAD0,VK_NUMPAD9, WKC_NUM_0, WKC_NUM_9),
|
AM(VK_NUMPAD0, VK_NUMPAD9, WKC_NUM_0, WKC_NUM_9),
|
||||||
AS(VK_DIVIDE, WKC_NUM_DIV),
|
AS(VK_DIVIDE, WKC_NUM_DIV),
|
||||||
AS(VK_MULTIPLY, WKC_NUM_MUL),
|
AS(VK_MULTIPLY, WKC_NUM_MUL),
|
||||||
AS(VK_SUBTRACT, WKC_NUM_MINUS),
|
AS(VK_SUBTRACT, WKC_NUM_MINUS),
|
||||||
|
|
Loading…
Reference in New Issue