- disabled the QAV preload calls in Blood.

Aside from not having been functional, this is ultimately more harmful than useful as it forces loading of a large number of textures at the same time during gameplay instead of spreading them out.
This commit is contained in:
Christoph Oelckers 2021-04-11 12:10:52 +02:00
parent d663d84596
commit 6342926871
11 changed files with 4 additions and 80 deletions

View file

@ -69,7 +69,7 @@ CGameMenuItemQAV::CGameMenuItemQAV(int a3, int a4, const char* name, bool widesc
data->nSprite = -1;
data->x = m_nX;
data->y = m_nY;
data->Preload();
//data->Preload();
duration = data->duration;
lastTick = I_GetBuildTime();
}

View file

@ -124,7 +124,6 @@ extern int nPrecacheCount;
int tileInit(char a1, const char *a2);
void tileProcessGLVoxels(void);
void tilePreloadTile(int nTile);
void tilePrecacheTile(int nTile, int nType, HitList& hits);
char tileGetSurfType(int hit);

View file

@ -1326,7 +1326,7 @@ void trPlayerCtrlStartScene(XSPRITE* pXSource, PLAYER* pPlayer, bool force) {
pCtrl->qavScene.qavResrc = pQav;
pCtrl->qavScene.dummy = -1;
pCtrl->qavScene.qavResrc->Preload();
//pCtrl->qavScene.qavResrc->Preload();
pPlayer->sceneQav = pXSource->data2;
pPlayer->weaponTimer = pCtrl->qavScene.qavResrc->duration;

View file

@ -2319,7 +2319,7 @@ void SerializePlayers(FSerializer& arc)
if (pQav)
{
gPlayerCtrl[i].qavScene.qavResrc = pQav;
gPlayerCtrl[i].qavScene.qavResrc->Preload();
//gPlayerCtrl[i].qavScene.qavResrc->Preload();
}
else
{

View file

@ -36,52 +36,6 @@ void fxPrecache(HitList &hits);
void gibPrecache(HitList &hits);
void tilePreloadTile(int nTile)
{
if (!r_precache) return;
int n = 1;
switch (picanm[nTile].extra & 7)
{
case 0:
n = 1;
break;
case 1:
n = 5;
break;
case 2:
n = 8;
break;
case 3:
n = 2;
break;
case 6:
case 7:
if (voxelIndex[nTile] < 0 || voxelIndex[nTile] >= kMaxVoxels)
{
voxelIndex[nTile] = -1;
picanm[nTile].extra &= ~7;
}
break;
}
while (n--)
{
if (picanm[nTile].sf & PICANM_ANIMTYPE_MASK)
{
for (int frame = picanm[nTile].num; frame >= 0; frame--)
{
if ((picanm[nTile].sf & PICANM_ANIMTYPE_MASK) == PICANM_ANIMTYPE_BACK)
PrecacheHardwareTextures(nTile - frame);
else
PrecacheHardwareTextures(nTile + frame);
}
}
else
PrecacheHardwareTextures(nTile);
nTile += 1 + picanm[nTile].num;
}
}
void tilePrecacheTile(int nTile, int nType, HitList &hits)
{
int n = 1;

View file

@ -146,18 +146,6 @@ void QAV::Play(int start, int end, int nCallback, void *pData)
}
}
void QAV::Preload(void)
{
for (int i = 0; i < nFrames; i++)
{
for (int j = 0; j < 8; j++)
{
if (frames[i].tiles[j].picnum >= 0)
tilePreloadTile(frames[i].tiles[j].picnum);
}
}
}
void QAV::Precache(HitList &hits)
{
for (int i = 0; i < nFrames; i++)

View file

@ -82,7 +82,6 @@ struct QAV
void Draw(int ticks, int stat, int shade, int palnum, bool in3dscene);
void Draw(double x, double y, int ticks, int stat, int shade, int palnum, bool in3dscene);
void Play(int, int, int, void *);
void Preload(void);
void Precache(HitList &hits);
};

View file

@ -102,16 +102,6 @@ static void (*seqClientCallback[])(int, DBloodActor*) = {
//
//---------------------------------------------------------------------------
void Seq::Preload(void)
{
if (memcmp(signature, "SEQ\x1a", 4) != 0)
I_Error("Invalid sequence");
if ((version & 0xff00) != 0x300)
I_Error("Obsolete sequence version");
for (int i = 0; i < nFrames; i++)
tilePreloadTile(seqGetTile(&frames[i]));
}
void Seq::Precache(HitList& hits)
{
if (memcmp(signature, "SEQ\x1a", 4) != 0)

View file

@ -59,7 +59,6 @@ struct Seq {
short soundId;
int flags;
SEQFRAME frames[1];
void Preload(void);
void Precache(HitList&);
bool isLooping()

View file

@ -132,10 +132,6 @@ void viewDrawText(int nFont, const char *pString, int x, int y, int nShade, int
}
void InitStatusBar(void)
{
if (r_precache) PrecacheHardwareTextures(2200);
}
GameStats GameInterface::getStats()
{
return { gKillMgr.Kills, gKillMgr.TotalKills, gSecretMgr.Founds, gSecretMgr.Total, gFrameCount / kTicsPerSec, gPlayer[myconnectindex].fragCount };
@ -168,7 +164,6 @@ extern int dword_172CE0[16][3];
void viewInit(void)
{
Printf("Initializing status bar\n");
InitStatusBar();
FontSet(0, 4096, 0);
FontSet(1, 4192, 1);
FontSet(2, 4288, 1);

View file

@ -302,7 +302,7 @@ static void StartQAV(PLAYER *pPlayer, int nWeaponQAV, int callback, bool looped
pPlayer->weaponTimer = weaponQAV[nWeaponQAV]->duration;
pPlayer->qavCallback = callback;
pPlayer->qavLoop = looped;
weaponQAV[nWeaponQAV]->Preload();
//weaponQAV[nWeaponQAV]->Preload();
WeaponPlay(pPlayer);
pPlayer->weaponTimer -= 4;
}