HD Packs: Invert X/Y axis for spriteNearby conditions if the current tile is mirrored
This commit is contained in:
parent
c50e0ffef4
commit
94c114e713
1 changed files with 5 additions and 2 deletions
|
@ -230,7 +230,7 @@ struct HdPackTileNearbyCondition : public HdPackBaseTileCondition
|
|||
|
||||
bool InternalCheckCondition(HdScreenInfo *screenInfo, int x, int y, HdPpuTileInfo* tile) override
|
||||
{
|
||||
int pixelIndex = PixelOffset + (y << 8) + x;
|
||||
int pixelIndex = PixelOffset + (y * 256) + x;
|
||||
if(pixelIndex < 0 || pixelIndex > PPU::PixelCount) {
|
||||
return false;
|
||||
}
|
||||
|
@ -250,7 +250,10 @@ struct HdPackSpriteNearbyCondition : public HdPackBaseTileCondition
|
|||
|
||||
bool InternalCheckCondition(HdScreenInfo *screenInfo, int x, int y, HdPpuTileInfo* tile) override
|
||||
{
|
||||
int pixelIndex = PixelOffset + (y << 8) + x;
|
||||
int xSign = tile && tile->HorizontalMirroring ? -1 : 1;
|
||||
int ySign = tile && tile->VerticalMirroring ? -1 : 1;
|
||||
int pixelIndex = PixelOffset + (y * 256 * ySign) + x * xSign;
|
||||
|
||||
if(pixelIndex < 0 || pixelIndex > PPU::PixelCount) {
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue