2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 02:27:40 -04:00

CWE Directory Reorganization

Rearrange directory structure of CWE to be loosely equivalent to
the H'uru Plasma repository.

Part 1: Movement of directories and files.
This commit is contained in:
rarified
2021-05-15 12:49:46 -06:00
parent c3f4a640a3
commit 96903e8dca
4002 changed files with 159 additions and 644 deletions

View File

@ -0,0 +1,270 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef hsGMatState_inc
#define hsGMatState_inc
#include "hsColorRGBA.h"
class hsStream;
class hsGMatState {
public:
enum hsGMatBlendFlags {
kBlendTest = 0x1, // dev
// Rest of blends are mutually exclusive
kBlendAlpha = 0x2, // dev
kBlendMult = 0x4, // dev
kBlendAdd = 0x8, // dev
kBlendAddColorTimesAlpha = 0x10, // dev
kBlendAntiAlias = 0x20,
kBlendDetail = 0x40,
kBlendNoColor = 0x80, // dev
kBlendMADD = 0x100,
kBlendDot3 = 0x200,
kBlendAddSigned = 0x400,
kBlendAddSigned2X = 0x800,
kBlendMask = kBlendAlpha
| kBlendMult
| kBlendAdd
| kBlendAddColorTimesAlpha
| kBlendDetail
| kBlendMADD
| kBlendDot3
| kBlendAddSigned
| kBlendAddSigned2X,
kBlendInvertAlpha = 0x1000, // dev
kBlendInvertColor = 0x2000, // dev
kBlendAlphaMult = 0x4000,
kBlendAlphaAdd = 0x8000,
kBlendNoVtxAlpha = 0x10000,
kBlendNoTexColor = 0x20000,
kBlendNoTexAlpha = 0x40000,
kBlendInvertVtxAlpha = 0x80000, // Invert ONLY the vertex alpha source
kBlendAlphaAlways = 0x100000, // Alpha test always passes (even for alpha=0).
kBlendInvertFinalColor = 0x200000,
kBlendInvertFinalAlpha = 0x400000,
kBlendEnvBumpNext = 0x800000,
kBlendSubtract = 0x1000000,
kBlendRevSubtract = 0x2000000,
kBlendAlphaTestHigh = 0x4000000,
kBlendAlphaPremultiplied = 0x8000000
};
enum hsGMatClampFlags {
kClampTextureU = 0x1, // dev
kClampTextureV = 0x2, // dev
kClampTexture = 0x3 // dev
};
enum hsGMatShadeFlags {
kShadeSoftShadow = 0x1, // view, dev
kShadeNoProjectors = 0x2, // projector
kShadeEnvironMap = 0x4, // dev, load
kShadeVertexShade = 0x20, // dev
kShadeNoShade = 0x40, // view,dev
kShadeBlack = kShadeNoShade,
kShadeSpecular = 0x80, // view, dev
//kShadeNoFog = 0x100, // dev
kShadeWhite = 0x200,
kShadeSpecularAlpha = 0x400,
kShadeSpecularColor = 0x800,
kShadeSpecularHighlight = 0x1000,
kShadeVertColShade = 0x2000,
kShadeInherit = 0x4000,
kShadeIgnoreVtxIllum = 0x8000,
kShadeEmissive = 0x10000, // Moved here 8.27 mcn. Only really sane to use with kMiscEndPassHere
kShadeReallyNoFog = 0x20000
};
enum hsGMatZFlags {
kZIncLayer = 0x1, // dev
kZClearZ = 0x4, // dev
kZNoZRead = 0x8, // dev
kZNoZWrite = 0x10,
kZMask = kZNoZWrite | kZClearZ | kZNoZRead,
kZLODBias = 0x20
};
enum hsGMatMiscFlags {
kMiscWireFrame = 0x1, // dev (running out of bits)
kMiscDrawMeshOutlines = 0x2, // dev, currently unimplemented
kMiscTwoSided = 0x4, // view,dev
kMiscDrawAsSplats = 0x8, // dev? bwt
kMiscAdjustPlane = 0x10,
kMiscAdjustCylinder = 0x20,
kMiscAdjustSphere = 0x40,
kMiscAdjust = kMiscAdjustPlane | kMiscAdjustCylinder| kMiscAdjustSphere,
kMiscTroubledLoner = 0x80,
kMiscBindSkip = 0x100,
kMiscBindMask = 0x200,
kMiscBindNext = 0x400,
kMiscLightMap = 0x800,
kMiscUseReflectionXform = 0x1000, // Use the calculated reflection environment
// texture transform instead of layer->GetTransform()
kMiscPerspProjection = 0x2000,
kMiscOrthoProjection = 0x4000,
kMiscProjection = kMiscPerspProjection | kMiscOrthoProjection,
kMiscRestartPassHere = 0x8000, // Tells pipeline to start a new pass beginning with this layer
// Kinda like troubledLoner, but only cuts off lower layers, not
// higher ones (kMiscBindNext sometimes does this by implication)
kMiscBumpLayer = 0x10000,
kMiscBumpDu = 0x20000,
kMiscBumpDv = 0x40000,
kMiscBumpDw = 0x80000,
kMiscBumpChans = kMiscBumpDu | kMiscBumpDv | kMiscBumpDw,
kMiscNoShadowAlpha = 0x100000,
kMiscUseRefractionXform = 0x200000, // Use a refraction-like hack.
kMiscCam2Screen = 0x400000, // Expects tex coords to be XYZ in camera space. Does a cam to screen (not NDC) projection
// and swaps Z with W, so that the texture projection can produce projected 2D screen coordinates.
kAllMiscFlags = 0xffffffff
};
enum StateIdx {
kBlend,
kClamp,
kShade,
kZ,
kMisc
};
UInt32 fBlendFlags;
UInt32 fClampFlags;
UInt32 fShadeFlags;
UInt32 fZFlags;
UInt32 fMiscFlags;
static hsBool Differs(UInt32 mine, UInt32 hers, UInt32 mask)
{
return (mine & mask) ^ (hers & mask);
}
static hsBool Differs(UInt32 mine, UInt32 hers)
{
return mine ^ hers;
}
hsBool operator!=(const hsGMatState& other)
{
return ((fBlendFlags ^ other.fBlendFlags)
| (fClampFlags ^ other.fClampFlags)
| (fShadeFlags ^ other.fShadeFlags)
| (fZFlags ^ other.fZFlags)
| (fMiscFlags ^ other.fMiscFlags));
}
UInt32 Value(int i) const
{
switch(i)
{
case kBlend:
return fBlendFlags;
case kClamp:
return fClampFlags;
case kShade:
return fShadeFlags;
case kZ:
return fZFlags;
case kMisc:
return fMiscFlags;
}
hsAssert(false, "Bad param");
return fBlendFlags;
}
UInt32& operator[](const int i)
{
switch(i)
{
case kBlend:
return fBlendFlags;
case kClamp:
return fClampFlags;
case kShade:
return fShadeFlags;
case kZ:
return fZFlags;
case kMisc:
return fMiscFlags;
}
hsAssert(false, "Bad param");
return fBlendFlags;
}
hsGMatState& operator|=(const hsGMatState& other)
{
fBlendFlags |= other.fBlendFlags;
fClampFlags |= other.fClampFlags;
fShadeFlags |= other.fShadeFlags;
fZFlags |= other.fZFlags;
fMiscFlags |= other.fMiscFlags;
return *this;
}
hsGMatState& operator+=(const hsGMatState& other)
{
return operator|=(other);
}
hsGMatState& operator-=(const hsGMatState& other)
{
fBlendFlags &= ~other.fBlendFlags;
fClampFlags &= ~other.fClampFlags;
fShadeFlags &= ~other.fShadeFlags;
fZFlags &= ~other.fZFlags;
fMiscFlags &= ~other.fMiscFlags;
return *this;
}
inline void Read(hsStream* s);
inline void Write(hsStream* s);
hsGMatState(UInt32 blend=0, UInt32 clamp=0, UInt32 shade=0, UInt32 z=0, UInt32 misc=0)
: fBlendFlags(blend),
fClampFlags(clamp),
fShadeFlags(shade),
fZFlags(z),
fMiscFlags(misc) {}
void Reset() { fBlendFlags = fClampFlags = fShadeFlags = fZFlags = fMiscFlags = 0; }
inline void Clear(const hsGMatState& state);
inline void Composite(const hsGMatState& want, const hsGMatState& on, const hsGMatState& off);
};
#endif // hsGMatState_inc

View File

@ -0,0 +1,53 @@
#ifndef hsGMatStateInline_inc
#define hsGMatStateInline_inc
#include "hsGMatState.h"
#include "hsStream.h"
void hsGMatState::Read(hsStream* s)
{
fBlendFlags = s->ReadSwap32();
fClampFlags = s->ReadSwap32();
fShadeFlags = s->ReadSwap32();
fZFlags = s->ReadSwap32();
fMiscFlags = s->ReadSwap32();
}
void hsGMatState::Write(hsStream* s)
{
s->WriteSwap32(fBlendFlags);
s->WriteSwap32(fClampFlags);
s->WriteSwap32(fShadeFlags);
s->WriteSwap32(fZFlags);
s->WriteSwap32(fMiscFlags);
}
void hsGMatState::Clear(const hsGMatState& state)
{
fBlendFlags &= ~state.fBlendFlags;
fClampFlags &= ~state.fClampFlags;
fShadeFlags &= ~state.fShadeFlags;
fZFlags &= ~state.fZFlags;
fMiscFlags &= ~state.fMiscFlags;
}
void hsGMatState::Composite(const hsGMatState& want, const hsGMatState& on, const hsGMatState& off)
{
fBlendFlags = want.fBlendFlags & ~off.fBlendFlags;
if( !(fBlendFlags & (kBlendMask & ~(kBlendAlpha|kBlendAntiAlias))) )
fBlendFlags |= on.fBlendFlags;
fClampFlags = (want.fClampFlags | on.fClampFlags) & ~off.fClampFlags;
fShadeFlags = (want.fShadeFlags | on.fShadeFlags) & ~off.fShadeFlags;
#if 0 // This restriction is only valid for glide - handle in glideDevice
if( fBlendFlags & (kBlendAntiAlias | kBlendAlpha) )
fShadeFlags &= ~(kShadeSpecularAlpha | kShadeSpecularHighlight);
#endif // This restriction is only valid for glide - handle in glideDevice
fZFlags = (want.fZFlags | on.fZFlags) & ~off.fZFlags;
fMiscFlags = (want.fMiscFlags | on.fMiscFlags) & ~off.fMiscFlags;
}
#endif // hsGMatStateInline_inc

View File

@ -0,0 +1,157 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef hsResMgr_inc
#define hsResMgr_inc
#include "hsTypes.h"
#include "hsRefCnt.h"
#include "plLoadMask.h"
#include "plRefFlags.h"
#include "../pnKeyedObject/plKey.h"
class hsStream;
class plKeyImp;
class hsKeyedObject;
class plRefMsg;
class plUoid;
class plLocation;
class plCreatable;
class plDispatchBase;
class hsResMgr : public hsRefCnt
{
public:
//---------------------------
// Load and Unload
//---------------------------
virtual void Load (const plKey& objKey)=0; // places on list to be loaded
virtual hsBool Unload(const plKey& objKey)=0; // Unregisters (deletes) an object, Return true if successful
virtual plKey CloneKey(const plKey& objKey)=0;
//---------------------------
// Finding Functions
//---------------------------
virtual plKey FindKey(const plUoid& uoid)=0;
//---------------------------
// Establish reference linkage
//---------------------------
virtual hsBool AddViaNotify(const plKey& sentKey, plRefMsg* msg, plRefFlags::Type flags)=0;
virtual hsBool AddViaNotify(plRefMsg* msg, plRefFlags::Type flags)=0; // msg->fRef->GetKey() == sentKey
virtual hsBool SendRef(const plKey& key, plRefMsg* refMsg, plRefFlags::Type flags)=0;
virtual hsBool SendRef(hsKeyedObject* ko, plRefMsg* refMsg, plRefFlags::Type flags)=0;
//---------------------------
// Reading and Writing keys
//---------------------------
// Read a Key in, and Notify me when the Object is loaded
virtual plKey ReadKeyNotifyMe(hsStream* s, plRefMsg* retMsg, plRefFlags::Type flags)=0;
// Just read the Key data in and find a match in the registry and return it.
virtual plKey ReadKey(hsStream* s)=0;
// For convenience you can write a key using the KeyedObject or the Key...same result
virtual void WriteKey(hsStream* s, hsKeyedObject* obj)=0;
virtual void WriteKey(hsStream* s, const plKey& key)=0;
//---------------------------
// Reading and Writing Objects directly
//---------------------------
virtual plCreatable* ReadCreatable(hsStream* s)=0;
virtual void WriteCreatable(hsStream* s, plCreatable* cre)=0;
virtual plCreatable* ReadCreatableVersion(hsStream* s)=0;
virtual void WriteCreatableVersion(hsStream* s, plCreatable* cre)=0;
//---------------------------
// Registry Modification Functions
//---------------------------
virtual plKey NewKey(const char* name, hsKeyedObject* object, const plLocation& loc, const plLoadMask& m = plLoadMask::kAlways)=0;
virtual plKey NewKey(plUoid& newUoid, hsKeyedObject* object)=0;
virtual plDispatchBase* Dispatch()=0;
virtual void BeginShutdown() {}
protected:
friend class hsKeyedObject;
friend class plKey;
friend class plKeyImp;
friend class plArmatureMod; // Temp hack until a findkey/clone issue is fixed. -Bob
virtual plKey ReRegister(const char *nm, const plUoid& oid)=0;
virtual hsBool ReadObject(plKeyImp* key)=0; // plKeys call this when needed
// Sets a key as used or unused in the registry. When all keys in a page of a
// particular type in an page are unused, we can free the memory associated with them.
// Only called by plKeyImp
virtual void IKeyReffed(plKeyImp* key)=0;
virtual void IKeyUnreffed(plKeyImp* key)=0;
protected: // hsgResMgr only
friend class hsgResMgr;
virtual hsBool IReset()=0;
virtual hsBool IInit()=0;
virtual void IShutdown()=0;
};
class hsgResMgr
{
private:
static hsResMgr* fResMgr;
public:
static hsResMgr* ResMgr() { return (hsResMgr*)fResMgr; }
static plDispatchBase* Dispatch() { hsAssert(fResMgr, "No resmgr"); return fResMgr->Dispatch(); }
static hsBool Init(hsResMgr* m);
static hsBool Reset() { return fResMgr->IReset(); }
static void Shutdown();
static hsBool SendRef(plKey& key, plRefMsg* refMsg, plRefFlags::Type flags) { return fResMgr->SendRef(key, refMsg, flags); }
static hsBool SendRef(hsKeyedObject* ko, plRefMsg* refMsg, plRefFlags::Type flags) { return fResMgr->SendRef(ko, refMsg, flags); }
};
#endif // hsResMgr_inc

View File

