mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-16 01:02:03 +00:00
- Added a PrecacheTexture virtual function to DFrameBuffer because it's the
renderer which should decide how to precache a texture. SVN r723 (trunk)
This commit is contained in:
parent
ebbe9c84f8
commit
465bcfd199
5 changed files with 29 additions and 14 deletions
|
@ -1,4 +1,6 @@
|
|||
January 27, 2008 (Changes by Graf Zahl)
|
||||
- Added a PrecacheTexture virtual function to DFrameBuffer because it's the
|
||||
renderer which should decide how to precache a texture.
|
||||
- Added SnowKate709's APROP_MaxHealth submission.
|
||||
- Fixed: FTexture::GetScaledWidth/Height always rounded down which could result in
|
||||
imprecisions (e.g. when scaling from 128 to 96.)
|
||||
|
|
|
@ -485,18 +485,7 @@ void R_PrecacheLevel (void)
|
|||
|
||||
for (i = TexMan.NumTextures() - 1; i >= 0; i--)
|
||||
{
|
||||
FTexture *tex = TexMan[i];
|
||||
if (tex != NULL)
|
||||
{
|
||||
if (hitlist[i])
|
||||
{
|
||||
tex->GetPixels ();
|
||||
}
|
||||
else
|
||||
{
|
||||
tex->Unload ();
|
||||
}
|
||||
}
|
||||
screen->PrecacheTexture(TexMan[i], !!hitlist[i]);
|
||||
}
|
||||
|
||||
delete[] hitlist;
|
||||
|
|
|
@ -844,8 +844,6 @@ private:
|
|||
TArray<WORD> Translation;
|
||||
WORD HashFirst[HASH_SIZE];
|
||||
int DefaultTexture;
|
||||
|
||||
friend void R_InitData ();
|
||||
};
|
||||
|
||||
extern FTextureManager TexMan;
|
||||
|
|
|
@ -1316,6 +1316,27 @@ void DFrameBuffer::CopyPixelData(BYTE * buffer, int texpitch, int texheight, int
|
|||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Texture precaching
|
||||
//
|
||||
//===========================================================================
|
||||
|
||||
void DFrameBuffer::PrecacheTexture(FTexture *tex, bool cache)
|
||||
{
|
||||
if (tex != NULL)
|
||||
{
|
||||
if (cache)
|
||||
{
|
||||
tex->GetPixels ();
|
||||
}
|
||||
else
|
||||
{
|
||||
tex->Unload ();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
//
|
||||
// Render the view
|
||||
|
|
|
@ -49,6 +49,8 @@
|
|||
extern int CleanWidth, CleanHeight, CleanXfac, CleanYfac;
|
||||
extern int DisplayWidth, DisplayHeight, DisplayBits;
|
||||
|
||||
bool V_DoModeSetup (int width, int height, int bits);
|
||||
|
||||
class FTexture;
|
||||
|
||||
// TagItem definitions for DrawTexture. As far as I know, tag lists
|
||||
|
@ -375,6 +377,9 @@ public:
|
|||
const BYTE *patch, int pix_width, int pix_height,
|
||||
int step_x, int step_y, PalEntry * palette);
|
||||
|
||||
// Precaches or unloads a texture
|
||||
virtual void PrecacheTexture(FTexture *tex, bool cache);
|
||||
|
||||
// Screen wiping
|
||||
virtual bool WipeStartScreen(int type);
|
||||
virtual void WipeEndScreen();
|
||||
|
|
Loading…
Reference in a new issue