* The "type" argument of S_MOD is 48 for bool, 56 for long int
* %b, %c, %d can consume any integer types (int, bool, or long int)
* If the value cannot be consumed, S_MOD should return the format
string instead of an empty string
It is implemented as a post-processing effect. The hack for the
projection transform matrix has been removed, because now the image is
flipped upside down in the post-processing stage.
This implementation supports only single-frame sprites with a single
child object. As far as I know, all Flash effects in AliceSoft games
meet this requirement.
The DefineSound tag in SWF has raw PCM data, so we create a WAV file in-
memory and pass it to audio_play_archive_data(). This is not strictly
necessary since libsndfile can handle raw PCM data, but keeps the audio
and mixer interfaces simple.
TapirEngine is the 3D rendering engine used in RanceQuest.
This implements the minimum functionality that is needed to render the
first battle scene. The lighting is still incorrect.
This SWF parser is far from complete, in particular it only supports
simple bitmap-filled rectangular shapes, but it covers all the features
used in Daiteikoku, Rance Quest, Pastel Chime 3 and Dorapeko.
Flash files are stored in archives in AFF format, which is an encrypted
SWF wrapper. The decryption code was adapted from GARbro.
Text sprites hold the height of the text drawn on them, and
sact_SP_TextNewLine increases the Y coordinate by this value if
nTextSize is 0.
The nTextSize argument of sact_SP_TextHome affects this value.
Beat Blades Haruka depends on this behavior.
xsystem4.scene: returns a list of scene entities
* all entities have an entityId that can be used in further requests
* SACT2 sprites have a 'sprite' member with a spriteId that can be
used in further requests
xsystem4.renderEntity: renders a scene entity and returns the texture
xsystem4.spriteTexture: returns the stored SACT2 sprite texture
xsystem4.renderParts: renders a parts object and returns the texture
xsystem4.partsTexture: returns the stored parts object texture
Image data in texture objects is RGB8888 encoded in base 64.
So far only basic debugging functionality is implemented (breakpoints,
stepping, stack traces/variables).
This is not tested against an established DAP client. My intention is to
create a custom GUI frontend and extend the protocol to support
xsystem4-specific features, such as inspecting the scene. (This work is
underway.)
Instruction references are hex-encoded address strings. Clients do not
need to obtain them from DAP requests. This is outside the spec, but it
is needed for a binary-only debugger.
Functions that write directly to stdout (e.g. printf) should generally
not be used any more. Instead, use either sys_message (which respects
sys_silent) or log_message (which will send the message to the debugger
if DAP is enabled). stderr can be used as normal.
Don't allocate massive textures for each text object. Instead, allocate
a texture for each character and then compose them onto an appropriately
sized texture.
Fixes a performance issue in Rance 01.
Although delegate pages store references to objects on the heap,
adding/removing objects from a delegate does not affect their reference
counts. When an object that is a member of a delegate is deleted, it is
automatically removed from the delegate.
In practice, this means that every object needs to keep a list of
delegates that it belongs to. This increases the size of the page header
on 64 bit systems, but not by much since the additional metadata can be
stored in a union with the array-specific metadata.
The afa implementation from libsys4 now handles basename indexing, so we
use that instead of creating a separate index. Also, afa v1 is now
properly supported in libsys4, so there is no need for the
id_indexed_afa hack.
This allows playback of videos in encodings other than MPEG-1, e.g. VC-1
used in the English version of Rance VI.
The FFmpeg dependency is optional. If it's not available, the PL_MPEG
backend will be used.
In SACT2 it's declared as int, so any integer can be passed. A Sengoku
Rance mod actually passes 2, but some compilers generate code that
interprets it as false.
After this, xsystem4 uses the global/group save format used by the
original System4, instead of the JSON format. Existing JSON save files
can still be loaded.
This makes save files interoperable between System4 and xsystem4 in some
games, including Sengoku Rance and Toushin Toshi III.
The nanosleep() function in mingw-w64 often sleeps for more than the
specified time. This causes a problem in Rance 6 combat scene, where
the damage popup is noticeably slow.
This adds vm_sleep() that calls SDL_Delay() which uses high-resolution
timer on Windows.
Most of the functionality of gfx_render_texture (draw method, blend
rate) is moved into sprite_render, since this was the only place using
it.
The draw method and blend rate are now stored in sact_sprite objects
instead of textures.
sact_sprite now has two renderers: the old SACT2 renderer (with blend
rate as the only shader parameter) and the new ChipmunkSpriteEngine
renderer, which supports multiply/add colors and the "surface area"
feature from PartsEngine.
Rance Quest now runs up to the first Flash-related function call
(Flash?!?!).
The 3rd argument to the instruction indicates the type of the second
argument. If there are multiple specifiers in the format string, the
first specifier matching the given type is substituted (NOT the first
specifier encountered when processing the format string).
Add 'step' (s) and 'next' (n) commands for single-stepping bytecode.
'step' is the 'step into' type which descends into function calls,
wheras 'next' is the 'step over' type which continues until the next
instruction within the current function.
These HLLs play .mpg movie files (later games use .alm file extension,
but the format is the same, i.e. MPEG-PS) that contain MPEG1 video and
MP2 audio streams.
pl_mpeg.h is the PL_MPEG library (https://github.com/phoboslab/pl_mpeg)
imported from commit 5aeef4d07593be1960a0e4c7fe204809cfae30bd.
This adds a few mixer functions (mixer_stream_*) for playing custom
audio streams under the master mixer.
Now parsed particle-effect definitions are cached in a hash map in the
plugin object. To make it possible, static part of `struct
particle_effect` and `struct particle_object` are factored out to
`struct pae` and `struct pae_object` respectively.
When there are multiple instances of a model, now they share a single
model object. Model objects are retained in a hash table until the
plugin is released, which is fine because Toushin Toshi 3 doesn't reuse
a plugin across scenes.
It visualizes the bounding sphere of the instance. Although it is only
called from dead code in Toushin Toshi 3, it's useful for debugging
shadow mapping.
This fixes broken shadow rendering e.g. when Nacht climbs a ladder.
Now update_bones() calculates the instance's bounding sphere which
is the minimum sphere containing the AABB of current bone coordinates.
This corresponds to the sphere that is displayed when calling
SetInstanceDebugDrawShadowVolume on the original ReignEngine.dll.
This fixes billboard rendering issue in some dungeons.
* For polygon models, use its AABB's center coordinates.
* Consider the camera angle, i.e. sort by view-space Z-coordinate
instead of world-space Z-coordinate.
Some games have assets that are too large to mmap everything on a 32-bit
address space. For example, TT3 has a total of 2.82GB of assets, which
is too large for the 3GB address space limit of 32-bit Linux. On Android
it's even stricter and mmaps of hundreds of MB can fail.
Before this, the order of drawing was determined on an instance-by-
instance basis. Instances with even a single transparent material were
drawn after fully opaque instances.
After this, first the opaque meshes in all instances are drawn, and then
the transparent meshes are drawn from the nearest to the farthest.