Widescreen: keep original size, extend view horizontally; fix player/camera

- Default render size is 768 high and as wide as the monitor aspect
  (1835x768 on 3440x1440), scaled up: everything keeps the size players
  know and the view only grows sideways. Height=0 keeps native 1:1.
- Ground: 818/888 clip limits, screen centre floats and integer
  immediates, ground quad list (capped at 1749) moved with the tile list.
- 3D: cGranny ortho (+-512 x +-384, incl. HUD items) scaled; inverse
  projection 0x623a20 (1/1024, 1/768) follows the render size, which fixes
  the camera following the player ("outside world") and the missing
  player / ESC menu.
- tools: game-input.ps1 + autotest-load.ps1 drive the game (load the first
  save game, screenshots in-game and with the ESC menu).

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 01:48:08 +02:00
1 parent 795fe8f087
commit df31c9c105
6 files changed
+324 -45

No files matched your search

+25
View File
@@ -93,8 +93,33 @@ in fullscreen).
- `0x0060e3f0` GDI BitBlt of a 1024x768 bitmap (startup/movie path)
- `0x00627260` name/HP labels while Alt is held (no constants, uses view)
## Render size
Default: 768 world pixels high (the original vertical view), width from the
monitor aspect (3440x1440 -> 1835x768), scaled to the monitor by the
borderless mod. Everything keeps the on-screen size players know; the view
only grows horizontally. `[widescreen] Height=0` renders natively 1:1
(everything about half size on a 1440p monitor).
## Things that had to follow the render size
- view size / centre / clip floats and their integer immediates (world view)
- tile draw list and ground quad list (fixed 1750 / 1749 entries) moved into
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)
- 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
## 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.
- HUD: drawn in the top-left 1024x768 of the render target; 3D belt items
use the scaled HUD projection and sit off their slots.
- Activity radius: which creatures/objects are updated and animated
(`cWorld` / `cSector`, `0x00603e90` = player?, `0x005fe060` = object by id).
- Fixed-size per-view buffers (e.g. `+0x80e40`, 5 vectors at `+0x96ad0` with