Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
584 commits
Select commit Hold shift + click to select a range
06a7881
reimplement: SHC_3BB0A8C1_0x005113F0 100.00% Reimplemented
gynt Nov 7, 2026
1493e40
reimplement: SHC_3BB0A8C1_0x00508A00 91.78% Style pass, asm differs
gynt Nov 7, 2026
f4e2138
reimplement: SHC_3BB0A8C1_0x004F8BD0 51.72% Style pass, asm differs
gynt Nov 7, 2026
3910b44
reimplement: SHC_3BB0A8C1_0x00507350 100.00% Reimplemented
gynt Nov 7, 2026
bc8bf4b
reimplement: SHC_3BB0A8C1_0x004FF990 77.20% Style pass, asm differs
gynt Nov 7, 2026
86cc849
reimplement: SHC_3BB0A8C1_0x004FF870 85.16% Style pass, asm differs
gynt Nov 7, 2026
f9d647a
reimplement: SHC_3BB0A8C1_0x00504F10 31.04% Style pass, asm differs
gynt Nov 7, 2026
0461330
reimplement: SHC_3BB0A8C1_0x004FB0C0 70.24% Style pass, asm differs
gynt Nov 7, 2026
0c661ea
reimplement: SHC_3BB0A8C1_0x00512940 92.53% asm macro via this, resol…
gynt Nov 7, 2026
de949c5
reimplement: SHC_3BB0A8C1_0x005003D0 91.36% Style pass, asm differs
gynt Nov 7, 2026
18449dc
reimplement: SHC_3BB0A8C1_0x00512100 88.99% Style pass, asm differs
gynt Nov 7, 2026
e4ff4e9
reimplement: SHC_3BB0A8C1_0x004F6B20 48.35% Style pass, asm differs
gynt Nov 7, 2026
3b1c702
reimplement: SHC_3BB0A8C1_0x004F9F00 100.00% Reimplemented
gynt Nov 7, 2026
038e935
reimplement: SHC_3BB0A8C1_0x004FB3F0 87.88% Style pass, asm differs
gynt Nov 7, 2026
05da519
reimplement: SHC_3BB0A8C1_0x004F6FD0 100.00% Reimplemented
gynt Nov 7, 2026
33d9c76
reimplement: SHC_3BB0A8C1_0x00506370 57.18% Style pass, asm differs
gynt Nov 7, 2026
fe161d1
reimplement: SHC_3BB0A8C1_0x004FC9E0 87.51% asm macro via this, resol…
gynt Nov 7, 2026
c59c0c5
reimplement: SHC_3BB0A8C1_0x00509180 90.55% asm macros via this, not …
gynt Nov 7, 2026
abb57b8
reimplement: SHC_3BB0A8C1_0x004F70F0 90.60% Style pass, asm differs
gynt Nov 7, 2026
5ea2e49
reimplement: SHC_3BB0A8C1_0x004FDB00 85.30% asm macro via this, resol…
gynt Nov 7, 2026
cc6c0d6
reimplement: SHC_3BB0A8C1_0x004FF080 85.87% Style pass, asm differs
gynt Nov 7, 2026
85fe93f
reimplement: SHC_3BB0A8C1_0x00501A20 100.00% Reimplemented
gynt Nov 7, 2026
6d28117
reimplement: SHC_3BB0A8C1_0x005017C0 52.07% Style pass, asm differs
gynt Nov 7, 2026
738da52
reimplement: SHC_3BB0A8C1_0x00502110 48.26% Style pass, asm differs
gynt Nov 7, 2026
124ca07
reimplement: SHC_3BB0A8C1_0x00502680 62.57% Style pass, asm differs
gynt Nov 7, 2026
30193e8
reimplement: SHC_3BB0A8C1_0x004F9DF0 100.00% Reimplemented
gynt Nov 7, 2026
a9a2a3e
reimplement: SHC_3BB0A8C1_0x005029D0 38.24% Style pass, asm differs
gynt Nov 7, 2026
06c712a
reimplement: SHC_3BB0A8C1_0x004F94A0 80.99% Style pass, asm differs
gynt Nov 7, 2026
f18e683
build: LTCG for TileMapState wall, keep and map-setup callers
gynt Nov 7, 2026
42244a5
reimplement(TileMapState): neighbour-flag asm macros through the glob…
gynt Nov 7, 2026
391fb56
types: TileMapState::MacroLayer is short
gynt Nov 7, 2026
a920dc3
types: TileMapState building height limits are int
gynt Nov 7, 2026
9a0013c
types: Moat::fillProgress is char
gynt Nov 7, 2026
d6b3471
types: Rock::x and Rock::y are short
gynt Nov 7, 2026
d1ddce9
types: PlayerData::unkHopFarmVariation is int
gynt Nov 7, 2026
3854882
types: placeEngineersguild/placeTunnelersguild take x as uint, not int*
gynt Nov 7, 2026
b6f867a
types: placeApplefarm takes the average height as int, not int*
gynt Nov 7, 2026
a22d902
types: placeDairyfarm takes the variation as int, not int*
gynt Nov 7, 2026
ee60bcd
types: placeDrawbridge takes the orientation as int, not int*
gynt Nov 7, 2026
02b3568
types: placeBarracks takes y as uint, not int*
gynt Nov 7, 2026
522dc5d
types: renderWallDragPreview takes the mapper command as short
gynt Nov 7, 2026
1b0454c
types: placeSiegeTent/placeSiegetowerPlaced take the building type as…
gynt Nov 7, 2026
97e384c
types: validateWallPlacementAtTile takes the mapper command as short
gynt Nov 7, 2026
cc1d6cc
types: useTerrainHeightBrush takes the mapper as short
gynt Nov 7, 2026
a50e8f7
reimplement(TileMapState): setupAllMapSections calls DoNothing with t…
gynt Nov 7, 2026
2a24487
style(TileMapState): drop casts the corrected header types made redun…
gynt Nov 7, 2026
1637855
status(TileMapState): record the match after the asm macro and type f…
gynt Nov 7, 2026
781a45c
reimplement(TileMapState): updateGfxLayer back on the this-based neig…
gynt Nov 7, 2026
c6a9372
types: setConstructionGFXLayerBasedOnPlacementChecks returns void
gynt Nov 7, 2026
d035401
types: type the gate tables in TerrainDefinedData
gynt Nov 7, 2026
786e39f
types: Moat tile is int, x/y and fillProgress are signed
gynt Nov 7, 2026
c6eb340
types: Rock::x and Rock::y are short
gynt Nov 7, 2026
57ad68a
types: Unit field_0x83 is a byte field, not padding
gynt Nov 7, 2026
db8c482
types: TileMapState counters and flags are signed, MacroLayer is short
gynt Nov 7, 2026
b882e31
types: validateWallPlacementAtTile takes the mapper command as short
gynt Nov 7, 2026
04af9b1
Reimplement 88 Map::TileMapState functions at 100%
gynt Nov 7, 2026
b374897
style(TileMapState): apply the reimplementation style guide to the 88…
gynt Nov 7, 2026
5de5096
style(TileMapState): write the footprint loops as while (true) with a…
gynt Nov 7, 2026
be54045
Merge origin/main into reimpl/TileMapState-100
gynt Nov 7, 2026
6a1067b
Merge origin/main into reimpl/TileMapState
gynt Nov 7, 2026
bb90ea0
removed comments, return FALSE instead of 0
gynt Nov 8, 2026
c21cc0c
style(TileMapState): swapWallOwnership as a plain per-tile loop
gynt Nov 8, 2026
0a5ba82
style(TileMapState): let MSVC unroll the remaining tile loops
gynt Nov 8, 2026
4227c71
style(TileMapState): apply main's style guide to the remaining spots
gynt Nov 8, 2026
0173f09
style(TileMapState): use compound assignments, drop redundant usings
gynt Nov 11, 2026
a50bdcf
style(TileMapState): drop unnecessary casts, use countof() for array …
gynt Nov 11, 2026
6ad2a6c
style(TileMapState): pass 0 instead of '\0' as the fill byte
gynt Nov 11, 2026
6f522f7
Merge origin/main into reimpl/TileMapState-100
gynt Nov 11, 2026
51479bd
style(TileMapState): use main's MapOrientation and BOOLEnum field types
gynt Nov 11, 2026
9fcc0aa
Merge origin/main into reimpl/TileMapState
gynt Nov 11, 2026
94e4e1f
Merge reimpl/TileMapState-100 into reimpl/TileMapState
gynt Nov 11, 2026
877c793
style(TileMapState): compound assignments and redundant usings in the…
gynt Nov 11, 2026
a3d8f61
tools: quick_gl.py, and quick_diff on a build list that starts with a…
gynt Nov 11, 2026
c895bde
types: placeKillingPit takes the building type as short
gynt Nov 11, 2026
8615343
build: LTCG for setMiscDisplayLayer and the place* callers that keep ecx
gynt Nov 11, 2026
10ff460
reimplement(TileMapState): restyle the remaining 78 sources and raise…
gynt Nov 11, 2026
ba2c7b0
types: setBitFlagBasedOnWallTowerGatehouseOrKeep returns uint
gynt Nov 11, 2026
e5b97e6
reimplement(TileMapState): neighbour-flag asm macros jump near, as th…
gynt Nov 11, 2026
43718fd
build: LTCG for upgradeTowerLogicLayer, prepareMap and the placement …
gynt Nov 11, 2026
3aaa221
reimplement(TileMapState): second agent round on the remaining sources
gynt Nov 11, 2026
a4489fb
types: validateWallBuildPath and setConstructionGFXLayerBasedOnPlacem…
gynt Nov 11, 2026
5064e90
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-1…
gynt Nov 12, 2026
b5bd6ce
reimplement(TileMapState): name the sprite variation array in setCons…
gynt Nov 12, 2026
67247ca
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-100
gynt Nov 12, 2026
7d1f870
types: add the CardinalDirection enum
gynt Nov 12, 2026
31a645f
types: getOrientationThatIsWallTowerOrGatehouse returns MapOrientation
gynt Nov 12, 2026
04a5f3e
style(TileMapState): enum names from review
gynt Nov 12, 2026
be9f718
Merge remote-tracking branch 'origin/reimpl/TileMapState-100' into re…
gynt Nov 12, 2026
03523e2
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-100
gynt Nov 12, 2026
5c1e705
reimplement(TileMapState): follow main's changeMapOrientation(MapOrie…
gynt Nov 12, 2026
9882188
types: getOrientationThatIsWallTowerOrGatehouse returns CardinalDirec…
gynt Nov 12, 2026
58050f4
Merge remote-tracking branch 'origin/reimpl/TileMapState-100' into re…
gynt Nov 12, 2026
9aa1023
style(TileMapState): use main's BuildingFailReasonEnum names and char…
gynt Nov 12, 2026
46b6f76
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-100
gynt Nov 13, 2026
2a224ea
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-100
gynt Nov 13, 2026
14db1d3
Merge remote-tracking branch 'origin/reimpl/TileMapState-100' into re…
gynt Nov 14, 2026
e8e4593
reimplement: SHC_3BB0A8C1_0x004FA2D0 100.00% Reimplemented
gynt Nov 14, 2026
cdabe8e
reimplement: SHC_3BB0A8C1_0x004FC0B0 100.00% Reimplemented
gynt Nov 14, 2026
1ad8391
reimplement: SHC_3BB0A8C1_0x004F7A80 100.00% Reimplemented
gynt Nov 14, 2026
28d1d8b
reimplement: SHC_3BB0A8C1_0x00508EC0 82.89% entry scheduling, arg regs
gynt Nov 14, 2026
ba76445
reimplement: SHC_3BB0A8C1_0x00504A30 94.17% register allocation
gynt Nov 14, 2026
0e9d729
reimplement: SHC_3BB0A8C1_0x004FFF10 89.31% this reg tie, tail merge
gynt Nov 14, 2026
d9ed259
reimplement: SHC_3BB0A8C1_0x004FFBA0 100.00% Reimplemented
gynt Nov 14, 2026
9520be3
reimplement: SHC_3BB0A8C1_0x005146D0 100.00% Reimplemented
gynt Nov 14, 2026
9b1f020
reimplement: SHC_3BB0A8C1_0x00508030 96.95% stack slot allocation
gynt Nov 14, 2026
a74283b
reimplement: SHC_3BB0A8C1_0x00508540 96.27% address operand order
gynt Nov 14, 2026
f38addc
reimplement: SHC_3BB0A8C1_0x00515DA0 83.25% register allocation
gynt Nov 14, 2026
fd5ddad
reimplement: SHC_3BB0A8C1_0x005160C0 97.30% one lea operand
gynt Nov 14, 2026
bd52fb4
reimplement: SHC_3BB0A8C1_0x00516B80 79.28% register allocation
gynt Nov 14, 2026
1ec9b66
reimplement: SHC_3BB0A8C1_0x00517790 96.12% scheduling, byte movsx
gynt Nov 14, 2026
c1f66d7
reimplement: SHC_3BB0A8C1_0x004FC280 100.00% Reimplemented
gynt Nov 14, 2026
ee51fe6
reimplement: SHC_3BB0A8C1_0x00501D90 91.48% scheduler, byte compare
gynt Nov 14, 2026
c0c8fc0
reimplement: SHC_3BB0A8C1_0x00508A00 94.48% brush loop register order
gynt Nov 14, 2026
c23e6d2
reimplement: SHC_3BB0A8C1_0x004F8BD0 93.93% stack slot tie
gynt Nov 14, 2026
f90dd92
reimplement: SHC_3BB0A8C1_0x004FF990 100.00% Reimplemented
gynt Nov 14, 2026
a73e3b1
reimplement: SHC_3BB0A8C1_0x00504F10 77.53% frame slot, register swaps
gynt Nov 14, 2026
5221221
reimplement: SHC_3BB0A8C1_0x005003D0 100.00% Reimplemented
gynt Nov 14, 2026
4c731c6
reimplement: SHC_3BB0A8C1_0x004F9590 87.65% register allocation
gynt Nov 14, 2026
92a8cd3
reimplement: SHC_3BB0A8C1_0x004FB3F0 100.00% Reimplemented
gynt Nov 14, 2026
efd3ca5
reimplement: SHC_3BB0A8C1_0x00509180 95.65% doubled asm jmp
gynt Nov 14, 2026
c453e24
reimplement: SHC_3BB0A8C1_0x004FF080 100.00% Reimplemented
gynt Nov 14, 2026
1e28a99
reimplement: SHC_3BB0A8C1_0x005017C0 87.65% entry scheduling, arg regs
gynt Nov 14, 2026
3352ce3
reimplement: SHC_3BB0A8C1_0x00502110 100.00% Reimplemented
gynt Nov 14, 2026
e235abc
reimplement: SHC_3BB0A8C1_0x00502680 75.20% code motion of mapper arms
gynt Nov 14, 2026
da499af
reimplement: SHC_3BB0A8C1_0x005029D0 78.49% register allocation
gynt Nov 14, 2026
fec795f
build: compile getRubbleGraphicStageForDamageLevel with /GL
gynt Nov 14, 2026
25579de
tools: compiler-internals probes honour QD_OUT
gynt Nov 14, 2026
1010ac1
build: compile returnOwnedMoatAtTile with /GL
gynt Nov 14, 2026
0f6e1d0
reimplement: SHC_3BB0A8C1_0x005037B0 75.78% register allocation
gynt Nov 14, 2026
289e33b
reimplement: SHC_3BB0A8C1_0x00515C80 100.00% Reimplemented
gynt Nov 14, 2026
4fd3d8d
reimplement: SHC_3BB0A8C1_0x00508EC0 82.89% register allocation
gynt Nov 14, 2026
99ca3aa
reimplement: SHC_3BB0A8C1_0x005154D0 100.00% Reimplemented
gynt Nov 14, 2026
df9100e
reimplement: SHC_3BB0A8C1_0x005034A0 92.41% parity copies not merged
gynt Nov 14, 2026
f9dbc7e
reimplement: SHC_3BB0A8C1_0x005116E0 100.00% Reimplemented
gynt Nov 14, 2026
ac4840d
reimplement: SHC_3BB0A8C1_0x00508540 97.76% address operand order
gynt Nov 14, 2026
ca4d70b
reimplement: SHC_3BB0A8C1_0x00514F30 100.00% Reimplemented
gynt Nov 14, 2026
9c48f7c
reimplement: SHC_3BB0A8C1_0x00501D90 100.00% Reimplemented
gynt Nov 14, 2026
0008201
reimplement: SHC_3BB0A8C1_0x004FB9E0 98.72% address operand order
gynt Nov 14, 2026
e53dffb
reimplement: SHC_3BB0A8C1_0x004FB0C0 100.00% Reimplemented
gynt Nov 14, 2026
2027e89
reimplement: SHC_3BB0A8C1_0x004F9590 97.81% register allocation
gynt Nov 14, 2026
3023f1f
reimplement: SHC_3BB0A8C1_0x004F6B20 97.78% register allocation
gynt Nov 14, 2026
e1f9a25
reimplement: SHC_3BB0A8C1_0x00509180 95.66% near-jz macro jump form
gynt Nov 14, 2026
e1798f3
reimplement: SHC_3BB0A8C1_0x005037B0 93.37% fix gatehouse tile x; reg…
gynt Nov 14, 2026
c2125b5
reimplement: SHC_3BB0A8C1_0x00508EC0 100.00% Reimplemented
gynt Nov 14, 2026
78eabf2
reimplement: SHC_3BB0A8C1_0x00508030 97.96% imul register naming
gynt Nov 14, 2026
786a2f2
reimplement: SHC_3BB0A8C1_0x00508540 99.25% jl loop end needs unroll
gynt Nov 14, 2026
ee588f6
reimplement: SHC_3BB0A8C1_0x00515DA0 98.08% register allocation
gynt Nov 14, 2026
6db3a80
reimplement: SHC_3BB0A8C1_0x005160C0 100.00% Reimplemented
gynt Nov 14, 2026
9f39c4b
reimplement: SHC_3BB0A8C1_0x00516B80 80.72% register allocation
gynt Nov 14, 2026
44983bc
reimplement: SHC_3BB0A8C1_0x00517790 99.86% one store order
gynt Nov 14, 2026
127d9ea
reimplement: SHC_3BB0A8C1_0x00508A00 100.00% Reimplemented
gynt Nov 14, 2026
4b95a9c
reimplement: SHC_3BB0A8C1_0x004F8BD0 94.29% stack slot tie order
gynt Nov 14, 2026
da4da03
reimplement: SHC_3BB0A8C1_0x004FB9E0 100.00% Reimplemented
gynt Nov 14, 2026
6d8310e
reimplement: SHC_3BB0A8C1_0x004F9590 100.00% Reimplemented
gynt Nov 14, 2026
c77f604
reimplement: SHC_3BB0A8C1_0x004F70F0 100.00% Reimplemented
gynt Nov 14, 2026
9386cc5
reimplement: SHC_3BB0A8C1_0x005017C0 91.50% late x load
gynt Nov 14, 2026
a32b7c0
types: declare getTotalHeightAtTile2, the linker-folded twin of getTo…
gynt Nov 14, 2026
37a928f
reimplement: SHC_3BB0A8C1_0x004FFF10 100.00% Reimplemented
gynt Nov 14, 2026
6229ec6
types: placeApplefarm buildingType as BuildingTypeShort
gynt Nov 14, 2026
4c9702e
reimplement: SHC_3BB0A8C1_0x00515740 100.00% Reimplemented
gynt Nov 14, 2026
6f51a46
reimplement: SHC_3BB0A8C1_0x005034A0 100.00% Reimplemented
gynt Nov 14, 2026
bf497c5
reimplement: SHC_3BB0A8C1_0x00516B80 88.79% owner/playerID register; …
gynt Nov 14, 2026
3f749df
reimplement: SHC_3BB0A8C1_0x004F8BD0 100.00% Reimplemented
gynt Nov 14, 2026
c4c07b0
reimplement: SHC_3BB0A8C1_0x00504F10 77.98% register allocation
gynt Nov 14, 2026
6563c30
reimplement: SHC_3BB0A8C1_0x004F6B20 100.00% Reimplemented
gynt Nov 14, 2026
7cb9424
reimplement: SHC_3BB0A8C1_0x005017C0 95.01% loop-2 brushY register
gynt Nov 14, 2026
67429bb
reimplement: SHC_3BB0A8C1_0x00502680 75.82% arm block order
gynt Nov 14, 2026
740a0d5
reimplement: SHC_3BB0A8C1_0x005029D0 100.00% Reimplemented
gynt Nov 14, 2026
1111bdd
reimplement: SHC_3BB0A8C1_0x005037B0 95.46% slot weights; keep/gate s…
gynt Nov 15, 2026
5017645
reimplement: SHC_3BB0A8C1_0x004FA000 68.68% final else 8; y reload
gynt Nov 15, 2026
5d4e602
reimplement: SHC_3BB0A8C1_0x005024F0 75.34% register colouring tie
gynt Nov 15, 2026
4ad6237
reimplement: SHC_3BB0A8C1_0x00516B80 89.47% volatile tail merge
gynt Nov 15, 2026
588eb96
reimplement: SHC_3BB0A8C1_0x00506370 100.00% Reimplemented
gynt Nov 15, 2026
0806c55
reimplement: SHC_3BB0A8C1_0x005017C0 100.00% Reimplemented
gynt Nov 15, 2026
8e4367a
reimplement: SHC_3BB0A8C1_0x00502680 76.37% FgCodeMotion arm placement
gynt Nov 15, 2026
6461d81
reimplement: SHC_3BB0A8C1_0x005024F0 83.78% register colouring tie
gynt Nov 15, 2026
b32cde1
build: __forceinline the resolver get() so unoptimised functions call…
gynt Nov 15, 2026
733543d
docs: c2 decisions decoded on the TileMapState last mile
gynt Nov 15, 2026
e37c517
docs: whole-project check of the __forceinline resolver get()
gynt Nov 15, 2026
531e6e3
style(TileMapState): direction, orientation and view enums from review
gynt Nov 15, 2026
bae202f
style(TileMapState): do-while footprint loops and MiscDisplay flags f…
gynt Nov 15, 2026
ccb8650
style(TileMapState): wall owner mask, types and flag checks from review
gynt Nov 15, 2026
73f5100
style(TileMapState): enum names in the remaining PR sources
gynt Nov 15, 2026
233eacc
types(TileMapState): signed coordinates and value types from review
gynt Nov 15, 2026
e4efe7a
types(TileMapState): enums, struct and names proposed in the review
gynt Nov 16, 2026
d146f8e
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-100
gynt Nov 16, 2026
e3f146c
docs(compiler-internals): the TU symbol count decides some register c…
gynt Nov 17, 2026
9c71e4b
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-100
gynt Nov 24, 2026
821a130
types(TileMapState): BOOLEnum for flags proven to hold only 0 or 1
gynt Nov 24, 2026
6f1c8d4
style(TileMapState): test 0/1 flags as if (x) / if (!x)
gynt Nov 24, 2026
a5f31fe
style(TileMapState): computeClimbRampRotation local names from the re…
gynt Nov 24, 2026
4207287
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-100
gynt Nov 24, 2026
419fcee
style(TileMapState): WallConstants for the wall and crenel heights
gynt Nov 24, 2026
63fc795
Merge branch 'reimpl/TileMapState-100' into reimpl/TileMapState-100-2
gynt Nov 24, 2026
1c85aa6
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-1…
gynt Nov 24, 2026
b6c4590
style(TileMapState): style-guide pass over the -100-2 sources
gynt Nov 25, 2026
4e76191
tools: drop the tools changes from this branch, they went to main dir…
gynt Nov 25, 2026
783e0cc
refactor(TileMapState): a local forwarder instead of getTotalHeightAt…
gynt Nov 25, 2026
52f903e
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-1…
gynt Nov 25, 2026
248b612
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-1…
gynt Nov 29, 2026
92c68b4
types: terrain gfx tables, macro layer and neighbour mask enums, brus…
gynt Nov 29, 2026
ef5f93d
TileMapState group A review: enums and typed parameters, drop casts a…
gynt Nov 29, 2026
7e9f4ec
types: building placement result enums, TileMapState placement signat…
gynt Nov 29, 2026
4e93fcb
types: moat stage, rock type, river fall flags, rock id offset; fix B…
gynt Nov 29, 2026
8915e55
TileMapState: review fixes for heights, cliff/luminescence, misc disp…
gynt Nov 29, 2026
d07765c
reimplement: SHC_3BB0A8C1_0x005037B0 61.67% needs xyAreValid in list …
gynt Nov 29, 2026
4801f90
reimplement: SHC_3BB0A8C1_0x004FA2D0 100.00% Reimplemented
gynt Nov 29, 2026
61fb161
reimplement: SHC_3BB0A8C1_0x004FA000 68.68% volatile wall/count slots
gynt Nov 29, 2026
a6f84c4
reimplement: SHC_3BB0A8C1_0x00504A30 94.17% register allocation
gynt Nov 29, 2026
7a10d77
reimplement: SHC_3BB0A8C1_0x004F9A60 100.00% Reimplemented
gynt Nov 29, 2026
4351f44
reimplement: SHC_3BB0A8C1_0x004FBE70 100.00% Reimplemented
gynt Nov 29, 2026
cee2364
reimplement: SHC_3BB0A8C1_0x005024F0 83.78% volatile tile/y reloads
gynt Nov 29, 2026
a938f0c
reimplement: SHC_3BB0A8C1_0x005160C0 100.00% Reimplemented
gynt Nov 29, 2026
975eb08
reimplement: SHC_3BB0A8C1_0x00504F10 77.98% register allocation
gynt Nov 29, 2026
bef6e59
reimplement: SHC_3BB0A8C1_0x005029D0 100.00% Reimplemented
gynt Nov 29, 2026
fee03da
types: TileMapState parameter types for damage, brush and rock/tree f…
gynt Nov 29, 2026
c45e628
TileMapState: answer review on damage, brush and rock/tree placement …
gynt Nov 29, 2026
84875c2
types: settle the place* family signatures in TileMapState
gynt Nov 29, 2026
dde2abd
Address review of the TileMapState building placers
gynt Nov 29, 2026
083c1b3
Merge branch 'tms396-c' into reimpl/TileMapState-100-2
gynt Nov 29, 2026
7ff5e35
Merge branch 'tms396-d' into reimpl/TileMapState-100-2
gynt Nov 29, 2026
d3074bb
Merge branch 'tms396-e' into reimpl/TileMapState-100-2
gynt Nov 29, 2026
762b372
Merge branch 'tms396-a' into reimpl/TileMapState-100-2
gynt Nov 29, 2026
b5971cf
Move the files that need volatile or the __forceinline resolver chang…
gynt Nov 29, 2026
a74682b
status: checkBuildingCanBePlacedHere is 97.3% with xyAreValid in the …
gynt Nov 30, 2026
420ae66
Reimplement 16 TileMapState functions that need volatile reads or a _…
gynt Dec 1, 2026
9b70ed7
Merge origin/main into reimpl/TileMapState-100-2
gynt Dec 2, 2026
41d17d1
TileMapState: adapt sources to main's headers
gynt Dec 2, 2026
65eb57c
Apply clang-format to PR sources
gynt Dec 2, 2026
1d44f4a
Merge origin/main into reimpl/TileMapState-100-2
gynt Dec 2, 2026
3f74990
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-1…
gynt Dec 3, 2026
1838032
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-1…
gynt Dec 4, 2026
7b244a3
Take main's clearStockpileFootprintTiles, placeDefensiveStructureTile…
gynt Dec 4, 2026
632d090
status: record the raw reccmp match and accurate remarks for the Tile…
gynt Dec 4, 2026
afdb070
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-1…
gynt Dec 4, 2026
78c7a83
Move getHeightAtTileIncludingOwnersBuildings and updateGfxLayer out o…
gynt Dec 4, 2026
5b749c5
Merge remote-tracking branch 'origin/main' into reimpl/TileMapState-1…
gynt Dec 4, 2026
b8455b3
checkDrawbridgePlacement: compute the on-map test in place instead of…
gynt Dec 4, 2026
531d443
validateWallBuildPath: write the map bounds checks out instead of uin…
gynt Dec 4, 2026
49edfe4
determineBuildingPlacementRotation: write the tileY bounds check out …
gynt Dec 4, 2026
f00d780
cmake: drop the duplicate xyAreValid /GL entry now that main lists it
gynt Dec 4, 2026
052d56e
Merge remote-tracking branch 'origin/main' into pr396
gynt Dec 5, 2026
db4cf2b
Merge remote-tracking branch 'origin/reimpl/TileMapState-100-2' into …
gynt Dec 5, 2026
baeb7a4
TileMapState: take x (and y) as int in eraseAreaWithBrush, useEraserB…
gynt Dec 5, 2026
cf076d7
PlayerData: replace attackedByPlayerArrayUnk[10][8] with an AttackedB…
gynt Dec 5, 2026
58e836d
TerrainDefinedData: retype field_0x264 as keepDoorOffsets[3][4][3]
gynt Dec 5, 2026
de24136
placeWalls: read the unit layer into a short instead of a ushort cast…
gynt Dec 5, 2026
536e6c6
BuildingLogicalState: add BLS_NONE = 0 for an unused building slot
gynt Dec 5, 2026
dc3588f
review: drop a redundant cast
gynt Dec 5, 2026
5ff7919
TileMapState: keep 16-bit ids in short locals instead of ushort cast …
gynt Dec 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
40 changes: 40 additions & 0 deletions cmake/compiler-flags-gl.txt
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,21 @@ src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAn
src/OpenSHC/UI/MenuItems/BuildingAndStatusMenu/MenuItemRenderFunction_BuildingAndStatusMenu_WorkshopWeaponSelection.cpp
src/OpenSHC/UI/MenuItems/General/MenuItemRenderFunction_General_RenderCurrentButtonWithPossibleAlphaTexOnScreenMenuSurface.cpp
src/OpenSHC/Map/TileMapState/getBuildingSizeIndexMappingData.cpp
src/OpenSHC/Map/TileMapState/getRubbleGraphicStageForDamageLevel.cpp
src/OpenSHC/Map/TileMapState/returnOwnedMoatAtTile.cpp
src/OpenSHC/Map/TileMapState/setSignpostDistanceForCampaignMission.cpp
src/OpenSHC/Map/TileMapState/clearDrawBridgeWater.cpp
src/OpenSHC/Map/TileMapState/clearFixedSizeTwoBuildingFootprint.cpp
src/OpenSHC/Map/TileMapState/clearRockFootprintFlags.cpp
src/OpenSHC/Map/TileMapState/clearSizeFiveBuildingFootprintAndMoats.cpp
src/OpenSHC/Map/TileMapState/clearTreeFootprintFlags.cpp
src/OpenSHC/Map/TileMapState/floodMoatUnderRemovedBuilding.cpp
src/OpenSHC/Map/TileMapState/isUnitBlockingSizeFiveFootprint.cpp
src/OpenSHC/Map/TileMapState/markBuildingFootprintFlag.cpp
src/OpenSHC/Map/TileMapState/placeBarracks.cpp
src/OpenSHC/Map/TileMapState/placeOilsmelter.cpp
src/OpenSHC/Map/TileMapState/renderWallPlacementPreview.cpp
src/OpenSHC/Map/TileMapState/setMiscDisplayLayer.cpp
src/OpenSHC/Map/TileMapState/storeMinAndMaxHeightOfArea.cpp
src/OpenSHC/Map/TileMapState/unmarkBuildingFootprintFlag.cpp
src/OpenSHC/Map/TileMapState/updateGameRelatedValue.cpp
Expand All @@ -160,9 +171,16 @@ src/OpenSHC/Map/TileMapState/clearBuildingFootprintAndResetUnits.cpp
src/OpenSHC/Map/TileMapState/computeWallCornerRenderRotation.cpp
src/OpenSHC/Map/TileMapState/isWallConnectionHeightValid.cpp
src/OpenSHC/Map/TileMapState/getWallFlagForOrientedDirection.cpp
src/OpenSHC/Map/TileMapState/placeKeep.cpp
src/OpenSHC/Map/TileMapState/updatePathLinkagesForBuilding.cpp
src/OpenSHC/Map/TileMapState/resetTileAndClearMoat.cpp
src/OpenSHC/Map/TileMapState/setupAllMapSections.cpp
src/OpenSHC/Map/TileMapState/setupLogicalMapBorders.cpp
src/OpenSHC/Map/TileMapState/updateShowHiLayerOrResetChangedLayer.cpp
src/OpenSHC/Map/TileMapState/validateWallBuildPath.cpp
src/OpenSHC/Map/TileMapState/isTileEnclosedByWalls.cpp
src/OpenSHC/Map/TileMapState/isTileEnclosedByWallsOrGates.cpp
src/OpenSHC/Map/TileMapState/getMaxWallHeightInBrushArea.cpp
src/OpenSHC/UI/DisplayElements/RenderTimeUntilDefeatDisplayElement.cpp
src/OpenSHC/UI/DisplayElements/GetIfDisplayElementStateNotZero.cpp
src/OpenSHC/UI/DisplayElements/FindDisplayElementWithID.cpp
Expand Down Expand Up @@ -241,6 +259,28 @@ src/OpenSHC/Map/Units/UpdateMiner.cpp
src/OpenSHC/Map/Units/UpdateQuarryMason.cpp
src/OpenSHC/Map/Units/UpdateDrunkard.cpp
src/OpenSHC/Map/Units/UpdateInnkeeper.cpp
src/OpenSHC/Map/TileMapState/placeApplefarm.cpp
src/OpenSHC/Map/TileMapState/placeDairyfarm.cpp
src/OpenSHC/Map/TileMapState/placeDrawbridge.cpp
src/OpenSHC/Map/TileMapState/placeEngineersguild.cpp
src/OpenSHC/Map/TileMapState/placeGatehouseLarge.cpp
src/OpenSHC/Map/TileMapState/placeGatehouseSmall.cpp
src/OpenSHC/Map/TileMapState/placeHopfarm.cpp
src/OpenSHC/Map/TileMapState/placeKillingPit.cpp
src/OpenSHC/Map/TileMapState/placePositiveFearfactor.cpp
src/OpenSHC/Map/TileMapState/placeQuarry.cpp
src/OpenSHC/Map/TileMapState/placeSiegeTent.cpp
src/OpenSHC/Map/TileMapState/placeSiegetowerPlaced.cpp
src/OpenSHC/Map/TileMapState/placeTower.cpp
src/OpenSHC/Map/TileMapState/placeTunnelersguild.cpp
src/OpenSHC/Map/TileMapState/placeWheatfarm.cpp
src/OpenSHC/Map/TileMapState/placeWorkshopOrHovel.cpp
src/OpenSHC/Map/TileMapState/stampBuildingOntoTileMap.cpp
src/OpenSHC/Map/TileMapState/upgradeTowerLogicLayer.cpp
src/OpenSHC/Map/TileMapState/setConstructionGFXLayerBasedOnPlacementChecks.cpp
src/OpenSHC/Map/TileMapState/prepareMap.cpp
src/OpenSHC/Map/TileMapState/toggleFlatView.cpp
src/OpenSHC/Map/TileMapState/checkBuildingCanBePlacedHere.cpp
src/OpenSHC/Map/Units/UpdateLion.cpp
src/OpenSHC/Map/Units/UpdateMerchant.cpp
src/OpenSHC/Map/Units/UpdateKnight.cpp
Expand Down
12 changes: 12 additions & 0 deletions cmake/function-visibility.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,18 @@ OpenSHC::UI::MenuItems::Roundtable::MenuItemActionHandler_Roundtable_Main
OpenSHC::Synchrony::GameSynchronyState::isAIPlayer
OpenSHC::Map::TileMapState::updateMoatCountdownTimers
OpenSHC::Map::TileMapState::recountTotalOwnedMoats
OpenSHC::Map::TileMapState::createPlateau
OpenSHC::Map::TileMapState::getTileForBrush
OpenSHC::Map::TileMapState::isValidCastleSiteLocation
OpenSHC::Map::TileMapState::getTileForBrush
OpenSHC::Map::TileMapState::setLand
OpenSHC::Map::TileMapState::getTileForBrush
OpenSHC::Map::TileMapState::useEraserBrush
OpenSHC::Map::TileMapState::getTileForBrush
OpenSHC::Map::TileMapState::useLevelBrush
OpenSHC::Map::TileMapState::getTileForBrush
OpenSHC::Map::TileMapState::useTerrainHeightBrush
OpenSHC::Map::TileMapState::getTileForBrush
OpenSHC::UI::HoveredState::Constructor_HoveredState
OpenSHC::UI::HoveredState::clearHoveredState
OpenSHC::Map::Units::UpdateBurningMan
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSHC/AI/AICState/updateAIPlayerState.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ namespace AI {
MACRO_CALL_MEMBER(OpenSHC::AI::AICState_Func::setCurrentAttackRaidParameter, this)(playerID);
// read into a local first: without it the scratch registers of this increment come out swapped
int attackedPlayerID = DAT_GameState::instance.playerDataArray[playerID].attackedPlayerID;
++DAT_GameState::instance.playerDataArray[attackedPlayerID].attackedByPlayerArrayUnk[playerID][0];
++DAT_GameState::instance.playerDataArray[attackedPlayerID].attackedByPlayer[playerID].attacks;
} else {
// send own units back to keep or campfire
MACRO_CALL_MEMBER(OpenSHC::AI::AICState_Func::aiRetreatUnits, this)(playerID);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ namespace Game {
DAT_GameSynchronyState::instance.finalResults.finalTroopsKilledWeighted[enemyPlayerID] += lossValue;
}
}
DAT_GameState::instance.playerDataArray[playerID].attackedByPlayerArrayUnk[enemyPlayerID][2]
= DAT_GameState::instance.playerDataArray[playerID].attackedByPlayerArrayUnk[enemyPlayerID][2] + 1;
DAT_GameState::instance.playerDataArray[playerID].attackedByPlayer[enemyPlayerID].unitsLost
= DAT_GameState::instance.playerDataArray[playerID].attackedByPlayer[enemyPlayerID].unitsLost + 1;
}
if (DAT_UnitsState::instance.units[unitID].isSelected != 0) {
DAT_GameCore::instance.countdown = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,11 @@ namespace Game {
= DAT_UnitsState::instance.units[enemyUnitID].uid;
}
DAT_GameState::instance.playerDataArray[playerID]
.attackedByPlayerArrayUnk[DAT_UnitsState::instance.units[unitID].lastEncounteredEnemyPlayerID][3]
.attackedByPlayer[DAT_UnitsState::instance.units[unitID].lastEncounteredEnemyPlayerID]
.troopEncounters
= DAT_GameState::instance.playerDataArray[playerID]
.attackedByPlayerArrayUnk[DAT_UnitsState::instance.units[unitID].lastEncounteredEnemyPlayerID][3]
.attackedByPlayer[DAT_UnitsState::instance.units[unitID].lastEncounteredEnemyPlayerID]
.troopEncounters
+ 1;
}

