Commit Graph
7 Commits
Author SHA1 Message Date
Nunuhara Cabbage ddc9f1ae12 DAP: add scene/parts requests
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.
2023-05-26 08:44:36 -07:00
Nunuhara Cabbage 7392d74efe Replace debug_print with to_json
to_json and cJSON_Print are now used when displaying debug information.

The main reason for this change it to support sending objects over DAP.
2023-05-14 20:12:34 -07:00
Nunuhara Cabbage caec854ed8 Implement scene_print function
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).
2022-06-10 19:18:10 -07:00
Nunuhara Cabbage 5581417937 Implement SACT2.WP_SetSP
Used in English version of Rance VI.
2022-04-10 09:04:00 -07:00
Nunuhara Cabbage e88ae62c08 Remove scene_flip function
It was a bug to call this function outside of sact_Update, because it
set scene_is_dirty to false without first rendering the scene. This can
cause the scene to not be rendered in a timely manner.
2022-04-05 19:31:13 -07:00
kichikuou b5f226ff79 Fix SACT2.SP_GetMaxZ
It should return the maximum Z value among all sprites, not among
visible sprites.

This fixes a bug in Rance VI where some UI elements are incorrectly
Z-ordered.
2021-06-12 10:38:16 +09:00
Nunuhara Cabbage dd985a3769 Refactor sprite/scene management code
Create a separate interface for managing the scene. The sact_sprite
interface is implemented on top of this, as is GoatGUIEngine (which is
now independent of sact_sprite).

This will allow more specialized graphics interfaces to be implemented
without adding to the complexity of the sact_sprite interace. (For
example, GoatGUIEngine needs to store multiple textures per sprite for
button states; this is not supported by sact_sprite.)
2021-05-21 18:56:33 -07:00