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:
@ -56,7 +56,7 @@ public:
|
||||
// flags should be either:
|
||||
// plRefMsg::kOnRequest - I'm adding this child to the receiver
|
||||
// plRefMsg::kOnRemove - I'm detaching this child from the receiver
|
||||
plAttachMsg(const plKey &rcv, hsKeyedObject* child, UInt8 context, const plKey snd=nil) : plRefMsg(rcv, context) { SetSender(snd); SetRef(child); }
|
||||
plAttachMsg(const plKey &rcv, hsKeyedObject* child, uint8_t context, const plKey snd=nil) : plRefMsg(rcv, context) { SetSender(snd); SetRef(child); }
|
||||
|
||||
CLASSNAME_REGISTER( plAttachMsg );
|
||||
GETINTERFACE_ANY( plAttachMsg, plRefMsg );
|
||||
|
@ -139,15 +139,15 @@ public:
|
||||
|
||||
plClientRefMsg(): fType(-1), fWhich(-1) {};
|
||||
|
||||
plClientRefMsg(const plKey &r, UInt8 refMsgFlags, Int8 which , Int8 type)
|
||||
plClientRefMsg(const plKey &r, uint8_t refMsgFlags, int8_t which , int8_t type)
|
||||
: plRefMsg(r, refMsgFlags), fType(type), fWhich(which) {}
|
||||
|
||||
|
||||
CLASSNAME_REGISTER( plClientRefMsg );
|
||||
GETINTERFACE_ANY( plClientRefMsg, plRefMsg );
|
||||
|
||||
Int8 fType;
|
||||
Int8 fWhich;
|
||||
int8_t fType;
|
||||
int8_t fWhich;
|
||||
|
||||
// IO - not really applicable to ref msgs, but anyway
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
|
||||
hsBitVector fCmd;
|
||||
plControlConfig* fInterface;
|
||||
UInt32 fControlCode;
|
||||
uint32_t fControlCode;
|
||||
int fIndex;
|
||||
|
||||
hsBool Cmd(int n) { return fCmd.IsBitSet(n); }
|
||||
|
@ -54,17 +54,17 @@ public:
|
||||
kAddingSpan,
|
||||
kRemovingSpan
|
||||
};
|
||||
UInt8 fType;
|
||||
uint8_t fType;
|
||||
|
||||
enum {
|
||||
kLeaveEmptyDrawable = 0x1
|
||||
};
|
||||
UInt8 fFlags;
|
||||
uint8_t fFlags;
|
||||
|
||||
Int32 fIndex;
|
||||
int32_t fIndex;
|
||||
|
||||
plDISpansMsg() : plMessage(), fType(0), fFlags(0), fIndex(-1) {}
|
||||
plDISpansMsg(const plKey &r, UInt8 type, int index, int flags) : plMessage(nil, r, nil), fType(type), fIndex(index), fFlags(flags) {}
|
||||
plDISpansMsg(const plKey &r, uint8_t type, int index, int flags) : plMessage(nil, r, nil), fType(type), fIndex(index), fFlags(flags) {}
|
||||
|
||||
CLASSNAME_REGISTER( plDISpansMsg );
|
||||
GETINTERFACE_ANY( plDISpansMsg, plMessage );
|
||||
|
@ -70,9 +70,9 @@ public:
|
||||
void SetCmd(int n) { fCmd.SetBit(n); }
|
||||
void ClearCmd() { fCmd.Clear(); }
|
||||
|
||||
void AddType(UInt16 t) { fTypes.SetBit(t); }
|
||||
void RemoveType(UInt16 t) { fTypes.ClearBit(t); }
|
||||
hsBool Type(UInt16 t) const { return fTypes.IsBitSet(t); }
|
||||
void AddType(uint16_t t) { fTypes.SetBit(t); }
|
||||
void RemoveType(uint16_t t) { fTypes.ClearBit(t); }
|
||||
hsBool Type(uint16_t t) const { return fTypes.IsBitSet(t); }
|
||||
const hsBitVector& Types() const { return fTypes; }
|
||||
|
||||
plEnableMsg() { }
|
||||
|
@ -67,10 +67,10 @@ protected:
|
||||
public:
|
||||
hsScalar fEventTime; // the time for time events
|
||||
CallbackEvent fEvent; // the event
|
||||
Int16 fIndex; // the index of the object we want the event to come from
|
||||
int16_t fIndex; // the index of the object we want the event to come from
|
||||
// (where applicable, required for sounds)
|
||||
Int16 fRepeats; // -1 for infinite repeats, 0 for one call, no repeats
|
||||
Int16 fUser; // User defined data, useful for keeping track of multiple callbacks
|
||||
int16_t fRepeats; // -1 for infinite repeats, 0 for one call, no repeats
|
||||
int16_t fUser; // User defined data, useful for keeping track of multiple callbacks
|
||||
|
||||
plEventCallbackMsg() : fEventTime(0.0f), fEvent((CallbackEvent)0), fRepeats(-1), fUser(0), fIndex(0) {;}
|
||||
plEventCallbackMsg (const plKey &s,
|
||||
@ -79,7 +79,7 @@ public:
|
||||
plMessage(s, r, t),
|
||||
fEventTime(0.0f), fEvent((CallbackEvent)0), fRepeats(-1), fUser(0), fIndex(0) {;}
|
||||
|
||||
plEventCallbackMsg(const plKey &receiver, CallbackEvent e, int idx=0, hsScalar t=0, Int16 repeats=-1, UInt16 user=0) :
|
||||
plEventCallbackMsg(const plKey &receiver, CallbackEvent e, int idx=0, hsScalar t=0, int16_t repeats=-1, uint16_t user=0) :
|
||||
plMessage(nil, receiver, nil), fEvent(e), fIndex(idx), fEventTime(t), fRepeats(repeats), fUser(user) {}
|
||||
|
||||
~plEventCallbackMsg(){;}
|
||||
@ -101,7 +101,7 @@ public:
|
||||
{
|
||||
plMessage::IMsgWrite(stream, mgr);
|
||||
stream->WriteLEFloat(fEventTime);
|
||||
stream->WriteLE16((Int16)fEvent);
|
||||
stream->WriteLE16((int16_t)fEvent);
|
||||
stream->WriteLE16(fIndex);
|
||||
stream->WriteLE16(fRepeats);
|
||||
stream->WriteLE16(fUser);
|
||||
|
@ -65,14 +65,14 @@ public:
|
||||
};
|
||||
|
||||
plIntRefMsg() : fType(-1), fWhich(-1), fIdx(-1) {}
|
||||
plIntRefMsg(const plKey &r, UInt8 flags, Int32 which, Int8 type, Int8 idx=-1) : plRefMsg(r, flags), fWhich((Int16)which), fType(type), fIdx(idx) {}
|
||||
plIntRefMsg(const plKey &r, uint8_t flags, int32_t which, int8_t type, int8_t idx=-1) : plRefMsg(r, flags), fWhich((int16_t)which), fType(type), fIdx(idx) {}
|
||||
|
||||
CLASSNAME_REGISTER( plIntRefMsg );
|
||||
GETINTERFACE_ANY( plIntRefMsg, plRefMsg );
|
||||
|
||||
Int8 fType;
|
||||
Int8 fIdx;
|
||||
Int16 fWhich;
|
||||
int8_t fType;
|
||||
int8_t fIdx;
|
||||
int16_t fWhich;
|
||||
|
||||
// IO - not really applicable to ref msgs, but anyway
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
|
@ -84,7 +84,7 @@ plMessage::~plMessage()
|
||||
}
|
||||
|
||||
plMessage& plMessage::SetNumReceivers(int n) { fReceivers.SetCount(n); return *this; }
|
||||
UInt32 plMessage::GetNumReceivers() const { return fReceivers.GetCount(); }
|
||||
uint32_t plMessage::GetNumReceivers() const { return fReceivers.GetCount(); }
|
||||
const plKey& plMessage::GetReceiver(int i) const { return fReceivers[i]; }
|
||||
plMessage& plMessage::RemoveReceiver(int i) { fReceivers.Remove(i); return *this; }
|
||||
|
||||
@ -200,24 +200,24 @@ void plMessage::IMsgWriteVersion(hsStream* s, hsResMgr* mgr)
|
||||
s->WriteLE32(fBCastFlags);
|
||||
}
|
||||
|
||||
void plMessage::AddNetReceiver( UInt32 plrID )
|
||||
void plMessage::AddNetReceiver( uint32_t plrID )
|
||||
{
|
||||
if ( !fNetRcvrPlayerIDs )
|
||||
fNetRcvrPlayerIDs = TRACKED_NEW std::vector<UInt32>;
|
||||
fNetRcvrPlayerIDs = TRACKED_NEW std::vector<uint32_t>;
|
||||
fNetRcvrPlayerIDs->push_back( plrID );
|
||||
}
|
||||
|
||||
void plMessage::AddNetReceivers( const std::vector<UInt32> & plrIDs )
|
||||
void plMessage::AddNetReceivers( const std::vector<uint32_t> & plrIDs )
|
||||
{
|
||||
if ( !fNetRcvrPlayerIDs )
|
||||
fNetRcvrPlayerIDs = TRACKED_NEW std::vector<UInt32>;
|
||||
fNetRcvrPlayerIDs = TRACKED_NEW std::vector<uint32_t>;
|
||||
std::copy( plrIDs.begin(), plrIDs.end(), std::back_inserter( *fNetRcvrPlayerIDs ) );
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
// STATIC
|
||||
int plMsgStdStringHelper::Poke(const std::string & stringref, hsStream* stream, const UInt32 peekOptions)
|
||||
int plMsgStdStringHelper::Poke(const std::string & stringref, hsStream* stream, const uint32_t peekOptions)
|
||||
{
|
||||
plMessage::plStrLen strlen;
|
||||
hsAssert( stringref.length()<0xFFFF, "buf too big for plMsgStdStringHelper" );
|
||||
@ -228,16 +228,16 @@ int plMsgStdStringHelper::Poke(const std::string & stringref, hsStream* stream,
|
||||
return stream->GetPosition();
|
||||
}
|
||||
|
||||
int plMsgStdStringHelper::PokeBig(const std::string & stringref, hsStream* stream, const UInt32 peekOptions)
|
||||
int plMsgStdStringHelper::PokeBig(const std::string & stringref, hsStream* stream, const uint32_t peekOptions)
|
||||
{
|
||||
UInt32 strlen = stringref.length();
|
||||
uint32_t strlen = stringref.length();
|
||||
stream->WriteLE(strlen);
|
||||
if (strlen)
|
||||
stream->Write(strlen,stringref.data());
|
||||
return stream->GetPosition();
|
||||
}
|
||||
|
||||
int plMsgStdStringHelper::Poke(const char * buf, UInt32 bufsz, hsStream* stream, const UInt32 peekOptions)
|
||||
int plMsgStdStringHelper::Poke(const char * buf, uint32_t bufsz, hsStream* stream, const uint32_t peekOptions)
|
||||
{
|
||||
plMessage::plStrLen strlen;
|
||||
hsAssert( bufsz<0xFFFF, "buf too big for plMsgStdStringHelper" );
|
||||
@ -248,7 +248,7 @@ int plMsgStdStringHelper::Poke(const char * buf, UInt32 bufsz, hsStream* stream,
|
||||
return stream->GetPosition();
|
||||
}
|
||||
|
||||
int plMsgStdStringHelper::PokeBig(const char * buf, UInt32 bufsz, hsStream* stream, const UInt32 peekOptions)
|
||||
int plMsgStdStringHelper::PokeBig(const char * buf, uint32_t bufsz, hsStream* stream, const uint32_t peekOptions)
|
||||
{
|
||||
stream->WriteLE(bufsz);
|
||||
if (bufsz)
|
||||
@ -257,7 +257,7 @@ int plMsgStdStringHelper::PokeBig(const char * buf, UInt32 bufsz, hsStream* stre
|
||||
}
|
||||
|
||||
// STATIC
|
||||
int plMsgStdStringHelper::Peek(std::string & stringref, hsStream* stream, const UInt32 peekOptions)
|
||||
int plMsgStdStringHelper::Peek(std::string & stringref, hsStream* stream, const uint32_t peekOptions)
|
||||
{
|
||||
plMessage::plStrLen strlen;
|
||||
stream->LogSubStreamStart("push this");
|
||||
@ -279,9 +279,9 @@ int plMsgStdStringHelper::Peek(std::string & stringref, hsStream* stream, const
|
||||
return stream->GetPosition();
|
||||
}
|
||||
|
||||
int plMsgStdStringHelper::PeekBig(std::string & stringref, hsStream* stream, const UInt32 peekOptions)
|
||||
int plMsgStdStringHelper::PeekBig(std::string & stringref, hsStream* stream, const uint32_t peekOptions)
|
||||
{
|
||||
UInt32 bufsz;
|
||||
uint32_t bufsz;
|
||||
stream->LogSubStreamStart("push this");
|
||||
stream->LogReadLE(&bufsz,"Bufsz");
|
||||
stringref.erase();
|
||||
@ -304,7 +304,7 @@ int plMsgStdStringHelper::PeekBig(std::string & stringref, hsStream* stream, co
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
// STATIC
|
||||
int plMsgXtlStringHelper::Poke(const xtl::istring & stringref, hsStream* stream, const UInt32 peekOptions)
|
||||
int plMsgXtlStringHelper::Poke(const xtl::istring & stringref, hsStream* stream, const uint32_t peekOptions)
|
||||
{
|
||||
plMessage::plStrLen strlen;
|
||||
strlen = stringref.length();
|
||||
@ -315,7 +315,7 @@ int plMsgXtlStringHelper::Poke(const xtl::istring & stringref, hsStream* stream,
|
||||
}
|
||||
|
||||
// STATIC
|
||||
int plMsgXtlStringHelper::Peek(xtl::istring & stringref, hsStream* stream, const UInt32 peekOptions)
|
||||
int plMsgXtlStringHelper::Peek(xtl::istring & stringref, hsStream* stream, const uint32_t peekOptions)
|
||||
{
|
||||
plMessage::plStrLen strlen;
|
||||
stream->LogSubStreamStart("push me");
|
||||
@ -337,7 +337,7 @@ int plMsgXtlStringHelper::Peek(xtl::istring & stringref, hsStream* stream, const
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
// STATIC
|
||||
int plMsgCStringHelper::Poke(const char * str, hsStream* stream, const UInt32 peekOptions)
|
||||
int plMsgCStringHelper::Poke(const char * str, hsStream* stream, const uint32_t peekOptions)
|
||||
{
|
||||
plMessage::plStrLen strlen;
|
||||
strlen = (str)?hsStrlen(str):0;
|
||||
@ -348,7 +348,7 @@ int plMsgCStringHelper::Poke(const char * str, hsStream* stream, const UInt32 pe
|
||||
}
|
||||
|
||||
// STATIC
|
||||
int plMsgCStringHelper::Peek(char *& str, hsStream* stream, const UInt32 peekOptions)
|
||||
int plMsgCStringHelper::Peek(char *& str, hsStream* stream, const uint32_t peekOptions)
|
||||
{
|
||||
plMessage::plStrLen strlen;
|
||||
stream->LogSubStreamStart("push me");
|
||||
@ -375,14 +375,14 @@ int plMsgCStringHelper::Peek(char *& str, hsStream* stream, const UInt32 peekOpt
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
// STATIC
|
||||
int plMsgCArrayHelper::Poke(const void * buf, UInt32 bufsz, hsStream* stream, const UInt32 peekOptions)
|
||||
int plMsgCArrayHelper::Poke(const void * buf, uint32_t bufsz, hsStream* stream, const uint32_t peekOptions)
|
||||
{
|
||||
stream->Write(bufsz,buf);
|
||||
return stream->GetPosition();
|
||||
}
|
||||
|
||||
// STATIC
|
||||
int plMsgCArrayHelper::Peek(void * buf, UInt32 bufsz, hsStream* stream, const UInt32 peekOptions)
|
||||
int plMsgCArrayHelper::Peek(void * buf, uint32_t bufsz, hsStream* stream, const uint32_t peekOptions)
|
||||
{
|
||||
stream->LogSubStreamStart("push me");
|
||||
stream->LogRead(bufsz,buf,"CArray");
|
||||
|
@ -56,7 +56,7 @@ class hsStream;
|
||||
class plMessage : public plCreatable
|
||||
{
|
||||
public:
|
||||
typedef UInt16 plStrLen;
|
||||
typedef uint16_t plStrLen;
|
||||
|
||||
enum plBCastFlags {
|
||||
kBCastNone = 0x0,
|
||||
@ -93,8 +93,8 @@ protected:
|
||||
hsTArray<plKey> fReceivers;
|
||||
double fTimeStamp;
|
||||
|
||||
UInt32 fBCastFlags;
|
||||
std::vector<UInt32>* fNetRcvrPlayerIDs;
|
||||
uint32_t fBCastFlags;
|
||||
std::vector<uint32_t>* fNetRcvrPlayerIDs;
|
||||
|
||||
void IMsgRead(hsStream* stream, hsResMgr* mgr); // default read implementation
|
||||
void IMsgWrite(hsStream* stream, hsResMgr* mgr); // default write implementation
|
||||
@ -123,7 +123,7 @@ public:
|
||||
plMessage& SetSender(const plKey &s) { fSender = s; return *this; }
|
||||
|
||||
plMessage& SetNumReceivers(int n);
|
||||
UInt32 GetNumReceivers() const ;
|
||||
uint32_t GetNumReceivers() const ;
|
||||
const plKey& GetReceiver(int i) const;
|
||||
plMessage& RemoveReceiver(int i);
|
||||
|
||||
@ -137,15 +137,15 @@ public:
|
||||
const double GetTimeStamp() const { return fTimeStamp; }
|
||||
plMessage& SetTimeStamp(double t) { fTimeStamp = t; return *this; }
|
||||
|
||||
hsBool HasBCastFlag(UInt32 f) const { return 0 != (fBCastFlags & f); }
|
||||
plMessage& SetBCastFlag(UInt32 f, hsBool on=true) { if( on )fBCastFlags |= f; else fBCastFlags &= ~f; return *this; }
|
||||
hsBool HasBCastFlag(uint32_t f) const { return 0 != (fBCastFlags & f); }
|
||||
plMessage& SetBCastFlag(uint32_t f, hsBool on=true) { if( on )fBCastFlags |= f; else fBCastFlags &= ~f; return *this; }
|
||||
|
||||
void SetAllBCastFlags(UInt32 f) { fBCastFlags=f; }
|
||||
UInt32 GetAllBCastFlags() const { return fBCastFlags; }
|
||||
void SetAllBCastFlags(uint32_t f) { fBCastFlags=f; }
|
||||
uint32_t GetAllBCastFlags() const { return fBCastFlags; }
|
||||
|
||||
void AddNetReceiver( UInt32 plrID );
|
||||
void AddNetReceivers( const std::vector<UInt32> & plrIDs );
|
||||
std::vector<UInt32>* GetNetReceivers() const { return fNetRcvrPlayerIDs; }
|
||||
void AddNetReceiver( uint32_t plrID );
|
||||
void AddNetReceivers( const std::vector<uint32_t> & plrIDs );
|
||||
std::vector<uint32_t>* GetNetReceivers() const { return fNetRcvrPlayerIDs; }
|
||||
|
||||
// just before dispatching this message, drop into debugger
|
||||
void SetBreakBeforeDispatch (bool on) { dispatchBreak = on; }
|
||||
@ -167,12 +167,12 @@ public:
|
||||
|
||||
struct plMsgStdStringHelper
|
||||
{
|
||||
static int Poke(const std::string & stringref, hsStream* stream, const UInt32 peekOptions=0);
|
||||
static int PokeBig(const std::string & stringref, hsStream* stream, const UInt32 peekOptions=0);
|
||||
static int Poke(const char * buf, UInt32 bufsz, hsStream* stream, const UInt32 peekOptions=0);
|
||||
static int PokeBig(const char * buf, UInt32 bufsz, hsStream* stream, const UInt32 peekOptions=0);
|
||||
static int Peek(std::string & stringref, hsStream* stream, const UInt32 peekOptions=0);
|
||||
static int PeekBig(std::string & stringref, hsStream* stream, const UInt32 peekOptions=0);
|
||||
static int Poke(const std::string & stringref, hsStream* stream, const uint32_t peekOptions=0);
|
||||
static int PokeBig(const std::string & stringref, hsStream* stream, const uint32_t peekOptions=0);
|
||||
static int Poke(const char * buf, uint32_t bufsz, hsStream* stream, const uint32_t peekOptions=0);
|
||||
static int PokeBig(const char * buf, uint32_t bufsz, hsStream* stream, const uint32_t peekOptions=0);
|
||||
static int Peek(std::string & stringref, hsStream* stream, const uint32_t peekOptions=0);
|
||||
static int PeekBig(std::string & stringref, hsStream* stream, const uint32_t peekOptions=0);
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
@ -180,8 +180,8 @@ struct plMsgStdStringHelper
|
||||
|
||||
struct plMsgXtlStringHelper
|
||||
{
|
||||
static int Poke(const xtl::istring & stringref, hsStream* stream, const UInt32 peekOptions=0);
|
||||
static int Peek(xtl::istring & stringref, hsStream* stream, const UInt32 peekOptions=0);
|
||||
static int Poke(const xtl::istring & stringref, hsStream* stream, const uint32_t peekOptions=0);
|
||||
static int Peek(xtl::istring & stringref, hsStream* stream, const uint32_t peekOptions=0);
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
@ -189,20 +189,20 @@ struct plMsgXtlStringHelper
|
||||
|
||||
struct plMsgCStringHelper
|
||||
{
|
||||
static int Poke(const char * str, hsStream* stream, const UInt32 peekOptions=0);
|
||||
static int Poke(const char * str, hsStream* stream, const uint32_t peekOptions=0);
|
||||
// deletes str and reallocates. you must delete [] str;
|
||||
static int Peek(char *& str, hsStream* stream, const UInt32 peekOptions=0);
|
||||
static int Peek(char *& str, hsStream* stream, const uint32_t peekOptions=0);
|
||||
};
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
// reads/writes your type [] field
|
||||
// don't use with byte ordered types like Int16,32.
|
||||
// fine for Int8, char, and IEEE formatted types like float, double.
|
||||
// don't use with uint8_t ordered types like int16_t,32.
|
||||
// fine for int8_t, char, and IEEE formatted types like float, double.
|
||||
|
||||
struct plMsgCArrayHelper
|
||||
{
|
||||
static int Poke(const void * buf, UInt32 bufsz, hsStream* stream, const UInt32 peekOptions=0);
|
||||
static int Peek(void * buf, UInt32 bufsz, hsStream* stream, const UInt32 peekOptions=0);
|
||||
static int Poke(const void * buf, uint32_t bufsz, hsStream* stream, const uint32_t peekOptions=0);
|
||||
static int Peek(void * buf, uint32_t bufsz, hsStream* stream, const uint32_t peekOptions=0);
|
||||
};
|
||||
|
||||
|
||||
|
@ -60,7 +60,7 @@ public:
|
||||
};
|
||||
|
||||
plNodeRefMsg() {}
|
||||
plNodeRefMsg(const plKey &r, UInt8 flags, Int8 which, Int8 type) : plGenRefMsg(r, flags, which, type) {}
|
||||
plNodeRefMsg(const plKey &r, uint8_t flags, int8_t which, int8_t type) : plGenRefMsg(r, flags, which, type) {}
|
||||
|
||||
CLASSNAME_REGISTER( plNodeRefMsg );
|
||||
GETINTERFACE_ANY( plNodeRefMsg, plGenRefMsg );
|
||||
|
@ -260,7 +260,7 @@ void plNotifyMsg::AddCollisionEvent( hsBool enter, const plKey &other, const plK
|
||||
// PARAMETERS : event - the event type, as enumerated in plEventCallbackMsg.h
|
||||
//
|
||||
//
|
||||
void plNotifyMsg::AddCallbackEvent( Int32 event )
|
||||
void plNotifyMsg::AddCallbackEvent( int32_t event )
|
||||
{
|
||||
// remove records that are like the one being added
|
||||
int num_recs = fEvents.GetCount();
|
||||
@ -295,7 +295,7 @@ void plNotifyMsg::AddCallbackEvent( Int32 event )
|
||||
// PARAMETERS : state - the state for the responder to switch to before triggering
|
||||
//
|
||||
//
|
||||
void plNotifyMsg::AddResponderStateEvent( Int32 state )
|
||||
void plNotifyMsg::AddResponderStateEvent( int32_t state )
|
||||
{
|
||||
// remove records that are like the one being added
|
||||
int num_recs = fEvents.GetCount();
|
||||
@ -331,7 +331,7 @@ void plNotifyMsg::AddResponderStateEvent( Int32 state )
|
||||
// : event - what was the event that happened
|
||||
//
|
||||
//
|
||||
void plNotifyMsg::AddMultiStageEvent( Int32 stage, Int32 event, const plKey& avatar )
|
||||
void plNotifyMsg::AddMultiStageEvent( int32_t stage, int32_t event, const plKey& avatar )
|
||||
{
|
||||
// we can have multi events of this type
|
||||
// create the mutlistage event record
|
||||
@ -342,7 +342,7 @@ void plNotifyMsg::AddMultiStageEvent( Int32 stage, Int32 event, const plKey& ava
|
||||
fEvents.Append(pED); // then add it to the list of event records
|
||||
}
|
||||
|
||||
void plNotifyMsg::AddCoopEvent(UInt32 id, UInt16 serial)
|
||||
void plNotifyMsg::AddCoopEvent(uint32_t id, uint16_t serial)
|
||||
{
|
||||
proCoopEventData *pED = TRACKED_NEW proCoopEventData;
|
||||
pED->fID = id;
|
||||
@ -546,7 +546,7 @@ void plNotifyMsg::AddFacingEvent( const plKey &other, const plKey &self, hsScala
|
||||
// NOTE: To test for duplicate record, it only checks for records of the same type
|
||||
// : Eventually, it might be wise to check if the same 'self' key also?
|
||||
//
|
||||
void plNotifyMsg::AddControlKeyEvent( Int32 key, hsBool down )
|
||||
void plNotifyMsg::AddControlKeyEvent( int32_t key, hsBool down )
|
||||
{
|
||||
// remove records that are like the one being added
|
||||
int num_recs = fEvents.GetCount();
|
||||
@ -713,7 +713,7 @@ void plNotifyMsg::AddOfferBookEvent(const plKey& offerer, int targetAge, int off
|
||||
// NOTE: To test for duplicate record, it only checks for records of the same type
|
||||
// : Eventually, it might be wise to check if the same 'self' key also?
|
||||
//
|
||||
void plNotifyMsg::AddBookEvent( UInt32 event, UInt32 linkID /*=0*/)
|
||||
void plNotifyMsg::AddBookEvent( uint32_t event, uint32_t linkID /*=0*/)
|
||||
{
|
||||
// remove records that are like the one being added
|
||||
int num_recs = fEvents.GetCount();
|
||||
@ -790,7 +790,7 @@ void plNotifyMsg::AddHitClimbingBlockerEvent(const plKey &blocker)
|
||||
//
|
||||
// PURPOSE : Find the first record in the event records that is of type eventtype
|
||||
//
|
||||
proEventData* plNotifyMsg::FindEventRecord( Int32 eventtype )
|
||||
proEventData* plNotifyMsg::FindEventRecord( int32_t eventtype )
|
||||
{
|
||||
// make sure that its a legal event type
|
||||
if ( eventtype >= 0 && eventtype < proEventData::kNone )
|
||||
@ -844,7 +844,7 @@ void plNotifyMsg::Read(hsStream* stream, hsResMgr* mgr)
|
||||
stream->ReadLE(&fState);
|
||||
fID = stream->ReadLE32();
|
||||
// read in the variable part of the message
|
||||
Int32 numberEDs = stream->ReadLE32();
|
||||
int32_t numberEDs = stream->ReadLE32();
|
||||
fEvents.SetCountAndZero(numberEDs);
|
||||
if ( numberEDs > 0 )
|
||||
{
|
||||
@ -873,7 +873,7 @@ void plNotifyMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
stream->WriteLE(fState);
|
||||
stream->WriteLE32(fID);
|
||||
// then write the variable data
|
||||
Int32 numberEDs = fEvents.Count();
|
||||
int32_t numberEDs = fEvents.Count();
|
||||
stream->WriteLE32(numberEDs);
|
||||
if ( numberEDs > 0 )
|
||||
{
|
||||
@ -914,7 +914,7 @@ void plNotifyMsg::ReadVersion(hsStream* s, hsResMgr* mgr)
|
||||
if (contentFlags.IsBitSet(kNotifyMsgEDs))
|
||||
{
|
||||
// read in the variable part of the message
|
||||
Int32 numberEDs = s->ReadLE32();
|
||||
int32_t numberEDs = s->ReadLE32();
|
||||
fEvents.SetCountAndZero(numberEDs);
|
||||
if (numberEDs > 0)
|
||||
{
|
||||
@ -955,7 +955,7 @@ void plNotifyMsg::WriteVersion(hsStream* s, hsResMgr* mgr)
|
||||
s->WriteLE32(fID);
|
||||
|
||||
// kNotifyMsgEDs
|
||||
Int32 numberEDs = fEvents.Count();
|
||||
int32_t numberEDs = fEvents.Count();
|
||||
s->WriteLE32(numberEDs);
|
||||
if (numberEDs > 0)
|
||||
{
|
||||
@ -998,7 +998,7 @@ plKey plNotifyMsg::GetAvatarKey()
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
proEventData* proEventData::ICreateEventDataType(Int32 type)
|
||||
proEventData* proEventData::ICreateEventDataType(int32_t type)
|
||||
{
|
||||
switch (type)
|
||||
{
|
||||
@ -1028,7 +1028,7 @@ proEventData* proEventData::ICreateEventDataType(Int32 type)
|
||||
|
||||
proEventData* proEventData::Read( hsStream *stream, hsResMgr *mgr )
|
||||
{
|
||||
Int32 evtType = stream->ReadLE32();
|
||||
int32_t evtType = stream->ReadLE32();
|
||||
|
||||
proEventData* data = ICreateEventDataType(evtType);
|
||||
|
||||
@ -1056,7 +1056,7 @@ proEventData* proEventData::ReadVersion(hsStream* s, hsResMgr* mgr)
|
||||
|
||||
if (contentFlags.IsBitSet(kProEventDataType))
|
||||
{
|
||||
Int32 evtType = s->ReadLE32();
|
||||
int32_t evtType = s->ReadLE32();
|
||||
|
||||
proEventData* data = ICreateEventDataType(evtType);
|
||||
|
||||
|
@ -80,7 +80,7 @@ public:
|
||||
kNone
|
||||
};
|
||||
|
||||
proEventData( Int32 evtType = kNone ) : fEventType( evtType )
|
||||
proEventData( int32_t evtType = kNone ) : fEventType( evtType )
|
||||
{
|
||||
}
|
||||
virtual ~proEventData() {}
|
||||
@ -102,9 +102,9 @@ public:
|
||||
kNothing
|
||||
};
|
||||
|
||||
Int32 fEventType; // what type of event (evenType enum)
|
||||
int32_t fEventType; // what type of event (evenType enum)
|
||||
|
||||
static proEventData* ICreateEventDataType(Int32 type);
|
||||
static proEventData* ICreateEventDataType(int32_t type);
|
||||
|
||||
static proEventData* Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
@ -165,7 +165,7 @@ protected:
|
||||
};
|
||||
|
||||
proEventType(ControlKey)
|
||||
Int32 fControlKey; // what control key was hit
|
||||
int32_t fControlKey; // what control key was hit
|
||||
hsBool fDown; // was the key going down (false if going up)
|
||||
|
||||
protected:
|
||||
@ -178,7 +178,7 @@ protected:
|
||||
|
||||
proEventType(Variable)
|
||||
char* fName; // name of variable
|
||||
Int32 fDataType; // type of data
|
||||
int32_t fDataType; // type of data
|
||||
|
||||
// Can't be a union, sadly, but it isn't that much of a waste of space...
|
||||
hsScalar fNumber; // if its a number
|
||||
@ -235,7 +235,7 @@ protected:
|
||||
};
|
||||
|
||||
proEventType(Callback)
|
||||
Int32 fEventType; // enumerated in plEventCallbackMsg.h
|
||||
int32_t fEventType; // enumerated in plEventCallbackMsg.h
|
||||
|
||||
protected:
|
||||
virtual void IRead(hsStream* stream, hsResMgr* mgr);
|
||||
@ -246,7 +246,7 @@ protected:
|
||||
};
|
||||
|
||||
proEventType(ResponderState)
|
||||
Int32 fState; // what state the responder should be switched to before triggering
|
||||
int32_t fState; // what state the responder should be switched to before triggering
|
||||
|
||||
protected:
|
||||
virtual void IRead(hsStream* stream, hsResMgr* mgr);
|
||||
@ -257,8 +257,8 @@ protected:
|
||||
};
|
||||
|
||||
proEventType(MultiStage)
|
||||
Int32 fStage;
|
||||
Int32 fEvent;
|
||||
int32_t fStage;
|
||||
int32_t fEvent;
|
||||
plKey fAvatar; // who was running the stage
|
||||
|
||||
protected:
|
||||
@ -270,8 +270,8 @@ protected:
|
||||
};
|
||||
|
||||
proEventType(Coop)
|
||||
UInt32 fID; // player ID of the initiator
|
||||
UInt16 fSerial; // serial number for the initiator
|
||||
uint32_t fID; // player ID of the initiator
|
||||
uint16_t fSerial; // serial number for the initiator
|
||||
protected:
|
||||
virtual void IRead(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void IWrite(hsStream* stream, hsResMgr* mgr);
|
||||
@ -300,8 +300,8 @@ protected:
|
||||
};
|
||||
|
||||
proEventType(Book)
|
||||
UInt32 fEvent; // The type of event. See pfJournalBook.h for enumsu
|
||||
UInt32 fLinkID; // The link ID of the image clicked, if an image link event, otherwise unused
|
||||
uint32_t fEvent; // The type of event. See pfJournalBook.h for enumsu
|
||||
uint32_t fLinkID; // The link ID of the image clicked, if an image link event, otherwise unused
|
||||
protected:
|
||||
virtual void IRead(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void IWrite(hsStream* stream, hsResMgr* mgr);
|
||||
@ -354,9 +354,9 @@ public:
|
||||
kResponderFF, // Fast forward
|
||||
kResponderChangeState, // Change state without triggering
|
||||
};
|
||||
Int32 fType; // what type of notification
|
||||
int32_t fType; // what type of notification
|
||||
hsScalar fState; // state of the notifier 0.0=false, 1.0=true
|
||||
Int32 fID; // special ID mostly for responder State transitions
|
||||
int32_t fID; // special ID mostly for responder State transitions
|
||||
hsTArray<proEventData*> fEvents;// list of events with data
|
||||
|
||||
void SetType(notificationType type) { fType = type; }
|
||||
@ -366,24 +366,24 @@ public:
|
||||
void AddEvent( proEventData* ed);
|
||||
void AddCollisionEvent( hsBool enter, const plKey &other, const plKey &self, hsBool onlyOneCollision=true );
|
||||
void AddPickEvent( const plKey &other, const plKey& self, hsBool enabled, hsPoint3 hitPoint );
|
||||
void AddControlKeyEvent( Int32 key, hsBool down );
|
||||
void AddControlKeyEvent( int32_t key, hsBool down );
|
||||
void AddVariableEvent( const char* name, hsScalar number );
|
||||
void AddVariableEvent( const char *name, const plKey &key);
|
||||
void AddFacingEvent( const plKey &other, const plKey &self, hsScalar dot, hsBool enabled);
|
||||
void AddContainerEvent( const plKey &container, const plKey &contained, hsBool entering);
|
||||
void AddActivateEvent( hsBool activate );
|
||||
void AddCallbackEvent( Int32 event );
|
||||
void AddResponderStateEvent( Int32 state );
|
||||
void AddMultiStageEvent( Int32 stage, Int32 event, const plKey& avatar );
|
||||
void AddCoopEvent(UInt32 id, UInt16 serial);
|
||||
void AddCallbackEvent( int32_t event );
|
||||
void AddResponderStateEvent( int32_t state );
|
||||
void AddMultiStageEvent( int32_t stage, int32_t event, const plKey& avatar );
|
||||
void AddCoopEvent(uint32_t id, uint16_t serial);
|
||||
void AddSpawnedEvent (const plKey &spawner, const plKey &spawned);
|
||||
void AddClickDragEvent(const plKey& dragger, const plKey& dragee, hsScalar animPos);
|
||||
void AddOfferBookEvent(const plKey& offerer, int targetAge, int offeree);
|
||||
void AddBookEvent( UInt32 event, UInt32 linkID = 0 );
|
||||
void AddBookEvent( uint32_t event, uint32_t linkID = 0 );
|
||||
void AddHitClimbingBlockerEvent(const plKey &blocker);
|
||||
proEventData* FindEventRecord( Int32 eventtype );
|
||||
Int32 GetEventCount() { return fEvents.Count(); }
|
||||
proEventData* GetEventRecord(Int32 i) { return fEvents[i]; }
|
||||
proEventData* FindEventRecord( int32_t eventtype );
|
||||
int32_t GetEventCount() { return fEvents.Count(); }
|
||||
proEventData* GetEventRecord(int32_t i) { return fEvents[i]; }
|
||||
void ClearEvents();
|
||||
|
||||
// Searches the event records for an event triggered by an avatar, and returns that key
|
||||
|
@ -60,15 +60,15 @@ public:
|
||||
|
||||
plObjRefMsg(): fType(-1), fWhich(-1) {};
|
||||
|
||||
plObjRefMsg(const plKey &r, UInt8 refMsgFlags, Int8 which , Int8 type)
|
||||
plObjRefMsg(const plKey &r, uint8_t refMsgFlags, int8_t which , int8_t type)
|
||||
: plRefMsg(r, refMsgFlags), fType(type), fWhich(which) {}
|
||||
|
||||
|
||||
CLASSNAME_REGISTER( plObjRefMsg );
|
||||
GETINTERFACE_ANY( plObjRefMsg, plRefMsg );
|
||||
|
||||
Int8 fType;
|
||||
Int8 fWhich;
|
||||
int8_t fType;
|
||||
int8_t fWhich;
|
||||
|
||||
// IO - not really applicable to ref msgs, but anyway
|
||||
void Read(hsStream* stream, hsResMgr* mgr)
|
||||
|
@ -51,14 +51,14 @@ plProxyDrawMsg::plProxyDrawMsg()
|
||||
SetBCastFlag(plMessage::kBCastByExactType);
|
||||
}
|
||||
|
||||
plProxyDrawMsg::plProxyDrawMsg(UInt16 flags)
|
||||
plProxyDrawMsg::plProxyDrawMsg(uint16_t flags)
|
||||
: plMessage(nil, nil, nil),
|
||||
fProxyFlags(flags)
|
||||
{
|
||||
SetBCastFlag(plMessage::kBCastByExactType);
|
||||
}
|
||||
|
||||
plProxyDrawMsg::plProxyDrawMsg(plKey &rcv, UInt16 flags)
|
||||
plProxyDrawMsg::plProxyDrawMsg(plKey &rcv, uint16_t flags)
|
||||
: plMessage(rcv, rcv, nil),
|
||||
fProxyFlags(flags)
|
||||
{
|
||||
|
@ -56,12 +56,12 @@ class hsResMgr;
|
||||
class plProxyDrawMsg : public plMessage
|
||||
{
|
||||
protected:
|
||||
UInt16 fProxyFlags;
|
||||
uint16_t fProxyFlags;
|
||||
|
||||
public:
|
||||
plProxyDrawMsg();
|
||||
plProxyDrawMsg(UInt16 flags); // for broadcast
|
||||
plProxyDrawMsg(plKey &rcv, UInt16 flags); // send yourself an ack
|
||||
plProxyDrawMsg(uint16_t flags); // for broadcast
|
||||
plProxyDrawMsg(plKey &rcv, uint16_t flags); // send yourself an ack
|
||||
~plProxyDrawMsg();
|
||||
|
||||
CLASSNAME_REGISTER( plProxyDrawMsg );
|
||||
@ -88,8 +88,8 @@ public:
|
||||
| kCamera
|
||||
};
|
||||
|
||||
UInt16 GetProxyFlags() const { return fProxyFlags; }
|
||||
void SetProxyFlags(UInt16 f) { fProxyFlags = f; }
|
||||
uint16_t GetProxyFlags() const { return fProxyFlags; }
|
||||
void SetProxyFlags(uint16_t f) { fProxyFlags = f; }
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
@ -53,7 +53,7 @@ plRefMsg::plRefMsg()
|
||||
{
|
||||
}
|
||||
|
||||
plRefMsg::plRefMsg(const plKey &r, UInt8 c)
|
||||
plRefMsg::plRefMsg(const plKey &r, uint8_t c)
|
||||
: plMessage(nil, r, nil), fRef(nil), fOldRef(nil), fContext(c)
|
||||
{
|
||||
if( !fContext )
|
||||
|
@ -63,10 +63,10 @@ protected:
|
||||
hsKeyedObject* fRef;
|
||||
hsKeyedObject* fOldRef; // on replace
|
||||
|
||||
UInt8 fContext;
|
||||
uint8_t fContext;
|
||||
public:
|
||||
plRefMsg();
|
||||
plRefMsg(const plKey &r, UInt8 c);
|
||||
plRefMsg(const plKey &r, uint8_t c);
|
||||
|
||||
virtual ~plRefMsg();
|
||||
|
||||
@ -79,8 +79,8 @@ public:
|
||||
plRefMsg& SetOldRef(hsKeyedObject* oldRef);
|
||||
hsKeyedObject* GetOldRef() { return fOldRef; }
|
||||
|
||||
plRefMsg& SetContext(UInt8 c) { fContext = c; return *this; }
|
||||
UInt8 GetContext() { return fContext; }
|
||||
plRefMsg& SetContext(uint8_t c) { fContext = c; return *this; }
|
||||
uint8_t GetContext() { return fContext; }
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
@ -91,7 +91,7 @@ class plGenRefMsg : public plRefMsg
|
||||
{
|
||||
public:
|
||||
plGenRefMsg() : fType(-1), fWhich(-1) {}
|
||||
plGenRefMsg(const plKey &r, UInt8 c, Int32 which, Int8 type) : plRefMsg(r, c), fWhich(which), fType(type) {}
|
||||
plGenRefMsg(const plKey &r, uint8_t c, int32_t which, int8_t type) : plRefMsg(r, c), fWhich(which), fType(type) {}
|
||||
|
||||
CLASSNAME_REGISTER(plGenRefMsg);
|
||||
GETINTERFACE_ANY(plGenRefMsg, plRefMsg);
|
||||
@ -99,8 +99,8 @@ public:
|
||||
// User variables. You can put anything here, but the standard convention
|
||||
// is an enum telling what type of ref it is in fType, and an index in
|
||||
// fWhich, for keeping track of multiple refs of the same type.
|
||||
Int8 fType;
|
||||
Int32 fWhich;
|
||||
int8_t fType;
|
||||
int32_t fWhich;
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
@ -67,8 +67,8 @@ protected:
|
||||
Action fAction;
|
||||
plStateDataRecord* fState; // for recving state
|
||||
bool fManageStateMem; // delete fState?
|
||||
UInt32 fPlayerID;
|
||||
UInt32 fFlags;
|
||||
uint32_t fPlayerID;
|
||||
uint32_t fFlags;
|
||||
|
||||
public:
|
||||
plSDLModifierMsg(const char* sdlName=nil, Action a=kActionNone);
|
||||
@ -77,8 +77,8 @@ public:
|
||||
CLASSNAME_REGISTER( plSDLModifierMsg );
|
||||
GETINTERFACE_ANY( plSDLModifierMsg, plMessage );
|
||||
|
||||
UInt32 GetFlags() const { return fFlags; }
|
||||
void SetFlags(UInt32 f) { fFlags = f; }
|
||||
uint32_t GetFlags() const { return fFlags; }
|
||||
void SetFlags(uint32_t f) { fFlags = f; }
|
||||
|
||||
Action GetAction() const { return fAction; }
|
||||
void SetAction(Action t) { fAction=t; }
|
||||
@ -89,8 +89,8 @@ public:
|
||||
const char* GetSDLName() const { return fSDLName; }
|
||||
void SetSDLName(const char* s) { delete [] fSDLName; fSDLName=hsStrcpy(s); }
|
||||
|
||||
UInt32 GetPlayerID() const { return fPlayerID; }
|
||||
void SetPlayerID(UInt32 p) { fPlayerID=p; }
|
||||
uint32_t GetPlayerID() const { return fPlayerID; }
|
||||
void SetPlayerID(uint32_t p) { fPlayerID=p; }
|
||||
|
||||
// IO
|
||||
void Read(hsStream* stream, hsResMgr* mgr) { hsAssert(false, "local only msg"); }
|
||||
|
@ -90,5 +90,5 @@ void plSoundMsg::Write(hsStream* stream, hsResMgr* mgr)
|
||||
stream->WriteLE(fRepeats);
|
||||
stream->WriteLE(fNameStr);
|
||||
stream->WriteLE(fVolume);
|
||||
stream->WriteByte( (UInt8)fFadeType );
|
||||
stream->WriteByte( (uint8_t)fFadeType );
|
||||
}
|
||||
|
@ -103,7 +103,7 @@ public:
|
||||
int fIndex;
|
||||
int fRepeats;
|
||||
hsBool fPlaying;
|
||||
UInt32 fNameStr;
|
||||
uint32_t fNameStr;
|
||||
hsScalar fVolume; // Range: 0 - silence, 1.f - loudest
|
||||
|
||||
enum FadeType
|
||||
|
@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
class plWarpMsg : public plMessage
|
||||
{
|
||||
private:
|
||||
UInt32 fWarpFlags;
|
||||
uint32_t fWarpFlags;
|
||||
hsMatrix44 fTransform;
|
||||
public:
|
||||
enum WarpFlags
|
||||
@ -64,7 +64,7 @@ public:
|
||||
plWarpMsg(const plKey &s,
|
||||
const plKey &r,
|
||||
const double* t) { Clear(); }
|
||||
plWarpMsg(const plKey &s, const plKey &r, UInt32 flags, const hsMatrix44 &mat)
|
||||
plWarpMsg(const plKey &s, const plKey &r, uint32_t flags, const hsMatrix44 &mat)
|
||||
: fWarpFlags(flags), fTransform(mat), plMessage(s, r, nil)
|
||||
{ };
|
||||
|
||||
@ -75,8 +75,8 @@ public:
|
||||
|
||||
void Clear() { fWarpFlags=0; }
|
||||
|
||||
UInt32 GetWarpFlags() { return fWarpFlags; }
|
||||
void SetWarpFlags(UInt32 f) { fWarpFlags=f; }
|
||||
uint32_t GetWarpFlags() { return fWarpFlags; }
|
||||
void SetWarpFlags(uint32_t f) { fWarpFlags=f; }
|
||||
|
||||
void SetTransform(const hsMatrix44& mat) { fTransform=mat; }
|
||||
hsMatrix44& GetTransform() { return fTransform; }
|
||||
|
Reference in New Issue
Block a user