mirror of https://github.com/OpenTTD/OpenTTD
(svn r1326) fixed compiler warnings in vehicle_gui.c and widget.c
parent
efc2702491
commit
6a6cbdd9b4
|
@ -526,30 +526,30 @@ static void DrawEngineArrayInReplaceWindow(Window *w, int x, int y, int x2, int
|
||||||
byte cargo;
|
byte cargo;
|
||||||
EngineInfo *info;
|
EngineInfo *info;
|
||||||
|
|
||||||
if ( selected_id[0] >= ROAD_ENGINES_INDEX && selected_id[0] <= SHIP_ENGINES_INDEX )
|
if ( selected_id[0] >= ROAD_ENGINES_INDEX && selected_id[0] <= SHIP_ENGINES_INDEX ) {
|
||||||
cargo = RoadVehInfo(selected_id[0])->cargo_type;
|
cargo = RoadVehInfo(selected_id[0])->cargo_type;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
info = &_engine_info[engine_id];
|
info = &_engine_info[engine_id];
|
||||||
if (ENGINE_AVAILABLE) {
|
if (ENGINE_AVAILABLE) {
|
||||||
if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {
|
if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {
|
||||||
DrawString(x+59, y+2, GetCustomEngineName(engine_id), sel[0]==0 ? 0xC : 0x10);
|
DrawString(x+59, y+2, GetCustomEngineName(engine_id), sel[0]==0 ? 0xC : 0x10);
|
||||||
DrawRoadVehEngine(x+29, y+6, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
|
DrawRoadVehEngine(x+29, y+6, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
|
||||||
y += 14;
|
y += 14;
|
||||||
}
|
|
||||||
|
|
||||||
if ( RoadVehInfo(engine_id)->cargo_type == cargo && HASBIT(e->player_avail, _local_player) ) {
|
|
||||||
if (IS_INT_INSIDE(--pos2, -w->vscroll.cap, 0) && RoadVehInfo(engine_id)->cargo_type == cargo) {
|
|
||||||
DrawString(x2+59, y2+2, GetCustomEngineName(engine_id), sel[1]==0 ? 0xC : 0x10);
|
|
||||||
DrawRoadVehEngine(x2+29, y2+6, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
|
|
||||||
y2 += 14;
|
|
||||||
}
|
}
|
||||||
sel[1]--;
|
|
||||||
}
|
|
||||||
sel[0]--;
|
|
||||||
}
|
|
||||||
} while (++engine_id, ++e,--num);
|
|
||||||
|
|
||||||
|
if ( RoadVehInfo(engine_id)->cargo_type == cargo && HASBIT(e->player_avail, _local_player) ) {
|
||||||
|
if (IS_INT_INSIDE(--pos2, -w->vscroll.cap, 0) && RoadVehInfo(engine_id)->cargo_type == cargo) {
|
||||||
|
DrawString(x2+59, y2+2, GetCustomEngineName(engine_id), sel[1]==0 ? 0xC : 0x10);
|
||||||
|
DrawRoadVehEngine(x2+29, y2+6, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
|
||||||
|
y2 += 14;
|
||||||
|
}
|
||||||
|
sel[1]--;
|
||||||
|
}
|
||||||
|
sel[0]--;
|
||||||
|
}
|
||||||
|
} while (++engine_id, ++e,--num);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -563,30 +563,30 @@ static void DrawEngineArrayInReplaceWindow(Window *w, int x, int y, int x2, int
|
||||||
if ( selected_id[0] != -1 ) {
|
if ( selected_id[0] != -1 ) {
|
||||||
cargo = ShipVehInfo(selected_id[0])->cargo_type;
|
cargo = ShipVehInfo(selected_id[0])->cargo_type;
|
||||||
refittable = ShipVehInfo(selected_id[0])->refittable;
|
refittable = ShipVehInfo(selected_id[0])->refittable;
|
||||||
}
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
info = &_engine_info[engine_id];
|
info = &_engine_info[engine_id];
|
||||||
if (ENGINE_AVAILABLE) {
|
if (ENGINE_AVAILABLE) {
|
||||||
if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {
|
if (IS_INT_INSIDE(--pos, -w->vscroll.cap, 0)) {
|
||||||
DrawString(x+75, y+7, GetCustomEngineName(engine_id), sel[0]==0 ? 0xC : 0x10);
|
DrawString(x+75, y+7, GetCustomEngineName(engine_id), sel[0]==0 ? 0xC : 0x10);
|
||||||
DrawShipEngine(x+35, y+10, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
|
DrawShipEngine(x+35, y+10, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
|
||||||
y += 24;
|
y += 24;
|
||||||
}
|
|
||||||
if ( selected_id[0] != -1 ) {
|
|
||||||
if (HASBIT(e->player_avail, _local_player) && ( cargo == ShipVehInfo(engine_id)->cargo_type || refittable & ShipVehInfo(engine_id)->refittable)) {
|
|
||||||
if (IS_INT_INSIDE(--pos2, -w->vscroll.cap, 0)) {
|
|
||||||
DrawString(x2+75, y2+7, GetCustomEngineName(engine_id), sel[1]==0 ? 0xC : 0x10);
|
|
||||||
DrawShipEngine(x2+35, y2+10, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
|
|
||||||
y2 += 24;
|
|
||||||
}
|
|
||||||
sel[1]--;
|
|
||||||
}
|
}
|
||||||
|
if ( selected_id[0] != -1 ) {
|
||||||
|
if (HASBIT(e->player_avail, _local_player) && ( cargo == ShipVehInfo(engine_id)->cargo_type || refittable & ShipVehInfo(engine_id)->refittable)) {
|
||||||
|
if (IS_INT_INSIDE(--pos2, -w->vscroll.cap, 0)) {
|
||||||
|
DrawString(x2+75, y2+7, GetCustomEngineName(engine_id), sel[1]==0 ? 0xC : 0x10);
|
||||||
|
DrawShipEngine(x2+35, y2+10, engine_id, SPRITE_PALETTE(PLAYER_SPRITE_COLOR(_local_player)));
|
||||||
|
y2 += 24;
|
||||||
|
}
|
||||||
|
sel[1]--;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
sel[0]--;
|
||||||
}
|
}
|
||||||
sel[0]--;
|
} while (++engine_id, ++e,--num);
|
||||||
}
|
}
|
||||||
} while (++engine_id, ++e,--num);
|
break;
|
||||||
break;
|
|
||||||
} //end of ship
|
} //end of ship
|
||||||
|
|
||||||
case VEH_Aircraft: {
|
case VEH_Aircraft: {
|
||||||
|
@ -933,6 +933,7 @@ void ShowReplaceVehicleWindow(byte vehicletype)
|
||||||
w->vscroll.cap = 4;
|
w->vscroll.cap = 4;
|
||||||
WP(w,replaceveh_d).line_height = 24;
|
WP(w,replaceveh_d).line_height = 24;
|
||||||
break;
|
break;
|
||||||
|
default: return;
|
||||||
}
|
}
|
||||||
WP(w,replaceveh_d).vehicletype = vehicletype;
|
WP(w,replaceveh_d).vehicletype = vehicletype;
|
||||||
w->vscroll2.cap = w->vscroll.cap; // these two are always the same
|
w->vscroll2.cap = w->vscroll.cap; // these two are always the same
|
||||||
|
|
1
widget.c
1
widget.c
|
@ -76,6 +76,7 @@ void ScrollbarClickHandler(Window *w, const Widget *wi, int x, int y)
|
||||||
pos = x;
|
pos = x;
|
||||||
sb = &w->hscroll;
|
sb = &w->hscroll;
|
||||||
}
|
}
|
||||||
|
default: return; //this should never happen
|
||||||
}
|
}
|
||||||
if (pos <= mi+9) {
|
if (pos <= mi+9) {
|
||||||
// Pressing the upper button?
|
// Pressing the upper button?
|
||||||
|
|
Loading…
Reference in New Issue