mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-01-18 21:21:36 +00:00
- Fixed: The names in the Depths array in m_options.cpp were never freed.
- Fixed: FDoomEdMap needed a destructor. - Fixed: Decal animators were never freed. - Fixed: Colormaps were never freed. - Fixed: Memory allocated in R_InitTranslationTables() was never freed. - Fixed: R_InitParticles() allocated way more memory than it needed to. (And the particle memory was never freed, either.) - Fixed: FMetaTable::FreeMeta() should use delete[] to free string metadata. - Fixed: FConfigFile::ClearCurrentSection() must cast the entry to a char * before deleting it, because that's the way it was allocated. - Fixed definitions of DeadZombieMan and DeadShotgunGuy in doom/deadthings.txt. Skip_super resets the dropitem list, so having it after "DropItem None" is pointless. - Fixed: Decorate DropItem information was never freed. - Fixed: FinishStates() allocated even 0-entry state arrays. - Fixed: Default actor instances were never freed. - Fixed: FRandomSoundList never freed its sound list. - Fixed: Level and cluster strings read from MAPINFO were never freed. - Fixed: Episode names were never freed. - Fixed: InverseColormap and GoldColormap were never freed. Since they're always allocated, they can just be arrays rather than pointers. - Fixed: FFont destructor never freed any of the character data or the font's name. - Fixed: Fonts were not freed at exit. - Fixed: FStringTable::LoadLanguage() did not call SC_Close(). - Fixed: When using the -iwad parameter, IdentifyVersion() did not release the buffer it created to hold the parameter's path. SVN r88 (trunk)
This commit is contained in:
parent
201e17082c
commit
df17a60f5d
26 changed files with 314 additions and 131 deletions
|
@ -1,4 +1,30 @@
|
||||||
May 8, 2006
|
May 8, 2006
|
||||||
|
- Fixed: The names in the Depths array in m_options.cpp were never freed.
|
||||||
|
- Fixed: FDoomEdMap needed a destructor.
|
||||||
|
- Fixed: Decal animators were never freed.
|
||||||
|
- Fixed: Colormaps were never freed.
|
||||||
|
- Fixed: Memory allocated in R_InitTranslationTables() was never freed.
|
||||||
|
- Fixed: R_InitParticles() allocated way more memory than it needed to. (And the
|
||||||
|
particle memory was never freed, either.)
|
||||||
|
- Fixed: FMetaTable::FreeMeta() should use delete[] to free string metadata.
|
||||||
|
- Fixed: FConfigFile::ClearCurrentSection() must cast the entry to a char *
|
||||||
|
before deleting it, because that's the way it was allocated.
|
||||||
|
- Fixed definitions of DeadZombieMan and DeadShotgunGuy in doom/deadthings.txt.
|
||||||
|
Skip_super resets the dropitem list, so having it after "DropItem None" is
|
||||||
|
pointless.
|
||||||
|
- Fixed: Decorate DropItem information was never freed.
|
||||||
|
- Fixed: FinishStates() allocated even 0-entry state arrays.
|
||||||
|
- Fixed: Default actor instances were never freed.
|
||||||
|
- Fixed: FRandomSoundList never freed its sound list.
|
||||||
|
- Fixed: Level and cluster strings read from MAPINFO were never freed.
|
||||||
|
- Fixed: Episode names were never freed.
|
||||||
|
- Fixed: InverseColormap and GoldColormap were never freed. Since they're always
|
||||||
|
allocated, they can just be arrays rather than pointers.
|
||||||
|
- Fixed: FFont destructor never freed any of the character data or the font's name.
|
||||||
|
- Fixed: Fonts were not freed at exit.
|
||||||
|
- Fixed: FStringTable::LoadLanguage() did not call SC_Close().
|
||||||
|
- Fixed: When using the -iwad parameter, IdentifyVersion() did not release the
|
||||||
|
buffer it created to hold the parameter's path.
|
||||||
- Blends created with the ACS fade commands now degrade to transparent overlays
|
- Blends created with the ACS fade commands now degrade to transparent overlays
|
||||||
when the menu is visible, so they can no longer obscure the menu.
|
when the menu is visible, so they can no longer obscure the menu.
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ void FConfigFile::ClearCurrentSection ()
|
||||||
{
|
{
|
||||||
next = entry->Next;
|
next = entry->Next;
|
||||||
delete[] entry->Value;
|
delete[] entry->Value;
|
||||||
delete entry;
|
delete (char *)entry;
|
||||||
entry = next;
|
entry = next;
|
||||||
}
|
}
|
||||||
CurrentSection->RootEntry = NULL;
|
CurrentSection->RootEntry = NULL;
|
||||||
|
|
|
@ -1550,17 +1550,16 @@ static EIWADType IdentifyVersion (const char *zdoom_wad)
|
||||||
int pickwad;
|
int pickwad;
|
||||||
size_t i;
|
size_t i;
|
||||||
bool iwadparmfound = false;
|
bool iwadparmfound = false;
|
||||||
|
FString custwad;
|
||||||
|
|
||||||
memset (wads, 0, sizeof(wads));
|
memset (wads, 0, sizeof(wads));
|
||||||
|
|
||||||
if (iwadparm)
|
if (iwadparm)
|
||||||
{
|
{
|
||||||
char *custwad = new char[strlen (iwadparm) + 5];
|
custwad = iwadparm;
|
||||||
strcpy (custwad, iwadparm);
|
FixPathSeperator (custwad.GetChars());
|
||||||
FixPathSeperator (custwad);
|
|
||||||
if (CheckIWAD (custwad, wads))
|
if (CheckIWAD (custwad, wads))
|
||||||
{ // -iwad parameter was a directory
|
{ // -iwad parameter was a directory
|
||||||
delete[] custwad;
|
|
||||||
iwadparm = NULL;
|
iwadparm = NULL;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -2015,13 +2014,12 @@ void D_DoomMain (void)
|
||||||
// [RH] Initialize localizable strings.
|
// [RH] Initialize localizable strings.
|
||||||
GStrings.LoadStrings (false);
|
GStrings.LoadStrings (false);
|
||||||
|
|
||||||
//P_InitXlat ();
|
|
||||||
|
|
||||||
// [RH] Moved these up here so that we can do most of our
|
// [RH] Moved these up here so that we can do most of our
|
||||||
// startup output in a fullscreen console.
|
// startup output in a fullscreen console.
|
||||||
|
|
||||||
CT_Init ();
|
CT_Init ();
|
||||||
I_Init ();
|
I_Init ();
|
||||||
|
|
||||||
V_Init ();
|
V_Init ();
|
||||||
|
|
||||||
// Base systems have been inited; enable cvar callbacks
|
// Base systems have been inited; enable cvar callbacks
|
||||||
|
|
|
@ -92,10 +92,22 @@ struct FDecalAnimator
|
||||||
virtual ~FDecalAnimator ();
|
virtual ~FDecalAnimator ();
|
||||||
virtual DThinker *CreateThinker (DBaseDecal *actor, side_t *wall) const = 0;
|
virtual DThinker *CreateThinker (DBaseDecal *actor, side_t *wall) const = 0;
|
||||||
|
|
||||||
char *Name;
|
FName Name;
|
||||||
};
|
};
|
||||||
|
|
||||||
static TArray<FDecalAnimator *> Animators;
|
class FDecalAnimatorArray : public TArray<FDecalAnimator *>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
~FDecalAnimatorArray()
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i < Size(); ++i)
|
||||||
|
{
|
||||||
|
delete (*this)[i];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
FDecalAnimatorArray Animators;
|
||||||
|
|
||||||
struct DDecalThinker : public DThinker
|
struct DDecalThinker : public DThinker
|
||||||
{
|
{
|
||||||
|
@ -554,7 +566,7 @@ void FDecalLib::ParseDecalGroup ()
|
||||||
SC_MustGetString ();
|
SC_MustGetString ();
|
||||||
if (SC_Compare ("}"))
|
if (SC_Compare ("}"))
|
||||||
{
|
{
|
||||||
group->Name = copystring (groupName);
|
group->Name = groupName;
|
||||||
group->SpawnID = decalNum;
|
group->SpawnID = decalNum;
|
||||||
AddDecal (group);
|
AddDecal (group);
|
||||||
break;
|
break;
|
||||||
|
@ -835,7 +847,7 @@ void FDecalLib::AddDecal (const char *name, byte num, const FDecalTemplate &deca
|
||||||
FDecalTemplate *newDecal = new FDecalTemplate;
|
FDecalTemplate *newDecal = new FDecalTemplate;
|
||||||
|
|
||||||
*newDecal = decal;
|
*newDecal = decal;
|
||||||
newDecal->Name = copystring (name);
|
newDecal->Name = name;
|
||||||
newDecal->SpawnID = num;
|
newDecal->SpawnID = num;
|
||||||
AddDecal (newDecal);
|
AddDecal (newDecal);
|
||||||
}
|
}
|
||||||
|
@ -987,13 +999,11 @@ FDecalLib::FTranslation *FDecalLib::GenerateTranslation (DWORD start, DWORD end)
|
||||||
|
|
||||||
FDecalBase::FDecalBase ()
|
FDecalBase::FDecalBase ()
|
||||||
{
|
{
|
||||||
Name = NULL;
|
Name = NAME_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
FDecalBase::~FDecalBase ()
|
FDecalBase::~FDecalBase ()
|
||||||
{
|
{
|
||||||
if (Name != NULL)
|
|
||||||
delete[] Name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void FDecalTemplate::ApplyToDecal (DBaseDecal *decal, side_t *wall) const
|
void FDecalTemplate::ApplyToDecal (DBaseDecal *decal, side_t *wall) const
|
||||||
|
@ -1101,16 +1111,11 @@ const FDecalTemplate *FDecalGroup::GetDecal () const
|
||||||
|
|
||||||
FDecalAnimator::FDecalAnimator (const char *name)
|
FDecalAnimator::FDecalAnimator (const char *name)
|
||||||
{
|
{
|
||||||
Name = copystring (name);
|
Name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
FDecalAnimator::~FDecalAnimator ()
|
FDecalAnimator::~FDecalAnimator ()
|
||||||
{
|
{
|
||||||
if (Name != NULL)
|
|
||||||
{
|
|
||||||
delete[] Name;
|
|
||||||
Name = NULL;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
IMPLEMENT_CLASS (DDecalFader)
|
IMPLEMENT_CLASS (DDecalFader)
|
||||||
|
|
|
@ -38,6 +38,7 @@
|
||||||
|
|
||||||
#include "doomtype.h"
|
#include "doomtype.h"
|
||||||
#include "tarray.h"
|
#include "tarray.h"
|
||||||
|
#include "name.h"
|
||||||
|
|
||||||
class AActor;
|
class AActor;
|
||||||
class FDecalTemplate;
|
class FDecalTemplate;
|
||||||
|
@ -57,7 +58,7 @@ protected:
|
||||||
virtual ~FDecalBase ();
|
virtual ~FDecalBase ();
|
||||||
|
|
||||||
FDecalBase *Left, *Right;
|
FDecalBase *Left, *Right;
|
||||||
char *Name;
|
FName Name;
|
||||||
BYTE SpawnID;
|
BYTE SpawnID;
|
||||||
TArray<const TypeInfo *> Users; // Which actors generate this decal
|
TArray<const TypeInfo *> Users; // Which actors generate this decal
|
||||||
};
|
};
|
||||||
|
|
|
@ -118,6 +118,14 @@ static struct TypeInfoDataFreeer
|
||||||
|
|
||||||
void TypeInfo::StaticFreeData (TypeInfo *type)
|
void TypeInfo::StaticFreeData (TypeInfo *type)
|
||||||
{
|
{
|
||||||
|
if (type->ActorInfo != NULL)
|
||||||
|
{
|
||||||
|
if (type->ActorInfo->Defaults != NULL)
|
||||||
|
{
|
||||||
|
delete[] type->ActorInfo->Defaults;
|
||||||
|
type->ActorInfo->Defaults = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
if (type->bRuntimeClass)
|
if (type->bRuntimeClass)
|
||||||
{
|
{
|
||||||
if (type->Name != NULL)
|
if (type->Name != NULL)
|
||||||
|
@ -127,6 +135,11 @@ void TypeInfo::StaticFreeData (TypeInfo *type)
|
||||||
type->Name = NULL;
|
type->Name = NULL;
|
||||||
if (type->ActorInfo != NULL)
|
if (type->ActorInfo != NULL)
|
||||||
{
|
{
|
||||||
|
if (type->ActorInfo->OwnedStates != NULL)
|
||||||
|
{
|
||||||
|
delete[] type->ActorInfo->OwnedStates;
|
||||||
|
type->ActorInfo->OwnedStates = NULL;
|
||||||
|
}
|
||||||
delete type->ActorInfo;
|
delete type->ActorInfo;
|
||||||
type->ActorInfo = NULL;
|
type->ActorInfo = NULL;
|
||||||
}
|
}
|
||||||
|
@ -350,7 +363,7 @@ void FMetaTable::FreeMeta ()
|
||||||
switch (meta->Type)
|
switch (meta->Type)
|
||||||
{
|
{
|
||||||
case META_String:
|
case META_String:
|
||||||
delete meta->Value.String;
|
delete[] meta->Value.String;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -95,6 +95,17 @@ static void InitPlayerClasses ();
|
||||||
static void ParseEpisodeInfo ();
|
static void ParseEpisodeInfo ();
|
||||||
static void G_DoParseMapInfo (int lump);
|
static void G_DoParseMapInfo (int lump);
|
||||||
static void SetLevelNum (level_info_t *info, int num);
|
static void SetLevelNum (level_info_t *info, int num);
|
||||||
|
static void ClearEpisodes ();
|
||||||
|
static void ClearLevelInfoStrings (level_info_t *linfo);
|
||||||
|
static void ClearClusterInfoStrings (cluster_info_t *cinfo);
|
||||||
|
|
||||||
|
static struct EpisodeKiller
|
||||||
|
{
|
||||||
|
~EpisodeKiller()
|
||||||
|
{
|
||||||
|
ClearEpisodes();
|
||||||
|
}
|
||||||
|
} KillTheEpisodes;
|
||||||
|
|
||||||
static FRandom pr_classchoice ("RandomPlayerClassChoice");
|
static FRandom pr_classchoice ("RandomPlayerClassChoice");
|
||||||
|
|
||||||
|
@ -130,6 +141,23 @@ level_locals_t level; // info about current level
|
||||||
static TArray<cluster_info_t> wadclusterinfos;
|
static TArray<cluster_info_t> wadclusterinfos;
|
||||||
TArray<level_info_t> wadlevelinfos;
|
TArray<level_info_t> wadlevelinfos;
|
||||||
|
|
||||||
|
static struct LevelClusterInfoKiller
|
||||||
|
{
|
||||||
|
~LevelClusterInfoKiller()
|
||||||
|
{
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
for (i = 0; i < wadlevelinfos.Size(); ++i)
|
||||||
|
{
|
||||||
|
ClearLevelInfoStrings (&wadlevelinfos[i]);
|
||||||
|
}
|
||||||
|
for (i = 0; i < wadclusterinfos.Size(); ++i)
|
||||||
|
{
|
||||||
|
ClearClusterInfoStrings (&wadclusterinfos[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} KillTheLevelAndClusterInfos;
|
||||||
|
|
||||||
// MAPINFO is parsed slightly differently when the map name is just a number.
|
// MAPINFO is parsed slightly differently when the map name is just a number.
|
||||||
static bool HexenHack;
|
static bool HexenHack;
|
||||||
|
|
||||||
|
@ -532,8 +560,16 @@ static void G_DoParseMapInfo (int lump)
|
||||||
{
|
{
|
||||||
levelindex = wadlevelinfos.Reserve(1);
|
levelindex = wadlevelinfos.Reserve(1);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ClearLevelInfoStrings (&wadlevelinfos[levelindex]);
|
||||||
|
}
|
||||||
levelinfo = &wadlevelinfos[levelindex];
|
levelinfo = &wadlevelinfos[levelindex];
|
||||||
memcpy (levelinfo, &defaultinfo, sizeof(*levelinfo));
|
memcpy (levelinfo, &defaultinfo, sizeof(*levelinfo));
|
||||||
|
if (levelinfo->music != NULL)
|
||||||
|
{
|
||||||
|
levelinfo->music = copystring (levelinfo->music);
|
||||||
|
}
|
||||||
if (HexenHack)
|
if (HexenHack)
|
||||||
{
|
{
|
||||||
levelinfo->WallHorizLight = levelinfo->WallVertLight = 0;
|
levelinfo->WallHorizLight = levelinfo->WallVertLight = 0;
|
||||||
|
@ -612,6 +648,10 @@ static void G_DoParseMapInfo (int lump)
|
||||||
{
|
{
|
||||||
delete[] clusterinfo->messagemusic;
|
delete[] clusterinfo->messagemusic;
|
||||||
}
|
}
|
||||||
|
if (clusterinfo->clustername != NULL)
|
||||||
|
{
|
||||||
|
delete[] clusterinfo->clustername;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
memset (clusterinfo, 0, sizeof(cluster_info_t));
|
memset (clusterinfo, 0, sizeof(cluster_info_t));
|
||||||
clusterinfo->cluster = sc_Number;
|
clusterinfo->cluster = sc_Number;
|
||||||
|
@ -623,18 +663,61 @@ static void G_DoParseMapInfo (int lump)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case MITL_CLEAREPISODES:
|
case MITL_CLEAREPISODES:
|
||||||
for (int i = 0; i < EpiDef.numitems; ++i)
|
ClearEpisodes ();
|
||||||
{
|
|
||||||
delete[] const_cast<char *>(EpisodeMenu[i].name);
|
|
||||||
EpisodeMenu[i].name = NULL;
|
|
||||||
}
|
|
||||||
EpiDef.numitems = 0;
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
SC_Close ();
|
SC_Close ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void ClearLevelInfoStrings(level_info_t *linfo)
|
||||||
|
{
|
||||||
|
if (linfo->music != NULL)
|
||||||
|
{
|
||||||
|
delete[] linfo->music;
|
||||||
|
linfo->music = NULL;
|
||||||
|
}
|
||||||
|
if (linfo->level_name != NULL)
|
||||||
|
{
|
||||||
|
delete[] linfo->level_name;
|
||||||
|
linfo->level_name = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ClearClusterInfoStrings(cluster_info_t *cinfo)
|
||||||
|
{
|
||||||
|
if (cinfo->exittext != NULL)
|
||||||
|
{
|
||||||
|
delete[] cinfo->exittext;
|
||||||
|
cinfo->exittext = NULL;
|
||||||
|
}
|
||||||
|
if (cinfo->entertext != NULL)
|
||||||
|
{
|
||||||
|
delete[] cinfo->entertext;
|
||||||
|
cinfo->entertext = NULL;
|
||||||
|
}
|
||||||
|
if (cinfo->messagemusic != NULL)
|
||||||
|
{
|
||||||
|
delete[] cinfo->messagemusic;
|
||||||
|
cinfo->messagemusic = NULL;
|
||||||
|
}
|
||||||
|
if (cinfo->clustername != NULL)
|
||||||
|
{
|
||||||
|
delete[] cinfo->clustername;
|
||||||
|
cinfo->clustername = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void ClearEpisodes()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < EpiDef.numitems; ++i)
|
||||||
|
{
|
||||||
|
delete[] const_cast<char *>(EpisodeMenu[i].name);
|
||||||
|
EpisodeMenu[i].name = NULL;
|
||||||
|
}
|
||||||
|
EpiDef.numitems = 0;
|
||||||
|
}
|
||||||
|
|
||||||
static void ParseMapInfoLower (MapInfoHandler *handlers,
|
static void ParseMapInfoLower (MapInfoHandler *handlers,
|
||||||
const char *strings[],
|
const char *strings[],
|
||||||
level_info_t *levelinfo,
|
level_info_t *levelinfo,
|
||||||
|
|
|
@ -31,19 +31,6 @@ BEGIN_DEFAULTS (AWeapon, Any, -1, 0)
|
||||||
PROP_Inventory_PickupSound ("misc/w_pkup")
|
PROP_Inventory_PickupSound ("misc/w_pkup")
|
||||||
END_DEFAULTS
|
END_DEFAULTS
|
||||||
|
|
||||||
ACTOR_STATE_NAMES(AWeapon) =
|
|
||||||
{
|
|
||||||
{ (FState *AActor::*)&AWeapon::UpState, "Up" },
|
|
||||||
{ (FState *AActor::*)&AWeapon::DownState, "Down" },
|
|
||||||
{ (FState *AActor::*)&AWeapon::ReadyState, "Ready" },
|
|
||||||
{ (FState *AActor::*)&AWeapon::AtkState, "Attack" },
|
|
||||||
{ (FState *AActor::*)&AWeapon::HoldAtkState, "HoldAttack" },
|
|
||||||
{ (FState *AActor::*)&AWeapon::AltAtkState, "AltAttack" },
|
|
||||||
{ (FState *AActor::*)&AWeapon::AltHoldAtkState, "AltHoldAttack" },
|
|
||||||
{ (FState *AActor::*)&AWeapon::FlashState, "Flash" },
|
|
||||||
{ 0, NAME_None }
|
|
||||||
};
|
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
//
|
//
|
||||||
// AWeapon :: Serialize
|
// AWeapon :: Serialize
|
||||||
|
|
|
@ -303,6 +303,11 @@ FDoomEdMap DoomEdMap;
|
||||||
|
|
||||||
FDoomEdMap::FDoomEdEntry *FDoomEdMap::DoomEdHash[DOOMED_HASHSIZE];
|
FDoomEdMap::FDoomEdEntry *FDoomEdMap::DoomEdHash[DOOMED_HASHSIZE];
|
||||||
|
|
||||||
|
FDoomEdMap::~FDoomEdMap()
|
||||||
|
{
|
||||||
|
Empty();
|
||||||
|
}
|
||||||
|
|
||||||
void FDoomEdMap::AddType (int doomednum, const TypeInfo *type)
|
void FDoomEdMap::AddType (int doomednum, const TypeInfo *type)
|
||||||
{
|
{
|
||||||
unsigned int hash = (unsigned int)doomednum % DOOMED_HASHSIZE;
|
unsigned int hash = (unsigned int)doomednum % DOOMED_HASHSIZE;
|
||||||
|
|
|
@ -353,12 +353,6 @@ enum
|
||||||
ADEF_EOL = 0xED5E // End Of List
|
ADEF_EOL = 0xED5E // End Of List
|
||||||
};
|
};
|
||||||
|
|
||||||
struct FStateName
|
|
||||||
{
|
|
||||||
FState *AActor::*State;
|
|
||||||
FName Name;
|
|
||||||
};
|
|
||||||
|
|
||||||
#if _MSC_VER
|
#if _MSC_VER
|
||||||
// nonstandard extension used : zero-sized array in struct/union
|
// nonstandard extension used : zero-sized array in struct/union
|
||||||
#pragma warning(disable:4200)
|
#pragma warning(disable:4200)
|
||||||
|
@ -378,7 +372,6 @@ struct FActorInfo
|
||||||
TypeInfo *Class;
|
TypeInfo *Class;
|
||||||
FState *OwnedStates;
|
FState *OwnedStates;
|
||||||
BYTE *Defaults;
|
BYTE *Defaults;
|
||||||
FStateName *StateNames;
|
|
||||||
int NumOwnedStates;
|
int NumOwnedStates;
|
||||||
BYTE GameFilter;
|
BYTE GameFilter;
|
||||||
BYTE SpawnID;
|
BYTE SpawnID;
|
||||||
|
@ -400,6 +393,8 @@ struct FActorInfo
|
||||||
class FDoomEdMap
|
class FDoomEdMap
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
|
~FDoomEdMap();
|
||||||
|
|
||||||
const TypeInfo *FindType (int doomednum) const;
|
const TypeInfo *FindType (int doomednum) const;
|
||||||
void AddType (int doomednum, const TypeInfo *type);
|
void AddType (int doomednum, const TypeInfo *type);
|
||||||
void DelType (int doomednum);
|
void DelType (int doomednum);
|
||||||
|
|
|
@ -173,12 +173,12 @@ public:
|
||||||
|
|
||||||
#define BEGIN_DEFAULTS(actor,game,ednum,spawnid) \
|
#define BEGIN_DEFAULTS(actor,game,ednum,spawnid) \
|
||||||
BEGIN_DEFAULTS_PRE(actor) \
|
BEGIN_DEFAULTS_PRE(actor) \
|
||||||
RUNTIME_CLASS(actor), &actor::States[0], NULL, NULL, countof(actor::States), \
|
RUNTIME_CLASS(actor), &actor::States[0], NULL, countof(actor::States), \
|
||||||
BEGIN_DEFAULTS_POST(actor,game,ednum,spawnid)
|
BEGIN_DEFAULTS_POST(actor,game,ednum,spawnid)
|
||||||
|
|
||||||
#define BEGIN_STATELESS_DEFAULTS(actor,game,ednum,spawnid) \
|
#define BEGIN_STATELESS_DEFAULTS(actor,game,ednum,spawnid) \
|
||||||
BEGIN_DEFAULTS_PRE(actor) \
|
BEGIN_DEFAULTS_PRE(actor) \
|
||||||
RUNTIME_CLASS(actor), NULL, NULL, NULL, 0, \
|
RUNTIME_CLASS(actor), NULL, NULL, 0, \
|
||||||
BEGIN_DEFAULTS_POST(actor,game,ednum,spawnid)
|
BEGIN_DEFAULTS_POST(actor,game,ednum,spawnid)
|
||||||
|
|
||||||
// IMPLEMENT_ACTOR combines IMPLEMENT_CLASS and BEGIN_DEFAULTS
|
// IMPLEMENT_ACTOR combines IMPLEMENT_CLASS and BEGIN_DEFAULTS
|
||||||
|
@ -191,13 +191,6 @@ public:
|
||||||
#define IMPLEMENT_ABSTRACT_ACTOR(actor) \
|
#define IMPLEMENT_ABSTRACT_ACTOR(actor) \
|
||||||
IMPLEMENT_STATELESS_ACTOR(actor,Any,-1,0) END_DEFAULTS
|
IMPLEMENT_STATELESS_ACTOR(actor,Any,-1,0) END_DEFAULTS
|
||||||
|
|
||||||
#define ACTOR_STATE_NAMES(actor) \
|
|
||||||
extern FStateName actor##StateNames[]; \
|
|
||||||
extern FActorInfo actor##ActorInfo; \
|
|
||||||
struct actor##StateNamesAssignerClass { actor##StateNamesAssignerClass() { actor##ActorInfo.StateNames = actor##StateNames; } } \
|
|
||||||
actor##StateNamesAssigner; \
|
|
||||||
FStateName actor##StateNames[]
|
|
||||||
|
|
||||||
#define PROP_SeeSound(x) ADD_STRING_PROP(ADEF_SeeSound,"\1",x)
|
#define PROP_SeeSound(x) ADD_STRING_PROP(ADEF_SeeSound,"\1",x)
|
||||||
#define PROP_AttackSound(x) ADD_STRING_PROP(ADEF_AttackSound,"\2",x)
|
#define PROP_AttackSound(x) ADD_STRING_PROP(ADEF_AttackSound,"\2",x)
|
||||||
#define PROP_PainSound(x) ADD_STRING_PROP(ADEF_PainSound,"\3",x)
|
#define PROP_PainSound(x) ADD_STRING_PROP(ADEF_PainSound,"\3",x)
|
||||||
|
|
|
@ -799,6 +799,21 @@ EXTERN_CVAR (Bool, fullscreen)
|
||||||
|
|
||||||
static value_t Depths[22];
|
static value_t Depths[22];
|
||||||
|
|
||||||
|
static struct DepthNameKiller
|
||||||
|
{
|
||||||
|
~DepthNameKiller()
|
||||||
|
{
|
||||||
|
for (int i = 0; i < countof(Depths); ++i)
|
||||||
|
{
|
||||||
|
if (Depths[i].name != NULL)
|
||||||
|
{
|
||||||
|
delete[] Depths[i].name;
|
||||||
|
Depths[i].name = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} KillTheDepthValues;
|
||||||
|
|
||||||
EXTERN_CVAR (Bool, vid_tft) // Defined below
|
EXTERN_CVAR (Bool, vid_tft) // Defined below
|
||||||
CUSTOM_CVAR (Int, menu_screenratios, 0, CVAR_ARCHIVE)
|
CUSTOM_CVAR (Int, menu_screenratios, 0, CVAR_ARCHIVE)
|
||||||
{
|
{
|
||||||
|
@ -1155,7 +1170,7 @@ void M_OptInit (void)
|
||||||
int currval = 0, dummy1, dummy2, i;
|
int currval = 0, dummy1, dummy2, i;
|
||||||
char name[24];
|
char name[24];
|
||||||
|
|
||||||
for (i = 1; i < 32; i++)
|
for (i = 1; i < 32 && currval < countof(Depths); i++)
|
||||||
{
|
{
|
||||||
I_StartModeIterator (i);
|
I_StartModeIterator (i);
|
||||||
if (I_NextMode (&dummy1, &dummy2, NULL))
|
if (I_NextMode (&dummy1, &dummy2, NULL))
|
||||||
|
|
|
@ -168,24 +168,6 @@ IMPLEMENT_POINTY_CLASS (AActor)
|
||||||
DECLARE_POINTER (master)
|
DECLARE_POINTER (master)
|
||||||
END_POINTERS
|
END_POINTERS
|
||||||
|
|
||||||
ACTOR_STATE_NAMES(AActor) =
|
|
||||||
{
|
|
||||||
{ &AActor::SpawnState, "Spawn" },
|
|
||||||
{ &AActor::SeeState, "See" },
|
|
||||||
{ &AActor::PainState, "Pain" },
|
|
||||||
{ &AActor::MeleeState, "Melee" },
|
|
||||||
{ &AActor::MissileState, "Missile" },
|
|
||||||
{ &AActor::CrashState, "Crash" },
|
|
||||||
{ &AActor::DeathState, "Death" },
|
|
||||||
{ &AActor::XDeathState, "XDeath" },
|
|
||||||
{ &AActor::BDeathState, "Burn" },
|
|
||||||
{ &AActor::IDeathState, "Ice" },
|
|
||||||
{ &AActor::EDeathState, "Disintegrate" },
|
|
||||||
{ &AActor::RaiseState, "Raise" },
|
|
||||||
{ &AActor::WoundState, "Wound" },
|
|
||||||
{ 0, NAME_None }
|
|
||||||
};
|
|
||||||
|
|
||||||
AActor::~AActor ()
|
AActor::~AActor ()
|
||||||
{
|
{
|
||||||
// Please avoid calling the destructor directly (or through delete)!
|
// Please avoid calling the destructor directly (or through delete)!
|
||||||
|
|
|
@ -2836,6 +2836,23 @@ int firstfakecmap;
|
||||||
byte *realcolormaps;
|
byte *realcolormaps;
|
||||||
int lastusedcolormap;
|
int lastusedcolormap;
|
||||||
|
|
||||||
|
static struct ColorMapKiller
|
||||||
|
{
|
||||||
|
~ColorMapKiller()
|
||||||
|
{
|
||||||
|
if (fakecmaps != NULL)
|
||||||
|
{
|
||||||
|
delete fakecmaps;
|
||||||
|
fakecmaps = NULL;
|
||||||
|
}
|
||||||
|
if (realcolormaps != NULL)
|
||||||
|
{
|
||||||
|
delete realcolormaps;
|
||||||
|
realcolormaps = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} KillTheColormaps;
|
||||||
|
|
||||||
void R_SetDefaultColormap (const char *name)
|
void R_SetDefaultColormap (const char *name)
|
||||||
{
|
{
|
||||||
if (strnicmp (fakecmaps[0].name, name, 8) != 0)
|
if (strnicmp (fakecmaps[0].name, name, 8) != 0)
|
||||||
|
|
|
@ -1212,18 +1212,19 @@ void R_DrawFogBoundary (int x1, int x2, short *uclip, short *dclip)
|
||||||
//
|
//
|
||||||
void R_InitTranslationTables ()
|
void R_InitTranslationTables ()
|
||||||
{
|
{
|
||||||
int i, j;
|
static BYTE MainTranslationTables[256*
|
||||||
|
|
||||||
// Diminishing translucency tables for shaded actors. Not really
|
|
||||||
// translation tables, but putting them here was convenient, particularly
|
|
||||||
// since translationtables[0] would otherwise be wasted.
|
|
||||||
translationtables[0] = new BYTE[256*
|
|
||||||
(NUMCOLORMAPS*16 // Shaded
|
(NUMCOLORMAPS*16 // Shaded
|
||||||
+MAXPLAYERS*2 // Players + PlayersExtra
|
+MAXPLAYERS*2 // Players + PlayersExtra
|
||||||
+8 // Standard (7 for Strife, 3 for the rest)
|
+8 // Standard (7 for Strife, 3 for the rest)
|
||||||
+MAX_ACS_TRANSLATIONS // LevelScripted
|
+MAX_ACS_TRANSLATIONS // LevelScripted
|
||||||
+BODYQUESIZE // PlayerCorpses
|
+BODYQUESIZE // PlayerCorpses
|
||||||
)];
|
)];
|
||||||
|
int i, j;
|
||||||
|
|
||||||
|
// Diminishing translucency tables for shaded actors. Not really
|
||||||
|
// translation tables, but putting them here was convenient, particularly
|
||||||
|
// since translationtables[0] would otherwise be wasted.
|
||||||
|
translationtables[0] = MainTranslationTables;
|
||||||
|
|
||||||
// Player translations, one for each player
|
// Player translations, one for each player
|
||||||
translationtables[TRANSLATION_Players] =
|
translationtables[TRANSLATION_Players] =
|
||||||
|
|
|
@ -23,6 +23,10 @@
|
||||||
#ifndef __R_MAIN_H__
|
#ifndef __R_MAIN_H__
|
||||||
#define __R_MAIN_H__
|
#define __R_MAIN_H__
|
||||||
|
|
||||||
|
// Number of diminishing brightness levels.
|
||||||
|
// There a 0-31, i.e. 32 LUT in the COLORMAP lump.
|
||||||
|
#define NUMCOLORMAPS 32
|
||||||
|
|
||||||
#include "d_player.h"
|
#include "d_player.h"
|
||||||
#include "r_data.h"
|
#include "r_data.h"
|
||||||
#include "r_bsp.h"
|
#include "r_bsp.h"
|
||||||
|
@ -83,9 +87,6 @@ extern int r_Yaspect;
|
||||||
// 16 discrete light levels. The terminology I use is borrowed from Build.
|
// 16 discrete light levels. The terminology I use is borrowed from Build.
|
||||||
//
|
//
|
||||||
|
|
||||||
// Number of diminishing brightness levels.
|
|
||||||
// There a 0-31, i.e. 32 LUT in the COLORMAP lump.
|
|
||||||
#define NUMCOLORMAPS 32
|
|
||||||
#define INVERSECOLORMAP 32
|
#define INVERSECOLORMAP 32
|
||||||
#define GOLDCOLORMAP 33
|
#define GOLDCOLORMAP 33
|
||||||
|
|
||||||
|
|
|
@ -1975,6 +1975,14 @@ void R_DrawMasked (void)
|
||||||
// [RH] Particle functions
|
// [RH] Particle functions
|
||||||
//
|
//
|
||||||
|
|
||||||
|
static void STACK_ARGS FreeParticles()
|
||||||
|
{
|
||||||
|
if (Particles != NULL)
|
||||||
|
{
|
||||||
|
delete[] Particles;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void R_InitParticles ()
|
void R_InitParticles ()
|
||||||
{
|
{
|
||||||
char *i;
|
char *i;
|
||||||
|
@ -1986,8 +1994,9 @@ void R_InitParticles ()
|
||||||
else if (NumParticles < 100)
|
else if (NumParticles < 100)
|
||||||
NumParticles = 100;
|
NumParticles = 100;
|
||||||
|
|
||||||
Particles = new particle_t[NumParticles * sizeof(particle_t)];
|
Particles = new particle_t[NumParticles];
|
||||||
R_ClearParticles ();
|
R_ClearParticles ();
|
||||||
|
atterm (FreeParticles);
|
||||||
}
|
}
|
||||||
|
|
||||||
void R_ClearParticles ()
|
void R_ClearParticles ()
|
||||||
|
|
|
@ -62,11 +62,31 @@
|
||||||
|
|
||||||
struct FRandomSoundList
|
struct FRandomSoundList
|
||||||
{
|
{
|
||||||
|
FRandomSoundList()
|
||||||
|
: Sounds(0), SfxHead(0), NumSounds(0)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
~FRandomSoundList()
|
||||||
|
{
|
||||||
|
if (Sounds != NULL)
|
||||||
|
{
|
||||||
|
delete[] Sounds;
|
||||||
|
Sounds = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
WORD *Sounds; // A list of sounds that can result for the following id
|
WORD *Sounds; // A list of sounds that can result for the following id
|
||||||
WORD SfxHead; // The sound id used to reference this list
|
WORD SfxHead; // The sound id used to reference this list
|
||||||
WORD NumSounds;
|
WORD NumSounds;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
void CopyForTArray<FRandomSoundList> (FRandomSoundList &dst, FRandomSoundList &src)
|
||||||
|
{
|
||||||
|
dst = src;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
struct FPlayerClassLookup
|
struct FPlayerClassLookup
|
||||||
{
|
{
|
||||||
char Name[MAX_SNDNAME+1];
|
char Name[MAX_SNDNAME+1];
|
||||||
|
@ -540,10 +560,6 @@ static void S_ClearSoundData()
|
||||||
if (Ambients[i]) delete Ambients[i];
|
if (Ambients[i]) delete Ambients[i];
|
||||||
Ambients[i]=NULL;
|
Ambients[i]=NULL;
|
||||||
}
|
}
|
||||||
for(i=0;i<S_rnd.Size();i++)
|
|
||||||
{
|
|
||||||
delete[] S_rnd[i].Sounds;
|
|
||||||
}
|
|
||||||
while (MusicVolumes != NULL)
|
while (MusicVolumes != NULL)
|
||||||
{
|
{
|
||||||
FMusicVolume * me = MusicVolumes;
|
FMusicVolume * me = MusicVolumes;
|
||||||
|
@ -934,10 +950,10 @@ static void S_AddSNDINFO (int lump)
|
||||||
else if (list.Size() > 1)
|
else if (list.Size() > 1)
|
||||||
{ // Only add non-empty random lists
|
{ // Only add non-empty random lists
|
||||||
random.NumSounds = (WORD)list.Size();
|
random.NumSounds = (WORD)list.Size();
|
||||||
random.Sounds = new WORD[random.NumSounds];
|
|
||||||
memcpy (random.Sounds, &list[0], sizeof(WORD)*random.NumSounds);
|
|
||||||
S_sfx[random.SfxHead].link = (WORD)S_rnd.Push (random);
|
S_sfx[random.SfxHead].link = (WORD)S_rnd.Push (random);
|
||||||
S_sfx[random.SfxHead].bRandomHeader = true;
|
S_sfx[random.SfxHead].bRandomHeader = true;
|
||||||
|
S_rnd[S_sfx[random.SfxHead].link].Sounds = new WORD[random.NumSounds];
|
||||||
|
memcpy (S_rnd[S_sfx[random.SfxHead].link].Sounds, &list[0], sizeof(WORD)*random.NumSounds);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -267,6 +267,7 @@ void FStringTable::LoadLanguage (int lumpnum, DWORD code, bool exactMatch, int p
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
SC_Close ();
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace \ escape sequences in a string with the escaped characters.
|
// Replace \ escape sequences in a string with the escaped characters.
|
||||||
|
|
|
@ -79,15 +79,6 @@ TArray<char*> DecalNames;
|
||||||
// all state parameters
|
// all state parameters
|
||||||
TArray<intptr_t> StateParameters;
|
TArray<intptr_t> StateParameters;
|
||||||
|
|
||||||
//==========================================================================
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//==========================================================================
|
|
||||||
inline char * MS_Strdup(const char * s)
|
|
||||||
{
|
|
||||||
return *s? strdup(s):NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
//
|
//
|
||||||
// List of all flags
|
// List of all flags
|
||||||
|
@ -953,12 +944,35 @@ enum
|
||||||
|
|
||||||
struct FDropItem
|
struct FDropItem
|
||||||
{
|
{
|
||||||
const char * Name;
|
FName Name;
|
||||||
int probability;
|
int probability;
|
||||||
int amount;
|
int amount;
|
||||||
FDropItem * Next;
|
FDropItem * Next;
|
||||||
};
|
};
|
||||||
TArray<FDropItem *> DropItemList;
|
|
||||||
|
static void FreeDropItemChain(FDropItem *chain)
|
||||||
|
{
|
||||||
|
while (chain != NULL)
|
||||||
|
{
|
||||||
|
FDropItem *next = chain->Next;
|
||||||
|
delete chain;
|
||||||
|
chain = next;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class FDropItemPtrArray : public TArray<FDropItem *>
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
~FDropItemPtrArray()
|
||||||
|
{
|
||||||
|
for (unsigned int i = 0; i < Size(); ++i)
|
||||||
|
{
|
||||||
|
FreeDropItemChain ((*this)[i]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
FDropItemPtrArray DropItemList;
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
//
|
//
|
||||||
|
@ -999,7 +1013,7 @@ void A_NoBlocking (AActor *actor)
|
||||||
|
|
||||||
while (di != NULL)
|
while (di != NULL)
|
||||||
{
|
{
|
||||||
if (stricmp (di->Name, "None") != 0)
|
if (di->Name != NAME_None)
|
||||||
{
|
{
|
||||||
const TypeInfo *ti = TypeInfo::FindType(di->Name);
|
const TypeInfo *ti = TypeInfo::FindType(di->Name);
|
||||||
if (ti) P_DropItem (actor, ti, di->amount, di->probability);
|
if (ti) P_DropItem (actor, ti, di->amount, di->probability);
|
||||||
|
@ -1032,7 +1046,7 @@ struct FBasicAttack
|
||||||
{
|
{
|
||||||
int MeleeDamage;
|
int MeleeDamage;
|
||||||
int MeleeSound;
|
int MeleeSound;
|
||||||
const char *MissileName;
|
FName MissileName;
|
||||||
fixed_t MissileHeight;
|
fixed_t MissileHeight;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1165,7 +1179,7 @@ static void ResetBaggage (Baggage *bag)
|
||||||
bag->DropItemList = NULL;
|
bag->DropItemList = NULL;
|
||||||
bag->BAttack.MissileHeight = 32*FRACUNIT;
|
bag->BAttack.MissileHeight = 32*FRACUNIT;
|
||||||
bag->BAttack.MeleeSound = 0;
|
bag->BAttack.MeleeSound = 0;
|
||||||
bag->BAttack.MissileName = NULL;
|
bag->BAttack.MissileName = NAME_None;
|
||||||
bag->DropItemSet = false;
|
bag->DropItemSet = false;
|
||||||
bag->CurrentState = 0;
|
bag->CurrentState = 0;
|
||||||
bag->StateSet = false;
|
bag->StateSet = false;
|
||||||
|
@ -1174,6 +1188,10 @@ static void ResetBaggage (Baggage *bag)
|
||||||
static void ResetActor (AActor *actor, Baggage *bag)
|
static void ResetActor (AActor *actor, Baggage *bag)
|
||||||
{
|
{
|
||||||
memcpy (actor, GetDefault<AActor>(), sizeof(AActor));
|
memcpy (actor, GetDefault<AActor>(), sizeof(AActor));
|
||||||
|
if (bag->DropItemList != NULL)
|
||||||
|
{
|
||||||
|
FreeDropItemChain (bag->DropItemList);
|
||||||
|
}
|
||||||
ResetBaggage (bag);
|
ResetBaggage (bag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1373,7 +1391,7 @@ bool DoSpecialFunctions(FState & state, bool multistate, int * statecount, Bagga
|
||||||
|
|
||||||
StateParameters[paramindex] = bag.BAttack.MeleeDamage;
|
StateParameters[paramindex] = bag.BAttack.MeleeDamage;
|
||||||
StateParameters[paramindex+1] = bag.BAttack.MeleeSound;
|
StateParameters[paramindex+1] = bag.BAttack.MeleeSound;
|
||||||
StateParameters[paramindex+2] = (intptr_t)bag.BAttack.MissileName;
|
StateParameters[paramindex+2] = bag.BAttack.MissileName;
|
||||||
StateParameters[paramindex+3] = bag.BAttack.MissileHeight;
|
StateParameters[paramindex+3] = bag.BAttack.MissileHeight;
|
||||||
state.Action = BasicAttacks[batk];
|
state.Action = BasicAttacks[batk];
|
||||||
return true;
|
return true;
|
||||||
|
@ -1400,7 +1418,7 @@ static void RetargetStatePointers (intptr_t count, const char *target, FState **
|
||||||
{
|
{
|
||||||
if (*probe == (FState *)count)
|
if (*probe == (FState *)count)
|
||||||
{
|
{
|
||||||
*probe = target == NULL? NULL : (FState *)strdup (target);
|
*probe = target == NULL ? NULL : (FState *)copystring (target);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1463,7 +1481,7 @@ do_goto: SC_MustGetString();
|
||||||
// copy the text - this must be resolved later!
|
// copy the text - this must be resolved later!
|
||||||
if (laststate != NULL)
|
if (laststate != NULL)
|
||||||
{ // Following a state definition: Modify it.
|
{ // Following a state definition: Modify it.
|
||||||
laststate->NextState=(FState*)strdup(statestring);
|
laststate->NextState = (FState*)copystring(statestring);
|
||||||
}
|
}
|
||||||
else if (lastlabel >= 0)
|
else if (lastlabel >= 0)
|
||||||
{ // Following a label: Retarget it.
|
{ // Following a label: Retarget it.
|
||||||
|
@ -1667,7 +1685,7 @@ do_stop:
|
||||||
case 'T':
|
case 'T':
|
||||||
case 't': // String
|
case 't': // String
|
||||||
SC_MustGetString();
|
SC_MustGetString();
|
||||||
v=(intptr_t)MS_Strdup(sc_String);
|
v = (intptr_t)(sc_String[0] ? copystring(sc_String) : NULL);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'L':
|
case 'L':
|
||||||
|
@ -1858,7 +1876,7 @@ static FState *ResolveGotoLabel (AActor *actor, const TypeInfo *type, char *name
|
||||||
{
|
{
|
||||||
SC_ScriptError("Unknown state label %s", label);
|
SC_ScriptError("Unknown state label %s", label);
|
||||||
}
|
}
|
||||||
free(namestart); // free the allocated string buffer
|
delete[] namestart; // free the allocated string buffer
|
||||||
return state;
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1915,12 +1933,13 @@ static void FixStatePointersAgain (FActorInfo *actor, AActor *defaults, FState *
|
||||||
static int FinishStates (FActorInfo *actor, AActor *defaults, Baggage &bag)
|
static int FinishStates (FActorInfo *actor, AActor *defaults, Baggage &bag)
|
||||||
{
|
{
|
||||||
int count = StateArray.Size();
|
int count = StateArray.Size();
|
||||||
FState *realstates = new FState[count];
|
|
||||||
int i;
|
|
||||||
int currange;
|
|
||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
|
FState *realstates = new FState[count];
|
||||||
|
int i;
|
||||||
|
int currange;
|
||||||
|
|
||||||
memcpy(realstates, &StateArray[0], count*sizeof(FState));
|
memcpy(realstates, &StateArray[0], count*sizeof(FState));
|
||||||
actor->OwnedStates = realstates;
|
actor->OwnedStates = realstates;
|
||||||
actor->NumOwnedStates = count;
|
actor->NumOwnedStates = count;
|
||||||
|
@ -2471,7 +2490,7 @@ static void ActorDropItem (AActor *defaults, Baggage &bag)
|
||||||
FDropItem * di=new FDropItem;
|
FDropItem * di=new FDropItem;
|
||||||
|
|
||||||
SC_MustGetString();
|
SC_MustGetString();
|
||||||
di->Name=strdup(sc_String);
|
di->Name=sc_String;
|
||||||
di->probability=255;
|
di->probability=255;
|
||||||
di->amount=-1;
|
di->amount=-1;
|
||||||
if (SC_CheckNumber())
|
if (SC_CheckNumber())
|
||||||
|
@ -2763,7 +2782,7 @@ static void ActorMeleeSound (AActor *defaults, Baggage &bag)
|
||||||
static void ActorMissileType (AActor *defaults, Baggage &bag)
|
static void ActorMissileType (AActor *defaults, Baggage &bag)
|
||||||
{
|
{
|
||||||
SC_MustGetString();
|
SC_MustGetString();
|
||||||
bag.BAttack.MissileName = MS_Strdup(sc_String);
|
bag.BAttack.MissileName = sc_String;
|
||||||
}
|
}
|
||||||
|
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
|
@ -191,7 +191,7 @@ static void DoAttack (AActor *self, bool domelee, bool domissile)
|
||||||
|
|
||||||
int MeleeDamage=StateParameters[index];
|
int MeleeDamage=StateParameters[index];
|
||||||
int MeleeSound=StateParameters[index+1];
|
int MeleeSound=StateParameters[index+1];
|
||||||
const char *MissileName=(const char *)StateParameters[index+2];
|
FName MissileName=(ENamedName)StateParameters[index+2];
|
||||||
fixed_t MissileHeight=StateParameters[index+3];
|
fixed_t MissileHeight=StateParameters[index+3];
|
||||||
|
|
||||||
A_FaceTarget (self);
|
A_FaceTarget (self);
|
||||||
|
@ -202,7 +202,7 @@ static void DoAttack (AActor *self, bool domelee, bool domissile)
|
||||||
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
|
P_DamageMobj (self->target, self, self, damage, MOD_HIT);
|
||||||
P_TraceBleed (damage, self->target, self);
|
P_TraceBleed (damage, self->target, self);
|
||||||
}
|
}
|
||||||
else if (domissile && MissileName)
|
else if (domissile && MissileName != NAME_None)
|
||||||
{
|
{
|
||||||
const TypeInfo * ti=TypeInfo::FindType(MissileName);
|
const TypeInfo * ti=TypeInfo::FindType(MissileName);
|
||||||
if (ti)
|
if (ti)
|
||||||
|
|
|
@ -110,6 +110,17 @@ static const byte myislower[256] =
|
||||||
|
|
||||||
FFont *FFont::FirstFont = NULL;
|
FFont *FFont::FirstFont = NULL;
|
||||||
|
|
||||||
|
static struct FontsDeleter
|
||||||
|
{
|
||||||
|
~FontsDeleter()
|
||||||
|
{
|
||||||
|
while (FFont::FirstFont != NULL)
|
||||||
|
{
|
||||||
|
delete FFont::FirstFont;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} DeleteAllTheFonts;
|
||||||
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER < 1310
|
#if defined(_MSC_VER) && _MSC_VER < 1310
|
||||||
template<> FArchive &operator<< (FArchive &arc, FFont* &font)
|
template<> FArchive &operator<< (FArchive &arc, FFont* &font)
|
||||||
#else
|
#else
|
||||||
|
@ -262,7 +273,7 @@ FFont::~FFont ()
|
||||||
|
|
||||||
for (int i = 0; i < count; ++i)
|
for (int i = 0; i < count; ++i)
|
||||||
{
|
{
|
||||||
if (Chars[i].Pic != NULL && Chars[i].Pic->Name == 0)
|
if (Chars[i].Pic != NULL && Chars[i].Pic->Name[0] == 0)
|
||||||
{
|
{
|
||||||
delete Chars[i].Pic;
|
delete Chars[i].Pic;
|
||||||
}
|
}
|
||||||
|
@ -280,6 +291,11 @@ FFont::~FFont ()
|
||||||
delete[] PatchRemap;
|
delete[] PatchRemap;
|
||||||
PatchRemap = NULL;
|
PatchRemap = NULL;
|
||||||
}
|
}
|
||||||
|
if (Name)
|
||||||
|
{
|
||||||
|
delete[] Name;
|
||||||
|
Name = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
FFont **prev = &FirstFont;
|
FFont **prev = &FirstFont;
|
||||||
FFont *font = *prev;
|
FFont *font = *prev;
|
||||||
|
@ -559,6 +575,7 @@ FFont::FFont ()
|
||||||
Chars = NULL;
|
Chars = NULL;
|
||||||
Ranges = NULL;
|
Ranges = NULL;
|
||||||
PatchRemap = NULL;
|
PatchRemap = NULL;
|
||||||
|
Name = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
FSingleLumpFont::FSingleLumpFont (const char *name, int lump)
|
FSingleLumpFont::FSingleLumpFont (const char *name, int lump)
|
||||||
|
|
|
@ -108,6 +108,7 @@ protected:
|
||||||
FFont *Next;
|
FFont *Next;
|
||||||
|
|
||||||
static FFont *FirstFont;
|
static FFont *FirstFont;
|
||||||
|
friend struct FontsDeleter;
|
||||||
|
|
||||||
#if defined(_MSC_VER) && _MSC_VER < 1310
|
#if defined(_MSC_VER) && _MSC_VER < 1310
|
||||||
template<> friend FArchive &operator<< (FArchive &arc, FFont* &font);
|
template<> friend FArchive &operator<< (FArchive &arc, FFont* &font);
|
||||||
|
|
|
@ -59,8 +59,8 @@ extern "C" {
|
||||||
FDynamicColormap NormalLight;
|
FDynamicColormap NormalLight;
|
||||||
}
|
}
|
||||||
FPalette GPalette;
|
FPalette GPalette;
|
||||||
BYTE *InverseColormap;
|
BYTE InverseColormap[NUMCOLORMAPS*256];
|
||||||
BYTE *GoldColormap;
|
BYTE GoldColormap[NUMCOLORMAPS*256];
|
||||||
int Near255;
|
int Near255;
|
||||||
|
|
||||||
FColorMatcher ColorMatcher;
|
FColorMatcher ColorMatcher;
|
||||||
|
@ -384,7 +384,6 @@ void InitPalette ()
|
||||||
|
|
||||||
// Doom invulnerability is an inverted grayscale
|
// Doom invulnerability is an inverted grayscale
|
||||||
// Strife uses it when firing the Sigil
|
// Strife uses it when firing the Sigil
|
||||||
InverseColormap = new BYTE[NUMCOLORMAPS*256];
|
|
||||||
shade = InverseColormap;
|
shade = InverseColormap;
|
||||||
|
|
||||||
for (c = 0; c < 256; c++)
|
for (c = 0; c < 256; c++)
|
||||||
|
@ -397,7 +396,6 @@ void InitPalette ()
|
||||||
}
|
}
|
||||||
|
|
||||||
// Heretic invulnerability is a golden shade
|
// Heretic invulnerability is a golden shade
|
||||||
GoldColormap = new BYTE[NUMCOLORMAPS*256];
|
|
||||||
shade = GoldColormap;
|
shade = GoldColormap;
|
||||||
|
|
||||||
for (c = 0; c < 256; c++)
|
for (c = 0; c < 256; c++)
|
||||||
|
|
|
@ -77,8 +77,8 @@ struct FDynamicColormap
|
||||||
FDynamicColormap *Next;
|
FDynamicColormap *Next;
|
||||||
};
|
};
|
||||||
|
|
||||||
extern BYTE *InverseColormap;
|
extern BYTE InverseColormap[NUMCOLORMAPS*256];
|
||||||
extern BYTE *GoldColormap;
|
extern BYTE GoldColormap[NUMCOLORMAPS*256];
|
||||||
extern FPalette GPalette;
|
extern FPalette GPalette;
|
||||||
extern "C" {
|
extern "C" {
|
||||||
extern FDynamicColormap NormalLight;
|
extern FDynamicColormap NormalLight;
|
||||||
|
|
|
@ -40,9 +40,9 @@ actor DeadMarine 15
|
||||||
|
|
||||||
actor DeadZombieMan : ZombieMan 18
|
actor DeadZombieMan : ZombieMan 18
|
||||||
{
|
{
|
||||||
|
Skip_Super
|
||||||
Game Doom
|
Game Doom
|
||||||
DropItem None
|
DropItem None
|
||||||
Skip_Super
|
|
||||||
States
|
States
|
||||||
{
|
{
|
||||||
Spawn:
|
Spawn:
|
||||||
|
@ -54,9 +54,9 @@ actor DeadZombieMan : ZombieMan 18
|
||||||
|
|
||||||
actor DeadShotgunGuy : ShotgunGuy 19
|
actor DeadShotgunGuy : ShotgunGuy 19
|
||||||
{
|
{
|
||||||
|
Skip_Super
|
||||||
Game Doom
|
Game Doom
|
||||||
DropItem None
|
DropItem None
|
||||||
Skip_Super
|
|
||||||
States
|
States
|
||||||
{
|
{
|
||||||
Spawn:
|
Spawn:
|
||||||
|
@ -68,8 +68,8 @@ actor DeadShotgunGuy : ShotgunGuy 19
|
||||||
|
|
||||||
actor DeadDoomImp : DoomImp 20
|
actor DeadDoomImp : DoomImp 20
|
||||||
{
|
{
|
||||||
Game Doom
|
|
||||||
Skip_Super
|
Skip_Super
|
||||||
|
Game Doom
|
||||||
States
|
States
|
||||||
{
|
{
|
||||||
Spawn:
|
Spawn:
|
||||||
|
@ -81,8 +81,8 @@ actor DeadDoomImp : DoomImp 20
|
||||||
|
|
||||||
actor DeadDemon : Demon 21
|
actor DeadDemon : Demon 21
|
||||||
{
|
{
|
||||||
Game Doom
|
|
||||||
Skip_Super
|
Skip_Super
|
||||||
|
Game Doom
|
||||||
States
|
States
|
||||||
{
|
{
|
||||||
Spawn:
|
Spawn:
|
||||||
|
@ -94,8 +94,8 @@ actor DeadDemon : Demon 21
|
||||||
|
|
||||||
actor DeadCacodemon : Cacodemon 22
|
actor DeadCacodemon : Cacodemon 22
|
||||||
{
|
{
|
||||||
Game Doom
|
|
||||||
Skip_Super
|
Skip_Super
|
||||||
|
Game Doom
|
||||||
States
|
States
|
||||||
{
|
{
|
||||||
Spawn:
|
Spawn:
|
||||||
|
@ -113,8 +113,8 @@ actor DeadCacodemon : Cacodemon 22
|
||||||
|
|
||||||
actor DeadLostSoul : LostSoul 23
|
actor DeadLostSoul : LostSoul 23
|
||||||
{
|
{
|
||||||
Game Doom
|
|
||||||
Skip_Super
|
Skip_Super
|
||||||
|
Game Doom
|
||||||
States
|
States
|
||||||
{
|
{
|
||||||
Spawn:
|
Spawn:
|
||||||
|
|
Loading…
Reference in a new issue