/* Web64 SDK header printout: web64/actor-batch.h * Generated by scripts/copy-web64-ide-source.mjs. * The IDE resolves this header as a read-only virtual SDK document. */ #ifndef WEB64_ACTOR_BATCH_H #define WEB64_ACTOR_BATCH_H #include #include #define WEB64_ACTOR_BATCH_ABI_VERSION 2 #define WEB64_ACTOR_BATCH_OK 0 #define WEB64_ACTOR_BATCH_INVALID_ARGUMENT 1 #define WEB64_ACTOR_BATCH_CAPACITY 2 #define WEB64_ACTOR_BATCH_INVALID_ID 4 #define WEB64_ACTOR_BATCH_INVALID_FRAME 8 #define WEB64_ACTOR_BATCH_POINTER_OVERFLOW 16 #define WEB64_ACTOR_BATCH_PALETTE_MISMATCH 32 #define WEB64_ACTOR_BATCH_INVALID_BINDING 64 #define WEB64_ACTOR_BATCH_UNSUPPORTED 128 #define WEB64_ACTOR_SPRITE_NONE 0 #define WEB64_ACTOR_SPRITE_RAW_SINGLE 1 #define WEB64_ACTOR_SPRITE_ASSET_SINGLE 2 #define WEB64_ACTOR_SPRITE_ASSET_PAIR 3 #define WEB64_ACTOR_RENDER_SINGLE 1 #define WEB64_ACTOR_RENDER_PAIR 2 #define WEB64_ACTOR_MUX_PIPELINE_BOUNDS_STABLE 1 #define WEB64_ACTOR_MUX_PIPELINE_ANIMATION_TICKS_READY 2 #define WEB64_ACTOR_MUX_PIPELINE_DENSE_ACTIVE_IDS 4 #define WEB64_ACTOR_MUX_PIPELINE_ANIMATION_PRETICKED 8 #define WEB64_ACTOR_MUX_PIPELINE_PAIRS_PRECOMPUTED 16 #define WEB64_ACTOR_MUX_PIPELINE_STABLE_TOPOLOGY 32 #define WEB64_ACTOR_MUX_PIPELINE_STABLE_ORDER_IDENTITY 64 #define WEB64_ACTOR_MUX_PIPELINE_DENSE_MOTION_PREINTEGRATED 128 #define WEB64_ACTOR_VIEW_ACTIVE_IDS 0 #define WEB64_ACTOR_VIEW_ACTIVE 2 #define WEB64_ACTOR_VIEW_ACTIVE_COUNT 4 #define WEB64_ACTOR_VIEW_CAPACITY 6 #define WEB64_ACTOR_VIEW_X 7 #define WEB64_ACTOR_VIEW_Y 9 #define WEB64_ACTOR_VIEW_VX 11 #define WEB64_ACTOR_VIEW_VY 13 #define WEB64_ACTOR_VIEW_WIDTH 15 #define WEB64_ACTOR_VIEW_HEIGHT 17 #define WEB64_ACTOR_VIEW_CATEGORY 19 #define WEB64_ACTOR_VIEW_MASK 21 #define WEB64_ACTOR_VIEW_SIZE 23 #define WEB64_ACTOR_ANIMATION_BANK 0 #define WEB64_ACTOR_ANIMATION_SEQUENCE 2 #define WEB64_ACTOR_ANIMATION_QUEUED 4 #define WEB64_ACTOR_ANIMATION_STEP 6 #define WEB64_ACTOR_ANIMATION_TICKS 8 #define WEB64_ACTOR_ANIMATION_FRAME 10 #define WEB64_ACTOR_ANIMATION_OVERLAY_FRAME 12 #define WEB64_ACTOR_ANIMATION_EVENTS 14 #define WEB64_ACTOR_ANIMATION_STATUS 16 #define WEB64_ACTOR_ANIMATION_DIRECTION 18 #define WEB64_ACTOR_ANIMATION_SIZE 20 #define WEB64_ACTOR_SPRITE_SET_KIND 0 #define WEB64_ACTOR_SPRITE_SET_ASSET 2 #define WEB64_ACTOR_SPRITE_SET_BASE_POINTER 4 #define WEB64_ACTOR_SPRITE_SET_OVERLAY_POINTER 6 #define WEB64_ACTOR_SPRITE_SET_FRAME_COUNT 8 #define WEB64_ACTOR_SPRITE_SET_BASE_COLOR 10 #define WEB64_ACTOR_SPRITE_SET_OVERLAY_COLOR 12 #define WEB64_ACTOR_SPRITE_SET_MULTICOLOR_1 14 #define WEB64_ACTOR_SPRITE_SET_MULTICOLOR_2 16 #define WEB64_ACTOR_SPRITE_SET_FLAGS 18 #define WEB64_ACTOR_SPRITE_SET_PRIORITY 20 #define WEB64_ACTOR_SPRITE_SET_BASE_FRAME 22 #define WEB64_ACTOR_SPRITE_SET_OVERLAY_FRAME 24 #define WEB64_ACTOR_SPRITE_SET_CAPACITY 26 #define WEB64_ACTOR_SPRITE_SET_SIZE 27 #define WEB64_ACTOR_VIEWPORT_WORLD_X 0 #define WEB64_ACTOR_VIEWPORT_WORLD_Y 2 #define WEB64_ACTOR_VIEWPORT_VIC_ORIGIN_X 4 #define WEB64_ACTOR_VIEWPORT_VIC_ORIGIN_Y 6 #define WEB64_ACTOR_VIEWPORT_WIDTH 7 #define WEB64_ACTOR_VIEWPORT_HEIGHT 9 #define WEB64_ACTOR_VIEWPORT_SIZE 11 #define WEB64_ACTOR_VISIBLE_ENTRY_ACTOR 0 #define WEB64_ACTOR_VISIBLE_ENTRY_X 1 #define WEB64_ACTOR_VISIBLE_ENTRY_Y 3 #define WEB64_ACTOR_VISIBLE_ENTRY_ORDER 4 #define WEB64_ACTOR_VISIBLE_ENTRY_SIZE 5 #define WEB64_ACTOR_VISIBLE_BUFFER_ENTRIES 0 #define WEB64_ACTOR_VISIBLE_BUFFER_CAPACITY 2 #define WEB64_ACTOR_VISIBLE_BUFFER_COUNT 3 #define WEB64_ACTOR_VISIBLE_BUFFER_DROPPED 4 #define WEB64_ACTOR_VISIBLE_BUFFER_SIZE 5 #define WEB64_ACTOR_PAIR_ACTOR_A 0 #define WEB64_ACTOR_PAIR_ACTOR_B 1 #define WEB64_ACTOR_PAIR_SIZE 2 #define WEB64_ACTOR_PAIR_WORKSPACE_SORTED_IDS 0 #define WEB64_ACTOR_PAIR_WORKSPACE_COUNT 2 #define WEB64_ACTOR_PAIR_WORKSPACE_CAPACITY 3 #define WEB64_ACTOR_PAIR_WORKSPACE_INITIALIZED 4 #define WEB64_ACTOR_PAIR_WORKSPACE_SIZE 5 #define WEB64_ACTOR_PAIR_BUFFER_PAIRS 0 #define WEB64_ACTOR_PAIR_BUFFER_CAPACITY 2 #define WEB64_ACTOR_PAIR_BUFFER_COUNT 3 #define WEB64_ACTOR_PAIR_BUFFER_OVERFLOW 4 #define WEB64_ACTOR_PAIR_BUFFER_SIZE 5 #define WEB64_ACTOR_BOUNDS_WORKSPACE_LEFT 0 #define WEB64_ACTOR_BOUNDS_WORKSPACE_RIGHT 2 #define WEB64_ACTOR_BOUNDS_WORKSPACE_TOP 4 #define WEB64_ACTOR_BOUNDS_WORKSPACE_BOTTOM 6 #define WEB64_ACTOR_BOUNDS_WORKSPACE_CAPACITY 8 #define WEB64_ACTOR_BOUNDS_WORKSPACE_SIZE 9 #define WEB64_ACTOR_COMMAND_ACTOR 0 #define WEB64_ACTOR_COMMAND_X 1 #define WEB64_ACTOR_COMMAND_Y 3 #define WEB64_ACTOR_COMMAND_BASE_POINTER 4 #define WEB64_ACTOR_COMMAND_OVERLAY_POINTER 5 #define WEB64_ACTOR_COMMAND_BASE_COLOR 6 #define WEB64_ACTOR_COMMAND_OVERLAY_COLOR 7 #define WEB64_ACTOR_COMMAND_FLAGS 8 #define WEB64_ACTOR_COMMAND_PRIORITY 9 #define WEB64_ACTOR_COMMAND_LAYERS 10 #define WEB64_ACTOR_COMMAND_MULTICOLOR_1 11 #define WEB64_ACTOR_COMMAND_MULTICOLOR_2 12 #define WEB64_ACTOR_COMMAND_ORDER 13 #define WEB64_ACTOR_COMMAND_SIZE 14 #define WEB64_ACTOR_COMMAND_BUFFER_COMMANDS 0 #define WEB64_ACTOR_COMMAND_BUFFER_CAPACITY 2 #define WEB64_ACTOR_COMMAND_BUFFER_COUNT 3 #define WEB64_ACTOR_COMMAND_BUFFER_ACCEPTED_LAYERS 4 #define WEB64_ACTOR_COMMAND_BUFFER_DROPPED_ENTRIES 5 #define WEB64_ACTOR_COMMAND_BUFFER_DROPPED_LAYERS 6 #define WEB64_ACTOR_COMMAND_BUFFER_SIZE 7 #define WEB64_ACTOR_MUX_PIPELINE_VIEW 0 #define WEB64_ACTOR_MUX_PIPELINE_ANIMATION 2 #define WEB64_ACTOR_MUX_PIPELINE_VIEWPORT 4 #define WEB64_ACTOR_MUX_PIPELINE_VISIBLE 6 #define WEB64_ACTOR_MUX_PIPELINE_BOUNDS 8 #define WEB64_ACTOR_MUX_PIPELINE_PAIR_WORKSPACE 10 #define WEB64_ACTOR_MUX_PIPELINE_PAIRS 12 #define WEB64_ACTOR_MUX_PIPELINE_SPRITES 14 #define WEB64_ACTOR_MUX_PIPELINE_COMMANDS 16 #define WEB64_ACTOR_MUX_PIPELINE_MUX 18 #define WEB64_ACTOR_MUX_PIPELINE_STATUS 20 #define WEB64_ACTOR_MUX_PIPELINE_FLAGS 22 #define WEB64_ACTOR_MUX_PIPELINE_SIZE 23 #define WEB64_ACTOR_STATUS_PROCESSED 0 #define WEB64_ACTOR_STATUS_EMITTED 1 #define WEB64_ACTOR_STATUS_DROPPED_ENTRIES 2 #define WEB64_ACTOR_STATUS_EMITTED_LAYERS 3 #define WEB64_ACTOR_STATUS_DROPPED_LAYERS 4 #define WEB64_ACTOR_STATUS_PAIRS 5 #define WEB64_ACTOR_STATUS_REASONS 6 #define WEB64_ACTOR_STATUS_SIZE 7 typedef struct { uint8_t *active_ids; uint8_t *active; uint8_t *active_count; uint8_t capacity; web64_pos_t *x; web64_pos_t *y; web64_vel_t *vx; web64_vel_t *vy; uint8_t *width; uint8_t *height; uint8_t *category; uint8_t *mask; } Web64ActorBatchView; typedef struct { uint16_t *bank; uint8_t *sequence; uint8_t *queued; uint8_t *step; uint8_t *ticks; uint8_t *frame; uint8_t *overlay_frame; uint8_t *events; uint8_t *status; uint8_t *direction; } Web64ActorAnimationBatch; typedef struct { uint8_t *kind; Web64AssetRef *asset; uint8_t *base_pointer; uint8_t *overlay_pointer; uint16_t *frame_count; uint8_t *base_color; uint8_t *overlay_color; uint8_t *multicolor_1; uint8_t *multicolor_2; uint8_t *flags; uint8_t *priority; uint8_t *base_frame; uint8_t *overlay_frame; uint8_t capacity; } Web64ActorSpriteSet; typedef struct { uint16_t world_x; uint16_t world_y; uint16_t vic_origin_x; uint8_t vic_origin_y; uint16_t width; uint16_t height; } Web64ActorViewport; typedef struct { uint8_t actor; uint16_t x; uint8_t y; uint8_t order; } Web64ActorVisibleEntry; typedef struct { Web64ActorVisibleEntry *entries; uint8_t capacity; uint8_t count; uint8_t dropped; } Web64ActorVisibleBuffer; typedef struct { uint8_t actor_a; uint8_t actor_b; } Web64ActorPair; typedef struct { uint8_t *sorted_ids; uint8_t count; uint8_t capacity; uint8_t initialized; } Web64ActorPairWorkspace; typedef struct { Web64ActorPair *pairs; uint8_t capacity; uint8_t count; uint8_t overflow; } Web64ActorPairBuffer; typedef struct { uint8_t *left; uint8_t *right; uint8_t *top; uint8_t *bottom; uint8_t capacity; } Web64ActorBoundsWorkspace; typedef struct { uint8_t actor; uint16_t x; uint8_t y; uint8_t base_pointer; uint8_t overlay_pointer; uint8_t base_color; uint8_t overlay_color; uint8_t flags; uint8_t priority; uint8_t layers; uint8_t multicolor_1; uint8_t multicolor_2; uint8_t order; } Web64ActorRenderCommand; typedef struct { Web64ActorRenderCommand *commands; uint8_t capacity; uint8_t count; uint8_t accepted_layers; uint8_t dropped_entries; uint8_t dropped_layers; } Web64ActorCommandBuffer; typedef struct { Web64ActorBatchView *view; Web64ActorAnimationBatch *animation; Web64ActorViewport *viewport; Web64ActorVisibleBuffer *visible; Web64ActorBoundsWorkspace *bounds; Web64ActorPairWorkspace *pair_workspace; Web64ActorPairBuffer *pairs; Web64ActorSpriteSet *sprites; Web64ActorCommandBuffer *commands; Web64SpriteMultiplexer *mux; Web64ActorBatchStatus *status; uint8_t flags; } Web64ActorMuxPipeline; typedef struct { uint8_t processed; uint8_t emitted; uint8_t dropped_entries; uint8_t emitted_layers; uint8_t dropped_layers; uint8_t pairs; uint8_t reasons; } Web64ActorBatchStatus; #define WEB64_ACTOR_ANIMATION_STORAGE(name, capacity) Web64ActorAnimationBatch name; uint16_t name##_bank[capacity]; uint8_t name##_sequence[capacity]; uint8_t name##_queued[capacity]; uint8_t name##_step[capacity]; uint8_t name##_ticks[capacity]; uint8_t name##_frame[capacity]; uint8_t name##_overlay_frame[capacity]; uint8_t name##_events[capacity]; uint8_t name##_status[capacity]; uint8_t name##_direction[capacity] #define WEB64_ACTOR_SPRITE_SET_STORAGE(name, capacity) Web64ActorSpriteSet name; uint8_t name##_kind[capacity]; uint16_t name##_asset[capacity]; uint8_t name##_base_pointer[capacity]; uint8_t name##_overlay_pointer[capacity]; uint16_t name##_frame_count[capacity]; uint8_t name##_base_color[capacity]; uint8_t name##_overlay_color[capacity]; uint8_t name##_multicolor_1[capacity]; uint8_t name##_multicolor_2[capacity]; uint8_t name##_flags[capacity]; uint8_t name##_priority[capacity]; uint8_t name##_base_frame[capacity]; uint8_t name##_overlay_frame[capacity] #define WEB64_ACTOR_VISIBLE_STORAGE(name, capacity) Web64ActorVisibleBuffer name; Web64ActorVisibleEntry name##_entries[capacity] #define WEB64_ACTOR_PAIR_STORAGE(name, actor_capacity, pair_capacity) Web64ActorPairWorkspace name##_workspace; uint8_t name##_sorted_ids[actor_capacity]; Web64ActorPairBuffer name##_pairs; Web64ActorPair name##_pair_entries[pair_capacity] #define WEB64_ACTOR_BOUNDS_STORAGE(name, capacity) Web64ActorBoundsWorkspace name; uint8_t name##_left[capacity]; uint8_t name##_right[capacity]; uint8_t name##_top[capacity]; uint8_t name##_bottom[capacity] #define WEB64_ACTOR_COMMAND_STORAGE(name, capacity) Web64ActorCommandBuffer name; Web64ActorRenderCommand name##_commands[capacity] _web64_rt uint8_t web64_actor_sprite_bind_raw(Web64ActorSpriteSet *sprites, uint8_t actor, uint8_t pointer_base, uint16_t frame_count, uint8_t color, uint8_t flags, uint8_t priority); _web64_rt uint8_t web64_actor_sprite_bind_asset(Web64ActorSpriteSet *sprites, uint8_t actor, const Web64SpriteAsset *asset, uint8_t pointer_base, uint8_t flags, uint8_t priority); _web64_rt uint8_t web64_actor_sprite_bind_asset_pair(Web64ActorSpriteSet *sprites, uint8_t actor, const Web64SpriteOverlayBinding *binding, uint8_t flags, uint8_t priority); _web64_rt void web64_actor_sprite_unbind(Web64ActorSpriteSet *sprites, uint8_t actor); /* _web64_rt uses registry-generated named absolute argument windows; see runtime.inc and actor-batch.inc. */ _web64_rt uint8_t web64_actor_batch_integrate_x(const Web64ActorBatchView *view, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_integrate_x_fast(const Web64ActorBatchView *view, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_integrate_y(const Web64ActorBatchView *view, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_integrate_y_fast(const Web64ActorBatchView *view, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_integrate_xy(const Web64ActorBatchView *view, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_integrate_xy_fast(const Web64ActorBatchView *view, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_animation_tick(const Web64ActorBatchView *view, Web64ActorAnimationBatch *animation, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_animation_tick_fast(const Web64ActorBatchView *view, Web64ActorAnimationBatch *animation, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_cull(const Web64ActorBatchView *view, const Web64ActorViewport *viewport, Web64ActorVisibleBuffer *visible, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_cull_fast(const Web64ActorBatchView *view, const Web64ActorViewport *viewport, Web64ActorVisibleBuffer *visible, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_pairs_x(const Web64ActorBatchView *view, Web64ActorPairWorkspace *workspace, Web64ActorPairBuffer *pairs, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_pairs_x_fast(const Web64ActorBatchView *view, Web64ActorPairWorkspace *workspace, Web64ActorPairBuffer *pairs, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_build_commands(const Web64ActorBatchView *view, const Web64ActorVisibleBuffer *visible, const Web64ActorSpriteSet *sprites, Web64ActorCommandBuffer *commands, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_build_commands_fast(const Web64ActorBatchView *view, const Web64ActorVisibleBuffer *visible, const Web64ActorSpriteSet *sprites, Web64ActorCommandBuffer *commands, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_commands_render_direct(Web64SpriteRenderer *renderer, const Web64ActorCommandBuffer *commands, uint8_t owned_slots, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_commands_render_direct_fast(Web64SpriteRenderer *renderer, const Web64ActorCommandBuffer *commands, uint8_t owned_slots, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_commands_submit_mux(Web64SpriteMultiplexer *mux, const Web64ActorCommandBuffer *commands, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_commands_submit_mux_fast(Web64SpriteMultiplexer *mux, const Web64ActorCommandBuffer *commands, Web64ActorBatchStatus *status); _web64_rt uint8_t web64_actor_batch_run_mux(const Web64ActorMuxPipeline *pipeline); _web64_rt uint8_t web64_actor_batch_run_mux_fast(const Web64ActorMuxPipeline *pipeline); #endif