Skip to content

Commit

Permalink
Merge pull request #3 from ahyangyi:fix-platform-switch-2
Browse files Browse the repository at this point in the history
Hirundo made this mistake years ago...
See OpenTTD/nml#330
  • Loading branch information
WenSimEHRP authored May 18, 2024
2 parents 0011d4b + 65b8bff commit b916453
Showing 1 changed file with 20 additions and 20 deletions.
40 changes: 20 additions & 20 deletions src/testing.pnml
Original file line number Diff line number Diff line change
Expand Up @@ -86,12 +86,12 @@ spriteset (s_test_fence, ZOOM_LEVEL_IN_4X, BIT_DEPTH_32BPP) {
}*/

#define GET_NPLAT_FORMATION \
((getbits(LOAD_TEMP(TILE_X_SW), NPLAT_BIT, 1) ^ getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_SW, 1)) << 0|\
(getbits(LOAD_TEMP(TILE_X_NE), NPLAT_BIT, 1) ^ getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_NE, 1)) << 1)
((!getbits(LOAD_TEMP(TEMP_NEARBY_TILE_STATION), TILE_X_SW, 1) | getbits(LOAD_TEMP(TILE_X_SW), NPLAT_BIT, 1) & getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_SW, 1)) << 0|\
(!getbits(LOAD_TEMP(TEMP_NEARBY_TILE_STATION), TILE_X_NE, 1) | getbits(LOAD_TEMP(TILE_X_NE), NPLAT_BIT, 1) & getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_NE, 1)) << 1)

#define GET_SPLAT_FORMATION \
((getbits(LOAD_TEMP(TILE_X_SW), SPLAT_BIT, 1) ^ getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_SW, 1)) << 0|\
(getbits(LOAD_TEMP(TILE_X_NE), SPLAT_BIT, 1) ^ getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_NE, 1)) << 1)
((!getbits(LOAD_TEMP(TEMP_NEARBY_TILE_STATION), TILE_X_SW, 1) | getbits(LOAD_TEMP(TILE_X_SW), SPLAT_BIT, 1) & getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_SW, 1)) << 0|\
(!getbits(LOAD_TEMP(TEMP_NEARBY_TILE_STATION), TILE_X_NE, 1) | getbits(LOAD_TEMP(TILE_X_NE), SPLAT_BIT, 1) & getbits(LOAD_TEMP(TEMP_NEARBY_TILE_GRF), TILE_X_NE, 1)) << 1)

spritelayout sp_test_x(hide_platform_nw, hide_platform_se, hide_shelter) {
ground {sprite: GROUNDSPRITE_RAIL_X;}
Expand Down Expand Up @@ -185,14 +185,14 @@ switch (FEAT_STATIONS, SELF, sw_check_rail_continuation,


switch (FEAT_STATIONS, SELF, sw_check_nearby_tile_station,
(nearby_tile_is_station(-1, 0) == 1) << TILE_X_NE|
(nearby_tile_is_station( 1, 0) == 1) << TILE_X_SW|
(nearby_tile_is_station( 0,-1) == 1) << TILE_X_NW|
(nearby_tile_is_station( 0, 1) == 1) << TILE_X_SE|
(nearby_tile_is_station(-1,-1) == 1) << TILE_X_N|
(nearby_tile_is_station( 1, 1) == 1) << TILE_X_S|
(nearby_tile_is_station( 1,-1) == 1) << TILE_X_W|
(nearby_tile_is_station(-1, 1) == 1) << TILE_X_E) {return;}
nearby_tile_is_station(-1, 0) << TILE_X_NE|
nearby_tile_is_station( 1, 0) << TILE_X_SW|
nearby_tile_is_station( 0,-1) << TILE_X_NW|
nearby_tile_is_station( 0, 1) << TILE_X_SE|
nearby_tile_is_station(-1,-1) << TILE_X_N|
nearby_tile_is_station( 1, 1) << TILE_X_S|
nearby_tile_is_station( 1,-1) << TILE_X_W|
nearby_tile_is_station(-1, 1) << TILE_X_E) {return;}

switch (FEAT_STATIONS, SELF, sw_check_nearby_tile_perpendicular,
(nearby_tile_perpendicular(-1, 0) == 1) << TILE_X_NE|
Expand All @@ -205,14 +205,14 @@ switch (FEAT_STATIONS, SELF, sw_check_nearby_tile_perpendicular,
(nearby_tile_perpendicular(-1, 1) == 1) << TILE_X_E) {return;}

switch (FEAT_STATIONS, SELF, sw_check_nearby_tile_grf,
(nearby_tile_same_grf(-1, 0) == 1) << TILE_X_NE|
(nearby_tile_same_grf( 1, 0) == 1) << TILE_X_SW|
(nearby_tile_same_grf( 0,-1) == 1) << TILE_X_NW|
(nearby_tile_same_grf( 0, 1) == 1) << TILE_X_SE|
(nearby_tile_same_grf(-1,-1) == 1) << TILE_X_N|
(nearby_tile_same_grf( 1, 1) == 1) << TILE_X_S|
(nearby_tile_same_grf( 1,-1) == 1) << TILE_X_W|
(nearby_tile_same_grf(-1, 1) == 1) << TILE_X_E) {return;}
nearby_tile_other_grf(-1, 0) << TILE_X_NE|
nearby_tile_other_grf( 1, 0) << TILE_X_SW|
nearby_tile_other_grf( 0,-1) << TILE_X_NW|
nearby_tile_other_grf( 0, 1) << TILE_X_SE|
nearby_tile_other_grf(-1,-1) << TILE_X_N|
nearby_tile_other_grf( 1, 1) << TILE_X_S|
nearby_tile_other_grf( 1,-1) << TILE_X_W|
nearby_tile_other_grf(-1, 1) << TILE_X_E) {return;}

switch (FEAT_STATIONS, SELF, sw_test, [
STORE_TEMP(sw_check_rail_continuation(), TEMP_RAIL_CONTINUATION),
Expand Down

0 comments on commit b916453

Please sign in to comment.