mirror of
https://github.com/ZDoom/gzdoom-gles.git
synced 2024-11-11 23:32:02 +00:00
- Removed the RUNTIME_TYPE macro. I just included it because MFC has one, but it's pretty
pointless here. SVN r2267 (scripting)
This commit is contained in:
parent
06995e26d9
commit
19f5b1dea1
9 changed files with 14 additions and 16 deletions
|
@ -524,7 +524,7 @@ public:
|
|||
|
||||
inline AActor *GetDefault () const
|
||||
{
|
||||
return (AActor *)(RUNTIME_TYPE(this)->Defaults);
|
||||
return (AActor *)(this->GetClass()->Defaults);
|
||||
}
|
||||
|
||||
DDropItem *GetDropItems() const;
|
||||
|
|
|
@ -80,7 +80,6 @@ class DPillar;
|
|||
|
||||
class PClassActor;
|
||||
|
||||
#define RUNTIME_TYPE(object) (object->GetClass()) // Passed an object, returns the type of that object
|
||||
#define RUNTIME_CLASS_CASTLESS(cls) (cls::RegistrationInfo.MyClass) // Passed a native class name, returns a PClass representing that class
|
||||
#define RUNTIME_CLASS(cls) ((cls::MetaClass *)RUNTIME_CLASS_CASTLESS(cls)) // Like above, but returns the true type of the meta object
|
||||
#define NATIVE_TYPE(object) (object->StaticType()) // Passed an object, returns the type of the C++ class representing the object
|
||||
|
|
|
@ -1043,7 +1043,7 @@ FArchive &FArchive::WriteObject (DObject *obj)
|
|||
}
|
||||
else
|
||||
{
|
||||
PClass *type = RUNTIME_TYPE(obj);
|
||||
PClass *type = obj->GetClass();
|
||||
|
||||
if (type == RUNTIME_CLASS(DObject))
|
||||
{
|
||||
|
|
|
@ -285,7 +285,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallOrbit)
|
|||
|
||||
if (!self->IsKindOf (RUNTIME_CLASS(ASorcBall)))
|
||||
{
|
||||
I_Error ("Corrupted sorcerer:\nTried to use a %s", RUNTIME_TYPE(self)->TypeName.GetChars());
|
||||
I_Error ("Corrupted sorcerer:\nTried to use a %s", self->GetClass()->TypeName.GetChars());
|
||||
}
|
||||
actor = static_cast<ASorcBall *> (self);
|
||||
|
||||
|
@ -317,7 +317,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallOrbit)
|
|||
break;
|
||||
|
||||
case SORC_STOPPING: // Balls stopping
|
||||
if ((parent->StopBall == RUNTIME_TYPE(actor)) &&
|
||||
if ((parent->StopBall == actor->GetClass()) &&
|
||||
(parent->args[1] > SORCBALL_SPEED_ROTATIONS) &&
|
||||
(abs(angle - (parent->angle>>ANGLETOFINESHIFT)) < (30<<5)))
|
||||
{
|
||||
|
@ -334,7 +334,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallOrbit)
|
|||
break;
|
||||
|
||||
case SORC_FIRESPELL: // Casting spell
|
||||
if (parent->StopBall == RUNTIME_TYPE(actor))
|
||||
if (parent->StopBall == actor->GetClass())
|
||||
{
|
||||
// Put sorcerer into special throw spell anim
|
||||
if (parent->health > 0)
|
||||
|
@ -345,7 +345,7 @@ DEFINE_ACTION_FUNCTION(AActor, A_SorcBallOrbit)
|
|||
break;
|
||||
|
||||
case SORC_FIRING_SPELL:
|
||||
if (parent->StopBall == RUNTIME_TYPE(actor))
|
||||
if (parent->StopBall == actor->GetClass())
|
||||
{
|
||||
if (actor->special2-- <= 0)
|
||||
{
|
||||
|
|
|
@ -263,7 +263,7 @@ FSpotList *DSpotState::FindSpotList(const PClass *type)
|
|||
|
||||
bool DSpotState::AddSpot(ASpecialSpot *spot)
|
||||
{
|
||||
FSpotList *list = FindSpotList(RUNTIME_TYPE(spot));
|
||||
FSpotList *list = FindSpotList(spot->GetClass());
|
||||
if (list != NULL) return list->Add(spot);
|
||||
return false;
|
||||
}
|
||||
|
@ -276,7 +276,7 @@ bool DSpotState::AddSpot(ASpecialSpot *spot)
|
|||
|
||||
bool DSpotState::RemoveSpot(ASpecialSpot *spot)
|
||||
{
|
||||
FSpotList *list = FindSpotList(RUNTIME_TYPE(spot));
|
||||
FSpotList *list = FindSpotList(spot->GetClass());
|
||||
if (list != NULL) return list->Remove(spot);
|
||||
return false;
|
||||
}
|
||||
|
@ -393,7 +393,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnSingleItem)
|
|||
AActor *spot = NULL;
|
||||
DSpotState *state = DSpotState::GetSpotState();
|
||||
|
||||
if (state != NULL) spot = state->GetRandomSpot(RUNTIME_TYPE(self), true);
|
||||
if (state != NULL) spot = state->GetRandomSpot(self->GetClass(), true);
|
||||
if (spot == NULL) return 0;
|
||||
|
||||
if (!multiplayer && pr_spawnmace() < fail_sp)
|
||||
|
@ -429,7 +429,7 @@ DEFINE_ACTION_FUNCTION_PARAMS(AActor, A_SpawnSingleItem)
|
|||
}
|
||||
if (spawned->IsKindOf(RUNTIME_CLASS(AInventory)))
|
||||
{
|
||||
static_cast<AInventory*>(spawned)->SpawnPointClass = RUNTIME_TYPE(self);
|
||||
static_cast<AInventory*>(spawned)->SpawnPointClass = self->GetClass();
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
|
|
@ -556,7 +556,7 @@ static void DrawOneWeapon(player_t * CPlayer, int x, int & y, AWeapon * weapon)
|
|||
|
||||
// Powered up weapons and inherited sister weapons are not displayed.
|
||||
if (weapon->WeaponFlags & WIF_POWERED_UP) return;
|
||||
if (weapon->SisterWeapon && weapon->IsKindOf(RUNTIME_TYPE(weapon->SisterWeapon))) return;
|
||||
if (weapon->SisterWeapon && weapon->IsKindOf(weapon->SisterWeapon->GetClass())) return;
|
||||
|
||||
trans=0x6666;
|
||||
if (CPlayer->ReadyWeapon)
|
||||
|
|
|
@ -4822,7 +4822,7 @@ int DLevelScript::RunScript ()
|
|||
}
|
||||
else if (activator)
|
||||
{
|
||||
work += RUNTIME_TYPE(activator)->TypeName.GetChars();
|
||||
work += activator->GetClass()->TypeName.GetChars();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -1178,8 +1178,7 @@ bool P_LookForMonsters (AActor *actor)
|
|||
{ // Stop searching
|
||||
return false;
|
||||
}
|
||||
if (mo->IsKindOf (RUNTIME_TYPE(actor)) ||
|
||||
actor->IsKindOf (RUNTIME_TYPE(mo)))
|
||||
if (mo->IsKindOf (actor->GetClass()) || actor->IsKindOf (mo->GetClass()))
|
||||
{ // [RH] Don't go after same species
|
||||
continue;
|
||||
}
|
||||
|
|
|
@ -2499,7 +2499,7 @@ void P_NightmareRespawn (AActor *mobj)
|
|||
// spawn it
|
||||
x = mobj->SpawnPoint[0];
|
||||
y = mobj->SpawnPoint[1];
|
||||
mo = Spawn (RUNTIME_TYPE(mobj), x, y, z, NO_REPLACE);
|
||||
mo = Spawn (mobj->GetClass(), x, y, z, NO_REPLACE);
|
||||
|
||||
if (z == ONFLOORZ)
|
||||
mo->z += mo->SpawnPoint[2];
|
||||
|
|
Loading…
Reference in a new issue