diff --git a/include/sact.h b/include/sact.h index 6487a5b..3290a3a 100644 --- a/include/sact.h +++ b/include/sact.h @@ -50,7 +50,7 @@ int sact_SP_SetY(int sp_no, int y); int sact_SP_SetZ(int sp, int z); int sact_SP_GetBlendRate(int sp_no); int sact_SP_SetBlendRate(int sp_no, int rate); -int sact_SP_SetShow(int sp_no, bool show); +int sact_SP_SetShow(int sp_no, int show); int sact_SP_SetDrawMethod(int sp_no, int method); int sact_SP_GetDrawMethod(int sp_no); int sact_SP_IsUsing(int sp_no); diff --git a/src/hll/SACT2.c b/src/hll/SACT2.c index ebd4f21..59f37b8 100644 --- a/src/hll/SACT2.c +++ b/src/hll/SACT2.c @@ -361,11 +361,11 @@ int sact_SP_SetBlendRate(int sp_no, int rate) return 1; } -int sact_SP_SetShow(int sp_no, bool show) +int sact_SP_SetShow(int sp_no, int show) { struct sact_sprite *sp = sact_get_sprite(sp_no); if (!sp) return 0; - sprite_set_show(sp, show); + sprite_set_show(sp, !!show); return 1; } diff --git a/src/sprite.c b/src/sprite.c index d86b242..0fb3088 100644 --- a/src/sprite.c +++ b/src/sprite.c @@ -175,6 +175,11 @@ struct texture *sprite_get_texture(struct sact_sprite *sp) return &sp->texture; } +static void _sprite_print(struct sprite *sp) +{ + sprite_print((struct sact_sprite*)sp); +} + void sprite_set_cg(struct sact_sprite *sp, struct cg *cg) { gfx_delete_texture(&sp->texture); @@ -184,6 +189,7 @@ void sprite_set_cg(struct sact_sprite *sp, struct cg *cg) sp->sp.has_pixel = true; sp->sp.has_alpha = cg->metrics.has_alpha; sp->sp.render = sprite_render; + sp->sp.debug_print = _sprite_print; sprite_dirty(sp); } @@ -212,6 +218,7 @@ void sprite_set_cg_2x(struct sact_sprite *sp, struct cg *cg) sp->sp.has_pixel = true; sp->sp.has_alpha = cg->metrics.has_alpha; sp->sp.render = sprite_render; + sp->sp.debug_print = _sprite_print; sprite_dirty(sp); gfx_delete_texture(&tmp); } @@ -263,11 +270,6 @@ int sprite_save_cg(struct sact_sprite *sp, const char *path) return gfx_save_texture(sprite_get_texture(sp), path, ALCG_QNT); } -static void _sprite_print(struct sprite *sp) -{ - sprite_print((struct sact_sprite*)sp); -} - /* * Attach pixel data to a sprite. The texture is initialized lazily. */