From 981b67a90f8cd92ee2e8c42c17f6461a6d2e36b7 Mon Sep 17 00:00:00 2001 From: Gymnasiast Date: Sat, 27 Jan 2018 23:22:24 +0100 Subject: [PATCH] Reorder edge textures --- src/openrct2-ui/interface/LandTool.cpp | 14 ++++++-------- src/openrct2-ui/interface/LandTool.h | 1 + src/openrct2-ui/windows/Land.cpp | 2 +- src/openrct2-ui/windows/MapGen.cpp | 4 ++-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/src/openrct2-ui/interface/LandTool.cpp b/src/openrct2-ui/interface/LandTool.cpp index 76770f749a..656549c86f 100644 --- a/src/openrct2-ui/interface/LandTool.cpp +++ b/src/openrct2-ui/interface/LandTool.cpp @@ -33,20 +33,18 @@ static uint16 toolSizeSpriteIndices[] = SPR_LAND_TOOL_SIZE_7, }; -static char FloorTextureOrder[] = +static uint32 FloorTextureOrder[] = { TERRAIN_SAND_DARK, TERRAIN_SAND_LIGHT, TERRAIN_DIRT, TERRAIN_GRASS_CLUMPS, TERRAIN_GRASS, TERRAIN_ROCK, TERRAIN_SAND, TERRAIN_MARTIAN, TERRAIN_CHECKERBOARD, TERRAIN_ICE, TERRAIN_GRID_RED, TERRAIN_GRID_YELLOW, TERRAIN_GRID_BLUE, TERRAIN_GRID_GREEN }; -static char WallTextureOrder[] = +uint32 WallTextureOrder[] = { - TERRAIN_EDGE_ROCK, TERRAIN_EDGE_WOOD_RED, TERRAIN_EDGE_WOOD_BLACK, TERRAIN_EDGE_ICE, - TERRAIN_EDGE_BRICK, TERRAIN_EDGE_IRON, - TERRAIN_EDGE_GREY, TERRAIN_EDGE_YELLOW, TERRAIN_EDGE_RED, TERRAIN_EDGE_PURPLE, TERRAIN_EDGE_GREEN, - TERRAIN_EDGE_STONE_BROWN, TERRAIN_EDGE_STONE_GREY, - TERRAIN_EDGE_SKYSCRAPER_A, TERRAIN_EDGE_SKYSCRAPER_B, + TERRAIN_EDGE_ROCK, TERRAIN_EDGE_WOOD_RED, TERRAIN_EDGE_WOOD_BLACK, TERRAIN_EDGE_ICE, TERRAIN_EDGE_BRICK, + TERRAIN_EDGE_GREY, TERRAIN_EDGE_YELLOW, TERRAIN_EDGE_RED, TERRAIN_EDGE_PURPLE, TERRAIN_EDGE_GREEN, + TERRAIN_EDGE_IRON, TERRAIN_EDGE_STONE_BROWN, TERRAIN_EDGE_STONE_GREY, TERRAIN_EDGE_SKYSCRAPER_A, TERRAIN_EDGE_SKYSCRAPER_B, 0, 0 }; @@ -124,7 +122,7 @@ void land_tool_show_edge_style_dropdown(rct_window * w, rct_widget * widget, uin for (uint8 i = 0; i < edgeCount; i++) { gDropdownItemsFormat[i] = DROPDOWN_FORMAT_LAND_PICKER; - gDropdownItemsArgs[i] = WallTexturePreviews[i]; + gDropdownItemsArgs[i] = WallTexturePreviews[WallTextureOrder[i]]; if (WallTextureOrder[i] == currentEdgeType) defaultIndex = i; } diff --git a/src/openrct2-ui/interface/LandTool.h b/src/openrct2-ui/interface/LandTool.h index 484ee310a3..749c57a8ae 100644 --- a/src/openrct2-ui/interface/LandTool.h +++ b/src/openrct2-ui/interface/LandTool.h @@ -33,6 +33,7 @@ extern uint8 gLandToolTerrainEdge; extern money32 gWaterToolRaiseCost; extern money32 gWaterToolLowerCost; +extern uint32 WallTextureOrder[]; extern uint32 WallTexturePreviews[]; uint32 land_tool_size_to_sprite_index(uint16 size); diff --git a/src/openrct2-ui/windows/Land.cpp b/src/openrct2-ui/windows/Land.cpp index 9f7cb7e40f..f5634bdfe2 100644 --- a/src/openrct2-ui/windows/Land.cpp +++ b/src/openrct2-ui/windows/Land.cpp @@ -239,7 +239,7 @@ static void window_land_dropdown(rct_window *w, rct_widgetindex widgetIndex, sin if (dropdownIndex == -1) dropdownIndex = gDropdownHighlightedIndex; - type = (dropdownIndex == -1) ?_selectedWallTexture : dropdownIndex; + type = (dropdownIndex == -1) ?_selectedWallTexture : WallTextureOrder[dropdownIndex]; if (gLandToolTerrainEdge == type) { gLandToolTerrainEdge = 255; diff --git a/src/openrct2-ui/windows/MapGen.cpp b/src/openrct2-ui/windows/MapGen.cpp index dffdab9234..86483fb57f 100644 --- a/src/openrct2-ui/windows/MapGen.cpp +++ b/src/openrct2-ui/windows/MapGen.cpp @@ -722,7 +722,7 @@ static void window_mapgen_base_dropdown(rct_window *w, rct_widgetindex widgetInd if (dropdownIndex == -1) dropdownIndex = gDropdownHighlightedIndex; - type = (dropdownIndex == -1) ? _wallTexture : dropdownIndex; + type = (dropdownIndex == -1) ? _wallTexture : WallTextureOrder[dropdownIndex]; if (gLandToolTerrainEdge == type) { gLandToolTerrainEdge = 255; @@ -1016,7 +1016,7 @@ static void window_mapgen_simplex_dropdown(rct_window *w, rct_widgetindex widget if (dropdownIndex == -1) dropdownIndex = gDropdownHighlightedIndex; - type = (dropdownIndex == -1) ? _wallTexture : dropdownIndex; + type = (dropdownIndex == -1) ? _wallTexture : WallTextureOrder[dropdownIndex]; if (gLandToolTerrainEdge == type) { gLandToolTerrainEdge = 255;