@ -0,0 +1,172 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef hsTimer_Defined
#define hsTimer_Defined
#include "hsWide.h"
#include "hsScalar.h"
#if !HS_CAN_USE_FLOAT
#error "Unsupported without double's"
#endif // !HS_CAN_USE_FLOAT
class plTimerShare
{
protected:
mutable hsBool fFirstTime;
mutable hsWide fRawTimeZero;
mutable hsBool fResetSmooth;
enum {
kSmoothBuffLen = 10
};
double fSmoothBuff[kSmoothBuffLen];
int fCurrSlot;
hsScalar fSysTimeScale;
double fRealSeconds;
double fSysSeconds;
hsScalar fDelSysSeconds;
hsScalar fFrameTimeInc;
hsBool fRunningFrameTime;
hsScalar fTimeClampSecs;
hsScalar fSmoothingClampSecs;
hsBool fClamping;
hsWide* FactorInTimeZero(hsWide* ticks) const;
double GetSeconds() const;
double GetMilliSeconds() const;
hsWide* GetRawTicks(hsWide* ticks) const;
double RawTicksToDSeconds(const hsWide& ticks);
hsWide DSecondsToRawTicks(double secs);
hsScalar GetDelSysSeconds() const { return fDelSysSeconds; }
double GetSysSeconds() const { return fSysSeconds; }
double IncSysSeconds();
void SetRealTime(hsBool realTime);
hsBool IsRealTime() const { return !fRunningFrameTime; }
void SetFrameTimeInc(hsScalar inc) { fFrameTimeInc = inc; }
void SetTimeScale(hsScalar s) { fSysTimeScale = s; }
hsScalar GetTimeScale() const { return fSysTimeScale; }
void SetTimeClamp(hsScalar secs) { fTimeClampSecs = secs; }
void SetSmoothingCap(hsScalar secs) { fSmoothingClampSecs = secs; }
hsScalar GetTimeClamp() const { return fTimeClampSecs; }
hsBool IsClamping() const { return fClamping; }
friend class hsTimer;
public:
plTimerShare();
~plTimerShare();
};
class hsTimer
{
protected:
static const double fPrecTicksPerSec;
static const hsWide fRawBase;
static hsWide IInitRawBase();
static plTimerShare* fTimer;
public:
static hsBool VerifyRawBase() { return fRawBase == IInitRawBase(); }
static const hsWide& GetRawBase() { return fRawBase; }
static hsWide* GetRawTicks(hsWide* ticks) { return fTimer->GetRawTicks(ticks); }
static double GetSeconds() { return fTimer->GetSeconds(); }
static double GetMilliSeconds() { return fTimer->GetMilliSeconds(); }
static double RawTicksToDSeconds(const hsWide& ticks) { return fTimer->RawTicksToDSeconds(ticks); }
static hsWide DSecondsToRawTicks(double secs) { return fTimer->DSecondsToRawTicks(secs); }
static hsScalar GetDelSysSeconds() { return fTimer->GetDelSysSeconds(); }
static double GetSysSeconds() { return fTimer->GetSysSeconds(); }
static double IncSysSeconds() { return fTimer->IncSysSeconds(); }
static void SetRealTime(hsBool realTime) { fTimer->SetRealTime(realTime); }
static hsBool IsRealTime() { return fTimer->IsRealTime(); }
static void SetFrameTimeInc(hsScalar inc) { fTimer->SetFrameTimeInc(inc); }
static void SetTimeScale(hsScalar s) { fTimer->SetTimeScale(s); }
static hsScalar GetTimeScale() { return fTimer->GetTimeScale(); }
static void SetTimeClamp(hsScalar secs) { fTimer->SetTimeClamp(secs); }
static void SetTimeSmoothingClamp(hsScalar secs) { fTimer->SetSmoothingCap(secs); }
static hsScalar GetTimeClamp() { return fTimer->GetTimeClamp(); }
static hsBool IsClamping() { return fTimer->IsClamping(); }
///////////////////////////
// Precision timer routines - these are stateless and implemented as statics.
///////////////////////////
static UInt32 GetPrecTickCount();
static double GetPrecTicksPerSec();
static UInt32 PrecSecsToTicks(hsScalar secs);
static double PrecTicksToSecs(UInt32 ticks);
static double PrecTicksToHz(UInt32 ticks);
// If you need to time something longer than 20 seconds, use this instead of
// the precision timer. It works the same, it just gives you full resolution.
static UInt64 GetFullTickCount();
static float FullTicksToMs(UInt64 ticks);
//
// Pass GetTheTimer() into other process space, and then call SetTheTimer() on it.
static void SetTheTimer(plTimerShare* timer);
static plTimerShare* GetTheTimer() { return fTimer; }
};
#endif

View File

@ -0,0 +1,118 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plAudible_inc
#define plAudible_inc
#include "hsTemplates.h"
#include "../pnKeyedObject/hsKeyedObject.h"
class plSound;
class hsStream;
class hsResMgr;
struct hsMatrix44;
struct hsVector3;
struct hsPoint3;
class hsBounds3Ext;
class plSoundMsg;
class plEventCallbackMsg;
class plAudible : public hsKeyedObject
{
public:
CLASSNAME_REGISTER( plAudible );
GETINTERFACE_ANY( plAudible, hsKeyedObject );
virtual plAudible& SetProperty(int prop, hsBool on) = 0;
virtual hsBool GetProperty(int prop) = 0;
virtual plAudible& SetTransform(const hsMatrix44& l2w, const hsMatrix44& w2l, int index = -1) { return *this; }
virtual void Read(hsStream* s, hsResMgr* mgr){hsKeyedObject::Read(s, mgr);}
virtual void Write(hsStream* s, hsResMgr* mgr){hsKeyedObject::Write(s, mgr);}
virtual void SetSceneObject(plKey obj) = 0;
virtual plKey GetSceneObject() const = 0;
// These two should only be called by the SceneNode
virtual void SetSceneNode(plKey node) = 0;
virtual plKey GetSceneNode() const = 0;
virtual void Play(int index = -1) = 0;
virtual void SynchedPlay(int index = -1) = 0;
virtual void Stop(int index = -1) = 0;
virtual void FastForwardPlay(int index = -1) = 0;
virtual void FastForwardToggle( int index = -1) = 0;
virtual void SetMin(const hsScalar m,int index = -1) = 0; // sets minimum falloff distance
virtual void SetMax(const hsScalar m,int index = -1) = 0; // sets maximum falloff distance
virtual hsScalar GetMin(int index = -1) const = 0;
virtual hsScalar GetMax(int index = -1) const = 0;
virtual void SetVelocity(const hsVector3 vel,int index = -1) = 0;
virtual hsVector3 GetVelocity(int index = -1) const = 0;
virtual hsPoint3 GetPosition(int index = -1) = 0;
virtual void SetLooping(hsBool loop,int index = -1) = 0; // sets continuous loop or stops looping
virtual hsBool IsPlaying(int index = -1) = 0;
virtual void SetTime(double t, int index = -1) = 0;
virtual void Activate() = 0;
virtual void DeActivate() = 0;
virtual void RemoveCallbacks(plSoundMsg* pMsg) = 0;
virtual void AddCallbacks(plSoundMsg* pMsg) = 0;
virtual void GetStatus(plSoundMsg* pMsg) = 0;
virtual int GetNumSounds() const = 0;
virtual plSound* GetSound(int i) const = 0;
virtual int GetSoundIndex(const char *keyname) const = 0;
virtual void Init(hsBool isLocal){;}
virtual void SetVolume(const float volume,int index = -1) = 0;
virtual void SetMuted( hsBool muted, int index = -1 ) = 0;
virtual void ToggleMuted( int index = -1 ) = 0;
virtual void SetTalkIcon(int index, UInt32 str) = 0;
virtual void ClearTalkIcon() = 0;
virtual void SetFilename(int index, const char *filename, hsBool isCompressed) = 0; // set filename for a streaming sound
virtual void SetFadeIn( const int type, const float length, int index = -1 ) = 0;
virtual void SetFadeOut( const int type, const float length, int index = -1 ) = 0;
protected:
hsTArray<plEventCallbackMsg*> fCallbacks;
};
#endif // plAudible_inc

View File

@ -0,0 +1,60 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plCCRMgrBase_inc
#define plCCRMgrBase_inc
//
// Abstract base class for CCR Mgr
//
#include "../pnKeyedObject/hsKeyedObject.h"
class plCCRMgrBase : public hsKeyedObject
{
protected:
static plCCRMgrBase* fBaseInstance;
public:
static plCCRMgrBase* GetInstance() { return fBaseInstance; }
};
#endif // plCCRMgrBase_inc

View File

