Skip to content

Commit

Permalink
Add: *Add two more experimental airtypes for graphic purposes.
Browse files Browse the repository at this point in the history
  • Loading branch information
J0anJosep committed Jul 11, 2024
1 parent a523522 commit b4f1c94
Show file tree
Hide file tree
Showing 11 changed files with 758 additions and 24 deletions.
Binary file modified media/baseset/openttd.grf
Binary file not shown.
2 changes: 1 addition & 1 deletion media/baseset/openttd.grf.hash
Original file line number Diff line number Diff line change
@@ -1 +1 @@
43b4094f645929e9d143a93983906d81
8bf3527c85bb373fa65b8e1d6b68f388
2 changes: 2 additions & 0 deletions media/baseset/openttd/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ if(GRFCODEC_FOUND)
${CMAKE_CURRENT_SOURCE_DIR}/2ccmap.nfo
PNG_SOURCE_FILES ${CMAKE_CURRENT_SOURCE_DIR}/airports.png
${CMAKE_CURRENT_SOURCE_DIR}/airport_asphalt.png
${CMAKE_CURRENT_SOURCE_DIR}/airport_asphalt_dark.png
${CMAKE_CURRENT_SOURCE_DIR}/airport_asphalt_yellow.png
${CMAKE_CURRENT_SOURCE_DIR}/airport_gravel.png
${CMAKE_CURRENT_SOURCE_DIR}/airport_preview.png
${CMAKE_CURRENT_SOURCE_DIR}/airport_water.png
Expand Down
Binary file added media/baseset/openttd/airport_asphalt_dark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added media/baseset/openttd/airport_asphalt_yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
335 changes: 320 additions & 15 deletions media/baseset/openttd/airtypes.nfo

Large diffs are not rendered by default.

9 changes: 8 additions & 1 deletion src/air_type.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,18 @@ typedef uint32_t AirTypeLabel;
static const AirTypeLabel AIRTYPE_LABEL_GRAVEL = 'GRVL';

Check failure on line 17 in src/air_type.h

View workflow job for this annotation

GitHub Actions / Linux (GCC - Dedicated) / CI

‘AirTypeLabel’ does not name a type
static const AirTypeLabel AIRTYPE_LABEL_ASPHALT = 'ASPH';

Check failure on line 18 in src/air_type.h

View workflow job for this annotation

GitHub Actions / Linux (GCC - Dedicated) / CI

‘AirTypeLabel’ does not name a type
static const AirTypeLabel AIRTYPE_LABEL_WATER = 'WATR';

Check failure on line 19 in src/air_type.h

View workflow job for this annotation

GitHub Actions / Linux (GCC - Dedicated) / CI

‘AirTypeLabel’ does not name a type
static const AirTypeLabel AIRTYPE_LABEL_ASPHALT_DARK = 'ASPD';

Check failure on line 20 in src/air_type.h

View workflow job for this annotation

GitHub Actions / Linux (GCC - Dedicated) / CI

‘AirTypeLabel’ does not name a type

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable AIRTYPE_LABEL_ASPHALT_DARK is never read.
static const AirTypeLabel AIRTYPE_LABEL_ASPHALT_YELLOW = 'ASPY';

Check failure on line 21 in src/air_type.h

View workflow job for this annotation

GitHub Actions / Linux (GCC - Dedicated) / CI

‘AirTypeLabel’ does not name a type

Check notice

Code scanning / CodeQL

Unused static variable Note

Static variable AIRTYPE_LABEL_ASPHALT_YELLOW is never read.


