2021-04-13 09:47:52 +02:00
|
|
|
#include "common.h"
|
2021-12-30 06:14:55 +01:00
|
|
|
#include "sprite.h"
|
2022-07-08 14:57:08 +02:00
|
|
|
#include "nu/nusys.h"
|
2022-10-18 13:43:04 +02:00
|
|
|
#include "ld_addrs.h"
|
2023-06-26 12:27:37 +02:00
|
|
|
#include "sprite/player.h"
|
2022-07-08 14:57:08 +02:00
|
|
|
|
2022-10-18 13:43:04 +02:00
|
|
|
#ifdef SHIFT
|
2023-06-27 01:00:12 +02:00
|
|
|
#define SPRITE_ROM_START (u32) sprites_ROM_START + 0x10
|
2023-11-20 16:22:26 +01:00
|
|
|
#elif VERSION_US || VERSION_IQUE
|
2022-07-08 14:57:08 +02:00
|
|
|
#define SPRITE_ROM_START 0x1943000 + 0x10
|
2023-07-24 20:07:47 +02:00
|
|
|
#elif VERSION_PAL
|
|
|
|
#define SPRITE_ROM_START 0x1DF0000 + 0x10
|
2024-01-16 06:13:54 +01:00
|
|
|
#elif VERSION_JP
|
|
|
|
#define SPRITE_ROM_START 0x1A40000 + 0x10
|
2022-10-18 13:43:04 +02:00
|
|
|
#endif
|
2021-12-30 06:14:55 +01:00
|
|
|
|
2022-08-10 17:29:06 +02:00
|
|
|
extern s32 spr_allocateBtlComponentsOnWorldHeap;
|
2023-02-14 14:14:14 +01:00
|
|
|
extern HeapNode heap_generalHead;
|
|
|
|
extern HeapNode heap_spriteHead;
|
2022-09-17 21:10:37 +02:00
|
|
|
|
2023-01-03 16:57:48 +01:00
|
|
|
BSS s32 spr_asset_entry[2];
|
2023-04-29 09:19:30 +02:00
|
|
|
BSS s32 PlayerRasterLoadDescBuffer[101]; //NOTE: maximum rasters supported for a single player sprite is 101
|
|
|
|
BSS s32 PlayerRasterLoadDescNumLoaded;
|
|
|
|
BSS s32 PlayerRasterLoadDescBeginSpriteIndex[SPR_Peach3]; //TODO size linked to number of player sprites
|
2022-09-17 21:10:37 +02:00
|
|
|
BSS s32 D_802D0084[3]; // unused?
|
2023-04-29 09:19:30 +02:00
|
|
|
BSS s32 PlayerRasterLoadDesc[0x2E0]; // correct length?
|
2022-09-17 21:10:37 +02:00
|
|
|
|
2023-04-29 09:19:30 +02:00
|
|
|
BSS PlayerRastersHeader PlayerRasterHeader;
|
|
|
|
BSS s32 D_802E0C1C; // unused
|
|
|
|
BSS s32 PlayerSpriteRasterSets[SPR_Peach3 + 1]; //TODO size linked to number of player sprites
|
2022-09-17 21:10:37 +02:00
|
|
|
BSS s32 PlayerRasterCacheSize;
|
|
|
|
BSS s32 PlayerRasterMaxSize;
|
2023-01-03 16:57:48 +01:00
|
|
|
BSS s32 SpriteDataHeader[3];
|
2022-09-17 21:10:37 +02:00
|
|
|
BSS s32 D_802E0C6C; // unused?
|
|
|
|
BSS PlayerSpriteCacheEntry PlayerRasterCache[18];
|
2021-12-13 10:27:28 +01:00
|
|
|
|
2022-09-24 11:04:13 +02:00
|
|
|
#define ALIGN4(v) (((u32)(v) >> 2) << 2)
|
|
|
|
#define SPR_SWIZZLE(base,offset) ((void*)((s32)(offset) + (s32)(base)))
|
|
|
|
|
|
|
|
void spr_swizzle_anim_offsets(s32 arg0, s32 base, void* spriteData) {
|
|
|
|
u8* buffer;
|
|
|
|
SpriteAnimComponent*** animList;
|
|
|
|
SpriteAnimComponent** compList;
|
|
|
|
SpriteAnimComponent* comp;
|
|
|
|
s32 animOffset;
|
|
|
|
s32 compOffset;
|
|
|
|
s32 temp;
|
2022-10-04 16:09:23 +02:00
|
|
|
|
2022-09-24 11:04:13 +02:00
|
|
|
// required to match, spriteData->animList would be nicer
|
|
|
|
animList = (SpriteAnimComponent***) spriteData;
|
|
|
|
animList += 4;
|
2022-10-04 16:09:23 +02:00
|
|
|
|
2022-09-24 11:04:13 +02:00
|
|
|
while (TRUE) {
|
|
|
|
if (*animList == PTR_LIST_END) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
compList = (SpriteAnimComponent**) ((s32)*animList - ALIGN4(base));
|
|
|
|
compList = SPR_SWIZZLE(ALIGN4(spriteData), compList);
|
|
|
|
*animList = compList;
|
|
|
|
while (TRUE) {
|
|
|
|
if (*compList == PTR_LIST_END) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
*compList = comp = SPR_SWIZZLE(ALIGN4(spriteData), (s32)*compList - ALIGN4(base));
|
|
|
|
comp->cmdList = SPR_SWIZZLE(ALIGN4(spriteData), (s32)comp->cmdList - ALIGN4(base));
|
|
|
|
compList++;
|
|
|
|
}
|
|
|
|
animList++;
|
|
|
|
}
|
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2023-01-03 16:57:48 +01:00
|
|
|
SpriteAnimData* spr_load_sprite(s32 idx, s32 isPlayerSprite, s32 useTailAlloc) {
|
2022-08-10 17:29:06 +02:00
|
|
|
SpriteAnimData* animData;
|
|
|
|
s32 base;
|
|
|
|
s32 i;
|
2023-01-03 16:57:48 +01:00
|
|
|
s32 compressedSize;
|
|
|
|
s32* ptr1;
|
|
|
|
IMG_PTR image;
|
|
|
|
s32 count;
|
|
|
|
s32** data;
|
|
|
|
s32** palettes;
|
|
|
|
|
|
|
|
if (isPlayerSprite) {
|
|
|
|
base = SpriteDataHeader[1];
|
2022-08-10 17:29:06 +02:00
|
|
|
} else {
|
2023-01-03 16:57:48 +01:00
|
|
|
base = SpriteDataHeader[2];
|
2022-08-10 17:29:06 +02:00
|
|
|
}
|
|
|
|
|
2023-01-03 16:57:48 +01:00
|
|
|
// read current and next sprite offsets, so we can find the difference
|
|
|
|
nuPiReadRom(base + idx * 4, &spr_asset_entry, sizeof(spr_asset_entry));
|
|
|
|
|
|
|
|
compressedSize = ALIGN8(spr_asset_entry[1] - spr_asset_entry[0]);
|
|
|
|
data = general_heap_malloc(compressedSize);
|
|
|
|
nuPiReadRom(base + spr_asset_entry[0], data, compressedSize);
|
|
|
|
|
|
|
|
ptr1 = (s32*)data;
|
|
|
|
// skip 4 bytes: 'YAY0' signature
|
|
|
|
ptr1++;
|
2022-08-10 17:29:06 +02:00
|
|
|
|
2023-01-03 16:57:48 +01:00
|
|
|
if (useTailAlloc) {
|
2023-02-14 14:14:14 +01:00
|
|
|
animData = _heap_malloc_tail(&heap_spriteHead, *ptr1);
|
2022-08-10 17:29:06 +02:00
|
|
|
} else {
|
2023-02-14 14:14:14 +01:00
|
|
|
animData = _heap_malloc(&heap_spriteHead, *ptr1);
|
2022-08-10 17:29:06 +02:00
|
|
|
}
|
2023-01-03 16:57:48 +01:00
|
|
|
decode_yay0(data, animData);
|
|
|
|
general_heap_free(data);
|
2022-08-10 17:29:06 +02:00
|
|
|
|
2023-01-03 16:57:48 +01:00
|
|
|
// swizzle raster array
|
|
|
|
data = (s32**)animData->rastersOffset;
|
|
|
|
data = SPR_SWIZZLE(ALIGN4(animData), data);
|
|
|
|
animData->rastersOffset = (SpriteRasterCacheEntry**)data;
|
2022-08-10 17:29:06 +02:00
|
|
|
|
2023-01-03 16:57:48 +01:00
|
|
|
while (TRUE) {
|
|
|
|
ptr1 = *data;
|
|
|
|
if (ptr1 == PTR_LIST_END) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
// swizzle each raster cache entry
|
|
|
|
ptr1 = SPR_SWIZZLE(ALIGN4(animData), ptr1);
|
|
|
|
*data++ = ptr1;
|
|
|
|
image = ((SpriteRasterCacheEntry*)ptr1)->image;
|
|
|
|
|
|
|
|
if (!isPlayerSprite) {
|
|
|
|
// swizzle image pointer in the cache entry
|
|
|
|
image = SPR_SWIZZLE(ALIGN4(animData), image);
|
|
|
|
*ptr1 = (s32)image;
|
2022-08-10 17:29:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-03 16:57:48 +01:00
|
|
|
if (isPlayerSprite) {
|
2023-04-29 09:19:30 +02:00
|
|
|
PlayerRasterLoadDescBeginSpriteIndex[idx] = PlayerRasterLoadDescNumLoaded;
|
|
|
|
count = PlayerSpriteRasterSets[idx + 1] - PlayerSpriteRasterSets[idx];
|
|
|
|
// load a range of raster loading desciptors to a buffer and copy contents into PlayerRasterLoadDesc
|
|
|
|
nuPiReadRom(SpriteDataHeader[0] + PlayerRasterHeader.loadDescriptors + sizeof(u32) * PlayerSpriteRasterSets[idx],
|
|
|
|
PlayerRasterLoadDescBuffer, sizeof(PlayerRasterLoadDescBuffer));
|
2023-01-03 16:57:48 +01:00
|
|
|
for (i = 0; i < count; i++) {
|
2023-04-29 09:19:30 +02:00
|
|
|
PlayerRasterLoadDesc[PlayerRasterLoadDescNumLoaded++] = PlayerRasterLoadDescBuffer[i];
|
2022-08-10 17:29:06 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-01-03 16:57:48 +01:00
|
|
|
// swizzle palettes array
|
|
|
|
palettes = SPR_SWIZZLE(ALIGN4(animData), animData->palettesOffset);
|
|
|
|
animData->palettesOffset = (PAL_PTR*)palettes;
|
|
|
|
while (TRUE) {
|
|
|
|
ptr1 = *palettes;
|
|
|
|
if (ptr1 == PTR_LIST_END) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
// swizzle each palette pointer
|
|
|
|
ptr1 = SPR_SWIZZLE(ALIGN4(animData), ptr1);
|
|
|
|
*palettes++ = ptr1;
|
2022-08-10 17:29:06 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
spr_swizzle_anim_offsets(0, 0, animData);
|
|
|
|
return animData;
|
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2022-07-08 14:57:08 +02:00
|
|
|
void spr_init_player_raster_cache(s32 cacheSize, s32 maxRasterSize) {
|
2022-08-10 15:36:38 +02:00
|
|
|
void* raster;
|
2022-07-08 14:57:08 +02:00
|
|
|
s32 i;
|
|
|
|
|
2023-01-03 16:57:48 +01:00
|
|
|
nuPiReadRom(SPRITE_ROM_START, &SpriteDataHeader, sizeof(SpriteDataHeader));
|
2022-08-10 15:36:38 +02:00
|
|
|
PlayerRasterCacheSize = cacheSize;
|
|
|
|
PlayerRasterMaxSize = maxRasterSize;
|
|
|
|
SpriteDataHeader[0] += SPRITE_ROM_START;
|
|
|
|
SpriteDataHeader[1] += SPRITE_ROM_START;
|
|
|
|
SpriteDataHeader[2] += SPRITE_ROM_START;
|
2023-02-14 14:14:14 +01:00
|
|
|
raster = _heap_malloc(&heap_spriteHead, maxRasterSize * cacheSize);
|
2022-07-08 14:57:08 +02:00
|
|
|
|
2022-08-10 15:36:38 +02:00
|
|
|
for (i = 0; i < ARRAY_COUNT(PlayerRasterCache); i++) {
|
|
|
|
PlayerRasterCache[i].raster = raster;
|
|
|
|
raster += PlayerRasterMaxSize;
|
|
|
|
PlayerRasterCache[i].lazyDeleteTime = 0;
|
|
|
|
PlayerRasterCache[i].rasterIndex = 0;
|
|
|
|
PlayerRasterCache[i].spriteIndex = 0xFF;
|
2022-07-08 14:57:08 +02:00
|
|
|
}
|
|
|
|
|
2023-04-29 09:19:30 +02:00
|
|
|
for (i = 0; i < ARRAY_COUNT(PlayerRasterLoadDescBeginSpriteIndex); i++) {
|
|
|
|
PlayerRasterLoadDescBeginSpriteIndex[i] = 0;
|
2022-07-08 14:57:08 +02:00
|
|
|
}
|
2023-04-29 09:19:30 +02:00
|
|
|
PlayerRasterLoadDescNumLoaded = 0;
|
2023-01-03 16:57:48 +01:00
|
|
|
nuPiReadRom(SpriteDataHeader[0], &PlayerRasterHeader, sizeof(PlayerRasterHeader));
|
2023-04-29 09:19:30 +02:00
|
|
|
nuPiReadRom(SpriteDataHeader[0] + PlayerRasterHeader.indexRanges, PlayerSpriteRasterSets, sizeof(PlayerSpriteRasterSets));
|
2022-07-08 14:57:08 +02:00
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2022-08-10 17:29:06 +02:00
|
|
|
IMG_PTR spr_get_player_raster(s32 rasterIndex, s32 playerSpriteID) {
|
2023-04-29 09:19:30 +02:00
|
|
|
PlayerSpriteCacheEntry* cacheEntry;
|
|
|
|
u32 playerRasterInfo;
|
2022-08-10 17:29:06 +02:00
|
|
|
s32 idx = -1;
|
|
|
|
s32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < PlayerRasterCacheSize; i++) {
|
|
|
|
if (PlayerRasterCache[i].lazyDeleteTime != 0) {
|
|
|
|
if (PlayerRasterCache[i].rasterIndex == rasterIndex && PlayerRasterCache[i].spriteIndex == playerSpriteID) {
|
|
|
|
PlayerRasterCache[i].lazyDeleteTime = 2;
|
|
|
|
return PlayerRasterCache[i].raster;
|
|
|
|
}
|
|
|
|
} else if (idx == -1) {
|
|
|
|
idx = i;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (idx == -1) {
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2023-04-29 09:19:30 +02:00
|
|
|
cacheEntry = &PlayerRasterCache[idx];
|
|
|
|
cacheEntry->rasterIndex = rasterIndex;
|
|
|
|
cacheEntry->spriteIndex = playerSpriteID;
|
|
|
|
cacheEntry->lazyDeleteTime = 2;
|
|
|
|
|
|
|
|
// each player raster load descriptor has image size (in bytes) and relative offset packed into one word
|
|
|
|
// upper three nibbles give size / 16, lower 5 give offset
|
|
|
|
playerRasterInfo = PlayerRasterLoadDesc[PlayerRasterLoadDescBeginSpriteIndex[playerSpriteID] + rasterIndex];
|
|
|
|
nuPiReadRom(SpriteDataHeader[0] + (playerRasterInfo & 0xFFFFF), cacheEntry->raster, (playerRasterInfo >> 0x10) & 0xFFF0);
|
|
|
|
return cacheEntry->raster;
|
2022-08-10 17:29:06 +02:00
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2021-12-13 10:27:28 +01:00
|
|
|
void spr_update_player_raster_cache(void) {
|
|
|
|
s32 i;
|
|
|
|
|
|
|
|
func_8013A4D0();
|
|
|
|
|
2022-08-10 15:36:38 +02:00
|
|
|
for (i = 0; i < PlayerRasterCacheSize; i++) {
|
|
|
|
if (PlayerRasterCache[i].lazyDeleteTime != 0) {
|
|
|
|
PlayerRasterCache[i].lazyDeleteTime--;
|
2021-12-13 10:27:28 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2021-04-13 09:47:52 +02:00
|
|
|
|
2023-01-03 16:57:48 +01:00
|
|
|
void spr_load_npc_extra_anims(SpriteAnimData* header, u32* extraAnimList) {
|
|
|
|
u8* src;
|
|
|
|
s32 imgID;
|
|
|
|
s32 rasterSize;
|
|
|
|
s32 remaining;
|
|
|
|
u16 animCmd;
|
|
|
|
u16* cmdList;
|
|
|
|
u32 extraAnimID;
|
|
|
|
u8* dataPos;
|
|
|
|
void* copyEnd;
|
|
|
|
SpriteAnimComponent* comp;
|
|
|
|
SpriteAnimComponent** compList;
|
|
|
|
void* writePos;
|
|
|
|
SpriteRasterCacheEntry** rasterList;
|
|
|
|
SpriteRasterCacheEntry* raster;
|
|
|
|
u16** oldPalList;
|
|
|
|
u16* palette;
|
|
|
|
// one extra required for 'done' sentinel
|
|
|
|
s32 sawRaster[100 + 1];
|
|
|
|
s32 i;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(sawRaster) - 1; i++) {
|
|
|
|
sawRaster[i] = FALSE;
|
|
|
|
}
|
|
|
|
|
|
|
|
while ((extraAnimID = *extraAnimList++) != -1) {
|
|
|
|
compList = header->animListStart[extraAnimID & 0xFF];
|
|
|
|
while ((comp = *compList++) != PTR_LIST_END) {
|
|
|
|
cmdList = comp->cmdList;
|
|
|
|
remaining = (s16) comp->cmdListSize / 2;
|
|
|
|
while (remaining > 0) {
|
|
|
|
animCmd = *cmdList++;
|
|
|
|
remaining--;
|
|
|
|
switch (animCmd & 0xF000) {
|
|
|
|
case 0x1000:
|
|
|
|
i = animCmd; // required to match
|
|
|
|
imgID = i & 0xFF;
|
|
|
|
if (imgID < ARRAY_COUNT(sawRaster) - 1) {
|
|
|
|
sawRaster[imgID] = TRUE;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case 0x3000:
|
|
|
|
cmdList++;
|
|
|
|
remaining--;
|
|
|
|
// fallthrough
|
|
|
|
case 0x4000:
|
|
|
|
cmdList++;
|
|
|
|
remaining--;
|
|
|
|
// fallthrough
|
|
|
|
case 0x7000:
|
|
|
|
case 0x5000:
|
|
|
|
cmdList++;
|
|
|
|
remaining--;
|
|
|
|
// fallthrough
|
|
|
|
case 0x0000:
|
|
|
|
case 0x2000:
|
|
|
|
case 0x6000:
|
|
|
|
case 0x8000:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
rasterList = header->rastersOffset;
|
|
|
|
raster = *rasterList;
|
|
|
|
dataPos = raster->image;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(sawRaster) - 1; i++) {
|
|
|
|
if ((raster = *rasterList) == PTR_LIST_END) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if (sawRaster[i]) {
|
|
|
|
src = raster->image;
|
|
|
|
rasterSize = (raster->width * raster->height) / 2;
|
|
|
|
copyEnd = &dataPos[rasterSize];
|
|
|
|
rasterSize += 8;
|
|
|
|
if (dataPos != src) {
|
|
|
|
raster->image = dataPos;
|
|
|
|
bcopy(src, dataPos, rasterSize);
|
|
|
|
}
|
|
|
|
*rasterList = copyEnd;
|
|
|
|
dataPos += rasterSize;
|
|
|
|
}
|
|
|
|
rasterList++;
|
|
|
|
}
|
|
|
|
// sentinel value to mark end of valid data
|
|
|
|
sawRaster[i] = TRUE;
|
|
|
|
|
|
|
|
writePos = dataPos;
|
|
|
|
|
|
|
|
// copy raster list
|
|
|
|
rasterList = header->rastersOffset;
|
|
|
|
header->rastersOffset = writePos;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(sawRaster) - 1; i++) {
|
|
|
|
raster = *rasterList++;
|
|
|
|
if (sawRaster[i]) {
|
|
|
|
*(SpriteRasterCacheEntry**) writePos = raster;
|
|
|
|
} else {
|
|
|
|
*(SpriteRasterCacheEntry**) writePos = (SpriteRasterCacheEntry*) copyEnd;
|
|
|
|
}
|
|
|
|
writePos += 4;
|
|
|
|
if (raster == PTR_LIST_END) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// copy palette list
|
|
|
|
oldPalList = header->palettesOffset;
|
|
|
|
header->palettesOffset = writePos;
|
|
|
|
|
|
|
|
for (i = 0; i < ARRAY_COUNT(sawRaster) - 1; i++) {
|
|
|
|
raster = (SpriteRasterCacheEntry*)*oldPalList++; // required to match
|
|
|
|
*(u16**)writePos = (u16*)raster;
|
|
|
|
writePos += 4;
|
|
|
|
if (raster == PTR_LIST_END) {
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-02-14 14:14:14 +01:00
|
|
|
_heap_realloc(&heap_spriteHead, header, (s32)writePos - (s32)header);
|
2023-01-03 16:57:48 +01:00
|
|
|
}
|
|
|
|
|
2022-09-24 11:04:13 +02:00
|
|
|
SpriteComponent** spr_allocate_components(s32 count) {
|
|
|
|
s32 listSize;
|
|
|
|
SpriteComponent** listStart;
|
|
|
|
SpriteComponent* component;
|
|
|
|
SpriteComponent** listPos;
|
|
|
|
u32 totalSize;
|
2022-08-10 17:29:06 +02:00
|
|
|
s32 i;
|
|
|
|
|
2022-09-24 11:04:13 +02:00
|
|
|
// data will contain a -1 terminated list, followed by the SpriteComponents
|
|
|
|
// corresponding to that list
|
|
|
|
listSize = (count + 1) * 4;
|
|
|
|
totalSize = (count * sizeof(SpriteComponent)) + listSize;
|
2022-08-10 17:29:06 +02:00
|
|
|
|
|
|
|
if (spr_allocateBtlComponentsOnWorldHeap) {
|
2023-01-03 16:57:48 +01:00
|
|
|
listStart = _heap_malloc(&heap_generalHead, totalSize);
|
2023-01-31 17:12:03 +01:00
|
|
|
listPos = listStart;
|
|
|
|
component = (SpriteComponent*) listPos;
|
2022-08-10 17:29:06 +02:00
|
|
|
} else {
|
2023-02-14 14:14:14 +01:00
|
|
|
listStart = _heap_malloc(&heap_spriteHead, totalSize);
|
2023-01-31 17:12:03 +01:00
|
|
|
listPos = listStart;
|
|
|
|
component = (SpriteComponent*) listPos;
|
2022-08-10 17:29:06 +02:00
|
|
|
}
|
|
|
|
|
2023-01-03 16:57:48 +01:00
|
|
|
component = (SpriteComponent*)((s32)(component) + (listSize / 4) * 4);
|
2022-08-10 17:29:06 +02:00
|
|
|
|
2022-09-24 11:04:13 +02:00
|
|
|
// fill list values
|
|
|
|
for (i = 0; i < count; i++) {
|
2023-01-03 16:57:48 +01:00
|
|
|
*listPos++ = component;
|
2022-09-24 11:04:13 +02:00
|
|
|
component++;
|
2022-08-10 17:29:06 +02:00
|
|
|
}
|
2022-09-24 11:04:13 +02:00
|
|
|
*listPos = PTR_LIST_END;
|
2022-10-04 16:09:23 +02:00
|
|
|
|
2022-09-24 11:04:13 +02:00
|
|
|
return listStart;
|
2022-08-10 17:29:06 +02:00
|
|
|
}
|