Skip to content

Commit

Permalink
reverted all the state work on Shadow Warrior.
Browse files Browse the repository at this point in the history
  • Loading branch information
coelckers committed Feb 24, 2024
1 parent 3e30e5f commit c769de1
Show file tree
Hide file tree
Showing 57 changed files with 8,389 additions and 9,103 deletions.
1 change: 0 additions & 1 deletion source/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -979,7 +979,6 @@ set (PCH_SOURCES
core/statistics.cpp
core/secrets.cpp
core/savegamehelp.cpp
core/states.cpp
core/precache.cpp
core/psky.cpp
core/quotes.cpp
Expand Down
30 changes: 0 additions & 30 deletions source/common/engine/serializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@
#include "textures.h"
#include "texturemanager.h"
#include "base64.h"
#include "vm.h"
#include "i_interface.h"

using namespace FileSys;
Expand Down Expand Up @@ -1592,35 +1591,6 @@ template<> FSerializer &Serialize(FSerializer &arc, const char *key, Dictionary
}
}

template<> FSerializer& Serialize(FSerializer& arc, const char* key, VMFunction*& func, VMFunction**)
{
if (arc.isWriting())
{
arc.WriteKey(key);
if (func) arc.w->String(func->QualifiedName);
else arc.w->Null();
}
else
{
func = nullptr;

auto val = arc.r->FindKey(key);
if (val != nullptr && val->IsString())
{
auto qname = val->GetString();
size_t p = strcspn(qname, ".");
if (p != 0)
{
FName clsname(qname, p, true);
FName funcname(qname + p + 1, true);
func = PClass::FindFunction(clsname, funcname);
}
}

}
return arc;
}

//==========================================================================
//
// Handler to retrieve a numeric value of any kind.
Expand Down
1 change: 0 additions & 1 deletion source/common/engine/serializer.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,6 @@ inline FSerializer& Serialize(FSerializer& arc, const char* key, BitArray& value
template<> FSerializer& Serialize(FSerializer& arc, const char* key, PClass*& clst, PClass** def);
template<> FSerializer& Serialize(FSerializer& arc, const char* key, FFont*& font, FFont** def);
template<> FSerializer &Serialize(FSerializer &arc, const char *key, Dictionary *&dict, Dictionary **def);
template<> FSerializer& Serialize(FSerializer& arc, const char* key, VMFunction*& dict, VMFunction** def);

inline FSerializer &Serialize(FSerializer &arc, const char *key, DVector3 &p, DVector3 *def)
{
Expand Down
31 changes: 1 addition & 30 deletions source/core/actorinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
#include "dobject.h"
#include "m_fixed.h"
#include "m_random.h"
#include "states.h"

class FScanner;
class FInternalLightAssociation;
Expand Down Expand Up @@ -45,10 +44,6 @@ struct FActorInfo
// these are temporary. Due to how Build games handle their tiles, we cannot look up the textures when scripts are being parsed.
TArray<FString> SpriteSetNames;

FState* OwnedStates = nullptr;
int NumOwnedStates = 0;
FStateLabels* StateList = nullptr;

FActorInfo() = default;
FActorInfo(const FActorInfo& other)
{
Expand All @@ -64,7 +59,6 @@ struct FActorInfo
}

void ResolveTextures(const char* clsname, DCoreActor *defaults);

};

// No objects of this type will be created ever - its only use is to static_cast
Expand All @@ -88,30 +82,7 @@ class PClassActor : public PClass
PClassActor *GetReplacement();
PClassActor *GetReplacee();

bool OwnsState(const FState* state) const
{
auto i = ActorInfo();
return i != nullptr && state >= i->OwnedStates && state < i->OwnedStates + i->NumOwnedStates;
}

FState* GetStates() const
{
return ActorInfo()->OwnedStates;
}

FStateLabels* GetStateLabels() const
{
return ActorInfo()->StateList;
}

FState* FindState(int numnames, FName* names, bool exact = false) const;
FState* FindStateByString(const char* name, bool exact = false);
FState* FindState(FName name) const
{
return FindState(1, &name);
}


// For those times when being able to scan every kind of actor is convenient
inline static TArray<PClassActor *> AllActorClasses;
};

4 changes: 0 additions & 4 deletions source/core/coreactor.h
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,3 @@ inline DCoreActor* GetDefaultByType(const PClass* type)
return (DCoreActor*)(type->Defaults);
}

inline PClassActor* ValidateActor(PClass* cls)
{
return cls && cls->IsDescendantOf(RUNTIME_CLASS(DCoreActor)) ? static_cast<PClassActor*>(cls) : nullptr;
}
43 changes: 0 additions & 43 deletions source/core/namedef_custom.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,46 +57,3 @@ xx(isExhumed)
xx(ChangeAction)
xx(ChangeAI)
xx(ChangeMove)

xx(Swim)
xx(DeathJump)
xx(Jump)
xx(DeathFall)
xx(Fall)
xx(Dead)
xx(Run)
xx(Sit)
xx(Stand)
xx(Death1)
xx(Death2)
xx(Duck)
xx(Rise)
xx(Fly)
xx(Crawl)
xx(Pain)
xx(Climb)
xx(Special)
xx(CloseAttack)
xx(Attack)
xx(Dive)
xx(Sword)
xx(Punch)
xx(HeadHurl)
xx(HangFall)

xx(Speeds)
xx(TicAdjust)
xx(MaxWeapons)
xx(AmbientSound)
xx(AlertSound)
xx(AttackSound)
xx(PainSound)
xx(DieSound)
xx(ExtraSound1)
xx(ExtraSound2)
xx(ExtraSound3)
xx(ExtraSound4)
xx(ExtraSound5)
xx(ExtraSound6)
xx(CloseAttackPercent)
xx(AttackPercent)
1 change: 0 additions & 1 deletion source/core/serializer_raze.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@
#include "rapidjson/prettywriter.h"
#include "rapidjson/document.h"
#include "serializer_raze.h"
#include "states.h"
#include "actorinfo.h"
#include "printf.h"
#include "utf8.h"
Expand Down
Loading

0 comments on commit c769de1

Please sign in to comment.