Merge branch 'lighting' into lighting-expanded-id

This commit is contained in:
Ariel A 2023-12-31 02:54:41 -05:00
commit ad737a4da1

View File

@ -912,27 +912,23 @@ u8 AddNewGameBirchObject(s16 x, s16 y, u8 subpriority)
return CreateSprite(&sSpriteTemplate_NewGameBirch, x, y, subpriority);
}
u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority)
u8 CreateMonSprite_FieldMove(u16 species, u32 otId, u32 personality, s16 x, s16 y, u8 subpriority)
{
s32 spriteId = CreateMonPicSprite_HandleDeoxys(species, 0, 0x8000, TRUE, x, y, 0, gMonPaletteTable[species].tag);
PreservePaletteInWeather(IndexOfSpritePaletteTag(gMonPaletteTable[species].tag) + 0x10);
// force load unique tag here to avoid collision with follower pokemon
u32 paletteSlot = AllocSpritePalette(FLDEFF_PAL_TAG_FIELD_MOVE_MON);
u16 spriteId = CreateMonPicSprite_HandleDeoxys(species, otId, personality, TRUE, x, y, paletteSlot, TAG_NONE);
PreservePaletteInWeather(paletteSlot + 0x10);
if (spriteId == 0xFFFF)
return MAX_SPRITES;
else
return spriteId;
}
u8 CreateMonSprite_FieldMove(u16 species, u32 otId, u32 personality, s16 x, s16 y, u8 subpriority)
u8 CreateMonSprite_PicBox(u16 species, s16 x, s16 y, u8 subpriority)
{
const struct CompressedSpritePalette *spritePalette = GetMonSpritePalStructFromOtIdPersonality(species, otId, personality);
// force load unique tag here to avoid collision with follower pokemon
u8 paletteSlot = AllocSpritePalette(FLDEFF_PAL_TAG_FIELD_MOVE_MON);
u16 spriteId = CreateMonPicSprite_HandleDeoxys(species, otId, personality, TRUE, x, y, paletteSlot, TAG_NONE);
PreservePaletteInWeather(IndexOfSpritePaletteTag(FLDEFF_PAL_TAG_FIELD_MOVE_MON) + 0x10);
if (spriteId == 0xFFFF)
return MAX_SPRITES;
else
return spriteId;
// Reuse logic; (otId ^ pid) >= SHINY_ODDS ensures non-shiny
return CreateMonSprite_FieldMove(species, 0, SHINY_ODDS, x, y, subpriority);
}
void FreeResourcesAndDestroySprite(struct Sprite *sprite, u8 spriteId)