mirror of https://github.com/snes9xgit/snes9x.git
Merge pull request #597 from tryal-star/sprites
add unlimited sprites (range)
This commit is contained in:
commit
592cfeeaae
12
gfx.cpp
12
gfx.cpp
|
@ -604,6 +604,7 @@ static void SetupOBJ (void)
|
||||||
|
|
||||||
int Height;
|
int Height;
|
||||||
uint8 S;
|
uint8 S;
|
||||||
|
int sprite_limit = (Settings.MaxSpriteTilesPerLine == 128) ? 128 : 32;
|
||||||
|
|
||||||
if (!PPU.OAMPriorityRotation || !(PPU.OAMFlip & PPU.OAMAddr & 1)) // normal case
|
if (!PPU.OAMPriorityRotation || !(PPU.OAMFlip & PPU.OAMAddr & 1)) // normal case
|
||||||
{
|
{
|
||||||
|
@ -614,7 +615,7 @@ static void SetupOBJ (void)
|
||||||
{
|
{
|
||||||
GFX.OBJLines[i].RTOFlags = 0;
|
GFX.OBJLines[i].RTOFlags = 0;
|
||||||
GFX.OBJLines[i].Tiles = Settings.MaxSpriteTilesPerLine;
|
GFX.OBJLines[i].Tiles = Settings.MaxSpriteTilesPerLine;
|
||||||
for (int j = 0; j < 32; j++)
|
for (int j = 0; j < sprite_limit; j++)
|
||||||
GFX.OBJLines[i].OBJ[j].Sprite = -1;
|
GFX.OBJLines[i].OBJ[j].Sprite = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -653,7 +654,7 @@ static void SetupOBJ (void)
|
||||||
if (Y >= SNES_HEIGHT_EXTENDED)
|
if (Y >= SNES_HEIGHT_EXTENDED)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (LineOBJ[Y] >= 32)
|
if (LineOBJ[Y] >= sprite_limit)
|
||||||
{
|
{
|
||||||
GFX.OBJLines[Y].RTOFlags |= 0x40;
|
GFX.OBJLines[Y].RTOFlags |= 0x40;
|
||||||
continue;
|
continue;
|
||||||
|
@ -757,7 +758,7 @@ static void SetupOBJ (void)
|
||||||
{
|
{
|
||||||
if (OBJOnLine[Y][S])
|
if (OBJOnLine[Y][S])
|
||||||
{
|
{
|
||||||
if (j >= 32)
|
if (j >= sprite_limit)
|
||||||
{
|
{
|
||||||
GFX.OBJLines[Y].RTOFlags |= 0x40;
|
GFX.OBJLines[Y].RTOFlags |= 0x40;
|
||||||
break;
|
break;
|
||||||
|
@ -774,7 +775,7 @@ static void SetupOBJ (void)
|
||||||
} while (S != FirstSprite);
|
} while (S != FirstSprite);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (j < 32)
|
if (j < sprite_limit)
|
||||||
GFX.OBJLines[Y].OBJ[j].Sprite = -1;
|
GFX.OBJLines[Y].OBJ[j].Sprite = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -794,13 +795,14 @@ static void DrawOBJS (int D)
|
||||||
int PixWidth = IPPU.DoubleWidthPixels ? 2 : 1;
|
int PixWidth = IPPU.DoubleWidthPixels ? 2 : 1;
|
||||||
BG.InterlaceLine = GFX.InterlaceFrame ? 8 : 0;
|
BG.InterlaceLine = GFX.InterlaceFrame ? 8 : 0;
|
||||||
GFX.Z1 = 2;
|
GFX.Z1 = 2;
|
||||||
|
int sprite_limit = (Settings.MaxSpriteTilesPerLine == 128) ? 128 : 32;
|
||||||
|
|
||||||
for (uint32 Y = GFX.StartY, Offset = Y * GFX.PPL; Y <= GFX.EndY; Y++, Offset += GFX.PPL)
|
for (uint32 Y = GFX.StartY, Offset = Y * GFX.PPL; Y <= GFX.EndY; Y++, Offset += GFX.PPL)
|
||||||
{
|
{
|
||||||
int I = 0;
|
int I = 0;
|
||||||
int tiles = GFX.OBJLines[Y].Tiles;
|
int tiles = GFX.OBJLines[Y].Tiles;
|
||||||
|
|
||||||
for (int S = GFX.OBJLines[Y].OBJ[I].Sprite; S >= 0 && I < 32; S = GFX.OBJLines[Y].OBJ[++I].Sprite)
|
for (int S = GFX.OBJLines[Y].OBJ[I].Sprite; S >= 0 && I < sprite_limit; S = GFX.OBJLines[Y].OBJ[++I].Sprite)
|
||||||
{
|
{
|
||||||
tiles += GFX.OBJVisibleTiles[S];
|
tiles += GFX.OBJVisibleTiles[S];
|
||||||
if (tiles <= 0)
|
if (tiles <= 0)
|
||||||
|
|
Loading…
Reference in New Issue