mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-11 07:12:02 +00:00
- Fixed: translationtables cannot use a TAutoGrowArray because it doesn't
initialize newly added fields when growing. SVN r675 (trunk)
This commit is contained in:
parent
9cdd0b98ce
commit
ed242b32df
5 changed files with 13 additions and 7 deletions
|
@ -1,4 +1,6 @@
|
|||
January 7, 2008 (Changes by Graf Zahl)
|
||||
- Fixed: translationtables cannot use a TAutoGrowArray because it doesn't
|
||||
initialize newly added fields when growing.
|
||||
- Added fix for Heretic IDKFA cheat by Karate Chris.
|
||||
- Added fix for Strife's AlienSpectre obituary by Karate Chris.
|
||||
|
||||
|
|
|
@ -2719,17 +2719,19 @@ void G_SerializeLevel (FArchive &arc, bool hubLoad)
|
|||
}
|
||||
else
|
||||
{
|
||||
TArray<FRemapTable*> &tt = translationtables[TRANSLATION_LevelScripted];
|
||||
while (arc << w, w != 0xffff)
|
||||
{
|
||||
if (w >= MAX_ACS_TRANSLATIONS)
|
||||
{ // hack hack to avoid crashing
|
||||
w = 0;
|
||||
}
|
||||
trans = translationtables[TRANSLATION_LevelScripted].GetVal(w);
|
||||
while (tt.Size() <= w) tt.Push(NULL);
|
||||
trans = tt[w];
|
||||
if (trans == NULL)
|
||||
{
|
||||
trans = new FRemapTable;
|
||||
translationtables[TRANSLATION_LevelScripted].SetVal(t, trans);
|
||||
tt[w] = trans;
|
||||
}
|
||||
trans->Serialize(arc);
|
||||
}
|
||||
|
|
|
@ -4675,11 +4675,13 @@ int DLevelScript::RunScript ()
|
|||
sp--;
|
||||
if (i >= 1 && i <= MAX_ACS_TRANSLATIONS)
|
||||
{
|
||||
translation = translationtables[TRANSLATION_LevelScripted].GetVal(i - 1);
|
||||
TArray<FRemapTable*> &tt = translationtables[TRANSLATION_LevelScripted];
|
||||
while (tt.Size() < i) tt.Push(NULL);
|
||||
translation = tt[i-1];
|
||||
if (translation == NULL)
|
||||
{
|
||||
translation = new FRemapTable;
|
||||
translationtables[TRANSLATION_LevelScripted].SetVal(i - 1, translation);
|
||||
tt[i-1] = translation;
|
||||
}
|
||||
translation->MakeIdentity();
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
#include "gi.h"
|
||||
#include "stats.h"
|
||||
|
||||
TAutoGrowArray<FRemapTable *> translationtables[NUM_TRANSLATION_TABLES];
|
||||
TArray<FRemapTable *> translationtables[NUM_TRANSLATION_TABLES];
|
||||
|
||||
/****************************************************/
|
||||
/****************************************************/
|
||||
|
@ -281,7 +281,7 @@ FRemapTable *TranslationToTable(int translation)
|
|||
{
|
||||
unsigned int type = GetTranslationType(translation);
|
||||
unsigned int index = GetTranslationIndex(translation);
|
||||
TAutoGrowArray<FRemapTable *> *slots;
|
||||
TArray<FRemapTable *> *slots;
|
||||
|
||||
if (type <= 0 || type >= NUM_TRANSLATION_TABLES)
|
||||
{
|
||||
|
|
|
@ -49,7 +49,7 @@ private:
|
|||
void Alloc(int count);
|
||||
};
|
||||
|
||||
extern TAutoGrowArray<FRemapTable *> translationtables[NUM_TRANSLATION_TABLES];
|
||||
extern TArray<FRemapTable *> translationtables[NUM_TRANSLATION_TABLES];
|
||||
|
||||
#define TRANSLATION_SHIFT 16
|
||||
#define TRANSLATION_MASK ((1<<TRANSLATION_SHIFT)-1)
|
||||
|
|
Loading…
Reference in a new issue