overworld_ascending_frames to simplify overworld_frames (#3625)

Introduces relativeFrames which automates the process of using
overworld_frames with ascending frames.

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
This commit is contained in:
Martin Griffin 2023-12-18 12:47:15 +00:00 committed by GitHub
parent c505abd53d
commit 74a6b8764c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 123 additions and 1027 deletions

View File

@ -751,9 +751,17 @@ void RequestSpriteFrameImageCopy(u16 index, u16 tileNum, const struct SpriteFram
{
if (sSpriteCopyRequestCount < MAX_SPRITE_COPY_REQUESTS)
{
sSpriteCopyRequests[sSpriteCopyRequestCount].src = images[index].data;
if (!images[0].relativeFrames)
{
sSpriteCopyRequests[sSpriteCopyRequestCount].src = images[index].data;
sSpriteCopyRequests[sSpriteCopyRequestCount].size = images[index].size;
}
else
{
sSpriteCopyRequests[sSpriteCopyRequestCount].src = images[0].data + images[0].size * index;
sSpriteCopyRequests[sSpriteCopyRequestCount].size = images[0].size;
}
sSpriteCopyRequests[sSpriteCopyRequestCount].dest = (u8 *)OBJ_VRAM0 + TILE_SIZE_4BPP * tileNum;
sSpriteCopyRequests[sSpriteCopyRequestCount].size = images[index].size;
sSpriteCopyRequestCount++;
}
}

View File

@ -26,11 +26,13 @@ struct SpriteFrameImage
{
const void *data;
u16 size;
bool8 relativeFrames;
};
#define obj_frame_tiles(ptr) {.data = (u8 *)ptr, .size = sizeof ptr}
#define overworld_frame(ptr, width, height, frame) {.data = (u8 *)ptr + (width * height * frame * 64)/2, .size = (width * height * 64)/2}
#define overworld_ascending_frames(ptr, width, height) {.data = (u8 *)ptr, .size = (width * height * 64)/2, .relativeFrames=TRUE}
struct SpritePalette
{

View File

@ -1,5 +1,4 @@
const u32 gObjectEventPic_BrendanNormal[] = INCBIN_U32("graphics/object_events/pics/people/brendan/walking.4bpp");
const u32 gObjectEventPic_BrendanRunning[] = INCBIN_U32("graphics/object_events/pics/people/brendan/running.4bpp");
const u32 gObjectEventPic_BrendanNormalRunning[] = INCBIN_U32("graphics/object_events/pics/people/brendan/walking.4bpp", "graphics/object_events/pics/people/brendan/running.4bpp");
const u16 gObjectEventPal_Brendan[] = INCBIN_U16("graphics/object_events/palettes/brendan.gbapal");
const u32 gObjectEventPic_RubySapphireBrendanNormal[] = INCBIN_U32("graphics/object_events/pics/people/ruby_sapphire_brendan/walking.4bpp");
const u32 gObjectEventPic_RubySapphireBrendanRunning[] = INCBIN_U32("graphics/object_events/pics/people/ruby_sapphire_brendan/running.4bpp");
@ -32,8 +31,7 @@ const u32 gObjectEventPic_MayDecorating[] = INCBIN_U32("graphics/object_events/p
const u32 gObjectEventPic_BrendanUnderwater[] = INCBIN_U32("graphics/object_events/pics/people/brendan/underwater.4bpp");
const u32 gObjectEventPic_MayUnderwater[] = INCBIN_U32("graphics/object_events/pics/people/may/underwater.4bpp");
const u16 gObjectEventPal_PlayerUnderwater[] = INCBIN_U16("graphics/object_events/palettes/player_underwater.gbapal");
const u32 gObjectEventPic_MayNormal[] = INCBIN_U32("graphics/object_events/pics/people/may/walking.4bpp");
const u32 gObjectEventPic_MayRunning[] = INCBIN_U32("graphics/object_events/pics/people/may/running.4bpp");
const u32 gObjectEventPic_MayNormalRunning[] = INCBIN_U32("graphics/object_events/pics/people/may/walking.4bpp", "graphics/object_events/pics/people/may/running.4bpp");
const u16 gObjectEventPal_May[] = INCBIN_U16("graphics/object_events/palettes/may.gbapal");
const u16 gObjectEventPal_MayReflection[] = INCBIN_U16("graphics/object_events/palettes/may_reflection.gbapal");
const u32 gObjectEventPic_RubySapphireMayNormal[] = INCBIN_U32("graphics/object_events/pics/people/ruby_sapphire_may/walking.4bpp");

File diff suppressed because it is too large Load Diff