- moved texture counting code into FTextureManager.
- moved all code and data for Build tile management into FTextureManager. - moved texture animation management into FTextureManager. - changed: Animate textures only once per frame, not per view. Otherwise with animations that have sub-frame accuracy camera textures of the same area can show different animation frames if the frame changes falls between the rendering of the different views. SVN r3026 (trunk)
This commit is contained in:
parent
c9a33edee0
commit
6309d90be0
13 changed files with 481 additions and 433 deletions
|
|
@ -41,8 +41,6 @@
|
|||
#include "cmdlib.h"
|
||||
#include "st_start.h"
|
||||
|
||||
static TArray<BYTE *> BuildTileFiles;
|
||||
|
||||
//==========================================================================
|
||||
//
|
||||
// A texture defined in a Build TILESxxx.ART file
|
||||
|
|
@ -158,7 +156,7 @@ const BYTE *FBuildTexture::GetColumn (unsigned int column, const Span **spans_ou
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void AddTiles (void *tiles)
|
||||
void FTextureManager::AddTiles (void *tiles)
|
||||
{
|
||||
// int numtiles = LittleLong(((DWORD *)tiles)[1]); // This value is not reliable
|
||||
int tilestart = LittleLong(((DWORD *)tiles)[2]);
|
||||
|
|
@ -183,7 +181,7 @@ void AddTiles (void *tiles)
|
|||
if (width <= 0 || height <= 0) continue;
|
||||
|
||||
tex = new FBuildTexture (i, tiledata, width, height, xoffs, yoffs);
|
||||
texnum = TexMan.AddTexture (tex);
|
||||
texnum = AddTexture (tex);
|
||||
while (size > 0)
|
||||
{
|
||||
*tiledata = 255 - *tiledata;
|
||||
|
|
@ -207,7 +205,7 @@ void AddTiles (void *tiles)
|
|||
speed = (anm >> 24) & 15;
|
||||
speed = MAX (1, (1 << speed) * 1000 / 120); // Convert from 120 Hz to 1000 Hz.
|
||||
|
||||
R_AddSimpleAnim (texnum, picanm[pic] & 63, type, speed);
|
||||
AddSimpleAnim (texnum, picanm[pic] & 63, type, speed);
|
||||
}
|
||||
|
||||
// Blood's rotation types:
|
||||
|
|
@ -262,7 +260,7 @@ void AddTiles (void *tiles)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
static int CountTiles (void *tiles)
|
||||
int FTextureManager::CountTiles (void *tiles)
|
||||
{
|
||||
int version = LittleLong(*(DWORD *)tiles);
|
||||
if (version != 1)
|
||||
|
|
@ -285,7 +283,7 @@ static int CountTiles (void *tiles)
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
int R_CountBuildTiles ()
|
||||
int FTextureManager::CountBuildTiles ()
|
||||
{
|
||||
int numartfiles = 0;
|
||||
char artfile[] = "tilesXXX.art";
|
||||
|
|
@ -373,25 +371,10 @@ int R_CountBuildTiles ()
|
|||
//
|
||||
//===========================================================================
|
||||
|
||||
void R_InitBuildTiles ()
|
||||
void FTextureManager::InitBuildTiles ()
|
||||
{
|
||||
for (unsigned int i = 0; i < BuildTileFiles.Size(); ++i)
|
||||
{
|
||||
AddTiles (BuildTileFiles[i]);
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// R_DeinitBuildTiles
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void R_DeinitBuildTiles ()
|
||||
{
|
||||
for (unsigned int i = 0; i < BuildTileFiles.Size(); ++i)
|
||||
{
|
||||
delete[] BuildTileFiles[i];
|
||||
}
|
||||
BuildTileFiles.Clear();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue