Collide sprites with rectangles that are not sprites
Some checks failed
akbasic CI Build / cmake_build (push) Failing after 3m19s
akbasic CI Build / sanitizers (push) Failing after 4m33s
akbasic CI Build / coverage (push) Failing after 3m41s
akbasic CI Build / akgl_build (push) Failing after 21s
akbasic CI Build / mutation_test (push) Failing after 3m29s

`SOLID id, x1, y1, x2, y2` registers static collision geometry; `SOLID id`
retires one and a bare `SOLID` retires them all, the way `TRAP`, `COLLISION` and
`DCLOSE` all read absence. `COLLISION 2` and `BUMP(2)` stop being refused and
mean *sprite met static geometry*.

**This is the thing eight sprite slots made impossible.** A wall of bricks wants
sixty, so until now a program could only collide with one by doing the
arithmetic itself against its own array -- which is exactly what both breakout
listings do, at about two hundred lines between them. A rectangle costs no sprite
slot.

The id is the **program's own number**, 1 to 64, not a minted handle. That is the
whole trick for "which brick did I hit": the id comes back out again, so a wall
built as `SOLID I#, ...` maps onto `B#(I#)` with no lookup, and retiring a broken
brick is `SOLID I#`.

`COLLISION 2` was refused with "sprite-to-background collision needs the screen
read back every frame", which was true of the question a C128 asks -- a sprite
against the bitmap's set pixels. `SOLID` gives this interpreter a background made
of rectangles instead, which is the same question in a form it can answer. Same
move `SPRSAV` made when it learned to take an image path.
`AKBASIC_INTERRUPT_BACKGROUND` has been sitting in the interrupt table commented
"COLLISION 2 -- sprite met background; refused" the whole time. Its accumulator is
separate, so a sprite hitting a wall never sets a bit in `BUMP(1)`.

**There is no `akgl_CollisionWorld` here, and that is deliberate.** libakgl's
uniform grid keeps its cell heads, cell size and origin in file-scope statics, so
it is one index per process -- and `akgl_collision_world_init()` ends in a
`reset()` that memsets those heads *and* calls
`akgl_heap_init_collision_cells()`. An interpreter embedded in a game with its
own collision world would have destroyed every registration that game had made,
on the first `SOLID` a script ran. So the geometry is indexed by an ordinary
array here and pairs go straight to `akgl_collision_test()`, which needs no
world. At sixty-four rectangles that is the right answer anyway; libakgl's own
numbers put a naive sweep at 0.7% of a frame at sixty-four objects.

**The scan now short-circuits when nothing has moved**, and that is what makes
any of it affordable. Its inputs are the sprites' boxes, which slots are
collidable, and the static geometry; if none changed the answer cannot have. A
frame runs one full scan and 255 cached ones. Eight sprites against sixty-four
rectangles is five hundred and twelve tests -- fine once a frame, ruinous 256
times.

The benchmark was rewritten to say which path it is timing, because with the
cache in place a loop that only calls the scan measures the short circuit and
nothing else. Breakout now costs 590.6 ns for its one full scan plus 255 cached
at 40.0, which is 10.8 us against a 1.19 ms frame -- **0.91%, less than the 2.0%
it cost before any of this work**, with static geometry and contacts added on
top.

`NEW` retires the rectangles, where it cannot undefine a sprite pattern: there
*is* an entry point for this one, so leaving them would be a choice, and the
wrong one -- a rectangle is invisible, so one left behind by a deleted program is
an unexplainable collision in the next. `CLR` leaves them alone.

`tests/sprite_verbs.c` gains the whole second path against the mock and its
`COLLISION 2` case is rewritten: it pinned the refusal, and now pins that type 2
arms its own handler without disturbing type 1's. `tests/akgl_backends.c` gains
the end-to-end version, including a full sixty-four-rectangle wall so the proxy
budget is exercised at its ceiling and the pool has to come back intact, and the
sixty-fifth refused by name.

