mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-25 13:31:37 +00:00
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
- Fixed: TObjPtr did not use a union to map its 2 pointers together. - Added a compatibility mode for A_Mushroom. For DECORATE it is an additional parameter but to force it for Dehacked mods some minor hacks using the Misc1 variable were needed. SVN r1746 (trunk)
This commit is contained in:
parent
8330a69212
commit
641f946e32
7 changed files with 63 additions and 7 deletions
|
@ -1,4 +1,11 @@
|
|||
August 1, 2009
|
||||
August 2, 2009 (Changes by Graf Zahl)
|
||||
- Fixed: The big endian version of PalEntry did not add the DWORD d field.
|
||||
- Fixed: TObjPtr did not use a union to map its 2 pointers together.
|
||||
- Added a compatibility mode for A_Mushroom. For DECORATE it is an additional
|
||||
parameter but to force it for Dehacked mods some minor hacks using the
|
||||
Misc1 variable were needed.
|
||||
|
||||
August 1, 2009
|
||||
- Moved the terget->velz assignment to the end of A_VileAttack to remove the
|
||||
influence of vertical thrust from the radius attack, since ZDoom does
|
||||
explosions in three dimensions, but Doom only did it in two.
|
||||
|
|
|
@ -1715,6 +1715,11 @@ static int PatchCodePtrs (int dummy)
|
|||
}
|
||||
}
|
||||
SetPointer(state, sym);
|
||||
// Hack to trigger compatible mode for A_Mushroom when called from Dehacked mods
|
||||
if (symname.CompareNoCase("A_Mushroom"))
|
||||
{
|
||||
state->Misc1 = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -340,8 +340,11 @@ namespace GC
|
|||
template<class T>
|
||||
class TObjPtr
|
||||
{
|
||||
T *p;
|
||||
DObject *o; // For GC::Mark below to make GCC's strict aliasing happy
|
||||
union
|
||||
{
|
||||
T *p;
|
||||
DObject *o;
|
||||
};
|
||||
public:
|
||||
TObjPtr() throw()
|
||||
{
|
||||
|
|
|
@ -162,7 +162,14 @@ struct PalEntry
|
|||
#ifdef WORDS_BIGENDIAN
|
||||
PalEntry (BYTE ir, BYTE ig, BYTE ib) : a(0), r(ir), g(ig), b(ib) {}
|
||||
PalEntry (BYTE ia, BYTE ir, BYTE ig, BYTE ib) : a(ia), r(ir), g(ig), b(ib) {}
|
||||
BYTE a,r,g,b;
|
||||
union
|
||||
{
|
||||
struct
|
||||
{
|
||||
BYTE a,r,g,b;
|
||||
};
|
||||
DWORD d;
|
||||
};
|
||||
#else
|
||||
PalEntry (BYTE ir, BYTE ig, BYTE ib) : b(ib), g(ig), r(ir), a(0) {}
|
||||
PalEntry (BYTE ia, BYTE ir, BYTE ig, BYTE ib) : b(ib), g(ig), r(ir), a(ia) {}
|
||||
|
|
|
@ -118,13 +118,16 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_FatAttack3)
|
|||
// Original idea: Linguica
|
||||
//
|
||||
|
||||
AActor * P_OldSpawnMissile(AActor * source, AActor * dest, const PClass *type);
|
||||
|
||||
DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Mushroom)
|
||||
{
|
||||
int i, j;
|
||||
|
||||
ACTION_PARAM_START(2);
|
||||
ACTION_PARAM_START(3);
|
||||
ACTION_PARAM_CLASS(spawntype, 0);
|
||||
ACTION_PARAM_INT(n, 1);
|
||||
ACTION_PARAM_INT(flags, 2);
|
||||
|
||||
if (n == 0) n = self->GetMissileDamage (0, 1);
|
||||
if (spawntype == NULL) spawntype = PClass::FindClass("FatShot");
|
||||
|
@ -146,7 +149,14 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_Mushroom)
|
|||
target->x = self->x + (i << FRACBITS); // Aim in many directions from source
|
||||
target->y = self->y + (j << FRACBITS);
|
||||
target->z = self->z + (P_AproxDistance(i,j) << (FRACBITS+2)); // Aim up fairly high
|
||||
mo = P_SpawnMissile (self, target, spawntype); // Launch fireball
|
||||
if (flags == 0 && self->state->Misc1 == 0)
|
||||
{
|
||||
mo = P_SpawnMissile (self, target, spawntype); // Launch fireball
|
||||
}
|
||||
else
|
||||
{
|
||||
mo = P_OldSpawnMissile (self, target, spawntype); // Launch fireball
|
||||
}
|
||||
if (mo != NULL)
|
||||
{
|
||||
mo->velx >>= 1;
|
||||
|
|
|
@ -4877,6 +4877,30 @@ AActor *P_SpawnMissileXYZ (fixed_t x, fixed_t y, fixed_t z,
|
|||
return (!checkspawn || P_CheckMissileSpawn (th)) ? th : NULL;
|
||||
}
|
||||
|
||||
AActor * P_OldSpawnMissile(AActor * source, AActor * dest, const PClass *type)
|
||||
{
|
||||
angle_t an;
|
||||
fixed_t dist;
|
||||
AActor *th = Spawn (type, source->x, source->y, source->z + 4*8*FRACUNIT, ALLOW_REPLACE);
|
||||
|
||||
P_PlaySpawnSound(th, source);
|
||||
th->target = source; // record missile's originator
|
||||
|
||||
th->angle = an = R_PointToAngle2 (source->x, source->y, dest->x, dest->y);
|
||||
an >>= ANGLETOFINESHIFT;
|
||||
th->velx = FixedMul (th->Speed, finecosine[an]);
|
||||
th->vely = FixedMul (th->Speed, finesine[an]);
|
||||
|
||||
dist = P_AproxDistance (dest->x - source->x, dest->y - source->y);
|
||||
if (th->Speed) dist = dist / th->Speed;
|
||||
|
||||
if (dist < 1)
|
||||
dist = 1;
|
||||
|
||||
th->velz = (dest->z - source->z) / dist;
|
||||
P_CheckMissileSpawn(th);
|
||||
return th;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
//
|
||||
// FUNC P_SpawnMissileAngle
|
||||
|
|
|
@ -100,7 +100,7 @@ ACTOR Actor native //: Thinker
|
|||
action native A_BrainExplode();
|
||||
action native A_Die(name damagetype = "none");
|
||||
action native A_Detonate();
|
||||
action native A_Mushroom(class<Actor> spawntype = "FatShot", int numspawns = 0);
|
||||
action native A_Mushroom(class<Actor> spawntype = "FatShot", int numspawns = 0, int flags = 0);
|
||||
action native A_CallSpecial(int special, int arg1=0, int arg2=0, int arg3=0, int arg4=0, int arg5=0);
|
||||
|
||||
action native A_SetFloorClip();
|
||||
|
|
Loading…
Reference in a new issue