mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Convert custom HeadSpin integer types to standard types from stdint.h
This commit is contained in:
@ -63,7 +63,7 @@ struct plKeySeed
|
||||
plFixedKeyId feFixedKey;
|
||||
// NOTE: The following fields are broken out to make adding to the fixed key list easier.
|
||||
// However, what they really are, are just the fields of plUoid (including plLocation)
|
||||
UInt16 fType;
|
||||
uint16_t fType;
|
||||
const char *fObj;
|
||||
|
||||
hsBool Match( plKeySeed *p )
|
||||
|
@ -64,7 +64,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
int mlfTrack = 1;
|
||||
|
||||
static const char* keyNameToLookFor = "AgeSDLHook";
|
||||
static const UInt16 CLASS_TO_TRACK = CLASS_INDEX_SCOPED(plSceneObject);
|
||||
static const uint16_t CLASS_TO_TRACK = CLASS_INDEX_SCOPED(plSceneObject);
|
||||
static const int kCloneID = 0;
|
||||
static const int kClonePlayerID = 0;
|
||||
static plKeyData* lastData = nil;
|
||||
@ -73,7 +73,7 @@ static const int kLocSeq = -1;
|
||||
class keyDataFriend : public plKeyData
|
||||
{
|
||||
public:
|
||||
UInt16 RefCount() const { return fRefCount; }
|
||||
uint16_t RefCount() const { return fRefCount; }
|
||||
};
|
||||
|
||||
static int IsTracked(const plKeyData* keyData)
|
||||
@ -89,7 +89,7 @@ static int IsTracked(const plKeyData* keyData)
|
||||
if( (kLocSeq < 0)
|
||||
||(kLocSeq == keyData->GetUoid().GetLocation().GetSequenceNumber()) )
|
||||
{
|
||||
plConst(UInt16) kMinRefCount(0);
|
||||
plConst(uint16_t) kMinRefCount(0);
|
||||
const keyDataFriend* kdf = (keyDataFriend*)keyData;
|
||||
if( kdf->RefCount() > kMinRefCount )
|
||||
{
|
||||
|
@ -117,9 +117,9 @@ public:
|
||||
//----------------------
|
||||
virtual void Release(plKey targetKey)=0;
|
||||
|
||||
virtual UInt16 GetActiveRefs() const = 0;
|
||||
virtual uint16_t GetActiveRefs() const = 0;
|
||||
|
||||
virtual UInt16 GetNumNotifyCreated() const = 0;
|
||||
virtual uint16_t GetNumNotifyCreated() const = 0;
|
||||
virtual plRefMsg* GetNotifyCreated(int i) const = 0;
|
||||
virtual const hsBitVector& GetActiveBits() const = 0;
|
||||
|
||||
@ -151,7 +151,7 @@ protected:
|
||||
friend class plKey;
|
||||
|
||||
// Refcount--the number of plKeys that have pointers to us.
|
||||
UInt16 fRefCount;
|
||||
uint16_t fRefCount;
|
||||
};
|
||||
|
||||
#endif // plKey_h_inc
|
||||
|
@ -52,9 +52,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
plProfile_CreateMemCounter("Keys", "Memory", KeyMem);
|
||||
|
||||
static UInt32 CalcKeySize(plKeyImp* key)
|
||||
static uint32_t CalcKeySize(plKeyImp* key)
|
||||
{
|
||||
UInt32 nameLen = 0;
|
||||
uint32_t nameLen = 0;
|
||||
if (key->GetUoid().GetObjectName())
|
||||
nameLen = strlen(key->GetUoid().GetObjectName()) + 1;
|
||||
return sizeof(plKeyImp) + nameLen;
|
||||
@ -64,8 +64,8 @@ static UInt32 CalcKeySize(plKeyImp* key)
|
||||
#ifdef LOG_ACTIVE_REFS
|
||||
#include "plCreatableIndex.h"
|
||||
static const char* kObjName = "GUI_District_OptionsMenuGUI";
|
||||
static UInt16 kClassType = CLASS_INDEX_SCOPED(plSceneNode);
|
||||
static UInt32 kCloneID = 0;
|
||||
static uint16_t kClassType = CLASS_INDEX_SCOPED(plSceneNode);
|
||||
static uint32_t kCloneID = 0;
|
||||
hsBool IsTrackedKey(const plKeyImp* key)
|
||||
{
|
||||
return hsStrEQ(key->GetName(), kObjName) && key->GetUoid().GetClassType() == kClassType && key->GetUoid().GetCloneID() == kCloneID;
|
||||
@ -86,7 +86,7 @@ plKeyImp::plKeyImp() :
|
||||
#endif
|
||||
}
|
||||
|
||||
plKeyImp::plKeyImp(plUoid u, UInt32 pos,UInt32 len):
|
||||
plKeyImp::plKeyImp(plUoid u, uint32_t pos,uint32_t len):
|
||||
fUoid(u),
|
||||
fObjectPtr(nil),
|
||||
fStartPos(pos),
|
||||
@ -159,7 +159,7 @@ hsKeyedObject* plKeyImp::ObjectIsLoaded() const
|
||||
}
|
||||
|
||||
// Copy the contents of p for cloning process
|
||||
void plKeyImp::CopyForClone(const plKeyImp *p, UInt32 playerID, UInt32 cloneID)
|
||||
void plKeyImp::CopyForClone(const plKeyImp *p, uint32_t playerID, uint32_t cloneID)
|
||||
{
|
||||
fObjectPtr = nil; // the clone object start as nil
|
||||
fUoid = p->GetUoid(); // we will set the UOID the same to start
|
||||
@ -213,7 +213,7 @@ void plKeyImp::Write(hsStream* s)
|
||||
fUoid.Write(s);
|
||||
s->WriteLE(fStartPos);
|
||||
s->WriteLE(fDataLen);
|
||||
if (fStartPos == (UInt32)-1)
|
||||
if (fStartPos == (uint32_t)-1)
|
||||
int foo = 0;
|
||||
}
|
||||
|
||||
@ -226,8 +226,8 @@ void plKeyImp::WriteObject(hsStream* stream)
|
||||
if (ko == nil)
|
||||
{
|
||||
// Mark the key as not written
|
||||
fStartPos = (UInt32)-1;
|
||||
fDataLen = (UInt32)-1;
|
||||
fStartPos = (uint32_t)-1;
|
||||
fDataLen = (uint32_t)-1;
|
||||
return;
|
||||
}
|
||||
|
||||
@ -405,7 +405,7 @@ void plKeyImp::RemoveClone(plKeyImp* key) const
|
||||
}
|
||||
}
|
||||
|
||||
plKey plKeyImp::GetClone(UInt32 playerID, UInt32 cloneID) const
|
||||
plKey plKeyImp::GetClone(uint32_t playerID, uint32_t cloneID) const
|
||||
{
|
||||
for (int i = 0; i < fClones.GetCount(); i++)
|
||||
{
|
||||
@ -419,12 +419,12 @@ plKey plKeyImp::GetClone(UInt32 playerID, UInt32 cloneID) const
|
||||
return plKey();
|
||||
}
|
||||
|
||||
UInt32 plKeyImp::GetNumClones()
|
||||
uint32_t plKeyImp::GetNumClones()
|
||||
{
|
||||
return fClones.GetCount();
|
||||
}
|
||||
|
||||
plKey plKeyImp::GetCloneByIdx(UInt32 idx)
|
||||
plKey plKeyImp::GetCloneByIdx(uint32_t idx)
|
||||
{
|
||||
if (idx < fClones.GetCount())
|
||||
return plKey::Make(fClones[idx]);
|
||||
|
@ -55,7 +55,7 @@ class plKeyImp : public plKeyData
|
||||
{
|
||||
public:
|
||||
plKeyImp();
|
||||
plKeyImp(plUoid, UInt32 pos,UInt32 len);
|
||||
plKeyImp(plUoid, uint32_t pos,uint32_t len);
|
||||
virtual ~plKeyImp();
|
||||
|
||||
virtual const plUoid& GetUoid() const { return fUoid; }
|
||||
@ -66,7 +66,7 @@ public:
|
||||
virtual hsKeyedObject* VerifyLoaded();
|
||||
|
||||
// called before writing to disk so that static keys can have faster lookups (int compare instead of string compare)
|
||||
void SetObjectID(UInt32 id) {fUoid.SetObjectID(id);}
|
||||
void SetObjectID(uint32_t id) {fUoid.SetObjectID(id);}
|
||||
|
||||
//----------------------
|
||||
// I/O
|
||||
@ -78,8 +78,8 @@ public:
|
||||
// For when you need to skip over a key in a stream
|
||||
static void SkipRead(hsStream* s);
|
||||
|
||||
UInt32 GetStartPos() const { return fStartPos; } // for ResMgr to read the Objects
|
||||
UInt32 GetDataLen() const { return fDataLen; } // for ResMgr to read the Objects
|
||||
uint32_t GetStartPos() const { return fStartPos; } // for ResMgr to read the Objects
|
||||
uint32_t GetDataLen() const { return fDataLen; } // for ResMgr to read the Objects
|
||||
|
||||
//----------------------
|
||||
// Allow a keyed object to behave as if it has an active ref when in fact the object
|
||||
@ -112,35 +112,35 @@ public:
|
||||
//----------------------
|
||||
void AddClone(plKeyImp* c);
|
||||
void RemoveClone(plKeyImp* c) const;
|
||||
plKey GetClone(UInt32 playerID, UInt32 cloneID) const;
|
||||
void CopyForClone(const plKeyImp* p, UInt32 playerID, UInt32 cloneID); // Copy the contents of p for cloning process
|
||||
plKey GetClone(uint32_t playerID, uint32_t cloneID) const;
|
||||
void CopyForClone(const plKeyImp* p, uint32_t playerID, uint32_t cloneID); // Copy the contents of p for cloning process
|
||||
|
||||
UInt32 GetNumClones();
|
||||
plKey GetCloneByIdx(UInt32 idx);
|
||||
uint32_t GetNumClones();
|
||||
plKey GetCloneByIdx(uint32_t idx);
|
||||
plKey GetCloneOwner() { return fCloneOwner; }
|
||||
|
||||
void NotifyCreated();
|
||||
void ISetupNotify(plRefMsg* msg, plRefFlags::Type flags); // Setup notifcations for reference, don't send anything.
|
||||
|
||||
void AddRef(plKeyImp* key) const;
|
||||
UInt16 GetNumRefs() const { return fRefs.GetCount(); }
|
||||
uint16_t GetNumRefs() const { return fRefs.GetCount(); }
|
||||
plKeyImp* GetRef(int i) const { return fRefs[i]; }
|
||||
void RemoveRef(plKeyImp *key) const;
|
||||
|
||||
virtual UInt16 GetActiveRefs() const { return fNumActiveRefs; }
|
||||
virtual UInt16 GetNumNotifyCreated() const { return fNotifyCreated.GetCount(); }
|
||||
virtual uint16_t GetActiveRefs() const { return fNumActiveRefs; }
|
||||
virtual uint16_t GetNumNotifyCreated() const { return fNotifyCreated.GetCount(); }
|
||||
virtual plRefMsg* GetNotifyCreated(int i) const { return fNotifyCreated[i]; }
|
||||
virtual const hsBitVector& GetActiveBits() const { return fActiveRefs; }
|
||||
|
||||
protected:
|
||||
void AddNotifyCreated(plRefMsg* msg, plRefFlags::Type flags);
|
||||
void ClearNotifyCreated();
|
||||
UInt16 GetNumNotifyCreated() { return fNotifyCreated.GetCount(); }
|
||||
uint16_t GetNumNotifyCreated() { return fNotifyCreated.GetCount(); }
|
||||
plRefMsg* GetNotifyCreated(int i) { return fNotifyCreated[i]; }
|
||||
void RemoveNotifyCreated(int i);
|
||||
|
||||
UInt16 IncActiveRefs() { return ++fNumActiveRefs; }
|
||||
UInt16 DecActiveRefs() { return fNumActiveRefs ? --fNumActiveRefs : 0; }
|
||||
uint16_t IncActiveRefs() { return ++fNumActiveRefs; }
|
||||
uint16_t DecActiveRefs() { return fNumActiveRefs ? --fNumActiveRefs : 0; }
|
||||
|
||||
hsBool IsActiveRef(int i) const { return fActiveRefs.IsBitSet(i) != 0; }
|
||||
void SetActiveRef(int i, hsBool on=true) { fActiveRefs.SetBit(i, on); }
|
||||
@ -160,16 +160,16 @@ protected:
|
||||
|
||||
// These fields are the ones actually saved to disk
|
||||
plUoid fUoid;
|
||||
UInt32 fStartPos; // where I live in the Datafile
|
||||
UInt32 fDataLen; // Length in the Datafile
|
||||
uint32_t fStartPos; // where I live in the Datafile
|
||||
uint32_t fDataLen; // Length in the Datafile
|
||||
|
||||
// Following used by hsResMgr to notify on defered load or when a passive ref is destroyed.
|
||||
UInt16 fNumActiveRefs; // num active refs on me
|
||||
uint16_t fNumActiveRefs; // num active refs on me
|
||||
hsBitVector fActiveRefs; // Which of notify created are active refs
|
||||
hsBitVector fNotified; // which of notifycreated i've already notified.
|
||||
hsTArray<plRefMsg*> fNotifyCreated; // people to notify when I'm created or destroyed
|
||||
mutable hsTArray<plKeyImp*> fRefs; // refs I've made (to be released when I'm unregistered).
|
||||
mutable Int16 fPendingRefs; // Outstanding requests I have out.
|
||||
mutable int16_t fPendingRefs; // Outstanding requests I have out.
|
||||
mutable hsTArray<plKeyImp*> fClones; // clones of me
|
||||
mutable plKey fCloneOwner; // pointer for clones back to the owning key
|
||||
};
|
||||
|
@ -82,7 +82,7 @@ hsBool plLocation::operator==(const plLocation& u) const
|
||||
return (fSequenceNumber == u.fSequenceNumber) && ((fFlags & ~kItinerant) == (u.fFlags & ~kItinerant));
|
||||
}
|
||||
|
||||
void plLocation::Set(UInt32 seqNum)
|
||||
void plLocation::Set(uint32_t seqNum)
|
||||
{
|
||||
fSequenceNumber = seqNum;
|
||||
}
|
||||
@ -124,19 +124,19 @@ char* plLocation::StringIze(char* str) const // Format to displayable string
|
||||
return str;
|
||||
}
|
||||
|
||||
plLocation plLocation::MakeReserved(UInt32 number)
|
||||
plLocation plLocation::MakeReserved(uint32_t number)
|
||||
{
|
||||
return plLocation(kReservedLocAvailableStart + number, kReserved);
|
||||
}
|
||||
|
||||
plLocation plLocation::MakeNormal(UInt32 number)
|
||||
plLocation plLocation::MakeNormal(uint32_t number)
|
||||
{
|
||||
return plLocation(kNormalLocStartIdx + number);
|
||||
}
|
||||
|
||||
//// plUoid //////////////////////////////////////////////////////////////////
|
||||
|
||||
plUoid::plUoid(const plLocation& location, UInt16 classType, const char* objectName, const plLoadMask& m)
|
||||
plUoid::plUoid(const plLocation& location, uint16_t classType, const char* objectName, const plLoadMask& m)
|
||||
{
|
||||
fObjectName = nil;
|
||||
Invalidate();
|
||||
@ -165,7 +165,7 @@ void plUoid::Read(hsStream* s)
|
||||
hsAssert(fObjectName == nil, "Reading over an old uoid? You're just asking for trouble, aren't you?");
|
||||
|
||||
// first read contents flags
|
||||
UInt8 contents = s->ReadByte();
|
||||
uint8_t contents = s->ReadByte();
|
||||
|
||||
fLocation.Read(s);
|
||||
|
||||
@ -184,7 +184,7 @@ void plUoid::Read(hsStream* s)
|
||||
if (contents & kHasCloneIDs)
|
||||
{
|
||||
s->LogReadLE( &fCloneID ,"CloneID");
|
||||
UInt16 dummy;
|
||||
uint16_t dummy;
|
||||
s->LogReadLE(&dummy, "dummy"); // To avoid breaking format
|
||||
s->LogReadLE( &fClonePlayerID ,"ClonePlayerID");
|
||||
}
|
||||
@ -198,7 +198,7 @@ void plUoid::Read(hsStream* s)
|
||||
void plUoid::Write(hsStream* s) const
|
||||
{
|
||||
// first write contents byte
|
||||
UInt8 contents = IsClone() ? kHasCloneIDs : 0;
|
||||
uint8_t contents = IsClone() ? kHasCloneIDs : 0;
|
||||
if (fLoadMask.IsUsed())
|
||||
contents |= kHasLoadMask;
|
||||
s->WriteByte(contents);
|
||||
@ -217,7 +217,7 @@ void plUoid::Write(hsStream* s) const
|
||||
if (contents & kHasCloneIDs)
|
||||
{
|
||||
s->WriteLE(fCloneID);
|
||||
UInt16 dummy = 0;
|
||||
uint16_t dummy = 0;
|
||||
s->WriteLE(dummy); // to avoid breaking format
|
||||
s->WriteLE(fClonePlayerID);
|
||||
}
|
||||
|
@ -75,8 +75,8 @@ public:
|
||||
};
|
||||
|
||||
protected:
|
||||
UInt32 fSequenceNumber;
|
||||
UInt16 fFlags;
|
||||
uint32_t fSequenceNumber;
|
||||
uint16_t fFlags;
|
||||
|
||||
enum
|
||||
{
|
||||
@ -97,7 +97,7 @@ protected:
|
||||
kInvalidLocIdx = 0xffffffff
|
||||
};
|
||||
|
||||
plLocation(UInt32 seqNum, UInt16 flags=0) : fFlags(flags) { Set(seqNum); }
|
||||
plLocation(uint32_t seqNum, uint16_t flags=0) : fFlags(flags) { Set(seqNum); }
|
||||
|
||||
public:
|
||||
plLocation() { Invalidate(); }
|
||||
@ -108,12 +108,12 @@ public:
|
||||
hsBool IsValid() const;
|
||||
hsBool IsReserved() const;
|
||||
hsBool IsItinerant() const;
|
||||
void Set(UInt32 seqNum);
|
||||
UInt32 GetSequenceNumber() const { return fSequenceNumber; }
|
||||
void Set(uint32_t seqNum);
|
||||
uint32_t GetSequenceNumber() const { return fSequenceNumber; }
|
||||
hsBool IsVirtual() const;
|
||||
|
||||
void SetFlags(UInt16 flags) { fFlags |= flags; }
|
||||
UInt16 GetFlags() const { return fFlags; }
|
||||
void SetFlags(uint16_t flags) { fFlags |= flags; }
|
||||
uint16_t GetFlags() const { return fFlags; }
|
||||
|
||||
void Read(hsStream* s);
|
||||
void Write(hsStream* s) const;
|
||||
@ -126,8 +126,8 @@ public:
|
||||
// THIS SHOULD BE FOR DEBUGGING ONLY <hint hint>
|
||||
char* StringIze(char* str) const; // Format to displayable string. Returns the same string for convenience
|
||||
|
||||
static plLocation MakeReserved(UInt32 number);
|
||||
static plLocation MakeNormal(UInt32 number);
|
||||
static plLocation MakeReserved(uint32_t number);
|
||||
static plLocation MakeNormal(uint32_t number);
|
||||
|
||||
static const plLocation kGlobalFixedLoc;
|
||||
static const plLocation kSceneViewerLoc;
|
||||
@ -144,13 +144,13 @@ class plUoid
|
||||
{
|
||||
public:
|
||||
plUoid() { fObjectName = nil; Invalidate(); }
|
||||
plUoid(const plLocation& location, UInt16 classType, const char* objectName, const plLoadMask& m=plLoadMask::kAlways);
|
||||
plUoid(const plLocation& location, uint16_t classType, const char* objectName, const plLoadMask& m=plLoadMask::kAlways);
|
||||
plUoid(plFixedKeyId fixedKey);
|
||||
plUoid(const plUoid& src);
|
||||
~plUoid();
|
||||
|
||||
const plLocation& GetLocation() const { return fLocation; }
|
||||
UInt16 GetClassType() const { return fClassType; }
|
||||
uint16_t GetClassType() const { return fClassType; }
|
||||
const char* GetObjectName() const { return fObjectName; }
|
||||
const plLoadMask& GetLoadMask() const { return fLoadMask; }
|
||||
|
||||
@ -165,13 +165,13 @@ public:
|
||||
hsBool operator!=(const plUoid& u) const { return !operator==(u); }
|
||||
|
||||
hsBool IsClone() const { return fCloneID != 0; }
|
||||
UInt32 GetClonePlayerID() const { return fClonePlayerID; }
|
||||
UInt32 GetCloneID() const { return fCloneID; }
|
||||
void SetClone(UInt32 playerID, UInt32 cloneID) { hsAssert(cloneID < 0xffff, "Clone id too high"); fCloneID = UInt16(cloneID); fClonePlayerID = playerID; }
|
||||
uint32_t GetClonePlayerID() const { return fClonePlayerID; }
|
||||
uint32_t GetCloneID() const { return fCloneID; }
|
||||
void SetClone(uint32_t playerID, uint32_t cloneID) { hsAssert(cloneID < 0xffff, "Clone id too high"); fCloneID = uint16_t(cloneID); fClonePlayerID = playerID; }
|
||||
|
||||
UInt32 GetObjectID() const { return fObjectID; }
|
||||
uint32_t GetObjectID() const { return fObjectID; }
|
||||
// Export time only. Only plRegistryKeyList should call this.
|
||||
void SetObjectID(UInt32 id) { fObjectID = id; }
|
||||
void SetObjectID(uint32_t id) { fObjectID = id; }
|
||||
|
||||
// THIS SHOULD BE FOR DEBUGGING ONLY <hint hint>
|
||||
char* StringIze(char* str) const; // Format to displayable string
|
||||
@ -183,10 +183,10 @@ protected:
|
||||
kHasLoadMask = 0x2,
|
||||
};
|
||||
|
||||
UInt32 fObjectID;
|
||||
UInt32 fClonePlayerID; // The ID of the player who made this clone
|
||||
UInt16 fCloneID; // The ID of this clone (unique per client)
|
||||
UInt16 fClassType;
|
||||
uint32_t fObjectID;
|
||||
uint32_t fClonePlayerID; // The ID of the player who made this clone
|
||||
uint16_t fCloneID; // The ID of this clone (unique per client)
|
||||
uint16_t fClassType;
|
||||
char* fObjectName;
|
||||
plLocation fLocation;
|
||||
plLoadMask fLoadMask;
|
||||
|
Reference in New Issue
Block a user