(svn r12761) -Codechange: lots of minor whitespace coding style fixes around operators.

pull/155/head
rubidium 16 years ago
parent d2b55e7afd
commit ca1f8fbe2e

@ -3995,11 +3995,11 @@ void AiDoGameLoop(Player *p)
if (_players_ai[p->index].state != old_state) {
if (hasdots)
printf("\n");
hasdots=false;
hasdots = false;
printf("AiState: %s\n", _ai_state_names[old_state=_players_ai[p->index].state]);
} else {
printf(".");
hasdots=true;
hasdots = true;
}
}
#endif

@ -342,7 +342,7 @@ static void AyStar_AiPathFinder_GetNeighbours(AyStar *aystar, OpenListNode *curr
// For now, we check both sides for this tile.. terraforming gives fuzzy result
if (tileh == InclinedSlope(dir)) {
// Now simply check if a tunnel can be build
ret = AI_DoCommand(tile, (PathFinderInfo->rail_or_road?0:0x200), 0, DC_AUTO, CMD_BUILD_TUNNEL);
ret = AI_DoCommand(tile, (PathFinderInfo->rail_or_road ? 0 : 0x200), 0, DC_AUTO, CMD_BUILD_TUNNEL);
tileh = GetTileSlope(_build_tunnel_endtile, NULL);
if (CmdSucceeded(ret) && IsInclinedSlope(tileh)) {
aystar->neighbours[aystar->num_neighbours].tile = _build_tunnel_endtile;

@ -796,7 +796,7 @@ static void AiNew_State_FindDepot(Player *p)
_players_ainew[p->index].depot_tile = 0;
for (i=2;i<_players_ainew[p->index].path_info.route_length-2;i++) {
for (i = 2; i < _players_ainew[p->index].path_info.route_length - 2; i++) {
tile = _players_ainew[p->index].path_info.route[i];
for (j = DIAGDIR_BEGIN; j < DIAGDIR_END; j++) {
TileIndex t = tile + TileOffsByDiagDir(j);
@ -819,9 +819,9 @@ static void AiNew_State_FindDepot(Player *p)
while (i > 1 && i < _players_ainew[p->index].path_info.route_length - 2) {
i += g;
g *= -1;
(g < 0?g--:g++);
(g < 0 ? g-- : g++);
if (_players_ainew[p->index].path_info.route_extra[i] != 0 || _players_ainew[p->index].path_info.route_extra[i+1] != 0) {
if (_players_ainew[p->index].path_info.route_extra[i] != 0 || _players_ainew[p->index].path_info.route_extra[i + 1] != 0) {
// Bridge or tunnel.. we can't place a depot there
continue;
}
@ -949,7 +949,7 @@ static void AiNew_State_VerifyRoute(Player *p)
_players_ainew[p->index].cur_veh = 0;
// Check how much it it going to cost us..
for (i=0;i<res;i++) {
for (i = 0; i < res; i++) {
_players_ainew[p->index].new_cost += AiNew_Build_Vehicle(p, 0, DC_QUERY_COST).GetCost();
}

@ -104,7 +104,7 @@ public:
}
/**
* Make a colour grey-based.
* Make a colour grey - based.
* @param colour the colour to make grey.
* @return the new colour, now grey.
*/

@ -66,7 +66,7 @@ struct MakeEnumPropsT {
/** In some cases we use byte or uint16 to store values that are defined as enum. It is
* necessary in order to control the sizeof() such values. Some compilers make enum
* the same size as int (4 or 8 bytes instead of 1 or 2). As a consequence the strict
* compiler type-checking causes errors like:
* compiler type - checking causes errors like:
* 'HasPowerOnRail' : cannot convert parameter 1 from 'byte' to 'RailType' when
* u->u.rail.railtype is passed as argument or type RailType. In such cases it is better
* to teach the compiler that u->u.rail.railtype is to be treated as RailType. */

@ -205,7 +205,7 @@ static void DrawVehicleInDepot(Window *w, const Vehicle *v, int x, int y)
DrawSprite((v->vehstatus & VS_STOPPED) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, PAL_NONE, x + diff_x, y + diff_y);
SetDParam(0, v->unitnumber);
DrawString(x, y + 2, (uint16)(v->max_age-366) >= v->age ? STR_00E2 : STR_00E3, TC_FROMSTRING);
DrawString(x, y + 2, (uint16)(v->max_age - 366) >= v->age ? STR_00E2 : STR_00E3, TC_FROMSTRING);
}
static void DrawDepotWindow(Window *w)

@ -1394,7 +1394,7 @@ static const Widget _save_dialog_widgets[] = {
{ WWT_INSET, RESIZE_RB, 14, 2, 243, 50, 150, 0x0, STR_400A_LIST_OF_DRIVES_DIRECTORIES},
{ WWT_SCROLLBAR, RESIZE_LRB, 14, 245, 256, 60, 151, 0x0, STR_0190_SCROLL_BAR_SCROLLS_LIST},
{ WWT_PANEL, RESIZE_RTB, 14, 0, 256, 152, 167, 0x0, STR_NULL},
{ WWT_EDITBOX, RESIZE_RTB, 14, 2, 254, 154, 165, STR_SAVE_OSKTITLE,STR_400B_CURRENTLY_SELECTED_NAME},
{ WWT_EDITBOX, RESIZE_RTB, 14, 2, 254, 154, 165, STR_SAVE_OSKTITLE, STR_400B_CURRENTLY_SELECTED_NAME},
{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 0, 127, 168, 179, STR_4003_DELETE, STR_400C_DELETE_THE_CURRENTLY_SELECTED},
{ WWT_PUSHTXTBTN, RESIZE_TB, 14, 128, 244, 168, 179, STR_4002_SAVE, STR_400D_SAVE_THE_CURRENT_GAME_USING},
{ WWT_RESIZEBOX, RESIZE_LRTB, 14, 245, 256, 168, 179, 0x0, STR_RESIZE_BUTTON},

@ -305,7 +305,7 @@ static byte MakeFinnishTownName(char *buf, uint32 seed, const char *last)
uint sel = SeedChance(2,
lengthof(name_finnish_1) + lengthof(name_finnish_2), seed);
if (sel >= lengthof(name_finnish_1)) {
strecat(buf, name_finnish_2[sel-lengthof(name_finnish_1)], last);
strecat(buf, name_finnish_2[sel - lengthof(name_finnish_1)], last);
} else {
strecat(buf, name_finnish_1[sel], last);
}

@ -391,7 +391,7 @@ static void NetworkFindIPs()
uint32 netmask;
fields = sscanf(*output, "%u: %hhu.%hhu.%hhu.%hhu, netmask %hhu.%hhu.%hhu.%hhu%n",
&n, &i1,&i2,&i3,&i4, &j1,&j2,&j3,&j4, &read);
&n, &i1, &i2, &i3, &i4, &j1, &j2, &j3, &j4, &read);
read += 1;
if (fields != 9) {
break;

@ -2121,8 +2121,8 @@ static bool IndustriesChangeInfo(uint indid, int numinfo, int prop, byte **bufp,
case 0x1D:
case 0x1E: {
uint32 multiples = grf_load_dword(&buf);
indsp->input_cargo_multiplier[prop - 0x1C][0] = GB(multiples, 0,15);
indsp->input_cargo_multiplier[prop - 0x1C][1] = GB(multiples, 15,15);
indsp->input_cargo_multiplier[prop - 0x1C][0] = GB(multiples, 0, 15);
indsp->input_cargo_multiplier[prop - 0x1C][1] = GB(multiples, 15, 15);
} break;
case 0x1F: // Industry name

@ -541,7 +541,7 @@ static void OrdersPlaceObj(const Vehicle *v, TileIndex tile, Window *w)
if (!cmd.IsValid()) return;
if (DoCommandP(v->tile, v->index + (OrderGetSel(w) << 16), cmd.Pack(), NULL, CMD_INSERT_ORDER | CMD_MSG(STR_8833_CAN_T_INSERT_NEW_ORDER))) {
if (WP(w, order_d).sel != -1) WP(w,order_d).sel++;
if (WP(w, order_d).sel != -1) WP(w, order_d).sel++;
ResetObjectToPlace();
}
}
@ -1087,7 +1087,7 @@ static const Widget _orders_train_widgets[] = {
static const WindowDesc _orders_train_desc = {
WDP_AUTO, WDP_AUTO, 386, 100, 386, 100,
WC_VEHICLE_ORDERS,WC_VEHICLE_VIEW,
WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
_orders_train_widgets,
OrdersWndProc
@ -1128,7 +1128,7 @@ static const Widget _orders_widgets[] = {
static const WindowDesc _orders_desc = {
WDP_AUTO, WDP_AUTO, 386, 100, 386, 100,
WC_VEHICLE_ORDERS,WC_VEHICLE_VIEW,
WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_RESIZABLE,
_orders_widgets,
OrdersWndProc
@ -1169,7 +1169,7 @@ static const Widget _other_orders_widgets[] = {
static const WindowDesc _other_orders_desc = {
WDP_AUTO, WDP_AUTO, 386, 88, 386, 88,
WC_VEHICLE_ORDERS,WC_VEHICLE_VIEW,
WC_VEHICLE_ORDERS, WC_VEHICLE_VIEW,
WDF_STD_TOOLTIPS | WDF_STD_BTN | WDF_DEF_WIDGET | WDF_UNCLICK_BUTTONS | WDF_RESIZABLE,
_other_orders_widgets,
OrdersWndProc

@ -135,7 +135,7 @@ static const Widget _player_finances_widgets[] = {
{ WWT_CAPTION, RESIZE_NONE, 14, 11, 379, 0, 13, STR_700E_FINANCES, STR_018C_WINDOW_TITLE_DRAG_THIS},
{ WWT_IMGBTN, RESIZE_NONE, 14, 380, 394, 0, 13, SPR_LARGE_SMALL_WINDOW, STR_7075_TOGGLE_LARGE_SMALL_WINDOW},
{ WWT_STICKYBOX, RESIZE_NONE, 14, 395, 406, 0, 13, 0x0, STR_STICKY_BUTTON},
{ WWT_PANEL, RESIZE_NONE, 14, 0, 406, 14, 39 +10 * EXPENSES_END, 0x0, STR_NULL},
{ WWT_PANEL, RESIZE_NONE, 14, 0, 406, 14, 39 + 10 * EXPENSES_END, 0x0, STR_NULL},
{ WWT_PANEL, RESIZE_NONE, 14, 0, 406, 40 + 10 * EXPENSES_END, 73 + 10 * EXPENSES_END, 0x0, STR_NULL},
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 0, 202, 74 + 10 * EXPENSES_END, 85 + 10 * EXPENSES_END, STR_7029_BORROW, STR_7035_INCREASE_SIZE_OF_LOAN},
{ WWT_PUSHTXTBTN, RESIZE_NONE, 14, 203, 406, 74 + 10 * EXPENSES_END, 85 + 10 * EXPENSES_END, STR_702A_REPAY, STR_7036_REPAY_PART_OF_LOAN},

@ -314,7 +314,7 @@ static void GenerateCompanyName(Player *p)
t = ClosestTownFromTile(tile, (uint)-1);
if (IsInsideMM(t->townnametype, SPECSTR_TOWNNAME_START, SPECSTR_TOWNNAME_LAST+1)) {
if (IsInsideMM(t->townnametype, SPECSTR_TOWNNAME_START, SPECSTR_TOWNNAME_LAST + 1)) {
str = t->townnametype - SPECSTR_TOWNNAME_START + SPECSTR_PLAYERNAME_START;
strp = t->townnameparts;
@ -353,7 +353,7 @@ bad_town_name:;
}
}
#define COLOR_SWAP(i,j) do { byte t=colors[i];colors[i]=colors[j];colors[j]=t; } while(0)
#define COLOR_SWAP(i, j) do { byte t = colors[i];colors[i] = colors[j];colors[j] = t; } while(0)
static const byte _color_sort[16] = {2, 2, 3, 2, 3, 2, 3, 2, 3, 2, 2, 2, 3, 1, 1, 1};
static const byte _color_similar_1[16] = {8, 6, 255, 12, 255, 0, 1, 1, 0, 13, 11, 10, 3, 9, 15, 14};
@ -362,7 +362,7 @@ static const byte _color_similar_2[16] = {5, 7, 255, 255, 255, 8, 7, 6, 5, 12, 2
static byte GeneratePlayerColor()
{
byte colors[16], pcolor, t2;
int i,j,n;
int i, j, n;
uint32 r;
Player *p;
@ -389,14 +389,14 @@ static byte GeneratePlayerColor()
/* Move the colors that look similar to each player's color to the side */
FOR_ALL_PLAYERS(p) if (p->is_active) {
pcolor = p->player_color;
for (i=0; i!=16; i++) if (colors[i] == pcolor) {
for (i = 0; i != 16; i++) if (colors[i] == pcolor) {
colors[i] = 0xFF;
t2 = _color_similar_1[pcolor];
if (t2 == 0xFF) break;
for (i=0; i!=15; i++) {
for (i = 0; i != 15; i++) {
if (colors[i] == t2) {
do COLOR_SWAP(i,i+1); while (++i != 15);
do COLOR_SWAP(i, i + 1); while (++i != 15);
break;
}
}
@ -721,7 +721,7 @@ CommandCost CmdSetAutoReplace(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
cost = AddEngineReplacementForPlayer(p, old_engine_type, new_engine_type, id_g, flags);
} else {
cost = RemoveEngineReplacementForPlayer(p, old_engine_type,id_g, flags);
cost = RemoveEngineReplacementForPlayer(p, old_engine_type, id_g, flags);
}
if (IsLocalPlayer()) InvalidateAutoreplaceWindow(old_engine_type, id_g);
@ -1089,8 +1089,8 @@ static const SaveLoad _player_desc[] = {
SLE_VAR(Player, name_1, SLE_STRINGID),
SLE_CONDSTR(Player, name, SLE_STR, 0, 84, SL_MAX_VERSION),
SLE_VAR(Player, president_name_1,SLE_UINT16),
SLE_VAR(Player, president_name_2,SLE_UINT32),
SLE_VAR(Player, president_name_1, SLE_UINT16),
SLE_VAR(Player, president_name_2, SLE_UINT32),
SLE_CONDSTR(Player, president_name, SLE_STR, 0, 84, SL_MAX_VERSION),
SLE_VAR(Player, face, SLE_UINT32),

@ -1293,7 +1293,7 @@ static bool RoadVehLeaveDepot(Vehicle *v, bool first)
v->cur_image = v->GetImage(v->direction);
v->UpdateDeltaXY(v->direction);
SetRoadVehPosition(v,x,y);
SetRoadVehPosition(v, x, y);
InvalidateWindowData(WC_VEHICLE_DEPOT, v->tile);
@ -1390,7 +1390,7 @@ static bool IndividualRoadVehicleController(Vehicle *v, const Vehicle *prev)
Direction new_dir;
Direction old_dir;
RoadDriveEntry rd;
int x,y;
int x, y;
uint32 r;
if (v->u.road.overtaking != 0) {
@ -1431,7 +1431,7 @@ static bool IndividualRoadVehicleController(Vehicle *v, const Vehicle *prev)
/* Vehicle has just entered a bridge or tunnel */
v->cur_image = v->GetImage(v->direction);
v->UpdateDeltaXY(v->direction);
SetRoadVehPosition(v,gp.x,gp.y);
SetRoadVehPosition(v, gp.x, gp.y);
return true;
}

@ -343,7 +343,7 @@ void SlSetLength(size_t length)
/* Ugly encoding of >16M RIFF chunks
* The lower 24 bits are normal
* The uppermost 4 bits are bits 24:27 */
assert(length < (1<<28));
assert(length < (1 << 28));
SlWriteUint32((length & 0xFFFFFF) | ((length >> 24) << 28));
break;
case CH_ARRAY:
@ -1218,7 +1218,7 @@ static void WriteZlibLoop(z_streamp z, byte *p, uint len, int mode)
z->avail_out = sizeof(buf);
r = deflate(z, mode);
/* bytes were emitted? */
if ((n=sizeof(buf) - z->avail_out) != 0) {
if ((n = sizeof(buf) - z->avail_out) != 0) {
if (fwrite(buf, n, 1, _sl.fh) != 1) SlError(STR_GAME_SAVELOAD_ERROR_FILE_NOT_WRITEABLE);
}
if (r == Z_STREAM_END)

@ -83,7 +83,7 @@ static void pool_free(SettingsMemoryPool **pool);
static bool IsSignedVarMemType(VarType vt);
struct SettingsMemoryPool {
uint pos,size;
uint pos, size;
SettingsMemoryPool *next;
byte mem[1];
};
@ -242,7 +242,7 @@ static IniFile *ini_load(const char *filename)
/* trim whitespace from right side. */
e = s + strlen(s);
while (e > s && ((c=e[-1]) == '\n' || c == '\r' || c == ' ' || c == '\t')) e--;
while (e > s && ((c = e[-1]) == '\n' || c == '\r' || c == ' ' || c == '\t')) e--;
*e = '\0';
/* skip comments and empty lines */
@ -253,7 +253,7 @@ static IniFile *ini_load(const char *filename)
/* add to comment */
if (ns > a) {
a = max(a, 128U);
do a*=2; while (a < ns);
do a *= 2; while (a < ns);
comment = ReallocT(comment, comment_alloc = a);
}
pos = comment_size;

@ -64,7 +64,7 @@ static StringID *BuildDynamicDropdown(StringID base, int num)
{
static StringID buf[32 + 1];
StringID *p = buf;
while (--num>=0) *p++ = base++;
while (--num >= 0) *p++ = base++;
*p = INVALID_STRING_ID;
return buf;
}
@ -308,7 +308,7 @@ static void GameOptionsWndProc(Window *w, WindowEvent *e)
break;
case GAMEOPT_RESOLUTION_BTN: /* Change resolution */
if (e->we.dropdown.index < _num_resolutions && ChangeResInGame(_resolutions[e->we.dropdown.index][0],_resolutions[e->we.dropdown.index][1]))
if (e->we.dropdown.index < _num_resolutions && ChangeResInGame(_resolutions[e->we.dropdown.index][0], _resolutions[e->we.dropdown.index][1]))
SetWindowDirty(w);
break;
@ -340,7 +340,7 @@ CommandCost CmdSetRoadDriveSide(TileIndex tile, uint32 flags, uint32 p1, uint32
if (flags & DC_EXEC) {
_opt_ptr->road_side = p1;
InvalidateWindow(WC_GAME_OPTIONS,0);
InvalidateWindow(WC_GAME_OPTIONS, 0);
}
return CommandCost();
}
@ -1059,7 +1059,7 @@ static void PatchesSelectionWndProc(Window *w, WindowEvent *e)
case WE_ON_EDIT_TEXT:
if (e->we.edittext.str != NULL) {
const PatchEntry *pe = &_patches_page[WP(w, def_d).data_1].entries[WP(w,def_d).data_3];
const PatchEntry *pe = &_patches_page[WP(w, def_d).data_1].entries[WP(w, def_d).data_3];
const SettingDesc *sd = pe->setting;
int32 value = atoi(e->we.edittext.str);

@ -219,7 +219,7 @@ static void QuerySignEditWndProc(Window *w, WindowEvent *e)
case QUERY_EDIT_SIGN_WIDGET_NEXT:
if (_sign_sort_dirty) GlobalSortSignList();
sign_index = _sign_sort[0]->index;
for (uint i = 0; i < _num_sign_sort-1; i++) {
for (uint i = 0; i < _num_sign_sort - 1; i++) {
if (qs->cur_sign == _sign_sort[i]->index) {
sign_index = _sign_sort[i + 1]->index;
break;

@ -2507,7 +2507,7 @@ static void UpdateStationRating(Station *st)
{
int b = ge->last_speed;
if ((b-=85) >= 0)
if ((b -= 85) >= 0)
rating += b >> 2;
}
@ -3065,15 +3065,15 @@ extern const TileTypeProcs _tile_type_station_procs = {
};
static const SaveLoad _roadstop_desc[] = {
SLE_VAR(RoadStop,xy, SLE_UINT32),
SLE_VAR(RoadStop, xy, SLE_UINT32),
SLE_CONDNULL(1, 0, 44),
SLE_VAR(RoadStop,status, SLE_UINT8),
SLE_VAR(RoadStop, status, SLE_UINT8),
/* Index was saved in some versions, but this is not needed */
SLE_CONDNULL(4, 0, 8),
SLE_CONDNULL(2, 0, 44),
SLE_CONDNULL(1, 0, 25),
SLE_REF(RoadStop,next, REF_ROADSTOPS),
SLE_REF(RoadStop, next, REF_ROADSTOPS),
SLE_CONDNULL(2, 0, 44),
SLE_CONDNULL(4, 0, 24),

@ -296,9 +296,9 @@ assert_compile(sizeof(uint8) == 1);
#define endof(x) (&x[lengthof(x)])
#define lastof(x) (&x[lengthof(x) - 1])
#define cpp_offsetof(s,m) (((size_t)&reinterpret_cast<const volatile char&>((((s*)(char*)8)->m))) - 8)
#define cpp_offsetof(s, m) (((size_t)&reinterpret_cast<const volatile char&>((((s*)(char*)8)->m))) - 8)
#if !defined(offsetof)
#define offsetof(s,m) cpp_offsetof(s, m)
#define offsetof(s, m) cpp_offsetof(s, m)
#endif /* offsetof */

@ -777,7 +777,7 @@ static bool CheckCommandsMatch(char *a, char *b, const char *name)
static void HandleString(char *str, bool master)
{
char *s,*t;
char *s, *t;
LangString *ent;
char *casep;

@ -1195,7 +1195,7 @@ static char *GetSpecialPlayerNameString(char *buff, int ind, const int64 *argv,
}
/* town name? */
if (IsInsideMM(ind - 6, 0, SPECSTR_TOWNNAME_LAST-SPECSTR_TOWNNAME_START + 1)) {
if (IsInsideMM(ind - 6, 0, SPECSTR_TOWNNAME_LAST - SPECSTR_TOWNNAME_START + 1)) {
buff = GetSpecialTownNameString(buff, ind - 6, GetInt32(&argv), last);
return strecpy(buff, " Transport", last);
}

@ -46,7 +46,7 @@ extern RoadType _last_built_roadtype;
* the default position is aligned with the left side of the clicked button */
Point GetToolbarDropdownPos(uint16 parent_button, int width, int height)
{
const Window *w = FindWindowById(WC_MAIN_TOOLBAR,0);
const Window *w = FindWindowById(WC_MAIN_TOOLBAR, 0);
Point pos;
pos.x = w->widget[GB(parent_button, 0, 8)].left;
pos.x = w->left + Clamp(pos.x, 0, w->width - width);
@ -175,7 +175,7 @@ static void ToolbarZoomInClick(Window *w)
static void ToolbarZoomOutClick(Window *w)
{
if (DoZoomInOutWindow(ZOOM_OUT,FindWindowById(WC_MAIN_WINDOW, 0))) {
if (DoZoomInOutWindow(ZOOM_OUT, FindWindowById(WC_MAIN_WINDOW, 0))) {
w->HandleButtonClick(18);
SndPlayFx(SND_15_BEEP);
}
@ -387,8 +387,8 @@ void MainToolbarWndProc(Window *w, WindowEvent *e)
switch (e->event) {
case WE_PAINT:
/* Draw brown-red toolbar bg. */
GfxFillRect(0, 0, w->width-1, w->height-1, 0xB2);
GfxFillRect(0, 0, w->width-1, w->height-1, 0xB4 | (1 << PALETTE_MODIFIER_GREYOUT));
GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB2);
GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB4 | (1 << PALETTE_MODIFIER_GREYOUT));
/* If spectator, disable all construction buttons
* ie : Build road, rail, ships, airports and landscaping
@ -599,8 +599,8 @@ void ScenEditToolbarWndProc(Window *w, WindowEvent *e)
w->SetWidgetDisabledState(7, _patches_newgame.starting_year >= MAX_YEAR);
/* Draw brown-red toolbar bg. */
GfxFillRect(0, 0, w->width-1, w->height-1, 0xB2);
GfxFillRect(0, 0, w->width-1, w->height-1, 0xB4 | (1 << PALETTE_MODIFIER_GREYOUT));
GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB2);
GfxFillRect(0, 0, w->width - 1, w->height - 1, 0xB4 | (1 << PALETTE_MODIFIER_GREYOUT));
DrawWindowWidgets(w);
@ -667,7 +667,7 @@ void ScenEditToolbarWndProc(Window *w, WindowEvent *e)
case WE_RESIZE: {
/* There are 15 buttons plus some spacings if the space allows it.
* Furthermore there are two panels of which one is non-essential
* Furthermore there are two panels of which one is non - essential
* and that one can be removed is the space is too small. */
uint buttons_width;
uint spacing;

@ -2345,7 +2345,7 @@ static void UpdateTownGrowRate(Town *t)
if (TilePixelHeight(t->xy) >= GetSnowLine() && t->act_food == 0 && t->population > 90)
return;
} else if (_opt.landscape == LT_TROPIC) {
if (GetTropicZone(t->xy) == TROPICZONE_DESERT && (t->act_food==0 || t->act_water==0) && t->population > 60)
if (GetTropicZone(t->xy) == TROPICZONE_DESERT && (t->act_food == 0 || t->act_water == 0) && t->population > 60)
return;
}

@ -149,7 +149,7 @@ static void TownAuthorityWndProc(Window *w, WindowEvent *e)
SetVScrollCount(w, numact + 1);
if (WP(w, def_d).data_1 != -1 && !HasBit(buttons, WP(w,def_d).data_1))
if (WP(w, def_d).data_1 != -1 && !HasBit(buttons, WP(w, def_d).data_1))
WP(w, def_d).data_1 = -1;
w->SetWidgetDisabledState(6, WP(w, def_d).data_1 == -1);

@ -1304,7 +1304,7 @@ CommandCost CmdStartStopTrain(TileIndex tile, uint32 flags, uint32 p1, uint32 p2
* @param p2 the selling mode
* - p2 = 0: only sell the single dragged wagon/engine (and any belonging rear-engines)
* - p2 = 1: sell the vehicle and all vehicles following it in the chain
if the wagon is dragged, don't delete the possibly belonging rear-engine to some front
* if the wagon is dragged, don't delete the possibly belonging rear-engine to some front
* - p2 = 2: when selling attached locos, rearrange all vehicles after it to separate lines;
* all wagons of the same type will go on the same line. Used by the AI currently
*/
@ -3207,7 +3207,7 @@ static void HandleCrashedTrain(Vehicle *v)
if (state <= 240 && !(v->tick_counter & 3)) ChangeTrainDirRandomly(v);
if (state >= 4440 && !(v->tick_counter&0x1F)) {
if (state >= 4440 && !(v->tick_counter & 0x1F)) {
DeleteLastWagon(v);
InvalidateWindow(WC_REPLACE_VEHICLE, (v->group_id << 16) | VEH_TRAIN);
}

@ -158,7 +158,7 @@ CommandCost CmdSellLandArea(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
if (flags & DC_EXEC) DoClearSquare(tile);
return CommandCost(EXPENSES_CONSTRUCTION,- _price.clear_roughland * 2);
return CommandCost(EXPENSES_CONSTRUCTION, - _price.clear_roughland * 2);
}
static Foundation GetFoundation_Unmovable(TileIndex tile, Slope tileh);

@ -1437,7 +1437,7 @@ extern void DrawShipDetails(const Vehicle *v, int x, int y);
extern void DrawAircraftDetails(const Vehicle *v, int x, int y);
/**
* Draw the details for the given vehicle at the position (x,y) of the Details windows
* Draw the details for the given vehicle at the position (x, y) of the Details windows
*
* @param v current vehicle
* @param x The x coordinate

@ -308,7 +308,7 @@ static LRESULT CALLBACK WndProcGdi(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
case WM_PAINT: {
PAINTSTRUCT ps;
HDC dc,dc2;
HDC dc, dc2;
HBITMAP old_bmp;
HPALETTE old_palette;

@ -1015,7 +1015,7 @@ static void ViewportAddTownNames(DrawPixelInfo *dpi)
if (bottom > t->sign.top &&
top < t->sign.top + 24 &&
right > t->sign.left &&
left < t->sign.left + t->sign.width_1*2) {
left < t->sign.left + t->sign.width_1 * 2) {
AddStringToDraw(t->sign.left + 1, t->sign.top + 1,
_patches.population_in_label ? STR_TOWN_LABEL_POP : STR_TOWN_LABEL,
t->index, t->population);
@ -1082,7 +1082,7 @@ static void ViewportAddStationNames(DrawPixelInfo *dpi)
if (bottom > st->sign.top &&
top < st->sign.top + 24 &&
right > st->sign.left &&
left < st->sign.left + st->sign.width_1*2) {
left < st->sign.left + st->sign.width_1 * 2) {
AddStation(st, STR_305C_0, st->sign.width_1);
}
}
@ -1210,7 +1210,7 @@ static void ViewportAddWaypoints(DrawPixelInfo *dpi)
if (bottom > wp->sign.top &&
top < wp->sign.top + 24 &&
right > wp->sign.left &&
left < wp->sign.left + wp->sign.width_1*2) {
left < wp->sign.left + wp->sign.width_1 * 2) {
AddWaypoint(wp, STR_WAYPOINT_VIEWPORT, wp->sign.width_1);
}
}

@ -86,7 +86,7 @@ void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y)
default: NOT_REACHED();
}
if (pos <= mi+9) {
if (pos <= mi + 9) {
/* Pressing the upper button? */
w->flags4 |= WF_SCROLL_UP;
if (_scroller_click_timeout == 0) {

@ -249,7 +249,7 @@ static bool EmergencySave()
#if 0
struct WinInetProcs {
HINTERNET (WINAPI *InternetOpen)(LPCTSTR,DWORD, LPCTSTR, LPCTSTR, DWORD);
HINTERNET (WINAPI *InternetOpen)(LPCTSTR, DWORD, LPCTSTR, LPCTSTR, DWORD);
HINTERNET (WINAPI *InternetConnect)(HINTERNET, LPCTSTR, INTERNET_PORT, LPCTSTR, LPCTSTR, DWORD, DWORD, DWORD);
HINTERNET (WINAPI *HttpOpenRequest)(HINTERNET, LPCTSTR, LPCTSTR, LPCTSTR, LPCTSTR, LPCTSTR *, DWORD, DWORD);
BOOL (WINAPI *HttpSendRequest)(HINTERNET, LPCTSTR, DWORD, LPVOID, DWORD);

@ -42,7 +42,7 @@ typedef void WindowProc(Window *w, WindowEvent *e);
Now the window will only change in height in steps of 10.
You can also give a minimum width and height. The default value is
the default height/width of the window itself. You can change this
AFTER window-creation, with:
AFTER window - creation, with:
w->resize.width or w->resize.height.
That was all.. good luck, and enjoy :) -- TrueLight */

Loading…
Cancel
Save