Removed legacy handling, fix if statment argument style

This commit is contained in:
Hedara 2025-04-11 21:27:49 +02:00
parent 3c2cc35158
commit fff6bd3ed8
3 changed files with 4 additions and 32 deletions

View File

@ -3,15 +3,6 @@
// Whether a palette has a night version, located at ((x + 9) % 16).pal
#define SWAP_PAL(x) ((x) < NUM_PALS_IN_PRIMARY ? 1 << (x) : 1 << ((x) - NUM_PALS_IN_PRIMARY))
// NOTE: Instead of using LIGHT_PAL,
// consider taking a look at the .pla files
// to mark colors as lights, instead.
// The old method *should* still work, however.
// Check docs/tutorials/dns.md for details.
// Whether a palette has lights the color indices to blend are stored in the palette's color 0
#define LIGHT_PAL(x) ((x) < NUM_PALS_IN_PRIMARY ? 1 << (x) : 1 << ((x) - NUM_PALS_IN_PRIMARY))
const struct Tileset gTileset_General =
{
.isCompressed = TRUE,

View File

@ -339,11 +339,10 @@ u32 FldEff_Shadow(void)
for (i = MAX_SPRITES - 1; i > -1; i--) // Search backwards, because of CreateSpriteAtEnd
{
// Return early if a shadow sprite already exists
if (gSprites[i].callback == UpdateShadowFieldEffect &&
gSprites[i].sLocalId == gFieldEffectArguments[0] &&
gSprites[i].sMapNum == gFieldEffectArguments[1] &&
gSprites[i].sMapGroup == gFieldEffectArguments[2]
)
if (gSprites[i].callback == UpdateShadowFieldEffect
&& gSprites[i].sLocalId == gFieldEffectArguments[0]
&& gSprites[i].sMapNum == gFieldEffectArguments[1]
&& gSprites[i].sMapGroup == gFieldEffectArguments[2])
return 0;
}
objectEventId = GetObjectEventIdByLocalIdAndMap(gFieldEffectArguments[0], gFieldEffectArguments[1], gFieldEffectArguments[2]);

View File

@ -911,24 +911,6 @@ static void LoadTilesetPalette(struct Tileset const *tileset, u16 destOffset, u1
LoadCompressedPalette((const u32 *)tileset->palettes, destOffset, size);
ApplyGlobalTintToPaletteEntries(destOffset, size >> 1);
}
// convert legacy light palette system to current
if (tileset->lightPalettes)
{
u32 i, j, color;
for (i = low; i < high; i++)
{
if (tileset->lightPalettes & (1 << (i - low))) // Mark light colors
{
for (j = 1, color = gPlttBufferUnfaded[PLTT_ID(i)]; j < 16 && color; j++, color >>= 1)
{
if (color & 1)
gPlttBufferFaded[PLTT_ID(i)+j] = gPlttBufferUnfaded[PLTT_ID(i)+j] |= RGB_ALPHA;
}
if (tileset->customLightColor & (1 << (i - low))) // Copy old custom light color to index 0
gPlttBufferFaded[PLTT_ID(i)] = gPlttBufferUnfaded[PLTT_ID(i)] = gPlttBufferUnfaded[PLTT_ID(i) + 15] | RGB_ALPHA;
}
}
}
}
}