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:
1 parent
ba03672c32
commit
d39f12ab4b
6 files changed
+145
-33
No files matched your search
+11
-1
@@ -18,7 +18,7 @@ shared base methods are inside the scope):
|
||||
| screen-space vertices (`XYZRHW`) | `IDirect3DDevice7::DrawPrimitive` / `DrawIndexedPrimitive` (vtable 25 / 26) | x + dx |
|
||||
| 3D items (belt, equipment) | ortho projection centred on the screen | none needed |
|
||||
| mouse events | `cEvent_mouseMove` x at +4 (previous) and +0xc; button down / up x at +8 | x - dx, restored afterwards |
|
||||
| mouse cursor object (`*0xcdbadc`) | x at +4, previous x at +0xc (polled for hover, item pick-up `0x6559a0`) | x - dx, restored unless the window thread stored a new position |
|
||||
| mouse cursor object (`*0xcdbadc`, accessor `0x6550f0`) | x at +4, previous x at +0xc (polled for hover, item pick-up `0x6559a0`) | the accessor returns a per-thread copy with x - dx; dwords the window changed are written back afterwards |
|
||||
| `GetMouseClientPos` (`0x66e500`) | polled position | x - dx |
|
||||
|
||||
## Calls outside a window's scope
|
||||
@@ -42,3 +42,13 @@ shared base methods are inside the scope):
|
||||
mouse events carry positions; category 5 events with subtype 0x10 test a point
|
||||
at +0x48 in `cUI_Window2::vf10`, but commands such as "open ESC menu" (0x11)
|
||||
keep unrelated data there.
|
||||
|
||||
## Why the cursor is copied, not shifted
|
||||
|
||||
UI windows render on the render thread while world input (picking,
|
||||
hold-to-move, `0x611f10`) reads the same cursor object on another thread.
|
||||
Shifting the shared object for the duration of a window's scope let the world
|
||||
sample a position ~400 px off now and then (jerky hold-to-move). Every user of
|
||||
the cursor goes through the accessor `0x6550f0`, so inside a moved window it
|
||||
returns a thread-local copy instead (with its own CRITICAL_SECTION at +0x24;
|
||||
copying and writing back hold the real object's lock).
|
||||
+8
-3
@@ -111,6 +111,14 @@ only grows horizontally. `[widescreen] Height=0` renders natively 1:1
|
||||
an enlarged view object
|
||||
- 3D ortho extents: world (+-267 x +-200, zoomed and unzoomed) and cGranny
|
||||
(+-512 x +-384, incl. cUI_NetGranny for HUD items)
|
||||
- creature clip test in both object passes (`0x62f988`, `0x6315cb`):
|
||||
creatures are drawn only within -200 .. 1024+200 x -200 .. 768+200 screen
|
||||
pixels (`cmp 4C8h` / `cmp 3C8h`); unpatched, creatures in the right part of
|
||||
a wide view were invisible, and above ~2450 px width (centre > 1224) even
|
||||
the player
|
||||
- centre immediates written as negatives (`add reg, 0FFFFFE00h`,
|
||||
`lea [..-200h]`), missed by a search for 200h: the row renderer's static
|
||||
object origin (`0x62babb`) and aiming at the cursor (`0x4fb6ef`)
|
||||
- the inverse projection `0x623a20` (screen -> view) uses 1/1024 and 1/768:
|
||||
game logic (camera follow `0x44d9f0`) converts world -> screen -> view with
|
||||
the device's current projection; unpatched it sent the camera off-world
|
||||
@@ -146,8 +154,5 @@ sector in every direction. The widened view needs at most +-1835 x +-768 px
|
||||
|
||||
## Open questions
|
||||
|
||||
- Above ~2300 px render width (between 2304 and 2816) the player is not drawn
|
||||
although monsters are (`cCreature::vf14` still called). Not hit at the
|
||||
default size; some per-view limit of ~40 tile columns, not found yet.
|
||||
- Fixed-size per-view buffers (e.g. `+0x80e40`, 5 vectors at `+0x96ad0` with
|
||||
capacity 0x200) - do they overflow at 3440x1440 (47 columns x 54 rows)?
|
||||
Reference in new issue
Block a user