Repository navigation
Reimpl/ViewportRenderState methods that are 100% - #392
Merged
Merged
Conversation
…int; lookup table layout - ViewportRenderState: availableFloaterIndex, windowX/Y, screenPixelWidth/Height, the four animation intervals, unitBatchedRenderCounterUntil6 and unitRender1-5 are int (the original compares them signed). - screenPointToTileNumber starts at 0x4E5E0 with 321610 entries, absorbing the eight field_0x4e5e0..fc slots before it; translationMatrix has 401 triplets, absorbing translationResult1/translationTracker1/translationResult2. Both arrays are written that way by setTileSystemMemoryLookupArrays. ViewportBasedTileNumber and convertMinimapClickToTileXY index the moved array with the shifted base (+8 entries), and still measure 100%. - TileMapState.cursorOverlayAnimationFrame, DAT_CurrentlyRenderedSpriteID and DAT_RenderedUnitOwner are int. From reimpl/ViewportRenderState, limited to the changes its 100% functions need. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmYbLQCBa8ek5RWjimR
From reimpl/ViewportRenderState: every function that measures 100% there, and again 100% in a trial build of this branch (on main d5d965d, data and function resolvers enabled, all 23 ViewportRenderState sources plus ViewportBasedTileNumber and convertMinimapClickToTileXY at 100%). - 15 new sources in src/OpenSHC/Rendering/ViewportRenderState/, with their status lines set to 100.0% Reimplemented - the 8 sources main already has at 100% are identical there and unchanged Left out: resetupViewport, which reaches 100% only under /GL together with setupViewport (here 43.8%, with setupViewport proxied to the original), and the 8 functions still below 100% on reimpl/ViewportRenderState (setupViewport, computeMouseTileFromScreenPosition, renderAssassinClimbingOverlay, renderGmOverlayBuilding, renderMap, renderUnits, setTileSystemMemoryLookupArrays, updateBuildingPreviewPosition), with the header changes only they use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmYbLQCBa8ek5RWjimR
100% in the reimpl/ViewportRenderState build, where it is compiled with /GL together with setupViewport; not re-measured on this branch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmYbLQCBa8ek5RWjimR
origin/main now carries the ViewportRenderState, TileMapState and global type changes from this branch's types commit, identical, so they merge cleanly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmYbLQCBa8ek5RWjimR
|
Style guide reading (advisory, posted once) 5 possible deviation(s) from REIMPLEMENTATION_STYLE_GUIDE.md across 4 of the 18 reimplemented The match comes first. Where the ugly form is what matched, it stays -- that is the guide's own overriding rule, and rule 21 asks for a one-line comment saying what was measured so the next reader does not retry it. This report is posted once, when the PR opens, and is not repeated on later pushes.
WhereRule 18 — Use the name, not the number
Rule 23 — Prefer if-else over ternary
Rule 24 — Declare variables upon first use
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmYbLQCBa8ek5RWjimR
…able layout Constants the ViewportRenderState functions use: the 32 x 8 pixel tile column and row steps, the screen point tables' start, size and row lengths, the map surface height and the unit render batch and white cap frame counts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmYbLQCBa8ek5RWjimR
…ssignment LogicLayer and Logic2Layer tests use the Logic1 and Logic2 flags, map sizes use MapConstants, the debug overlay text is Colors::COL_FFFFFF, and the remaining pixel and table constants come from the new ViewportConstants. Array bounds are countof(); the floater id check keeps `countof - 1 <` because `>= countof` compiles to cmp 250 / jae where the original has cmp 249 / ja. Self-assignments are ++, += and -=. All 24 ViewportRenderState functions on this branch measure as before (23 at 100%, resetupViewport unchanged at 43.8% without /GL). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmYbLQCBa8ek5RWjimR
TileMapState::mapOrientation takes 0, 2, 4 and 6. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmYbLQCBa8ek5RWjimR
…ST, SOUTH and WEST focusOnTile and setViewportBasedOnMapSize compile as before (quick_diff identical to the committed sources). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmYbLQCBa8ek5RWjimR
…literals.hpp renderDebugDataMousePointing still measures 100%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmYbLQCBa8ek5RWjimR
/GS (on by default in MSVC 2005) emits the cookie for char text[200] itself; the unused local read of MSVC_SecurityCookie was optimised away. renderDebugDataMousePointing still measures 100%. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmYbLQCBa8ek5RWjimR
origin/main now carries both headers from this branch. MapConstants is identical; ViewportConstants (add/add) takes main's generated version, which has the same names and values without the hand-written comments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmYbLQCBa8ek5RWjimR
TheRedDaemon
requested changes
Nov 11, 2026
…ic numbers - Map::LogicHelpers::MiscDisplay: MiscDisplayLayer bits 0x40-0x200 are the sea edge graphics updateGfxLayer sets (cliff, shore, shore edge); MD_SEA_EDGES is their 0x3C0 mask. - Map::Buildings::BuildingTargetMarker(Short): Building+0xC2, set to 1 by drawFlagsAndUnitDestinations for a building an own unit targets and to 2 by the unit selection handler for an own engine when engineers are selected; renderGmOverlayBuilding2 draws the marker and clears it. - ViewportConstants: VC_TILE_PIXEL_HEIGHT (16) and VC_MAP_SURFACE_MARGIN_X (150, the map surface's left margin in currentCameraOffsetX). - ViewportRenderState: the updateWaterAnimationFrames clocks named after the counters they drive (animationFrame16/32/36/512, slowAnimation*); slowAnimationTicked is BOOLEnum. - ViewportState::mouseTile -> mouseFlatTile: the height-ignoring tile updateBuildingPreviewPosition writes, against the elevation-aware mouseAtomRefFloorTile. - Floater::id -> nextFloaterID: the per-tile floater chain link. - TileMapState::disableElevationRendering is BOOLEnum. - scheduleUnitForBatchedRendering takes ints; param_7 -> batchesEarlier. - renderBuildingAnimation(buildingID, screenX, screenY, tile, BOOLEnum clipToBuilding). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
MD_SEA_EDGES for the white cap tile test, BTM_* for the building target marker, FALSE/TRUE for the BOOLEnum flags, the renamed animation clocks, mouseFlatTile and nextFloaterID, MC_MAP_SIZE_400 + 1 and tile-size and map-surface-margin constants in setViewportBasedOnMapSize. Dropped the redundant (char) casts on char layers and the (ushort) store cast, and renderGmOverlayBuilding2 declares buildingType at first use. All 25 functions stay at 100%. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Re the style-lint reading above:
All 25 functions that were at 100% are still at 100%. |
…:Enums Main's Ghidra sync moved the enum into Map/Buildings/Enums. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmb1ZyWXFVVKYYu4FWo
Tested as booleans (style guide rule 5), every store checked in the original binary where the field is not already BOOLEnum: - disableElevationRendering, clipToBuilding: BOOLEnum. - Building::useOffsetGraphics, displayOwnerFlag: only ever stored 0/1. - ViewportState::isZoomedOutUnk: a toggle, short form already on main. - DAT_BinaryTileMap400x400: filled by setTileSystemMemoryLookupArrays with SETG, cleared to 0 here. - Bitmask tests in assignRandomTiles and tweakValidTilesToExcludeMapBorders. Counters, image frames, IDs, renderAnimation (also stored 2) and drawBridgeState1 (2, 3) keep their comparisons. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XmXCmb1ZyWXFVVKYYu4FWo
TheRedDaemon
approved these changes
Nov 16, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.