Fixed some field effect palettes. Removed leftover CacheLightMetatiles.

This commit is contained in:
Ariel A 2022-05-10 22:03:40 -04:00
parent 40d610e29a
commit 28ec60a776
8 changed files with 8 additions and 28 deletions

View file

@ -132,5 +132,7 @@
// Duplicates of event_object_movement tags
#define FLDEFF_PAL_TAG_MAY 0x1110 // OBJ_EVENT_PAL_TAG_MAY
#define FLDEFF_PAL_TAG_BRENDAN 0x1100 // OBJ_EVENT_PAL_TAG_BRENDAN
#define FLDEFF_PAL_TAG_NPC_1 0x1103 // OBJ_EVENT_PAL_TAG_NPC_1
#define FLDEFF_PAL_TAG_NPC_2 0x1104 // OBJ_EVENT_PAL_TAG_NPC_2
#endif // GUARD_FIELD_EFFECT_CONSTANTS_H

View file

@ -47,7 +47,6 @@ struct LinkPlayerObjectEvent
// Exported RAM declarations
extern struct WarpData gLastUsedWarp;
extern struct LinkPlayerObjectEvent gLinkPlayerObjectEvents[4];
extern struct Coords16 gLightMetatiles[32];
extern u16 *gBGTilemapBuffers1;
extern u16 *gBGTilemapBuffers2;

View file

@ -948,7 +948,7 @@ static const union AnimCmd *const sAnimTable_Sparkle[] =
const struct SpriteTemplate gFieldEffectObjectTemplate_Sparkle = {
.tileTag = TAG_NONE,
.paletteTag = TAG_NONE,
.paletteTag = FLDEFF_PAL_TAG_NPC_2,
.oam = &gObjectEventBaseOam_16x16,
.anims = sAnimTable_Sparkle,
.images = sPicTable_Sparkle,

View file

@ -511,7 +511,7 @@ static const struct SpritePalette sObjectEventSpritePalettes[] = {
{gObjectEventPal_RubySapphireMay, OBJ_EVENT_PAL_TAG_RS_MAY},
{gObjectEventPal_Npc1, OBJ_EVENT_PAL_TAG_DYNAMIC},
{gObjectEventPaletteEmotes, OBJ_EVENT_PAL_TAG_EMOTES},
{NULL, 0x0000},
{NULL, OBJ_EVENT_PAL_TAG_NONE},
};
static const u16 sReflectionPaletteTags_Brendan[] = {

View file

@ -1438,7 +1438,7 @@ u32 FldEff_BerryTreeGrowthSparkle(void)
sprite = &gSprites[spriteId];
sprite->coordOffsetEnabled = TRUE;
sprite->oam.priority = gFieldEffectArguments[3];
sprite->oam.paletteNum = 5; // TODO: What paletteTag does this use?
UpdateSpritePaletteByTemplate(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPARKLE], sprite);
sprite->data[0] = FLDEFF_BERRY_TREE_GROWTH_SPARKLE;
}
return 0;

View file

@ -1024,7 +1024,7 @@ void DoSecretBaseGlitterMatSparkle(void)
{
gSprites[spriteId].coordOffsetEnabled = TRUE;
gSprites[spriteId].oam.priority = 1;
gSprites[spriteId].oam.paletteNum = 5; // TODO: What palette should this use?
UpdateSpritePaletteByTemplate(gFieldEffectObjectTemplatePointers[FLDEFFOBJ_SPARKLE], &gSprites[spriteId]);
gSprites[spriteId].callback = SpriteCB_GlitterMatSparkle;
gSprites[spriteId].data[0] = 0;
}

View file

@ -207,7 +207,6 @@ EWRAM_DATA static struct InitialPlayerAvatarState sInitialPlayerAvatarState = {0
EWRAM_DATA static u16 sAmbientCrySpecies = 0;
EWRAM_DATA static bool8 sIsAmbientCryWaterMon = FALSE;
EWRAM_DATA struct LinkPlayerObjectEvent gLinkPlayerObjectEvents[4] = {0};
EWRAM_DATA struct Coords16 gLightMetatiles[32] = {0};
static const struct WarpData sDummyWarpData =
@ -596,23 +595,6 @@ struct MapHeader const *const GetDestinationWarpMapHeader(void)
return Overworld_GetMapHeaderByGroupAndId(sWarpDestination.mapGroup, sWarpDestination.mapNum);
}
// Caches light metatile coordinates
static void CacheLightMetatiles(void) { // TODO: Better way to dynamically generate lights
u8 i = 0;
s16 x, y;
for (x = 0; x < gBackupMapLayout.width; x++) {
for (y = 0; y < gBackupMapLayout.height; y++) {
if (MapGridGetMetatileBehaviorAt(x, y) == 0x04) {
gLightMetatiles[i].x = x;
gLightMetatiles[i].y = y;
i++;
}
}
}
gLightMetatiles[i].x = -1;
gLightMetatiles[i].y = -1;
}
static void LoadCurrentMapData(void)
{
sLastMapSectionId = gMapHeader.regionMapSectionId;
@ -833,7 +815,6 @@ void LoadMapFromCameraTransition(u8 mapGroup, u8 mapNum)
Overworld_ClearSavedMusic();
RunOnTransitionMapScript();
InitMap();
CacheLightMetatiles();
CopySecondaryTilesetToVramUsingHeap(gMapHeader.mapLayout);
LoadSecondaryTilesetPalette(gMapHeader.mapLayout);
@ -1766,7 +1747,6 @@ void CB2_ContinueSavedGame(void)
}
else
{
CacheLightMetatiles();
TryPutTodaysRivalTrainerOnAir();
gFieldCallback = FieldCB_FadeTryShowMapPopup;
SetMainCallback1(CB1_Overworld);
@ -1926,7 +1906,6 @@ static bool32 LoadMapInStepsLocal(u8 *state, bool32 a2)
(*state)++;
break;
case 3:
CacheLightMetatiles();
InitObjectEventsLocal();
SetCameraToTrackPlayer();
(*state)++;

View file

@ -303,7 +303,7 @@ static const struct SpriteTemplate sSpriteTemplate_ExclamationQuestionMark =
static const struct SpriteTemplate sSpriteTemplate_HeartIcon =
{
.tileTag = TAG_NONE,
.paletteTag = FLDEFF_PAL_TAG_GENERAL_0,
.paletteTag = FLDEFF_PAL_TAG_NPC_1,
.oam = &sOamData_Icons,
.anims = sSpriteAnimTable_Icons,
.images = sSpriteImageTable_HeartIcon,
@ -870,7 +870,7 @@ u8 FldEff_HeartIcon(void)
struct Sprite *sprite = &gSprites[spriteId];
SetIconSpriteData(sprite, FLDEFF_HEART_ICON, 0);
sprite->oam.paletteNum = 2; // TODO: What palette should this use?
UpdateSpritePaletteByTemplate(&sSpriteTemplate_HeartIcon, sprite);
}
return 0;