widescreen: draw creatures across the whole view; HUD: copy the cursor per thread

- Creatures were culled beyond 1024+200 x 768+200 screen pixels (cmp 4C8h /
  3C8h in both object passes): invisible in the right part of a wide view,
  and the player too once the centre passed 1224. The bounds follow the
  render size now.
- Centre immediates written as negatives (-200h / -180h), missed before:
  the row renderer's static object origin (0x62babb) and aiming at the
  cursor (0x4fb620).
- HUD: moved windows no longer shift the shared mouse cursor object; the
  cursor accessor (0x6550f0) hands them a per-thread shifted copy and writes
  back what they changed. World input on other threads read the shifted
  position now and then, which made hold-to-move jerky.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
khallaandClaude Opus 5.5 committed 2026-10-14 08:16:27 +02:00
1 parent ba03672c32
commit d39f12ab4b
6 files changed
+145 -33

No files matched your search

+15
View File
@@ -84,6 +84,21 @@ constexpr uint32_t kCenterImmediates[][2] = {
// floating texts (damage numbers): world -> screen, and back (sub)
{0x0041e560, 0x0041e596}, {0x0041eb07, 0x0041eaf7},
};
// The same, negated (`add reg, -200h` / `lea reg, [...-200h]`), pairs x, y.
constexpr uint32_t kNegativeCenterImmediates[][2] = {
// aiming at the cursor (0x4fb620): cursor - centre + camera -> world
{0x004fb6ef, 0x004fb6f9},
// row renderer 0x62b000: screen origin (camera - centre) for the static
// objects it puts into the per-view draw lists
{0x0062babb, 0x0062bac1},
};
// Creatures are drawn only while their screen position lies within
// -200 .. 1024+200 x -200 .. 768+200 (`cmp reg, 4C8h` / `cmp eax, 3C8h`, in
// the two object passes 0x62e580 and 0x6300d0); outside it they only update.
constexpr uint32_t kCreatureClipRight[] = {0x0062f988, 0x006315cb}; // 0x4c8
constexpr uint32_t kCreatureClipBottom[] = {0x0062f9a7, 0x006315ea}; // 0x3c8
constexpr uint32_t kCreatureClipMargin = 200;
// cWorldView0 is allocated with `push 970F4h; call operator new` here.
constexpr uint32_t kWorldViewAllocSizePush = 0x006101aa;