mirror of https://github.com/OpenTTD/OpenTTD
(svn r1610) Remove trailing whitespace (last time ever, i hope)
parent
80131e1e4a
commit
44f48ce915
|
@ -203,7 +203,7 @@ static void BuildAirportPickerWndProc(Window *w, WindowEvent *e)
|
|||
|
||||
CheckRedrawStationCoverage(w);
|
||||
} break;
|
||||
|
||||
|
||||
case WE_DESTROY:
|
||||
ResetObjectToPlace();
|
||||
break;
|
||||
|
|
|
@ -1089,7 +1089,7 @@ void IConsoleCmdExec(const char* cmdstr)
|
|||
uint c;
|
||||
uint i;
|
||||
uint l;
|
||||
|
||||
|
||||
if (strlen(cmdstr) == 0) // only execute if there is something typed obviously
|
||||
return;
|
||||
|
||||
|
|
|
@ -105,7 +105,7 @@ void WINAPI CheckForConsoleInput(void)
|
|||
void CreateWindowsConsoleThread(void)
|
||||
{
|
||||
/* 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);
|
||||
if (hThread == NULL)
|
||||
|
@ -151,7 +151,7 @@ static void DedicatedVideoStop(void)
|
|||
#ifdef WIN32
|
||||
CloseWindowsConsoleThread();
|
||||
#endif
|
||||
free(_dedicated_video_mem);
|
||||
free(_dedicated_video_mem);
|
||||
}
|
||||
|
||||
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)
|
||||
return true;
|
||||
|
||||
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
|
2
fileio.c
2
fileio.c
|
@ -87,7 +87,7 @@ void FioReadBlock(void *ptr, uint size)
|
|||
static inline void FioCloseFile(int slot)
|
||||
{
|
||||
if (_fio.handles[slot] != NULL) {
|
||||
fclose(_fio.handles[slot]);
|
||||
fclose(_fio.handles[slot]);
|
||||
_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 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
|
||||
|
||||
|
||||
* @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;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
|
|
@ -927,5 +927,5 @@ void ShowEndGameChart(void)
|
|||
w->window_number = _opt.diff_level;
|
||||
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? */
|
||||
if (flags & DC_EXEC) {
|
||||
|
||||
|
||||
_map3_lo[tile] &= ~c;
|
||||
|
||||
/* removed last signal from tile? */
|
||||
|
@ -1149,7 +1149,7 @@ int32 CmdRemoveSignals(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
|||
_map2[tile] &= ~0xF0;
|
||||
CLRBIT(_map3_hi[tile], 2); // remove any possible semaphores
|
||||
}
|
||||
|
||||
|
||||
SetSignalsOnBothDir(tile, track);
|
||||
|
||||
MarkTileDirtyByTile(tile);
|
||||
|
@ -1289,7 +1289,7 @@ regular_track:;
|
|||
return CMD_ERROR;
|
||||
cost += ret;
|
||||
};
|
||||
|
||||
|
||||
m5 &= RAIL_BIT_MASK;
|
||||
if (flags & DC_EXEC)
|
||||
goto regular_track;
|
||||
|
|
|
@ -465,7 +465,7 @@ static void RoadStationPickerWndProc(Window *w, WindowEvent *e)
|
|||
|
||||
CheckRedrawStationCoverage(w);
|
||||
} break;
|
||||
|
||||
|
||||
case WE_DESTROY:
|
||||
ResetObjectToPlace();
|
||||
break;
|
||||
|
|
|
@ -367,7 +367,7 @@ int32 EstimateTrainCost(const RailVehicleInfo *rvi)
|
|||
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->owner = v->owner;
|
||||
|
@ -387,7 +387,7 @@ void AddRearEngineToMultiheadedTrain(Vehicle *v, Vehicle *u, bool building)
|
|||
if (building) v->next = u;
|
||||
u->engine_type = v->engine_type;
|
||||
u->build_year = v->build_year;
|
||||
if (building)
|
||||
if (building)
|
||||
v->value = u->value = v->value >> 1;
|
||||
else
|
||||
u->value = v->value;
|
||||
|
@ -2399,7 +2399,7 @@ static void HandleCrashedTrain(Vehicle *v)
|
|||
ChangeTrainDirRandomly(v);
|
||||
}
|
||||
|
||||
if (state >= 4440 && !(v->tick_counter&0x1F))
|
||||
if (state >= 4440 && !(v->tick_counter&0x1F))
|
||||
DeleteLastWagon(v);
|
||||
}
|
||||
|
||||
|
|
2
ttd.c
2
ttd.c
|
@ -729,7 +729,7 @@ int ttd_main(int argc, char* argv[])
|
|||
LoadIntroGame();
|
||||
_switch_mode = SM_NONE;
|
||||
NetworkClientConnectGame(network_conn, rport);
|
||||
}
|
||||
}
|
||||
}
|
||||
#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 DoClearBridge(tile, flags);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
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 */
|
||||
if (old_engine_type == new_engine_type && v->age == 0)
|
||||
return CMD_ERROR;
|
||||
|
||||
|
||||
if ( v->type == VEH_Train ) {
|
||||
u = GetLastVehicleInChain(v);
|
||||
if ( RailVehInfo(new_engine_type)->flags & RVI_MULTIHEAD )
|
||||
build_cost = build_cost >> 1; //multiheaded engines have EstimateTrainCost() for both engines
|
||||
|
||||
|
||||
if ( old_engine_type != new_engine_type ) {
|
||||
|
||||
|
||||
// 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 ) {
|
||||
Vehicle *first = GetFirstVehicleInChain(v);
|
||||
if ( first->engine_type != new_engine_type ) return CMD_ERROR;
|
||||
}
|
||||
|
||||
|
||||
// checks if the engine is the first one
|
||||
if ( v->u.rail.first_engine == 0xffff ) {
|
||||
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);
|
||||
|
||||
|
||||
|
||||
if (v->engine_type != new_engine_type) {
|
||||
byte sprite = v->spritenum;
|
||||
byte cargo_type = v->cargo_type;
|
||||
|
@ -1471,7 +1471,7 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
|||
} else {
|
||||
v->cargo_type = rvi->cargo_type;
|
||||
}
|
||||
|
||||
|
||||
if ( rvi2->flags & RVI_MULTIHEAD && !(rvi->flags & RVI_MULTIHEAD) && v->index == first->index) {
|
||||
if (old_engine_type == u->engine_type ) {
|
||||
Vehicle *w;
|
||||
|
@ -1482,11 +1482,11 @@ int32 CmdReplaceVehicle(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
|||
DeleteVehicle(u);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ( rvi->flags & RVI_MULTIHEAD && rvi2->flags & RVI_MULTIHEAD && v->index == first->index ) {
|
||||
CmdReplaceVehicle(x, y, flags, u->index, p2);
|
||||
}
|
||||
|
||||
|
||||
if ( rvi->flags & RVI_MULTIHEAD && !(rvi2->flags & RVI_MULTIHEAD) && v->index == first->index ) {
|
||||
if ( old_engine_type != u->engine_type ) {
|
||||
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
|
||||
// this is needed for wagon override
|
||||
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;
|
||||
} while ( (veh=veh->next) != NULL );
|
||||
}
|
||||
|
||||
|
||||
break;
|
||||
}
|
||||
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));
|
||||
diffy = myabs(TileY(start)-TileY(ti->tile));
|
||||
|
||||
|
||||
side = myabs( diffx-diffy );
|
||||
if(dir<2) side = 0;
|
||||
|
||||
|
@ -697,7 +697,7 @@ static void DrawTileSelection(const TileInfo *ti)
|
|||
|
||||
if (thd->make_square_red) image |= 0x3048000;
|
||||
DrawSelectionSprite(image, ti);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1963,7 +1963,7 @@ void VpStartPreSizing(void)
|
|||
_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. */
|
||||
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;
|
||||
else if (dx==-16)
|
||||
b = (Check2x1AutoRail(2)) | HT_LINE;
|
||||
else
|
||||
else
|
||||
b = HT_LINE | HT_DIR_X;
|
||||
y = thd->selstart.y;
|
||||
} 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;
|
||||
else if (dy==-16) // 2x1 other direction
|
||||
b = (Check2x1AutoRail(0)) | HT_LINE;
|
||||
else
|
||||
else
|
||||
b = HT_LINE | HT_DIR_Y;
|
||||
x = thd->selstart.x;
|
||||
} 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;
|
||||
}
|
||||
|
||||
// while dragging
|
||||
// while dragging
|
||||
bool VpHandlePlaceSizingDrag(void)
|
||||
{
|
||||
Window *w;
|
||||
|
@ -2160,7 +2160,7 @@ bool VpHandlePlaceSizingDrag(void)
|
|||
// mouse button released..
|
||||
// keep the selected tool, but reset it to the original mode.
|
||||
_special_mouse_mode = WSM_NONE;
|
||||
if (_thd.next_drawstyle == HT_RECT)
|
||||
if (_thd.next_drawstyle == HT_RECT)
|
||||
_thd.place_mode = VHM_RECT;
|
||||
else if ((e.place.userdata & 0xF) == VPM_SIGNALDIRS) // some might call this a hack... -- Dominik
|
||||
_thd.place_mode = VHM_RECT;
|
||||
|
|
|
@ -79,7 +79,7 @@ enum {
|
|||
HT_RAIL = 0x10, /* autorail (one piece)
|
||||
* (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) */
|
||||
HT_DIR_X = 0, // X direction
|
||||
HT_DIR_Y = 1, // Y direction
|
||||
|
|
Loading…
Reference in New Issue