mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
fix relative includes in PubUtilLib, move them up to where they belong, remvoe some unused files
This commit is contained in:
@ -39,7 +39,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plgDispatch.h"
|
||||
|
||||
// other
|
||||
// #include "../pnMessage/plRefMsg.h"
|
||||
#include "plMessage/plAnimCmdMsg.h"
|
||||
#include "pnMessage/plSDLModifierMsg.h"
|
||||
#include "pnMessage/plSDLNotificationMsg.h"
|
||||
|
@ -70,6 +70,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plMessage/plClimbEventMsg.h"
|
||||
#include "pnNetCommon/plSDLTypes.h"
|
||||
|
||||
#include "plSDL/plSDL.h"
|
||||
#include "plAvatarSDLModifier.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// IMPLEMENTATION
|
||||
@ -769,8 +772,6 @@ hsBool plAvBrainClimb::IInitAnimations()
|
||||
// SDL-BASED PERSISTENCE
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
#include "../plSDL/plSDL.h"
|
||||
#include "plAvatarSDLModifier.h"
|
||||
|
||||
// SaveToSDL -----------------------------------------
|
||||
// ---------
|
||||
|
@ -36,6 +36,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
// other
|
||||
#include "plMessage/plAvatarMsg.h"
|
||||
#include "plMessage/plOneShotMsg.h"
|
||||
#include "plMessage/plOneShotCallbacks.h"
|
||||
|
||||
// CTOR()
|
||||
plOneShotMod::plOneShotMod()
|
||||
@ -91,9 +93,6 @@ plOneShotMod::~plOneShotMod()
|
||||
}
|
||||
|
||||
|
||||
#include "../plMessage/plOneShotMsg.h"
|
||||
#include "../plMessage/plOneShotCallbacks.h"
|
||||
|
||||
// MSGRECEIVE
|
||||
hsBool plOneShotMod::MsgReceive(plMessage* msg)
|
||||
{
|
||||
|
@ -83,6 +83,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plScene/plVisMgr.h"
|
||||
#include "plScene/plVisRegion.h"
|
||||
|
||||
#include "plStatusLog/plStatusLog.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
//// Local Konstants /////////////////////////////////////////////////////////
|
||||
@ -460,8 +462,6 @@ static inline hsMatrix44 IMatrixMul34(const hsMatrix44& lhs, const hsMatrix44& r
|
||||
return ret;
|
||||
}
|
||||
|
||||
#include "../plStatusLog/plStatusLog.h"
|
||||
|
||||
#ifdef MF_TEST_UPDATE
|
||||
plProfile_CreateCounter("DSSetTrans", "Update", DSSetTrans);
|
||||
plProfile_CreateCounter("DSMatSpans", "Update", DSMatSpans);
|
||||
|
@ -68,6 +68,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include "pnMessage/plPipeResMakeMsg.h"
|
||||
|
||||
#include "plGImage/plBumpMapGen.h"
|
||||
|
||||
// Stuff for creating a bumpenv decal on demand.
|
||||
#include "plGImage/plMipmap.h"
|
||||
#include "plSurface/plLayer.h"
|
||||
@ -1547,8 +1549,6 @@ hsBool plDynaDecalMgr::ICutoutTargets(double secs)
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "../plGImage/plBumpMapGen.h"
|
||||
|
||||
hsGMaterial* plDynaDecalMgr::IConvertToEnvMap(hsGMaterial* mat, plBitmap* envMap)
|
||||
{
|
||||
if( !mat || !envMap )
|
||||
|
@ -41,6 +41,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plScene/plSceneNode.h"
|
||||
#include "plScene/plPageTreeMgr.h"
|
||||
|
||||
|
||||
#include "plPipeline.h"
|
||||
#include "pnSceneObject/plSceneObject.h"
|
||||
|
||||
// Stuff for cursor los
|
||||
#include "plInputCore/plInputDevice.h"
|
||||
#include "plPipeline.h"
|
||||
@ -411,9 +415,6 @@ hsBool plVisLOSMgr::CursorCheck(plVisHit& hit)
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "plPipeline.h"
|
||||
#include "../pnSceneObject/plSceneObject.h"
|
||||
|
||||
static plSceneObject* marker = nil;
|
||||
static plPipeline* pipe = nil;
|
||||
|
||||
|
@ -32,6 +32,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "pnKeyedObject/plKey.h"
|
||||
#include "pnSceneObject/plSceneObject.h"
|
||||
|
||||
#include "plMessage/plOneShotCallbacks.h"
|
||||
|
||||
#ifndef SERVER
|
||||
#include "plAvatar/plAvBrain.h"
|
||||
#endif
|
||||
@ -331,8 +333,6 @@ void plAvTaskSeekDoneMsg::Write(hsStream *stream, hsResMgr *mgr)
|
||||
//
|
||||
/////////////////
|
||||
|
||||
#include "../plMessage/plOneShotCallbacks.h"
|
||||
|
||||
// CTOR()
|
||||
plAvOneShotMsg::plAvOneShotMsg()
|
||||
: plAvSeekMsg(), fAnimName(nil), fDrivable(false), fReversible(false), fCallbacks(nil)
|
||||
|
@ -31,7 +31,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plNetCommon/plNetServerSessionInfo.h"
|
||||
#include "plNetCommon/plNetCommon.h"
|
||||
#include "hsBitVector.h"
|
||||
|
||||
#include "pnNetCommon/plNetApp.h"
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
@ -203,7 +203,6 @@ enum LinkEffectsFlags
|
||||
kLinkEffectsLinkInAnimKey,
|
||||
};
|
||||
|
||||
#include "../pnNetCommon/plNetApp.h"
|
||||
void plLinkEffectsTriggerMsg::ReadVersion(hsStream* s, hsResMgr* mgr)
|
||||
{
|
||||
plMessage::IMsgReadVersion(s, mgr);
|
||||
|
@ -32,6 +32,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "pnMessage/plEnableMsg.h"
|
||||
#include "pnMessage/plEventCallbackMsg.h"
|
||||
|
||||
#include "pnNetCommon/plNetApp.h"
|
||||
#include "pnMessage/plNotifyMsg.h"
|
||||
|
||||
plAnimEventModifier::plAnimEventModifier() : fCallback(nil), fDisabled(false)
|
||||
{
|
||||
}
|
||||
@ -105,9 +108,6 @@ hsBool plAnimEventModifier::MsgReceive(plMessage* msg)
|
||||
return plSingleModifier::MsgReceive(msg);
|
||||
}
|
||||
|
||||
#include "../pnNetCommon/plNetApp.h"
|
||||
#include "../pnMessage/plNotifyMsg.h"
|
||||
|
||||
void plAnimEventModifier::ISendNotify(bool triggered)
|
||||
{
|
||||
if (fDisabled)
|
||||
|
@ -61,7 +61,6 @@ void plAnimTimeConvertSDLModifier::IPutATC(plStateDataRecord* atcStateDataRec, p
|
||||
//
|
||||
// Apply state in SDL record to current animation state
|
||||
//
|
||||
//#include "../pnSceneObject/plSceneObject.h"
|
||||
void plAnimTimeConvertSDLModifier::ISetCurrentATC(const plStateDataRecord* atcStateDataRec, plAnimTimeConvert* objAtc)
|
||||
{
|
||||
// if ( GetTarget(0)->GetKeyName() && stricmp( GetTarget(0)->GetKeyName(), "RTDirLight01" )==0 )
|
||||
|
@ -35,6 +35,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plgDispatch.h"
|
||||
#include "pnMessage/plWarpMsg.h"
|
||||
#include "pnMessage/plNodeRefMsg.h"
|
||||
#include "plMessage/plLoadCloneMsg.h"
|
||||
|
||||
plCloneSpawnModifier::plCloneSpawnModifier() : fTemplateName(nil), fExportTime(false)
|
||||
{
|
||||
@ -80,7 +81,6 @@ void plCloneSpawnModifier::SetTarget(plSceneObject* so)
|
||||
}
|
||||
}
|
||||
|
||||
#include "../plMessage/plLoadCloneMsg.h"
|
||||
|
||||
plKey plCloneSpawnModifier::SpawnClone(const char* cloneName, const char* cloneAge, const hsMatrix44& pos, plKey requestor)
|
||||
{
|
||||
|
@ -59,6 +59,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plAvatar/plArmatureMod.h"
|
||||
#include "plAvatar/plAvatarMgr.h"
|
||||
|
||||
#include "plPipeline/plDebugText.h"
|
||||
|
||||
|
||||
//#ifdef HS_DEBUGGING
|
||||
#define STATUS_LOG
|
||||
@ -699,7 +701,6 @@ void plResponderModifier::Write(hsStream* stream, hsResMgr* mgr)
|
||||
stream->WriteByte(fFlags);
|
||||
}
|
||||
|
||||
#include "../plPipeline/plDebugText.h"
|
||||
|
||||
bool plResponderModifier::fDebugAnimBox = false;
|
||||
|
||||
|
@ -1,103 +0,0 @@
|
||||
/*==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/>.
|
||||
|
||||
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 "plTagModifier.h"
|
||||
|
||||
#include "hsResMgr.h"
|
||||
#include "../pnMessage/plRemoteAvatarInfoMsg.h"
|
||||
#include "../plMessage/plAvatarMsg.h"
|
||||
//#include "../pfMessage/plClothingMsg.h"
|
||||
#include "../plMessage/plCollideMsg.h"
|
||||
#include "../plMessage/plSimInfluenceMsg.h"
|
||||
|
||||
#include "../plStatusLog/plStatusLog.h"
|
||||
|
||||
static plStatusLog* gLog = nil;
|
||||
|
||||
plTagModifier::plTagModifier()
|
||||
{
|
||||
if (!gLog)
|
||||
gLog = plStatusLogMgr::GetInstance().CreateStatusLog(15, "Tag", plStatusLog::kFilledBackground | plStatusLog::kDeleteForMe | plStatusLog::kDontWriteFile | plStatusLog::kAlignToTop);
|
||||
}
|
||||
|
||||
plTagModifier::~plTagModifier()
|
||||
{
|
||||
}
|
||||
|
||||
hsBool plTagModifier::MsgReceive(plMessage* msg)
|
||||
{
|
||||
plCollideMsg* collideMsg = plCollideMsg::ConvertNoRef(msg);
|
||||
if (collideMsg)
|
||||
{
|
||||
gLog->AddLineF("Kicked by %s", collideMsg->fOtherKey->GetName());
|
||||
return true;
|
||||
}
|
||||
|
||||
plRemoteAvatarInfoMsg* avInfoMsg = plRemoteAvatarInfoMsg::ConvertNoRef(msg);
|
||||
if (avInfoMsg)
|
||||
{
|
||||
// TODO
|
||||
// Check if the local av is frozen
|
||||
// plKey localAvKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey();
|
||||
|
||||
// Freeze clicked av
|
||||
plKey clickedAvKey = avInfoMsg->GetAvatarKey();
|
||||
if (clickedAvKey)
|
||||
{
|
||||
static hsBool tempHack = true;
|
||||
tempHack = !tempHack;
|
||||
|
||||
plAvEnableMsg* avEnableMsg = new plAvEnableMsg(GetKey(), clickedAvKey, tempHack);
|
||||
avEnableMsg->SetBCastFlag(plMessage::kNetPropagate | plMessage::kPropagateToModifiers);
|
||||
avEnableMsg->Send();
|
||||
|
||||
gLog->AddLineF("Tagged %s", clickedAvKey->GetName());
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return plSingleModifier::MsgReceive(msg);
|
||||
}
|
||||
|
||||
void plTagModifier::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plSingleModifier::Read(stream, mgr);
|
||||
}
|
||||
|
||||
void plTagModifier::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plSingleModifier::Write(stream, mgr);
|
||||
}
|
||||
|
||||
#include "plgDispatch.h"
|
||||
|
||||
void plTagModifier::SetTarget(plSceneObject* so)
|
||||
{
|
||||
if (so)
|
||||
plgDispatch::Dispatch()->RegisterForExactType(plRemoteAvatarInfoMsg::Index(), GetKey());
|
||||
else
|
||||
plgDispatch::Dispatch()->UnRegisterForExactType(plRemoteAvatarInfoMsg::Index(), GetKey());
|
||||
}
|
@ -1,51 +0,0 @@
|
||||
/*==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/>.
|
||||
|
||||
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 plTagModifier_inc
|
||||
#define plTagModifier_inc
|
||||
|
||||
#include "../pnModifier/plSingleModifier.h"
|
||||
|
||||
class plTagModifier : public plSingleModifier
|
||||
{
|
||||
protected:
|
||||
virtual hsBool IEval(double secs, hsScalar del, UInt32 dirty) { return true; }
|
||||
|
||||
public:
|
||||
plTagModifier();
|
||||
virtual ~plTagModifier();
|
||||
|
||||
CLASSNAME_REGISTER(plTagModifier);
|
||||
GETINTERFACE_ANY(plTagModifier, plSingleModifier);
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
virtual void Read(hsStream* stream, hsResMgr* mgr);
|
||||
virtual void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
virtual void SetTarget(plSceneObject* so);
|
||||
};
|
||||
|
||||
#endif // plTagModifier_inc
|
@ -1,164 +0,0 @@
|
||||
/*==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/>.
|
||||
|
||||
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 "plNetClientMgr.h"
|
||||
#include "plNetClientVNodeMgr.h"
|
||||
#include "../plNetMessage/plNetMessage.h"
|
||||
#include "../plGImage/plMipmap.h"
|
||||
#include "../plJPEG/plJPEG.h"
|
||||
#include "../plVault/plVault.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "../pnMessage/plRefMsg.h"
|
||||
#include "../plVault/plDniCoordinateInfo.h"
|
||||
#include "../plVault/plAgeInfoSource.h"
|
||||
#include "plNetLinkingMgr.h"
|
||||
#include "../plStatusLog/plStatusLog.h"
|
||||
#include "../plClientState/plClientStateMgr.h"
|
||||
#include "../plSDL/plSDL.h"
|
||||
#include "../plAgeLoader/plAgeLoader.h"
|
||||
|
||||
#include "../../FeatureLib/pfMessage/pfKIMsg.h"
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
class plNetClientAgeInfoSource : public plAgeInfoSource
|
||||
{
|
||||
plDniCoordinateInfo fNilCoords; // TEMPORARY
|
||||
public:
|
||||
const plDniCoordinateInfo * GetAgeCoords( void ) const
|
||||
{
|
||||
return &fNilCoords; // tmp
|
||||
}
|
||||
const plUnifiedTime * GetAgeTime( void ) const
|
||||
{
|
||||
static plUnifiedTime ut;
|
||||
ut.SetSecsDouble(plNetClientMgr::GetInstance()->GetCurrentAgeElapsedSeconds());
|
||||
return &ut;
|
||||
}
|
||||
const char * GetAgeName( void ) const
|
||||
{
|
||||
return plNetLinkingMgr::GetInstance()->GetAgeLink()->GetAgeInfo()->GetAgeInstanceName();
|
||||
}
|
||||
const plUUID * GetAgeGuid( void ) const
|
||||
{
|
||||
return plNetLinkingMgr::GetInstance()->GetAgeLink()->GetAgeInfo()->GetAgeInstanceGuid();
|
||||
}
|
||||
static plNetClientAgeInfoSource * GetInstance( void )
|
||||
{
|
||||
static plNetClientAgeInfoSource Me;
|
||||
return &Me;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//// Image/Mipmap Conversion //////////////////////////////////////////////////
|
||||
|
||||
hsBool StuffImageIntoNode( plMipmap * src, RelVaultNode * dst )
|
||||
{
|
||||
VaultImageNode image(dst);
|
||||
hsRAMStream ramStream;
|
||||
|
||||
// Create our JPEG stream
|
||||
plJPEG::Instance().SetWriteQuality( 30 ); // In percent quality
|
||||
|
||||
if( !plJPEG::Instance().WriteToStream( &ramStream, src ) )
|
||||
return false;
|
||||
|
||||
unsigned bytes = ramStream.GetEOF();
|
||||
byte * buffer = (byte *)ALLOC(bytes);
|
||||
ramStream.CopyToMem(buffer);
|
||||
|
||||
image.SetImageData(buffer, bytes);
|
||||
|
||||
image.SetImageType( VaultImageNode::kJPEG );
|
||||
|
||||
// possibly make a plKey for the mipmap.
|
||||
return ExtractImageFromNode( dst );
|
||||
}
|
||||
|
||||
hsBool ExtractImageFromNode( RelVaultNode * src)
|
||||
{
|
||||
// no id? exit now. we will be called again when element is given an id.
|
||||
if ( src->nodeId == 0 )
|
||||
return false;
|
||||
|
||||
VaultCliImageNode image(src);
|
||||
|
||||
// already have a mipmap and it has a key? release it
|
||||
if ( image.fMipmap && image.fMipmap->GetKey()!=nil )
|
||||
{
|
||||
plNetClientMgr::GetInstance()->GetKey()->Release( image.fMipmap->GetKey() );
|
||||
image.fMipmap = nil;
|
||||
}
|
||||
|
||||
// convert image data to a plMipmap
|
||||
switch( image.imgType )
|
||||
{
|
||||
case VaultImageNode::kJPEG:
|
||||
{
|
||||
// Copy to a RAM stream so the JPEG class is happy
|
||||
hsRAMStream ramStream;
|
||||
ramStream.Write( image.imgDataLen, image.imgData );
|
||||
ramStream.Rewind();
|
||||
// create mipmap from image data
|
||||
image.fMipmap = plJPEG::Instance().ReadFromStream( &ramStream );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
hsAssert( false, "ExtractImageFromNode: Invalid image type" );
|
||||
return false; // Invalid image type
|
||||
}
|
||||
}
|
||||
|
||||
if ( !image.fMipmap )
|
||||
{
|
||||
hsAssert( false, "ExtractImageFromNode failed" );
|
||||
return false;
|
||||
}
|
||||
|
||||
// we now have a mipmap, but it doesn't have a key. make a key for it
|
||||
static int UniqueIdentifier = 0;
|
||||
|
||||
char keyName[512];
|
||||
sprintf( keyName, "VaultImage_%lu_%d", src->nodeId, UniqueIdentifier++ );
|
||||
|
||||
// create a key for the mipmap
|
||||
plKey imageKey = hsgResMgr::ResMgr()->NewKey( keyName, image.fMipmap, plLocation::kGlobalFixedLoc );
|
||||
|
||||
// ref the image key
|
||||
hsgResMgr::ResMgr()->AddViaNotify( imageKey, TRACKED_NEW plGenRefMsg(
|
||||
plNetClientMgr::GetInstance()->GetKey(), plRefMsg::kOnCreate, 0, plNetClientMgr::kVaultImage ),
|
||||
plRefFlags::kActiveRef );
|
||||
|
||||
return ( image.fMipmap->GetKey()!=nil );
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// End.
|
||||
|
@ -1,234 +0,0 @@
|
||||
/*==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/>.
|
||||
|
||||
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 "plNetClientMgr.h"
|
||||
#include "plNetClientVault.h"
|
||||
#include "../pnNetCommon/plNetMsg.h"
|
||||
#include "../plGImage/plMipmap.h"
|
||||
#include "../plJPEG/plJPEG.h"
|
||||
#include "../plVault/plVaultTasks.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "../pnMessage/plRefMsg.h"
|
||||
#include "../plVault/plDniCoordinateInfo.h"
|
||||
#include "../plVault/plAgeInfoSource.h"
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
class plNetClientAgeInfoSource : public plAgeInfoSource
|
||||
{
|
||||
plDniCoordinateInfo fNilCoords; // TEMPORARY
|
||||
public:
|
||||
const plDniCoordinateInfo * GetAgeCoords( void ) const
|
||||
{
|
||||
return &fNilCoords; // tmp
|
||||
}
|
||||
const plUnifiedTime * GetAgeTime( void ) const
|
||||
{
|
||||
static plUnifiedTime ut;
|
||||
ut.SetSecsDouble(plNetClientMgr::GetInstance()->GetCurrentAgeElapsedSeconds());
|
||||
return &ut;
|
||||
}
|
||||
const char * GetAgeName( void ) const
|
||||
{
|
||||
return plNetClientMgr::GetInstance()->GetAgeName();
|
||||
}
|
||||
const plServerGuid * GetAgeGuid( void ) const
|
||||
{
|
||||
return plNetClientMgr::GetInstance()->GetCurrSessionInfo()->GetServerGuid();
|
||||
}
|
||||
static plNetClientAgeInfoSource * GetInstance( void )
|
||||
{
|
||||
static plNetClientAgeInfoSource Me;
|
||||
return &Me;
|
||||
}
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
plNetClientVault::plNetClientVault()
|
||||
{
|
||||
}
|
||||
|
||||
plNetApp * plNetClientVault::GetNetApp( void ) const
|
||||
{
|
||||
return plNetClientMgr::GetInstance();
|
||||
}
|
||||
|
||||
plAgeInfoSource * plNetClientVault::GetAgeInfo( void ) const
|
||||
{
|
||||
return plNetClientAgeInfoSource::GetInstance();
|
||||
}
|
||||
|
||||
|
||||
void plNetClientVault::IInitNode( plVaultNode * node )
|
||||
{
|
||||
plVaultImageNode * IMG = plVaultImageNode::ConvertNoRef( node );
|
||||
if ( IMG )
|
||||
{
|
||||
plNetClientVault::ExtractImageFromNode( IMG );
|
||||
}
|
||||
}
|
||||
|
||||
void plNetClientVault::IFiniNode( plVaultNode * node )
|
||||
{
|
||||
plVaultImageNode * IMG = plVaultImageNode::ConvertNoRef( node );
|
||||
if ( IMG && IMG->GetMipmap() )
|
||||
{
|
||||
plNetClientMgr::GetInstance()->GetKey()->Release( IMG->GetMipmap()->GetKey() );
|
||||
IMG->ISetMipmap( nil );
|
||||
}
|
||||
}
|
||||
|
||||
int plNetClientVault::ISendNetMsg( plNetMsgVault * msg, UInt32 sendFlags )
|
||||
{
|
||||
return plNetClientMgr::GetInstance()->SendMsg( msg, sendFlags );
|
||||
}
|
||||
|
||||
void plNetClientVault::IOnTaskTimedOut( plVaultTask * task )
|
||||
{
|
||||
std::string msg;
|
||||
xtl::format( msg, "KI task timed out: %s", task->ClassName() );
|
||||
plNetClientMgr::GetInstance()->OnNetFailure( msg.c_str(), true );
|
||||
}
|
||||
|
||||
bool plNetClientVault::IAmOnline( void ) const
|
||||
{
|
||||
return plNetClientMgr::GetInstance()->IsEnabled()!=0;
|
||||
}
|
||||
|
||||
//// Image/Mipmap Conversion //////////////////////////////////////////////////
|
||||
|
||||
hsBool plNetClientVault::StuffImageIntoNode( plMipmap * src, plVaultImageNode * dst )
|
||||
{
|
||||
hsRAMStream ramStream;
|
||||
|
||||
// Create our JPEG stream
|
||||
plJPEG::Instance().SetWriteQuality( 50 ); // In percent quality
|
||||
|
||||
if( !plJPEG::Instance().WriteToStream( &ramStream, src ) )
|
||||
return false;
|
||||
|
||||
// Copy the stream to the image element now
|
||||
void * buffer = dst->AllocBuffer( ramStream.GetEOF() );
|
||||
if( buffer == nil )
|
||||
return false;
|
||||
ramStream.CopyToMem( buffer );
|
||||
dst->SetImageType( plVaultImageNode::kJPEG );
|
||||
|
||||
// possibly make a plKey for the mipmap.
|
||||
return plNetClientVault::ExtractImageFromNode( dst );
|
||||
}
|
||||
|
||||
hsBool plNetClientVault::ExtractImageFromNode( plVaultImageNode * src)
|
||||
{
|
||||
// no id? exit now. we will be called again when element is given an id.
|
||||
if ( src->GetID()==0 )
|
||||
return false;
|
||||
|
||||
// already have a mipmap and it has a key? release it
|
||||
if ( src->GetMipmap() && src->GetMipmap()->GetKey()!=nil )
|
||||
{
|
||||
plNetClientMgr::GetInstance()->GetKey()->Release( src->GetMipmap()->GetKey() );
|
||||
src->ISetMipmap( nil );
|
||||
}
|
||||
|
||||
// convert image data to a plMipmap
|
||||
switch( src->GetImageType() )
|
||||
{
|
||||
case plVaultImageNode::kJPEG:
|
||||
{
|
||||
// Copy to a RAM stream so the JPEG class is happy
|
||||
hsRAMStream ramStream;
|
||||
ramStream.Write( src->GetBufSize(), src->GetBuffer() );
|
||||
ramStream.Rewind();
|
||||
// create mipmap from image data
|
||||
src->ISetMipmap( plJPEG::Instance().ReadFromStream( &ramStream ) );
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
{
|
||||
hsAssert( false, "ExtractImageFromNode: Invalid image type" );
|
||||
return false; // Invalid image type
|
||||
}
|
||||
}
|
||||
|
||||
if ( !src->GetMipmap() )
|
||||
{
|
||||
hsAssert( false, "ExtractImageFromNode failed" );
|
||||
return false;
|
||||
}
|
||||
|
||||
// we now have a mipmap, but it doesn't have a key. make a key for it
|
||||
static int UniqueIdentifier = 0;
|
||||
|
||||
char keyName[512];
|
||||
sprintf( keyName, "VaultImage_%lu_%d", src->GetID(), UniqueIdentifier++ );
|
||||
|
||||
// create a key for the mipmap
|
||||
plKey imageKey = hsgResMgr::ResMgr()->NewKey( keyName, src->IGetMipmap(),
|
||||
plLocation::kGlobalFixedLoc );
|
||||
|
||||
// ref the image key
|
||||
hsgResMgr::ResMgr()->AddViaNotify( imageKey, new plGenRefMsg(
|
||||
plNetClientMgr::GetInstance()->GetKey(), plRefMsg::kOnCreate, 0, 0 ),
|
||||
plRefFlags::kActiveRef );
|
||||
|
||||
return ( src->GetMipmap()->GetKey()!=nil );
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
plNetPlayerVault::plNetPlayerVault()
|
||||
{
|
||||
}
|
||||
|
||||
bool plNetPlayerVault::IIsThisMe( plVaultPlayerInfoNode * node ) const
|
||||
{
|
||||
return GetPlayer()->GetPlayerInfo()->GetID()==node->GetID();
|
||||
}
|
||||
|
||||
plVaultPlayerNode * plNetPlayerVault::GetPlayer( void ) const
|
||||
{
|
||||
return plVaultPlayerNode::ConvertNoRef( GetRootNode() );
|
||||
}
|
||||
|
||||
void plNetPlayerVault::IFillOutConnectFields( plNetMsgVault * msg ) const
|
||||
{
|
||||
msg->AddInt( plVault::kArg_VaultClientType, plVault::kNodeType_VaultPlayer );
|
||||
msg->AddInt( plVault::kArg_VaultClientID, plNetClientMgr::GetInstance()->GetDesiredPlayerID() );
|
||||
}
|
||||
|
||||
bool plNetPlayerVault::IIsThisMsgMine( plNetMsgVault * msg ) const
|
||||
{
|
||||
if ( plVaultClient::IIsThisMsgMine( msg ) )
|
||||
return true;
|
||||
return ( msg->GetInt( plVault::kArg_VaultClientID )==plNetClientMgr::GetInstance()->GetDesiredPlayerID() );
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
// End.
|
@ -1,71 +0,0 @@
|
||||
/*==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/>.
|
||||
|
||||
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 plNetClientVault_h_inc
|
||||
#define plNetClientVault_h_inc
|
||||
|
||||
#include "../plVault/plVaultClient.h"
|
||||
|
||||
class plMipmap;
|
||||
class plVaultImageNode;
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
class plNetClientVault : public plVaultClient
|
||||
{
|
||||
protected:
|
||||
void IInitNode( plVaultNode * node );
|
||||
void IFiniNode( plVaultNode * node );
|
||||
int ISendNetMsg( plNetMsgVault * msg, UInt32 sendFlags=0 );
|
||||
void IOnTaskTimedOut( plVaultTask * task );
|
||||
bool IAmOnline( void ) const;
|
||||
|
||||
public:
|
||||
plNetClientVault();
|
||||
|
||||
plNetApp * GetNetApp( void ) const;
|
||||
plAgeInfoSource * GetAgeInfo( void ) const;
|
||||
|
||||
// static helpers to convert between plMipmap and plVaultImageNode
|
||||
static hsBool StuffImageIntoNode( plMipmap * src, plVaultImageNode * dst );
|
||||
static hsBool ExtractImageFromNode( plVaultImageNode * src );
|
||||
};
|
||||
|
||||
////////////////////////////////////////////////////////////////////
|
||||
|
||||
class plNetPlayerVault : public plNetClientVault
|
||||
{
|
||||
protected:
|
||||
bool IIsThisMe( plVaultPlayerInfoNode * node ) const;
|
||||
void IFillOutConnectFields( plNetMsgVault * msg ) const;
|
||||
bool IIsThisMsgMine( plNetMsgVault * msg ) const;
|
||||
|
||||
public:
|
||||
plNetPlayerVault();
|
||||
plVaultPlayerNode * GetPlayer( void ) const;
|
||||
};
|
||||
|
||||
#endif // plNetClientVault_h_inc
|
@ -25,8 +25,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*==LICENSE==*/
|
||||
#include "hsWindows.h"
|
||||
#include "plServerGuid.h"
|
||||
#include "../pnMessage/plMessage.h"
|
||||
#include "../PubUtilLib/plStreamLogger/plStreamLogger.h"
|
||||
#include "pnMessage/plMessage.h"
|
||||
#include "PubUtilLib/plStreamLogger/plStreamLogger.h"
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
#include <process.h>
|
||||
#else
|
||||
|
@ -56,7 +56,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plPXConvert.h"
|
||||
#include "plPXPhysicalControllerCore.h"
|
||||
|
||||
#include "../plModifier/plDetectorLog.h"
|
||||
#include "plModifier/plDetectorLog.h"
|
||||
|
||||
#include "plSurface/hsGMaterial.h"
|
||||
#include "plSurface/plLayerInterface.h"
|
||||
|
||||
|
||||
#if 0
|
||||
@ -1254,9 +1257,6 @@ hsBool plPXPhysical::IsDynamic() const
|
||||
!GetProperty(plSimulationInterface::kPhysAnim);
|
||||
}
|
||||
|
||||
#include "../plSurface/hsGMaterial.h"
|
||||
#include "../plSurface/plLayerInterface.h"
|
||||
|
||||
// Some helper functions for pulling info out of a PhysX trimesh description
|
||||
inline hsPoint3& GetTrimeshVert(NxTriangleMeshDesc& desc, int idx)
|
||||
{
|
||||
|
@ -35,9 +35,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plDrawable/plDrawableGenerator.h"
|
||||
#include "plPhysical/plPhysicalProxy.h"
|
||||
|
||||
#include "pnMessage/plSetNetGroupIDMsg.h"
|
||||
#include "pnMessage/plSetNetGroupIDMsg.h
|
||||
|
||||
#include "plSurface/hsGMaterial.h"
|
||||
#include "plSurface/plLayerInterface.h""
|
||||
#include "plMessage/plCollideMsg.h"
|
||||
|
||||
|
||||
#include <NxPhysics.h>
|
||||
#include <ControllerManager.h>
|
||||
#include <NxCapsuleController.h>
|
||||
@ -55,6 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
|
||||
#ifndef PLASMA_EXTERNAL_RELEASE
|
||||
#include "plPipeline/plDebugText.h"
|
||||
hsBool plPXPhysicalController::fDebugDisplay = false;
|
||||
#endif // PLASMA_EXTERNAL_RELEASE
|
||||
|
||||
@ -1197,9 +1202,6 @@ void plPXPhysicalController::IDeleteController()
|
||||
}
|
||||
}
|
||||
|
||||
#include "../plSurface/hsGMaterial.h"
|
||||
#include "../plSurface/plLayerInterface.h"
|
||||
|
||||
// Make a visible object that can be viewed by users for debugging purposes.
|
||||
plDrawableSpans* plPXPhysicalController::CreateProxy(hsGMaterial* mat, hsTArray<UInt32>& idx, plDrawableSpans* addTo)
|
||||
{
|
||||
@ -1226,7 +1228,6 @@ plDrawableSpans* plPXPhysicalController::CreateProxy(hsGMaterial* mat, hsTArray<
|
||||
}
|
||||
|
||||
#ifndef PLASMA_EXTERNAL_RELEASE
|
||||
#include "../plPipeline/plDebugText.h"
|
||||
|
||||
void plPXPhysicalController::IDrawDebugDisplay()
|
||||
{
|
||||
|
@ -27,22 +27,31 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plSimulationMgr.h"
|
||||
#include "plPXPhysical.h"
|
||||
#include "plPXConvert.h"
|
||||
#include "../pnSceneObject/plSimulationInterface.h"
|
||||
#include "../pnSceneObject/plSceneObject.h"
|
||||
#include "../pnMessage/plCorrectionMsg.h"
|
||||
#include "../plAvatar/plArmatureMod.h"
|
||||
#include "../pnSceneObject/plCoordinateInterface.h"
|
||||
#include "../plDrawable/plDrawableGenerator.h"
|
||||
#include "../plPhysical/plPhysicalProxy.h"
|
||||
#include "../pnMessage/plSetNetGroupIDMsg.h"
|
||||
#include "../plMessage/plCollideMsg.h"
|
||||
#include "../plModifier/plDetectorLog.h"
|
||||
#include "pnSceneObject/plSimulationInterface.h"
|
||||
#include "pnSceneObject/plSceneObject.h"
|
||||
#include "pnMessage/plCorrectionMsg.h"
|
||||
#include "plAvatar/plArmatureMod.h"
|
||||
#include "pnSceneObject/plCoordinateInterface.h"
|
||||
#include "plDrawable/plDrawableGenerator.h"
|
||||
#include "plPhysical/plPhysicalProxy.h"
|
||||
#include "pnMessage/plSetNetGroupIDMsg.h"
|
||||
#include "plMessage/plCollideMsg.h"
|
||||
#include "plModifier/plDetectorLog.h"
|
||||
//#include "NxVecExtendedVec3.h"
|
||||
|
||||
#include "NxPhysics.h"
|
||||
#include "ControllerManager.h"
|
||||
#include "NxCapsuleController.h"
|
||||
#include "NxCapsuleShape.h"
|
||||
|
||||
#include "plSurface/hsGMaterial.h"
|
||||
#include "plSurface/plLayerInterface.h"
|
||||
|
||||
|
||||
#ifndef PLASMA_EXTERNAL_RELEASE
|
||||
#include "plPipeline/plDebugText.h"
|
||||
#endif
|
||||
|
||||
#define kPhysxSkinWidth 0.1f
|
||||
#define kPhysZOffset ((fRadius + (fHeight / 2)) + kPhysxSkinWidth)
|
||||
//#define kSLOPELIMIT (cosf(NxMath::degToRad(55.f)))
|
||||
@ -1162,9 +1171,6 @@ const hsVector3& plPXPhysicalControllerCore::GetLinearVelocity()
|
||||
}
|
||||
}
|
||||
|
||||
#include "../plSurface/hsGMaterial.h"
|
||||
#include "../plSurface/plLayerInterface.h"
|
||||
|
||||
// Make a visible object that can be viewed by users for debugging purposes.
|
||||
plDrawableSpans* plPXPhysicalControllerCore::CreateProxy(hsGMaterial* mat, hsTArray<UInt32>& idx, plDrawableSpans* addTo)
|
||||
{
|
||||
@ -1189,7 +1195,6 @@ plDrawableSpans* plPXPhysicalControllerCore::CreateProxy(hsGMaterial* mat, hsTAr
|
||||
return myDraw;
|
||||
}
|
||||
#ifndef PLASMA_EXTERNAL_RELEASE
|
||||
#include "../plPipeline/plDebugText.h"
|
||||
|
||||
void plPXPhysicalControllerCore::IDrawDebugDisplay()
|
||||
{
|
||||
|
@ -23,7 +23,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "../plAvatar/plPhysicalControllerCore.h"
|
||||
#include "plAvatar/plPhysicalControllerCore.h"
|
||||
#include "hsQuat.h"
|
||||
#define PHYSX_ONLY_TRIGGER_FROM_KINEMATIC 1
|
||||
|
||||
|
@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plModifier/plDetectorLog.h"
|
||||
|
||||
#ifndef PLASMA_EXTERNAL_RELEASE
|
||||
#include "plPipeline/plDebugText.h"
|
||||
bool plSimulationMgr::fDisplayAwakeActors=false;
|
||||
#endif //PLASMA_EXTERNAL_RELEASE
|
||||
// This gets called by PhysX whenever a trigger gets penetrated. This is used
|
||||
@ -989,7 +990,6 @@ void plSimulationMgr::ClearLog()
|
||||
}
|
||||
}
|
||||
#ifndef PLASMA_EXTERNAL_RELEASE
|
||||
#include "../plPipeline/plDebugText.h"
|
||||
|
||||
void plSimulationMgr::IDrawActiveActorList()
|
||||
{
|
||||
|
@ -1,76 +0,0 @@
|
||||
/*==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/>.
|
||||
|
||||
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 "hsTypes.h"
|
||||
#include "plEnvEffectDetector.h"
|
||||
#include "../plMessage/plCollideMsg.h"
|
||||
#include "plgDispatch.h"
|
||||
#include "../pnMessage/plEnvEffectMsg.h"
|
||||
|
||||
/*
|
||||
hsBool plEnvEffectDetector::MsgReceive(plMessage* msg)
|
||||
{
|
||||
plCollideMsg* pCollMsg = plCollideMsg::ConvertNoRef(msg);
|
||||
|
||||
if (pCollMsg)
|
||||
{
|
||||
for (int i = 0; i < fEffectMsg.Count(); i++)
|
||||
{
|
||||
fEffectMsg[i]->ClearReceivers();
|
||||
if(pCollMsg->fEntering)
|
||||
{
|
||||
fEffectMsg[i]->Enable( true );
|
||||
} else {
|
||||
fEffectMsg[i]->Enable( false );
|
||||
}
|
||||
fEffectMsg[i]->AddReceiver( pCollMsg->fOtherKey );
|
||||
hsRefCnt_SafeRef(fEffectMsg[i]);
|
||||
plgDispatch::MsgSend( fEffectMsg[i] );
|
||||
}
|
||||
}
|
||||
return plDetectorModifier::MsgReceive(msg);
|
||||
}
|
||||
|
||||
void plEnvEffectDetector::Read(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plDetectorModifier::Read(stream, mgr);
|
||||
int n = stream->ReadSwap32();
|
||||
fEffectMsg.SetCountAndZero(n);
|
||||
for(int i = 0; i < n; i++ )
|
||||
{
|
||||
plEnvEffectMsg* pMsg = plEnvEffectMsg::ConvertNoRef(mgr->ReadCreatable(stream));
|
||||
fEffectMsg[i] = pMsg;
|
||||
}
|
||||
}
|
||||
|
||||
void plEnvEffectDetector::Write(hsStream* stream, hsResMgr* mgr)
|
||||
{
|
||||
plDetectorModifier::Write(stream, mgr);
|
||||
stream->WriteSwap32(fEffectMsg.GetCount());
|
||||
for(int i = 0; i < fEffectMsg.GetCount(); i++ )
|
||||
mgr->WriteCreatable( stream, fEffectMsg[i] );
|
||||
|
||||
}
|
||||
*/
|
@ -1,57 +0,0 @@
|
||||
/*==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/>.
|
||||
|
||||
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 plEnvEffectDetector_inc
|
||||
#define plEnvEffectDetector_inc
|
||||
|
||||
#include "plDetectorModifier.h"
|
||||
|
||||
class plEnvEffectMsg;
|
||||
class plMessage;
|
||||
class hsStream;
|
||||
class hsResMgr;
|
||||
|
||||
class plEnvEffectDetector : public plDetectorModifier
|
||||
{
|
||||
protected:
|
||||
|
||||
public:
|
||||
plEnvEffectDetector(){;}
|
||||
virtual ~plEnvEffectDetector(){;}
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
|
||||
CLASSNAME_REGISTER( plEnvEffectDetector );
|
||||
GETINTERFACE_ANY( plEnvEffectDetector, plDetectorModifier );
|
||||
|
||||
hsTArray<plEnvEffectMsg*> fEffectMsg;
|
||||
|
||||
void Read(hsStream* stream, hsResMgr* mgr);
|
||||
void Write(hsStream* stream, hsResMgr* mgr);
|
||||
|
||||
};
|
||||
|
||||
#endif plEnvEffectDetector_inc
|
File diff suppressed because it is too large
Load Diff
@ -1,273 +0,0 @@
|
||||
/*==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/>.
|
||||
|
||||
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 hsGEnviron_inc
|
||||
#define hsGEnviron_inc
|
||||
|
||||
#include "hsGeometry3.h" // hsPoint3
|
||||
#include "../plInterp/hsTimedValue.h"
|
||||
#include "../plResMgr/hsKeyedObject.h"
|
||||
#include "hsColorRGBA.h"
|
||||
#include "hsTemplates.h"
|
||||
|
||||
//
|
||||
//-----------------------------------
|
||||
// Environment
|
||||
//-----------------------------------
|
||||
//
|
||||
|
||||
class hsGMaterial;
|
||||
class hsGDevEnvCache;
|
||||
class hsFogControl;
|
||||
class hsSceneNode;
|
||||
class hsScene;
|
||||
class hsGRenderProcs;
|
||||
class hsG3DDevice;
|
||||
class plKey;
|
||||
class hsResMgr;
|
||||
|
||||
class hsGEnvironment : public hsKeyedObject {
|
||||
private:
|
||||
static const UInt16 kSaveMagicNumber;
|
||||
static const UInt16 kSaveVersion;
|
||||
|
||||
public:
|
||||
struct FogState {
|
||||
private:
|
||||
static const UInt16 kSaveMagicNumber;
|
||||
static const UInt16 kSaveVersion;
|
||||
|
||||
public:
|
||||
FogState() : fFlags(0) {};
|
||||
enum {
|
||||
kColorSet = 0x1,
|
||||
kDistanceSet = 0x2,
|
||||
kDepthSet = 0x4,
|
||||
kDensitySet = 0x8,
|
||||
kYonSet = 0x10,
|
||||
kClearSet = 0x20,
|
||||
|
||||
kLinear = 0x10000000,
|
||||
kExp = 0x20000000,
|
||||
kExp2 = 0x40000000,
|
||||
kTypeMask = kLinear | kExp | kExp2
|
||||
};
|
||||
UInt32 fFlags;
|
||||
hsTimedValue<hsColorRGBA> fColor;
|
||||
hsTimedValue<hsColorRGBA> fClear;
|
||||
hsTimedValue<hsScalar> fDistance;
|
||||
hsTimedValue<hsScalar> fDensity;
|
||||
hsTimedValue<hsScalar> fDepth;
|
||||
hsTimedValue<hsScalar> fYon;
|
||||
|
||||
void ValidateEnv(class hsGEnvironment* env);
|
||||
void SetFromEnv(class hsGEnvironment* env);
|
||||
void SetToEnv(class hsGEnvironment* env);
|
||||
void Save(hsStream *stream, hsResMgr* mgr);
|
||||
void Load(hsStream *stream, hsResMgr* mgr);
|
||||
};
|
||||
|
||||
enum {
|
||||
kMapSet = 0x1,
|
||||
kCenterSet = 0x2,
|
||||
kRadiusSet = 0x4,
|
||||
kEnvironMapSet = kMapSet | kCenterSet | kRadiusSet,
|
||||
kFogDepthSet = 0x8,
|
||||
kFogColorSet = 0x10,
|
||||
kFogDensitySet = 0x20,
|
||||
kYonSet = 0x40,
|
||||
kOverride = 0x80,
|
||||
kFarOut = 0x100,
|
||||
kFogDistanceSet = 0x200,
|
||||
kCacheInvalid = 0x400,
|
||||
kClearColorSet = 0x800,
|
||||
kCurrentDepthSet = 0x1000,
|
||||
kFogControl = 0x2000,
|
||||
kSortObjects = 0x4000,
|
||||
kHasRenderProcs = 0x8000,
|
||||
kFogLinear = 0x10000,
|
||||
kFogExp = 0x20000,
|
||||
kFogExp2 = 0x40000,
|
||||
kFogTypeMask = kFogLinear | kFogExp | kFogExp2,
|
||||
kClearColorAmbient = 0x80000,
|
||||
kFogColorAmbient = 0x100000,
|
||||
kFogColorDiffuse = 0x200000
|
||||
};
|
||||
protected:
|
||||
static hsScalar fYonScale;
|
||||
|
||||
UInt32 fFlags;
|
||||
hsGMaterial* fMap;
|
||||
char fMapName[256];
|
||||
hsPoint3 fPos;
|
||||
hsScalar fRadius;
|
||||
hsScalar fValidScale;
|
||||
hsTArray<FogState*> fFogStateStack;
|
||||
hsTimedValue<hsScalar> fFogDistance;
|
||||
hsTimedValue<hsScalar> fFogDepth; // value 0..1, as fraction of yon, 0 is no fog
|
||||
hsTimedValue<hsScalar> fFogDensity;
|
||||
hsTimedValue<hsColorRGBA> fFogColor;
|
||||
hsTimedValue<hsColorRGBA> fClearColor;
|
||||
hsTimedValue<hsScalar> fYon;
|
||||
hsScalar fCurrentDepth; // function of Depth and Distance
|
||||
|
||||
FogState fResetState;
|
||||
hsGDevEnvCache* fDevCache;
|
||||
|
||||
hsDynamicArray<hsGRenderProcs*> fRenderProcs;
|
||||
hsTArray<plKey*> fNodeKeys;
|
||||
|
||||
hsFogControl* fFogControl;
|
||||
|
||||
void IReadFogControl(hsStream* s, hsResMgr* mgr);
|
||||
void IWriteFogControl(hsStream* s, hsResMgr* mgr);
|
||||
|
||||
public:
|
||||
hsGEnvironment();
|
||||
virtual ~hsGEnvironment();
|
||||
|
||||
hsBool32 AddNode(hsSceneNode *node);
|
||||
hsBool32 AddNodeKey(plKey *key);
|
||||
Int32 GetNumNodes() { return fNodeKeys.GetCount(); }
|
||||
hsSceneNode* GetNode(Int32 i);
|
||||
plKey* GetNodeKey(Int32 i) { return fNodeKeys[i]; }
|
||||
|
||||
char* GetMapName() { return fMapName; }
|
||||
hsGMaterial* GetMap() const { return fMap; }
|
||||
hsPoint3 GetCenter() const { return fPos; }
|
||||
hsScalar GetRadius() const { return fRadius; }
|
||||
hsScalar GetFogDistance() const { return fFogDistance.GetValue(); }
|
||||
hsScalar GetFogDepth() const { return fFogDepth.GetValue(); }
|
||||
hsScalar GetCurrentDepth() const { return fCurrentDepth; }
|
||||
hsScalar GetFogDensity() const { return fFogDensity.GetValue(); }
|
||||
hsColorRGBA GetFogColor() const { return fFogColor.GetValue(); }
|
||||
hsColorRGBA GetClearColor() const { return fClearColor.GetValue(); }
|
||||
hsScalar GetYon() const { return fYonScale * fYon.GetValue(); }
|
||||
hsScalar GetUnscaledYon() const { return fYon.GetValue(); }
|
||||
hsBool32 GetOverride() const { return 0 != (fFlags & kOverride); }
|
||||
UInt32 GetFlags() const { return fFlags; }
|
||||
|
||||
hsScalar GoalFogDistance() const { return fFogDistance.GetGoal(); }
|
||||
hsScalar GoalFogDepth() const { return fFogDepth.GetGoal(); }
|
||||
hsScalar GoalFogDensity() const { return fFogDensity.GetGoal(); }
|
||||
hsColorRGBA GoalFogColor() const { return fFogColor.GetGoal(); }
|
||||
hsColorRGBA GoalClearColor() const { return fClearColor.GetGoal(); }
|
||||
hsScalar GoalYon() const { return fYon.GetGoal(); }
|
||||
|
||||
const hsTimedValue<hsScalar>& FogDistanceState() const { return fFogDistance; }
|
||||
const hsTimedValue<hsScalar>& FogDepthState() const { return fFogDepth; }
|
||||
const hsTimedValue<hsScalar>& FogDensityState() const { return fFogDensity; }
|
||||
const hsTimedValue<hsColorRGBA>& FogColorState() const { return fFogColor; }
|
||||
const hsTimedValue<hsColorRGBA>& ClearColorState() const { return fClearColor; }
|
||||
const hsTimedValue<hsScalar>& YonState() const { return fYon; }
|
||||
|
||||
void SetFogDistance(const hsTimedValue<hsScalar>& v);
|
||||
void SetFogDepth(const hsTimedValue<hsScalar>& v);
|
||||
void SetFogDensity(const hsTimedValue<hsScalar>& v);
|
||||
void SetFogColor(const hsTimedValue<hsColorRGBA>& v);
|
||||
void SetClearColor(const hsTimedValue<hsColorRGBA>& v);
|
||||
void SetYon(const hsTimedValue<hsScalar>& v);
|
||||
|
||||
void SetMapName(const char *name);
|
||||
void SetMap(hsGMaterial *m); // refs
|
||||
void SetCenter(const hsPoint3 &p);
|
||||
void SetRadius(hsScalar r);
|
||||
void SetFogDistance(hsScalar d);
|
||||
void SetFogDepth(hsScalar f);
|
||||
void SetCurrentDepth(hsScalar f);
|
||||
void SetFogDensity(hsScalar f);
|
||||
void SetFogColor(const hsColorRGBA &c);
|
||||
void SetClearColor(const hsColorRGBA &c);
|
||||
void SetYon(hsScalar f);
|
||||
void SetOverride(hsBool32 on);
|
||||
void SetIsFar(hsBool32 on=true);
|
||||
void SetHasFogControl(hsBool32 on=true);
|
||||
void SetSortObjects(hsBool32 on=true);
|
||||
void SetFogType(UInt32 t);
|
||||
void SetFogColorAmbient(hsBool32 on=true);
|
||||
void SetFogColorDiffuse(hsBool32 on=true);
|
||||
void SetClearColorAmbient(hsBool32 on=true);
|
||||
|
||||
void SetTimedFogDistance(const hsScalar g, const hsScalar s);
|
||||
void SetTimedFogDepth(const hsScalar g, const hsScalar s);
|
||||
void SetTimedFogDensity(const hsScalar g, const hsScalar s);
|
||||
void SetTimedFogColor(const hsColorRGBA& g, const hsScalar s);
|
||||
void SetTimedClearColor(const hsColorRGBA& g, const hsScalar s);
|
||||
void SetTimedYon(const hsScalar g, const hsScalar s);
|
||||
|
||||
void UnSetMapName() { *fMapName = 0; }
|
||||
void UnSetEnvironMap() { fFlags &= ~kEnvironMapSet; }
|
||||
void UnSetFogDistance() { fFlags &= ~kFogDistanceSet; }
|
||||
void UnSetFogDepth() { fFlags &= ~kFogDepthSet; }
|
||||
void UnSetFogDensity() { fFlags &= ~kFogDensitySet; }
|
||||
void UnSetFogColor() { fFlags &= ~kFogColorSet; }
|
||||
void UnSetClearColor() { fFlags &= ~kClearColorSet; }
|
||||
void UnSetYon() { fFlags &= ~kYonSet; }
|
||||
|
||||
hsGEnvironment* Copy(hsGEnvironment* env); // returns this
|
||||
|
||||
void MixEnvirons(hsGEnvironment* env, hsGEnvironment* def);
|
||||
|
||||
void Push(hsG3DDevice* d);
|
||||
void Pop(hsG3DDevice* d);
|
||||
|
||||
void Blend();
|
||||
void Restore();
|
||||
void Init(hsSceneNode* node);
|
||||
|
||||
void SetDeviceCache(hsGDevEnvCache* p);
|
||||
hsGDevEnvCache* GetDeviceCache(){ return fDevCache; }
|
||||
|
||||
void SetFogControl(hsFogControl* fc);
|
||||
hsFogControl* GetFogControl() { return fFogControl; }
|
||||
|
||||
void SaveFogState(); // push
|
||||
hsGEnvironment::FogState* PopFogState() { return fFogStateStack.GetCount() ? fFogStateStack.Pop() : nil; } // doesn't restore
|
||||
void RestoreFogState(); // pop and restore
|
||||
|
||||
void AddRenderProc(hsGRenderProcs* rp); // refs
|
||||
hsGRenderProcs* GetRenderProc(int i); // no ref
|
||||
UInt32 GetNumRenderProcs();
|
||||
|
||||
virtual void SetResetState();
|
||||
virtual void Reset();
|
||||
virtual void ValidateInResetState();
|
||||
virtual void Save(hsStream *stream, hsResMgr* mgr);
|
||||
virtual void Load(hsStream *stream, hsResMgr* mgr);
|
||||
virtual void Update(hsScalar secs, const hsPoint3& vPos);
|
||||
|
||||
virtual void Read(hsStream* s);
|
||||
virtual void Write(hsStream* s);
|
||||
|
||||
virtual void Write(hsStream *stream, hsResMgr *group);
|
||||
virtual void Read(hsStream *stream, hsResMgr *group);
|
||||
|
||||
static hsScalar GetYonScale() { return fYonScale; }
|
||||
static hsScalar SetYonScale(hsScalar s);
|
||||
|
||||
virtual hsBool MsgReceive(plMessage* msg);
|
||||
};
|
||||
|
||||
#endif // hsGEnviron_inc
|
@ -40,6 +40,18 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include "pfGameGUIMgr/pfGameGUIMgr.h"
|
||||
|
||||
#else // MF_FRONTBUFF_CAPTURE
|
||||
|
||||
#include "plPipeline.h"
|
||||
#include "plgDispatch.h"
|
||||
|
||||
#include "plMessage/plCaptureRenderMsg.h"
|
||||
#include "plGImage/plMipmap.h"
|
||||
|
||||
#endif // MF_FRONTBUFF_CAPTURE
|
||||
|
||||
|
||||
#ifndef MF_FRONTBUFF_CAPTURE
|
||||
// CaptureRenderRequest
|
||||
//
|
||||
void plCaptureRenderRequest::Render(plPipeline* pipe, plPageTreeMgr* pageMgr)
|
||||
@ -179,12 +191,6 @@ void plCaptureRender::Update()
|
||||
|
||||
#else // MF_FRONTBUFF_CAPTURE
|
||||
|
||||
#include "plPipeline.h"
|
||||
#include "plgDispatch.h"
|
||||
|
||||
#include "../plMessage/plCaptureRenderMsg.h"
|
||||
#include "../plGImage/plMipmap.h"
|
||||
|
||||
hsTArray<plCaptureRender::CapInfo> plCaptureRender::fCapReqs;
|
||||
|
||||
void plCaptureRender::Update(plPipeline* pipe)
|
||||
|
@ -62,7 +62,7 @@ public:
|
||||
#else // MF_FRONTBUFF_CAPTURE
|
||||
|
||||
#include "hsTemplates.h"
|
||||
#include "../pnKeyedObject/plKey.h"
|
||||
#include "pnKeyedObject/plKey.h"
|
||||
|
||||
class plPipeline;
|
||||
|
||||
|
@ -38,7 +38,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plProgressMgr.h"
|
||||
#include "hsTimer.h"
|
||||
|
||||
#include "../plPipeline/plPlates.h"
|
||||
#include "plPipeline/plPlates.h"
|
||||
|
||||
#include <string.h>
|
||||
|
||||
|
@ -1,195 +0,0 @@
|
||||
/*==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/>.
|
||||
|
||||
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==*/
|
||||
#define plIndexFile_cpp // for version numbers in plVersion.h
|
||||
|
||||
#include "plIndexFile.h"
|
||||
#include "hsStream.h"
|
||||
#include "plVersion.h"
|
||||
|
||||
//--------------------
|
||||
// plIndexFileHeader
|
||||
//--------------------
|
||||
|
||||
plIndexFileHeader::plIndexFileHeader()
|
||||
{
|
||||
fTimeStamp[ 0 ] = fTimeStamp[ 1 ] = 0;
|
||||
fStrTblStartPos = 0;
|
||||
fStrTblKnt = 0;
|
||||
fMajorVersion = plVersion::GetMajorVersion();
|
||||
fMinorVersion = plVersion::GetMinorVersion();
|
||||
fExportLocal = 0;
|
||||
}
|
||||
|
||||
void plIndexFileHeader::Write(hsStream *s)
|
||||
{
|
||||
s->WriteSwap32(2,fTimeStamp);
|
||||
s->WriteSwap32(fStrTblStartPos);
|
||||
s->WriteSwap16(fStrTblKnt);
|
||||
s->WriteSwap16(fMajorVersion);
|
||||
s->WriteSwap16(fMinorVersion);
|
||||
s->WriteSwap16(fExportLocal);
|
||||
}
|
||||
void plIndexFileHeader::Read(hsStream *s)
|
||||
{
|
||||
s->ReadSwap32(2,fTimeStamp);
|
||||
fStrTblStartPos = s->ReadSwap32();
|
||||
fStrTblKnt = s->ReadSwap16();
|
||||
fMajorVersion = s->ReadSwap16();
|
||||
fMinorVersion = s->ReadSwap16();
|
||||
fExportLocal = s->ReadSwap16();
|
||||
}
|
||||
|
||||
//--------------------
|
||||
// plIndexFileRoom
|
||||
//--------------------
|
||||
|
||||
void plIndexFileRoom::Write(hsStream *s)
|
||||
{
|
||||
fRmUoid.Write(s);
|
||||
s->WriteSwap32(fTypesInRoom);
|
||||
s->WriteSwap16(fFiller1_16);
|
||||
s->WriteSwap32(fFiller2_32);
|
||||
s->WriteSwap32(fFiller3_32);
|
||||
}
|
||||
void plIndexFileRoom::Read(hsStream *s)
|
||||
{
|
||||
fRmUoid.Read(s);
|
||||
fTypesInRoom = s->ReadSwap32();
|
||||
s->ReadSwap16();
|
||||
s->ReadSwap32();
|
||||
s->ReadSwap32();
|
||||
}
|
||||
//--------------------
|
||||
// plIndexFileType
|
||||
//--------------------
|
||||
|
||||
|
||||
void plIndexFileType::Write(hsStream *s)
|
||||
{
|
||||
fTypeUoid.Write(s);
|
||||
s->WriteSwap32(fNumKeys);
|
||||
s->WriteSwap32(fFiller1_32);
|
||||
s->WriteSwap32(fFiller2_32);
|
||||
}
|
||||
|
||||
void plIndexFileType::Read(hsStream *s)
|
||||
{
|
||||
fTypeUoid.Read(s);
|
||||
fNumKeys = s->ReadSwap32();
|
||||
s->ReadSwap32();
|
||||
s->ReadSwap32();
|
||||
}
|
||||
//--------------------
|
||||
// plIndexFileKey
|
||||
//--------------------
|
||||
|
||||
|
||||
void plIndexFileKey::Write(hsStream *s)
|
||||
{
|
||||
fKeyUoid.Write(s);
|
||||
s->WriteSwap32(fStartPos);
|
||||
s->WriteSwap32(fDataLen);
|
||||
s->WriteSwap16(fNameIx);
|
||||
s->WriteSwap16(fFiller1_16);
|
||||
}
|
||||
|
||||
|
||||
void plIndexFileKey::Read(hsStream *s)
|
||||
{
|
||||
fKeyUoid.Read(s);
|
||||
fStartPos = s->ReadSwap32();
|
||||
fDataLen = s->ReadSwap32();
|
||||
fNameIx = s->ReadSwap16();
|
||||
s->ReadSwap16();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------
|
||||
// plIxStrTbl
|
||||
//--------------------
|
||||
|
||||
plIxStrTbl::~plIxStrTbl()
|
||||
{
|
||||
if (fpStrings) delete []fpStrings; // if strings came from elsewhere, not our responsibility
|
||||
}
|
||||
|
||||
UInt16 plIxStrTbl::AddString(const char *p)
|
||||
{ Int16 ix = FindString(p);
|
||||
if (ix != -1)
|
||||
return ix; // duplicate
|
||||
fStringTbl.push_back(p); return fStringTbl.size() - 1;
|
||||
}
|
||||
|
||||
Int16 plIxStrTbl::FindString(const char *p)
|
||||
{
|
||||
for (int i=0; i < fStringTbl.size(); i++)
|
||||
{
|
||||
if (!_stricmp(p,fStringTbl[i]))
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
void plIxStrTbl::Write(hsStream *s)
|
||||
{
|
||||
for (int i=0; i < fStringTbl.size(); i++)
|
||||
{ Int32 len= fStringTbl[i] ? strlen(fStringTbl[i]) : 0;
|
||||
hsAssert(len < 256,"Name string too long");
|
||||
UInt8 l = (UInt8) len;
|
||||
s->WriteByte(l); // FUTURE, don't really need length!
|
||||
if (len)
|
||||
{
|
||||
s->Write(len, fStringTbl[i]);
|
||||
}
|
||||
s->WriteByte(0); // Null terminate
|
||||
}
|
||||
}
|
||||
|
||||
void plIxStrTbl::Read(hsStream *s)
|
||||
{ UInt32 pos = s->GetPosition();
|
||||
s->FastFwd();
|
||||
fTabSize = s->GetPosition() - pos; // Get size of table
|
||||
s->SetPosition(pos);
|
||||
fpStrings = new char[fTabSize];
|
||||
hsAssert(fpStrings,"new failed");
|
||||
s->Read(fTabSize,fpStrings); // Read all the string in
|
||||
|
||||
char *p = fpStrings;
|
||||
while (p < fpStrings + fTabSize)
|
||||
{
|
||||
UInt8 len = *p;
|
||||
p++;
|
||||
hsAssert(p < fpStrings + fTabSize,"String Index error");
|
||||
fStringTbl.push_back(p);
|
||||
p += len + 1; // past len and NULL
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -1,152 +0,0 @@
|
||||
/*==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/>.
|
||||
|
||||
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 PLINDEXFILE_H
|
||||
#define PLINDEXFILE_H
|
||||
|
||||
#include "../pnKeyedObject/plUoid.h"
|
||||
#include <vector>
|
||||
//---------------------------------------------------------------
|
||||
// These Classes are used to Read and Write the Index file for the Database
|
||||
// Records are kept the same size Currently 20 Bytes
|
||||
// At the End of the file, the Strings are stored
|
||||
// plIxStrTbl is used to Read and Write the String section of the Index
|
||||
//---------------------------------------------------------------
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Main header Entry, One per Index file
|
||||
//---------------------------------------------------------------
|
||||
class plIndexFileHeader
|
||||
{
|
||||
public:
|
||||
plIndexFileHeader(); // I buried Paul
|
||||
~plIndexFileHeader(){}
|
||||
|
||||
UInt32 fTimeStamp[2];
|
||||
UInt32 fStrTblStartPos; // where the String table starts in the Index file
|
||||
UInt16 fStrTblKnt; // how many strings in the string table
|
||||
UInt16 fMajorVersion;
|
||||
UInt16 fMinorVersion;
|
||||
UInt16 fExportLocal; // was this file exported locally or downloaded from server?
|
||||
|
||||
void Write(hsStream *s);
|
||||
void Read(hsStream *s);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Room Entry One Entry per Room
|
||||
//---------------------------------------------------------------
|
||||
class plIndexFileRoom
|
||||
{
|
||||
public:
|
||||
plIndexFileRoom() { memset(this,1,sizeof(this)); } // no virtuals...relax
|
||||
~plIndexFileRoom(){}
|
||||
|
||||
plUoid fRmUoid;
|
||||
UInt16 fTypesInRoom;
|
||||
UInt16 fFiller1_16;
|
||||
UInt32 fFiller2_32;
|
||||
UInt32 fFiller3_32;
|
||||
|
||||
void Write(hsStream *s);
|
||||
void Read(hsStream *s);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Type Entry One Entry per Type in each Room
|
||||
//---------------------------------------------------------------
|
||||
|
||||
class plIndexFileType
|
||||
{
|
||||
public:
|
||||
plIndexFileType() { memset(this,1,sizeof(this)); } // no virtuals...relax
|
||||
~plIndexFileType(){}
|
||||
|
||||
plUoid fTypeUoid;
|
||||
UInt16 fNumKeys;
|
||||
UInt32 fFiller1_32;
|
||||
UInt32 fFiller2_32;
|
||||
|
||||
void Write(hsStream *s);
|
||||
void Read(hsStream *s);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// Key Entry One Entry per Type in each Room
|
||||
//---------------------------------------------------------------
|
||||
|
||||
class plIndexFileKey
|
||||
{
|
||||
public:
|
||||
plIndexFileKey() { memset(this,1,sizeof(this)); } // no virtuals...relax
|
||||
~plIndexFileKey(){}
|
||||
|
||||
|
||||
plUoid fKeyUoid;
|
||||
UInt32 fStartPos;
|
||||
UInt32 fDataLen;
|
||||
UInt16 fNameIx; // Index into string table of name
|
||||
UInt16 fFiller1_16;
|
||||
|
||||
void Write(hsStream *s) ;
|
||||
void Read(hsStream *s);
|
||||
};
|
||||
|
||||
//---------------------------------------------------------------
|
||||
// String Table, Lives at the end of the Index File
|
||||
//---------------------------------------------------------------
|
||||
class plIxStrTbl
|
||||
{
|
||||
std::vector<const char *>fStringTbl;
|
||||
char *fpStrings;
|
||||
UInt32 fTabSize; // buffer size for strings
|
||||
|
||||
public:
|
||||
|
||||
plIxStrTbl() :fpStrings(nil), fTabSize(0){}
|
||||
~plIxStrTbl();
|
||||
|
||||
Int16 FindString(const char *p); // returns -1 if not found, otherwise the index from zero
|
||||
UInt16 AddString(const char *p);
|
||||
UInt16 NumStrings() { return fStringTbl.size(); }
|
||||
const char * GetString(UInt16 x) { return fStringTbl[x]; }
|
||||
|
||||
void Write(hsStream *s);
|
||||
void Read(hsStream *s);
|
||||
};
|
||||
|
||||
class plLinkRecord
|
||||
{
|
||||
public:
|
||||
plLinkRecord(UInt16 a, UInt16 d, UInt16 r) : fAgeIx(a), fDistIx(d), fRoomIx(r){}
|
||||
~plLinkRecord(){}
|
||||
|
||||
UInt16 fAgeIx; // Index into string table
|
||||
UInt16 fDistIx;
|
||||
UInt16 fRoomIx;
|
||||
UInt32 fTimeStamp[2];
|
||||
};
|
||||
|
||||
#endif
|
@ -24,7 +24,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plLoc.h"
|
||||
#include "../pnKeyedObject/hsKeyedObject.h"
|
||||
#include "pnKeyedObject/hsKeyedObject.h"
|
||||
|
||||
|
||||
plLocFileParser::plLocFileParser(): fThrowBack(nil), fThrowBackLevel(0)
|
||||
|
@ -27,6 +27,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plProfileManager.h"
|
||||
#include "plNetClient/plNetClientMgr.h"
|
||||
#include "hsTimer.h"
|
||||
#include "plPipeline/plPlates.h"
|
||||
|
||||
plProfile_CreateCounter("Age Upload BitsPerSec", "Network", UploadAgeBitsPerSec);
|
||||
plProfile_CreateMemCounter("Upload Bytes", "Network", UploadBW);
|
||||
@ -119,8 +120,6 @@ void CalculateProfiles()
|
||||
}
|
||||
}
|
||||
|
||||
#include "../plPipeline/plPlates.h"
|
||||
|
||||
static plGraphPlate* fFPSPlate = nil;
|
||||
static plGraphPlate* fNetBWPlate = nil;
|
||||
static plGraphPlate* fNetPPSPlate = nil;
|
||||
|
@ -28,7 +28,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include "hsStream.h"
|
||||
#include "hsStlUtils.h"
|
||||
#include "../../NucleusLib/pnNetCommon/plGenericVar.h"
|
||||
#include "pnNetCommon/plGenericVar.h"
|
||||
|
||||
class plStreamLogger
|
||||
{
|
||||
|
@ -29,7 +29,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "hsMemory.h"
|
||||
//#include "../plGeometry/hsTriangle3.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "plLayerInterface.h"
|
||||
#include "plLayer.h"
|
||||
|
@ -1,36 +0,0 @@
|
||||
/*==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/>.
|
||||
|
||||
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 plUnifiedTimeCreatable_inc
|
||||
#define plUnifiedTimeCreatable_inc
|
||||
|
||||
#if 0
|
||||
#include "../pnFactory/plCreator.h"
|
||||
|
||||
#include "plUnifiedTime.h"
|
||||
REGISTER_CREATABLE( plUnifiedTime );
|
||||
#endif
|
||||
|
||||
#endif // plUnifiedTimeCreatable_inc
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user