mirror of
https://github.com/OpenTTD/OpenTTD.git
synced 2025-03-06 22:28:56 +00:00
(svn r3046) Replace some numbers with sprite names and fix a typo in the sprite list
This commit is contained in:
parent
ab41ccb23c
commit
d5042d4ab2
@ -17,6 +17,7 @@
|
|||||||
#include "player.h"
|
#include "player.h"
|
||||||
#include "airport.h"
|
#include "airport.h"
|
||||||
#include "vehicle_gui.h"
|
#include "vehicle_gui.h"
|
||||||
|
#include "table/sprites.h"
|
||||||
|
|
||||||
static bool AirportMove(Vehicle *v, const AirportFTAClass *Airport);
|
static bool AirportMove(Vehicle *v, const AirportFTAClass *Airport);
|
||||||
static bool AirportSetBlocks(Vehicle *v, AirportFTA *current_pos, const AirportFTAClass *Airport);
|
static bool AirportSetBlocks(Vehicle *v, AirportFTA *current_pos, const AirportFTAClass *Airport);
|
||||||
@ -116,7 +117,7 @@ void DrawAircraftEngine(int x, int y, EngineID engine, uint32 image_ormod)
|
|||||||
DrawSprite(sprite | image_ormod, x, y);
|
DrawSprite(sprite | image_ormod, x, y);
|
||||||
|
|
||||||
if ((AircraftVehInfo(engine)->subtype & 1) == 0) {
|
if ((AircraftVehInfo(engine)->subtype & 1) == 0) {
|
||||||
DrawSprite(0xF3D, x, y-5);
|
DrawSprite(SPR_ROTOR_STOPPED, x, y - 5);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -305,7 +306,7 @@ int32 CmdBuildAircraft(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
|||||||
w->z_height = 1;
|
w->z_height = 1;
|
||||||
w->vehstatus = VS_HIDDEN | VS_UNCLICKABLE;
|
w->vehstatus = VS_HIDDEN | VS_UNCLICKABLE;
|
||||||
w->subtype = 6;
|
w->subtype = 6;
|
||||||
w->cur_image = 0xF3D;
|
w->cur_image = SPR_ROTOR_STOPPED;
|
||||||
VehiclePositionChanged(w);
|
VehiclePositionChanged(w);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -672,7 +673,7 @@ static void HelicopterTickHandler(Vehicle *v)
|
|||||||
if (v->current_order.type == OT_LOADING || (v->vehstatus & VS_STOPPED)) {
|
if (v->current_order.type == OT_LOADING || (v->vehstatus & VS_STOPPED)) {
|
||||||
if (u->cur_speed != 0) {
|
if (u->cur_speed != 0) {
|
||||||
u->cur_speed++;
|
u->cur_speed++;
|
||||||
if (u->cur_speed >= 0x80 && u->cur_image == 0xF40) {
|
if (u->cur_speed >= 0x80 && u->cur_image == SPR_ROTOR_MOVING_3) {
|
||||||
u->cur_speed = 0;
|
u->cur_speed = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -688,14 +689,13 @@ static void HelicopterTickHandler(Vehicle *v)
|
|||||||
spd = u->cur_speed >> 4;
|
spd = u->cur_speed >> 4;
|
||||||
|
|
||||||
if (spd == 0) {
|
if (spd == 0) {
|
||||||
img = 0xF3D;
|
img = SPR_ROTOR_STOPPED;
|
||||||
if (u->cur_image == img)
|
if (u->cur_image == img)
|
||||||
return;
|
return;
|
||||||
} else if (tick >= spd) {
|
} else if (tick >= spd) {
|
||||||
u->tick_counter = 0;
|
u->tick_counter = 0;
|
||||||
img = u->cur_image + 1;
|
img = u->cur_image + 1;
|
||||||
if (img > 0xF40)
|
if (img > SPR_ROTOR_MOVING_3) img = SPR_ROTOR_MOVING_1;
|
||||||
img = 0xF3E;
|
|
||||||
} else
|
} else
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -69,7 +69,7 @@ static void DrawAircraftImage(const Vehicle *v, int x, int y, VehicleID selectio
|
|||||||
ormod = PALETTE_CRASH;
|
ormod = PALETTE_CRASH;
|
||||||
DrawSprite(image | ormod, x+25, y+10);
|
DrawSprite(image | ormod, x+25, y+10);
|
||||||
if (v->subtype == 0)
|
if (v->subtype == 0)
|
||||||
DrawSprite(0xF3D, x+25, y+5);
|
DrawSprite(SPR_ROTOR_STOPPED, x + 25, y + 5);
|
||||||
if (v->index == selection) {
|
if (v->index == selection) {
|
||||||
DrawFrameRect(x-1, y-1, x+58, y+21, 0xF, FR_BORDERONLY);
|
DrawFrameRect(x-1, y-1, x+58, y+21, 0xF, FR_BORDERONLY);
|
||||||
}
|
}
|
||||||
@ -565,7 +565,7 @@ static void AircraftViewWndProc(Window *w, WindowEvent *e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* draw the flag plus orders */
|
/* draw the flag plus orders */
|
||||||
DrawSprite(v->vehstatus & VS_STOPPED ? 0xC12 : 0xC13, 2, w->widget[5].top + 1);
|
DrawSprite(v->vehstatus & VS_STOPPED ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, 2, w->widget[5].top + 1);
|
||||||
DrawStringCenteredTruncated(w->widget[5].left + 8, w->widget[5].right, w->widget[5].top + 1, str, 0);
|
DrawStringCenteredTruncated(w->widget[5].left + 8, w->widget[5].right, w->widget[5].top + 1, str, 0);
|
||||||
DrawWindowViewport(w);
|
DrawWindowViewport(w);
|
||||||
} break;
|
} break;
|
||||||
@ -690,7 +690,7 @@ static void DrawAircraftDepotWindow(Window *w)
|
|||||||
SetDParam(0, v->unitnumber);
|
SetDParam(0, v->unitnumber);
|
||||||
DrawString(x, y+2, (uint16)(v->max_age-366) >= v->age ? STR_00E2 : STR_00E3, 0);
|
DrawString(x, y+2, (uint16)(v->max_age-366) >= v->age ? STR_00E2 : STR_00E3, 0);
|
||||||
|
|
||||||
DrawSprite( (v->vehstatus & VS_STOPPED) ? 0xC12 : 0xC13, x, y+12);
|
DrawSprite((v->vehstatus & VS_STOPPED) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, x, y + 12);
|
||||||
|
|
||||||
if ((x+=74) == 2 + 74 * w->hscroll.cap) {
|
if ((x+=74) == 2 + 74 * w->hscroll.cap) {
|
||||||
x = 2;
|
x = 2;
|
||||||
|
@ -10,6 +10,7 @@
|
|||||||
#include "viewport.h"
|
#include "viewport.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
#include "variables.h"
|
#include "variables.h"
|
||||||
|
#include "table/sprites.h"
|
||||||
|
|
||||||
typedef struct TerraformerHeightMod {
|
typedef struct TerraformerHeightMod {
|
||||||
TileIndex tile;
|
TileIndex tile;
|
||||||
@ -485,13 +486,13 @@ int32 CmdSellLandArea(int x, int y, uint32 flags, uint32 p1, uint32 p2)
|
|||||||
|
|
||||||
void DrawClearLandTile(const TileInfo *ti, byte set)
|
void DrawClearLandTile(const TileInfo *ti, byte set)
|
||||||
{
|
{
|
||||||
DrawGroundSprite(0xF54 + _tileh_to_sprite[ti->tileh] + set * 19);
|
DrawGroundSprite(SPR_FLAT_BARE_LAND + _tileh_to_sprite[ti->tileh] + set * 19);
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawHillyLandTile(const TileInfo *ti)
|
void DrawHillyLandTile(const TileInfo *ti)
|
||||||
{
|
{
|
||||||
if (ti->tileh != 0) {
|
if (ti->tileh != 0) {
|
||||||
DrawGroundSprite(0xFA0 + _tileh_to_sprite[ti->tileh]);
|
DrawGroundSprite(SPR_FLAT_ROUGH_LAND + _tileh_to_sprite[ti->tileh]);
|
||||||
} else {
|
} else {
|
||||||
DrawGroundSprite(_landscape_clear_sprites[GB(ti->x ^ ti->y, 4, 3)]);
|
DrawGroundSprite(_landscape_clear_sprites[GB(ti->x ^ ti->y, 4, 3)]);
|
||||||
}
|
}
|
||||||
@ -529,7 +530,7 @@ static void DrawTile_Clear(TileInfo *ti)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
DrawGroundSprite(0xFB7 + _tileh_to_sprite[ti->tileh]);
|
DrawGroundSprite(SPR_FLAT_ROCKY_LAND_1 + _tileh_to_sprite[ti->tileh]);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 3:
|
case 3:
|
||||||
|
@ -6,10 +6,11 @@
|
|||||||
#include "functions.h"
|
#include "functions.h"
|
||||||
#include "viewport.h"
|
#include "viewport.h"
|
||||||
#include "command.h"
|
#include "command.h"
|
||||||
|
#include "table/sprites.h"
|
||||||
|
|
||||||
static void DrawTile_Dummy(TileInfo *ti)
|
static void DrawTile_Dummy(TileInfo *ti)
|
||||||
{
|
{
|
||||||
DrawGroundSpriteAt(0x3EC, ti->x, ti->y, ti->z);
|
DrawGroundSpriteAt(SPR_SHADOW_CELL, ti->x, ti->y, ti->z);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -284,7 +284,7 @@ static void RoadVehViewWndProc(Window *w, WindowEvent *e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* draw the flag plus orders */
|
/* draw the flag plus orders */
|
||||||
DrawSprite(v->vehstatus & VS_STOPPED ? 0xC12 : 0xC13, 2, w->widget[5].top + 1);
|
DrawSprite(v->vehstatus & VS_STOPPED ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, 2, w->widget[5].top + 1);
|
||||||
DrawStringCenteredTruncated(w->widget[5].left + 8, w->widget[5].right, w->widget[5].top + 1, str, 0);
|
DrawStringCenteredTruncated(w->widget[5].left + 8, w->widget[5].right, w->widget[5].top + 1, str, 0);
|
||||||
DrawWindowViewport(w);
|
DrawWindowViewport(w);
|
||||||
} break;
|
} break;
|
||||||
@ -587,7 +587,7 @@ static void DrawRoadDepotWindow(Window *w)
|
|||||||
SetDParam(0, v->unitnumber);
|
SetDParam(0, v->unitnumber);
|
||||||
DrawString(x, y+2, (uint16)(v->max_age-366) >= v->age ? STR_00E2 : STR_00E3, 0);
|
DrawString(x, y+2, (uint16)(v->max_age-366) >= v->age ? STR_00E2 : STR_00E3, 0);
|
||||||
|
|
||||||
DrawSprite( (v->vehstatus & VS_STOPPED) ? 0xC12 : 0xC13, x + 16, y);
|
DrawSprite((v->vehstatus & VS_STOPPED) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, x + 16, y);
|
||||||
|
|
||||||
if ((x+=56) == 2 + 56 * w->hscroll.cap) {
|
if ((x+=56) == 2 + 56 * w->hscroll.cap) {
|
||||||
x = 2;
|
x = 2;
|
||||||
|
@ -523,7 +523,7 @@ static void ShipViewWndProc(Window *w, WindowEvent *e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* draw the flag plus orders */
|
/* draw the flag plus orders */
|
||||||
DrawSprite(v->vehstatus & VS_STOPPED ? 0xC12 : 0xC13, 2, w->widget[5].top + 1);
|
DrawSprite(v->vehstatus & VS_STOPPED ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, 2, w->widget[5].top + 1);
|
||||||
DrawStringCenteredTruncated(w->widget[5].left + 8, w->widget[5].right, w->widget[5].top + 1, str, 0);
|
DrawStringCenteredTruncated(w->widget[5].left + 8, w->widget[5].right, w->widget[5].top + 1, str, 0);
|
||||||
DrawWindowViewport(w);
|
DrawWindowViewport(w);
|
||||||
} break;
|
} break;
|
||||||
@ -663,7 +663,7 @@ static void DrawShipDepotWindow(Window *w)
|
|||||||
SetDParam(0, v->unitnumber);
|
SetDParam(0, v->unitnumber);
|
||||||
DrawString(x, y+2, (uint16)(v->max_age-366) >= v->age ? STR_00E2 : STR_00E3, 0);
|
DrawString(x, y+2, (uint16)(v->max_age-366) >= v->age ? STR_00E2 : STR_00E3, 0);
|
||||||
|
|
||||||
DrawSprite( (v->vehstatus & VS_STOPPED) ? 0xC12 : 0xC13, x, y + 9);
|
DrawSprite((v->vehstatus & VS_STOPPED) ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, x, y + 9);
|
||||||
|
|
||||||
if ((x+=90) == 2 + 90 * w->hscroll.cap) {
|
if ((x+=90) == 2 + 90 * w->hscroll.cap) {
|
||||||
x = 2;
|
x = 2;
|
||||||
|
@ -1359,7 +1359,7 @@ uint32 GetCustomStationRelocation(const StationSpec *spec, const Station *st, by
|
|||||||
/* This is what gets subscribed of dtss->image in newgrf.c,
|
/* This is what gets subscribed of dtss->image in newgrf.c,
|
||||||
* so it's probably kinda "default offset". Try to use it as
|
* so it's probably kinda "default offset". Try to use it as
|
||||||
* emergency measure. */
|
* emergency measure. */
|
||||||
return 0x42D;
|
return SPR_RAIL_PLATFORM_Y_FRONT;
|
||||||
}
|
}
|
||||||
|
|
||||||
int GetCustomStationsCount(StationClass sclass)
|
int GetCustomStationsCount(StationClass sclass)
|
||||||
|
@ -119,7 +119,7 @@ enum Sprites {
|
|||||||
SPR_HUGEHQ_WEST_BUILD = 2630,
|
SPR_HUGEHQ_WEST_BUILD = 2630,
|
||||||
SPR_HUGEHQ_SOUTH = 2631,
|
SPR_HUGEHQ_SOUTH = 2631,
|
||||||
SPR_STATUE_GROUND = 1420,
|
SPR_STATUE_GROUND = 1420,
|
||||||
SPR_STATUE_COMPANY = 2623,
|
SPR_STATUE_COMPANY = 2632,
|
||||||
SPR_BOUGHT_LAND = 4790,
|
SPR_BOUGHT_LAND = 4790,
|
||||||
|
|
||||||
/* sprites for rail and rail stations*/
|
/* sprites for rail and rail stations*/
|
||||||
|
@ -442,7 +442,7 @@ static void DrawTrainDepotWindow(Window *w)
|
|||||||
DrawStringRightAligned(w->widget[6].right - 1, y + 4, STR_TINY_BLACK, 0); //Draw the counter
|
DrawStringRightAligned(w->widget[6].right - 1, y + 4, STR_TINY_BLACK, 0); //Draw the counter
|
||||||
|
|
||||||
/* Draw the pretty flag */
|
/* Draw the pretty flag */
|
||||||
DrawSprite(v->vehstatus&VS_STOPPED ? 0xC12 : 0xC13, x+15, y);
|
DrawSprite(v->vehstatus & VS_STOPPED ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, x + 15, y);
|
||||||
|
|
||||||
y += 14;
|
y += 14;
|
||||||
}
|
}
|
||||||
@ -984,7 +984,7 @@ static void TrainViewWndProc(Window *w, WindowEvent *e)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* draw the flag plus orders */
|
/* draw the flag plus orders */
|
||||||
DrawSprite(v->vehstatus & VS_STOPPED ? 0xC12 : 0xC13, 2, w->widget[5].top + 1);
|
DrawSprite(v->vehstatus & VS_STOPPED ? SPR_FLAG_VEH_STOPPED : SPR_FLAG_VEH_RUNNING, 2, w->widget[5].top + 1);
|
||||||
DrawStringCenteredTruncated(w->widget[5].left + 8, w->widget[5].right, w->widget[5].top + 1, str, 0);
|
DrawStringCenteredTruncated(w->widget[5].left + 8, w->widget[5].right, w->widget[5].top + 1, str, 0);
|
||||||
DrawWindowViewport(w);
|
DrawWindowViewport(w);
|
||||||
} break;
|
} break;
|
||||||
|
@ -1074,7 +1074,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
|
|||||||
if (f) DrawFoundation(ti, f);
|
if (f) DrawFoundation(ti, f);
|
||||||
|
|
||||||
// default sloped sprites..
|
// default sloped sprites..
|
||||||
if (ti->tileh != 0) image = _track_sloped_sprites[ti->tileh - 1] + 0x3F3;
|
if (ti->tileh != 0) image = SPR_RAIL_TRACK_Y + _track_sloped_sprites[ti->tileh - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// bridge ending.
|
// bridge ending.
|
||||||
@ -1089,7 +1089,7 @@ static void DrawTile_TunnelBridge(TileInfo *ti)
|
|||||||
if (!ice) {
|
if (!ice) {
|
||||||
DrawClearLandTile(ti, 3);
|
DrawClearLandTile(ti, 3);
|
||||||
} else {
|
} else {
|
||||||
DrawGroundSprite(0x11C6 + _tileh_to_sprite[ti->tileh]);
|
DrawGroundSprite(SPR_FLAT_SNOWY_TILE + _tileh_to_sprite[ti->tileh]);
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw ramp
|
// draw ramp
|
||||||
|
@ -117,10 +117,10 @@ static void DrawTile_Unmovable(TileInfo *ti)
|
|||||||
if (ti->map5 == 2) {
|
if (ti->map5 == 2) {
|
||||||
|
|
||||||
// statue
|
// statue
|
||||||
DrawGroundSprite(0x58C);
|
DrawGroundSprite(SPR_STATUE_GROUND);
|
||||||
|
|
||||||
image = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile));
|
image = PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile));
|
||||||
image += 0x8A48;
|
image += PALETTE_MODIFIER_COLOR | SPR_STATUE_COMPANY;
|
||||||
if (_display_opt & DO_TRANS_BUILDINGS)
|
if (_display_opt & DO_TRANS_BUILDINGS)
|
||||||
MAKE_TRANSPARENT(image);
|
MAKE_TRANSPARENT(image);
|
||||||
AddSortableSpriteToDraw(image, ti->x, ti->y, 16, 16, 25, ti->z);
|
AddSortableSpriteToDraw(image, ti->x, ti->y, 16, 16, 25, ti->z);
|
||||||
@ -130,7 +130,7 @@ static void DrawTile_Unmovable(TileInfo *ti)
|
|||||||
DrawClearLandTile(ti, 0);
|
DrawClearLandTile(ti, 0);
|
||||||
|
|
||||||
AddSortableSpriteToDraw(
|
AddSortableSpriteToDraw(
|
||||||
PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)) + 0x92B6,
|
PLAYER_SPRITE_COLOR(GetTileOwner(ti->tile)) + PALETTE_MODIFIER_COLOR + SPR_BOUGHT_LAND,
|
||||||
ti->x+8, ti->y+8,
|
ti->x+8, ti->y+8,
|
||||||
1, 1,
|
1, 1,
|
||||||
10,
|
10,
|
||||||
|
18
water_cmd.c
18
water_cmd.c
@ -17,7 +17,21 @@
|
|||||||
#include "vehicle_gui.h"
|
#include "vehicle_gui.h"
|
||||||
|
|
||||||
const SpriteID _water_shore_sprites[15] = {
|
const SpriteID _water_shore_sprites[15] = {
|
||||||
0, 0xFDF, 0xFE0, 0xFE4, 0xFDE, 0, 0xFE2, 0, 0xFE1, 0xFE5, 0, 0, 0xFE3, 0, 0
|
0,
|
||||||
|
SPR_SHORE_TILEH_1,
|
||||||
|
SPR_SHORE_TILEH_2,
|
||||||
|
SPR_SHORE_TILEH_3,
|
||||||
|
SPR_SHORE_TILEH_4,
|
||||||
|
0,
|
||||||
|
SPR_SHORE_TILEH_6,
|
||||||
|
0,
|
||||||
|
SPR_SHORE_TILEH_8,
|
||||||
|
SPR_SHORE_TILEH_9,
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
SPR_SHORE_TILEH_12,
|
||||||
|
0,
|
||||||
|
0
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -411,7 +425,7 @@ static void DrawTile_Water(TileInfo *ti)
|
|||||||
{
|
{
|
||||||
// draw water tile
|
// draw water tile
|
||||||
if (ti->map5 == 0) {
|
if (ti->map5 == 0) {
|
||||||
DrawGroundSprite(0xFDD);
|
DrawGroundSprite(SPR_FLAT_WATER_TILE);
|
||||||
if (ti->z != 0) DrawCanalWater(ti->tile);
|
if (ti->z != 0) DrawCanalWater(ti->tile);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
4
window.c
4
window.c
@ -11,6 +11,7 @@
|
|||||||
#include "viewport.h"
|
#include "viewport.h"
|
||||||
#include "console.h"
|
#include "console.h"
|
||||||
#include "variables.h"
|
#include "variables.h"
|
||||||
|
#include "table/sprites.h"
|
||||||
|
|
||||||
// delta between mouse cursor and upper left corner of dragged window
|
// delta between mouse cursor and upper left corner of dragged window
|
||||||
static Point _drag_delta;
|
static Point _drag_delta;
|
||||||
@ -1430,7 +1431,8 @@ static void MouseLoop(int click, int mousewheel)
|
|||||||
DEBUG(misc, 2) ("cursor: 0x%X (%d)", _cursor.sprite, _cursor.sprite);
|
DEBUG(misc, 2) ("cursor: 0x%X (%d)", _cursor.sprite, _cursor.sprite);
|
||||||
if (_thd.place_mode != 0 &&
|
if (_thd.place_mode != 0 &&
|
||||||
// query button and place sign button work in pause mode
|
// query button and place sign button work in pause mode
|
||||||
!(_cursor.sprite == 0x2CF || _cursor.sprite == 0x2D2) &&
|
_cursor.sprite != SPR_CURSOR_QUERY &&
|
||||||
|
_cursor.sprite != SPR_CURSOR_SIGN &&
|
||||||
_pause != 0 &&
|
_pause != 0 &&
|
||||||
!_cheats.build_in_pause.value)
|
!_cheats.build_in_pause.value)
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user