42 Commits
Author SHA1 Message Date
kichikuou 167d75d092 parts: Implement PartsFunc 112 (GetText) 2026-09-16 10:14:38 +09:00
kichikuou 267f7bb762 parts: Support PartsFunc func_id assignments in Blade Briders
Blade Briders inserts three layer functions at func_id 3-5 into the
assignment used by Rance9, shifting all subsequent func_ids up by three.
Evenicle uses the same assignment as Blade Briders.

Use this assignment internally and add three to Rance9 func_ids before
dispatch. Also implement the functions 3-5.
2026-09-15 08:36:47 +09:00
kichikuou addc26ca45 parts: Implement PartsEngine.GetComponentSpeedupRateByMessageSkip 2026-09-15 08:36:39 +09:00
kichikuou ec9bd95dc9 PartsEngine: Implement PartsFunc 3 (motion Pause/Resume)
Wire up PartsFunc 3 (PauseMotion) to a new PE_PauseMotion(). While
paused, PE_UpdateMotionTime stops advancing the motion clock.
2026-06-10 17:17:05 +09:00
kichikuou 8dee7d8658 PartsEngine: Implement PartsFunc 6 (SaveThumbnail)
Save a reduced copy of the main surface to a file. The image is written
as QNT under the save directory.

To avoid aliasing at large reductions, the surface is downscaled by
repeatedly halving before the final stretch.
2026-06-10 17:17:01 +09:00
kichikuou 63ab438391 PartsEngine: Implement 3DLayer parts type
This adds PARTS_3DLAYER type that creates a SealEngine plugin bound to a
SACT sprite.
2026-04-25 12:06:01 +09:00
kichikuou 1b87d3f9a5 PartsEngine: Implement drag-and-drop processing
This implements Parts_SetDrag and drag/drop event handling. When a part
has drag enabled, clicking and moving the mouse will move the part and
emit DRAG_BEGIN/DRAGGING/DRAG_END messages. Drop target detection emits
DROP_ENTER/DROP_ON/DROPPED/DROP_LEAVE messages on parts under the cursor
during drag.
2026-04-25 07:38:46 +09:00
kichikuou df6998c0f9 PartsEngine: Implement LayoutBox
This adds PARTS_LAYOUT_BOX parts type with support for automatic
horizontal/vertical child positioning. Layout calculation runs during
the component update cycle, repositioning children before their global
parameters are combined.
2026-04-22 11:25:28 +09:00
kichikuou c4f89d040a PartsEngine: Implement PartsFunc 4 (SetWantSave)
This adds want_save parts flag which defaults to true. Parts with
want_save set to false are excluded from save data.
2026-04-20 09:03:43 +09:00
kichikuou 88f199a8f2 PartsEngine: Implement PartsFunc 45 (PARTS_SetLockInputState)
This adds lock_input_state parts flag which prevents state transition.
2026-04-20 08:10:27 +09:00
kichikuou 28c8c277c9 PartsEngine: Implement PartsFunc 40-42 (PARTS_GetAbsolute[XYZ]) 2026-04-20 07:59:03 +09:00
kichikuou e5087f0757 PartsEngine: Implement PartsFunc 103 (GetPartsCGSurfaceArea) 2026-04-20 07:24:16 +09:00
kichikuou 1655c8a8e0 PartsEngine: Implement pass_cursor flag
This implements SetPassCursor/GetPartsPassCursor HLL functions. The
pass_cursor flag controls whether the cursor "passes through" a
component to reach parts behind it.

Key changes to input processing:
- Iteration order changed from back-to-front to front-to-back for proper
  cursor consumption
- MOUSE_ENTER / MOUSE_LEAVE now fire for all parts regardless of
  clickable
- Click hit test uses clickable || !pass_cursor pre-filter
- pass_cursor=false parts consume the cursor, preventing hover and
  click events from reaching parts behind them
2026-04-19 09:42:20 +09:00
kichikuou a0d78a024c PartsEngine: Implement message dispatch system
This adds a message queue that captures GUI events and exposes them
through HLL accessor functions.
2026-04-15 08:56:52 +09:00
Nunuhara Cabbage c877e261c5 Merge pull request #322 from kichikuou/ComponentType
PartsEngine: Implement SetComponentType and GetComponentType
2026-04-12 16:42:32 -07:00
kichikuou 93ca13a50b PartsEngine: Implement SetComponentType and GetComponentType 2026-04-12 16:53:34 +09:00
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
kichikuou 96d46069ce PartsEngine: Implement movie parts
This adds PARTS_MOVIE type which creates a SACT sprite as a render
target for DrawMovie.

