- Changed handling of AUTOPAGE texture so that it is properly inserted into

the texture manager even if it is from Raven's IWADs.
- Removed code related to internal ActorInfo definitions from dobjtype.cpp.
- removed unneeded file dehackedactions.h


SVN r1162 (trunk)
This commit is contained in:
Christoph Oelckers 2008-08-12 09:57:59 +00:00
parent 765ccd0100
commit b1d36182c4
8 changed files with 70 additions and 184 deletions

View file

@ -1,3 +1,9 @@
August 12, 2008 (Changes by Graf Zahl)
- Changed handling of AUTOPAGE texture so that it is properly inserted into
the texture manager even if it is from Raven's IWADs.
- Removed code related to internal ActorInfo definitions from dobjtype.cpp.
- removed unneeded file dehackedactions.h
August 11, 2008
- Ported asm_x86_64/tmap3.nas to AT&T syntax so it can be compiled with gas.
After finding out that gas does have directives to describe the .eh_frame

View file

@ -337,7 +337,7 @@ static int markpointnum = 0; // next point to be assigned
static int followplayer = 1; // specifies whether to follow the player around
static FTexture *mapback; // the automap background
static FTextureID mapback; // the automap background
static fixed_t mapystart=0; // y-value for the start of the map bitmap...used in the parallax stuff.
static fixed_t mapxstart=0; //x-value for the bitmap.
@ -534,19 +534,24 @@ static void AM_ScrollParchment (fixed_t dmapx, fixed_t dmapy)
mapxstart -= MulScale12 (dmapx, scale_mtof);
mapystart -= MulScale12 (dmapy, scale_mtof);
if (mapback != NULL)
if (mapback.isValid())
{
int pwidth = mapback->GetWidth() << MAPBITS;
int pheight = mapback->GetHeight() << MAPBITS;
FTexture *backtex = TexMan[mapback];
while(mapxstart > 0)
mapxstart -= pwidth;
while(mapxstart <= -pwidth)
mapxstart += pwidth;
while(mapystart > 0)
mapystart -= pheight;
while(mapystart <= -pheight)
mapystart += pheight;
if (backtex != NULL)
{
int pwidth = backtex->GetWidth() << MAPBITS;
int pheight = backtex->GetHeight() << MAPBITS;
while(mapxstart > 0)
mapxstart -= pwidth;
while(mapxstart <= -pwidth)
mapxstart += pwidth;
while(mapystart > 0)
mapystart -= pheight;
while(mapystart <= -pheight)
mapystart += pheight;
}
}
}
@ -737,23 +742,7 @@ void AM_loadPics ()
marknums[i] = TexMan.CheckForTexture (namebuf, FTexture::TEX_MiscPatch);
}
if (mapback == NULL)
{
i = Wads.CheckNumForName ("AUTOPAGE");
if (i >= 0)
{
mapback = FTexture::CreateTexture(i, FTexture::TEX_Autopage);
}
}
}
void AM_unloadPics ()
{
if (mapback != NULL)
{
delete mapback;
mapback = NULL;
}
mapback = TexMan.CheckForTexture("AUTOPAGE", FTexture::TEX_MiscPatch);
}
bool AM_clearMarks ()
@ -788,7 +777,6 @@ void AM_LevelInit ()
//
void AM_Stop ()
{
AM_unloadPics ();
automapactive = false;
stopped = true;
BorderNeedRefresh = screen->GetPageCount ();
@ -1063,22 +1051,26 @@ void AM_Ticker ()
//
void AM_clearFB (const AMColor &color)
{
if (mapback == NULL || !am_drawmapback)
if (!mapback.isValid() || !am_drawmapback)
{
screen->Clear (0, 0, f_w, f_h, color.Index, color.RGB);
}
else
{
int pwidth = mapback->GetWidth();
int pheight = mapback->GetHeight();
int x, y;
//blit the automap background to the screen.
for (y = mapystart >> MAPBITS; y < f_h; y += pheight)
FTexture *backtex = TexMan[mapback];
if (backtex != NULL)
{
for (x = mapxstart >> MAPBITS; x < f_w; x += pwidth)
int pwidth = backtex->GetWidth();
int pheight = backtex->GetHeight();
int x, y;
//blit the automap background to the screen.
for (y = mapystart >> MAPBITS; y < f_h; y += pheight)
{
screen->DrawTexture (mapback, x, y, DTA_ClipBottom, f_h, DTA_TopOffset, 0, DTA_LeftOffset, 0, TAG_DONE);
for (x = mapxstart >> MAPBITS; x < f_w; x += pwidth)
{
screen->DrawTexture (backtex, x, y, DTA_ClipBottom, f_h, DTA_TopOffset, 0, DTA_LeftOffset, 0, TAG_DONE);
}
}
}
}

View file

@ -1,108 +0,0 @@
// This file is included by d_dehacked.cpp twice.
// The first time is to prototype these functions, and the second
// time is to define them in the CodePtrs list. The macros are
// defined appropriately to get the desired effect each time.
ACTOR(MonsterRail)
WEAPON(FireRailgun)
WEAPON(FireRailgunLeft)
WEAPON(FireRailgunRight)
WEAPON(RailWait)
WEAPON(Light0)
WEAPON(WeaponReady)
WEAPON(Lower)
WEAPON(Raise)
WEAPON(Punch)
WEAPON(ReFire)
WEAPON(FirePistol)
WEAPON(Light1)
WEAPON(FireShotgun)
WEAPON(Light2)
WEAPON(FireShotgun2)
WEAPON(CheckReload)
WEAPON(OpenShotgun2)
WEAPON(LoadShotgun2)
WEAPON(CloseShotgun2)
WEAPON(FireCGun)
WEAPON(GunFlash)
WEAPON(FireMissile)
WEAPON(Saw)
WEAPON(FirePlasma)
WEAPON(BFGsound)
WEAPON(FireBFG)
ACTOR(BFGSpray)
ACTOR(Explode)
ACTOR(Pain)
ACTOR(PlayerScream)
ACTOR(NoBlocking)
ACTOR(XScream)
ACTOR(Look)
ACTOR(Chase)
ACTOR(FaceTarget)
ACTOR(PosAttack)
ACTOR(Scream)
ACTOR(SPosAttack)
ACTOR(VileChase)
ACTOR(VileStart)
ACTOR(VileTarget)
ACTOR(VileAttack)
ACTOR(StartFire)
ACTOR(Fire)
ACTOR(FireCrackle)
ACTOR(Tracer)
ACTOR(SkelWhoosh)
ACTOR(SkelFist)
ACTOR(SkelMissile)
ACTOR(FatRaise)
ACTOR(FatAttack1)
ACTOR(FatAttack2)
ACTOR(FatAttack3)
ACTOR(BossDeath)
ACTOR(CPosAttack)
ACTOR(CPosRefire)
ACTOR(TroopAttack)
ACTOR(SargAttack)
ACTOR(HeadAttack)
ACTOR(BruisAttack)
ACTOR(SkullAttack)
ACTOR(Metal)
ACTOR(SpidRefire)
ACTOR(BabyMetal)
ACTOR(BspiAttack)
ACTOR(Hoof)
ACTOR(CyberAttack)
ACTOR(PainAttack)
ACTOR(PainDie)
ACTOR(KeenDie)
ACTOR(BrainPain)
ACTOR(BrainScream)
ACTOR(BrainDie)
ACTOR(BrainAwake)
ACTOR(BrainSpit)
ACTOR(SpawnSound)
ACTOR(SpawnFly)
ACTOR(BrainExplode)
ACTOR(Die)
ACTOR(Detonate)
ACTOR(Mushroom)
ACTOR(SetFloorClip)
ACTOR(UnSetFloorClip)
ACTOR(HideThing)
ACTOR(UnHideThing)
ACTOR(SetInvulnerable)
ACTOR(UnSetInvulnerable)
ACTOR(SetReflective)
ACTOR(UnSetReflective)
ACTOR(SetReflectiveInvulnerable)
ACTOR(UnSetReflectiveInvulnerable)
ACTOR(SetShootable)
ACTOR(UnSetShootable)
ACTOR(NoGravity)
ACTOR(Gravity)
ACTOR(LowGravity)
#undef WEAPON
#undef ACTOR

View file

@ -123,36 +123,29 @@ void PClass::StaticFreeData (PClass *type)
}
type->FreeStateList ();
if (type->ActorInfo != NULL)
{
if (type->ActorInfo->OwnedStates != NULL)
{
delete[] type->ActorInfo->OwnedStates;
type->ActorInfo->OwnedStates = NULL;
}
if (type->ActorInfo->DamageFactors != NULL)
{
delete type->ActorInfo->DamageFactors;
type->ActorInfo->DamageFactors = NULL;
}
if (type->ActorInfo->PainChances != NULL)
{
delete type->ActorInfo->PainChances;
type->ActorInfo->PainChances = NULL;
}
delete type->ActorInfo;
type->ActorInfo = NULL;
}
if (type->bRuntimeClass)
{
if (type->ActorInfo != NULL)
{
if (type->ActorInfo->OwnedStates != NULL)
{
delete[] type->ActorInfo->OwnedStates;
type->ActorInfo->OwnedStates = NULL;
}
if (type->ActorInfo->DamageFactors != NULL)
{
delete type->ActorInfo->DamageFactors;
type->ActorInfo->DamageFactors = NULL;
}
if (type->ActorInfo->PainChances != NULL)
{
delete type->ActorInfo->PainChances;
type->ActorInfo->PainChances = NULL;
}
delete type->ActorInfo;
type->ActorInfo = NULL;
}
if (type->bRuntimeClass != 2)
{
delete type;
}
else
{
type->Symbols.ReleaseSymbols();
}
delete type;
}
else
{
@ -315,8 +308,6 @@ void PClass::InitializeActorInfo ()
memset (Defaults, 0, Size);
}
bRuntimeClass = 2; // Class is internal but actor data external
FActorInfo *info = ActorInfo = new FActorInfo;
info->Class = this;
info->GameFilter = GAME_Any;
@ -398,7 +389,7 @@ const PClass *PClass::NativeClass() const
{
const PClass *cls = this;
while (cls && cls->bRuntimeClass == 1)
while (cls && cls->bRuntimeClass)
cls = cls->ParentClass;
return cls;

View file

@ -103,7 +103,7 @@ struct PClass
PClass *HashNext;
FMetaTable Meta;
BYTE *Defaults;
BYTE bRuntimeClass; // class was defined at run-time, not compile-time
bool bRuntimeClass; // class was defined at run-time, not compile-time
unsigned short ClassIndex;
PSymbolTable Symbols;

View file

@ -70,13 +70,15 @@ private:
//==========================================================================
//
//
// This texture type will only be used for the AUTOPAGE lump if no other
// format matches.
//
//==========================================================================
FTexture *AutomapTexture_TryCreate(FileReader &data, int lumpnum)
{
if (data.GetLength() < 320) return NULL;
if (!Wads.CheckLumpName(lumpnum, "AUTOPAGE")) return NULL;
return new FAutomapTexture(lumpnum);
}
@ -89,6 +91,9 @@ FTexture *AutomapTexture_TryCreate(FileReader &data, int lumpnum)
FAutomapTexture::FAutomapTexture (int lumpnum)
: Pixels(NULL), LumpNum(lumpnum)
{
Wads.GetLumpName (Name, lumpnum);
Name[8] = 0;
Width = 320;
Height = WORD(Wads.LumpLength(lumpnum) / 320);
CalcBitSize ();

View file

@ -87,7 +87,7 @@ FTexture * FTexture::CreateTexture (int lumpnum, int usetype)
{ RawPageTexture_TryCreate, TEX_MiscPatch },
{ FlatTexture_TryCreate, TEX_Flat },
{ PatchTexture_TryCreate, TEX_Any },
{ AutomapTexture_TryCreate, TEX_Autopage },
{ AutomapTexture_TryCreate, TEX_MiscPatch },
};
if (lumpnum == -1) return NULL;