Files
nunuhara_xsystem4/include
kichikuou c540eb9796 PartsEngine: Implement controller (layer) system
PartsEngine in Rance 9 manages multiple "controllers" (called "layers"
in game scripts) that provide part grouping, draw-order control, and
bulk release. This implements the core controller API:

  - AddController / RemoveController: push/pop a controller on the
    stack. RemoveController releases all parts belonging to the removed
    controller and returns their IDs in erase_number_list.
  - SetActiveLayer / GetActiveLayer / GetSystemOverlayLayer: control
    which controller newly created parts are assigned to. The system
    overlay controller is a special controller that always renders on
    top and survives ReleaseAllWithoutSystem.
  - ReleaseAllWithoutSystem: releases all parts except those in the
    system overlay controller and re-initializes the controller stack.

Controllers are identified by their position in the stack (0 = bottom).
Draw ordering uses the scene's two-level sprite sorting: sp.z is set to
the controller's stack index and sp.z2 to the part's Z value, so parts
in higher controllers always render above lower ones regardless of
individual Z values. When the parts_multi_controller flag (see below) is
false, the original Z ordering is preserved (allowing Z-interleaving
with non-parts scene sprites -- see #180) for compatibility with games
that do not use controllers.

Save/load of the controller stack and per-part controller_no is gated on
a parts_multi_controller flag (set at PreLink time when the game's HLL
exports AddController) rather than a save version bump. This keeps the
save format stable for games that do not use controllers, while allowing
the save format to evolve freely during development.
2026-04-12 12:09:17 +09:00
..
2026-02-24 08:38:45 +09:00
2023-06-11 15:06:44 +09:00
2023-05-26 08:44:36 -07:00
2025-03-23 08:22:16 +09:00
2025-09-06 16:30:18 -07:00
2024-05-31 13:36:29 +09:00
2025-08-23 07:08:40 +09:00
2023-05-26 08:44:36 -07:00
2024-08-11 07:18:19 +09:00
2023-04-29 10:32:50 -07:00
2019-12-31 17:50:40 -08:00
2025-06-21 16:55:24 +09:00
2023-05-26 08:44:36 -07:00
2025-09-09 09:19:38 +09:00
2023-07-09 17:05:25 +09:00