The GL texture is shared between the SACT sprite and parts_common, so
movie frames rendered to the sprite are directly visible through the
parts engine's rendering path.
2026-04-09 13:06:07 +09:00
kichikuou fe952354c5 PartsEngine: Add initial support for Flat animation
Only nested timelines and CG rendering are implemented. Stop motion and
particle emitters are not yet implemented.
2026-04-05 13:52:27 +09:00
kichikuou 623b3d3407 PartsEngine: Implement AddFillWithAlphaToPartsConstructionProcess 2026-04-02 13:21:34 +09:00
kichikuou 205e0a3ed0 Implement PartsEngine.ExistsFlashFile
Used in Pastel Chime 3.
2026-03-01 07:31:50 +09:00
kichikuou 9c962e3467 Implement PartsEngine.AddGrayFilterToPartsConstructionProcess
It applies a grayscale filter to a specified area of the parts.
2026-03-01 07:31:36 +09:00
kichikuou 7540712de1 Add stub for PartsEngine.SetPartsAlphaClipperPartsNumber
For Pastel Chime 3.
2026-02-15 09:35:24 +09:00
kichikuou c70e5e028e Implement GoatGUIEngine.AddDrawRectToPartsConstructionProcess
Used in Rance Quest.
2025-06-14 15:37:35 +09:00
kichikuou ade7ea9235 Fix signature mismatch in HLL_EXPORT functions
Notable changes:

* The numerator / denominator parameters of AddMotion[HV]GaugeRate are
  int in GoatGUIEngine but float in GUIEngine and PartsEngine.
* AnteaterADVEngine.ADVLogList_AddText has second parameter
  (int WindowNo) since Oyako Rankan.

This also avoids using non-void functions where a void function is
expected. It is fine in most ABIs, but raises a runtime error in wasm32.
2024-08-07 09:14:38 +09:00
Nunuhara Cabbage 6b78f53bd7 Implement various functions for Drapeko
The game now runs until after the opening movie, although with some GUI
layout bugs.
2024-08-02 15:08:44 -07:00
Nunuhara Cabbage bc04af131a parts: implement miscellaneous functions 2024-07-31 07:35:10 -07:00
kichikuou 3496f45e39 parts: add basic implementation of Flash type
Sprite objects and sounds are not implemented yet.
2023-06-17 11:32:14 +09:00
Nunuhara Cabbage f7cf2264fa Fix multiple issues with resetting HLLs
Clear PartsEngine/SACT2/CharSpriteManager/audio state when resetting the
VM.

Fixes #113
2023-04-14 16:00:40 -07:00
Nunuhara Cabbage e4ed459376 Implement miscellaneous PartsEngine functions 2023-04-10 21:48:09 -07:00
Nunuhara Cabbage 6b62e1db23 Fix CG loading functions for Rance Quest
Rance Quest uses strings for CG names, but the strings contain numbers
which should be converted to integers for lookup.
2023-02-11 16:36:05 -08:00
Nunuhara Cabbage fc42c42ef5 parts: refactor parent-child handling
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).
2022-06-24 17:54:25 -07:00
Nunuhara Cabbage 8ee136b287 parts: various fixes and improvements
* 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.
2022-06-21 19:57:36 -07:00
Nunuhara Cabbage 25695c3e86 parts: implement GUIEngine numerals
Implement Parts_SetNumeralLinedCGNumberWidthWidthList and
Parts_SetNumeralLength.

Also fix bugs where changing numeral properties would not update the
texture until the number was reset.
2022-06-18 10:53:43 -07:00
Nunuhara Cabbage a6913af2bc parts: implement more ConstructionProcess ops
Implement Fill, FillAMap, DrawCutCG and CopyCutCG operations.
2022-06-17 16:08:30 -07:00
Nunuhara Cabbage 8ff4fa8666 parts: various fixes and improvements
The title screen in Rance 01 now functions as expected.
2022-06-16 19:13:36 -07:00
Nunuhara Cabbage 7e04db958b parts: implement more ConstructionProcess ops
Implement Create, CreatePixelOnly, DrawText and CopyText operations.
2022-06-10 15:28:08 -07:00
Nunuhara Cabbage 1484a207c5 Implement GUIEngine.{Set,Get}DelegateIndex 2022-06-08 17:09:47 -07:00
Nunuhara Cabbage 09f2c3e1ed parts: implement Parts_Set*SurfaceArea functions
These functions apply a clipping rectangle to the parts texture.
2022-06-08 16:51:06 -07:00
Nunuhara Cabbage eaa0baad7f Handle library incompatibilities
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).
2022-06-06 08:49:12 -07:00
Nunuhara Cabbage 5dfb82afd7 parts: ConstructionProcess (WIP)
A very partial implementation of some ConstructionProcess functionality.
2022-03-27 15:40:18 -07:00
Nunuhara Cabbage 5b2f9d7536 Refactor GoatGUIEngine and add misc. stubs
Refactor GoatGUIEngine into various files under src/parts/.
The external interface to this code is the functions prefixed with PE_
and generally following the naming of the HLL functions which they
implement.

The reason for this is that there are multiple HLL libraries that
implement more or less the same GUI interface (GoatGUIEngine, GUIEngine
and PartsEngine).

Also added here are a number of miscellaneous stubbed-out HLL functions
that are used by Rance 01 (which now runs up to the point where it tries
to create the title menu).
2022-01-30 10:12:20 -08:00