Expand Down
34 changes: 34 additions & 0 deletions src/OpenSHC/Game/Player/AttackedByPlayerStatistics.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
THIS FILE IS AUTO GENERATED
Communicate changes to the dev team (e.g. via a Pull Request).
Changes get lost otherwise.

path: 'OpenSHC/Game/Player/AttackedByPlayerStatistics.hpp'
*/

#pragma once

namespace OpenSHC {
namespace Game {
namespace Player {

#pragma pack(push, 1)
// SIZE: 0x00000020
typedef struct AttackedByPlayerStatistics {

int attacks; // 0x00000000 length: 4
int buildingsDestroyed; // 0x00000004 length: 4
int unitsLost; // 0x00000008 length: 4
int troopEncounters; // 0x0000000C length: 4
int field_0x10; // 0x00000010 length: 4
int field_0x14; // 0x00000014 length: 4
int field_0x18; // 0x00000018 length: 4
int field_0x1c; // 0x0000001C length: 4

} AttackedByPlayerStatistics;
#pragma pack(pop)

static_assert_cpp98_obj(sizeof(AttackedByPlayerStatistics) == 32, AttackedByPlayerStatistics);
} // namespace Player
} // namespace Game
} // namespace OpenSHC
4 changes: 3 additions & 1 deletion src/OpenSHC/Game/Player/PlayerData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "OpenSHC/AI/AIStrengthTypeInt.hpp"
#include "OpenSHC/AI/AITypeInt.hpp"
#include "OpenSHC/Coordinates/XYPairShort.hpp"
#include "OpenSHC/Game/Player/AttackedByPlayerStatistics.hpp"
#include "OpenSHC/Game/Player/BuildingEntryInfo.hpp"
#include "OpenSHC/Game/Player/Enums/StorageMarketFailStateEnumInt.hpp"
#include "OpenSHC/Game/Player/UnknownPlayerDataStructure.hpp"
Expand All @@ -29,6 +30,7 @@ namespace Game {
using OpenSHC::AI::AIStrengthTypeInt;
using OpenSHC::AI::AITypeInt;
using OpenSHC::Coordinates::XYPairShort;
using OpenSHC::Game::Player::AttackedByPlayerStatistics;
using OpenSHC::Game::Player::BuildingEntryInfo;
using OpenSHC::Game::Player::UnknownPlayerDataStructure;
using OpenSHC::Game::Player::Enums::StorageMarketFailStateEnumInt;
Expand Down Expand Up @@ -329,7 +331,7 @@ namespace Game {
int totalMaxDefaultTroops; // 0x00002BD0 length: 4
int attackedPlayerID_2Unk; // 0x00002BD4 length: 4
int attackedPlayerID; // 0x00002BD8 length: 4
int attackedByPlayerArrayUnk[10][8]; // 0x00002BDC length: 320
AttackedByPlayerStatistics attackedByPlayer[10]; // 0x00002BDC length: 320
int aivUnitLocationSlots[22][10]; // 0x00002D1C length: 880
int aivUnitLocationSlotLocationCount[22]; // 0x0000308C length: 88
int totalTroopsType0; // 0x000030E4 length: 4
Expand Down
1 change: 1 addition & 0 deletions src/OpenSHC/Map/Buildings/BuildingLogicalState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ namespace Map {
namespace Buildings {
typedef enum BuildingLogicalState {

BLS_NONE = 0, // 0x00000000
BLS_INITIAL = 1, // 0x00000001
BLS_NORMAL = 2, // 0x00000002
BLS_REMOVE = 3 // 0x00000003
Expand Down
2 changes: 1 addition & 1 deletion src/OpenSHC/Map/TerrainDefinedData.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace Map {
XYPair Stockpile_BuildingPartsOffsets[4]; // 0x000001BC length: 32
XYPair StockpilePathableOffsets[9]; // 0x000001DC length: 72
undefined1 padding_0x224[64]; // 0x00000224 length: 64
XYPair field_0x264[3][12]; // 0x00000264 length: 288
XYPair keepDoorOffsets[3][4][3]; // 0x00000264 length: 288
Point8IntXY keepOutbuildingOffsets_0x384[3][4]; // 0x00000384 length: 96
Point8IntXY keepOutbuildingOffsets_0x3e4[3][4]; // 0x000003E4 length: 96
XYPair field_0x444[24]; // 0x00000444 length: 192
Expand Down
6 changes: 3 additions & 3 deletions src/OpenSHC/Map/TileMapState.func.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,7 +492,7 @@ namespace Map {
void (TileMapState::*)(), false, Address::SHC_3BB0A8C1_0x005017A0, &TileMapState::forceFullTileMapRedraw)
forceFullTileMapRedraw;

MACRO_FUNCTION_RESOLVER(void (TileMapState::*)(uint, int, int), false, Address::SHC_3BB0A8C1_0x005017C0,
MACRO_FUNCTION_RESOLVER(void (TileMapState::*)(int, int, int), false, Address::SHC_3BB0A8C1_0x005017C0,
&TileMapState::useEraserBrush)
useEraserBrush;

Expand Down Expand Up @@ -660,7 +660,7 @@ namespace Map {
&TileMapState::applyTreeBrushToLogicalLayer)
applyTreeBrushToLogicalLayer;

MACRO_FUNCTION_RESOLVER(void (TileMapState::*)(uint, int, uint), false, Address::SHC_3BB0A8C1_0x00508EC0,
MACRO_FUNCTION_RESOLVER(void (TileMapState::*)(int, int, uint), false, Address::SHC_3BB0A8C1_0x00508EC0,
&TileMapState::eraseAreaWithBrush)
eraseAreaWithBrush;

Expand Down Expand Up @@ -688,7 +688,7 @@ namespace Map {
void (TileMapState::*)(), false, Address::SHC_3BB0A8C1_0x005114C0, &TileMapState::updatePitchDitches)
updatePitchDitches;

MACRO_FUNCTION_RESOLVER(int (TileMapState::*)(int, uint, uint), false, Address::SHC_3BB0A8C1_0x005116E0,
MACRO_FUNCTION_RESOLVER(int (TileMapState::*)(int, int, int), false, Address::SHC_3BB0A8C1_0x005116E0,
&TileMapState::placePitchDitch)
placePitchDitch;

Expand Down
6 changes: 3 additions & 3 deletions src/OpenSHC/Map/TileMapState.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -500,7 +500,7 @@ namespace Map {

void forceFullTileMapRedraw();

void useEraserBrush(uint x, int y, int brush);
void useEraserBrush(int x, int y, int brush);

void updateShowHiLayerOrResetChangedLayer();

Expand Down Expand Up @@ -599,7 +599,7 @@ namespace Map {

void applyTreeBrushToLogicalLayer(int treeID, BOOLEnum noVariation);

void eraseAreaWithBrush(uint x, int y, uint brush);
void eraseAreaWithBrush(int x, int y, uint brush);

void updateGfxLayer();

Expand All @@ -613,7 +613,7 @@ namespace Map {

void updatePitchDitches();

int placePitchDitch(int playerID, uint x, uint y);
int placePitchDitch(int playerID, int x, int y);

void updateGameRelatedValue();

Expand Down
53 changes: 53 additions & 0 deletions src/OpenSHC/Map/TileMapState/applyTreeBrushToLogicalLayer.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
#include "../TileMapState.func.hpp"

#include "OpenSHC/Map/LandscapeState.func.hpp"
#include "OpenSHC/Map/Navigation/PathFindingState.func.hpp"

#include "OpenSHC/Globals/DAT_LandscapeState.hpp"
#include "OpenSHC/Globals/DAT_PathFindingState.hpp"
#include "OpenSHC/Globals/DAT_TerrainDefinedData.hpp"
#include "OpenSHC/Globals/DAT_ViewportRenderState.hpp"

namespace OpenSHC {
namespace Map {

using OpenSHC::Map::LogicHelpers::L_BORDER;
using OpenSHC::Map::LogicHelpers::L_MARSH;
using OpenSHC::Map::LogicHelpers::L_MOAT;
using OpenSHC::Map::LogicHelpers::L_SEA;
using OpenSHC::Map::LogicHelpers::L_TREE_VARIATION;

// FUNCTION: STRONGHOLDCRUSADER 0x00508DD0
void TileMapState::applyTreeBrushToLogicalLayer(int treeID, BOOLEnum noVariation)
{
int const brushSize = DAT_TerrainDefinedData::instance.BrushSizeArray[MACRO_CALL_MEMBER(
OpenSHC::Map::LandscapeState_Func::getValueFrom0UpTo3ForTreeTypeAndTreeStage, DAT_LandscapeState::ptr)(
DAT_LandscapeState::instance.trees[treeID].treeType, DAT_LandscapeState::instance.trees[treeID].stage)];
int tile = DAT_LandscapeState::instance.trees[treeID].xPosition
+ DAT_ViewportRenderState::instance.translationMatrix[DAT_LandscapeState::instance.trees[treeID].yPosition]
.addXgetTile;
int brushY = DAT_LandscapeState::instance.trees[treeID].yPosition;
int const baseTile = tile;
int const baseY = brushY;
for (int tileIndex = 0; tileIndex < brushSize; tileIndex++) {
MACRO_CALL_MEMBER(OpenSHC::Map::TileMapState_Func::getTileForBrush, this)(
1, tileIndex, &tile, &brushY, baseTile, baseY);
if ((this->LogicLayer[tile] & L_BORDER) != 0) {
break;
}
if ((this->LogicLayer[tile] & (L_SEA | L_MARSH | L_MOAT)) != 0) {
continue;
}
if (noVariation) {
this->LogicLayer[tile] &= ~L_TREE_VARIATION;
} else {
this->LogicLayer[tile] |= L_TREE_VARIATION;
}
}
MACRO_CALL_MEMBER(
OpenSHC::Map::Navigation::PathFindingState_Func::updateWalkAndPathLayer, DAT_PathFindingState::ptr)(7,
DAT_LandscapeState::instance.trees[treeID].xPosition, DAT_LandscapeState::instance.trees[treeID].yPosition);
}

}
}
Loading
Loading