From 63429268710e865e8cae13e71df20cf3d8a8b0d7 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 11 Apr 2021 12:10:52 +0200 Subject: [PATCH] - 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. --- source/games/blood/src/d_menu.cpp | 2 +- source/games/blood/src/misc.h | 1 - source/games/blood/src/nnexts.cpp | 2 +- source/games/blood/src/player.cpp | 2 +- source/games/blood/src/preload.cpp | 46 ------------------------------ source/games/blood/src/qav.cpp | 12 -------- source/games/blood/src/qav.h | 1 - source/games/blood/src/seq.cpp | 10 ------- source/games/blood/src/seq.h | 1 - source/games/blood/src/view.cpp | 5 ---- source/games/blood/src/weapon.cpp | 2 +- 11 files changed, 4 insertions(+), 80 deletions(-) diff --git a/source/games/blood/src/d_menu.cpp b/source/games/blood/src/d_menu.cpp index 39c305268..8db9fc494 100644 --- a/source/games/blood/src/d_menu.cpp +++ b/source/games/blood/src/d_menu.cpp @@ -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(); } diff --git a/source/games/blood/src/misc.h b/source/games/blood/src/misc.h index 0e5b404e7..09ce772d8 100644 --- a/source/games/blood/src/misc.h +++ b/source/games/blood/src/misc.h @@ -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); diff --git a/source/games/blood/src/nnexts.cpp b/source/games/blood/src/nnexts.cpp index f90fb1199..a708623e0 100644 --- a/source/games/blood/src/nnexts.cpp +++ b/source/games/blood/src/nnexts.cpp @@ -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; diff --git a/source/games/blood/src/player.cpp b/source/games/blood/src/player.cpp index 28ae4aec8..3fd2f6aae 100644 --- a/source/games/blood/src/player.cpp +++ b/source/games/blood/src/player.cpp @@ -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 { diff --git a/source/games/blood/src/preload.cpp b/source/games/blood/src/preload.cpp index 4c0e0661d..f64f5521f 100644 --- a/source/games/blood/src/preload.cpp +++ b/source/games/blood/src/preload.cpp @@ -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; diff --git a/source/games/blood/src/qav.cpp b/source/games/blood/src/qav.cpp index a17d24df6..fab15a288 100644 --- a/source/games/blood/src/qav.cpp +++ b/source/games/blood/src/qav.cpp @@ -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++) diff --git a/source/games/blood/src/qav.h b/source/games/blood/src/qav.h index d858a042b..07062c67e 100644 --- a/source/games/blood/src/qav.h +++ b/source/games/blood/src/qav.h @@ -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); }; diff --git a/source/games/blood/src/seq.cpp b/source/games/blood/src/seq.cpp index ddbb583a2..7ea06fbdf 100644 --- a/source/games/blood/src/seq.cpp +++ b/source/games/blood/src/seq.cpp @@ -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) diff --git a/source/games/blood/src/seq.h b/source/games/blood/src/seq.h index 538f460e9..481431c11 100644 --- a/source/games/blood/src/seq.h +++ b/source/games/blood/src/seq.h @@ -59,7 +59,6 @@ struct Seq { short soundId; int flags; SEQFRAME frames[1]; - void Preload(void); void Precache(HitList&); bool isLooping() diff --git a/source/games/blood/src/view.cpp b/source/games/blood/src/view.cpp index 16e6e8c24..28cc22f62 100644 --- a/source/games/blood/src/view.cpp +++ b/source/games/blood/src/view.cpp @@ -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); diff --git a/source/games/blood/src/weapon.cpp b/source/games/blood/src/weapon.cpp index 130074dd5..b720fbb80 100644 --- a/source/games/blood/src/weapon.cpp +++ b/source/games/blood/src/weapon.cpp @@ -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; }