A bare `SOLID` needed `akbasic_parse_optional_arglist` rather than
`akbasic_parse_arglist`, which `DCLOSE` already uses for the same shape.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01EwxGB6TdoVvZ11KQQME9cL
This commit is contained in:
2026-08-02 10:25:35 -04:00
parent f005b88980
commit 802bbcc17a
15 changed files with 764 additions and 52 deletions

View File

@@ -123,6 +123,18 @@ akerr_ErrorContext *akbasic_cmd_new(akbasic_Runtime *obj, akbasic_ASTLeaf *expr,
PASS(errctx, obj->sprites->show(obj->sprites, (int)i + 1, false));
}
}
/*
* **Static geometry does go back to the device**, where a sprite pattern
* cannot. There is an entry point that retires one, so leaving them would be
* a choice rather than a limitation -- and the wrong choice: a wall is
* invisible, so one left behind by a deleted program is an unexplainable
* collision in the next.
*/
if ( obj->sprites != NULL && obj->sprites->solid != NULL ) {
for ( i = 0; i < AKBASIC_MAX_SOLIDS; i++ ) {
PASS(errctx, obj->sprites->solid(obj->sprites, (int)i + 1, false, 0.0, 0.0, 0.0, 0.0));
}
}
/*
* The line counter goes home too. Without this a NEW typed at the REPL

View File

@@ -498,6 +498,7 @@ akerr_ErrorContext *akbasic_cmd_collision(akbasic_Runtime *obj, akbasic_ASTLeaf
akbasic_ASTLeaf *handler = NULL;
akbasic_Value *value = NULL;
int type = 0;
int source = AKBASIC_INTERRUPT_SPRITE;
(void)lval; (void)rval;
FAIL_ZERO_RETURN(errctx, (obj != NULL && dest != NULL), AKERR_NULLPOINTER,
@@ -513,22 +514,23 @@ akerr_ErrorContext *akbasic_cmd_collision(akbasic_Runtime *obj, akbasic_ASTLeaf
FAIL_ZERO_RETURN(errctx, (type >= 1 && type <= 3), AKBASIC_ERR_BOUNDS,
"COLLISION: type %d is outside 1..3", type);
/*
* Type 1 only. Sprite-to-background would need the whole render target read
* back and compared against each sprite every frame, and a light pen has no
* meaning on a machine with no light pen; both are refused by name rather
* than silently accepted and never fired. TODO.md section 5.
* Types 1 and 2 both exist now. A C128's type 2 is a sprite against the set
* pixels of the bitmap screen, which was refused here because reading the
* render target back every frame is not affordable -- but SOLID gives this
* interpreter a background made of rectangles instead of pixels, and that is
* the same question asked in a form it can answer. The same move SPRSAV made
* when it learned to take an image path.
*
* Type 3 stays refused. There is still no light pen.
*/
FAIL_ZERO_RETURN(errctx, (type == 1), AKBASIC_ERR_DEVICE,
"COLLISION type %d is not implemented: %s",
type,
(type == 2
? "sprite-to-background collision needs the screen read back every frame"
: "there is no light pen"));
FAIL_ZERO_RETURN(errctx, (type == 1 || type == 2), AKBASIC_ERR_DEVICE,
"COLLISION type %d is not implemented: there is no light pen", type);
source = (type == 2 ? AKBASIC_INTERRUPT_BACKGROUND : AKBASIC_INTERRUPT_SPRITE);
handler = arg->next;
if ( handler == NULL ) {
/* No target disarms it, which is how a C128 turns a handler off. */
PASS(errctx, akbasic_runtime_disarm_interrupt(obj, AKBASIC_INTERRUPT_SPRITE));
PASS(errctx, akbasic_runtime_disarm_interrupt(obj, source));
SUCCEED_TRUE(obj, dest);
SUCCEED_RETURN(errctx);
}
@@ -544,7 +546,7 @@ akerr_ErrorContext *akbasic_cmd_collision(akbasic_Runtime *obj, akbasic_ASTLeaf
*/
if ( handler->leaftype == AKBASIC_LEAF_IDENTIFIER &&
akbasic_leaf_first_subscript(handler) == NULL ) {
PASS(errctx, akbasic_runtime_arm_interrupt(obj, AKBASIC_INTERRUPT_SPRITE,
PASS(errctx, akbasic_runtime_arm_interrupt(obj, source,
0, handler->identifier));
SUCCEED_TRUE(obj, dest);
SUCCEED_RETURN(errctx);
@@ -553,7 +555,7 @@ akerr_ErrorContext *akbasic_cmd_collision(akbasic_Runtime *obj, akbasic_ASTLeaf
PASS(errctx, akbasic_runtime_evaluate(obj, handler, &value));
FAIL_NONZERO_RETURN(errctx, (value->valuetype == AKBASIC_TYPE_STRING), AKBASIC_ERR_TYPE,
"COLLISION expected a line number or a label");
PASS(errctx, akbasic_runtime_arm_interrupt(obj, AKBASIC_INTERRUPT_SPRITE,
PASS(errctx, akbasic_runtime_arm_interrupt(obj, source,
value->intval, NULL));
SUCCEED_TRUE(obj, dest);
SUCCEED_RETURN(errctx);
@@ -563,6 +565,7 @@ akerr_ErrorContext *akbasic_collision_service(akbasic_Runtime *obj)
{
PREPARE_ERROR(errctx);
uint16_t mask = 0;
uint16_t solidmask = 0;
FAIL_ZERO_RETURN(errctx, (obj != NULL), AKERR_NULLPOINTER,
"NULL runtime in collision_service");
@@ -570,6 +573,19 @@ akerr_ErrorContext *akbasic_collision_service(akbasic_Runtime *obj)
SUCCEED_RETURN(errctx);
}
PASS(errctx, obj->sprites->collisions(obj->sprites, &mask));
/*
* Static geometry is a second question with a second accumulator and a
* second handler, answered from the same scan the device just ran. A backend
* that cannot do it withholds the entry point and reports nothing, the same
* way a runtime with no backend at all does.
*/
if ( obj->sprites->solids != NULL ) {
PASS(errctx, obj->sprites->solids(obj->sprites, &solidmask));
}
if ( solidmask != 0 ) {
obj->sprite_state.bumpedsolid |= solidmask;
PASS(errctx, akbasic_runtime_raise_interrupt(obj, AKBASIC_INTERRUPT_BACKGROUND));
}
if ( mask == 0 ) {
SUCCEED_RETURN(errctx);
}
@@ -644,8 +660,8 @@ akerr_ErrorContext *akbasic_fn_bump(akbasic_Runtime *obj, akbasic_ASTLeaf *expr,
FAIL_ZERO_RETURN(errctx, (obj != NULL && dest != NULL), AKERR_NULLPOINTER,
"NULL argument in BUMP");
PASS(errctx, nth_number(obj, expr, "BUMP", 0, &type));
FAIL_ZERO_RETURN(errctx, (type == 1), AKBASIC_ERR_DEVICE,
"BUMP type %" PRId64 " is not implemented; only sprite-to-sprite collision is",
FAIL_ZERO_RETURN(errctx, (type == 1 || type == 2), AKBASIC_ERR_DEVICE,
"BUMP type %" PRId64 " is not implemented; sprite-to-sprite is 1 and static geometry is 2",
type);
/*
@@ -653,8 +669,13 @@ akerr_ErrorContext *akbasic_fn_bump(akbasic_Runtime *obj, akbasic_ASTLeaf *expr,
* answerable at all: without it a program that polls in a loop would see the
* same collision forever.
*/
reported = obj->sprite_state.bumped;
obj->sprite_state.bumped = 0;
if ( type == 2 ) {
reported = obj->sprite_state.bumpedsolid;
obj->sprite_state.bumpedsolid = 0;
} else {
reported = obj->sprite_state.bumped;
obj->sprite_state.bumped = 0;
}
PASS(errctx, integer_result(obj, (int64_t)reported, dest));
SUCCEED_RETURN(errctx);
}
@@ -706,6 +727,68 @@ static akerr_ErrorContext *float_result(akbasic_Runtime *obj, double value, akba
SUCCEED_RETURN(errctx);
}
/* ----------------------------------------------------------------- SOLID -- */
akerr_ErrorContext *akbasic_cmd_solid(akbasic_Runtime *obj, akbasic_ASTLeaf *expr, akbasic_Value *lval, akbasic_Value *rval, akbasic_Value **dest)
{
PREPARE_ERROR(errctx);
akbasic_Solid *solid = NULL;
double args[5];
int count = 0;
int id = 0;
int i = 0;
(void)lval; (void)rval;
FAIL_ZERO_RETURN(errctx, (obj != NULL && dest != NULL), AKERR_NULLPOINTER,
"NULL argument in SOLID");
PASS(errctx, require_sprites(obj, "SOLID"));
FAIL_ZERO_RETURN(errctx, (obj->sprites->solid != NULL), AKBASIC_ERR_DEVICE,
"SOLID needs a sprite device that can carry static collision geometry, and this one cannot");
PASS(errctx, akbasic_args_numbers(obj, expr, "SOLID", args, 5, &count));
FAIL_ZERO_RETURN(errctx, (count == 0 || count == 1 || count == 5), AKBASIC_ERR_SYNTAX,
"SOLID takes nothing, an id, or an id and four corners, not %d arguments",
count);
/*
* No arguments clears the lot, which is how `TRAP`, `COLLISION` and `DCLOSE`
* all read absence -- and is the verb a level change wants.
*/
if ( count == 0 ) {
for ( i = 0; i < AKBASIC_MAX_SOLIDS; i++ ) {
if ( !obj->sprite_state.solids[i].active ) {
continue;
}
memset(&obj->sprite_state.solids[i], 0, sizeof(obj->sprite_state.solids[i]));
/* PASS rather than CATCH: this is a loop. */
PASS(errctx, obj->sprites->solid(obj->sprites, i + 1, false, 0.0, 0.0, 0.0, 0.0));
}
SUCCEED_RETURN(errctx);
}
id = (int)args[0];
FAIL_ZERO_RETURN(errctx, (id >= 1 && id <= AKBASIC_MAX_SOLIDS), AKBASIC_ERR_BOUNDS,
"SOLID: %d is outside 1..%d", id, AKBASIC_MAX_SOLIDS);
solid = &obj->sprite_state.solids[id - 1];
if ( count == 1 ) {
memset(solid, 0, sizeof(*solid));
PASS(errctx, obj->sprites->solid(obj->sprites, id, false, 0.0, 0.0, 0.0, 0.0));
SUCCEED_RETURN(errctx);
}
FAIL_ZERO_RETURN(errctx, (args[3] > args[1] && args[4] > args[2]), AKBASIC_ERR_VALUE,
"SOLID: (%g, %g) to (%g, %g) is not a rectangle with a positive width and height",
args[1], args[2], args[3], args[4]);
solid->active = true;
solid->x1 = args[1];
solid->y1 = args[2];
solid->x2 = args[3];
solid->y2 = args[4];
PASS(errctx, obj->sprites->solid(obj->sprites, id, true,
solid->x1, solid->y1, solid->x2, solid->y2));
SUCCEED_RETURN(errctx);
}
/* ---------------------------------------------------------------- SPRHIT -- */
akerr_ErrorContext *akbasic_cmd_sprhit(akbasic_Runtime *obj, akbasic_ASTLeaf *expr, akbasic_Value *lval, akbasic_Value *rval, akbasic_Value **dest)

View File

@@ -625,10 +625,18 @@ static akerr_ErrorContext AKERR_NOIGNORE *sync_proxy(akbasic_AkglSprites *state,
SUCCEED_RETURN(errctx);
}
static akerr_ErrorContext *spr_collisions(akbasic_SpriteBackend *self, uint16_t *mask)
/**
* @brief Run the scan if anything has changed, and leave both masks on the state.
*
* One worker behind two entry points, because both masks come out of the same
* pass and computing them separately would be computing the sprite boxes twice
* for one answer. `spr_collisions()` reports the sprite-against-sprite mask and
* `spr_solids()` the sprite-against-static one; either may be called first, and
* the cache below is what makes that true rather than merely usually true.
*/
static akerr_ErrorContext AKERR_NOIGNORE *run_scan(akbasic_AkglSprites *state)
{
PREPARE_ERROR(errctx);
akbasic_AkglSprites *state = NULL;
akgl_Contact contact;
SDL_FRect box[AKBASIC_MAX_SPRITES];
bool live[AKBASIC_MAX_SPRITES];
@@ -637,19 +645,52 @@ static akerr_ErrorContext *spr_collisions(akbasic_SpriteBackend *self, uint16_t
int i = 0;
int j = 0;
PASS(errctx, state_of(self, &state));
FAIL_ZERO_RETURN(errctx, (mask != NULL), AKERR_NULLPOINTER, "NULL mask in collisions");
*mask = 0;
for ( i = 0; i < AKBASIC_MAX_SPRITES; i++ ) {
live[i] = slot_collidable(state, i);
synced[i] = false;
memset(&box[i], 0, sizeof(box[i]));
if ( !live[i] ) {
continue;
}
collision_box(state, i, &box[i]);
}
/*
* **Nothing moved, so nothing can have changed.**
*
* The scan's inputs are exactly these boxes and which slots are collidable;
* static geometry invalidates the cache where it is registered. So if all
* eight match what the last scan saw, the answer is the answer it gave, and
* eight rectangle comparisons are far cheaper than recomputing it.
*
* This is what makes static geometry affordable. The scan runs at the top of
* every interpreter step -- up to 256 times a rendered frame -- and eight
* sprites against sixty-four rectangles is five hundred and twelve tests.
* That is fine once a frame and ruinous 256 times, and a sprite moves at
* most once in that window.
*
* It changes nothing a program can observe: the same mask comes back, so
* BUMP accumulates the same bits and the interrupt is raised on the same
* steps.
*/
if ( state->lastvalid ) {
bool same = true;
for ( i = 0; i < AKBASIC_MAX_SPRITES; i++ ) {
if ( live[i] != state->lastlive[i]
|| box[i].x != state->lastbox[i].x || box[i].y != state->lastbox[i].y
|| box[i].w != state->lastbox[i].w || box[i].h != state->lastbox[i].h ) {
same = false;
break;
}
}
if ( same ) {
SUCCEED_RETURN(errctx);
}
}
state->lastmask = 0;
state->lastsolidmask = 0;
/*
* **Two phases, and the split is the whole performance story.**
*
@@ -713,11 +754,143 @@ static akerr_ErrorContext *spr_collisions(akbasic_SpriteBackend *self, uint16_t
PASS(errctx, akgl_collision_test(state->proxies[i], state->proxies[j],
AKGL_COLLISION_TEST_PLANAR, &contact, &hit));
if ( hit ) {
*mask |= (uint16_t)(1u << i);
*mask |= (uint16_t)(1u << j);
state->lastmask |= (uint16_t)(1u << i);
state->lastmask |= (uint16_t)(1u << j);
}
}
}
/*
* Every live sprite against every registered rectangle, same shape: reject
* on the boxes, and only then ask the library. A wall is motionless, so its
* proxy was synced when SOLID registered it and there is nothing to refresh
* here.
*/
for ( i = 0; i < AKBASIC_MAX_SPRITES; i++ ) {
if ( !live[i] ) {
continue;
}
for ( j = 0; j < AKBASIC_MAX_SOLIDS; j++ ) {
if ( !state->solidactive[j] ) {
continue;
}
if ( !(box[i].x < state->solidbox[j].x + state->solidbox[j].w
&& state->solidbox[j].x < box[i].x + box[i].w
&& box[i].y < state->solidbox[j].y + state->solidbox[j].h
&& state->solidbox[j].y < box[i].y + box[i].h) ) {
continue;
}
if ( !synced[i] ) {
PASS(errctx, sync_proxy(state, i, &box[i]));
synced[i] = true;
}
hit = false;
PASS(errctx, akgl_collision_test(state->proxies[i], state->solidproxies[j],
AKGL_COLLISION_TEST_PLANAR, &contact, &hit));
if ( hit ) {
state->lastsolidmask |= (uint16_t)(1u << i);
}
}
}
for ( i = 0; i < AKBASIC_MAX_SPRITES; i++ ) {
state->lastbox[i] = box[i];
state->lastlive[i] = live[i];
}
state->lastvalid = true;
SUCCEED_RETURN(errctx);
}
/**
* @brief Register, replace or retire static rectangle @p id.
*
* A proxy with a **NULL owner**: there is no actor behind a wall, and libakgl's
* proxy carries the owner only so a resolver can push something. Nothing here
* resolves anything, so the field stays empty and the shape is what matters.
*
* Layers are the other half. A wall sits on #AKGL_COLLISION_LAYER_STATIC and
* responds to nothing, which is the asymmetry libakgl's masks exist for: the
* sprite's own `collidemask` includes STATIC, so a sprite finds a wall and two
* walls never test against each other. Sixty-four motionless rectangles
* therefore cost nothing per scan beyond the boxes a sprite is compared to.
*/
static akerr_ErrorContext *spr_solid(akbasic_SpriteBackend *self, int id, bool define,
double x1, double y1, double x2, double y2)
{
PREPARE_ERROR(errctx);
akbasic_AkglSprites *state = NULL;
SDL_FRect body;
int i = 0;
PASS(errctx, state_of(self, &state));
FAIL_ZERO_RETURN(errctx, (id >= 1 && id <= AKBASIC_MAX_SOLIDS), AKBASIC_ERR_BOUNDS,
"Static shape %d is outside 1..%d", id, AKBASIC_MAX_SOLIDS);
i = id - 1;
/*
* Anything that changes the geometry invalidates the cached answer. Cheapest
* possible correctness: the scan's own change detection watches the sprites,
* and this is the one input it cannot see moving.
*/
state->lastvalid = false;
if ( !define ) {
if ( state->solidproxies[i] != NULL ) {
PASS(errctx, akgl_heap_release_collision_proxy(state->solidproxies[i]));
state->solidproxies[i] = NULL;
}
state->solidactive[i] = false;
SUCCEED_RETURN(errctx);
}
body.x = 0.0f;
body.y = 0.0f;
body.w = (float32_t)(x2 - x1);
body.h = (float32_t)(y2 - y1);
PASS(errctx, akgl_collision_shape_box(&state->solidshapes[i], &body, 0.0f));
state->solidshapes[i].flags |= AKGL_COLLISION_FLAG_STATIC;
state->solidshapes[i].layermask = AKGL_COLLISION_LAYER_STATIC;
state->solidshapes[i].collidemask = AKGL_COLLISION_LAYER_NONE;
if ( state->solidproxies[i] == NULL ) {
/* Adjacent, with nothing between: the slot is free until initialize takes it. */
PASS(errctx, akgl_heap_next_collision_proxy(&state->solidproxies[i]));
PASS(errctx, akgl_collision_proxy_initialize(state->solidproxies[i], NULL,
&state->solidshapes[i],
(float32_t)x1, (float32_t)y1, 0.0f));
} else {
PASS(errctx, akgl_collision_proxy_sync(state->solidproxies[i], &state->solidshapes[i],
(float32_t)x1, (float32_t)y1, 0.0f));
}
state->solidbox[i].x = (float32_t)x1;
state->solidbox[i].y = (float32_t)y1;
state->solidbox[i].w = body.w;
state->solidbox[i].h = body.h;
state->solidactive[i] = true;
SUCCEED_RETURN(errctx);
}
static akerr_ErrorContext *spr_collisions(akbasic_SpriteBackend *self, uint16_t *mask)
{
PREPARE_ERROR(errctx);
akbasic_AkglSprites *state = NULL;
PASS(errctx, state_of(self, &state));
FAIL_ZERO_RETURN(errctx, (mask != NULL), AKERR_NULLPOINTER, "NULL mask in collisions");
PASS(errctx, run_scan(state));
*mask = state->lastmask;
SUCCEED_RETURN(errctx);
}
static akerr_ErrorContext *spr_solids(akbasic_SpriteBackend *self, uint16_t *mask)
{
PREPARE_ERROR(errctx);
akbasic_AkglSprites *state = NULL;
PASS(errctx, state_of(self, &state));
FAIL_ZERO_RETURN(errctx, (mask != NULL), AKERR_NULLPOINTER, "NULL mask in solids");
PASS(errctx, run_scan(state));
*mask = state->lastsolidmask;
SUCCEED_RETURN(errctx);
}
@@ -784,6 +957,8 @@ akerr_ErrorContext *akbasic_sprite_init_akgl(akbasic_SpriteBackend *obj, akbasic
obj->shared_colors = spr_shared_colors;
obj->collisions = spr_collisions;
obj->shape = spr_shape;
obj->solid = spr_solid;
obj->solids = spr_solids;
SUCCEED_RETURN(errctx);
}
@@ -831,4 +1006,10 @@ void akbasic_sprite_akgl_shutdown(akbasic_SpriteBackend *obj)
state->proxies[i] = NULL;
}
}
for ( i = 0; i < AKBASIC_MAX_SOLIDS; i++ ) {
if ( state->solidproxies[i] != NULL ) {
IGNORE(akgl_heap_release_collision_proxy(state->solidproxies[i]));
state->solidproxies[i] = NULL;
}
}
}

View File

@@ -154,6 +154,7 @@ static const akbasic_Verb VERBS[] = {
{ "SHR", AKBASIC_TOK_FUNCTION, 2, NULL, akbasic_fn_shr },
{ "SIN", AKBASIC_TOK_FUNCTION, 1, NULL, akbasic_fn_sin },
{ "SLEEP", AKBASIC_TOK_COMMAND, -1, akbasic_parse_arglist, akbasic_cmd_sleep },
{ "SOLID", AKBASIC_TOK_COMMAND, -1, akbasic_parse_optional_arglist, akbasic_cmd_solid },
{ "SOUND", AKBASIC_TOK_COMMAND, -1, akbasic_parse_arglist, akbasic_cmd_sound },
{ "SPC", AKBASIC_TOK_FUNCTION, 1, NULL, akbasic_fn_spc },
{ "SPRCOLOR", AKBASIC_TOK_COMMAND, -1, akbasic_parse_arglist, akbasic_cmd_sprcolor },

View File

@@ -90,6 +90,7 @@ akerr_ErrorContext AKERR_NOIGNORE *akbasic_cmd_on(struct akbasic_Runtime *obj, a
akerr_ErrorContext AKERR_NOIGNORE *akbasic_cmd_collision(struct akbasic_Runtime *obj, akbasic_ASTLeaf *expr, akbasic_Value *lval, akbasic_Value *rval, akbasic_Value **dest);
akerr_ErrorContext AKERR_NOIGNORE *akbasic_cmd_movspr(struct akbasic_Runtime *obj, akbasic_ASTLeaf *expr, akbasic_Value *lval, akbasic_Value *rval, akbasic_Value **dest);
akerr_ErrorContext AKERR_NOIGNORE *akbasic_cmd_sprcolor(struct akbasic_Runtime *obj, akbasic_ASTLeaf *expr, akbasic_Value *lval, akbasic_Value *rval, akbasic_Value **dest);
akerr_ErrorContext AKERR_NOIGNORE *akbasic_cmd_solid(struct akbasic_Runtime *obj, akbasic_ASTLeaf *expr, akbasic_Value *lval, akbasic_Value *rval, akbasic_Value **dest);
akerr_ErrorContext AKERR_NOIGNORE *akbasic_cmd_sprhit(struct akbasic_Runtime *obj, akbasic_ASTLeaf *expr, akbasic_Value *lval, akbasic_Value *rval, akbasic_Value **dest);
akerr_ErrorContext AKERR_NOIGNORE *akbasic_cmd_sprite(struct akbasic_Runtime *obj, akbasic_ASTLeaf *expr, akbasic_Value *lval, akbasic_Value *rval, akbasic_Value **dest);
akerr_ErrorContext AKERR_NOIGNORE *akbasic_cmd_sprsav(struct akbasic_Runtime *obj, akbasic_ASTLeaf *expr, akbasic_Value *lval, akbasic_Value *rval, akbasic_Value **dest);