mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r1610) Remove trailing whitespace (last time ever, i hope)
This commit is contained in:
parent
80131e1e4a
commit
44f48ce915
|
@ -203,7 +203,7 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
|
||||||
|
|
||||||
CheckRedrawStationCoverage(w);
|
CheckRedrawStationCoverage(w);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case WE_DESTROY:
|
case WE_DESTROY:
|
||||||
ResetObjectToPlace();
|
ResetObjectToPlace();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -1089,7 +1089,7 @@ void IConsoleCmdExec(const char* cmdstr)
|
||||||
uint c;
|
uint c;
|
||||||
uint i;
|
uint i;
|
||||||
uint l;
|
uint l;
|
||||||
|
|
||||||
if (strlen(cmdstr) == 0) // only execute if there is something typed obviously
|
if (strlen(cmdstr) == 0) // only execute if there is something typed obviously
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
|
@ -105,7 +105,7 @@ void WINAPI CheckForConsoleInput(void)
|
||||||
void CreateWindowsConsoleThread(void)
|
void CreateWindowsConsoleThread(void)
|
||||||
{
|
{
|
||||||
/* Create event to signal when console input is ready */
|
/* Create event to signal when console input is ready */
|
||||||
hEvent = CreateEvent(NULL, false, false, "keyboard input");
|
hEvent = CreateEvent(NULL, false, false, "keyboard input");
|
||||||
|
|
||||||
hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CheckForConsoleInput, 0, 0, NULL);
|
hThread = CreateThread(NULL, 0, (LPTHREAD_START_ROUTINE)CheckForConsoleInput, 0, 0, NULL);
|
||||||
if (hThread == NULL)
|
if (hThread == NULL)
|
||||||
|
@ -151,7 +151,7 @@ static void DedicatedVideoStop(void)
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
CloseWindowsConsoleThread();
|
CloseWindowsConsoleThread();
|
||||||
#endif
|
#endif
|
||||||
free(_dedicated_video_mem);
|
free(_dedicated_video_mem);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void DedicatedVideoMakeDirty(int left, int top, int width, int height) {}
|
static void DedicatedVideoMakeDirty(int left, int top, int width, int height) {}
|
||||||
|
@ -183,7 +183,7 @@ static bool InputWaiting(void)
|
||||||
{
|
{
|
||||||
if (WaitForSingleObject(hEvent, 1) == WAIT_OBJECT_0)
|
if (WaitForSingleObject(hEvent, 1) == WAIT_OBJECT_0)
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
2
fileio.c
2
fileio.c
|
@ -87,7 +87,7 @@ void FioReadBlock(void *ptr, uint size)
|
||||||
static inline void FioCloseFile(int slot)
|
static inline void FioCloseFile(int slot)
|
||||||
{
|
{
|
||||||
if (_fio.handles[slot] != NULL) {
|
if (_fio.handles[slot] != NULL) {
|
||||||
fclose(_fio.handles[slot]);
|
fclose(_fio.handles[slot]);
|
||||||
_fio.handles[slot] = NULL;
|
_fio.handles[slot] = NULL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -121,7 +121,7 @@ void HandleOnEditText(WindowEvent *e) {
|
||||||
* @param cursor How should the cursor image change? E.g. cursor with depot image in it
|
* @param cursor How should the cursor image change? E.g. cursor with depot image in it
|
||||||
* @param mode Tile highlighting mode, e.g. drawing a rectangle or a dot on the ground
|
* @param mode Tile highlighting mode, e.g. drawing a rectangle or a dot on the ground
|
||||||
* @param placeproc Procedure which will be called when someone clicks on the map
|
* @param placeproc Procedure which will be called when someone clicks on the map
|
||||||
|
|
||||||
* @return true if the button is clicked, false if it's unclicked
|
* @return true if the button is clicked, false if it's unclicked
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -13,7 +13,7 @@ static inline int32 SeedChanceBias(int shift_by, int max, uint32 seed, int bias)
|
||||||
return SeedChance(shift_by, max + bias, seed) - bias;
|
return SeedChance(shift_by, max + bias, seed) - bias;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ReplaceWords(const char *org, const char *rep, char *buf)
|
static void ReplaceWords(const char *org, const char *rep, char *buf)
|
||||||
{
|
{
|
||||||
if (strncmp(buf, org, 4) == 0) strncpy(buf, rep, 4);
|
if (strncmp(buf, org, 4) == 0) strncpy(buf, rep, 4);
|
||||||
}
|
}
|
||||||
|
|
|
@ -927,5 +927,5 @@ void ShowEndGameChart(void)
|
||||||
w->window_number = _opt.diff_level;
|
w->window_number = _opt.diff_level;
|
||||||
WP(w, highscore_d).rank = SaveHighScoreValue(p);
|
WP(w, highscore_d).rank = SaveHighScoreValue(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1140,7 +1140,7 @@ int32 CmdRemoveSignals(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
|
|
||||||
/* Do it? */
|
/* Do it? */
|
||||||
if (flags & DC_EXEC) {
|
if (flags & DC_EXEC) {
|
||||||
|
|
||||||
_map3_lo[tile] &= ~c;
|
_map3_lo[tile] &= ~c;
|
||||||
|
|
||||||
/* removed last signal from tile? */
|
/* removed last signal from tile? */
|
||||||
|
@ -1149,7 +1149,7 @@ int32 CmdRemoveSignals(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
_map2[tile] &= ~0xF0;
|
_map2[tile] &= ~0xF0;
|
||||||
CLRBIT(_map3_hi[tile], 2); // remove any possible semaphores
|
CLRBIT(_map3_hi[tile], 2); // remove any possible semaphores
|
||||||
}
|
}
|
||||||
|
|
||||||
SetSignalsOnBothDir(tile, track);
|
SetSignalsOnBothDir(tile, track);
|
||||||
|
|
||||||
MarkTileDirtyByTile(tile);
|
MarkTileDirtyByTile(tile);
|
||||||
|
@ -1289,7 +1289,7 @@ regular_track:;
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
cost += ret;
|
cost += ret;
|
||||||
};
|
};
|
||||||
|
|
||||||
m5 &= RAIL_BIT_MASK;
|
m5 &= RAIL_BIT_MASK;
|
||||||
if (flags & DC_EXEC)
|
if (flags & DC_EXEC)
|
||||||
goto regular_track;
|
goto regular_track;
|
||||||
|
|
|
@ -465,7 +465,7 @@ static void RoadStationPickerWndProc(Window *w, WindowEvent *e)
|
||||||
|
|
||||||
CheckRedrawStationCoverage(w);
|
CheckRedrawStationCoverage(w);
|
||||||
} break;
|
} break;
|
||||||
|
|
||||||
case WE_DESTROY:
|
case WE_DESTROY:
|
||||||
ResetObjectToPlace();
|
ResetObjectToPlace();
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -367,7 +367,7 @@ int32 EstimateTrainCost(const RailVehicleInfo *rvi)
|
||||||
return (rvi->base_cost * (_price.build_railvehicle >> 3)) >> 5;
|
return (rvi->base_cost * (_price.build_railvehicle >> 3)) >> 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddRearEngineToMultiheadedTrain(Vehicle *v, Vehicle *u, bool building)
|
void AddRearEngineToMultiheadedTrain(Vehicle *v, Vehicle *u, bool building)
|
||||||
{
|
{
|
||||||
u->direction = v->direction;
|
u->direction = v->direction;
|
||||||
u->owner = v->owner;
|
u->owner = v->owner;
|
||||||
|
@ -387,7 +387,7 @@ void AddRearEngineToMultiheadedTrain(Vehicle *v, Vehicle *u, bool building)
|
||||||
if (building) v->next = u;
|
if (building) v->next = u;
|
||||||
u->engine_type = v->engine_type;
|
u->engine_type = v->engine_type;
|
||||||
u->build_year = v->build_year;
|
u->build_year = v->build_year;
|
||||||
if (building)
|
if (building)
|
||||||
v->value = u->value = v->value >> 1;
|
v->value = u->value = v->value >> 1;
|
||||||
else
|
else
|
||||||
u->value = v->value;
|
u->value = v->value;
|
||||||
|
@ -2399,7 +2399,7 @@ static void HandleCrashedTrain(Vehicle *v)
|
||||||
ChangeTrainDirRandomly(v);
|
ChangeTrainDirRandomly(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (state >= 4440 && !(v->tick_counter&0x1F))
|
if (state >= 4440 && !(v->tick_counter&0x1F))
|
||||||
DeleteLastWagon(v);
|
DeleteLastWagon(v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
2
ttd.c
2
ttd.c
|
@ -729,7 +729,7 @@ int ttd_main(int argc, char* argv[])
|
||||||
LoadIntroGame();
|
LoadIntroGame();
|
||||||
_switch_mode = SM_NONE;
|
_switch_mode = SM_NONE;
|
||||||
NetworkClientConnectGame(network_conn, rport);
|
NetworkClientConnectGame(network_conn, rport);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* ENABLE_NETWORK */
|
#endif /* ENABLE_NETWORK */
|
||||||
|
|
||||||
|
|
|
@ -817,8 +817,8 @@ static int32 ClearTile_TunnelBridge(uint tile, byte flags) {
|
||||||
return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
|
return_cmd_error(STR_5007_MUST_DEMOLISH_BRIDGE_FIRST);
|
||||||
|
|
||||||
return DoClearBridge(tile, flags);
|
return DoClearBridge(tile, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
20
vehicle.c
20
vehicle.c
|
@ -1361,20 +1361,20 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
settings, a vehicle can be replaced twice.. check if this is the situation here */
|
settings, a vehicle can be replaced twice.. check if this is the situation here */
|
||||||
if (old_engine_type == new_engine_type && v->age == 0)
|
if (old_engine_type == new_engine_type && v->age == 0)
|
||||||
return CMD_ERROR;
|
return CMD_ERROR;
|
||||||
|
|
||||||
if ( v->type == VEH_Train ) {
|
if ( v->type == VEH_Train ) {
|
||||||
u = GetLastVehicleInChain(v);
|
u = GetLastVehicleInChain(v);
|
||||||
if ( RailVehInfo(new_engine_type)->flags & RVI_MULTIHEAD )
|
if ( RailVehInfo(new_engine_type)->flags & RVI_MULTIHEAD )
|
||||||
build_cost = build_cost >> 1; //multiheaded engines have EstimateTrainCost() for both engines
|
build_cost = build_cost >> 1; //multiheaded engines have EstimateTrainCost() for both engines
|
||||||
|
|
||||||
if ( old_engine_type != new_engine_type ) {
|
if ( old_engine_type != new_engine_type ) {
|
||||||
|
|
||||||
// prevent that the rear engine can get replaced to something else than the front engine
|
// prevent that the rear engine can get replaced to something else than the front engine
|
||||||
if ( v->u.rail.first_engine != 0xffff && RailVehInfo(old_engine_type)->flags & RVI_MULTIHEAD && RailVehInfo(old_engine_type)->flags ) {
|
if ( v->u.rail.first_engine != 0xffff && RailVehInfo(old_engine_type)->flags & RVI_MULTIHEAD && RailVehInfo(old_engine_type)->flags ) {
|
||||||
Vehicle *first = GetFirstVehicleInChain(v);
|
Vehicle *first = GetFirstVehicleInChain(v);
|
||||||
if ( first->engine_type != new_engine_type ) return CMD_ERROR;
|
if ( first->engine_type != new_engine_type ) return CMD_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
// checks if the engine is the first one
|
// checks if the engine is the first one
|
||||||
if ( v->u.rail.first_engine == 0xffff ) {
|
if ( v->u.rail.first_engine == 0xffff ) {
|
||||||
if ( RailVehInfo(new_engine_type)->flags & RVI_MULTIHEAD ) {
|
if ( RailVehInfo(new_engine_type)->flags & RVI_MULTIHEAD ) {
|
||||||
|
@ -1431,7 +1431,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
|
|
||||||
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
|
InvalidateWindow(WC_VEHICLE_DETAILS, v->index);
|
||||||
|
|
||||||
|
|
||||||
if (v->engine_type != new_engine_type) {
|
if (v->engine_type != new_engine_type) {
|
||||||
byte sprite = v->spritenum;
|
byte sprite = v->spritenum;
|
||||||
byte cargo_type = v->cargo_type;
|
byte cargo_type = v->cargo_type;
|
||||||
|
@ -1471,7 +1471,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
} else {
|
} else {
|
||||||
v->cargo_type = rvi->cargo_type;
|
v->cargo_type = rvi->cargo_type;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( rvi2->flags & RVI_MULTIHEAD && !(rvi->flags & RVI_MULTIHEAD) && v->index == first->index) {
|
if ( rvi2->flags & RVI_MULTIHEAD && !(rvi->flags & RVI_MULTIHEAD) && v->index == first->index) {
|
||||||
if (old_engine_type == u->engine_type ) {
|
if (old_engine_type == u->engine_type ) {
|
||||||
Vehicle *w;
|
Vehicle *w;
|
||||||
|
@ -1482,11 +1482,11 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
DeleteVehicle(u);
|
DeleteVehicle(u);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( rvi->flags & RVI_MULTIHEAD && rvi2->flags & RVI_MULTIHEAD && v->index == first->index ) {
|
if ( rvi->flags & RVI_MULTIHEAD && rvi2->flags & RVI_MULTIHEAD && v->index == first->index ) {
|
||||||
CmdReplaceVehicle(x, y, flags, u->index, p2);
|
CmdReplaceVehicle(x, y, flags, u->index, p2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( rvi->flags & RVI_MULTIHEAD && !(rvi2->flags & RVI_MULTIHEAD) && v->index == first->index ) {
|
if ( rvi->flags & RVI_MULTIHEAD && !(rvi2->flags & RVI_MULTIHEAD) && v->index == first->index ) {
|
||||||
if ( old_engine_type != u->engine_type ) {
|
if ( old_engine_type != u->engine_type ) {
|
||||||
Vehicle *w;
|
Vehicle *w;
|
||||||
|
@ -1496,7 +1496,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// updates the id of the front engine in the other units, since the front engine just got a new engine_id
|
// updates the id of the front engine in the other units, since the front engine just got a new engine_id
|
||||||
// this is needed for wagon override
|
// this is needed for wagon override
|
||||||
if ( v->u.rail.first_engine == 0xffff && v->next != NULL ) {
|
if ( v->u.rail.first_engine == 0xffff && v->next != NULL ) {
|
||||||
|
@ -1505,7 +1505,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
||||||
veh->u.rail.first_engine = new_engine_type;
|
veh->u.rail.first_engine = new_engine_type;
|
||||||
} while ( (veh=veh->next) != NULL );
|
} while ( (veh=veh->next) != NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case VEH_Road:
|
case VEH_Road:
|
||||||
|
|
14
viewport.c
14
viewport.c
|
@ -689,7 +689,7 @@ static void DrawTileSelection(const TileInfo *ti)
|
||||||
|
|
||||||
diffx = myabs(TileX(start)-TileX(ti->tile));
|
diffx = myabs(TileX(start)-TileX(ti->tile));
|
||||||
diffy = myabs(TileY(start)-TileY(ti->tile));
|
diffy = myabs(TileY(start)-TileY(ti->tile));
|
||||||
|
|
||||||
side = myabs( diffx-diffy );
|
side = myabs( diffx-diffy );
|
||||||
if(dir<2) side = 0;
|
if(dir<2) side = 0;
|
||||||
|
|
||||||
|
@ -697,7 +697,7 @@ static void DrawTileSelection(const TileInfo *ti)
|
||||||
|
|
||||||
if (thd->make_square_red) image |= 0x3048000;
|
if (thd->make_square_red) image |= 0x3048000;
|
||||||
DrawSelectionSprite(image, ti);
|
DrawSelectionSprite(image, ti);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1963,7 +1963,7 @@ void VpStartPreSizing(void)
|
||||||
_special_mouse_mode = WSM_PRESIZE;
|
_special_mouse_mode = WSM_PRESIZE;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* returns information about the 2x1 piece to be build.
|
/* returns information about the 2x1 piece to be build.
|
||||||
* The lower bits (0-3) are the track type. */
|
* The lower bits (0-3) are the track type. */
|
||||||
static byte Check2x1AutoRail(int mode)
|
static byte Check2x1AutoRail(int mode)
|
||||||
{
|
{
|
||||||
|
@ -2025,7 +2025,7 @@ static void CalcRaildirsDrawstyle(TileHighlightData *thd, int x, int y, int meth
|
||||||
b = (Check2x1AutoRail(3)) | HT_LINE;
|
b = (Check2x1AutoRail(3)) | HT_LINE;
|
||||||
else if (dx==-16)
|
else if (dx==-16)
|
||||||
b = (Check2x1AutoRail(2)) | HT_LINE;
|
b = (Check2x1AutoRail(2)) | HT_LINE;
|
||||||
else
|
else
|
||||||
b = HT_LINE | HT_DIR_X;
|
b = HT_LINE | HT_DIR_X;
|
||||||
y = thd->selstart.y;
|
y = thd->selstart.y;
|
||||||
} else if (w == 16) { // Or Y direction?
|
} else if (w == 16) { // Or Y direction?
|
||||||
|
@ -2033,7 +2033,7 @@ static void CalcRaildirsDrawstyle(TileHighlightData *thd, int x, int y, int meth
|
||||||
b = (Check2x1AutoRail(1)) | HT_LINE;
|
b = (Check2x1AutoRail(1)) | HT_LINE;
|
||||||
else if (dy==-16) // 2x1 other direction
|
else if (dy==-16) // 2x1 other direction
|
||||||
b = (Check2x1AutoRail(0)) | HT_LINE;
|
b = (Check2x1AutoRail(0)) | HT_LINE;
|
||||||
else
|
else
|
||||||
b = HT_LINE | HT_DIR_Y;
|
b = HT_LINE | HT_DIR_Y;
|
||||||
x = thd->selstart.x;
|
x = thd->selstart.x;
|
||||||
} else if (w > h * 2) { // still count as x dir?
|
} else if (w > h * 2) { // still count as x dir?
|
||||||
|
@ -2131,7 +2131,7 @@ void VpSelectTilesWithMethod(int x, int y, int method)
|
||||||
thd->selend.y = y;
|
thd->selend.y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
// while dragging
|
// while dragging
|
||||||
bool VpHandlePlaceSizingDrag(void)
|
bool VpHandlePlaceSizingDrag(void)
|
||||||
{
|
{
|
||||||
Window *w;
|
Window *w;
|
||||||
|
@ -2160,7 +2160,7 @@ bool VpHandlePlaceSizingDrag(void)
|
||||||
// mouse button released..
|
// mouse button released..
|
||||||
// keep the selected tool, but reset it to the original mode.
|
// keep the selected tool, but reset it to the original mode.
|
||||||
_special_mouse_mode = WSM_NONE;
|
_special_mouse_mode = WSM_NONE;
|
||||||
if (_thd.next_drawstyle == HT_RECT)
|
if (_thd.next_drawstyle == HT_RECT)
|
||||||
_thd.place_mode = VHM_RECT;
|
_thd.place_mode = VHM_RECT;
|
||||||
else if ((e.place.userdata & 0xF) == VPM_SIGNALDIRS) // some might call this a hack... -- Dominik
|
else if ((e.place.userdata & 0xF) == VPM_SIGNALDIRS) // some might call this a hack... -- Dominik
|
||||||
_thd.place_mode = VHM_RECT;
|
_thd.place_mode = VHM_RECT;
|
||||||
|
|
|
@ -79,7 +79,7 @@ enum {
|
||||||
HT_RAIL = 0x10, /* autorail (one piece)
|
HT_RAIL = 0x10, /* autorail (one piece)
|
||||||
* (uses lower bits to indicate direction) */
|
* (uses lower bits to indicate direction) */
|
||||||
|
|
||||||
/* lower bits (used with HT_LINE and HT_RAIL):
|
/* lower bits (used with HT_LINE and HT_RAIL):
|
||||||
* (see ASCII art in autorail.h for a visual interpretation) */
|
* (see ASCII art in autorail.h for a visual interpretation) */
|
||||||
HT_DIR_X = 0, // X direction
|
HT_DIR_X = 0, // X direction
|
||||||
HT_DIR_Y = 1, // Y direction
|
HT_DIR_Y = 1, // Y direction
|
||||||
|
|
4
window.c
4
window.c
|
@ -52,8 +52,8 @@ void DispatchLeftClickEvent(Window *w, int x, int y) {
|
||||||
if (e.click.widget == 0) { /* 'X' */
|
if (e.click.widget == 0) { /* 'X' */
|
||||||
DeleteWindow(w);
|
DeleteWindow(w);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.click.widget == 1) /* 'Title bar' */
|
if (e.click.widget == 1) /* 'Title bar' */
|
||||||
StartWindowDrag(w);
|
StartWindowDrag(w);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue