mirror of
https://github.com/nunuhara/xsystem4.git
synced 2026-10-01 19:38:06 +03:00
SACT2: allow SP_Create with unallocated sprite nr
MangaGamer version of Sengoku Rance does this.
This commit is contained in:
+4
-1
@@ -248,8 +248,11 @@ int sact_SP_SetCG(int sp_no, int cg_no)
|
||||
static struct sact_sprite *create_sprite(int sp_no, int width, int height, int r, int g, int b, int a)
|
||||
{
|
||||
struct sact_sprite *sp;
|
||||
if (sp_no < 0 || sp_no >= nr_sprites)
|
||||
if (sp_no < 0)
|
||||
VM_ERROR("Invalid sprite number: %d", sp_no);
|
||||
if (sp_no >= nr_sprites) {
|
||||
realloc_sprite_table(sp_no+256);
|
||||
}
|
||||
if (!(sp = sact_get_sprite(sp_no)))
|
||||
sp = alloc_sprite(sp_no);
|
||||
sp->color = (SDL_Color) { .r = r, .g = g, .b = b, .a = (a >= 0 ? a : 255) };
|
||||
|
||||
Reference in New Issue
Block a user