/** Enumeration for all possible airtypes. */
enum AirType : uint8_t {

Check failure on line 25 in src/air_type.h

View workflow job for this annotation

GitHub Actions / Linux (GCC - Dedicated) / CI

found ‘:’ in nested-name-specifier, expected ‘::’

Check failure on line 25 in src/air_type.h

View workflow job for this annotation

GitHub Actions / Linux (GCC - Dedicated) / CI

‘AirType’ has not been declared

Check failure on line 25 in src/air_type.h

View workflow job for this annotation

GitHub Actions / Linux (GCC - Dedicated) / CI

expected unqualified-id before ‘{’ token
AIRTYPE_BEGIN = 0, ///< Used for iterations
AIRTYPE_GRAVEL = 0, ///< Gravel surface
AIRTYPE_ASPHALT = 1, ///< Asphalt surface
AIRTYPE_WATER = 2, ///< Water surface
AIRTYPE_DARK = 3,
AIRTYPE_YELLOW = 4,
AIRTYPE_END = 16, ///< Used for iterations
INVALID_AIRTYPE = 0xFF, ///< Flag for invalid airtype

Expand All @@ -41,7 +46,9 @@ enum AirTypes : uint64_t {
AIRTYPES_GRAVEL = 1 << AIRTYPE_GRAVEL, ///< Gravel surface
AIRTYPES_ASPHALT = 1 << AIRTYPE_ASPHALT, ///< Asphalt surface
AIRTYPES_WATER = 1 << AIRTYPE_WATER, ///< Water surface
AIRTYPES_ALL = AIRTYPES_GRAVEL | AIRTYPES_ASPHALT | AIRTYPES_WATER,
AIRTYPES_DARK = 1 << AIRTYPE_DARK, ///< Dark surface
AIRTYPES_YELLOW = 1 << AIRTYPE_YELLOW, ///< Yellow surface
AIRTYPES_ALL = AIRTYPES_GRAVEL | AIRTYPES_ASPHALT | AIRTYPES_WATER | AIRTYPES_DARK | AIRTYPES_YELLOW,
INVALID_AIRTYPES = UINT16_MAX, ///< Invalid airtypes
};
DECLARE_ENUM_AS_BIT_SET(AirTypes)
Expand Down
8 changes: 7 additions & 1 deletion src/lang/english.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2983,9 +2983,11 @@ STR_STATION_BUILD_DOCK_CAPTION :{WHITE}Dock
STR_TOOLBAR_AIRPORT_GRAVEL_CONSTRUCTION_CAPTION :Gravel Airport Construction
STR_TOOLBAR_AIRPORT_ASPHALT_CONSTRUCTION_CAPTION :Asphalt Airport Construction
STR_TOOLBAR_AIRPORT_WATER_CONSTRUCTION_CAPTION :Water Airport Construction
STR_TOOLBAR_AIRPORT_DARK_CONSTRUCTION_CAPTION :Darker Airport Construction
STR_TOOLBAR_AIRPORT_YELLOW_CONSTRUCTION_CAPTION :Drawn Tracks Airport Construction

# Airport menu text
###length 3
###length 5
STR_TOOLBAR_AIRPORT_GRAVEL_MENU_TEXT :Gravel airport construction
STR_TOOLBAR_AIRPORT_ASPHALT_MENU_TEXT :Asphalt airport construction
STR_TOOLBAR_AIRPORT_WATER_MENU_TEXT :Water airport construction
Expand Down Expand Up @@ -3018,6 +3020,8 @@ STR_TOOLBAR_AIRPORT_TOGGLE_GROUND_TOOLBAR :{BLACK}Click ove
STR_AIRTYPE_NAME_GRAVEL :Gravel airport
STR_AIRTYPE_NAME_ASPHALT :Asphalt airport
STR_AIRTYPE_NAME_WATER :Water airport
STR_AIRTYPE_NAME_DARK :Darker airport
STR_AIRTYPE_NAME_YELLOW :Drawn tracks airport

# Airport infrastructure construction window
STR_BUILD_AIRPORT_INFRA_NO_CATCH_CAPTION :{WHITE}Infrastructure without cargo catchment
Expand Down Expand Up @@ -4468,6 +4472,8 @@ STR_REPLACE_TRAM_VEHICLES :Tramway Vehicle
STR_REPLACE_AIRCRAFT_GRAVEL_VEHICLES :Gravel aircraft
STR_REPLACE_AIRCRAFT_ASPHALT_VEHICLES :Asphalt aircraft
STR_REPLACE_AIRCRAFT_WATER_VEHICLES :Water aircraft
STR_REPLACE_AIRCRAFT_DARK_VEHICLES :Dark aircraft
STR_REPLACE_AIRCRAFT_YELLOW_VEHICLES :Drawn tracks aircraft

STR_REPLACE_REMOVE_WAGON :{BLACK}Wagon removal ({STRING1}): {ORANGE}{STRING}
STR_REPLACE_REMOVE_WAGON_HELP :{BLACK}Make autoreplace keep the length of a train the same by removing wagons (starting at the front), if replacing the engine would make the train longer
Expand Down
2 changes: 1 addition & 1 deletion src/station_cmd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2756,7 +2756,7 @@ static void DrawAirportFences(TileInfo *ti)
PaletteID palette = COMPANY_SPRITE_COLOUR(GetTileOwner(ti->tile));
for (DiagDirection dir = DIAGDIR_BEGIN; dir < DIAGDIR_END; dir++) {
TileIndex neighbour = TileAddByDiagDir(ti->tile, dir);
if (IsValidTile(neighbour) && IsAirportTileOfStation(neighbour, st_id)) continue;
if (IsValidTile(neighbour) && (IsAirportTileOfStation(neighbour, st_id) || IsTileType(neighbour, MP_OBJECT))) continue;
AddSortableSpriteToDraw(SPR_TRACK_FENCE_FLAT_Y - (dir % 2), palette,
ti->x + x_off_air_fence[dir], ti->y + y_off_air_fence[dir], (dir % 2) ? 16 : 1, (dir % 2) ? 1 : 16, 4, ti->z);
}
Expand Down
Loading

0 comments on commit b4f1c94

Please sign in to comment.