mirror of https://github.com/OpenTTD/OpenTTD
(svn r3511) More whitespace ([FS#46] by Rubidium)
parent
22dc05faf2
commit
84fb96fe85
|
@ -1015,8 +1015,7 @@ static void SubsidyMonthlyHandler(void)
|
||||||
bool modified = false;
|
bool modified = false;
|
||||||
|
|
||||||
for (s = _subsidies; s != endof(_subsidies); s++) {
|
for (s = _subsidies; s != endof(_subsidies); s++) {
|
||||||
if (s->cargo_type == CT_INVALID)
|
if (s->cargo_type == CT_INVALID) continue;
|
||||||
continue;
|
|
||||||
|
|
||||||
if (s->age == 12-1) {
|
if (s->age == 12-1) {
|
||||||
pair = SetupSubsidyDecodeParam(s, 1);
|
pair = SetupSubsidyDecodeParam(s, 1);
|
||||||
|
|
3
misc.c
3
misc.c
|
@ -223,8 +223,7 @@ void GenerateWorld(int mode, uint size_x, uint size_y)
|
||||||
|
|
||||||
// No need to run the tile loop in the scenario editor.
|
// No need to run the tile loop in the scenario editor.
|
||||||
if (mode != GW_EMPTY) {
|
if (mode != GW_EMPTY) {
|
||||||
for(i=0x500; i!=0; i--)
|
for (i = 0x500; i != 0; i--) RunTileLoop();
|
||||||
RunTileLoop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ResetObjectToPlace();
|
ResetObjectToPlace();
|
||||||
|
|
|
@ -1376,8 +1376,9 @@ static void SaveLoadDlgWndProc(Window *w, WindowEvent *e)
|
||||||
break;
|
break;
|
||||||
case WE_DESTROY:
|
case WE_DESTROY:
|
||||||
// pause is only used in single-player, non-editor mode, non menu mode
|
// pause is only used in single-player, non-editor mode, non menu mode
|
||||||
if(!_networking && (_game_mode != GM_EDITOR) && (_game_mode != GM_MENU))
|
if (!_networking && _game_mode != GM_EDITOR && _game_mode != GM_MENU) {
|
||||||
DoCommandP(0, 0, 0, NULL, CMD_PAUSE);
|
DoCommandP(0, 0, 0, NULL, CMD_PAUSE);
|
||||||
|
}
|
||||||
FiosFreeSavegameList();
|
FiosFreeSavegameList();
|
||||||
CLRBIT(_no_scroll, SCROLL_SAVE);
|
CLRBIT(_no_scroll, SCROLL_SAVE);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -376,8 +376,7 @@ static byte GeneratePlayerColor(void)
|
||||||
Player *p;
|
Player *p;
|
||||||
|
|
||||||
// Initialize array
|
// Initialize array
|
||||||
for(i=0; i!=16; i++)
|
for (i = 0; i != 16; i++) colors[i] = i;
|
||||||
colors[i] = i;
|
|
||||||
|
|
||||||
// And randomize it
|
// And randomize it
|
||||||
n = 100;
|
n = 100;
|
||||||
|
@ -1253,7 +1252,8 @@ static const SaveLoad _player_ai_build_rec_desc[] = {
|
||||||
SLE_END()
|
SLE_END()
|
||||||
};
|
};
|
||||||
|
|
||||||
static void SaveLoad_PLYR(Player *p) {
|
static void SaveLoad_PLYR(Player* p)
|
||||||
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
SlObject(p, _player_desc);
|
SlObject(p, _player_desc);
|
||||||
|
|
|
@ -778,11 +778,9 @@ static const ChunkHandler *SlFindChunkHandler(uint32 id)
|
||||||
const ChunkHandler *ch;
|
const ChunkHandler *ch;
|
||||||
const ChunkHandler *const *chsc;
|
const ChunkHandler *const *chsc;
|
||||||
for (chsc = _sl.chs; (ch=*chsc++) != NULL;) {
|
for (chsc = _sl.chs; (ch=*chsc++) != NULL;) {
|
||||||
while(true) {
|
for (;;) {
|
||||||
if (ch->id == id)
|
if (ch->id == id) return ch;
|
||||||
return ch;
|
if (ch->flags & CH_LAST) break;
|
||||||
if (ch->flags & CH_LAST)
|
|
||||||
break;
|
|
||||||
ch++;
|
ch++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -430,6 +430,7 @@ static void make_intlist(char *buf, void *array, int nelems, int type)
|
||||||
{
|
{
|
||||||
int i, v = 0;
|
int i, v = 0;
|
||||||
byte *p = (byte*)array;
|
byte *p = (byte*)array;
|
||||||
|
|
||||||
for (i = 0; i != nelems; i++) {
|
for (i = 0; i != nelems; i++) {
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case SDT_INT8 >> 4: v = *(int8*)p; p += 1; break;
|
case SDT_INT8 >> 4: v = *(int8*)p; p += 1; break;
|
||||||
|
|
|
@ -304,8 +304,7 @@ static void EmitWordList(char **words, int nw)
|
||||||
int i,j;
|
int i,j;
|
||||||
|
|
||||||
PutByte(nw);
|
PutByte(nw);
|
||||||
for(i=0; i<nw; i++)
|
for (i = 0; i < nw; i++) PutByte(strlen(words[i]));
|
||||||
PutByte(strlen(words[i]));
|
|
||||||
for (i = 0; i < nw; i++) {
|
for (i = 0; i < nw; i++) {
|
||||||
for (j = 0; words[i][j]; j++)
|
for (j = 0; words[i][j]; j++)
|
||||||
PutByte(words[i][j]);
|
PutByte(words[i][j]);
|
||||||
|
@ -365,8 +364,7 @@ static void EmitGender(char *buf, int value)
|
||||||
|
|
||||||
// This is a {G=DER} command
|
// This is a {G=DER} command
|
||||||
for (nw = 0; ; nw++) {
|
for (nw = 0; ; nw++) {
|
||||||
if (nw >= 8)
|
if (nw >= 8) Fatal("G argument '%s' invalid", buf);
|
||||||
Fatal("G argument '%s' invalid", buf);
|
|
||||||
if (!strcmp(buf, _genders[nw]))
|
if (!strcmp(buf, _genders[nw]))
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -466,6 +466,7 @@ static const char *ParseStringChoice(const char *b, uint form, char *dst, int *d
|
||||||
//<NUM> {Length of each string} {each string}
|
//<NUM> {Length of each string} {each string}
|
||||||
uint n = (byte)*b++;
|
uint n = (byte)*b++;
|
||||||
uint pos,i, mylen=0,mypos=0;
|
uint pos,i, mylen=0,mypos=0;
|
||||||
|
|
||||||
for (i = pos = 0; i != n; i++) {
|
for (i = pos = 0; i != n; i++) {
|
||||||
uint len = (byte)*b++;
|
uint len = (byte)*b++;
|
||||||
if (i == form) {
|
if (i == form) {
|
||||||
|
|
|
@ -1173,8 +1173,7 @@ static bool CheckFree2x2Area(Town *t1, TileIndex tile)
|
||||||
for (i = 0; i != 4; i++) {
|
for (i = 0; i != 4; i++) {
|
||||||
tile += ToTileIndexDiff(_tile_add[i]);
|
tile += ToTileIndexDiff(_tile_add[i]);
|
||||||
|
|
||||||
if (GetTileSlope(tile, NULL))
|
if (GetTileSlope(tile, NULL)) return false;
|
||||||
return false;
|
|
||||||
|
|
||||||
if (CmdFailed(DoCommandByTile(tile, 0, 0, DC_EXEC | DC_AUTO | DC_NO_WATER | DC_FORCETEST, CMD_LANDSCAPE_CLEAR)))
|
if (CmdFailed(DoCommandByTile(tile, 0, 0, DC_EXEC | DC_AUTO | DC_NO_WATER | DC_FORCETEST, CMD_LANDSCAPE_CLEAR)))
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -2214,7 +2214,7 @@ static bool CheckReverseTrain(Vehicle *v)
|
||||||
reverse_best = false;
|
reverse_best = false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
while(true) {
|
for (;;) {
|
||||||
fd.best_bird_dist = (uint)-1;
|
fd.best_bird_dist = (uint)-1;
|
||||||
fd.best_track_dist = (uint)-1;
|
fd.best_track_dist = (uint)-1;
|
||||||
|
|
||||||
|
|
|
@ -1008,8 +1008,14 @@ static void DrawBridgePillars(const TileInfo *ti, int x, int y, int z)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (; z >= front_height || z >= back_height; z = z - 8) {
|
for (; z >= front_height || z >= back_height; z = z - 8) {
|
||||||
if (z>=front_height) AddSortableSpriteToDraw(image, x,y, p[4], p[5], 0x28, z); // front facing pillar
|
if (z >= front_height) {
|
||||||
if (z>=back_height && z<i-8) AddSortableSpriteToDraw(image, x - p[6], y - p[7], p[4], p[5], 0x28, z); // back facing pillar
|
// front facing pillar
|
||||||
|
AddSortableSpriteToDraw(image, x,y, p[4], p[5], 0x28, z);
|
||||||
|
}
|
||||||
|
if (z >= back_height && z < i - 8) {
|
||||||
|
// back facing pillar
|
||||||
|
AddSortableSpriteToDraw(image, x - p[6], y - p[7], p[4], p[5], 0x28, z);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1945,8 +1945,7 @@ Trackdir GetVehicleTrackdir(const Vehicle* v)
|
||||||
{
|
{
|
||||||
if (v->vehstatus & VS_CRASHED) return 0xFF;
|
if (v->vehstatus & VS_CRASHED) return 0xFF;
|
||||||
|
|
||||||
switch(v->type)
|
switch (v->type) {
|
||||||
{
|
|
||||||
case VEH_Train:
|
case VEH_Train:
|
||||||
if (v->u.rail.track == 0x80) /* We'll assume the train is facing outwards */
|
if (v->u.rail.track == 0x80) /* We'll assume the train is facing outwards */
|
||||||
return DiagdirToDiagTrackdir(GetDepotDirection(v->tile, TRANSPORT_RAIL)); /* Train in depot */
|
return DiagdirToDiagTrackdir(GetDepotDirection(v->tile, TRANSPORT_RAIL)); /* Train in depot */
|
||||||
|
|
|
@ -709,7 +709,7 @@ static void Win32GdiMainLoop(void)
|
||||||
|
|
||||||
_wnd.running = true;
|
_wnd.running = true;
|
||||||
|
|
||||||
while(true) {
|
for (;;) {
|
||||||
while (PeekMessage(&mesg, NULL, 0, 0, PM_REMOVE)) {
|
while (PeekMessage(&mesg, NULL, 0, 0, PM_REMOVE)) {
|
||||||
InteractiveRandom(); // randomness
|
InteractiveRandom(); // randomness
|
||||||
TranslateMessage(&mesg);
|
TranslateMessage(&mesg);
|
||||||
|
|
2
win32.c
2
win32.c
|
@ -141,7 +141,7 @@ static void GetFileInfo(DebugFileInfo *dfi, const char *filename)
|
||||||
file = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL,
|
file = CreateFile(filename, GENERIC_READ, FILE_SHARE_READ, NULL,
|
||||||
OPEN_EXISTING, 0, 0);
|
OPEN_EXISTING, 0, 0);
|
||||||
if (file != INVALID_HANDLE_VALUE) {
|
if (file != INVALID_HANDLE_VALUE) {
|
||||||
while(true) {
|
for (;;) {
|
||||||
if (ReadFile(file, buffer, sizeof(buffer), &numread, NULL) == 0 ||
|
if (ReadFile(file, buffer, sizeof(buffer), &numread, NULL) == 0 ||
|
||||||
numread == 0)
|
numread == 0)
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue