mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2025-01-31 10:40:33 +00:00
Merge branch 'master' of https://github.com/ZzZombo/zdoom-modified
This commit is contained in:
commit
4e2763e5fa
28 changed files with 72 additions and 92 deletions
|
@ -1234,9 +1234,16 @@ void AM_initVariables ()
|
||||||
for (pnum=0;pnum<MAXPLAYERS;pnum++)
|
for (pnum=0;pnum<MAXPLAYERS;pnum++)
|
||||||
if (playeringame[pnum])
|
if (playeringame[pnum])
|
||||||
break;
|
break;
|
||||||
|
// [ZzZombo] no access out of bounds.
|
||||||
|
if(pnum>=MAXPLAYERS)
|
||||||
|
{
|
||||||
|
m_x=m_y=0;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
m_x = (players[pnum].camera->x >> FRACTOMAPBITS) - m_w/2;
|
m_x = (players[pnum].camera->x >> FRACTOMAPBITS) - m_w/2;
|
||||||
m_y = (players[pnum].camera->y >> FRACTOMAPBITS) - m_h/2;
|
m_y = (players[pnum].camera->y >> FRACTOMAPBITS) - m_h/2;
|
||||||
|
}
|
||||||
AM_changeWindowLoc();
|
AM_changeWindowLoc();
|
||||||
|
|
||||||
// for saving & restoring
|
// for saving & restoring
|
||||||
|
|
|
@ -61,8 +61,8 @@ void DBot::Serialize (FArchive &arc)
|
||||||
|
|
||||||
if (SaveVersion < 4515)
|
if (SaveVersion < 4515)
|
||||||
{
|
{
|
||||||
angle_t savedyaw;
|
angle_t savedyaw=0;
|
||||||
int savedpitch;
|
int savedpitch=0;
|
||||||
arc << savedyaw
|
arc << savedyaw
|
||||||
<< savedpitch;
|
<< savedpitch;
|
||||||
}
|
}
|
||||||
|
|
|
@ -513,7 +513,7 @@ angle_t DBot::FireRox (AActor *enemy, ticcmd_t *cmd)
|
||||||
|
|
||||||
bglobal.SetBodyAt (enemy->x + FixedMul(enemy->velx, (m+2*FRACUNIT)),
|
bglobal.SetBodyAt (enemy->x + FixedMul(enemy->velx, (m+2*FRACUNIT)),
|
||||||
enemy->y + FixedMul(enemy->vely, (m+2*FRACUNIT)), ONFLOORZ, 1);
|
enemy->y + FixedMul(enemy->vely, (m+2*FRACUNIT)), ONFLOORZ, 1);
|
||||||
dist = P_AproxDistance(actor->x-bglobal.body1->x, actor->y-bglobal.body1->y);
|
|
||||||
//try the predicted location
|
//try the predicted location
|
||||||
if (P_CheckSight (actor, bglobal.body1, SF_IGNOREVISIBILITY)) //See the predicted location, so give a test missile
|
if (P_CheckSight (actor, bglobal.body1, SF_IGNOREVISIBILITY)) //See the predicted location, so give a test missile
|
||||||
{
|
{
|
||||||
|
|
|
@ -1028,7 +1028,6 @@ CCMD(nextsecret)
|
||||||
TEXTCOLOR_NORMAL " is for single-player only.\n");
|
TEXTCOLOR_NORMAL " is for single-player only.\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
char *next = NULL;
|
|
||||||
|
|
||||||
if (level.NextSecretMap.Len() > 0 && level.NextSecretMap.Compare("enDSeQ", 6))
|
if (level.NextSecretMap.Len() > 0 && level.NextSecretMap.Compare("enDSeQ", 6))
|
||||||
{
|
{
|
||||||
|
|
|
@ -856,11 +856,10 @@ void C_DrawConsole (bool hw2d)
|
||||||
}
|
}
|
||||||
else if (ConBottom)
|
else if (ConBottom)
|
||||||
{
|
{
|
||||||
int visheight, realheight;
|
int visheight;
|
||||||
FTexture *conpic = TexMan[conback];
|
FTexture *conpic = TexMan[conback];
|
||||||
|
|
||||||
visheight = ConBottom;
|
visheight = ConBottom;
|
||||||
realheight = (visheight * conpic->GetHeight()) / SCREENHEIGHT;
|
|
||||||
|
|
||||||
screen->DrawTexture (conpic, 0, visheight - screen->GetHeight(),
|
screen->DrawTexture (conpic, 0, visheight - screen->GetHeight(),
|
||||||
DTA_DestWidth, screen->GetWidth(),
|
DTA_DestWidth, screen->GetWidth(),
|
||||||
|
|
|
@ -439,7 +439,7 @@ static BYTE HexToByte (const char *hex)
|
||||||
UCVarValue FBaseCVar::FromString (const char *value, ECVarType type)
|
UCVarValue FBaseCVar::FromString (const char *value, ECVarType type)
|
||||||
{
|
{
|
||||||
UCVarValue ret;
|
UCVarValue ret;
|
||||||
int i;
|
int i=0;
|
||||||
|
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
|
@ -475,38 +475,28 @@ UCVarValue FBaseCVar::FromString (const char *value, ECVarType type)
|
||||||
// 0 1 2 3
|
// 0 1 2 3
|
||||||
|
|
||||||
ret.pGUID = NULL;
|
ret.pGUID = NULL;
|
||||||
for (i = 0; i < 38; ++i)
|
if(value)
|
||||||
|
for (; i < 38; i++)
|
||||||
{
|
{
|
||||||
if (value[i] == 0)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
bool goodv = true;
|
|
||||||
switch (i)
|
switch (i)
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
if (value[i] != '{')
|
if (value[i] != '{')
|
||||||
goodv = false;
|
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
case 14:
|
case 14:
|
||||||
case 19:
|
case 19:
|
||||||
case 24:
|
case 24:
|
||||||
if (value[i] != '-')
|
if (value[i] != '-')
|
||||||
goodv = false;
|
|
||||||
break;
|
break;
|
||||||
case 37:
|
case 37:
|
||||||
if (value[i] != '}')
|
if (value[i] != '}')
|
||||||
goodv = false;
|
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
if (value[i] < '0' ||
|
if (value[i] < '0' ||
|
||||||
(value[i] > '9' && value[i] < 'A') ||
|
(value[i] > '9' && value[i] < 'A') ||
|
||||||
(value[i] > 'F' && value[i] < 'a') ||
|
(value[i] > 'F' && value[i] < 'a') ||
|
||||||
value[i] > 'f')
|
value[i] > 'f')
|
||||||
{
|
|
||||||
goodv = false;
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1673,9 +1663,6 @@ void FBaseCVar::ListVars (const char *filter, bool plain)
|
||||||
if (CheckWildcards (filter, var->GetName()))
|
if (CheckWildcards (filter, var->GetName()))
|
||||||
{
|
{
|
||||||
DWORD flags = var->GetFlags();
|
DWORD flags = var->GetFlags();
|
||||||
UCVarValue val;
|
|
||||||
|
|
||||||
val = var->GetGenericRep (CVAR_String);
|
|
||||||
if (plain)
|
if (plain)
|
||||||
{ // plain formatting does not include user-defined cvars
|
{ // plain formatting does not include user-defined cvars
|
||||||
if (!(flags & CVAR_UNSETTABLE))
|
if (!(flags & CVAR_UNSETTABLE))
|
||||||
|
|
|
@ -1336,7 +1336,7 @@ CCMD (alias)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
alias = new FConsoleAlias (argv[1], argv[2], ParsingKeyConf);
|
new FConsoleAlias (argv[1], argv[2], ParsingKeyConf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -448,7 +448,7 @@ void SetCompatibilityParams()
|
||||||
{
|
{
|
||||||
unsigned i = ii_compatparams;
|
unsigned i = ii_compatparams;
|
||||||
|
|
||||||
while (CompatParams[i] != CP_END && i < CompatParams.Size())
|
while (i < CompatParams.Size() && CompatParams[i] != CP_END)
|
||||||
{
|
{
|
||||||
switch (CompatParams[i])
|
switch (CompatParams[i])
|
||||||
{
|
{
|
||||||
|
|
|
@ -20,11 +20,11 @@ struct FCompatValues
|
||||||
|
|
||||||
struct FMD5HashTraits
|
struct FMD5HashTraits
|
||||||
{
|
{
|
||||||
hash_t Hash(const FMD5Holder key)
|
hash_t Hash(const FMD5Holder &key)
|
||||||
{
|
{
|
||||||
return key.Hash;
|
return key.Hash;
|
||||||
}
|
}
|
||||||
int Compare(const FMD5Holder left, const FMD5Holder right)
|
int Compare(const FMD5Holder &left, const FMD5Holder &right)
|
||||||
{
|
{
|
||||||
return left.DWords[0] != right.DWords[0] ||
|
return left.DWords[0] != right.DWords[0] ||
|
||||||
left.DWords[1] != right.DWords[1] ||
|
left.DWords[1] != right.DWords[1] ||
|
||||||
|
|
|
@ -50,12 +50,11 @@ static FRandom pr_endtag;
|
||||||
//
|
//
|
||||||
//====================================================================
|
//====================================================================
|
||||||
|
|
||||||
FConfigFile::FConfigFile ()
|
FConfigFile::FConfigFile () : PathName(NAME_None)
|
||||||
{
|
{
|
||||||
Sections = CurrentSection = NULL;
|
Sections = CurrentSection = NULL;
|
||||||
LastSectionPtr = &Sections;
|
LastSectionPtr = &Sections;
|
||||||
CurrentEntry = NULL;
|
CurrentEntry = NULL;
|
||||||
PathName = "";
|
|
||||||
OkayToWrite = true;
|
OkayToWrite = true;
|
||||||
FileExisted = true;
|
FileExisted = true;
|
||||||
}
|
}
|
||||||
|
@ -836,7 +835,7 @@ const char *FConfigFile::GenerateEndTag(const char *value)
|
||||||
|
|
||||||
for (int i = 0; i < 5; ++i)
|
for (int i = 0; i < 5; ++i)
|
||||||
{
|
{
|
||||||
DWORD three_bytes = (rand_bytes[i*3] << 16) | (rand_bytes[i*3+1] << 8) | (rand_bytes[i*3+2]);
|
//DWORD three_bytes = (rand_bytes[i*3] << 16) | (rand_bytes[i*3+1] << 8) | (rand_bytes[i*3+2]); // ???
|
||||||
EndTag[4+i*4 ] = Base64Table[rand_bytes[i*3] >> 2];
|
EndTag[4+i*4 ] = Base64Table[rand_bytes[i*3] >> 2];
|
||||||
EndTag[4+i*4+1] = Base64Table[((rand_bytes[i*3] & 3) << 4) | (rand_bytes[i*3+1] >> 4)];
|
EndTag[4+i*4+1] = Base64Table[((rand_bytes[i*3] & 3) << 4) | (rand_bytes[i*3+1] >> 4)];
|
||||||
EndTag[4+i*4+2] = Base64Table[((rand_bytes[i*3+1] & 15) << 2) | (rand_bytes[i*3+2] >> 6)];
|
EndTag[4+i*4+2] = Base64Table[((rand_bytes[i*3+1] & 15) << 2) | (rand_bytes[i*3+2] >> 6)];
|
||||||
|
|
|
@ -2055,7 +2055,8 @@ void FDynamicBuffer::SetData (const BYTE *data, int len)
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
len = 0;
|
m_Len = 0;
|
||||||
|
M_Free((void *)data);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -500,5 +500,5 @@ void SkipChunk (BYTE **stream)
|
||||||
int len;
|
int len;
|
||||||
|
|
||||||
len = ReadLong (stream);
|
len = ReadLong (stream);
|
||||||
stream += len + (len & 1);
|
*stream += len + (len & 1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -443,7 +443,6 @@ void FDecalLib::ParseDecal (FScanner &sc)
|
||||||
FString decalName;
|
FString decalName;
|
||||||
WORD decalNum;
|
WORD decalNum;
|
||||||
FDecalTemplate newdecal;
|
FDecalTemplate newdecal;
|
||||||
int code;
|
|
||||||
FTextureID picnum;
|
FTextureID picnum;
|
||||||
int lumpnum;
|
int lumpnum;
|
||||||
|
|
||||||
|
@ -467,7 +466,7 @@ void FDecalLib::ParseDecal (FScanner &sc)
|
||||||
AddDecal (decalName, decalNum, newdecal);
|
AddDecal (decalName, decalNum, newdecal);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
switch ((code = sc.MustMatchString (DecalKeywords)))
|
switch (sc.MustMatchString (DecalKeywords))
|
||||||
{
|
{
|
||||||
case DECAL_XSCALE:
|
case DECAL_XSCALE:
|
||||||
newdecal.ScaleX = ReadScale (sc);
|
newdecal.ScaleX = ReadScale (sc);
|
||||||
|
@ -763,8 +762,6 @@ void FDecalLib::ParseSlider (FScanner &sc)
|
||||||
}
|
}
|
||||||
else if (sc.Compare ("DistX"))
|
else if (sc.Compare ("DistX"))
|
||||||
{
|
{
|
||||||
sc.MustGetFloat ();
|
|
||||||
distX = (fixed_t)(sc.Float * FRACUNIT);
|
|
||||||
Printf ("DistX in slider decal %s is unsupported\n", sliderName.GetChars());
|
Printf ("DistX in slider decal %s is unsupported\n", sliderName.GetChars());
|
||||||
}
|
}
|
||||||
else if (sc.Compare ("DistY"))
|
else if (sc.Compare ("DistY"))
|
||||||
|
@ -1024,9 +1021,8 @@ FDecalLib::FTranslation *FDecalLib::GenerateTranslation (DWORD start, DWORD end)
|
||||||
return trans;
|
return trans;
|
||||||
}
|
}
|
||||||
|
|
||||||
FDecalBase::FDecalBase ()
|
FDecalBase::FDecalBase () : Name(NAME_None)
|
||||||
{
|
{
|
||||||
Name = NAME_None;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FDecalBase::~FDecalBase ()
|
FDecalBase::~FDecalBase ()
|
||||||
|
@ -1139,9 +1135,8 @@ const FDecalTemplate *FDecalGroup::GetDecal () const
|
||||||
return static_cast<const FDecalTemplate *>(remember);
|
return static_cast<const FDecalTemplate *>(remember);
|
||||||
}
|
}
|
||||||
|
|
||||||
FDecalAnimator::FDecalAnimator (const char *name)
|
FDecalAnimator::FDecalAnimator (const char *name) : Name(name)
|
||||||
{
|
{
|
||||||
Name = name;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FDecalAnimator::~FDecalAnimator ()
|
FDecalAnimator::~FDecalAnimator ()
|
||||||
|
|
|
@ -24,7 +24,7 @@ struct PSymbol
|
||||||
FName SymbolName;
|
FName SymbolName;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
PSymbol(FName name, ESymbolType type) { SymbolType = type; SymbolName = name; }
|
PSymbol(FName name, ESymbolType type):SymbolName(name) { SymbolType = type; }
|
||||||
};
|
};
|
||||||
|
|
||||||
// A constant value ---------------------------------------------------------
|
// A constant value ---------------------------------------------------------
|
||||||
|
|
|
@ -78,9 +78,8 @@ DMover::DMover ()
|
||||||
}
|
}
|
||||||
|
|
||||||
DMover::DMover (sector_t *sector)
|
DMover::DMover (sector_t *sector)
|
||||||
: DSectorEffect (sector)
|
: DSectorEffect (sector), interpolation(NULL)
|
||||||
{
|
{
|
||||||
interpolation = NULL;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DMover::Destroy()
|
void DMover::Destroy()
|
||||||
|
|
|
@ -53,7 +53,7 @@
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
FileReader::FileReader ()
|
FileReader::FileReader ()
|
||||||
: File(NULL), Length(0), StartPos(0), CloseOnDestruct(false)
|
: File(NULL), Length(0), StartPos(0), FilePos(0), CloseOnDestruct(false)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2589,6 +2589,12 @@ bool G_ProcessIFFDemo (FString &mapname)
|
||||||
demo_p = nextchunk;
|
demo_p = nextchunk;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!headerHit)
|
||||||
|
{
|
||||||
|
Printf ("Demo has no header!\n");
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
if (!numPlayers)
|
if (!numPlayers)
|
||||||
{
|
{
|
||||||
Printf ("Demo has no players!\n");
|
Printf ("Demo has no players!\n");
|
||||||
|
|
|
@ -367,7 +367,6 @@ static void InitPlayerClasses ()
|
||||||
|
|
||||||
void G_InitNew (const char *mapname, bool bTitleLevel)
|
void G_InitNew (const char *mapname, bool bTitleLevel)
|
||||||
{
|
{
|
||||||
EGameSpeed oldSpeed;
|
|
||||||
bool wantFast;
|
bool wantFast;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
@ -454,7 +453,6 @@ void G_InitNew (const char *mapname, bool bTitleLevel)
|
||||||
I_Error ("Could not find map %s\n", mapname);
|
I_Error ("Could not find map %s\n", mapname);
|
||||||
}
|
}
|
||||||
|
|
||||||
oldSpeed = GameSpeed;
|
|
||||||
wantFast = !!G_SkillProperty(SKILLP_FastMonsters);
|
wantFast = !!G_SkillProperty(SKILLP_FastMonsters);
|
||||||
GameSpeed = wantFast ? SPEED_Fast : SPEED_Normal;
|
GameSpeed = wantFast ? SPEED_Fast : SPEED_Normal;
|
||||||
|
|
||||||
|
|
|
@ -241,7 +241,7 @@ struct FOptionalMapinfoData
|
||||||
{
|
{
|
||||||
FOptionalMapinfoData *Next;
|
FOptionalMapinfoData *Next;
|
||||||
FName identifier;
|
FName identifier;
|
||||||
FOptionalMapinfoData() { Next = NULL; identifier = NAME_None; }
|
FOptionalMapinfoData():identifier(NAME_None) { Next = NULL; }
|
||||||
virtual ~FOptionalMapinfoData() {}
|
virtual ~FOptionalMapinfoData() {}
|
||||||
virtual FOptionalMapinfoData *Clone() const = 0;
|
virtual FOptionalMapinfoData *Clone() const = 0;
|
||||||
};
|
};
|
||||||
|
|
|
@ -705,8 +705,6 @@ void FMapInfoParser::ParseCluster()
|
||||||
}
|
}
|
||||||
else if (sc.Compare("music"))
|
else if (sc.Compare("music"))
|
||||||
{
|
{
|
||||||
int order = 0;
|
|
||||||
|
|
||||||
ParseAssign();
|
ParseAssign();
|
||||||
ParseMusic(clusterinfo->MessageMusic, clusterinfo->musicorder);
|
ParseMusic(clusterinfo->MessageMusic, clusterinfo->musicorder);
|
||||||
}
|
}
|
||||||
|
|
|
@ -238,7 +238,7 @@ void PacketSend (void)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
// Printf("send %d\n", doomcom.datalength);
|
// Printf("send %d\n", doomcom.datalength);
|
||||||
c = sendto(mysocket, (char *)doomcom.data, doomcom.datalength,
|
/*c = */sendto(mysocket, (char *)doomcom.data, doomcom.datalength,
|
||||||
0, (sockaddr *)&sendaddress[doomcom.remotenode],
|
0, (sockaddr *)&sendaddress[doomcom.remotenode],
|
||||||
sizeof(sendaddress[doomcom.remotenode]));
|
sizeof(sendaddress[doomcom.remotenode]));
|
||||||
}
|
}
|
||||||
|
@ -800,7 +800,6 @@ bool Guest_WaitForOthers (void *userdata)
|
||||||
{
|
{
|
||||||
int node;
|
int node;
|
||||||
|
|
||||||
packet.NumNodes = packet.NumNodes;
|
|
||||||
doomcom.numnodes = packet.NumNodes + 2;
|
doomcom.numnodes = packet.NumNodes + 2;
|
||||||
sendplayer[0] = packet.ConsoleNum; // My player number
|
sendplayer[0] = packet.ConsoleNum; // My player number
|
||||||
doomcom.consoleplayer = packet.ConsoleNum;
|
doomcom.consoleplayer = packet.ConsoleNum;
|
||||||
|
|
|
@ -158,7 +158,6 @@ void FActorInfo::StaticSetActorNums ()
|
||||||
void FActorInfo::RegisterIDs ()
|
void FActorInfo::RegisterIDs ()
|
||||||
{
|
{
|
||||||
const PClass *cls = PClass::FindClass(Class->TypeName);
|
const PClass *cls = PClass::FindClass(Class->TypeName);
|
||||||
bool set = false;
|
|
||||||
|
|
||||||
if (GameFilter == GAME_Any || (GameFilter & gameinfo.gametype))
|
if (GameFilter == GAME_Any || (GameFilter & gameinfo.gametype))
|
||||||
{
|
{
|
||||||
|
@ -578,17 +577,17 @@ CCMD (summonfoe)
|
||||||
|
|
||||||
TMap<FName, DamageTypeDefinition> GlobalDamageDefinitions;
|
TMap<FName, DamageTypeDefinition> GlobalDamageDefinitions;
|
||||||
|
|
||||||
void DamageTypeDefinition::Apply(FName const type)
|
void DamageTypeDefinition::Apply(FName const &type)
|
||||||
{
|
{
|
||||||
GlobalDamageDefinitions[type] = *this;
|
GlobalDamageDefinitions[type] = *this;
|
||||||
}
|
}
|
||||||
|
|
||||||
DamageTypeDefinition *DamageTypeDefinition::Get(FName const type)
|
DamageTypeDefinition *DamageTypeDefinition::Get(FName const &type)
|
||||||
{
|
{
|
||||||
return GlobalDamageDefinitions.CheckKey(type);
|
return GlobalDamageDefinitions.CheckKey(type);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool DamageTypeDefinition::IgnoreArmor(FName const type)
|
bool DamageTypeDefinition::IgnoreArmor(FName const &type)
|
||||||
{
|
{
|
||||||
DamageTypeDefinition *dtd = Get(type);
|
DamageTypeDefinition *dtd = Get(type);
|
||||||
if (dtd) return dtd->NoArmor;
|
if (dtd) return dtd->NoArmor;
|
||||||
|
@ -610,7 +609,7 @@ bool DamageTypeDefinition::IgnoreArmor(FName const type)
|
||||||
//
|
//
|
||||||
//==========================================================================
|
//==========================================================================
|
||||||
|
|
||||||
int DamageTypeDefinition::ApplyMobjDamageFactor(int damage, FName const type, DmgFactors const * const factors)
|
int DamageTypeDefinition::ApplyMobjDamageFactor(int damage, FName const &type, DmgFactors const * const factors)
|
||||||
{
|
{
|
||||||
if (factors)
|
if (factors)
|
||||||
{
|
{
|
||||||
|
|
|
@ -217,7 +217,7 @@ public:
|
||||||
bool ReplaceFactor;
|
bool ReplaceFactor;
|
||||||
bool NoArmor;
|
bool NoArmor;
|
||||||
|
|
||||||
void Apply(FName const type);
|
void Apply(FName const &type);
|
||||||
void Clear()
|
void Clear()
|
||||||
{
|
{
|
||||||
DefaultFactor = FRACUNIT;
|
DefaultFactor = FRACUNIT;
|
||||||
|
@ -225,9 +225,9 @@ public:
|
||||||
NoArmor = false;
|
NoArmor = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
static DamageTypeDefinition *Get(FName const type);
|
static DamageTypeDefinition *Get(FName const &type);
|
||||||
static bool IgnoreArmor(FName const type);
|
static bool IgnoreArmor(FName const &type);
|
||||||
static int ApplyMobjDamageFactor(int damage, FName const type, DmgFactors const * const factors);
|
static int ApplyMobjDamageFactor(int damage, FName const &type, DmgFactors const * const factors);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -55,10 +55,9 @@ DArgs::DArgs()
|
||||||
//
|
//
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
|
||||||
DArgs::DArgs(const DArgs &other)
|
DArgs::DArgs(const DArgs &other):Argv(other.Argv),
|
||||||
: DObject()
|
DObject()
|
||||||
{
|
{
|
||||||
Argv = other.Argv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
@ -263,7 +262,6 @@ void DArgs::RemoveArgs(const char *check)
|
||||||
const char *DArgs::GetArg(int arg) const
|
const char *DArgs::GetArg(int arg) const
|
||||||
{
|
{
|
||||||
return ((unsigned)arg < Argv.Size()) ? Argv[arg].GetChars() : NULL;
|
return ((unsigned)arg < Argv.Size()) ? Argv[arg].GetChars() : NULL;
|
||||||
return Argv[arg];
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//===========================================================================
|
//===========================================================================
|
||||||
|
@ -351,7 +349,6 @@ void DArgs::RemoveArg(int argindex)
|
||||||
void DArgs::CollectFiles(const char *param, const char *extension)
|
void DArgs::CollectFiles(const char *param, const char *extension)
|
||||||
{
|
{
|
||||||
TArray<FString> work;
|
TArray<FString> work;
|
||||||
DArgs *out = new DArgs;
|
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
size_t extlen = extension == NULL ? 0 : strlen(extension);
|
size_t extlen = extension == NULL ? 0 : strlen(extension);
|
||||||
|
|
||||||
|
|
|
@ -1023,7 +1023,6 @@ bool M_SaveBitmap(const BYTE *from, ESSType color_type, int width, int height, i
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
y = sizeof(buffer) - stream.avail_out;
|
|
||||||
deflateEnd (&stream);
|
deflateEnd (&stream);
|
||||||
|
|
||||||
if (err != Z_STREAM_END)
|
if (err != Z_STREAM_END)
|
||||||
|
|
|
@ -261,11 +261,10 @@ protected:
|
||||||
public:
|
public:
|
||||||
bool mEnabled;
|
bool mEnabled;
|
||||||
|
|
||||||
FListMenuItem(int xpos = 0, int ypos = 0, FName action = NAME_None)
|
FListMenuItem(int xpos = 0, int ypos = 0, FName action = NAME_None):mAction(action)
|
||||||
{
|
{
|
||||||
mXpos = xpos;
|
mXpos = xpos;
|
||||||
mYpos = ypos;
|
mYpos = ypos;
|
||||||
mAction = action;
|
|
||||||
mEnabled = true;
|
mEnabled = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
30
src/tarray.h
30
src/tarray.h
|
@ -416,10 +416,10 @@ typedef unsigned int hash_t;
|
||||||
template<class KT> struct THashTraits
|
template<class KT> struct THashTraits
|
||||||
{
|
{
|
||||||
// Returns the hash value for a key.
|
// Returns the hash value for a key.
|
||||||
hash_t Hash(const KT key) { return (hash_t)(intptr_t)key; }
|
hash_t Hash(const KT &key) { return (hash_t)(intptr_t)key; }
|
||||||
|
|
||||||
// Compares two keys, returning zero if they are the same.
|
// Compares two keys, returning zero if they are the same.
|
||||||
int Compare(const KT left, const KT right) { return left != right; }
|
int Compare(const KT &left, const KT &right) { return left != right; }
|
||||||
};
|
};
|
||||||
|
|
||||||
template<class VT> struct TValueTraits
|
template<class VT> struct TValueTraits
|
||||||
|
@ -547,12 +547,12 @@ public:
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
VT &operator[] (const KT key)
|
VT &operator[] (const KT &key)
|
||||||
{
|
{
|
||||||
return GetNode(key)->Pair.Value;
|
return GetNode(key)->Pair.Value;
|
||||||
}
|
}
|
||||||
|
|
||||||
const VT &operator[] (const KT key) const
|
const VT &operator[] (const KT &key) const
|
||||||
{
|
{
|
||||||
return GetNode(key)->Pair.Value;
|
return GetNode(key)->Pair.Value;
|
||||||
}
|
}
|
||||||
|
@ -566,13 +566,13 @@ public:
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
VT *CheckKey (const KT key)
|
VT *CheckKey (const KT &key)
|
||||||
{
|
{
|
||||||
Node *n = FindKey(key);
|
Node *n = FindKey(key);
|
||||||
return n != NULL ? &n->Pair.Value : NULL;
|
return n != NULL ? &n->Pair.Value : NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
const VT *CheckKey (const KT key) const
|
const VT *CheckKey (const KT &key) const
|
||||||
{
|
{
|
||||||
const Node *n = FindKey(key);
|
const Node *n = FindKey(key);
|
||||||
return n != NULL ? &n->Pair.Value : NULL;
|
return n != NULL ? &n->Pair.Value : NULL;
|
||||||
|
@ -591,7 +591,7 @@ public:
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
VT &Insert(const KT key, const VT &value)
|
VT &Insert(const KT &key, const VT &value)
|
||||||
{
|
{
|
||||||
Node *n = FindKey(key);
|
Node *n = FindKey(key);
|
||||||
if (n != NULL)
|
if (n != NULL)
|
||||||
|
@ -614,7 +614,7 @@ public:
|
||||||
//
|
//
|
||||||
//=======================================================================
|
//=======================================================================
|
||||||
|
|
||||||
void Remove(const KT key)
|
void Remove(const KT &key)
|
||||||
{
|
{
|
||||||
DelKey(key);
|
DelKey(key);
|
||||||
}
|
}
|
||||||
|
@ -649,13 +649,13 @@ protected:
|
||||||
hash_t Size; /* must be a power of 2 */
|
hash_t Size; /* must be a power of 2 */
|
||||||
hash_t NumUsed;
|
hash_t NumUsed;
|
||||||
|
|
||||||
const Node *MainPosition(const KT k) const
|
const Node *MainPosition(const KT &k) const
|
||||||
{
|
{
|
||||||
HashTraits Traits;
|
HashTraits Traits;
|
||||||
return &Nodes[Traits.Hash(k) & (Size - 1)];
|
return &Nodes[Traits.Hash(k) & (Size - 1)];
|
||||||
}
|
}
|
||||||
|
|
||||||
Node *MainPosition(const KT k)
|
Node *MainPosition(const KT &k)
|
||||||
{
|
{
|
||||||
HashTraits Traits;
|
HashTraits Traits;
|
||||||
return &Nodes[Traits.Hash(k) & (Size - 1)];
|
return &Nodes[Traits.Hash(k) & (Size - 1)];
|
||||||
|
@ -736,7 +736,7 @@ protected:
|
||||||
**
|
**
|
||||||
** The Value field is left unconstructed.
|
** The Value field is left unconstructed.
|
||||||
*/
|
*/
|
||||||
Node *NewKey(const KT key)
|
Node *NewKey(const KT &key)
|
||||||
{
|
{
|
||||||
Node *mp = MainPosition(key);
|
Node *mp = MainPosition(key);
|
||||||
if (!mp->IsNil())
|
if (!mp->IsNil())
|
||||||
|
@ -775,7 +775,7 @@ protected:
|
||||||
return mp;
|
return mp;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DelKey(const KT key)
|
void DelKey(const KT &key)
|
||||||
{
|
{
|
||||||
Node *mp = MainPosition(key), **mpp;
|
Node *mp = MainPosition(key), **mpp;
|
||||||
HashTraits Traits;
|
HashTraits Traits;
|
||||||
|
@ -814,7 +814,7 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Node *FindKey(const KT key)
|
Node *FindKey(const KT &key)
|
||||||
{
|
{
|
||||||
HashTraits Traits;
|
HashTraits Traits;
|
||||||
Node *n = MainPosition(key);
|
Node *n = MainPosition(key);
|
||||||
|
@ -825,7 +825,7 @@ protected:
|
||||||
return n == NULL || n->IsNil() ? NULL : n;
|
return n == NULL || n->IsNil() ? NULL : n;
|
||||||
}
|
}
|
||||||
|
|
||||||
const Node *FindKey(const KT key) const
|
const Node *FindKey(const KT &key) const
|
||||||
{
|
{
|
||||||
HashTraits Traits;
|
HashTraits Traits;
|
||||||
const Node *n = MainPosition(key);
|
const Node *n = MainPosition(key);
|
||||||
|
@ -836,7 +836,7 @@ protected:
|
||||||
return n == NULL || n->IsNil() ? NULL : n;
|
return n == NULL || n->IsNil() ? NULL : n;
|
||||||
}
|
}
|
||||||
|
|
||||||
Node *GetNode(const KT key)
|
Node *GetNode(const KT &key)
|
||||||
{
|
{
|
||||||
Node *n = FindKey(key);
|
Node *n = FindKey(key);
|
||||||
if (n != NULL)
|
if (n != NULL)
|
||||||
|
|
|
@ -152,10 +152,9 @@ struct ExpVal
|
||||||
class FxExpression
|
class FxExpression
|
||||||
{
|
{
|
||||||
protected:
|
protected:
|
||||||
FxExpression(const FScriptPosition &pos)
|
FxExpression(const FScriptPosition &pos):ScriptPosition(pos)
|
||||||
{
|
{
|
||||||
isresolved = false;
|
isresolved = false;
|
||||||
ScriptPosition = pos;
|
|
||||||
}
|
}
|
||||||
public:
|
public:
|
||||||
virtual ~FxExpression() {}
|
virtual ~FxExpression() {}
|
||||||
|
|
Loading…
Reference in a new issue