Repository navigation
Reimplement 88 Map::TileMapState functions at 100% #366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
786e39f
c6eb340
57ad68a
db8c482
b882e31
04af9b1
b374897
5de5096
be54045
bb90ea0
c21cc0c
0a5ba82
4227c71
0173f09
a50bdcf
6ad2a6c
6f522f7
51479bd
67247ca
7d1f870
31a645f
04a5f3e
03523e2
5c1e705
9882188
46b6f76
2a224ea
531e6e3
bae202f
ccb8650
73f5100
233eacc
e4efe7a
d146f8e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| #include "../TileMapState.func.hpp" | ||
|
|
||
| #include "OpenSHC/Commands/MappersEnum.hpp" | ||
| #include "OpenSHC/Map/Enums/LoweredViewTransition.hpp" | ||
| #include "OpenSHC/Map/Rocks/Enums/EditorRockType.hpp" | ||
| #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" | ||
|
|
||
| #include "OpenSHC/Globals/DAT_GameCore.hpp" | ||
| #include "OpenSHC/Globals/DAT_GameState.hpp" | ||
|
|
||
| namespace OpenSHC { | ||
| namespace Map { | ||
|
|
||
| // FUNCTION: STRONGHOLDCRUSADER 0x00515F40 | ||
| TileMapState* TileMapState::Constructor_TileMapState() | ||
| { | ||
| MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::setupMovementDirectionTranslationMatrix, this)(); | ||
| MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::setupBuildingSizeIndexMapping, this)(); | ||
| MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::setupTileMapSections, this)(); | ||
| this->editorActiveBrush = 7; | ||
| this->refreshCertainTileMap = OpenSHC::Map::Enums::LVT_SET_NORMAL; | ||
| this->counter1 = 0; | ||
| this->mapperMax = FALSE; | ||
| this->editorSnapToMode = 0; | ||
| this->editorAffectType = 0; | ||
| this->unknownZero_0x554900 = 0; | ||
| this->currentMapperCommand = OpenSHC::Commands::M_MAPPER_NULL; | ||
| this->refreshRelatedOne = 1; | ||
| this->disableElevationRendering = 0; | ||
| this->refreshRelatedTwo = 0; | ||
| this->forceUpdateLogicalAndMiscDisplayLayers = TRUE; | ||
| this->forceUpdateTextureTilemap = TRUE; | ||
| this->forceUpdateGFXLayers = TRUE; | ||
| this->refreshCertainTileMap_old = OpenSHC::Map::Enums::LVT_RAISE; | ||
| MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::setChangedLayerToThreeAndMapping0x40x40, this)(); | ||
| this->moatTileCount = 0; | ||
| this->skipPlacementCheck = 0; | ||
| this->gateOrientationVariant = 80; | ||
| this->lastTime = timeGetTime(); | ||
| this->rockOrientation = OpenSHC::Map::Enums::MO_NORTH; | ||
| this->editorRockType = OpenSHC::Map::Rocks::Enums::ERT_NONE; | ||
| this->cursorAnimationTime = timeGetTime(); | ||
| this->cursorOverlayAnimationFrame = 1; | ||
| this->temporaryTerrainTypeIndex = 0; | ||
| this->skipPlacementFailChecks = 0; | ||
| DAT_GameCore::instance.isTimeHalted = FALSE; | ||
| DAT_GameState::instance.mapAndTime.skirmishFogOfWar = 0; | ||
| this->ptr_LogicLayer = this->LogicLayer; | ||
| this->ptr_TerrainTypeTileMap = this->Logic2Layer; | ||
| this->ptr_TerrainHeightTileMap = this->HeightLayer; | ||
| this->ptr_ChangedLayer = this->ChangedLayer; | ||
| this->ptr_OccupancyLayer = this->OccupancyLayer; | ||
| this->ptr_DamageLayer = this->DamageLayer; | ||
| this->ptr_PathConnectionLayer = this->PathConnectionLayer; | ||
| this->ptr_MovementDirectionTranslationMatrix = this; | ||
| this->ptr_SpecialAreasArray = this->specialAreasArray; | ||
| this->ptr_AIZoneLayer = this->AIZoneLayer; | ||
| this->ptr_MiscDisplayLayer = this->MiscDisplayLayer; | ||
| this->currentMoatCount = 16000; | ||
| this->maxPitchDitchCount = 4000; | ||
| return this; | ||
| } | ||
|
|
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #include "../TileMapState.func.hpp" | ||
|
|
||
| #include "OpenSHC/Map/Navigation/PathFindingState.func.hpp" | ||
| #include "OpenSHC/UI/MinimapViewState.func.hpp" | ||
|
|
||
| #include "OpenSHC/Globals/DAT_MinimapViewState.hpp" | ||
| #include "OpenSHC/Globals/DAT_PathFindingState.hpp" | ||
|
|
||
| namespace OpenSHC { | ||
| namespace Map { | ||
|
|
||
| using OpenSHC::Map::LogicHelpers::L2_NONE; | ||
| using OpenSHC::Map::LogicHelpers::L_MOAT; | ||
| using OpenSHC::Map::LogicHelpers::L_MOAT_DUG_OR_PLANNED; | ||
| using OpenSHC::Map::LogicHelpers::L_PLAIN2_AND_PITCH; | ||
|
|
||
| // FUNCTION: STRONGHOLDCRUSADER 0x00500500 | ||
| BOOLEnum TileMapState::advanceMoatDigProgress(int moatID) | ||
| { | ||
| this->moats[moatID].fillProgress += 1; | ||
| if (this->moats[moatID].fillProgress >= 4) { | ||
| int tile = this->moats[moatID].tile; | ||
| this->moats[moatID].someCountDown = 0; | ||
| this->moats[moatID].fillProgress = 4; | ||
| this->moats[moatID].stage = 2; | ||
| this->HeightLayer[tile] = 0; | ||
| this->LogicLayer[this->moats[moatID].tile] &= ~L_MOAT_DUG_OR_PLANNED; | ||
| this->LogicLayer[this->moats[moatID].tile] &= ~L_PLAIN2_AND_PITCH; | ||
| this->LogicLayer[this->moats[moatID].tile] |= L_MOAT; | ||
| this->Logic2Layer[this->moats[moatID].tile] = L2_NONE; | ||
| MACRO_CALL_MEMBER(OpenSHC::Map::Navigation::PathFindingState_Func::updateWalkAndPathLayer, | ||
| DAT_PathFindingState::ptr)(2, this->moats[moatID].x, this->moats[moatID].y); | ||
| MACRO_CALL_MEMBER(OpenSHC::Map::Navigation::PathFindingState_Func::updatePathLinkagesInAllEightDirections, | ||
| DAT_PathFindingState::ptr)(this->moats[moatID].y, this->moats[moatID].tile); | ||
| DAT_PathFindingState::instance.toggleUpdateSeparateAreaTileMap = 1; | ||
| MACRO_CALL_MEMBER(OpenSHC::UI::MinimapViewState_Func::triggerMinimapRedraw, DAT_MinimapViewState::ptr)(1); | ||
| return TRUE; | ||
| } | ||
| return FALSE; | ||
| } | ||
|
|
||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,59 @@ | ||
| #include "../TileMapState.func.hpp" | ||
|
|
||
| #include "OpenSHC/Map/LandscapeState.func.hpp" | ||
| #include "OpenSHC/Map/Enums/CardinalDirection.hpp" | ||
|
|
||
| #include "OpenSHC/Globals/DAT_LandscapeState.hpp" | ||
| #include "OpenSHC/Globals/DAT_TileMapState.hpp" | ||
| #include "OpenSHC/Globals/DAT_ViewportRenderState.hpp" | ||
| #include "OpenSHC/Globals/GMFirstPictureIndex.hpp" | ||
|
|
||
| namespace OpenSHC { | ||
| namespace Map { | ||
|
|
||
| using OpenSHC::Map::Enums::CD_UPPER_LIMIT; | ||
| using OpenSHC::Map::LogicHelpers::L_WALL_OR_GATEHOUSE; | ||
|
|
||
| // FUNCTION: STRONGHOLDCRUSADER 0x004FB770 | ||
| void TileMapState::applyRockGraphicsToFootprint(int rockID) | ||
| { | ||
| int rockX = DAT_LandscapeState::instance.rocks[rockID].x; | ||
| int rockY = DAT_LandscapeState::instance.rocks[rockID].y; | ||
| int orientation = DAT_LandscapeState::instance.rocks[rockID].orientation + this->mapOrientation; | ||
| int index = 0; | ||
| if (orientation >= CD_UPPER_LIMIT) { | ||
| orientation -= CD_UPPER_LIMIT; | ||
| } | ||
| int size = DAT_LandscapeState::instance.rocks[rockID].size; | ||
| int surface = (orientation / 2) * size * size; | ||
|
|
||
| do { | ||
| MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::getBuildingSizeIndexMappingData, this)( | ||
| index, DAT_LandscapeState::instance.rocks[rockID].size); | ||
| int tile = DAT_ViewportRenderState::instance.translationMatrix[this->buildingY + rockY].addXgetTile + rockX | ||
| + this->buildingX; | ||
| if ((this->LogicLayer[tile] & L_WALL_OR_GATEHOUSE) == 0) { | ||
| if (this->disableElevationRendering == 0) { | ||
| this->GfxLayer[tile] | ||
| = GMFirstPictureIndex::instance[DAT_LandscapeState::instance.rocks[rockID].unknownGMID] | ||
| + DAT_LandscapeState::instance.rocks[rockID].gfx + this->buildingOrientedPartIndex + surface | ||
| - 1; | ||
| } else if (DAT_LandscapeState::instance.rocks[rockID].size == 1) { | ||
| this->GfxLayer[tile] | ||
| = GMFirstPictureIndex::instance[DAT_LandscapeState::instance.rocks[rockID].unknownGMID] | ||
| + DAT_LandscapeState::instance.rocks[rockID].gfx + this->buildingOrientedPartIndex + surface | ||
| - 1; | ||
| } else { | ||
| this->GfxLayer[tile] | ||
| = MACRO_CALL_MEMBER(OpenSHC::Map::LandscapeState_Func::getRandomRockImageOffset, | ||
| DAT_LandscapeState::ptr)((DAT_TileMapState::instance.RandomLayer[tile] & 3) + 1) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I assume the 3 marks the first two byte in this layer, but we have no info on them at the moment?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| + GMFirstPictureIndex::instance[DAT_LandscapeState::instance.rocks[rockID].unknownGMID] | ||
| + surface - 1; | ||
| } | ||
| } | ||
| index++; | ||
| } while (index < this->constructionTileCount); | ||
| } | ||
|
|
||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| #include "../TileMapState.func.hpp" | ||
|
|
||
| #include "OpenSHC/Map/Buildings/BuildingsState.func.hpp" | ||
| #include "OpenSHC/Rendering/ViewportRenderState.func.hpp" | ||
| #include "OpenSHC/Map/Enums/CardinalDirection.hpp" | ||
|
|
||
| #include "OpenSHC/Globals/DAT_BuildingsState.hpp" | ||
| #include "OpenSHC/Globals/DAT_TileMapState.hpp" | ||
| #include "OpenSHC/Globals/DAT_ViewportRenderState.hpp" | ||
|
|
||
| namespace OpenSHC { | ||
| namespace Map { | ||
|
|
||
| // FUNCTION: STRONGHOLDCRUSADER 0x00501B90 | ||
| void TileMapState::changeMapOrientation(MapOrientation mapOrientation) | ||
| { | ||
| MACRO_CALL_MEMBER(OpenSHC::Rendering::ViewportRenderState_Func::saveFocusTileAndCenterPreview, | ||
| DAT_ViewportRenderState::ptr)(); | ||
| DAT_TileMapState::instance.mapOrientation = mapOrientation; | ||
| MACRO_CALL_MEMBER( | ||
| OpenSHC::Rendering::ViewportRenderState_Func::restoreFocusTile, DAT_ViewportRenderState::ptr)(); | ||
| MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::forceFullTileMapRedraw, this)(); | ||
| MACRO_CALL_MEMBER( | ||
| OpenSHC::Map::Buildings::BuildingsState_Func::refreshAllBuildingTileDisplays, DAT_BuildingsState::ptr)(); | ||
| DAT_BuildingsState::instance.field_0x10 = 5; | ||
| switch (this->mapOrientation) { | ||
| case OpenSHC::Map::Enums::MO_NORTH: | ||
| this->screenSouthEastDirection = OpenSHC::Map::Enums::CD_SOUTHEAST; | ||
| this->orientedRowStep = 1; | ||
| this->screenEastDirection = OpenSHC::Map::Enums::CD_EAST; | ||
| this->screenSouthDirection = OpenSHC::Map::Enums::CD_SOUTH; | ||
| this->screenSouthWestDirection = OpenSHC::Map::Enums::CD_SOUTHWEST; | ||
| return; | ||
| case OpenSHC::Map::Enums::MO_EAST: | ||
| this->screenSouthEastDirection = OpenSHC::Map::Enums::CD_SOUTHWEST; | ||
| this->orientedRowStep = 1; | ||
| this->screenEastDirection = OpenSHC::Map::Enums::CD_SOUTH; | ||
| this->screenSouthDirection = OpenSHC::Map::Enums::CD_WEST; | ||
| this->screenSouthWestDirection = OpenSHC::Map::Enums::CD_NORTHWEST; | ||
| return; | ||
| case OpenSHC::Map::Enums::MO_SOUTH: | ||
| this->screenSouthEastDirection = OpenSHC::Map::Enums::CD_NORTHWEST; | ||
| this->screenEastDirection = OpenSHC::Map::Enums::CD_WEST; | ||
| this->screenSouthDirection = OpenSHC::Map::Enums::CD_NORTH; | ||
| this->screenSouthWestDirection = OpenSHC::Map::Enums::CD_NORTHEAST; | ||
| this->orientedRowStep = -1; | ||
| return; | ||
| case OpenSHC::Map::Enums::MO_WEST: | ||
| this->screenSouthEastDirection = OpenSHC::Map::Enums::CD_NORTHEAST; | ||
| this->screenEastDirection = OpenSHC::Map::Enums::CD_NORTH; | ||
| this->screenSouthDirection = OpenSHC::Map::Enums::CD_EAST; | ||
| this->screenSouthWestDirection = OpenSHC::Map::Enums::CD_SOUTHEAST; | ||
| this->orientedRowStep = -1; | ||
| } | ||
| } | ||
|
|
||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| #include "../TileMapState.func.hpp" | ||
|
|
||
| #include "OpenSHC/Map/Entities/EntityState.func.hpp" | ||
| #include "OpenSHC/Map/LogicHelpers/MiscDisplay.hpp" | ||
|
|
||
| #include "OpenSHC/Globals/DAT_BuildingsState.hpp" | ||
| #include "OpenSHC/Globals/DAT_EntityState.hpp" | ||
| #include "OpenSHC/Globals/DAT_ViewportRenderState.hpp" | ||
|
|
||
| namespace OpenSHC { | ||
| namespace Map { | ||
|
|
||
| using OpenSHC::Map::LogicHelpers::MD_BUILDING_TILES; | ||
|
|
||
| // FUNCTION: STRONGHOLDCRUSADER 0x004FB360 | ||
| void TileMapState::clearBuildingDisplayFlagsAndEntities(int buildingID, int destroyEntities) | ||
| { | ||
| int buildingSizeTileIndex = 0; | ||
| int buildingX = DAT_BuildingsState::instance.buildings[buildingID].x; | ||
| int buildingY = DAT_BuildingsState::instance.buildings[buildingID].y; | ||
| uint widthOrHeight = DAT_BuildingsState::instance.buildings[buildingID].widthOrHeight; | ||
|
|
||
| do { | ||
| MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::getBuildingSizeIndexMappingData, this)( | ||
| buildingSizeTileIndex, widthOrHeight); | ||
| int tileUnk = DAT_ViewportRenderState::instance.translationMatrix[this->buildingY + buildingY].addXgetTile | ||
| + this->buildingX + buildingX; | ||
| this->MiscDisplayLayer[tileUnk] &= ~MD_BUILDING_TILES; | ||
| if (destroyEntities == 1) { | ||
| MACRO_CALL_MEMBER( | ||
| OpenSHC::Map::Entities::EntityState_Func::destroyEntitiesOnTile, DAT_EntityState::ptr)(tileUnk); | ||
| } | ||
| buildingSizeTileIndex++; | ||
| } while (buildingSizeTileIndex < this->constructionTileCount); | ||
| } | ||
|
|
||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,46 @@ | ||
| #include "../TileMapState.func.hpp" | ||
|
|
||
| #include "OpenSHC/Map/Navigation/PathFindingState.func.hpp" | ||
| #include "OpenSHC/Map/Units/States/UnitState.hpp" | ||
| #include "OpenSHC/Map/Units/UnitType.hpp" | ||
|
|
||
| #include "OpenSHC/Globals/DAT_PathFindingState.hpp" | ||
| #include "OpenSHC/Globals/DAT_UnitsState.hpp" | ||
| #include "OpenSHC/Globals/DAT_ViewportRenderState.hpp" | ||
|
|
||
| namespace OpenSHC { | ||
| namespace Map { | ||
|
|
||
| using OpenSHC::Map::LogicHelpers::L_BUILDING; | ||
| using OpenSHC::Map::LogicHelpers::L_CRENEL; | ||
| using OpenSHC::Map::LogicHelpers::L_CRENEL_VARIATIONUnk; | ||
| using OpenSHC::Map::LogicHelpers::L_KEEP_NON_MANOR_HOUSE; | ||
| using OpenSHC::Map::LogicHelpers::L_STAIRS; | ||
| using OpenSHC::Map::LogicHelpers::L_WALL_OR_GATEHOUSE; | ||
|
|
||
| // FUNCTION: STRONGHOLDCRUSADER 0x004FAC70 | ||
| void TileMapState::clearBuildingFootprintAndRemoveSiegeTower(int x, int y, int size) | ||
| { | ||
| int tileIndex = 0; | ||
|
|
||
| do { | ||
| MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::getBuildingSizeIndexMappingData, this)(tileIndex, size); | ||
| int tile = DAT_ViewportRenderState::instance.translationMatrix[this->buildingY + y].addXgetTile | ||
| + this->buildingX + x; | ||
| this->LogicLayer[tile] &= ~(L_WALL_OR_GATEHOUSE | L_CRENEL | L_BUILDING | L_STAIRS | L_CRENEL_VARIATIONUnk | ||
| | L_KEEP_NON_MANOR_HOUSE); | ||
| this->BuildingLayer[tile] = 0; | ||
| this->HeightLayer[tile] = this->DefaultHeightLayer[tile]; | ||
| MACRO_CALL_MEMBER(OpenSHC::Map::Navigation::PathFindingState_Func::updatePathLinkagesInAllEightDirections, | ||
| DAT_PathFindingState::ptr)( | ||
| DAT_ViewportRenderState::instance.tileTranslationMatrix_YComponent[tile], tile); | ||
| int unitID = this->UnitLayer[tile]; | ||
| if (unitID != 0 && DAT_UnitsState::instance.units[unitID].unitType == OpenSHC::Map::Units::UT_S_TOWER) { | ||
| DAT_UnitsState::instance.units[unitID].state.generic = OpenSHC::Map::Units::States::US_DISAPPEAR; | ||
| } | ||
| tileIndex++; | ||
| } while (tileIndex < this->constructionTileCount); | ||
| } | ||
|
|
||
| } | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| #include "../TileMapState.func.hpp" | ||
|
|
||
| #include "OpenSHC/Map/LogicHelpers/MiscDisplay.hpp" | ||
| #include "OpenSHC/WindowsHelper/Enums/BOOLEnum.hpp" | ||
|
|
||
| #include "OpenSHC/Globals/DAT_BuildingsState.hpp" | ||
| #include "OpenSHC/Globals/DAT_UnitsState.hpp" | ||
| #include "OpenSHC/Globals/DAT_ViewportRenderState.hpp" | ||
|
|
||
| namespace OpenSHC { | ||
| namespace Map { | ||
|
|
||
| using OpenSHC::Map::LogicHelpers::L_BUILDING; | ||
| using OpenSHC::Map::LogicHelpers::L_CRENEL; | ||
| using OpenSHC::Map::LogicHelpers::L_CRENEL_VARIATIONUnk; | ||
| using OpenSHC::Map::LogicHelpers::L_KEEP_NON_MANOR_HOUSE; | ||
| using OpenSHC::Map::LogicHelpers::L_STAIRS; | ||
| using OpenSHC::Map::LogicHelpers::L_WALL_OR_GATEHOUSE; | ||
| using OpenSHC::Map::LogicHelpers::MD_GATEHOUSE_RAISED; | ||
| using OpenSHC::Map::LogicHelpers::MD_RUBBLE_EDGEUnk; | ||
| using OpenSHC::Map::LogicHelpers::MD_RUBBLE_INNERUnk; | ||
|
|
||
| // FUNCTION: STRONGHOLDCRUSADER 0x004FAB70 | ||
| void TileMapState::clearBuildingFootprintAndResetUnits(int x, int y, int size) | ||
| { | ||
| int buildingSizeTileIndex = 0; | ||
|
|
||
| do { | ||
| MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::getBuildingSizeIndexMappingData, this)( | ||
| buildingSizeTileIndex, size); | ||
| int tile = DAT_ViewportRenderState::instance.translationMatrix[this->buildingY + y].addXgetTile | ||
| + this->buildingX + x; | ||
| this->LogicLayer[tile] &= ~(L_WALL_OR_GATEHOUSE | L_CRENEL | L_BUILDING | L_STAIRS | L_CRENEL_VARIATIONUnk | ||
| | L_KEEP_NON_MANOR_HOUSE); | ||
| if ((this->MiscDisplayLayer[tile] & MD_GATEHOUSE_RAISED) != 0) { | ||
| this->MiscDisplayLayer[tile] &= ~MD_GATEHOUSE_RAISED; | ||
| this->HeightLayer[tile] = this->DefaultHeightLayer[tile]; | ||
| } | ||
| int buildingID = this->BuildingLayer[tile]; | ||
| this->BuildingLayer[tile] = 0; | ||
| if (DAT_BuildingsState::instance.buildings[buildingID].noRubble == 0) { | ||
| this->BuildingWasLayer[tile] = 0; | ||
| } else if (MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::isFootprintIndexOnEdge, this)( | ||
| buildingSizeTileIndex, size)) { | ||
| this->MiscDisplayLayer[tile] |= MD_RUBBLE_EDGEUnk; | ||
| } else { | ||
| this->MiscDisplayLayer[tile] |= MD_RUBBLE_INNERUnk; | ||
| } | ||
| for (int unitID = this->UnitLayer[tile]; unitID != 0; | ||
| unitID = DAT_UnitsState::instance.units[unitID].nextUnitOnTheSameTile) { | ||
| DAT_UnitsState::instance.units[unitID].vanish = 0; | ||
| DAT_UnitsState::instance.units[unitID].unknownCountdown_0x402 = 0; | ||
| } | ||
| buildingSizeTileIndex++; | ||
| this->ChangedLayer[tile] = 2; | ||
| } while (buildingSizeTileIndex < this->constructionTileCount); | ||
| } | ||
|
|
||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These bruhes are sizes, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
editorActiveBrushis a brush-size index 1..7 intoTerrainDefinedData.BrushSizeArray= {0, 1, 5, 13, 25, 41, 85, 145}, the number of tiles the brush covers (raiseLandloopsgetTileForBrushoverBrushSizeArray[brush]tiles). The landscaping brush buttons cycle it through 1..7 with wrap-around, big rocks round it up to an odd size, andunknownBrushRelated = editorActiveBrush >> 1. So 7 is the largest brush (145 tiles). These are plain sizes with no enum in Ghidra, so the value stays7. In the same constructor, 531e6e3 now uses the newLoweredViewTransition(refreshCertainTileMap = LVT_SET_NORMAL,refreshCertainTileMap_old = LVT_RAISE, seetriggerLoweredView) andEditorRockType(editorRockType = ERT_NONE) enums, plusrockOrientation = MO_NORTH. Same instructions.