- removed several unneeded GL headers from the software renderer's sources.
- consolidated the code to calculate a sprite's display angle for all 3 renderers. As it turned out, they all differed in their feature support because they had always been updated independently by different people.
This commit is contained in:
parent
005e6871f9
commit
b529b1e3a7
20 changed files with 100 additions and 103 deletions
|
|
@ -35,6 +35,39 @@ uint8_t OtherGameSkinRemap[256];
|
|||
PalEntry OtherGameSkinPalette[256];
|
||||
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Gets the texture index for a sprite frame
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
FTextureID spritedef_t::GetSpriteFrame(int frame, int rot, DAngle ang, bool *mirror)
|
||||
{
|
||||
if ((unsigned)frame >= numframes)
|
||||
{
|
||||
// If there are no frames at all for this sprite, don't draw it.
|
||||
return FNullTextureID();
|
||||
}
|
||||
else
|
||||
{
|
||||
// choose a different rotation based on player view
|
||||
spriteframe_t *sprframe = &SpriteFrames[spriteframes + frame];
|
||||
if (rot == -1)
|
||||
{
|
||||
if (sprframe->Texture[0] == sprframe->Texture[1])
|
||||
{
|
||||
rot = (ang + 45.0 / 2 * 9).BAMs() >> 28;
|
||||
}
|
||||
else
|
||||
{
|
||||
rot = (ang + (45.0 / 2 * 9 - 180.0 / 16)).BAMs() >> 28;
|
||||
}
|
||||
}
|
||||
if (mirror) *mirror = !!(sprframe->Flip&(1 << rot));
|
||||
return sprframe->Texture[rot];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//
|
||||
// R_InstallSpriteLump
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue