Fixes an issue in English version of Rance 9 where item description text
was overly compressed. Now ChipmunkSpriteEngine.SP_GetFontWidth returns
the same values as the official engine.
There are still text layout bugs with item descriptions in Rance 9
(affecting both JP and EN versions), but this at least makes the text
readable.
On Windows RAND_MAX is 0x7fff, which makes Rand() and RandF() far too
coarse. Use mt19937 instead so that seeded sequences reproduce the
original engine's behavior.
Text lines are saved individually without newlines. Insert an explicit
newline between lines on load so the original line structure is
restored. Also free the strings read from the save data.
Rance 9's AFA archives have no ID field, so asset IDs are sequential
indices local to each archive. When the game loads an additional CG
archive, the ID spaces overlap: a name resolved to an ID against the
base archive later fetches a different CG from the additional archive.
Keep the CG name instead.
Bumps the save version to 5; version 4 and earlier saves still store IDs
and are converted on load.
AFAFactory.LoadArchive passed the SJIS archive name straight through, so
the extra assets loaded by the Rance 9 v2.00 patch were never found.
Move the path resolution out of CGManager.LoadArchive so that both
callers share it.
Bump the save version and always serialize controller state and the
Rance 9 parts fields. Load these fields based on the save version while
retaining compatibility with existing multi-controller saves.
Commit 03062d5 fixed audio lookup for Rance 9, but the new archive-data
preparation path bypassed BGI and WAI metadata. Pass the asset number
through that path so loop points are applied correctly.
Audio linesize may include unused buffer space. Using it as the sample
count caused short Vorbis frames to replay stale samples and slowed down
audio playback.
Fortress.alm from Rance IX uses an MPEG-2 Program Stream containing
MPEG-1 video and MPEG-1 Layer II audio. As far as I checked, it is the
only .alm movie released in Japan that does not use an MPEG-1 Program
Stream.
The existing pl_mpeg decoders support its elementary streams, but the
demuxer rejects its MPEG-2 pack and PES headers. Extend the demuxer to
parse those headers and the PTS/DTS combinations used by Fortress.alm.
Replace direct one-shot zlib compression and decompression calls with
the libsys4 wrappers. Use exact-size decompression where file formats
provide the uncompressed size.
File2.c continues to depend directly on zlib because it uses streaming
inflate.
When NumLock is disabled, Windows reports numpad keys as navigation
virtual-key codes in the WM_KEYDOWN message. SACT2 games rely on this
behavior.
Translate SDL keypad scancodes to the corresponding SACT key codes in
that state, and map keypad Enter to VK_RETURN.
Fixes#359.
Add the following commands to the debugger:
3d list [all] List plugins and instances
3d plugin [<plugin>] Show or select the current plugin
3d show [<instance>] Dump plugin or instance state
3d set <instance> draw <0|1> Enable or disable drawing
3d set <instance> pos <x> <y> <z> Set the instance position
3d help Show command help
The show and set commands operate on the current plugin. If only one
plugin exists, it is selected automatically. Changes made with set are
rendered immediately.
If AddCreateCGToProcess fails for a missing CG, no create op is added to
the construction process. Game scripts still add drawing operations and
then build the process, leaving those operations with no destination
texture and causing an incomplete framebuffer error.
This makes construction build operations return false as soon as an
operation cannot be executed.
Fixes#356.
Game-specific .xsys4rc files are loaded from the game directory, so
relative paths in that file are most useful when interpreted from the
same directory. This allows patches that ship external fonts to
reference them with relative paths.
In both TapirEngine and SealEngine an instance is outlined only when the
global edge draw option and its per-instance edge flag are both on. The
per-instance flag is exposed via Set/GetInstanceDrawParam, whose edge
index differs by engine (Tapir 0, Seal 2).
For the global option the engine only distinguishes on/off, so drop the
RE_draw_edge_mode enum.
In SealEngine the outline length and color are plugin-wide values set
via SetEdgeLength/SetEdgeColor, not the per-mesh .opr parameters used by
TapirEngine.
Only resolve the method when the function's signature matches the
delegate type, returning 0 otherwise.
Also, DG_SET / DG_NEW_FROM_METHOD / DG_ADD should not add function 0.
This implements the sky/middle/ground hemisphere ambient driven by
light_params[8..19].
SealEngine has no separate specular-light instance; its specular instead
shares the hemisphere light vector.
SealEngine manages a 41-float light parameter set (serialized as .lit
file) for tone mapping, hemisphere lighting, and light scattering. This
adds the storage and HLL plumbing, without wiring values into shaders.
- A DIRECTIONAL_LIGHT instance owns a parameter set, filled by loading a
.lit file (RE_instance_load).
- SealEngine.StoreInstanceLightParam() reflects that presets into the
plugin's master buffer, which is used by the renderer.
- SealEngine.LoadInstanceLightParam() copies the master back into an
instance, and Reset()/Set()/Get() operate directly on the master.