This implements a Phong shading with ambient, diffuse and specular
components, using up to three directional lights and one specular light.
The light calculation is made to match the "high quality" 3D mode of
Toushin Toshi 3.
Each delegate call needs to copy its arguments so that they aren't
double-freed by the next call.
Also fix a bug in FT_ASSIGNS where -1 was returned for non-existant
functions instead of 0.
Parent-child relationships are established by the UpdateComponent
function. Parts_SetParentPartsNumber does not establish the relationship
(and it does not create the parent object if it does not exist yet).
Render params are now computed recursively on children when they are set
on the parent (instead of recomputing them every time a child parts is
rendered).
* SetAddColor and SetMultiplyColor implemented
* additive draw filter implemented
* GetPartsUpperLeftPos{X,Y} implemented
* various parameters are now applied from parent to child parts
* misc. bug fixes
The first dungeon screen in Rance 01 now renders correctly.
Implement Parts_SetNumeralLinedCGNumberWidthWidthList and
Parts_SetNumeralLength.
Also fix bugs where changing numeral properties would not update the
texture until the number was reset.
The parent's z-value determines the render order of its children.
Alicesoft's implementation of this is a bit weird. The render order only
changes when the parent's visibility is toggled (via Parts_SetShow), NOT
when the parent is set on a child or the parent's z-value changes.
I have chosen to implement this so that the render order is always based
on the current parent/child z-values.
This fixes some bugs in Rance 01.
Fixes a crash bug when attempted to get a string property of nonexistent
motion.
This also fixes compiler warnings, and simplifies the code by using
helper functions.
Move position/size values around and rename them to reflect what they
actually mean:
* parts->offset moved to parts_common->origin_offset
* parts->pos moved to parts_common->hitbox
* x and y coordinates from parts->rect renamed to parts->pos
* width and height from parts->rect moved into parts_common
Check for uninitialized or explicitly zeroed surface area at render
time. This fixes an issue where some construction process parts would
not be rendered (specifically, the button text on the Rance 01 title
screen).
Plugins can implement this so that scene_print will print additional
information for the sprite. RE_plugin implements this to dump the 3D
scene information.
Add a scene_print function which prints a textual representation of the
current scene. This works by attaching a `debug_print` function to each
entity in the scene. This function is implemented for SACT2 and
GUIEngine entities. A default implementation will be used of none is
provided.
This can be accessed from the debugger via the `scene` command (although
the output is typically too much to view in a terminal; it's better to
run `scene_print` somewhere and redirect stdout to a file).
Add a mechanism for libraries to resolve incompatibilities between
library versions before linking.
This is currently used for ChipmunkSpriteEngine and GoatGUIEngine,
where early versions used integer IDs when loading CGs (later versions
use strings).
There are now two types of asset management:
1. ID-indexed assets, where IDs are not necessarily sequential
2. name-indexed assets
Name-indexed assets can have additional archives added at run-time. This
is to support the CGManager.LoadArchive function used in Rance Quest
Magnum.
Name-indexed assets always use .afa archives. ID-indexed assets mostly
use .ald archives, except for Daiteikoku and Shaman's Sanctuary.
asset_get_by_name is now case insensitive and ignores the file
extension.