@ -0,0 +1,74 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plClassIndexMacros_inc
#define plClassIndexMacros_inc
// Macros for deriving the class index enum from the class name.
// These should always be used in place of 'plFooIDX'.
// Place before includes to avoid recursive include prob.
// --For use within plCreatableIndex
#define CLASS_INDEX(plClassName) plClassName##IDX
// --For use within plExternalCreatableIndex
#define EXTERN_CLASS_INDEX(plClassName) plClassName##IDX
// --For use outside of plCreatableIndex
#define CLASS_INDEX_SCOPED(plClassName) plCreatableIndex::CLASS_INDEX(plClassName)
// --For use outside of plExternalCreatableIndex
#define EXTERN_CLASS_INDEX_SCOPED(plClassName) plExternalCreatableIndex::EXTERN_CLASS_INDEX(plClassName)
// Macros for the start and end of the class index list
#define CLASS_INDEX_LIST_START const int KEYED_OBJ_DELINEATOR = 512; \
const int EXTERNAL_KEYED_DLL_BEGIN = 256; \
const int EXTERNAL_KEYED_DLL_END = 511; \
const int EXTERNAL_NONKEYED_DLL_BEGIN = 1436; \
const int EXTERNAL_NONKEYED_DLL_END = 1536; \
class plCreatableIndex { public: enum {
#define CLASS_INDEX_LIST_END plNumClassIndices = EXTERNAL_NONKEYED_DLL_END + 1, }; };
// Macro to mark which class index is the start of the nonkeyed object section
#define CLASS_INDEX_NONKEYED_OBJ_START kKeyedObjDelineator = KEYED_OBJ_DELINEATOR-1,
#define CLASS_INDEX_DATABASE_STRUCT_INDEXES_START kDatabaseStructIndexesStart,
#define CLASS_INDEX_DATABASE_STRUCT_INDEXES_END kDatabaseStructIndexesEnd=kDatabaseStructIndexesStart+100,
#endif // plClassIndexMacros_inc

View File

@ -0,0 +1,952 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plCreatableIndex_inc
#define plCreatableIndex_inc
#include "plClassIndexMacros.h" // for CLASS_INDEX macro defn
CLASS_INDEX_LIST_START
//---------------------------------------------------------------------
// hsKeyedObjects should appear in the first section of the enum list
// And everything else in the next section
// Otherwise you will get an Assert
//---------------------------------------------------------------------
CLASS_INDEX(plSceneNode),
CLASS_INDEX(plSceneObject),
CLASS_INDEX(hsKeyedObject),
CLASS_INDEX(plBitmap),
CLASS_INDEX(plMipmap),
CLASS_INDEX(plCubicEnvironmap),
CLASS_INDEX(plLayer),
CLASS_INDEX(hsGMaterial),
CLASS_INDEX(plParticleSystem),
CLASS_INDEX(plParticleEffect),
CLASS_INDEX(plParticleCollisionEffectBeat),
CLASS_INDEX(plParticleFadeVolumeEffect),
CLASS_INDEX(plBoundInterface),
CLASS_INDEX(plRenderTarget),
CLASS_INDEX(plCubicRenderTarget),
CLASS_INDEX(plCubicRenderTargetModifier),
CLASS_INDEX(plObjInterface),
CLASS_INDEX(plAudioInterface),
CLASS_INDEX(plAudible),
CLASS_INDEX(plAudibleNull),
CLASS_INDEX(plWinAudible),
CLASS_INDEX(plCoordinateInterface),
CLASS_INDEX(plDrawInterface),
CLASS_INDEX(plDrawable),
CLASS_INDEX(plDrawableMesh),
CLASS_INDEX(plDrawableIce),
CLASS_INDEX(plPhysical),
CLASS_INDEX(plPhysicalMesh),
CLASS_INDEX(plSimulationInterface),
CLASS_INDEX(plCameraModifier),
CLASS_INDEX(plModifier),
CLASS_INDEX(plSingleModifier),
CLASS_INDEX(plSimpleModifier),
CLASS_INDEX(pfSecurePreloader),
CLASS_INDEX(UNUSED_plRandomTMModifier),
CLASS_INDEX(plInterestingModifier),
CLASS_INDEX(plDetectorModifier),
CLASS_INDEX(plSimplePhysicalMesh),
CLASS_INDEX(plCompoundPhysicalMesh),
CLASS_INDEX(plMultiModifier),
CLASS_INDEX(plSynchedObject),
CLASS_INDEX(plSoundBuffer),
CLASS_INDEX(UNUSED_plAliasModifier),
CLASS_INDEX(plPickingDetector),
CLASS_INDEX(plCollisionDetector),
CLASS_INDEX(plLogicModifier),
CLASS_INDEX(plConditionalObject),
CLASS_INDEX(plANDConditionalObject),
CLASS_INDEX(plORConditionalObject),
CLASS_INDEX(plPickedConditionalObject),
CLASS_INDEX(plActivatorConditionalObject),
CLASS_INDEX(plTimerCallbackManager),
CLASS_INDEX(plKeyPressConditionalObject),
CLASS_INDEX(plAnimationEventConditionalObject),
CLASS_INDEX(plControlEventConditionalObject),
CLASS_INDEX(plObjectInBoxConditionalObject),
CLASS_INDEX(plLocalPlayerInBoxConditionalObject),
CLASS_INDEX(plObjectIntersectPlaneConditionalObject),
CLASS_INDEX(plLocalPlayerIntersectPlaneConditionalObject),
CLASS_INDEX(plPortalDrawable),
CLASS_INDEX(plPortalPhysical),
CLASS_INDEX(plSpawnModifier),
CLASS_INDEX(plFacingConditionalObject),
CLASS_INDEX(plPXPhysical),
CLASS_INDEX(plViewFaceModifier),
CLASS_INDEX(plLayerInterface),
CLASS_INDEX(plLayerWrapper),
CLASS_INDEX(plLayerAnimation),
CLASS_INDEX(plLayerDepth),
CLASS_INDEX(plLayerMovie),
CLASS_INDEX(plLayerBink),
CLASS_INDEX(plLayerAVI),
CLASS_INDEX(plSound),
CLASS_INDEX(plWin32Sound),
CLASS_INDEX(plLayerOr),
CLASS_INDEX(plAudioSystem),
CLASS_INDEX(plDrawableSpans),
CLASS_INDEX(UNUSED_plDrawablePatchSet),
CLASS_INDEX(plInputManager),
CLASS_INDEX(plLogicModBase),
CLASS_INDEX(plFogEnvironment),
CLASS_INDEX(plNetApp),
CLASS_INDEX(plNetClientMgr),
CLASS_INDEX(pl2WayWinAudible),
CLASS_INDEX(plLightInfo),
CLASS_INDEX(plDirectionalLightInfo),
CLASS_INDEX(plOmniLightInfo),
CLASS_INDEX(plSpotLightInfo),
CLASS_INDEX(plLightSpace),
CLASS_INDEX(plNetClientApp),
CLASS_INDEX(plNetServerApp),
CLASS_INDEX(plClient),
CLASS_INDEX(UNUSED_plCompoundTMModifier),
CLASS_INDEX(plCameraBrain),
CLASS_INDEX(plCameraBrain_Default),
CLASS_INDEX(plCameraBrain_Drive),
CLASS_INDEX(plCameraBrain_Fixed),
CLASS_INDEX(plCameraBrain_FixedPan),
CLASS_INDEX(pfGUIClickMapCtrl),
CLASS_INDEX(plListener),
CLASS_INDEX(plAvatarMod),
CLASS_INDEX(plAvatarAnim),
CLASS_INDEX(plAvatarAnimMgr),
CLASS_INDEX(plOccluder),
CLASS_INDEX(plMobileOccluder),
CLASS_INDEX(plLayerShadowBase),
CLASS_INDEX(plLimitedDirLightInfo),
CLASS_INDEX(plAGAnim),
CLASS_INDEX(plAGModifier),
CLASS_INDEX(plAGMasterMod),
CLASS_INDEX(plCameraBrain_Avatar),
CLASS_INDEX(plCameraRegionDetector),
CLASS_INDEX(plCameraBrain_FP),
CLASS_INDEX(plLineFollowMod),
CLASS_INDEX(plLightModifier),
CLASS_INDEX(plOmniModifier),
CLASS_INDEX(plSpotModifier),
CLASS_INDEX(plLtdDirModifier),
CLASS_INDEX(plSeekPointMod),
CLASS_INDEX(plOneShotMod),
CLASS_INDEX(plRandomCommandMod),
CLASS_INDEX(plRandomSoundMod),
CLASS_INDEX(plPostEffectMod),
CLASS_INDEX(plObjectInVolumeDetector),
CLASS_INDEX(plResponderModifier),
CLASS_INDEX(plAxisAnimModifier),
CLASS_INDEX(plLayerLightBase),
CLASS_INDEX(plFollowMod),
CLASS_INDEX(plTransitionMgr),
CLASS_INDEX(UNUSED___plInventoryMod),
CLASS_INDEX(UNUSED___plInventoryObjMod),
CLASS_INDEX(plLinkEffectsMgr),
CLASS_INDEX(plWin32StreamingSound),
CLASS_INDEX(UNUSED___plPythonMod),
CLASS_INDEX(plActivatorActivatorConditionalObject),
CLASS_INDEX(plSoftVolume),
CLASS_INDEX(plSoftVolumeSimple),
CLASS_INDEX(plSoftVolumeComplex),
CLASS_INDEX(plSoftVolumeUnion),
CLASS_INDEX(plSoftVolumeIntersect),
CLASS_INDEX(plSoftVolumeInvert),
CLASS_INDEX(plWin32LinkSound),
CLASS_INDEX(plLayerLinkAnimation),
CLASS_INDEX(plArmatureMod),
CLASS_INDEX(plCameraBrain_Freelook),
CLASS_INDEX(plHavokConstraintsMod),
CLASS_INDEX(plHingeConstraintMod),
CLASS_INDEX(plWheelConstraintMod),
CLASS_INDEX(plStrongSpringConstraintMod),
CLASS_INDEX(plArmatureLODMod),
CLASS_INDEX(plWin32StaticSound),
CLASS_INDEX(pfGameGUIMgr),
CLASS_INDEX(pfGUIDialogMod),
CLASS_INDEX(plCameraBrain1),
CLASS_INDEX(plVirtualCam1),
CLASS_INDEX(plCameraModifier1),
CLASS_INDEX(plCameraBrain1_Drive),
CLASS_INDEX(plCameraBrain1_POA),
CLASS_INDEX(plCameraBrain1_Avatar),
CLASS_INDEX(plCameraBrain1_Fixed),
CLASS_INDEX(plCameraBrain1_POAFixed),
CLASS_INDEX(pfGUIButtonMod),
CLASS_INDEX(plPythonFileMod),
CLASS_INDEX(pfGUIControlMod),
CLASS_INDEX(plExcludeRegionModifier),
CLASS_INDEX(pfGUIDraggableMod),
CLASS_INDEX(plVolumeSensorConditionalObject),
CLASS_INDEX(plVolActivatorConditionalObject),
CLASS_INDEX(plMsgForwarder),
CLASS_INDEX(plBlower),
CLASS_INDEX(pfGUIListBoxMod),
CLASS_INDEX(pfGUITextBoxMod),
CLASS_INDEX(pfGUIEditBoxMod),
CLASS_INDEX(plDynamicTextMap),
CLASS_INDEX(plSittingModifier),
CLASS_INDEX(pfGUIUpDownPairMod),
CLASS_INDEX(pfGUIValueCtrl),
CLASS_INDEX(pfGUIKnobCtrl),
CLASS_INDEX(plAvLadderMod),
CLASS_INDEX(plCameraBrain1_FirstPerson),
CLASS_INDEX(plCloneSpawnModifier),
CLASS_INDEX(plClothingItem),
CLASS_INDEX(plClothingOutfit),
CLASS_INDEX(plClothingBase),
CLASS_INDEX(plClothingMgr),
CLASS_INDEX(pfGUIDragBarCtrl),
CLASS_INDEX(pfGUICheckBoxCtrl),
CLASS_INDEX(pfGUIRadioGroupCtrl),
CLASS_INDEX(pfPlayerBookMod),
CLASS_INDEX(pfGUIDynDisplayCtrl),
CLASS_INDEX(UNUSED_plLayerProject),
CLASS_INDEX(plInputInterfaceMgr),
CLASS_INDEX(plRailCameraMod),
CLASS_INDEX(plMultistageBehMod),
CLASS_INDEX(plCameraBrain1_Circle),
CLASS_INDEX(plParticleWindEffect),
CLASS_INDEX(plAnimEventModifier),
CLASS_INDEX(plAutoProfile),
CLASS_INDEX(pfGUISkin),
CLASS_INDEX(plAVIWriter),
CLASS_INDEX(plParticleCollisionEffect),
CLASS_INDEX(plParticleCollisionEffectDie),
CLASS_INDEX(plParticleCollisionEffectBounce),
CLASS_INDEX(plInterfaceInfoModifier),
CLASS_INDEX(plSharedMesh),
CLASS_INDEX(plArmatureEffectsMgr),
CLASS_INDEX(pfMarkerMgr),
CLASS_INDEX(plVehicleModifier),
CLASS_INDEX(plParticleLocalWind),
CLASS_INDEX(plParticleUniformWind),
CLASS_INDEX(plInstanceDrawInterface),
CLASS_INDEX(plShadowMaster),
CLASS_INDEX(plShadowCaster),
CLASS_INDEX(plPointShadowMaster),
CLASS_INDEX(plDirectShadowMaster),
CLASS_INDEX(plSDLModifier),
CLASS_INDEX(plPhysicalSDLModifier),
CLASS_INDEX(plClothingSDLModifier),
CLASS_INDEX(plAvatarSDLModifier),
CLASS_INDEX(plAGMasterSDLModifier),
CLASS_INDEX(plPythonSDLModifier),
CLASS_INDEX(plLayerSDLModifier),
CLASS_INDEX(plAnimTimeConvertSDLModifier),
CLASS_INDEX(plResponderSDLModifier),
CLASS_INDEX(plSoundSDLModifier),
CLASS_INDEX(plResManagerHelper),
CLASS_INDEX(plAvatarPhysicalSDLModifier),
CLASS_INDEX(plArmatureEffect),
CLASS_INDEX(plArmatureEffectFootSound),
CLASS_INDEX(plEAXListenerMod),
CLASS_INDEX(plDynaDecalMgr),
CLASS_INDEX(plObjectInVolumeAndFacingDetector),
CLASS_INDEX(plDynaFootMgr),
CLASS_INDEX(plDynaRippleMgr),
CLASS_INDEX(plDynaBulletMgr),
CLASS_INDEX(plDecalEnableMod),
CLASS_INDEX(plPrintShape),
CLASS_INDEX(plDynaPuddleMgr),
CLASS_INDEX(pfGUIMultiLineEditCtrl),
CLASS_INDEX(plLayerAnimationBase),
CLASS_INDEX(plLayerSDLAnimation),
CLASS_INDEX(plATCAnim),
CLASS_INDEX(plAgeGlobalAnim),
CLASS_INDEX(plSubworldRegionDetector),
CLASS_INDEX(plAvatarMgr),
CLASS_INDEX(plNPCSpawnMod),
CLASS_INDEX(plActivePrintShape),
CLASS_INDEX(plExcludeRegionSDLModifier),
CLASS_INDEX(plLOSDispatch),
CLASS_INDEX(plDynaWakeMgr),
CLASS_INDEX(plSimulationMgr),
CLASS_INDEX(plWaveSet7),
CLASS_INDEX(plPanicLinkRegion),
CLASS_INDEX(plWin32GroupedSound),
CLASS_INDEX(plFilterCoordInterface),
CLASS_INDEX(plStereizer),
CLASS_INDEX( plCCRMgr ),
CLASS_INDEX( plCCRSpecialist ),
CLASS_INDEX( plCCRSeniorSpecialist ),
CLASS_INDEX( plCCRShiftSupervisor ),
CLASS_INDEX( plCCRGameOperator ),
CLASS_INDEX(plShader),
CLASS_INDEX(plDynamicEnvMap),
CLASS_INDEX(plSimpleRegionSensor),
CLASS_INDEX(plMorphSequence),
CLASS_INDEX(plEmoteAnim),
CLASS_INDEX(plDynaRippleVSMgr),
CLASS_INDEX(UNUSED_plWaveSet6),
CLASS_INDEX(pfGUIProgressCtrl),
CLASS_INDEX(plMaintainersMarkerModifier),
CLASS_INDEX(plMorphSequenceSDLMod),
CLASS_INDEX(plMorphDataSet),
CLASS_INDEX(plHardRegion),
CLASS_INDEX(plHardRegionPlanes),
CLASS_INDEX(plHardRegionComplex),
CLASS_INDEX(plHardRegionUnion),
CLASS_INDEX(plHardRegionIntersect),
CLASS_INDEX(plHardRegionInvert),
CLASS_INDEX(plVisRegion),
CLASS_INDEX(plVisMgr),
CLASS_INDEX(plRegionBase),
CLASS_INDEX(pfGUIPopUpMenu),
CLASS_INDEX(pfGUIMenuItem),
CLASS_INDEX(plCoopCoordinator),
CLASS_INDEX(plFont),
CLASS_INDEX(plFontCache),
CLASS_INDEX(plRelevanceRegion),
CLASS_INDEX(plRelevanceMgr),
CLASS_INDEX(pfJournalBook),
CLASS_INDEX(plLayerTargetContainer),
CLASS_INDEX(plImageLibMod),
CLASS_INDEX(plParticleFlockEffect),
CLASS_INDEX(plParticleSDLMod),
CLASS_INDEX(plAgeLoader),
CLASS_INDEX(plWaveSetBase),
CLASS_INDEX(plPhysicalSndGroup),
CLASS_INDEX(pfBookData),
CLASS_INDEX(plDynaTorpedoMgr),
CLASS_INDEX(plDynaTorpedoVSMgr),
CLASS_INDEX(plClusterGroup),
CLASS_INDEX(plGameMarkerModifier),
CLASS_INDEX(plLODMipmap),
CLASS_INDEX(plSwimDetector),
CLASS_INDEX(plFadeOpacityMod),
CLASS_INDEX(plFadeOpacityLay),
CLASS_INDEX(plDistOpacityMod),
CLASS_INDEX(plArmatureModBase),
CLASS_INDEX(plSwimRegionInterface),
CLASS_INDEX(plSwimCircularCurrentRegion),
CLASS_INDEX(plParticleFollowSystemEffect),
CLASS_INDEX(plSwimStraightCurrentRegion),
CLASS_INDEX(pfObjectFlocker),
CLASS_INDEX(plGrassShaderMod),
CLASS_INDEX(plDynamicCamMap),
CLASS_INDEX(plRidingAnimatedPhysicalDetector),
CLASS_INDEX(plVolumeSensorConditionalObjectNoArbitration),
//---------------------------------------------------------
// Keyed objects above this line, unkeyed (such as messages) below..
//---------------------------------------------------------
CLASS_INDEX_NONKEYED_OBJ_START
CLASS_INDEX(plObjRefMsg),
CLASS_INDEX(plNodeRefMsg),
CLASS_INDEX(plMessage),
CLASS_INDEX(plRefMsg),
CLASS_INDEX(plGenRefMsg),
CLASS_INDEX(plTimeMsg),
CLASS_INDEX(plAnimCmdMsg),
CLASS_INDEX(plParticleUpdateMsg),
CLASS_INDEX(plLayRefMsg),
CLASS_INDEX(plMatRefMsg),
CLASS_INDEX(plCameraMsg),
CLASS_INDEX(plInputEventMsg),
CLASS_INDEX(plKeyEventMsg),
CLASS_INDEX(plMouseEventMsg),
CLASS_INDEX(plEvalMsg),
CLASS_INDEX(plTransformMsg),
CLASS_INDEX(plControlEventMsg),
CLASS_INDEX(plVaultCCRNode),
CLASS_INDEX(plLOSRequestMsg),
CLASS_INDEX(plLOSHitMsg),
CLASS_INDEX(plSingleModMsg),
CLASS_INDEX(plMultiModMsg),
CLASS_INDEX(plAvatarPhysicsEnableCallbackMsg),
CLASS_INDEX(plMemberUpdateMsg),
CLASS_INDEX(plNetMsgPagingRoom),
CLASS_INDEX(plActivatorMsg),
CLASS_INDEX(plDispatch),
CLASS_INDEX(plReceiver),
CLASS_INDEX(plMeshRefMsg),
CLASS_INDEX(hsGRenderProcs),
CLASS_INDEX(hsSfxAngleFade),
CLASS_INDEX(hsSfxDistFade),
CLASS_INDEX(hsSfxDistShade),
CLASS_INDEX(hsSfxGlobalShade),
CLASS_INDEX(hsSfxIntenseAlpha),
CLASS_INDEX(hsSfxObjDistFade),
CLASS_INDEX(hsSfxObjDistShade),
CLASS_INDEX(hsDynamicValue),
CLASS_INDEX(hsDynamicScalar),
CLASS_INDEX(hsDynamicColorRGBA),
CLASS_INDEX(hsDynamicMatrix33),
CLASS_INDEX(hsDynamicMatrix44),
CLASS_INDEX(plOmniSqApplicator),
CLASS_INDEX(plPreResourceMsg),
CLASS_INDEX(UNUSED_hsDynamicColorRGBA),
CLASS_INDEX(UNUSED_hsDynamicMatrix33),
CLASS_INDEX(UNUSED_hsDynamicMatrix44),
CLASS_INDEX(plController),
CLASS_INDEX(plLeafController),
CLASS_INDEX(plCompoundController),
CLASS_INDEX(UNUSED_plRotController),
CLASS_INDEX(UNUSED_plPosController),
CLASS_INDEX(UNUSED_plScalarController),
CLASS_INDEX(UNUSED_plPoint3Controller),
CLASS_INDEX(UNUSED_plScaleValueController),
CLASS_INDEX(UNUSED_plQuatController),
CLASS_INDEX(UNUSED_plMatrix33Controller),
CLASS_INDEX(UNUSED_plMatrix44Controller),
CLASS_INDEX(UNUSED_plEaseController),
CLASS_INDEX(UNUSED_plSimpleScaleController),
CLASS_INDEX(UNUSED_plSimpleRotController),
CLASS_INDEX(plCompoundRotController),
CLASS_INDEX(UNUSED_plSimplePosController),
CLASS_INDEX(plCompoundPosController),
CLASS_INDEX(plTMController),
CLASS_INDEX(hsFogControl),
CLASS_INDEX(plIntRefMsg),
CLASS_INDEX(plCollisionReactor),
CLASS_INDEX(plCorrectionMsg),
CLASS_INDEX(plPhysicalModifier),
CLASS_INDEX(plPickedMsg),
CLASS_INDEX(plCollideMsg),
CLASS_INDEX(plTriggerMsg),
CLASS_INDEX(plInterestingModMsg),
CLASS_INDEX(plDebugKeyEventMsg),
CLASS_INDEX(plPhysicalProperties_DEAD),
CLASS_INDEX(plSimplePhys),
CLASS_INDEX(plMatrixUpdateMsg),
CLASS_INDEX(plCondRefMsg),
CLASS_INDEX(plTimerCallbackMsg),
CLASS_INDEX(plEventCallbackMsg),
CLASS_INDEX(plSpawnModMsg),
CLASS_INDEX(plSpawnRequestMsg),
CLASS_INDEX(plLoadCloneMsg),
CLASS_INDEX(plEnableMsg),
CLASS_INDEX(plWarpMsg),
CLASS_INDEX(plAttachMsg),
CLASS_INDEX(pfConsole),
CLASS_INDEX(plRenderMsg),
CLASS_INDEX(plAnimTimeConvert),
CLASS_INDEX(plSoundMsg),
CLASS_INDEX(plInterestingPing),
CLASS_INDEX(plNodeCleanupMsg),
CLASS_INDEX(plSpaceTree),
CLASS_INDEX(plNetMessage),
CLASS_INDEX(plNetMsgJoinReq),
CLASS_INDEX(plNetMsgJoinAck),
CLASS_INDEX(plNetMsgLeave),
CLASS_INDEX(plNetMsgPing),
CLASS_INDEX(plNetMsgRoomsList),
CLASS_INDEX(plNetMsgGroupOwner),
CLASS_INDEX(plNetMsgGameStateRequest),
CLASS_INDEX(plNetMsgSessionReset),
CLASS_INDEX(plNetMsgOmnibus),
CLASS_INDEX(plNetMsgObject),
CLASS_INDEX(plCCRInvisibleMsg),
CLASS_INDEX(plLinkInDoneMsg),
CLASS_INDEX(plNetMsgGameMessage),
CLASS_INDEX(plNetMsgStream),
CLASS_INDEX(plAudioSysMsg),
CLASS_INDEX(plDispatchBase),
CLASS_INDEX(plServerReplyMsg),
CLASS_INDEX(plDeviceRecreateMsg),
CLASS_INDEX(plNetMsgStreamHelper),
CLASS_INDEX(plNetMsgObjectHelper),
CLASS_INDEX(plIMouseXEventMsg),
CLASS_INDEX(plIMouseYEventMsg),
CLASS_INDEX(plIMouseBEventMsg),
CLASS_INDEX(plLogicTriggerMsg),
CLASS_INDEX(plPipeline),
CLASS_INDEX(plDXPipeline),
CLASS_INDEX(plNetMsgVoice),
CLASS_INDEX(plLightRefMsg),
CLASS_INDEX(plNetMsgStreamedObject),
CLASS_INDEX(plNetMsgSharedState),
CLASS_INDEX(plNetMsgTestAndSet),
CLASS_INDEX(plNetMsgGetSharedState),
CLASS_INDEX(plSharedStateMsg),
CLASS_INDEX(plNetGenericServerTask),
CLASS_INDEX(plNetClientMgrMsg),
CLASS_INDEX(plLoadAgeMsg),
CLASS_INDEX(plMessageWithCallbacks),
CLASS_INDEX(plClientMsg),
CLASS_INDEX(plClientRefMsg),
CLASS_INDEX(plNetMsgObjStateRequest),
CLASS_INDEX(plCCRPetitionMsg),
CLASS_INDEX(plVaultCCRInitializationTask),
CLASS_INDEX(plNetServerMsg),
CLASS_INDEX(plNetServerMsgWithContext),
CLASS_INDEX(plNetServerMsgRegisterServer),
CLASS_INDEX(plNetServerMsgUnregisterServer),
CLASS_INDEX(plNetServerMsgStartProcess),
CLASS_INDEX(plNetServerMsgRegisterProcess),
CLASS_INDEX(plNetServerMsgUnregisterProcess),
CLASS_INDEX(plNetServerMsgFindProcess),
CLASS_INDEX(plNetServerMsgProcessFound),
CLASS_INDEX(plNetMsgRoutingInfo),
CLASS_INDEX(plNetServerSessionInfo),
CLASS_INDEX(plSimulationMsg),
CLASS_INDEX(plSimulationSynchMsg),
CLASS_INDEX(plHKSimulationSynchMsg),
CLASS_INDEX(plAvatarMsg),
CLASS_INDEX(plAvTaskMsg),
CLASS_INDEX(plAvSeekMsg),
CLASS_INDEX(plAvOneShotMsg),
CLASS_INDEX(plSatisfiedMsg),
CLASS_INDEX(plNetMsgObjectListHelper),
CLASS_INDEX(plNetMsgObjectUpdateFilter),
CLASS_INDEX(plProxyDrawMsg),
CLASS_INDEX(plSelfDestructMsg),
CLASS_INDEX(plSimInfluenceMsg ),
CLASS_INDEX(plForceMsg ),
CLASS_INDEX(plOffsetForceMsg ),
CLASS_INDEX(plTorqueMsg ),
CLASS_INDEX(plImpulseMsg ),
CLASS_INDEX(plOffsetImpulseMsg ),
CLASS_INDEX(plAngularImpulseMsg ),
CLASS_INDEX(plDampMsg ),
CLASS_INDEX(plShiftMassMsg ),
CLASS_INDEX(plSimStateMsg ),
CLASS_INDEX(plFreezeMsg ),
CLASS_INDEX(plEventGroupMsg ),
CLASS_INDEX(plSuspendEventMsg ),
CLASS_INDEX(plNetMsgMembersListReq),
CLASS_INDEX(plNetMsgMembersList),
CLASS_INDEX(plNetMsgMemberInfoHelper),
CLASS_INDEX(plNetMsgMemberListHelper),
CLASS_INDEX(plNetMsgMemberUpdate),
CLASS_INDEX(plNetMsgServerToClient),
CLASS_INDEX(plNetMsgCreatePlayer),
CLASS_INDEX(plNetMsgAuthenticateHello),
CLASS_INDEX(plNetMsgAuthenticateChallenge),
CLASS_INDEX(plConnectedToVaultMsg),
CLASS_INDEX(plCCRCommunicationMsg),
CLASS_INDEX(plNetMsgInitialAgeStateSent),
CLASS_INDEX(plInitialAgeStateLoadedMsg),
CLASS_INDEX(plNetServerMsgFindServerBase),
CLASS_INDEX(plNetServerMsgFindServerReplyBase),
CLASS_INDEX(plNetServerMsgFindAuthServer),
CLASS_INDEX(plNetServerMsgFindAuthServerReply),
CLASS_INDEX(plNetServerMsgFindVaultServer),
CLASS_INDEX(plNetServerMsgFindVaultServerReply),
CLASS_INDEX(plAvTaskSeekDoneMsg),
CLASS_INDEX(plNCAgeJoinerMsg),
CLASS_INDEX(plNetServerMsgVaultTask),
CLASS_INDEX(plNetMsgVaultTask),
CLASS_INDEX(plAgeLinkStruct),
CLASS_INDEX(plVaultAgeInfoNode),
CLASS_INDEX(plNetMsgStreamableHelper),
CLASS_INDEX(plNetMsgReceiversListHelper),
CLASS_INDEX(plNetMsgListenListUpdate),
CLASS_INDEX(plNetServerMsgPing),
CLASS_INDEX(plNetMsgAlive),
CLASS_INDEX(plNetMsgTerminated),
CLASS_INDEX(plSDLModifierMsg),
CLASS_INDEX(plNetMsgSDLState),
CLASS_INDEX(plNetServerMsgSessionReset),
CLASS_INDEX(plCCRBanLinkingMsg),
CLASS_INDEX(plCCRSilencePlayerMsg),
CLASS_INDEX(plRenderRequestMsg),
CLASS_INDEX(plRenderRequestAck),
CLASS_INDEX(plNetMember),
CLASS_INDEX(plNetGameMember),
CLASS_INDEX(plNetTransportMember),
CLASS_INDEX(plConvexVolume),
CLASS_INDEX(plParticleGenerator),
CLASS_INDEX(plSimpleParticleGenerator),
CLASS_INDEX(plParticleEmitter),
CLASS_INDEX(plAGChannel),
CLASS_INDEX(plMatrixChannel),
CLASS_INDEX(plMatrixTimeScale),
CLASS_INDEX(plMatrixBlend),
CLASS_INDEX(plMatrixControllerChannel),
CLASS_INDEX(plQuatPointCombine),
CLASS_INDEX(plPointChannel),
CLASS_INDEX(plPointConstant),
CLASS_INDEX(plPointBlend),
CLASS_INDEX(plQuatChannel),
CLASS_INDEX(plQuatConstant),
CLASS_INDEX(plQuatBlend),
CLASS_INDEX(plLinkToAgeMsg),
CLASS_INDEX(plPlayerPageMsg),
CLASS_INDEX(plCmdIfaceModMsg),
CLASS_INDEX(plNetServerMsgPlsUpdatePlayer),
CLASS_INDEX(plListenerMsg),
CLASS_INDEX(plAnimPath),
CLASS_INDEX(plClothingUpdateBCMsg),
CLASS_INDEX(plNotifyMsg),
CLASS_INDEX(plFakeOutMsg),
CLASS_INDEX(plCursorChangeMsg),
CLASS_INDEX(plNodeChangeMsg),
CLASS_INDEX(UNUSED_plAvEnableMsg),
CLASS_INDEX(plLinkCallbackMsg),
CLASS_INDEX(plTransitionMsg),
CLASS_INDEX(plConsoleMsg),
CLASS_INDEX(plVolumeIsect),
CLASS_INDEX(plSphereIsect),
CLASS_INDEX(plConeIsect),
CLASS_INDEX(plCylinderIsect),
CLASS_INDEX(plParallelIsect),
CLASS_INDEX(plConvexIsect),
CLASS_INDEX(plComplexIsect),
CLASS_INDEX(plUnionIsect),
CLASS_INDEX(plIntersectionIsect),
CLASS_INDEX(plModulator),
CLASS_INDEX(UNUSED___plInventoryMsg),
CLASS_INDEX(plLinkEffectsTriggerMsg),
CLASS_INDEX(plLinkEffectBCMsg),
CLASS_INDEX(plResponderEnableMsg),
CLASS_INDEX(plNetServerMsgHello),
CLASS_INDEX(plNetServerMsgHelloReply),
CLASS_INDEX(plNetServerMember),
CLASS_INDEX(plResponderMsg),
CLASS_INDEX(plOneShotMsg),
CLASS_INDEX(plVaultAgeInfoListNode),
CLASS_INDEX(plNetServerMsgServerRegistered),
CLASS_INDEX(plPointTimeScale),
CLASS_INDEX(plPointControllerChannel),
CLASS_INDEX(plQuatTimeScale),
CLASS_INDEX(plAGApplicator),
CLASS_INDEX(plMatrixChannelApplicator),
CLASS_INDEX(plPointChannelApplicator),
CLASS_INDEX(plLightDiffuseApplicator),
CLASS_INDEX(plLightAmbientApplicator),
CLASS_INDEX(plLightSpecularApplicator),
CLASS_INDEX(plOmniApplicator),
CLASS_INDEX(plQuatChannelApplicator),
CLASS_INDEX(plScalarChannel),
CLASS_INDEX(plScalarTimeScale),
CLASS_INDEX(plScalarBlend),
CLASS_INDEX(plScalarControllerChannel),
CLASS_INDEX(plScalarChannelApplicator),
CLASS_INDEX(plSpotInnerApplicator),
CLASS_INDEX(plSpotOuterApplicator),
CLASS_INDEX(plNetServerMsgPlsRoutableMsg),
CLASS_INDEX(_UNUSED_plPuppetBrainMsg),
CLASS_INDEX(plATCEaseCurve),
CLASS_INDEX(plConstAccelEaseCurve),
CLASS_INDEX(plSplineEaseCurve),
CLASS_INDEX(plVaultAgeInfoInitializationTask),
CLASS_INDEX(pfGameGUIMsg),
CLASS_INDEX(plNetServerMsgVaultRequestGameState),
CLASS_INDEX(plNetServerMsgVaultGameState),
CLASS_INDEX(plNetServerMsgVaultGameStateSave),
CLASS_INDEX(plNetServerMsgVaultGameStateSaved),
CLASS_INDEX(plNetServerMsgVaultGameStateLoad),
CLASS_INDEX(plNetClientTask),
CLASS_INDEX(plNetMsgSDLStateBCast),
CLASS_INDEX(plReplaceGeometryMsg),
CLASS_INDEX(plNetServerMsgExitProcess),
CLASS_INDEX(plNetServerMsgSaveGameState),
CLASS_INDEX(plDniCoordinateInfo),
CLASS_INDEX(plNetMsgGameMessageDirected),
CLASS_INDEX(plLinkOutUnloadMsg),
CLASS_INDEX(plScalarConstant),
CLASS_INDEX(plMatrixConstant),
CLASS_INDEX(plAGCmdMsg),
CLASS_INDEX(plParticleTransferMsg),
CLASS_INDEX(plParticleKillMsg),
CLASS_INDEX(plExcludeRegionMsg),
CLASS_INDEX(plOneTimeParticleGenerator),
CLASS_INDEX(plParticleApplicator),
CLASS_INDEX(plParticleLifeMinApplicator),
CLASS_INDEX(plParticleLifeMaxApplicator),
CLASS_INDEX(plParticlePPSApplicator),
CLASS_INDEX(plParticleAngleApplicator),
CLASS_INDEX(plParticleVelMinApplicator),
CLASS_INDEX(plParticleVelMaxApplicator),
CLASS_INDEX(plParticleScaleMinApplicator),
CLASS_INDEX(plParticleScaleMaxApplicator),
CLASS_INDEX(plDynamicTextMsg),
CLASS_INDEX(plCameraTargetFadeMsg),
CLASS_INDEX(plAgeLoadedMsg),
CLASS_INDEX(plPointControllerCacheChannel),
CLASS_INDEX(plScalarControllerCacheChannel),
CLASS_INDEX(plLinkEffectsTriggerPrepMsg),
CLASS_INDEX(plLinkEffectPrepBCMsg),
CLASS_INDEX(plAvatarInputStateMsg),
CLASS_INDEX(plAgeInfoStruct),
CLASS_INDEX(plSDLNotificationMsg),
CLASS_INDEX(plNetClientConnectAgeVaultTask),
CLASS_INDEX(plLinkingMgrMsg),
CLASS_INDEX(plVaultNotifyMsg),
CLASS_INDEX(plPlayerInfo),
CLASS_INDEX(plSwapSpansRefMsg),
CLASS_INDEX(pfKI),
CLASS_INDEX(plDISpansMsg),
CLASS_INDEX(plNetMsgCreatableHelper),
CLASS_INDEX(plCreatableUuid),
CLASS_INDEX(plNetMsgRequestMyVaultPlayerList),
CLASS_INDEX(plDelayedTransformMsg),
CLASS_INDEX(plSuperVNodeMgrInitTask),
CLASS_INDEX(plElementRefMsg),
CLASS_INDEX(plClothingMsg),
CLASS_INDEX(plEventGroupEnableMsg),
CLASS_INDEX(pfGUINotifyMsg),
CLASS_INDEX(UNUSED_plAvBrain),
CLASS_INDEX(plArmatureBrain),
CLASS_INDEX(plAvBrainHuman),
CLASS_INDEX(plAvBrainCritter),
CLASS_INDEX(plAvBrainDrive),
CLASS_INDEX(plAvBrainSample),
CLASS_INDEX(plAvBrainGeneric),
CLASS_INDEX(plPreloaderMsg),
CLASS_INDEX(plAvBrainLadder),
CLASS_INDEX(plInputIfaceMgrMsg),
CLASS_INDEX(pfKIMsg),
CLASS_INDEX(plRemoteAvatarInfoMsg),
CLASS_INDEX(plMatrixDelayedCorrectionApplicator),
CLASS_INDEX(plAvPushBrainMsg),
CLASS_INDEX(plAvPopBrainMsg),
CLASS_INDEX(plRoomLoadNotifyMsg),
CLASS_INDEX(plAvTask),
CLASS_INDEX(plAvAnimTask),
CLASS_INDEX(plAvSeekTask),
CLASS_INDEX(plNetCommAuthConnectedMsg),
CLASS_INDEX(plAvOneShotTask),
CLASS_INDEX(UNUSED_plAvEnableTask),
CLASS_INDEX(plAvTaskBrain),
CLASS_INDEX(plAnimStage),
CLASS_INDEX(plNetClientMember),
CLASS_INDEX(plNetClientCommTask),
CLASS_INDEX(plNetServerMsgAuthRequest),
CLASS_INDEX(plNetServerMsgAuthReply),
CLASS_INDEX(plNetClientCommAuthTask),
CLASS_INDEX(plClientGuid),
CLASS_INDEX(plNetMsgVaultPlayerList),
CLASS_INDEX(plNetMsgSetMyActivePlayer),
CLASS_INDEX(plNetServerMsgRequestAccountPlayerList),
CLASS_INDEX(plNetServerMsgAccountPlayerList),
CLASS_INDEX(plNetMsgPlayerCreated),
CLASS_INDEX(plNetServerMsgVaultCreatePlayer),
CLASS_INDEX(plNetServerMsgVaultPlayerCreated),
CLASS_INDEX(plNetMsgFindAge),
CLASS_INDEX(plNetMsgFindAgeReply),
CLASS_INDEX(plNetClientConnectPrepTask),
CLASS_INDEX(plNetClientAuthTask),
CLASS_INDEX(plNetClientGetPlayerVaultTask),
CLASS_INDEX(plNetClientSetActivePlayerTask),
CLASS_INDEX(plNetClientFindAgeTask),
CLASS_INDEX(plNetClientLeaveTask),
CLASS_INDEX(plNetClientJoinTask),
CLASS_INDEX(plNetClientCalibrateTask),
CLASS_INDEX(plNetMsgDeletePlayer),
CLASS_INDEX(plNetServerMsgVaultDeletePlayer),
CLASS_INDEX(plNetCoreStatsSummary),
CLASS_INDEX(plCreatableGenericValue),
CLASS_INDEX(plCreatableListHelper),
CLASS_INDEX(plCreatableStream),
CLASS_INDEX(plAvBrainGenericMsg),
CLASS_INDEX(plAvTaskSeek),
CLASS_INDEX(plAGInstanceCallbackMsg),
CLASS_INDEX(plArmatureEffectMsg),
CLASS_INDEX(plArmatureEffectStateMsg),
CLASS_INDEX(plShadowCastMsg),
CLASS_INDEX(plBoundsIsect),
CLASS_INDEX(plResMgrHelperMsg),
CLASS_INDEX(plNetCommAuthMsg),
CLASS_INDEX(plNetCommFileListMsg),
CLASS_INDEX(plNetCommFileDownloadMsg),
CLASS_INDEX(plNetCommLinkToAgeMsg),
CLASS_INDEX(plNetCommPlayerListMsg),
CLASS_INDEX(plNetCommActivePlayerMsg),
CLASS_INDEX(plNetCommCreatePlayerMsg),
CLASS_INDEX(plNetCommDeletePlayerMsg),
CLASS_INDEX(plNetCommPublicAgeListMsg),
CLASS_INDEX(plNetCommPublicAgeMsg),
CLASS_INDEX(plNetCommRegisterAgeMsg),
CLASS_INDEX(plVaultAdminInitializationTask),
CLASS_INDEX(plMultistageModMsg),
CLASS_INDEX(plSoundVolumeApplicator),
CLASS_INDEX(plCutter),
CLASS_INDEX(plBulletMsg),
CLASS_INDEX(plDynaDecalEnableMsg),
CLASS_INDEX(plOmniCutoffApplicator),
CLASS_INDEX(plArmatureUpdateMsg),
CLASS_INDEX(plAvatarFootMsg),
CLASS_INDEX(plNetOwnershipMsg),
CLASS_INDEX(plNetMsgRelevanceRegions),
CLASS_INDEX(plParticleFlockMsg),
CLASS_INDEX(plAvatarBehaviorNotifyMsg),
CLASS_INDEX(plATCChannel),
CLASS_INDEX(plScalarSDLChannel),
CLASS_INDEX(plLoadAvatarMsg),
CLASS_INDEX(plAvatarSetTypeMsg),
CLASS_INDEX(plNetMsgLoadClone),
CLASS_INDEX(plNetMsgPlayerPage),
CLASS_INDEX(plVNodeInitTask),
CLASS_INDEX(plRippleShapeMsg),
CLASS_INDEX(plEventManager),
CLASS_INDEX(plVaultNeighborhoodInitializationTask),
CLASS_INDEX(plNetServerMsgAgentRecoveryRequest),
CLASS_INDEX(plNetServerMsgFrontendRecoveryRequest),
CLASS_INDEX(plNetServerMsgBackendRecoveryRequest),
CLASS_INDEX(plNetServerMsgAgentRecoveryData),
CLASS_INDEX(plNetServerMsgFrontendRecoveryData),
CLASS_INDEX(plNetServerMsgBackendRecoveryData),
CLASS_INDEX(plSubWorldMsg),
CLASS_INDEX(plMatrixDifferenceApp),
CLASS_INDEX(plAvatarSpawnNotifyMsg),
// ** NOTE **: DO NOT INSERT CLASS_INDEXES HERE. Ignore all this junk
// and continue adding them at the bottom of the enum. - EAp
// -- Reserve a block of class indexes for auto-generated server database structs --
CLASS_INDEX_DATABASE_STRUCT_INDEXES_START
CLASS_INDEX_DATABASE_STRUCT_INDEXES_END
CLASS_INDEX(plVaultGameServerInitializationTask),
CLASS_INDEX(plNetClientFindDefaultAgeTask),
CLASS_INDEX(plVaultAgeNode),
CLASS_INDEX(plVaultAgeInitializationTask),
CLASS_INDEX(plSetListenerMsg),
CLASS_INDEX(plVaultSystemNode),
CLASS_INDEX(plAvBrainSwim),
CLASS_INDEX(plNetMsgVault),
CLASS_INDEX(plNetServerMsgVault),
CLASS_INDEX(plVaultTask), // =1066
CLASS_INDEX(plVaultConnectTask),
CLASS_INDEX(plVaultNegotiateManifestTask),
CLASS_INDEX(plVaultFetchNodesTask),
CLASS_INDEX(plVaultSaveNodeTask),
CLASS_INDEX(plVaultFindNodeTask),
CLASS_INDEX(plVaultAddNodeRefTask),
CLASS_INDEX(plVaultRemoveNodeRefTask),
CLASS_INDEX(plVaultSendNodeTask),
CLASS_INDEX(plVaultNotifyOperationCallbackTask),
CLASS_INDEX(plVNodeMgrInitializationTask),
CLASS_INDEX(plVaultPlayerInitializationTask),
CLASS_INDEX(plNetVaultServerInitializationTask),
CLASS_INDEX(plCommonNeighborhoodsInitTask),
CLASS_INDEX(plVaultNodeRef),
CLASS_INDEX(plVaultNode),
CLASS_INDEX(plVaultFolderNode),
CLASS_INDEX(plVaultImageNode),
CLASS_INDEX(plVaultTextNoteNode),
CLASS_INDEX(plVaultSDLNode),
CLASS_INDEX(plVaultAgeLinkNode),
CLASS_INDEX(plVaultChronicleNode),
CLASS_INDEX(plVaultPlayerInfoNode),
CLASS_INDEX(plVaultMgrNode),
CLASS_INDEX(plVaultPlayerNode),
CLASS_INDEX(plSynchEnableMsg),
CLASS_INDEX(plNetVaultServerNode),
CLASS_INDEX(plVaultAdminNode),
CLASS_INDEX(plVaultGameServerNode),
CLASS_INDEX(plVaultPlayerInfoListNode),
CLASS_INDEX(plAvatarStealthModeMsg),
CLASS_INDEX(plEventCallbackInterceptMsg),
CLASS_INDEX(plDynamicEnvMapMsg),
CLASS_INDEX(plClimbMsg),
CLASS_INDEX(plIfaceFadeAvatarMsg),
CLASS_INDEX(plAvBrainClimb),
CLASS_INDEX(plSharedMeshBCMsg),
CLASS_INDEX(plNetVoiceListMsg),
CLASS_INDEX(plSwimMsg),
CLASS_INDEX(plMorphDelta),
CLASS_INDEX(plMatrixControllerCacheChannel),
CLASS_INDEX(plVaultMarkerNode),
CLASS_INDEX(pfMarkerMsg),
CLASS_INDEX(plPipeResMakeMsg),
CLASS_INDEX(plPipeRTMakeMsg),
CLASS_INDEX(plPipeGeoMakeMsg),
CLASS_INDEX(plAvCoopMsg),
CLASS_INDEX(plAvBrainCoop),
CLASS_INDEX(plSimSuppressMsg),
CLASS_INDEX(plVaultMarkerListNode),
CLASS_INDEX(UNUSED_plAvTaskOrient),
CLASS_INDEX(plAgeBeginLoadingMsg),
CLASS_INDEX(plSetNetGroupIDMsg),
CLASS_INDEX(pfBackdoorMsg),
CLASS_INDEX(plAIMsg),
CLASS_INDEX(plAIBrainCreatedMsg),
CLASS_INDEX(plStateDataRecord),
CLASS_INDEX(plNetClientCommDeletePlayerTask),
CLASS_INDEX(plNetMsgSetTimeout),
CLASS_INDEX(plNetMsgActivePlayerSet),
CLASS_INDEX(plNetClientCommSetTimeoutTask),
CLASS_INDEX(plNetRoutableMsgOmnibus),
CLASS_INDEX(plNetMsgGetPublicAgeList),
CLASS_INDEX(plNetMsgPublicAgeList),
CLASS_INDEX(plNetMsgCreatePublicAge),
CLASS_INDEX(plNetMsgPublicAgeCreated),
CLASS_INDEX(plNetServerMsgEnvelope),
CLASS_INDEX(plNetClientCommGetPublicAgeListTask),
CLASS_INDEX(plNetClientCommCreatePublicAgeTask),
CLASS_INDEX(plNetServerMsgPendingMsgs),
CLASS_INDEX(plNetServerMsgRequestPendingMsgs),
CLASS_INDEX(plDbInterface),
CLASS_INDEX(plDbProxyInterface),
CLASS_INDEX(plDBGenericSQLDB),
CLASS_INDEX(pfGameMgrMsg),
CLASS_INDEX(pfGameCliMsg),
CLASS_INDEX(pfGameCli),
CLASS_INDEX(pfGmTicTacToe),
CLASS_INDEX(pfGmHeek),
CLASS_INDEX(pfGmMarker),
CLASS_INDEX(pfGmBlueSpiral),
CLASS_INDEX(pfGmClimbingWall),
CLASS_INDEX(plAIArrivedAtGoalMsg),
CLASS_INDEX(pfGmVarSync),
CLASS_INDEX(plNetMsgRemovePublicAge),
CLASS_INDEX(plNetMsgPublicAgeRemoved),
CLASS_INDEX(plNetClientCommRemovePublicAgeTask),
CLASS_INDEX(plCCRMessage),
CLASS_INDEX(plAvOneShotLinkTask),
CLASS_INDEX(plNetAuthDatabase),
CLASS_INDEX(plAvatarOpacityCallbackMsg),
CLASS_INDEX(plAGDetachCallbackMsg),
CLASS_INDEX(pfMovieEventMsg),
CLASS_INDEX(plMovieMsg),
CLASS_INDEX(plPipeTexMakeMsg),
CLASS_INDEX(plEventLog),
CLASS_INDEX(plDbEventLog),
CLASS_INDEX(plSyslogEventLog),
CLASS_INDEX(plCaptureRenderMsg),
CLASS_INDEX(plAgeLoaded2Msg),
CLASS_INDEX(plPseudoLinkEffectMsg),
CLASS_INDEX(plPseudoLinkAnimTriggerMsg),
CLASS_INDEX(plPseudoLinkAnimCallbackMsg),
CLASS_INDEX(__UNUSED__pfClimbingWallMsg),
CLASS_INDEX(plClimbEventMsg),
CLASS_INDEX(__UNUSED__plAvBrainQuab),
CLASS_INDEX(plAccountUpdateMsg),
CLASS_INDEX(plLinearVelocityMsg),
CLASS_INDEX(plAngularVelocityMsg),
CLASS_INDEX(plRideAnimatedPhysMsg),
CLASS_INDEX(plAvBrainRideAnimatedPhysical),
CLASS_INDEX_LIST_END
#endif // plCreatableIndex_inc

View File

@ -0,0 +1,94 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
//////////////////////////////////////////////////////////////////////////////
//
// plCreatableStrings.h - Handy header file that declares a class with two
// static public string arrays representing the names
// of the classes before and after keyedObjDelineator
// in plCreatableIndex.h. Note the cunning (and humble)
// use of macros to avoid having to change this file
// whenever plCreatableIndex.h changes.
//
// Should only be included once, probably in plFactory.cpp
//
//////////////////////////////////////////////////////////////////////////////
#ifndef _plCreatableStrings_h
#define _plCreatableStrings_h
// Step 0: Undefine plCreatableIndex_inc, since we're doing something sneaky with it
#undef plCreatableIndex_inc
// Step 1: Define plCreator_inc, so the plCreator.h include in plCI.h won't do anything
#define plCreator_inc
// Step 2: Define the CLASS_INDEX macros so we generate our class. The class name
// is plCreatableStrings and the arrays are fKeyedStrings and fNonKeyedStrings
#undef CLASS_INDEX_LIST_START
#undef CLASS_INDEX
#undef CLASS_INDEX_NONKEYED_OBJ_START
#undef CLASS_INDEX_LIST_END
#define CLASS_INDEX_LIST_START class plCreatableStrings { public:\
static char *fKeyedStrings[]; static char *fNonKeyedStrings[]; static char *fNonKeyedPostDBStrings[];\
}; \
char *plCreatableStrings::fKeyedStrings[] = {
#define CLASS_INDEX(ci) #ci
#define CLASS_INDEX_NONKEYED_OBJ_START }; char *plCreatableStrings::fNonKeyedStrings[] = {
#define CLASS_INDEX_LIST_END };
#undef CLASS_INDEX_DATABASE_STRUCT_INDEXES_START
#undef CLASS_INDEX_DATABASE_STRUCT_INDEXES_END
#define CLASS_INDEX_DATABASE_STRUCT_INDEXES_START
#define CLASS_INDEX_DATABASE_STRUCT_INDEXES_END }; char *plCreatableStrings::fNonKeyedPostDBStrings[] = {
// Step 3: Include plCI.h
#include "plCreatableIndex.h"
#endif // _plCreatableStrings_h

View File

@ -0,0 +1,202 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plDrawable_inc
#define plDrawable_inc
#include "../pnKeyedObject/hsKeyedObject.h"
#include "plLoadMask.h"
#include "hsTemplates.h"
#include "plRenderLevel.h"
class plSpaceTree;
class hsStream;
class hsResMgr;
struct hsMatrix44;
class hsBounds3Ext;
class plPipeline;
class plGeometrySpan;
class hsGMaterial;
class plParticleEmitter;
class plAccessSpan;
class plDrawableCriteria
{
public:
plDrawableCriteria(UInt32 crit, const plRenderLevel& lev, const plLoadMask& m, UInt32 ty=1 /* Normal */ ) : fCriteria(crit), fLevel(lev), fType(ty), fLoadMask(m) {}
UInt32 fCriteria;
plRenderLevel fLevel;
UInt32 fType;
plLoadMask fLoadMask;
};
class plDrawable : public hsKeyedObject
{
public:
enum {
// Renumber these the next time we bump major version #s (no reason to do it now)
kPropNoDraw = 0x01,
kPropUNUSED = 0x02,
kPropSortSpans = 0x04,
kPropSortFaces = 0x08,
kPropVolatile = 0x10, // Means that spans DEFAULT to kPropVolatile, but if this
// is not set, spans can still be volatile
kPropNoReSort = 0x20, // Don't do sorting of spans for optimization.
kPropPartialSort = 0x40, // Sort spans on an individual basis.
kPropCharacter = 0x80, // Lights want to know if this is in the general class of "characters"
kPropSortAsOne = 0x100,
kPropHasVisLOS = 0x200
};
// Criteria for drawables. Used when searching through a sceneNode for a particular drawable
enum
{
kCritStatic = 0x01,
kCritSortSpans = 0x02,
kCritSortFaces = 0x08,
kCritCharacter = 0x10
};
// Types of drawables for rendering filtering.
enum plDrawableType {
kNormal = 0x00000001,
kNonDrawable = 0x00000002, //e.g. a light, affects drawing, but isn't drawn.
kEnviron = 0x00000004,
// Proxies in the upper 16 bits.
kLightProxy = 0x00010000,
kOccluderProxy = 0x00020000,
kAudibleProxy = 0x00040000,
kPhysicalProxy = 0x00080000,
kCoordinateProxy = 0x00100000,
kOccSnapProxy = 0x00200000,
kGenericProxy = 0x00400000,
kCameraProxy = 0x00800000,
kAllProxies = 0x00ff0000,
kAllTypes = 0xffffffff
};
enum plSubDrawableType {
kSubNormal = 0x00000001,
kSubNonDrawable = 0x00000002,
kSubEnviron = 0x00000004,
kSubAllTypes = 0xffffffff
};
enum plAccessFlags {
kReadSrc = 0x1,
kWriteDst = 0x2,
kWriteSrc = 0x4
};
enum MsgTypes
{
kMsgMaterial,
kMsgDISpans, // UNUSED
kMsgFogEnviron,
kMsgPermaLight,
kMsgPermaProj,
kMsgPermaLightDI,
kMsgPermaProjDI
};
CLASSNAME_REGISTER( plDrawable );
GETINTERFACE_ANY( plDrawable, hsKeyedObject );
virtual plDrawable& SetProperty( int prop, hsBool on ) = 0;
virtual hsBool GetProperty( int prop ) const = 0;
virtual plDrawable& SetProperty( UInt32 index, int prop, hsBool on ) = 0;
virtual hsBool GetProperty( UInt32 index, int prop ) const = 0;
virtual plDrawable& SetNativeProperty( int prop, hsBool on ) = 0;
virtual hsBool GetNativeProperty( int prop ) const = 0;
virtual plDrawable& SetNativeProperty( UInt32 index, int prop, hsBool on ) = 0;
virtual hsBool GetNativeProperty( UInt32 index, int prop ) const = 0;
virtual plDrawable& SetSubType( UInt32 index, plSubDrawableType t, hsBool on ) = 0;
virtual UInt32 GetSubType( UInt32 index ) const = 0; // returns or of all spans with this index (index==-1 is all spans).
virtual UInt32 GetType( void ) const = 0;
virtual void SetType( UInt32 type ) = 0;
virtual void SetRenderLevel(const plRenderLevel& l) = 0;
virtual const plRenderLevel& GetRenderLevel() const = 0;
virtual plDrawable& SetTransform( UInt32 index, const hsMatrix44& l2w, const hsMatrix44& w2l ) = 0;
virtual const hsMatrix44& GetLocalToWorld( UInt32 span = (UInt32)-1 ) const = 0;
virtual const hsMatrix44& GetWorldToLocal( UInt32 span = (UInt32)-1 ) const = 0;
virtual const hsBounds3Ext& GetLocalBounds( UInt32 index = (UInt32)-1 ) const = 0;
virtual const hsBounds3Ext& GetWorldBounds( UInt32 index = (UInt32)-1 ) const = 0;
virtual const hsBounds3Ext& GetMaxWorldBounds( UInt32 index = (UInt32)-1 ) const = 0;
virtual plSpaceTree* GetSpaceTree() const = 0;
virtual void SetDISpanVisSet(UInt32 diIndex, hsKeyedObject* reg, hsBool on) = 0;
// Taking span index. DI Index doesn't make sense here, because one object's DI can dereference into many materials etc.
virtual hsGMaterial* GetSubMaterial(int index) const = 0;
virtual hsBool GetSubVisDists(int index, hsScalar& minDist, hsScalar& maxDist) const = 0; // return true if span invisible before minDist and/or after maxDist
// Should implement hsKeyedObject Read/Write/Save/Load as well
// These two should only be called by the SceneNode
virtual void SetSceneNode(plKey node) = 0;
virtual plKey GetSceneNode() const = 0;
/// Funky particle system functions
virtual UInt32 CreateParticleSystem( UInt32 maxNumEmitters, UInt32 maxNumParticles, hsGMaterial *material ) = 0;
virtual void ResetParticleSystem( UInt32 index ) = 0;
virtual void AssignEmitterToParticleSystem( UInt32 index, plParticleEmitter *emitter ) = 0;
/// EXPORT-ONLY
// Called by the sceneNode to determine if we match the criteria
virtual hsBool DoIMatch( const plDrawableCriteria& crit ) = 0;
// Take the list of triMeshes and convert them to buffers, building a list of spans for each
virtual void Optimize( void ) = 0;
};
#endif // plDrawable_inc

View File

@ -0,0 +1,41 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/

View File

@ -0,0 +1,132 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plPhysical_inc
#define plPhysical_inc
#include "../pnNetCommon/plSynchedObject.h"
#include "hsTemplates.h"
struct hsMatrix44;
struct hsPoint3;
struct hsVector3;
class hsQuat;
class plPhysicalSndGroup;
class plDrawableSpans;
class hsGMaterial;
// Primary interface object for physics functionality. A physical corresponds to
// a single rigid body in a simulation. (Note that there can be multiple
// simulations.) The plPhysical is reached through the simulation interface on a
// plSceneObject
//
// Any function that ends with 'Sim' gets or sets a simulation space value. If
// the physical is in the main world, this will be the same as a global value,
// but if it's in a subworld, it will be relative to that.
class plPhysical : public plSynchedObject
{
public:
CLASSNAME_REGISTER(plPhysical);
GETINTERFACE_ANY(plPhysical, plSynchedObject);
virtual plPhysical& SetProperty(int prop, hsBool b) = 0;
virtual hsBool GetProperty(int prop) const = 0;
virtual void SetObjectKey(plKey oKey) = 0;
virtual plKey GetObjectKey() const = 0;
// These two should only be called by the SceneNode
virtual void SetSceneNode(plKey node) = 0;
virtual plKey GetSceneNode() const = 0;
virtual hsBool GetLinearVelocitySim(hsVector3& vel) const = 0;
virtual void SetLinearVelocitySim(const hsVector3& vel) = 0;
virtual void ClearLinearVelocity() = 0;
virtual hsBool GetAngularVelocitySim(hsVector3& vel) const = 0;
virtual void SetAngularVelocitySim(const hsVector3& vel) = 0;
virtual void SetHitForce(const hsVector3& force, const hsPoint3& pos)=0;
/** Standard plasma transform interface, in global coordinates by convention.
If you send in the same matrix that the physical last sent out in its correction message,
it will be ignored as an "echo" -- UNLESS you set force to true, in which case the transform
will be applied regardless.
Set force to true if you don't want the transform to be ignored for any reason. Without it,
this will ignore the incoming transform if it's the same one it sent out last time. */
virtual void SetTransform(const hsMatrix44& l2w, const hsMatrix44& w2l, hsBool force=false) = 0;
virtual void GetTransform(hsMatrix44& l2w, hsMatrix44& w2l) = 0;
// From plSimDefs::Group
virtual int GetGroup() const = 0;
// Flags in plSimDefs::plLOSDB
virtual void AddLOSDB(UInt16 flag) = 0;
virtual void RemoveLOSDB(UInt16 flag) = 0;
virtual UInt16 GetAllLOSDBs() = 0;
virtual hsBool IsInLOSDB(UInt16 flag) = 0;
// Return the key of our subworld. May be a nil key.
virtual plKey GetWorldKey() const = 0;
virtual plPhysicalSndGroup* GetSoundGroup() const = 0;
virtual void GetPositionSim(hsPoint3& pos) const = 0;
/** Send the current simulation location to the coordinate interface.
If the simulation is a subworld, this will also factor in the subworld's
transform. The sent transform is global. "isSynchUpdate" tells us if this
is an update due to receiving remote state.*/
virtual void SendNewLocation(hsBool synchTransform = false, hsBool isSynchUpdate = false) = 0;
// For the physics SDL only. For Set, any of the values may be set to nil, if
// they're not used.
virtual void GetSyncState(hsPoint3& pos, hsQuat& rot, hsVector3& linV, hsVector3& angV) = 0;
virtual void SetSyncState(hsPoint3* pos, hsQuat* rot, hsVector3* linV, hsVector3* angV) = 0;
virtual hsScalar GetMass() = 0;
// I wish I could think of a better way to do this, but this is how it's
// going to be for now.
virtual void ExcludeRegionHack(hsBool cleared) = 0;
virtual plDrawableSpans* CreateProxy(hsGMaterial* mat, hsTArray<UInt32>& idx, plDrawableSpans* addTo) = 0;
};
#endif // plPhysical_inc

View File

@ -0,0 +1,69 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plPipeResReq_inc
#define plPipeResReq_inc
//#define PIPERES_VERBOSE
#ifdef PIPERES_VERBOSE
#define PIPELOG(a) hsStatusMessage(a)
#else // PIPERES_VERBOSE
#define PIPELOG(a)
#endif // PIPERES_VERBOSE
class plPipeResReq
{
protected:
hsBool fReq;
plPipeResReq() : fReq(false) {}
static plPipeResReq& Instance();
public:
static void Request() { PIPELOG("Request"); Instance().fReq = true; }
static hsBool Check() { PIPELOG("Check"); return Instance().fReq; }
static void Clear() { PIPELOG("Clear"); Instance().fReq = false; }
};
#endif // plPipeResReq_inc

View File

@ -0,0 +1,362 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plPipeline_inc
#define plPipeline_inc
#include "../pnFactory/plCreatable.h"
#include "hsGMatState.h"
#include "hsTemplates.h"
#include "hsStlUtils.h"
#define MIN_WIDTH 640
#define MIN_HEIGHT 480
#define DEFAULT_WIDTH 800
#define DEFAULT_HEIGHT 600
#define DEFAULT_WINDOWED false
#define DEFAULT_COLORDEPTH 32
#define DEFAULT_ANTIALIASAMOUNT 0
#define DEFAULT_ANISOLEVEL 0
#define DEFAULT_TEXTUREQUALITY 2
#define DEFAULT_VIDEOQUALITY 2
#define DEFAULT_SHADOWS 0
#define DEFAULT_PLANARREFLECTIONS 0
struct hsPoint3;
struct hsVector3;
struct hsMatrix44;
struct hsColorRGBA;
class hsBounds3Ext;
class hsGMaterial;
class plDrawPrim;
class plRenderTarget;
class hsG3DDevice;
class hsGView3;
class plDrawable;
class plGBufferGroup;
class plLayerInterface;
class plSpaceTree;
class plCullPoly;
class plRenderRequest;
class plShadowSlave;
class plAccessSpan;
class plTextFont;
class plVertexSpan;
class plDrawableSpans;
class plSceneObject;
class plClothingOutfit;
class hsGDeviceRef;
class plFogEnvironment;
class plLightInfo;
class plMipmap;
class plVisMgr;
class plViewTransform;
struct PipelineParams
{
PipelineParams():
Width(DEFAULT_WIDTH),
Height(DEFAULT_HEIGHT),
Windowed(DEFAULT_WINDOWED),
ColorDepth(DEFAULT_COLORDEPTH),
AntiAliasingAmount(DEFAULT_ANTIALIASAMOUNT),
AnisotropicLevel(DEFAULT_ANISOLEVEL),
TextureQuality(DEFAULT_TEXTUREQUALITY),
VideoQuality(DEFAULT_VIDEOQUALITY),
Shadows(DEFAULT_SHADOWS),
PlanarReflections(DEFAULT_PLANARREFLECTIONS),
#ifndef PLASMA_EXTERNAL_RELEASE
ForceSecondMonitor(false),
#endif // PLASMA_EXTERNAL_RELEASE
VSync(false)
{
}
int Width;
int Height;
hsBool Windowed;
int ColorDepth;
int AntiAliasingAmount;
int AnisotropicLevel;
int TextureQuality;
int VideoQuality;
int Shadows;
int PlanarReflections;
hsBool VSync;
#ifndef PLASMA_EXTERNAL_RELEASE
hsBool ForceSecondMonitor;
#endif // PLASMA_EXTERNAL_RELEASE
};
class plDisplayMode
{
public:
int Width;
int Height;
int ColorDepth;
};
class plPipeline : public plCreatable
{
public:
CLASSNAME_REGISTER( plPipeline );
GETINTERFACE_ANY( plPipeline, plCreatable );
// Typical 3D device
//
// PreRender - fill out the visList with which spans from drawable will be drawn.
// visList is write only. On output, visList is UNSORTED visible spans.
// Called once per scene render (maybe multiple times per frame).
// Returns true if rendering should proceed.
virtual hsBool PreRender(plDrawable* drawable, hsTArray<Int16>& visList, plVisMgr* visMgr=nil) = 0;
// PrepForRender - perform any processing on the drawable data nessecary before rendering.
// visList is read only. On input, visList is SORTED visible spans, and is ALL spans which will be drawn this render.
// Called once per scene render.
// Returns true if rendering should proceed.
virtual hsBool PrepForRender(plDrawable* drawable, hsTArray<Int16>& visList, plVisMgr* visMgr=nil) = 0;
// Render - draw the drawable to the current render target.
// visList is read only. On input, visList is SORTED visible spans. May not be the complete list of visible spans
// for this drawable.
// Called multiple times per scene render e.g.:
// Render(drawable0, visList0) // visList0 contains furthest spans in drawable0
// Render(drawable1, visList1) // visList1 contains spans from drawable1 between drawable0's visList0 and visList2
// Render(drawable0, visList2) // visList2 contains closest spans in drawable0.
virtual void Render(plDrawable* d, const hsTArray<Int16>& visList) = 0;
// Draw - Convenience wrapper for standalone renders. Calls PreRender, PrepForRender, Render. Currently for internal
// use only, but may prove useful for procedurals (render to texture).
virtual void Draw(plDrawable* d) = 0;
// Device-specific ref creation. Includes buffers and fonts
virtual plTextFont *MakeTextFont( char *face, UInt16 size ) = 0;
// Create and/or Refresh geometry buffers
virtual void CheckVertexBufferRef(plGBufferGroup* owner, UInt32 idx) = 0;
virtual void CheckIndexBufferRef(plGBufferGroup* owner, UInt32 idx) = 0;
virtual hsBool OpenAccess(plAccessSpan& dst, plDrawableSpans* d, const plVertexSpan* span, hsBool readOnly) = 0;
virtual hsBool CloseAccess(plAccessSpan& acc) = 0;
virtual void CheckTextureRef(plLayerInterface* lay) = 0;
// Default fog settings
virtual void SetDefaultFogEnviron( plFogEnvironment *fog ) = 0;
virtual const plFogEnvironment &GetDefaultFogEnviron( void ) const = 0;
virtual void RegisterLight(plLightInfo* light) = 0;
virtual void UnRegisterLight(plLightInfo* light) = 0;
enum RenderTargetFlags
{
kRTMainScreen = 0x0000,
kRTOffscreen = 0x0001,
kRTTexture = 0x0002,
kRTPerspProjected = 0x0004,
kRTOrthoProjected = 0x0008,
kRTProjected = kRTPerspProjected | kRTOrthoProjected
};
enum RenderStateSettings
{
kRenderNormal = 0x0,
kRenderProjection = 0x1,
kRenderShadow = 0x2,
kRenderBaseLayerOnly = 0x4,
kRenderNoPiggyBacks = 0x8,
kRenderClearColor = 0x10,
kRenderClearDepth = 0x20,
kRenderOrthogonal = 0x40,
kRenderNoProjection = 0x80,
kRenderNoLights = 0x100,
kRenderShadowErase = 0x200
};
virtual void PushRenderRequest(plRenderRequest* req) = 0;
virtual void PopRenderRequest(plRenderRequest* req) = 0;
virtual void ClearRenderTarget( plDrawable* d ) = 0; // nil d reverts to ClearRenderTarget(nil, nil).
virtual void ClearRenderTarget(const hsColorRGBA* col = nil, const hsScalar* depth = nil) = 0; // col/depth are overrides for current default.
virtual void SetClear(const hsColorRGBA* col=nil, const hsScalar* depth=nil) = 0; // sets the default clear for current render target.
virtual hsColorRGBA GetClearColor() const = 0;
virtual hsScalar GetClearDepth() const = 0;
virtual hsGDeviceRef *MakeRenderTargetRef( plRenderTarget *owner ) = 0;
virtual void PushRenderTarget( plRenderTarget *target ) = 0;
virtual plRenderTarget *PopRenderTarget( void ) = 0;
virtual hsBool BeginRender() = 0;
virtual hsBool EndRender() = 0;
virtual void RenderScreenElements( void ) = 0;
virtual hsBool BeginDrawable(plDrawable* d) = 0;
virtual hsBool EndDrawable(plDrawable* d) = 0;
virtual void BeginVisMgr(plVisMgr* visMgr) = 0;
virtual void EndVisMgr(plVisMgr* visMgr) = 0;
virtual hsBool IsFullScreen() const = 0;
virtual UInt32 Width() const = 0;
virtual UInt32 Height() const = 0;
virtual UInt32 ColorDepth() const = 0;
virtual void Resize( UInt32 width, UInt32 height ) = 0;
// Culling. Might be used in Update before bothering to do any serious computation.
virtual hsBool TestVisibleWorld(const hsBounds3Ext& wBnd) = 0;
virtual hsBool TestVisibleWorld(const plSceneObject* sObj) = 0;
virtual hsBool HarvestVisible(plSpaceTree* space, hsTArray<Int16>& visList) = 0;
virtual hsBool SubmitOccluders(const hsTArray<const plCullPoly*>& polyList) = 0;
virtual void SetDebugFlag( UInt32 flag, hsBool on ) = 0;
virtual hsBool IsDebugFlagSet( UInt32 flag ) const = 0;
virtual void SetMaxCullNodes(UInt16 n) = 0; // Debug/analysis only
virtual UInt16 GetMaxCullNodes() const = 0; // Debug/analysis only
// Properties
enum Properties
{
kPropDontDeleteTextures = 0x00000001 // Keeps the pipeline from deleting textures on
// MakeTextureRef, regardless of the kUserOwnsBitmap flag
};
virtual hsBool CheckResources() = 0; // Do we need to call LoadResources?
virtual void LoadResources() = 0;
virtual void SetProperty( UInt32 prop, hsBool on ) = 0;
virtual hsBool GetProperty( UInt32 prop ) const = 0;
virtual UInt32 GetMaxLayersAtOnce() const = 0;
// Drawable type mask
virtual void SetDrawableTypeMask( UInt32 mask ) = 0;
virtual UInt32 GetDrawableTypeMask( void ) const = 0;
virtual void SetSubDrawableTypeMask( UInt32 mask ) = 0;
virtual UInt32 GetSubDrawableTypeMask( void ) const = 0;
// View state
virtual hsPoint3 GetViewPositionWorld() const = 0;
virtual hsVector3 GetViewAcrossWorld() const = 0;
virtual hsVector3 GetViewUpWorld() const = 0;
virtual hsVector3 GetViewDirWorld() const = 0;
virtual void GetViewAxesWorld(hsVector3 axes[3] /* ac,up,at */ ) const = 0;
virtual void GetFOV(hsScalar& fovX, hsScalar& fovY) const = 0;
virtual void SetFOV(hsScalar fovX, hsScalar fovY) = 0;
virtual void GetSize(hsScalar& width, hsScalar& height) const = 0;
virtual void SetSize(hsScalar width, hsScalar height) = 0;
virtual void GetDepth(hsScalar& hither, hsScalar& yon) const = 0;
virtual void SetDepth(hsScalar hither, hsScalar yon) = 0;
virtual void SetZBiasScale( hsScalar scale ) = 0;
virtual hsScalar GetZBiasScale( void ) const = 0;
virtual const hsMatrix44& GetWorldToCamera() const = 0;
virtual const hsMatrix44& GetCameraToWorld() const = 0;
virtual void SetWorldToCamera(const hsMatrix44& w2c, const hsMatrix44& c2w) = 0;
virtual const hsMatrix44& GetWorldToLocal() const = 0;
virtual const hsMatrix44& GetLocalToWorld() const = 0;
virtual const plViewTransform& GetViewTransform() const = 0;
virtual void ScreenToWorldPoint( int n, UInt32 stride, Int32 *scrX, Int32 *scrY,
hsScalar dist, UInt32 strideOut, hsPoint3 *worldOut ) = 0;
virtual void RefreshMatrices( void ) = 0;
virtual void RefreshScreenMatrices( void ) = 0;
// Overrides, always push returns whatever is necessary to restore on pop.
virtual hsGMaterial* PushOverrideMaterial(hsGMaterial* mat) = 0;
virtual void PopOverrideMaterial(hsGMaterial* restore) = 0;
virtual hsGMaterial* GetOverrideMaterial() const = 0;
virtual plLayerInterface* AppendLayerInterface(plLayerInterface* li, hsBool onAllLayers = false) = 0;
virtual plLayerInterface* RemoveLayerInterface(plLayerInterface* li, hsBool onAllLayers = false) = 0;
virtual UInt32 GetMaterialOverrideOn(hsGMatState::StateIdx category) const = 0;
virtual UInt32 GetMaterialOverrideOff(hsGMatState::StateIdx category) const = 0;
virtual hsGMatState PushMaterialOverride(const hsGMatState& state, hsBool on) = 0;
virtual hsGMatState PushMaterialOverride(hsGMatState::StateIdx cat, UInt32 which, hsBool on) = 0;
virtual void PopMaterialOverride(const hsGMatState& restore, hsBool on) = 0;
virtual const hsGMatState& GetMaterialOverride(hsBool on) const = 0;
virtual hsColorOverride PushColorOverride(const hsColorOverride& over) = 0;
virtual void PopColorOverride(const hsColorOverride& restore) = 0;
virtual const hsColorOverride& GetColorOverride() const = 0;
virtual void SubmitShadowSlave(plShadowSlave* slave) = 0;
virtual void SubmitClothingOutfit(plClothingOutfit* co) = 0;
// These all return true if the gamma was successfully set.
virtual hsBool SetGamma(hsScalar eR, hsScalar eG, hsScalar eB) = 0;
virtual hsBool SetGamma(const UInt16* const tabR, const UInt16* const tabG, const UInt16* const tabB) = 0; // len table = 256.
virtual hsBool SetGamma(hsScalar e) { return SetGamma(e, e, e); }
virtual hsBool SetGamma(const UInt16* const table) { return SetGamma(table, table, table); }
// flipVertical is for the AVI writer, which wants it's frames upside down
virtual hsBool CaptureScreen( plMipmap *dest, bool flipVertical = false, UInt16 desiredWidth = 0, UInt16 desiredHeight = 0 ) = 0;
// Returns an un-named (GetKey()==nil) mipmap same dimensions as targ. You are responsible for deleting said mipMap.
virtual plMipmap* ExtractMipMap(plRenderTarget* targ) = 0;
/// Error handling
virtual const char *GetErrorString( void ) = 0;
// info about current rendering device
virtual void GetSupportedDisplayModes(std::vector<plDisplayMode> *res, int ColorDepth = 32 ) = 0;
virtual int GetMaxAnisotropicSamples() = 0;
virtual int GetMaxAntiAlias(int Width, int Height, int ColorDepth) = 0;
int GetDesktopWidth() { return fDesktopParams.Width; }
int GetDesktopHeight() { return fDesktopParams.Height; }
int GetDesktopColorDepth() { return fDesktopParams.ColorDepth; }
PipelineParams *GetDefaultParams() { return &fDefaultPipeParams; }
virtual void ResetDisplayDevice(int Width, int Height, int ColorDepth, hsBool Windowed, int NumAASamples, int MaxAnisotropicSamples, hsBool vSync = false ) = 0;
static PipelineParams fDefaultPipeParams;
static PipelineParams fInitialPipeParams;
plDisplayMode fDesktopParams;
};
#endif // plPipeline_inc

View File

@ -0,0 +1,252 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plProfile_h_inc
#define plProfile_h_inc
#include "hsTypes.h"
#ifndef PLASMA_EXTERNAL_RELEASE
#define PL_PROFILE_ENABLED
#endif
//
// These macros are all you should need to use to profile your code. They are
// compiled out in external release mode for maximum performance.
//
// plProfile_Create* should only be used at global scope, not in functions.
// Use plProfile_Extern if the plProfile_Create* for a variable is in another source file.
//
// --Examples--
//
// plProfile_CreateCounter("Num Foobars", "Test", NumFoobars);
// void SomeFunc1()
// {
// plProfile_Inc(NumFoobars);
// plProfile_IncCount(NumFoobars, 5);
// }
//
// plProfile_CreateTimer("Foobar Time", "Test", FoobarTime);
// void SomeFunc2()
// {
// plProfile_BeginTiming(FoobarTime);
// (execute some code...)
// plProfile_EndTiming(FoobarTime);
//
// plProfile_BeginLap(FoobarTime, pKeyedObj->GetKeyName());
// pKeyedObj->DoStuff();
// plProfile_EndLap(FoobarTime, pKeyedObj->GetKeyName());
// }
//
#ifdef PL_PROFILE_ENABLED
#define plProfile_CreateTimerNoReset(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayTime | plProfileVar::kDisplayNoReset)
#define plProfile_CreateTimer(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayTime)
#define plProfile_CreateAsynchTimer(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayTime | plProfileVar::kDisplayResetEveryBegin | plProfileVar::kDisplayNoReset)
#define plProfile_BeginTiming(varName) gProfileVar##varName.BeginTiming()
#define plProfile_EndTiming(varName) gProfileVar##varName.EndTiming()
#define plProfile_BeginLap(varName, lapName) gProfileVar##varName.BeginLap(lapName)
#define plProfile_EndLap(varName, lapName) gProfileVar##varName.EndLap(lapName)
#define plProfile_CreateCounter(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayCount)
#define plProfile_CreateCounterNoReset(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayCount | plProfileVar::kDisplayNoReset)
#define plProfile_Inc(varName) gProfileVar##varName.Inc()
#define plProfile_IncCount(varName, count) gProfileVar##varName.Inc(count)
#define plProfile_Dec(varName) gProfileVar##varName.Dec()
#define plProfile_Set(varName, value) gProfileVar##varName.Set(value)
#define plProfile_CreateMemCounter(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayMem | plProfileVar::kDisplayNoReset)
#define plProfile_CreateMemCounterReset(name, group, varName) plProfileVar gProfileVar##varName(name, group, plProfileVar::kDisplayMem)
#define plProfile_NewMem(varName, memAmount) gProfileVar##varName.NewMem(memAmount)
#define plProfile_DelMem(varName, memAmount) gProfileVar##varName.DelMem(memAmount)
#define plProfile_StopVar(varName) gProfileVar##varName.Stop()
#define plProfile_StartVar(varName) gProfileVar##varName.Start()
#define plProfile_Extern(varName) extern plProfileVar gProfileVar##varName
#else
#define plProfile_CreateTimerNoReset(name, group, varName)
#define plProfile_CreateTimer(name, group, varName)
#define plProfile_CreateAsynchTimer(name, group, varName)
#define plProfile_BeginTiming(varName)
#define plProfile_EndTiming(varName)
#define plProfile_BeginLap(varName, lapName)
#define plProfile_EndLap(varName, lapName)
#define plProfile_CreateCounter(name, group, varName)
#define plProfile_CreateCounterNoReset(name, group, varName)
#define plProfile_Inc(varName)
#define plProfile_IncCount(varName, count)
#define plProfile_Dec(varName)
#define plProfile_Set(varName, value)
#define plProfile_CreateMemCounter(name, group, varName)
#define plProfile_CreateMemCounterReset(name, group, varName)
#define plProfile_NewMem(varName, memAmount)
#define plProfile_DelMem(varName, memAmount)
#define plProfile_StopVar(varName)
#define plProfile_StartVar(varName)
#define plProfile_Extern(varName)
#endif
class plProfileLaps;
class plProfileBase
{
public:
enum
{
kDisplayCount = 0x1,
kDisplayTime = 0x2,
kDisplayMem = 0x4,
kDisplayNoReset = 0x8,
kDisplayFPS = 0x10,
kDisplayLaps = 0x20,
kDisplaySelected = 0x40,
kDisplayResetEveryBegin = 0x80
};
protected:
const char* fName; // Name of timer
UInt32 fValue;
UInt32 fAvgCount;
UInt64 fAvgTotal;
UInt32 fLastAvg;
UInt32 fMax;
hsBool fActive;
hsBool fRunning;
UInt8 fDisplayFlags;
// Number of times EndTiming was called. Can be used to combine timing and counting in one timer
UInt32 fTimerSamples;
void IAddAvg();
void IPrintValue(UInt32 value, char* buf, hsBool printType);
public:
plProfileBase();
virtual ~plProfileBase();
virtual void BeginFrame();
virtual void EndFrame();
void UpdateAvg();
UInt32 GetValue();
void PrintValue(char* buf, hsBool printType=true);
void PrintAvg(char* buf, hsBool printType=true);
void PrintMax(char* buf, hsBool printType=true);
UInt32 GetTimerSamples() const { return fTimerSamples; }
const char* GetName() { return fName; }
void SetActive(hsBool s) { fActive = s; }
void Stop() { fRunning = false; }
void Start() { fRunning = true; }
UInt8 GetDisplayFlags() const { return fDisplayFlags; }
void ResetMax() { fMax = 0; }
};
class plProfileVar : public plProfileBase
{
protected:
const char* fGroup;
plProfileLaps* fLaps;
hsBool fLapsActive;
plProfileVar() {}
void IBeginTiming();
void IEndTiming();
void IBeginLap(const char* lapName);
void IEndLap(const char* lapName);
public:
// Name is the timer name. Each timer group gets its own plStatusLog
plProfileVar(const char *name, const char* group, UInt8 flags);
~plProfileVar();
// For timing
void BeginTiming() { if (fActive && fRunning) IBeginTiming(); }
void EndTiming() { if (fActive && fRunning) IEndTiming(); }
void NewMem(UInt32 memAmount) { fValue += memAmount; }
void DelMem(UInt32 memAmount) { fValue -= memAmount; }
// For Counting
void Inc(int i = 1) { fValue += i;}
void Dec(int i = 1) { fValue -= i;}
void Set(UInt32 value) { fValue = value; }
//
// For multiple timings per frame of the same thing ie. Each particle system
//
// Will output to log like
// Timername : lapCnt: (lapName) : 3.22 msec
//
void BeginLap(const char* lapName) { if(fActive && fRunning) IBeginLap(lapName); }
void EndLap(const char* lapName) { if(fActive && fRunning) IEndLap(lapName); }
const char* GetGroup() { return fGroup; }
plProfileLaps* GetLaps() { return fLaps; }
// Enable Lap Sampling
void SetLapsActive(hsBool s) { fLapsActive = s; }
};
#endif // plProfile_h_inc

View File

@ -0,0 +1,535 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "plProfileManager.h"
#include "plProfile.h"
#include "hsTimer.h"
#include "hsUtils.h"
static UInt32 gCyclesPerMS = 0;
#ifdef HS_BUILD_FOR_WIN32
#define USE_FAST_TIMER
#endif
#ifdef USE_FAST_TIMER
#pragma warning (push)
#pragma warning (disable : 4035) // disable no return value warning
__forceinline UInt32 GetPentiumCounter()
{
__asm
{
xor eax,eax // VC won't realize that eax is modified w/out this
// instruction to modify the val.
// Problem shows up in release mode builds
_emit 0x0F // Pentium high-freq counter to edx;eax
_emit 0x31 // only care about low 32 bits in eax
xor edx,edx // so VC gets that edx is modified
}
}
#pragma warning (pop)
#include "hsWindows.h"
static UInt32 GetProcSpeed()
{
const char* keypath[] =
{
"HARDWARE",
"DESCRIPTION",
"System",
"CentralProcessor",
"0"
};
HKEY hKey = HKEY_LOCAL_MACHINE;
int numKeys = sizeof(keypath) / sizeof(char*);
for (int i = 0; i < numKeys; i++)
{
HKEY thisKey = NULL;
hsBool success = (RegOpenKeyEx(hKey, keypath[i], 0, KEY_READ, &thisKey) == ERROR_SUCCESS);
RegCloseKey(hKey);
hKey = thisKey;
if (!success)
return 0;
}
DWORD value=0, size=sizeof(DWORD);
hsBool success = (RegQueryValueEx(hKey, "~MHz", 0, NULL, (BYTE*)&value, &size) == ERROR_SUCCESS);
RegCloseKey(hKey);
return value*1000000;
}
UInt32 GetProcSpeedAlt()
{
const UInt32 kSamplePeriodMS = 250;
// Raise priority to avoid interference from other threads.
int priority = GetThreadPriority(GetCurrentThread());
SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_TIME_CRITICAL);
UInt32 startTicks, endTicks;
UInt64 pcStart, pcEnd;
// Count number of processor cycles inside the specified interval
QueryPerformanceCounter((LARGE_INTEGER*)&pcStart);
startTicks = plProfileManager::GetTime();
Sleep(kSamplePeriodMS);
endTicks = plProfileManager::GetTime();
QueryPerformanceCounter((LARGE_INTEGER*)&pcEnd);
// Restore thread priority.
SetThreadPriority(GetCurrentThread(), priority);
// Calculate Rdtsc/PerformanceCounter ratio;
UInt32 numTicks = endTicks - startTicks;
UInt64 pcDiff = pcEnd - pcStart;
double ratio = double(numTicks) / double(pcDiff);
UInt64 pcFreq;
QueryPerformanceFrequency((LARGE_INTEGER*)&pcFreq);
// Calculate CPU frequency.
UInt64 cpuFreq = UInt64(pcFreq * ratio);
return (UInt32)cpuFreq;
}
#define GetProfileTicks() GetPentiumCounter()
#else
#define GetProfileTicks() hsTimer::GetPrecTickCount()
#endif // USE_FAST_TIMER
#define TicksToMSec(t) (float(t) / float(gCyclesPerMS))
#define MSecToTicks(t) (float(t) * float(gCyclesPerMS))
plProfileManager::plProfileManager() : fLastAvgTime(0), fProcessorSpeed(0)
{
#ifdef USE_FAST_TIMER
fProcessorSpeed = GetProcSpeed();
// Registry stuff only works on NT OS's, have to calc it otherwise
if (fProcessorSpeed == 0)
fProcessorSpeed = GetProcSpeedAlt();
gCyclesPerMS = fProcessorSpeed / 1000;
#else
gCyclesPerMS = hsTimer::GetPrecTicksPerSec() / 1000;
#endif
}
plProfileManager::~plProfileManager()
{
}
plProfileManager& plProfileManager::Instance()
{
static plProfileManager theInstance;
return theInstance;
}
void plProfileManager::AddTimer(plProfileVar* var)
{
fVars.push_back(var);
}
static UInt32 kAvgMilliseconds = 1000;
void plProfileManager::SetAvgTime(UInt32 avgMS)
{
kAvgMilliseconds = avgMS;
}
static plProfileVar gVarEFPS("EFPS", "General", plProfileVar::kDisplayTime | plProfileVar::kDisplayFPS);
void plProfileManager::BeginFrame()
{
for (int i = 0; i < fVars.size(); i++)
{
fVars[i]->BeginFrame();
if (fVars[i]->GetLaps())
fVars[i]->GetLaps()->BeginFrame();
}
gVarEFPS.BeginTiming();
}
void plProfileManager::EndFrame()
{
gVarEFPS.EndTiming();
hsBool updateAvgs = false;
// If enough time has passed, update the averages
double curTime = hsTimer::GetMilliSeconds();
if (curTime - fLastAvgTime > kAvgMilliseconds)
{
fLastAvgTime = curTime;
updateAvgs = true;
}
int i;
//
// Update all the variables
//
for (i = 0; i < fVars.size(); i++)
{
plProfileVar* var = fVars[i];
if (updateAvgs)
{
// Timers that reset at every BeginTiming() call don't want to average over frames
if (!hsCheckBits(var->GetDisplayFlags(), plProfileBase::kDisplayResetEveryBegin))
{
var->UpdateAvg();
if (var->GetLaps())
var->GetLaps()->UpdateAvgs();
}
}
var->EndFrame();
if (var->GetLaps())
var->GetLaps()->EndFrame();
}
}
UInt32 plProfileManager::GetTime()
{
return GetProfileTicks();
}
///////////////////////////////////////////////////////////////////////////////
plProfileBase::plProfileBase() :
fName(nil),
fDisplayFlags(0),
fValue(0),
fTimerSamples(0),
fAvgCount(0),
fAvgTotal(0),
fLastAvg(0),
fMax(0),
fActive(false),
fRunning(true)
{
}
plProfileBase::~plProfileBase()
{
}
void plProfileBase::BeginFrame()
{
if (!hsCheckBits(fDisplayFlags, kDisplayNoReset))
fValue = 0;
fTimerSamples = 0;
}
void plProfileBase::EndFrame()
{
fAvgCount++;
fAvgTotal += fValue;
fMax = hsMaximum(fMax, fValue);
}
void plProfileBase::UpdateAvg()
{
if (fAvgCount > 0)
{
fLastAvg = (UInt32)(fAvgTotal / fAvgCount);
fAvgCount = 0;
fAvgTotal = 0;
}
}
UInt32 plProfileBase::GetValue()
{
if (hsCheckBits(fDisplayFlags, kDisplayTime))
return (UInt32)TicksToMSec(fValue);
else
return fValue;
}
// Stolen from plMemTracker.cpp
static const char *insertCommas(unsigned int value)
{
static char str[30];
memset(str, 0, sizeof(str));
sprintf(str, "%u", value);
if (strlen(str) > 3)
{
memmove(&str[strlen(str)-3], &str[strlen(str)-4], 4);
str[strlen(str) - 4] = ',';
}
if (strlen(str) > 7)
{
memmove(&str[strlen(str)-7], &str[strlen(str)-8], 8);
str[strlen(str) - 8] = ',';
}
if (strlen(str) > 11)
{
memmove(&str[strlen(str)-11], &str[strlen(str)-12], 12);
str[strlen(str) - 12] = ',';
}
return str;
}
void plProfileBase::IPrintValue(UInt32 value, char* buf, hsBool printType)
{
if (hsCheckBits(fDisplayFlags, kDisplayCount))
{
if (printType)
{
const char* valueStr = insertCommas(value);
strcpy(buf, valueStr);
}
else
sprintf(buf, "%u", value);
}
else if (hsCheckBits(fDisplayFlags, kDisplayFPS))
{
sprintf(buf, "%.1f", 1000.0f / TicksToMSec(value));
}
else if (hsCheckBits(fDisplayFlags, kDisplayTime))
{
sprintf(buf, "%.1f", TicksToMSec(value));
if (printType)
strcat(buf, " ms");
}
else if (hsCheckBits(fDisplayFlags, kDisplayMem))
{
if (printType)
{
if (value > (1024*1000))
sprintf(buf, "%.1f MB", float(value) / (1024.f * 1024.f));
else if (value > 1024)
sprintf(buf, "%d KB", value / 1024);
else
sprintf(buf, "%d b", value);
}
else
sprintf(buf, "%u", value);
}
}
void plProfileBase::PrintValue(char* buf, hsBool printType)
{
IPrintValue(fValue, buf, printType);
}
void plProfileBase::PrintAvg(char* buf, hsBool printType)
{
IPrintValue(fLastAvg, buf, printType);
}
void plProfileBase::PrintMax(char* buf, hsBool printType)
{
IPrintValue(fMax, buf, printType);
}
////////////////////////////////////////////////////////////////////////////////
plProfileLaps::LapInfo* plProfileLaps::IFindLap(const char* lapName)
{
static int lastSearch = 0;
int i;
for (i = lastSearch; i < fLapTimes.size(); i++)
{
if(fLapTimes[i].GetName() == lapName)
{
lastSearch = i;
return &fLapTimes[i];
}
}
if(lastSearch > fLapTimes.size()) lastSearch = fLapTimes.size();
for (i = 0; i < lastSearch; i++)
{
if(fLapTimes[i].GetName() == lapName)
{
lastSearch = i;
return &fLapTimes[i];
}
}
return nil;
}
void plProfileLaps::BeginLap(UInt32 curValue, const char* name)
{
LapInfo* lap = IFindLap(name);
if (!lap)
{
// Technically we shouldn't hold on to this pointer. However, I think
// it will be ok in all cases, so I'll wait until this blows up
LapInfo info(name);
fLapTimes.push_back(info);
lap = &(*(fLapTimes.end()-1));
}
lap->fUsedThisFrame = true;
lap->BeginTiming(curValue);
}
void plProfileLaps::EndLap(UInt32 curValue, const char* name)
{
LapInfo* lap = IFindLap(name);
// There's a lap timer around the input code. You display it with "Stats.ShowLaps Update Input"
// Since the command activates the timer INSIDE the lap, the first call to this function fails to
// find it. (the timer wasn't active when BeginLap was called)
if (lap)
lap->EndTiming(curValue);
}
void plProfileLaps::BeginFrame()
{
for (int i = 0; i < fLapTimes.size(); i++)
{
fLapTimes[i].BeginFrame();
fLapTimes[i].fUsedThisFrame = false;
}
}
void plProfileLaps::EndFrame()
{
for (int i = 0; i < fLapTimes.size(); i++)
{
fLapTimes[i].EndFrame();
if (!fLapTimes[i].fUsedThisFrame)
{
char buf[200];
sprintf(buf, "Dropping unused lap %s", fLapTimes[i].GetName());
hsStatusMessage(buf);
fLapTimes.erase(fLapTimes.begin()+i);
i--;
}
}
}
void plProfileLaps::UpdateAvgs()
{
for (int i = 0; i < fLapTimes.size(); i++)
fLapTimes[i].UpdateAvg();
}
int plProfileLaps::GetNumLaps()
{
// std::sort(fLapTimes.begin(), fLapTimes.end());
return fLapTimes.size();
}
plProfileBase* plProfileLaps::GetLap(int i)
{
return &fLapTimes[i];
}
///////////////////////////////////////////////////////////////////////////////
plProfileVar::plProfileVar(const char *name, const char* group, UInt8 flags) :
fGroup(group),
fLaps(nil)
{
fName = name;
fDisplayFlags = flags;
plProfileManager::Instance().AddTimer(this);
fLapsActive = 0;
}
plProfileVar::~plProfileVar()
{
delete fLaps;
}
void plProfileVar::IBeginLap(const char* lapName)
{
if (!fLaps)
fLaps = TRACKED_NEW plProfileLaps;
fDisplayFlags |= kDisplayLaps;
if(fLapsActive)
fLaps->BeginLap(fValue, lapName);
BeginTiming();
}
void plProfileVar::IEndLap(const char* lapName)
{
EndTiming();
if(fLapsActive)
fLaps->EndLap(fValue, lapName);
}
void plProfileVar::IBeginTiming()
{
if( hsCheckBits( fDisplayFlags, kDisplayResetEveryBegin ) )
fValue = 0;
fValue -= GetProfileTicks();
}
void plProfileVar::IEndTiming()
{
fValue += GetProfileTicks();
fTimerSamples++;
// If we reset every BeginTiming(), then we want to average all the timing calls
// independent of framerate
if (hsCheckBits(fDisplayFlags, plProfileBase::kDisplayResetEveryBegin))
UpdateAvg();
}

View File

@ -0,0 +1,112 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plProfileManager_h_inc
#define plProfileManager_h_inc
#include "hsTypes.h"
#include "hsStlUtils.h"
#include "plProfile.h"
class plProfileManager
{
protected:
friend class plProfileManagerFull;
typedef std::vector<plProfileVar*> VarVec;
VarVec fVars;
double fLastAvgTime;
UInt32 fProcessorSpeed;
plProfileManager();
public:
~plProfileManager();
static plProfileManager& Instance();
void AddTimer(plProfileVar* var); // Called by plProfileVar
void BeginFrame(); // Call begin frame on all timers
void EndFrame(); // Call end frame on all timers
void SetAvgTime(UInt32 avgMS);
UInt32 GetProcessorSpeed() { return fProcessorSpeed; }
// Backdoor for hack timers in calculated profiles
static UInt32 GetTime();
};
class plProfileLaps
{
protected:
class LapInfo : public plProfileBase
{
protected:
public:
bool fUsedThisFrame;
LapInfo(const char* name) { fName = name; fDisplayFlags = kDisplayTime; }
bool operator<(const LapInfo& rhs) const { return fLastAvg < rhs.fLastAvg; }
void BeginTiming(UInt32 value) { fValue -= value; }
void EndTiming(UInt32 value) { fValue += value; fTimerSamples++; }
};
std::vector<LapInfo> fLapTimes;
LapInfo* IFindLap(const char* lapName);
public:
void BeginLap(UInt32 curValue, const char* name);
void EndLap(UInt32 curValue, const char* name);
void BeginFrame();
void EndFrame();
void UpdateAvgs();
int GetNumLaps();
plProfileBase* GetLap(int i);
};
#endif // plProfileManager_h_inc

View File

@ -0,0 +1,53 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plRefFlags_inc
#define plRefFlags_inc
namespace plRefFlags
{
enum Type {
kActiveRef, // If one is resident, return it, else create and load one to return. Keep it loaded till I release.
kPassiveRef // Just notify me when it is loaded or unloaded until I release.
};
};
#endif // plRefFlags_inc

View File

@ -0,0 +1,83 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef plDispatchBase_inc
#define plDispatchBase_inc
#include "../pnFactory/plCreatable.h"
class plMessage;
class plKey;
class plDispatchBase : public plCreatable
{
public:
CLASSNAME_REGISTER( plDispatchBase );
GETINTERFACE_ANY( plDispatchBase, plCreatable );
virtual void RegisterForType(UInt16 hClass, const plKey& receiver) = 0;
virtual void RegisterForExactType(UInt16 hClass, const plKey& receiver) = 0;
virtual void UnRegisterForType(UInt16 hClass, const plKey& receiver) = 0;
virtual void UnRegisterForExactType(UInt16 hClass, const plKey& receiver) = 0;
virtual void UnRegisterAll(const plKey& receiver) = 0;
virtual hsBool MsgSend(plMessage* msg, hsBool async=false) = 0;
virtual void MsgQueue(plMessage* msg)=0; // Used by other thread to Send Messages, they are handled as soon as Practicable
virtual void MsgQueueProcess() = 0;
virtual void MsgQueueOnOff(hsBool) = 0; // Turn on or off Queued Messages, if off, uses MsgSend Immediately (for plugins)
virtual hsBool SetMsgBuffering(hsBool on) = 0; // On starts deferring msg delivery until buffering is set to off again.
virtual void BeginShutdown() = 0;
};
class plgDispatch
{
public:
static plDispatchBase* Dispatch();
static hsBool MsgSend(plMessage* msg, hsBool async = false) { return Dispatch()->MsgSend(msg, async); }
};

View File

@ -0,0 +1,49 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef pnAllCreatables_inc
#define pnAllCreatables_inc
#include "pnNucleusCreatables.h"
#include "../../Apps/plClient/plClientCreatable.h"
#endif // pnAllCreatables_inc

View File

@ -0,0 +1,72 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef pnNucleusCreatables_inc
#define pnNucleusCreatables_inc
#include "../pnFactory/plCreator.h"
#include "plPipeline.h"
REGISTER_NONCREATABLE( plPipeline );
#include "plAudible.h"
REGISTER_NONCREATABLE( plAudible );
#include "plDrawable.h"
REGISTER_NONCREATABLE( plDrawable );
#include "plPhysical.h"
REGISTER_NONCREATABLE( plPhysical );
#include "plgDispatch.h"
REGISTER_NONCREATABLE( plDispatchBase );
#include "../pnDispatch/pnDispatchCreatable.h"
#include "../pnKeyedObject/pnKeyedObjectCreatable.h"
#include "../pnMessage/pnMessageCreatable.h"
#include "../pnModifier/pnModifierCreatable.h"
#include "../pnNetCommon/pnNetCommonCreatable.h"
#include "../pnSceneObject/pnSceneObjectCreatable.h"
#include "../pnTimer/pnTimerCreatable.h"
#endif // pnNucleusCreatables_inc

View File

@ -0,0 +1,84 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#include "plgDispatch.h"
#include "hsResMgr.h"
#include "plPipeResReq.h"
hsResMgr* hsgResMgr::fResMgr = nil;
plDispatchBase* plgDispatch::Dispatch()
{
return hsgResMgr::Dispatch();
}
hsBool hsgResMgr::Init(hsResMgr* m)
{
hsRefCnt_SafeAssign(fResMgr, m);
hsRefCnt_SafeUnRef(m);
if (!m->IInit())
return false;
return true;
}
void hsgResMgr::Shutdown()
{
if (fResMgr)
{
if (fResMgr->RefCnt() <= 1)
{
fResMgr->IShutdown();
hsRefCnt_SafeUnRef(fResMgr);
fResMgr = nil;
}
else
{
hsRefCnt_SafeUnRef(fResMgr);
}
}
}
plPipeResReq& plPipeResReq::Instance()
{
static plPipeResReq r;
return r;
}