mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-14 02:27:40 -04:00
Merge pull request #87 from dpogue/linux
Make plPythonPack work on Linux --HG-- rename : Sources/Plasma/PubUtilLib/plUUID/plUUID.h => Sources/Plasma/NucleusLib/pnUUID/pnUUID.h rename : Sources/Plasma/PubUtilLib/plUUID/plUUID_Unix.cpp => Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp rename : Sources/Plasma/PubUtilLib/plUUID/plUUID_Win32.cpp => Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp
This commit is contained in:
@ -10,13 +10,17 @@ find_package(OpenAL REQUIRED)
|
||||
find_package(PythonLibs REQUIRED)
|
||||
find_package(EXPAT REQUIRED)
|
||||
find_package(ZLIB REQUIRED)
|
||||
find_package(PhysX REQUIRED) #TODO: Not required if we aren't building the client
|
||||
find_package(PNG REQUIRED)
|
||||
find_package(Ogg REQUIRED) #TODO: Not required if we aren't building the client
|
||||
find_package(Vorbis REQUIRED) #TODO: Not required if we aren't building the client
|
||||
find_package(Speex REQUIRED) #TODO: Not required if we aren't building the client
|
||||
find_package(DirectX REQUIRED)
|
||||
find_package(CURL REQUIRED)
|
||||
|
||||
if(WIN32)
|
||||
find_package(PhysX REQUIRED) #TODO: Not required if we aren't building the client
|
||||
find_package(DirectX REQUIRED)
|
||||
endif(WIN32)
|
||||
|
||||
find_package(MaxSDK) #TODO: Only find this if we are building PlasmaMax
|
||||
find_package(Bink) #TODO: Find Bink, but don't require it if plPipeline isn't built...
|
||||
# Or better yet, just eliminate bink altogether
|
||||
|
@ -5,3 +5,4 @@ add_subdirectory(plUruLauncher)
|
||||
add_subdirectory(plFileSecure)
|
||||
add_subdirectory(plFileEncrypt)
|
||||
add_subdirectory(plLogDecrypt)
|
||||
add_subdirectory(plPageInfo)
|
||||
|
@ -135,7 +135,6 @@ target_link_libraries(plClient plStreamLogger)
|
||||
target_link_libraries(plClient plSurface)
|
||||
target_link_libraries(plClient plTransform)
|
||||
target_link_libraries(plClient plUnifiedTime)
|
||||
target_link_libraries(plClient plUUID)
|
||||
target_link_libraries(plClient plVault)
|
||||
target_link_libraries(plClient pnAddrInfo)
|
||||
target_link_libraries(plClient pnAsyncCore)
|
||||
@ -161,6 +160,7 @@ target_link_libraries(plClient pnSimpleNet)
|
||||
target_link_libraries(plClient pnTimer)
|
||||
target_link_libraries(plClient pnUtils)
|
||||
target_link_libraries(plClient pnUtilsExe)
|
||||
target_link_libraries(plClient pnUUID)
|
||||
|
||||
if(PYTHON_DEBUG_LIBRARY)
|
||||
target_link_libraries(plClient debug ${PYTHON_DEBUG_LIBRARY})
|
||||
|
@ -12,7 +12,6 @@ set(plFileEncrypt_SOURCES
|
||||
)
|
||||
|
||||
add_executable(plFileEncrypt ${plFileEncrypt_SOURCES})
|
||||
target_link_libraries(plFileEncrypt CoreLib CoreLibExe plFile plUnifiedTime pnProduct pnUtils)
|
||||
target_link_libraries(plFileEncrypt Rpcrt4)
|
||||
target_link_libraries(plFileEncrypt CoreLib CoreLibExe pnProduct plFile)
|
||||
|
||||
source_group("Source Files" FILES ${plFileEncrypt_SOURCES})
|
||||
|
@ -41,7 +41,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*==LICENSE==*/
|
||||
#include "plFile/hsFiles.h"
|
||||
#include "plFile/plEncryptedStream.h"
|
||||
#include "pnUtils/pnUtils.h"
|
||||
#include "pnProduct/pnProduct.h"
|
||||
#include "hsUtils.h"
|
||||
|
||||
|
@ -12,7 +12,6 @@ set(plFileSecure_SOURCES
|
||||
)
|
||||
|
||||
add_executable(plFileSecure ${plFileSecure_SOURCES})
|
||||
target_link_libraries(plFileSecure CoreLib CoreLibExe plFile plUnifiedTime pnProduct pnUtils)
|
||||
target_link_libraries(plFileSecure Rpcrt4)
|
||||
target_link_libraries(plFileSecure CoreLib CoreLibExe pnProduct plFile)
|
||||
|
||||
source_group("Source Files" FILES ${plFileSecure_SOURCES})
|
||||
|
@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plFile/hsFiles.h"
|
||||
#include "plFile/plFileUtils.h"
|
||||
#include "plFile/plSecureStream.h"
|
||||
#include "pnUtils/pnUtils.h"
|
||||
#include "pnProduct/pnProduct.h"
|
||||
#include "hsUtils.h"
|
||||
|
||||
|
@ -12,7 +12,6 @@ set(plLogDecrypt_SOURCES
|
||||
)
|
||||
|
||||
add_executable(plLogDecrypt ${plLogDecrypt_SOURCES})
|
||||
target_link_libraries(plLogDecrypt CoreLib CoreLibExe plFile plUnifiedTime plStatusLog pnProduct pnUtils)
|
||||
target_link_libraries(plLogDecrypt Rpcrt4)
|
||||
target_link_libraries(plLogDecrypt CoreLib CoreLibExe plStatusLog pnProduct)
|
||||
|
||||
source_group("Source Files" FILES ${plLogDecrypt_SOURCES})
|
||||
|
@ -45,8 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*
|
||||
***/
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
#include "hsTypes.h"
|
||||
#include "hsUtils.h"
|
||||
#include "plStatusLog/plEncryptLogLine.h"
|
||||
|
||||
void IProcessFile(const char *path)
|
||||
|
18
Sources/Plasma/Apps/plPageInfo/CMakeLists.txt
Normal file
18
Sources/Plasma/Apps/plPageInfo/CMakeLists.txt
Normal file
@ -0,0 +1,18 @@
|
||||
include_directories("../../Apps")
|
||||
include_directories("../../CoreLib")
|
||||
include_directories("../../FeatureLib/inc")
|
||||
include_directories("../../FeatureLib")
|
||||
include_directories("../../NucleusLib/inc")
|
||||
include_directories("../../NucleusLib")
|
||||
include_directories("../../PubUtilLib/inc")
|
||||
include_directories("../../PubUtilLib")
|
||||
|
||||
set(plPageInfo_SOURCES
|
||||
plAllCreatables.cpp
|
||||
plPageInfo.cpp
|
||||
)
|
||||
|
||||
add_executable(plPageInfo ${plPageInfo_SOURCES})
|
||||
target_link_libraries(plPageInfo CoreLib CoreLibExe pnProduct plResMgr plAudioCore)
|
||||
|
||||
source_group("Source Files" FILES ${plPageInfo_SOURCES})
|
@ -41,7 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*==LICENSE==*/
|
||||
#include "hsTypes.h"
|
||||
|
||||
#include "../pnFactory/plCreator.h"
|
||||
#include "pnFactory/plCreator.h"
|
||||
|
||||
#include "plAudible.h"
|
||||
REGISTER_NONCREATABLE( plAudible );
|
||||
@ -55,16 +55,16 @@ 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 "../pnTimer/pnTimerCreatable.h"
|
||||
#include "pnDispatch/pnDispatchCreatable.h"
|
||||
#include "pnKeyedObject/pnKeyedObjectCreatable.h"
|
||||
#include "pnMessage/pnMessageCreatable.h"
|
||||
#include "pnModifier/pnModifierCreatable.h"
|
||||
#include "pnNetCommon/pnNetCommonCreatable.h"
|
||||
#include "pnTimer/pnTimerCreatable.h"
|
||||
|
||||
#include "../plResMgr/plResMgrCreatable.h"
|
||||
#include "plResMgr/plResMgrCreatable.h"
|
||||
|
||||
#include "../plMessage/plResMgrHelperMsg.h"
|
||||
#include "plMessage/plResMgrHelperMsg.h"
|
||||
REGISTER_CREATABLE(plResMgrHelperMsg);
|
||||
|
||||
#include "../plAudioCore/plAudioCoreCreatable.h"
|
||||
#include "plAudioCore/plAudioCoreCreatable.h"
|
||||
|
@ -41,21 +41,20 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*==LICENSE==*/
|
||||
#include "hsUtils.h"
|
||||
#include "hsTimer.h"
|
||||
#include "../plFile/hsFiles.h"
|
||||
#include "../plFile/plFileUtils.h"
|
||||
#include "../plResMgr/plResManager.h"
|
||||
#include "../plResMgr/plResMgrSettings.h"
|
||||
#include "plFile/hsFiles.h"
|
||||
#include "plFile/plFileUtils.h"
|
||||
#include "plResMgr/plResManager.h"
|
||||
#include "plResMgr/plResMgrSettings.h"
|
||||
|
||||
#include "../plAgeDescription/plAgeManifest.h"
|
||||
#include "plAgeDescription/plAgeManifest.h"
|
||||
|
||||
#include "../plResMgr/plRegistryHelpers.h"
|
||||
#include "../plResMgr/plRegistryNode.h"
|
||||
#include "plResMgr/plRegistryHelpers.h"
|
||||
#include "plResMgr/plRegistryNode.h"
|
||||
|
||||
#include "../plAudioCore/plSoundBuffer.h"
|
||||
#include "plAudioCore/plSoundBuffer.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
#include "../pnUtils/pnUtils.h"
|
||||
#include "../pnProduct/pnProduct.h"
|
||||
#include "pnProduct/pnProduct.h"
|
||||
|
||||
|
||||
//// Globals /////////////////////////////////////////////////////////////////
|
||||
@ -70,7 +69,7 @@ void PrintVersion()
|
||||
{
|
||||
wchar productString[256];
|
||||
ProductString(productString, arrsize(productString));
|
||||
_putws(productString);
|
||||
printf("%S\n\n", productString);
|
||||
}
|
||||
|
||||
//// PrintHelp ///////////////////////////////////////////////////////////////
|
||||
|
@ -48,10 +48,26 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include <string>
|
||||
#include <algorithm>
|
||||
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
# include <direct.h>
|
||||
|
||||
# define getcwd _getcwd
|
||||
# define chdir _chdir
|
||||
|
||||
# ifndef MAXPATHLEN
|
||||
# define MAXPATHLEN MAX_PATH
|
||||
# endif
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
# include <unistd.h>
|
||||
# include <sys/param.h>
|
||||
#endif
|
||||
|
||||
static const char* kPackFileName = "python.pak";
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
static const char* kGlueFile = ".\\plasma\\glue.py";
|
||||
#else
|
||||
static const char* kGlueFile = "./plasma/glue.py";
|
||||
#endif
|
||||
static char* glueFile = (char*)kGlueFile;
|
||||
|
||||
void WritePythonFile(std::string fileName, std::string path, hsStream *s)
|
||||
@ -267,16 +283,22 @@ void FindSubDirs(std::vector<std::string> &dirnames, const char *path)
|
||||
// adds or removes the ending slash in a path as necessary
|
||||
std::string AdjustEndingSlash(std::string path, bool endingSlash = false)
|
||||
{
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
char slash = '\\';
|
||||
#else
|
||||
char slash = '/';
|
||||
#endif
|
||||
|
||||
std::string retVal = path;
|
||||
bool endSlashExists = false;
|
||||
char temp = path[path.length()-1];
|
||||
if (temp == '\\')
|
||||
if (temp == slash)
|
||||
endSlashExists = true;
|
||||
|
||||
if (endingSlash)
|
||||
{
|
||||
if (!endSlashExists)
|
||||
retVal += "\\";
|
||||
retVal += slash;
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -294,17 +316,23 @@ std::string AdjustEndingSlash(std::string path, bool endingSlash = false)
|
||||
// appends partialPath onto the end of fullPath, inserting or removing slashes as necesssary
|
||||
std::string ConcatDirs(std::string fullPath, std::string partialPath)
|
||||
{
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
char slash = '\\';
|
||||
#else
|
||||
char slash = '/';
|
||||
#endif
|
||||
|
||||
bool fullSlash = false, partialSlash = false;
|
||||
char temp = fullPath[fullPath.length()-1];
|
||||
if (temp == '\\')
|
||||
if (temp == slash)
|
||||
fullSlash = true;
|
||||
temp = partialPath[0];
|
||||
if (temp == '\\')
|
||||
if (temp == slash)
|
||||
partialSlash = true;
|
||||
|
||||
std::string retVal = "";
|
||||
if (!fullSlash)
|
||||
retVal = fullPath + "\\";
|
||||
retVal = fullPath + slash;
|
||||
if (partialSlash)
|
||||
{
|
||||
std::string temp = "";
|
||||
@ -346,7 +374,7 @@ void PackDirectory(std::string dir, std::string rootPath, std::string pakName, s
|
||||
|
||||
printf("\nCreating %s using the contents of %s\n",pakName.c_str(),dir.c_str());
|
||||
printf("Changing working directory to %s\n",rootPath.c_str());
|
||||
if (_chdir(rootPath.c_str()))
|
||||
if (chdir(rootPath.c_str()))
|
||||
{
|
||||
printf("ERROR: Directory change to %s failed for some reason\n",rootPath.c_str());
|
||||
printf("Unable to continue with the packing of this directory, aborting...\n");
|
||||
@ -428,12 +456,12 @@ void PrintUsage()
|
||||
printf(" must be a relative path to the current working directory\n");
|
||||
}
|
||||
|
||||
void main(int argc, char *argv[])
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
printf("The Python Pack Utility\n");
|
||||
|
||||
char buffer[_MAX_PATH];
|
||||
_getcwd(buffer,_MAX_PATH);
|
||||
char buffer[MAXPATHLEN];
|
||||
getcwd(buffer, MAXPATHLEN);
|
||||
std::string baseWorkingDir = buffer;
|
||||
|
||||
// are they asking for usage?
|
||||
@ -445,14 +473,14 @@ void main(int argc, char *argv[])
|
||||
|| (temp == "-h") || (temp == "/h"))
|
||||
{
|
||||
PrintUsage();
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
// wrong number of args, print usage
|
||||
if (argc > 2)
|
||||
{
|
||||
PrintUsage();
|
||||
return;
|
||||
return -1;
|
||||
}
|
||||
|
||||
std::vector<std::string> dirNames;
|
||||
@ -476,4 +504,6 @@ void main(int argc, char *argv[])
|
||||
{
|
||||
PackDirectory(dirNames[i],rootPath,rootPath+dirNames[i]+".pak",dirNames);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
@ -87,6 +87,9 @@ set(CoreLib_HEADERS
|
||||
)
|
||||
|
||||
add_library(CoreLib STATIC ${CoreLib_SOURCES} ${CoreLib_HEADERS})
|
||||
if(UNIX)
|
||||
target_link_libraries(CoreLib pthread)
|
||||
endif(UNIX)
|
||||
|
||||
source_group("Source Files" FILES ${CoreLib_SOURCES})
|
||||
source_group("Header Files" FILES ${CoreLib_HEADERS})
|
||||
|
@ -80,4 +80,23 @@ void CCritSect::Enter () {
|
||||
void CCritSect::Leave () {
|
||||
LeaveCriticalSection(&m_handle);
|
||||
}
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
//===========================================================================
|
||||
CCritSect::CCritSect () {
|
||||
m_handle = PTHREAD_MUTEX_INITIALIZER;
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
CCritSect::~CCritSect () {
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
void CCritSect::Enter () {
|
||||
pthread_mutex_lock(&m_handle);
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
void CCritSect::Leave () {
|
||||
pthread_mutex_unlock(&m_handle);
|
||||
}
|
||||
#endif
|
||||
|
@ -61,6 +61,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#ifdef HS_BUILD_FOR_WIN32
|
||||
typedef CRITICAL_SECTION CritSectHandle;
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
# include <pthread.h>
|
||||
typedef pthread_mutex_t CritSectHandle;
|
||||
#else
|
||||
# error "CCritSect: Not implemented on this platform"
|
||||
#endif
|
||||
|
@ -404,7 +404,8 @@ void hsMatrix44::MakeZRotation(hsScalar radians)
|
||||
//
|
||||
hsMatrix44& hsMatrix44::Make(const hsPoint3* f, const hsPoint3* at, const hsVector3* up)
|
||||
{
|
||||
MakeTranslateMat(&hsVector3(f->fX, f->fY, f->fZ));
|
||||
hsVector3 trans(f->fX, f->fY, f->fZ);
|
||||
MakeTranslateMat(&trans);
|
||||
|
||||
hsVector3 back (f,at); // Z
|
||||
back.Normalize();
|
||||
@ -435,7 +436,8 @@ hsMatrix44& hsMatrix44::Make(const hsPoint3* f, const hsPoint3* at, const hsVect
|
||||
//
|
||||
hsMatrix44& hsMatrix44::MakeUpPreserving(const hsPoint3* f, const hsPoint3* at, const hsVector3* up)
|
||||
{
|
||||
MakeTranslateMat(&hsVector3(f->fX, f->fY, f->fZ));
|
||||
hsVector3 trans(f->fX, f->fY, f->fZ);
|
||||
MakeTranslateMat(&trans);
|
||||
|
||||
hsVector3 topHead = *up;
|
||||
topHead.Normalize();
|
||||
|
@ -56,7 +56,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
***/
|
||||
|
||||
static bool s_skipBreak;
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
static CCritSect * s_critsect;
|
||||
#endif
|
||||
|
||||
// User options
|
||||
static bool s_options[kNumErrorOptions];
|
||||
@ -69,12 +71,14 @@ static bool s_options[kNumErrorOptions];
|
||||
***/
|
||||
|
||||
//===========================================================================
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
AUTO_INIT_FUNC(hsExeErrorInit) {
|
||||
// The critical section has to be initialized
|
||||
// before program startup and never freed
|
||||
static byte rawMemory[sizeof(CCritSect)];
|
||||
s_critsect = new(rawMemory) CCritSect;
|
||||
}
|
||||
#endif
|
||||
|
||||
//============================================================================
|
||||
static void DoAssert (int line, const char file[], const char msg[]) {
|
||||
@ -118,7 +122,7 @@ static void DoAssert (int line, const char file[], const char msg[]) {
|
||||
|
||||
//============================================================================
|
||||
#pragma auto_inline(off)
|
||||
void __cdecl ErrorFatal (int line, const char file[], const char fmt[], ...) {
|
||||
void CDECL ErrorFatal (int line, const char file[], const char fmt[], ...) {
|
||||
char buffer[256];
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
@ -135,7 +139,7 @@ void __cdecl ErrorFatal (int line, const char file[], const char fmt[], ...) {
|
||||
|
||||
//============================================================================
|
||||
#pragma auto_inline(off)
|
||||
void __cdecl ErrorAssert (int line, const char file[], const char fmt[], ...) {
|
||||
void CDECL ErrorAssert (int line, const char file[], const char fmt[], ...) {
|
||||
char buffer[256];
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
@ -250,7 +254,7 @@ void DebugMsgV (const char fmt[], va_list args) {
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void __cdecl DebugMsg (const char fmt[], ...) {
|
||||
void CDECL DebugMsg (const char fmt[], ...) {
|
||||
#ifdef HS_DEBUGGING
|
||||
|
||||
va_list args;
|
||||
|
@ -591,14 +591,16 @@ void * MemRealloc (void * ptr, unsigned bytes, unsigned flags, const char file[]
|
||||
//===========================================================================
|
||||
unsigned MemSize (void * ptr) {
|
||||
ASSERT(ptr);
|
||||
unsigned result;
|
||||
unsigned result = 0;
|
||||
|
||||
#ifdef MEM_DEBUG
|
||||
const _CrtMemBlockHeader * pHead = pHdr(ptr);
|
||||
unsigned block = pHead->nBlockUse;
|
||||
#endif
|
||||
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
result = (unsigned)_msize_dbg(ptr, block);
|
||||
#endif
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@ -206,7 +206,7 @@ void pfVehicle::IMeasurePathCurvature(const float elapsedTime)
|
||||
{
|
||||
if (elapsedTime > 0)
|
||||
{
|
||||
const hsVector3 deltaPosition(&fLastPos, &Position());
|
||||
const hsVector3 deltaPosition(&fLastPos, &fPos);
|
||||
const hsVector3 deltaForward = (fLastForward - Forward()) / deltaPosition.Magnitude();
|
||||
const hsVector3 lateral = PerpendicularComponent(deltaForward, Forward());
|
||||
const float sign = ((lateral * Side()) < 0) ? 1.0f : -1.0f;
|
||||
@ -529,7 +529,9 @@ hsBool pfBoid::IInBoidNeighborhood(const pfVehicle &other, const float minDistan
|
||||
return false;
|
||||
else
|
||||
{
|
||||
const hsVector3 offset(&(other.Position()), &Position());
|
||||
hsPoint3 selfpos = Position();
|
||||
hsPoint3 otherpos = other.Position();
|
||||
const hsVector3 offset(&otherpos, &selfpos);
|
||||
const float distanceSquared = offset.MagnitudeSquared();
|
||||
|
||||
// definitely in neighborhood if inside minDistance sphere
|
||||
@ -576,14 +578,17 @@ hsVector3 pfBoid::ISteerForSeek(const hsPoint3 &target)
|
||||
plDebugGeometry::Instance()->DrawLine(Position(), target, DEBUG_COLOR_RED);
|
||||
#endif
|
||||
|
||||
const hsVector3 desiredVelocity(&target, &Position());
|
||||
hsPoint3 pos = Position();
|
||||
const hsVector3 desiredVelocity(&target, &pos);
|
||||
return desiredVelocity - Velocity();
|
||||
}
|
||||
|
||||
hsVector3 pfBoid::ISteerToGoal(pfBoidGoal &goal, float maxPredictionTime)
|
||||
{
|
||||
// offset from this to quarry, that distance, unit vector toward quarry
|
||||
const hsVector3 offset(&goal.Position(), &Position());
|
||||
hsPoint3 gpos = goal.Position();
|
||||
hsPoint3 pos = Position();
|
||||
const hsVector3 offset(&gpos, &pos);
|
||||
const float distance = offset.Magnitude();
|
||||
if (distance == 0) // nowhere to go
|
||||
return hsVector3(0, 0, 0);
|
||||
@ -680,7 +685,9 @@ hsVector3 pfBoid::ISteerForSeparation(const float maxDistance, const float cosMa
|
||||
// add in steering contribution
|
||||
// (opposite of the offset direction, divided once by distance
|
||||
// to normalize, divided another time to get 1/d falloff)
|
||||
const hsVector3 offset(&((**other).Position()), &Position());
|
||||
hsPoint3 pos = Position();
|
||||
hsPoint3 otherpos = (**other).Position();
|
||||
const hsVector3 offset(&otherpos, &pos);
|
||||
const float distanceSquared = offset * offset;
|
||||
steering += (offset / -distanceSquared);
|
||||
|
||||
@ -727,7 +734,9 @@ hsVector3 pfBoid::ISteerForCohesion(const float maxDistance, const float cosMaxA
|
||||
// correcting direction, then normalize to pure direction
|
||||
if (neighbors > 0)
|
||||
{
|
||||
hsVector3 posVector(&(Position()), &(hsPoint3(0,0,0))); // quick hack to turn a point into a vector
|
||||
hsPoint3 pos = Position();
|
||||
hsPoint3 zero(0, 0, 0);
|
||||
hsVector3 posVector(&pos, &zero); // quick hack to turn a point into a vector
|
||||
steering = ((steering / (float)neighbors) - posVector);
|
||||
steering.Normalize();
|
||||
}
|
||||
|
@ -168,8 +168,9 @@ void plBlower::ISetTargetTransform()
|
||||
hsPoint3 pos = l2p.GetTranslate();
|
||||
pos += fCurrDel;
|
||||
|
||||
hsPoint3 neg = -pos;
|
||||
l2p.SetTranslate(&pos);
|
||||
p2l.SetTranslate(&-pos);
|
||||
p2l.SetTranslate(&neg);
|
||||
|
||||
ci->SetLocalToParent(l2p, p2l);
|
||||
}
|
||||
|
@ -81,8 +81,9 @@ hsBool plFollowMod::MsgReceive(plMessage* msg)
|
||||
{
|
||||
hsVector3 pos;
|
||||
pos.Set(list->GetPosition().fX, list->GetPosition().fY, list->GetPosition().fZ);
|
||||
hsVector3 neg = -pos;
|
||||
fLeaderL2W.MakeTranslateMat(&pos);
|
||||
fLeaderW2L.MakeTranslateMat(&-pos);
|
||||
fLeaderW2L.MakeTranslateMat(&neg);
|
||||
fLeaderSet = true;
|
||||
|
||||
return true;
|
||||
|
@ -61,6 +61,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "pnMessage/plCameraMsg.h"
|
||||
#include "pnTimer/plTimerCallbackManager.h"
|
||||
#include "plVault/plVault.h"
|
||||
#include "pnNetCommon/plCreatableUuid.h"
|
||||
#include "plNetClient/plNetClientMgr.h"
|
||||
#include "plNetClient/plNetLinkingMgr.h"
|
||||
#include "plNetTransport/plNetTransport.h"
|
||||
|
@ -44,7 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "plNetCommon/plNetServerSessionInfo.h"
|
||||
#include "plUUID/plUUID.h"
|
||||
#include "pnUUID/pnUUID.h"
|
||||
|
||||
#include <Python.h>
|
||||
#include "pyGlueHelpers.h"
|
||||
|
@ -6,9 +6,9 @@ include_directories(../../PubUtilLib)
|
||||
if(Bink_SDK_AVAILABLE)
|
||||
include_directories(${Bink_INCLUDE_DIR})
|
||||
endif()
|
||||
include_directories(${DirectX_INCLUDE_DIR})
|
||||
|
||||
if(WIN32)
|
||||
include_directories(${DirectX_INCLUDE_DIR})
|
||||
add_definitions(-DWIN32)
|
||||
endif(WIN32)
|
||||
|
||||
|
@ -32,3 +32,4 @@ add_subdirectory(pnSimpleNet)
|
||||
add_subdirectory(pnTimer)
|
||||
add_subdirectory(pnUtils)
|
||||
add_subdirectory(pnUtilsExe)
|
||||
add_subdirectory(pnUUID)
|
||||
|
@ -30,6 +30,7 @@ set(pnNucleusInc_SOURCES
|
||||
)
|
||||
|
||||
add_library(pnNucleusInc STATIC ${pnNucleusInc_HEADERS} ${pnNucleusInc_SOURCES})
|
||||
target_link_libraries(pnNucleusInc CoreLib pnTimer)
|
||||
|
||||
source_group("Header Files" FILES ${pnNucleusInc_HEADERS})
|
||||
source_group("Source Files" FILES ${pnNucleusInc_SOURCES})
|
||||
|
@ -9,6 +9,10 @@ set(pnAddrInfo_HEADERS
|
||||
)
|
||||
|
||||
add_library(pnAddrInfo STATIC ${pnAddrInfo_SOURCES} ${pnAddrInfo_HEADERS})
|
||||
target_link_libraries(pnAddrInfo CoreLib)
|
||||
if(WIN32)
|
||||
target_link_libraries(pnAddrInfo ws2_32)
|
||||
endif(WIN32)
|
||||
|
||||
source_group("Source Files" FILES ${pnAddrInfo_SOURCES})
|
||||
source_group("Header Files" FILES ${pnAddrInfo_HEADERS})
|
@ -1,7 +1,7 @@
|
||||
include_directories(../../CoreLib)
|
||||
include_directories(../../NucleusLib)
|
||||
include_directories(../../NucleusLib/inc)
|
||||
include_directories("../../PubUtilLib")
|
||||
include_directories(../../PubUtilLib)
|
||||
|
||||
set(pnDispatch_SOURCES
|
||||
plDispatch.cpp
|
||||
@ -15,6 +15,7 @@ set(pnDispatch_HEADERS
|
||||
)
|
||||
|
||||
add_library(pnDispatch STATIC ${pnDispatch_SOURCES} ${pnDispatch_HEADERS})
|
||||
target_link_libraries(pnDispatch pnNucleusInc)
|
||||
|
||||
source_group("Source Files" FILES ${pnDispatch_SOURCES})
|
||||
source_group("Header Files" FILES ${pnDispatch_HEADERS})
|
@ -13,6 +13,7 @@ set(pnFactory_HEADERS
|
||||
)
|
||||
|
||||
add_library(pnFactory STATIC ${pnFactory_SOURCES} ${pnFactory_HEADERS})
|
||||
target_link_libraries(pnFactory CoreLib)
|
||||
|
||||
source_group("Source Files" FILES ${pnFactory_SOURCES})
|
||||
source_group("Header Files" FILES ${pnFactory_HEADERS})
|
@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#ifndef plOSMsg_inc
|
||||
#define plOSMsg_inc
|
||||
|
||||
#include <windows.h>
|
||||
#include "hsWindows.h"
|
||||
|
||||
//
|
||||
// This enum wraps all of the OS messages
|
||||
|
@ -24,6 +24,7 @@ set(pnKeyedObject_SOURCES
|
||||
)
|
||||
|
||||
add_library(pnKeyedObject STATIC ${pnKeyedObject_HEADERS} ${pnKeyedObject_SOURCES})
|
||||
target_link_libraries(pnKeyedObject CoreLib pnMessage)
|
||||
|
||||
source_group("Header Files" FILES ${pnKeyedObject_HEADERS})
|
||||
source_group("Source Files" FILES ${pnKeyedObject_SOURCES})
|
||||
|
@ -59,6 +59,7 @@ set(pnMessage_SOURCES
|
||||
)
|
||||
|
||||
add_library(pnMessage STATIC ${pnMessage_HEADERS} ${pnMessage_SOURCES})
|
||||
target_link_libraries(pnMessage CoreLib pnNetCommon)
|
||||
|
||||
source_group("Header Files" FILES ${pnMessage_HEADERS})
|
||||
source_group("Source Files" FILES ${pnMessage_SOURCES})
|
||||
|
@ -4,6 +4,7 @@ include_directories("../../NucleusLib/inc")
|
||||
include_directories("../../PubUtilLib")
|
||||
|
||||
set(pnNetCommon_HEADERS
|
||||
plCreatableUuid.h
|
||||
plGenericVar.h
|
||||
plNetAddress.h
|
||||
plNetApp.h
|
||||
@ -33,6 +34,7 @@ set(pnNetCommon_SOURCES
|
||||
)
|
||||
|
||||
add_library(pnNetCommon STATIC ${pnNetCommon_HEADERS} ${pnNetCommon_SOURCES})
|
||||
target_link_libraries(pnNetCommon pnAddrInfo plStatusLog)
|
||||
|
||||
source_group("Header Files" FILES ${pnNetCommon_HEADERS})
|
||||
source_group("Source Files" FILES ${pnNetCommon_SOURCES})
|
||||
|
61
Sources/Plasma/NucleusLib/pnNetCommon/plCreatableUuid.h
Normal file
61
Sources/Plasma/NucleusLib/pnNetCommon/plCreatableUuid.h
Normal file
@ -0,0 +1,61 @@
|
||||
/*==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 pnCreatableUUID_h_inc
|
||||
#define pnCreatableUUID_h_inc
|
||||
|
||||
#include "pnUUID/pnUUID.h"
|
||||
#include "pnFactory/plCreatable.h"
|
||||
|
||||
class plCreatableUuid : public plUUID, public plCreatable {
|
||||
public:
|
||||
CLASSNAME_REGISTER( plCreatableUuid );
|
||||
GETINTERFACE_ANY( plCreatableUuid, plCreatable );
|
||||
|
||||
plCreatableUuid() { }
|
||||
plCreatableUuid(const plCreatableUuid& other) : plUUID(other) { }
|
||||
plCreatableUuid(const plUUID& other) : plUUID(other) { }
|
||||
|
||||
void Read( hsStream * s, hsResMgr* ) { plUUID::Read(s); }
|
||||
void Write( hsStream * s, hsResMgr* ) { plUUID::Write(s); }
|
||||
};
|
||||
|
||||
#endif //pnCreatableUUID_h_inc
|
@ -57,6 +57,9 @@ REGISTER_CREATABLE( plCreatableGenericValue );
|
||||
#include "pnNetCommon.h"
|
||||
REGISTER_CREATABLE( plCreatableStream );
|
||||
|
||||
#include "plCreatableUuid.h"
|
||||
REGISTER_CREATABLE( plCreatableUuid );
|
||||
|
||||
|
||||
#endif // pnNetCommonCreatable_inc
|
||||
|
||||
|
@ -20,5 +20,7 @@ set(pnProduct_PRIVATE
|
||||
|
||||
add_library(pnProduct STATIC ${pnProduct_HEADERS} ${pnProduct_PRIVATE})
|
||||
|
||||
target_link_libraries(pnProduct CoreLib pnUUID)
|
||||
|
||||
source_group("Header Files" FILES ${pnProduct_HEADERS})
|
||||
source_group("Private" FILES ${pnProduct_PRIVATE})
|
||||
|
@ -50,7 +50,4 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#endif
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNPRODUCT_PCH_H
|
||||
|
||||
|
||||
#include "pnUtils/pnUtils.h"
|
||||
|
||||
#include "Private/pnPrAllIncludes.h"
|
||||
|
@ -49,7 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNPRODUCT_PRIVATE_PNPRALLINCLUDES_H
|
||||
|
||||
|
||||
#include "pnUtils/pnUtils.h"
|
||||
//#include "pnUtils/pnUtils.h"
|
||||
#include "pnUUID/pnUUID.h"
|
||||
|
||||
#include "pnPrBuildId.h"
|
||||
#include "pnPrBranchId.h"
|
||||
|
@ -61,7 +61,7 @@ namespace Uru {
|
||||
static const wchar kCoreName[] = L"UruLive";
|
||||
static const wchar kShortName[] = L"UruLive";
|
||||
static const wchar kLongName[] = L"Uru Live";
|
||||
static const Uuid kId(L"ea489821-6c35-4bd0-9dae-bb17c585e680");
|
||||
static const plUUID kId("ea489821-6c35-4bd0-9dae-bb17c585e680");
|
||||
}
|
||||
|
||||
// @@@: add your product namespace here
|
||||
@ -96,7 +96,7 @@ namespace Uru {
|
||||
***/
|
||||
|
||||
//============================================================================
|
||||
const Uuid & ProductId () {
|
||||
const plUUID& ProductId () {
|
||||
return PRODUCT_ID;
|
||||
}
|
||||
|
||||
@ -119,7 +119,7 @@ const wchar * ProductLongName () {
|
||||
//============================================================================
|
||||
void ProductString (wchar * dest, unsigned destChars) {
|
||||
// Example: "UruLive.2.214 - External.Release"
|
||||
StrPrintf(
|
||||
swprintf(
|
||||
dest,
|
||||
destChars,
|
||||
L"%s.%u.%u - %s.%s",
|
||||
|
@ -83,7 +83,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*
|
||||
***/
|
||||
|
||||
const Uuid & ProductId ();
|
||||
const plUUID& ProductId ();
|
||||
const wchar * ProductCoreName (); // e.g: L"Uru"
|
||||
const wchar * ProductShortName (); // e.g: L"Uru" (filename/registry friendly)
|
||||
const wchar * ProductLongName (); // e.g: L"Uru: Ages Beyond Myst" (human friendly)
|
||||
|
@ -18,6 +18,7 @@ set(pnTimer_SOURCES
|
||||
)
|
||||
|
||||
add_library(pnTimer STATIC ${pnTimer_HEADERS} ${pnTimer_SOURCES})
|
||||
target_link_libraries(pnTimer CoreLib)
|
||||
|
||||
source_group("Header Files" FILES ${pnTimer_HEADERS})
|
||||
source_group("Source Files" FILES ${pnTimer_SOURCES})
|
||||
|
28
Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt
Normal file
28
Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt
Normal file
@ -0,0 +1,28 @@
|
||||
include_directories("../../CoreLib")
|
||||
include_directories("../../NucleusLib")
|
||||
|
||||
set(pnUUID_SOURCES
|
||||
pnUUID.cpp
|
||||
)
|
||||
|
||||
if(WIN32)
|
||||
set(pnUUID_SOURCES ${pnUUID_SOURCES} pnUUID_Win32.cpp)
|
||||
else(WIN32)
|
||||
set(pnUUID_SOURCES ${pnUUID_SOURCES} pnUUID_Unix.cpp)
|
||||
endif(WIN32)
|
||||
|
||||
set(pnUUID_HEADERS
|
||||
pnUUID.h
|
||||
)
|
||||
|
||||
add_library(pnUUID STATIC ${pnUUID_SOURCES} ${pnUUID_HEADERS})
|
||||
target_link_libraries(pnUUID CoreLib)
|
||||
if(WIN32)
|
||||
target_link_libraries(pnUUID pnUtils)
|
||||
target_link_libraries(pnUUID Rpcrt4)
|
||||
else(WIN32)
|
||||
target_link_libraries(pnUUID uuid)
|
||||
endif(WIN32)
|
||||
|
||||
source_group("Source Files" FILES ${pnUUID_SOURCES})
|
||||
source_group("Header Files" FILES ${pnUUID_HEADERS})
|
@ -39,11 +39,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plUUID.h"
|
||||
#include "pnUUID.h"
|
||||
#include "hsStream.h"
|
||||
|
||||
COMPILER_ASSERT(msizeof(Uuid, data) == msizeof(plUUID, fData));
|
||||
|
||||
plUUID::plUUID()
|
||||
{
|
||||
Clear();
|
||||
@ -59,11 +57,6 @@ plUUID::plUUID( const plUUID & other )
|
||||
CopyFrom( &other );
|
||||
}
|
||||
|
||||
plUUID::plUUID( const Uuid & uuid )
|
||||
{
|
||||
MemCopy(fData, uuid.data, sizeof(fData));
|
||||
}
|
||||
|
||||
void plUUID::Read( hsStream * s)
|
||||
{
|
||||
s->LogSubStreamPushDesc("plUUID");
|
||||
@ -75,47 +68,8 @@ void plUUID::Write( hsStream * s)
|
||||
s->Write( sizeof( fData ), (const void*)fData );
|
||||
}
|
||||
|
||||
plUUID::operator Uuid () const {
|
||||
Uuid uuid;
|
||||
MemCopy(uuid.data, fData, sizeof(uuid.data));
|
||||
return uuid;
|
||||
}
|
||||
|
||||
const char * plUUID::AsString() const {
|
||||
static std::string str;
|
||||
ToStdString(str);
|
||||
return str.c_str();
|
||||
}
|
||||
|
||||
void plUUID::CopyFrom( const plUUID * v ) {
|
||||
if (!v)
|
||||
Clear();
|
||||
else
|
||||
CopyFrom(*v);
|
||||
}
|
||||
|
||||
void plUUID::CopyFrom( const plUUID & v ) {
|
||||
MemCopy(fData, v.fData, sizeof(fData));
|
||||
}
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* plCreatableUuid
|
||||
*
|
||||
***/
|
||||
|
||||
//============================================================================
|
||||
plCreatableUuid::plCreatableUuid () {
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
plCreatableUuid::plCreatableUuid (const plCreatableUuid & other)
|
||||
: plUUID(other)
|
||||
{
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
plCreatableUuid::plCreatableUuid (const plUUID & other)
|
||||
: plUUID(other)
|
||||
{
|
||||
}
|
@ -39,13 +39,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#ifndef plUUID_h_inc
|
||||
#define plUUID_h_inc
|
||||
#ifndef pnUUID_h_inc
|
||||
#define pnUUID_h_inc
|
||||
|
||||
#include "hsTypes.h"
|
||||
#include "hsStlUtils.h"
|
||||
#ifdef HS_BUILD_FOR_WIN32
|
||||
#include "pnUtils/pnUtils.h"
|
||||
#include "pnFactory/plCreatable.h"
|
||||
#endif
|
||||
|
||||
class hsStream;
|
||||
|
||||
@ -64,7 +65,9 @@ public:
|
||||
plUUID();
|
||||
plUUID( const char * s );
|
||||
plUUID( const plUUID & other );
|
||||
#ifdef HS_BUILD_FOR_WIN32
|
||||
plUUID( const Uuid & uuid );
|
||||
#endif
|
||||
void Clear();
|
||||
bool IsNull() const;
|
||||
bool IsSet() const { return !IsNull(); }
|
||||
@ -82,23 +85,11 @@ public:
|
||||
bool operator==( const plUUID & other ) const { return IsEqualTo( &other ); }
|
||||
bool operator!=( const plUUID & other ) const { return !IsEqualTo( &other ); }
|
||||
int operator <( const plUUID & other ) const { return CompareTo( &other ); }
|
||||
#ifdef HS_BUILD_FOR_WIN32
|
||||
operator Uuid () const;
|
||||
#endif
|
||||
|
||||
static plUUID Generate();
|
||||
};
|
||||
|
||||
class plCreatableUuid : public plUUID, public plCreatable {
|
||||
public:
|
||||
CLASSNAME_REGISTER( plCreatableUuid );
|
||||
GETINTERFACE_ANY( plCreatableUuid, plCreatable );
|
||||
|
||||
plCreatableUuid ();
|
||||
plCreatableUuid (const plCreatableUuid & other);
|
||||
plCreatableUuid (const plUUID & other);
|
||||
|
||||
void Read( hsStream * s, hsResMgr* ) { plUUID::Read(s); }
|
||||
void Write( hsStream * s, hsResMgr* ) { plUUID::Write(s); }
|
||||
};
|
||||
|
||||
|
||||
#endif // plUUID_h_inc
|
||||
#endif // pnUUID_h_inc
|
@ -39,7 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plUUID.h"
|
||||
#include "pnUUID.h"
|
||||
|
||||
#ifdef HS_BUILD_FOR_UNIX
|
||||
|
@ -39,7 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
Mead, WA 99021
|
||||
|
||||
*==LICENSE==*/
|
||||
#include "plUUID.h"
|
||||
#include "pnUUID.h"
|
||||
|
||||
#ifdef HS_BUILD_FOR_WIN32
|
||||
|
||||
@ -47,6 +47,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "hsWindows.h"
|
||||
#include <rpc.h>
|
||||
|
||||
COMPILER_ASSERT(msizeof(Uuid, data) == msizeof(plUUID, fData));
|
||||
|
||||
plUUID::plUUID( const Uuid & uuid )
|
||||
{
|
||||
MemCopy(fData, uuid.data, sizeof(fData));
|
||||
}
|
||||
|
||||
void plUUID::Clear()
|
||||
{
|
||||
UuidCreateNil( (GUID *)this );
|
||||
@ -69,6 +76,23 @@ bool plUUID::IsNull() const
|
||||
return 1 == UuidIsNil( (GUID *)this, &s );
|
||||
}
|
||||
|
||||
void plUUID::CopyFrom( const plUUID * v ) {
|
||||
if (!v)
|
||||
Clear();
|
||||
else
|
||||
CopyFrom(*v);
|
||||
}
|
||||
|
||||
void plUUID::CopyFrom( const plUUID & v ) {
|
||||
MemCopy(fData, v.fData, sizeof(fData));
|
||||
}
|
||||
|
||||
plUUID::operator Uuid () const {
|
||||
Uuid uuid;
|
||||
MemCopy(uuid.data, fData, sizeof(uuid.data));
|
||||
return uuid;
|
||||
}
|
||||
|
||||
bool plUUID::FromString( const char * str )
|
||||
{
|
||||
Clear();
|
@ -48,5 +48,4 @@ add_subdirectory(plStreamLogger)
|
||||
add_subdirectory(plSurface)
|
||||
add_subdirectory(plTransform)
|
||||
add_subdirectory(plUnifiedTime)
|
||||
add_subdirectory(plUUID)
|
||||
add_subdirectory(plVault)
|
||||
|
@ -46,7 +46,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
//#include "hsTimer.h"
|
||||
#include "plResPatcher.h"
|
||||
#include "plBackgroundDownloader.h"
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
# include "process.h" // for getpid()
|
||||
#else
|
||||
# include <unistd.h>
|
||||
#endif
|
||||
|
||||
#include "pnProduct/pnProduct.h"
|
||||
|
||||
|
@ -52,7 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include "plAgeDescription/plAgeDescription.h"
|
||||
|
||||
#include "plUUID/plUUID.h"
|
||||
#include "pnUUID/pnUUID.h"
|
||||
|
||||
//
|
||||
// A singleton class which manages loading and unloading ages and operations associated with that
|
||||
|
@ -3,7 +3,9 @@ include_directories("../../NucleusLib/inc")
|
||||
include_directories("../../NucleusLib")
|
||||
include_directories("../../PubUtilLib")
|
||||
|
||||
if(WIN32)
|
||||
include_directories(${DirectX_INCLUDE_DIR})
|
||||
endif(WIN32)
|
||||
include_directories(${OPENAL_INCLUDE_DIR})
|
||||
include_directories(${Speex_INCLUDE_DIR})
|
||||
|
||||
|
@ -3,9 +3,13 @@ include_directories("../../NucleusLib/inc")
|
||||
include_directories("../../NucleusLib")
|
||||
include_directories("../../PubUtilLib")
|
||||
|
||||
include_directories(${DirectX_INCLUDE_DIR})
|
||||
include_directories(${Ogg_INCLUDE_DIR})
|
||||
include_directories(${Vorbis_INCLUDE_DIR})
|
||||
# We only need DirectX if we're building the Max plugin
|
||||
# TODO: Check if we actually need this at all
|
||||
if(3dsm_BUILD_PLUGIN)
|
||||
include_directories(${DirectX_INCLUDE_DIR})
|
||||
endif(3dsm_BUILD_PLUGIN)
|
||||
|
||||
set(plAudioCore_SOURCES
|
||||
plAudioFileReader.cpp
|
||||
@ -32,6 +36,8 @@ set(plAudioCore_HEADERS
|
||||
)
|
||||
|
||||
add_library(plAudioCore STATIC ${plAudioCore_SOURCES} ${plAudioCore_HEADERS})
|
||||
target_link_libraries(plAudioCore ${Ogg_LIBRARIES})
|
||||
target_link_libraries(plAudioCore ${Vorbis_LIBRARIES})
|
||||
|
||||
source_group("Source Files" FILES ${plAudioCore_SOURCES})
|
||||
source_group("Header Files" FILES ${plAudioCore_HEADERS})
|
||||
|
@ -458,9 +458,9 @@ hsScalar plAGAnimInstance::ICalcFade(hsBool &fade, hsScalar curVal, hsScalar goa
|
||||
hsScalar newVal;
|
||||
hsScalar curStep = rate * elapsed;
|
||||
if(rate > 0) {
|
||||
newVal = __min(goal, curVal + curStep);
|
||||
newVal = std::min(goal, curVal + curStep);
|
||||
} else {
|
||||
newVal = __max(goal, curVal + curStep);
|
||||
newVal = std::max(goal, curVal + curStep);
|
||||
}
|
||||
|
||||
if(newVal == goal)
|
||||
@ -593,7 +593,7 @@ void DumpAGAllocs()
|
||||
agAlloc * al = (*i).second;
|
||||
delete al;
|
||||
|
||||
i = gAGAllocs.erase(i);
|
||||
gAGAllocs.erase(i++);
|
||||
}
|
||||
hsStatusMessage("FINISHED DUMPING AG ALLOCATIONS *********************************************");
|
||||
}
|
||||
|
@ -51,7 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plAGAnimInstance.h"
|
||||
#include "plMatrixChannel.h"
|
||||
#include "plAvBrainGeneric.h"
|
||||
#include "plMultiStageBehMod.h"
|
||||
#include "plMultistageBehMod.h"
|
||||
|
||||
// global
|
||||
#include "hsUtils.h"
|
||||
|
@ -797,7 +797,8 @@ bool plIniSectionConfigSource::ReadSubSource( const char * name )
|
||||
std::vector<std::string> sections;
|
||||
for ( int i=0; i<fSections.size(); i++ )
|
||||
sections.push_back( fSections[i].c_str() );
|
||||
return fConfigInfo->ReadFrom(&plIniSectionConfigSource( name, sections ));
|
||||
plIniSectionConfigSource src(name, sections);
|
||||
return fConfigInfo->ReadFrom(&src);
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////
|
||||
|
@ -205,8 +205,10 @@ void plCluster::UnPack(UInt8* vDst, UInt16* iDst, int idxOffset, hsBounds3Ext& w
|
||||
}
|
||||
}
|
||||
}
|
||||
wBnd.Reset(&hsPoint3(minX, minY, minZ));
|
||||
wBnd.Union(&hsPoint3(maxX, maxY, maxZ));
|
||||
hsPoint3 min(minX, minY, minZ);
|
||||
wBnd.Reset(&min);
|
||||
hsPoint3 max(maxX, maxY, maxZ);
|
||||
wBnd.Union(&max);
|
||||
}
|
||||
|
||||
|
||||
|
@ -547,7 +547,8 @@ plDrawableSpans *plDrawableGenerator::GenerateConicalDrawable( hsScalar radi
|
||||
|
||||
direction.Set( 0, 0, height );
|
||||
|
||||
return GenerateConicalDrawable( hsPoint3( 0, 0, 0 ), direction, radius, material, localToWorld, blended,
|
||||
hsPoint3 zero(0, 0, 0);
|
||||
return GenerateConicalDrawable(zero, direction, radius, material, localToWorld, blended,
|
||||
multColor, retIndex, toAddTo );
|
||||
}
|
||||
|
||||
|
@ -3549,8 +3549,9 @@ plParticleSpan *plDrawableSpans::ICreateParticleIcicle( hsGMaterial *material,
|
||||
icicle->fLocalBounds.MakeEmpty();
|
||||
icicle->fWorldBounds.MakeEmpty();
|
||||
|
||||
icicle->fLocalBounds.Union( &hsPoint3(0,0,0) );
|
||||
icicle->fWorldBounds.Union( &hsPoint3(0,0,0) );
|
||||
hsPoint3 zero(0, 0, 0);
|
||||
icicle->fLocalBounds.Union( &zero );
|
||||
icicle->fWorldBounds.Union( &zero );
|
||||
|
||||
icicle->fGroupIdx = set->fGroupIdx;
|
||||
icicle->fVBufferIdx = set->fVBufferIdx;
|
||||
|
@ -103,7 +103,7 @@ hsBool plDynaBulletMgr::IHandleShot(plBulletMsg* bull)
|
||||
fCutter->SetLength(hsVector3(bull->Radius() * fScale.fX, bull->Radius() * fScale.fY, bull->Range()));
|
||||
fCutter->Set(pos, up, -bull->Dir());
|
||||
|
||||
plDynaDecalInfo& info = IGetDecalInfo(UInt32(this), GetKey());
|
||||
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(this), GetKey());
|
||||
|
||||
if( bull->PartyTime() > 0 )
|
||||
fPartyTime = bull->PartyTime();
|
||||
|
@ -348,7 +348,7 @@ hsBool plDynaDecalMgr::IWetParts(const plDynaDecalEnableMsg* enaMsg)
|
||||
const plPrintShape* shape = IGetPrintShape(enaMsg->GetShapeKey());
|
||||
if( shape )
|
||||
{
|
||||
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey());
|
||||
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
|
||||
IWetInfo(info, enaMsg);
|
||||
}
|
||||
}
|
||||
@ -362,7 +362,7 @@ hsBool plDynaDecalMgr::IWetParts(const plDynaDecalEnableMsg* enaMsg)
|
||||
const plPrintShape* shape = IGetPrintShape(avMod, fPartIDs[i]);
|
||||
if( shape )
|
||||
{
|
||||
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey());
|
||||
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
|
||||
IWetInfo(info, enaMsg);
|
||||
}
|
||||
}
|
||||
@ -381,7 +381,7 @@ hsBool plDynaDecalMgr::IWetPart(UInt32 id, const plDynaDecalEnableMsg* enaMsg)
|
||||
const plPrintShape* shape = IGetPrintShape(avMod, id);
|
||||
if( shape )
|
||||
{
|
||||
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey());
|
||||
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
|
||||
IWetInfo(info, enaMsg);
|
||||
}
|
||||
return true;
|
||||
@ -484,7 +484,7 @@ hsBool plDynaDecalMgr::MsgReceive(plMessage* msg)
|
||||
return true;
|
||||
case kRefAvatar:
|
||||
if( refMsg->GetContext() & (plRefMsg::kOnRemove|plRefMsg::kOnDestroy) )
|
||||
IRemoveDecalInfo(UInt32(refMsg->GetRef()));
|
||||
IRemoveDecalInfo(unsigned_ptr(refMsg->GetRef()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@ -537,7 +537,7 @@ plDynaDecalInfo& plDynaDecalInfo::Init(const plKey& key)
|
||||
return *this;
|
||||
}
|
||||
|
||||
plDynaDecalInfo& plDynaDecalMgr::IGetDecalInfo(UInt32 id, const plKey& key)
|
||||
plDynaDecalInfo& plDynaDecalMgr::IGetDecalInfo(unsigned_ptr id, const plKey& key)
|
||||
{
|
||||
plDynaDecalMap::iterator iter = fDecalMap.find(id);
|
||||
if( iter == fDecalMap.end() )
|
||||
|
@ -104,7 +104,7 @@ public:
|
||||
plDynaDecalInfo& Init(const plKey& key);
|
||||
};
|
||||
|
||||
typedef std::map< UInt32, plDynaDecalInfo, std::less<UInt32> > plDynaDecalMap;
|
||||
typedef std::map< unsigned_ptr, plDynaDecalInfo, std::less<unsigned_ptr> > plDynaDecalMap;
|
||||
|
||||
// plDynaDecalMgr
|
||||
// Primary responsibilities:
|
||||
@ -189,7 +189,7 @@ protected:
|
||||
hsBool IWetPart(UInt32 id, const plDynaDecalEnableMsg* enaMsg);
|
||||
void IWetInfo(plDynaDecalInfo& info, const plDynaDecalEnableMsg* enaMsg) const;
|
||||
hsScalar IHowWet(plDynaDecalInfo& info, double t) const;
|
||||
plDynaDecalInfo& IGetDecalInfo(UInt32 id, const plKey& key);
|
||||
plDynaDecalInfo& IGetDecalInfo(unsigned_ptr id, const plKey& key);
|
||||
void IRemoveDecalInfo(UInt32 id);
|
||||
void IRemoveDecalInfos(const plKey& key);
|
||||
|
||||
|
@ -115,7 +115,7 @@ hsBool plDynaFootMgr::MsgReceive(plMessage* msg)
|
||||
const plPrintShape* shape = IGetPrintShape(armMod, id);
|
||||
if( shape )
|
||||
{
|
||||
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey());
|
||||
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
|
||||
if( IPrintFromShape(shape, footMsg->IsLeft()) )
|
||||
{
|
||||
INotifyActive(info, armMod->GetKey(), id);
|
||||
@ -138,7 +138,7 @@ hsBool plDynaFootMgr::IPrintFromShape(const plPrintShape* shape, hsBool flip)
|
||||
|
||||
if( shape )
|
||||
{
|
||||
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey());
|
||||
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
|
||||
|
||||
double secs = hsTimer::GetSysSeconds();
|
||||
hsScalar wetness = IHowWet(info, secs);
|
||||
|
@ -94,7 +94,7 @@ hsBool plDynaPuddleMgr::MsgReceive(plMessage* msg)
|
||||
const plPrintShape* shape = IGetPrintShape(armMod, fPartIDs[i]);
|
||||
if( shape )
|
||||
{
|
||||
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey());
|
||||
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
|
||||
if( IRippleFromShape(shape, true) )
|
||||
{
|
||||
INotifyActive(info, armMod->GetKey(), fPartIDs[i]);
|
||||
|
@ -146,7 +146,7 @@ hsBool plDynaRippleMgr::MsgReceive(plMessage* msg)
|
||||
const plPrintShape* shape = IGetPrintShape(armMsg->fArmature, fPartIDs[i]);
|
||||
if( shape )
|
||||
{
|
||||
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey());
|
||||
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
|
||||
if( IRippleFromShape(shape, false) )
|
||||
{
|
||||
INotifyActive(info, armMsg->fArmature->GetKey(), fPartIDs[i]);
|
||||
@ -182,7 +182,7 @@ hsBool plDynaRippleMgr::IRippleFromShape(const plPrintShape* shape, hsBool force
|
||||
|
||||
hsBool retVal = false;
|
||||
|
||||
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey());
|
||||
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
|
||||
|
||||
const hsMatrix44& shapeL2W = shape->GetOwner()->GetLocalToWorld();
|
||||
|
||||
@ -191,7 +191,8 @@ hsBool plDynaRippleMgr::IRippleFromShape(const plPrintShape* shape, hsBool force
|
||||
double t = hsTimer::GetSysSeconds();
|
||||
hsScalar dt = hsScalar(t - info.fLastTime) * sRand.RandZeroToOne();
|
||||
hsBool longEnough = (dt >= kMinTime);
|
||||
hsBool farEnough = (hsVector3(&info.fLastPos, &shapeL2W.GetTranslate()).Magnitude() > kMinDist);
|
||||
hsPoint3 xlate = shapeL2W.GetTranslate();
|
||||
hsBool farEnough = (hsVector3(&info.fLastPos, &xlate).Magnitude() > kMinDist);
|
||||
if( force || longEnough || farEnough )
|
||||
{
|
||||
hsPoint3 pos = shapeL2W.GetTranslate();
|
||||
|
@ -172,7 +172,7 @@ hsBool plDynaRippleVSMgr::IRippleFromShape(const plPrintShape* shape, hsBool for
|
||||
|
||||
hsBool retVal = false;
|
||||
|
||||
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey());
|
||||
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
|
||||
|
||||
const hsMatrix44& shapeL2W = shape->GetOwner()->GetLocalToWorld();
|
||||
|
||||
@ -181,7 +181,8 @@ hsBool plDynaRippleVSMgr::IRippleFromShape(const plPrintShape* shape, hsBool for
|
||||
double t = hsTimer::GetSysSeconds();
|
||||
hsScalar dt = hsScalar(t - info.fLastTime) * sRand.RandZeroToOne();
|
||||
hsBool longEnough = (dt >= kMinTime);
|
||||
hsBool farEnough = (hsVector3(&info.fLastPos, &shapeL2W.GetTranslate()).Magnitude() > kMinDist);
|
||||
hsPoint3 xlate = shapeL2W.GetTranslate();
|
||||
hsBool farEnough = (hsVector3(&info.fLastPos, &xlate).Magnitude() > kMinDist);
|
||||
if( force || longEnough || farEnough )
|
||||
{
|
||||
hsPoint3 pos = shapeL2W.GetTranslate();
|
||||
|
@ -124,7 +124,7 @@ hsBool plDynaTorpedoMgr::IHandleShot(plBulletMsg* bull)
|
||||
fCutter->SetLength(hsVector3(scaleX, scaleY, bull->Range()));
|
||||
fCutter->Set(pos, up, -bull->Dir());
|
||||
|
||||
plDynaDecalInfo& info = IGetDecalInfo(UInt32(this), GetKey());
|
||||
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(this), GetKey());
|
||||
|
||||
if( bull->PartyTime() > 0 )
|
||||
fPartyTime = bull->PartyTime();
|
||||
|
@ -173,7 +173,7 @@ hsBool plDynaWakeMgr::IRippleFromShape(const plPrintShape* shape, hsBool force)
|
||||
|
||||
hsBool retVal = false;
|
||||
|
||||
plDynaDecalInfo& info = IGetDecalInfo(UInt32(shape), shape->GetKey());
|
||||
plDynaDecalInfo& info = IGetDecalInfo(unsigned_ptr(shape), shape->GetKey());
|
||||
|
||||
const hsMatrix44& shapeL2W = shape->GetOwner()->GetLocalToWorld();
|
||||
|
||||
@ -182,7 +182,8 @@ hsBool plDynaWakeMgr::IRippleFromShape(const plPrintShape* shape, hsBool force)
|
||||
double t = hsTimer::GetSysSeconds();
|
||||
hsScalar dt = hsScalar(t - info.fLastTime) * sRand.RandZeroToOne();
|
||||
hsBool longEnough = (dt >= kMinTime);
|
||||
hsBool farEnough = (hsVector3(&info.fLastPos, &shapeL2W.GetTranslate()).Magnitude() > kMinDist);
|
||||
hsPoint3 xlate = shapeL2W.GetTranslate();
|
||||
hsBool farEnough = (hsVector3(&info.fLastPos, &xlate).Magnitude() > kMinDist);
|
||||
if( force || longEnough || farEnough )
|
||||
{
|
||||
hsPoint3 pos = shapeL2W.GetTranslate();
|
||||
|
@ -104,7 +104,8 @@ void inline IInlSetParticlePathFollow( const plParticleCore &particle, const hsM
|
||||
|
||||
/// Follow path specified by interpreting orientation as a velocity vector.
|
||||
|
||||
hsVector3 viewDir(&particle.fPos, &viewToWorld.GetTranslate());
|
||||
hsPoint3 xlate = viewToWorld.GetTranslate();
|
||||
hsVector3 viewDir(&particle.fPos, &xlate);
|
||||
hsFastMath::NormalizeAppr(viewDir);
|
||||
|
||||
zVec = viewDir;
|
||||
@ -152,7 +153,8 @@ void inline IInlSetParticlePathStretch( const plParticleCore &particle, const hs
|
||||
// Note that we could probably slim away a normalize or two, but the actual number
|
||||
// of normalizes we're doing hasn't gone up, I've just moved them up from IInlSetParticlePoints().
|
||||
|
||||
hsVector3 viewDir(&particle.fPos, &viewToWorld.GetTranslate());
|
||||
hsPoint3 xlate = viewToWorld.GetTranslate();
|
||||
hsVector3 viewDir(&particle.fPos, &xlate);
|
||||
hsScalar invD = hsFastMath::InvSqrtAppr(viewDir.MagnitudeSquared());
|
||||
viewDir *= invD;
|
||||
|
||||
@ -191,7 +193,8 @@ void inline IInlSetParticlePathFlow( const plParticleCore &particle, const hsMat
|
||||
// difference is that we're going to keep the area of the particle constant,
|
||||
// so the longer it stretches, the narrower it gets orthogonal to the velocity.
|
||||
|
||||
hsVector3 viewDir(&particle.fPos, &viewToWorld.GetTranslate());
|
||||
hsPoint3 xlate = viewToWorld.GetTranslate();
|
||||
hsVector3 viewDir(&particle.fPos, &xlate);
|
||||
hsScalar invD = hsFastMath::InvSqrtAppr(viewDir.MagnitudeSquared());
|
||||
viewDir *= invD;
|
||||
|
||||
@ -242,10 +245,12 @@ void inline IInlSetParticleExplicit( const hsMatrix44 &viewToWorld, const plPart
|
||||
// to calculate the vector from camera to particle and normalize it than
|
||||
// to transform the vector (0,0,-1) (though not as fast as pulling the
|
||||
// camera direction directly from the viewToWorld).
|
||||
hsVector3 del(&particle.fPos, &viewToWorld.GetTranslate());
|
||||
hsPoint3 xlate = viewToWorld.GetTranslate();
|
||||
hsVector3 del(&particle.fPos, &xlate);
|
||||
hsFastMath::NormalizeAppr(del);
|
||||
zVec = del;
|
||||
yVec.Set(&(viewToWorld * orientation));
|
||||
hsVector3 tmp = viewToWorld * orientation;
|
||||
yVec.Set(&tmp);
|
||||
xVec = yVec % zVec;
|
||||
#endif // See notes below - mf
|
||||
|
||||
@ -320,7 +325,8 @@ void inline IInlSetNormalStrongestLight( hsVector3 &partNorm, const plParticleCo
|
||||
{
|
||||
if( omniLight != nil )
|
||||
{
|
||||
partNorm.Set( &particle.fPos, &omniLight->GetWorldPosition() );
|
||||
hsPoint3 pos = omniLight->GetWorldPosition();
|
||||
partNorm.Set( &particle.fPos, &pos );
|
||||
partNorm = -partNorm;
|
||||
}
|
||||
else if( directionLight != nil )
|
||||
|
@ -551,7 +551,8 @@ plSpaceTree* plSpaceTreeMaker::IMakeEmptyTree()
|
||||
plSpaceTree* tree = TRACKED_NEW plSpaceTree;
|
||||
|
||||
tree->fTree.SetCount(1);
|
||||
tree->fTree[0].fWorldBounds.Reset(&hsPoint3(0,0,0));
|
||||
hsPoint3 zero(0, 0, 0);
|
||||
tree->fTree[0].fWorldBounds.Reset(&zero);
|
||||
tree->fTree[0].fFlags = plSpaceTreeNode::kEmpty;
|
||||
tree->fRoot = 0;
|
||||
tree->fNumLeaves = 0;
|
||||
|
@ -31,7 +31,7 @@ set(plFile_HEADERS
|
||||
)
|
||||
|
||||
add_library(plFile STATIC ${plFile_SOURCES} ${plFile_HEADERS})
|
||||
target_link_libraries(plFile ${ZLIB_LIBRARIES})
|
||||
target_link_libraries(plFile CoreLib plUnifiedTime ${ZLIB_LIBRARIES})
|
||||
|
||||
source_group("Source Files" FILES ${plFile_SOURCES})
|
||||
source_group("Header Files" FILES ${plFile_HEADERS})
|
||||
|
@ -48,7 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#if HS_BUILD_FOR_UNIX
|
||||
#include <limits.h>
|
||||
#define kFolderIterator_MaxPath PATH_MAX
|
||||
#include <unistd.h>
|
||||
#define SetCurrentDirectory chdir
|
||||
#else
|
||||
#define kFolderIterator_MaxPath _MAX_PATH
|
||||
|
@ -103,7 +103,9 @@ hsBool plFileUtils::CreateDir( const wchar *path )
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
return ( _wmkdir( path ) == 0 ) ? true : ( errno==EEXIST );
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
return ( mkdir( path, 0777 ) == 0 ) ? true : ( errno==EEXIST );
|
||||
const char* cpath = hsWStringToString(path);
|
||||
CreateDir(cpath);
|
||||
delete[] cpath; /* Free the string */
|
||||
#endif
|
||||
}
|
||||
|
||||
@ -148,9 +150,15 @@ bool plFileUtils::RemoveFile(const char* filename, bool delReadOnly)
|
||||
|
||||
bool plFileUtils::RemoveFile(const wchar* filename, bool delReadOnly)
|
||||
{
|
||||
#ifdef HS_BUILD_FOR_WIN32
|
||||
if (delReadOnly)
|
||||
_wchmod(filename, S_IWRITE);
|
||||
return (_wunlink(filename) == 0);
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
const char* cfilename = hsWStringToString(filename);
|
||||
RemoveFile(cfilename, delReadOnly);
|
||||
delete[] cfilename; /* Free the string */
|
||||
#endif
|
||||
}
|
||||
|
||||
bool plFileUtils::FileCopy(const char* existingFile, const char* newFile)
|
||||
@ -169,8 +177,12 @@ bool plFileUtils::FileCopy(const wchar* existingFile, const wchar* newFile)
|
||||
return (::CopyFileW(existingFile, newFile, FALSE) != 0);
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
char data[1500];
|
||||
FILE* fp = fopen(existingFile, "rb");
|
||||
FILE* fw = fopen(newFile, "w");
|
||||
const char* cexisting = hsWStringToString(existingFile);
|
||||
const char* cnew = hsWStringToString(newFile);
|
||||
FILE* fp = fopen(cexisting, "rb");
|
||||
FILE* fw = fopen(cnew, "w");
|
||||
delete[] cexisting;
|
||||
delete[] cnew;
|
||||
int num = 0;
|
||||
bool retVal = true;
|
||||
if (fp && fw){
|
||||
@ -427,7 +439,22 @@ void plFileUtils::AddSlash(char* path)
|
||||
{
|
||||
char lastChar = path[strlen(path)-1];
|
||||
if (lastChar != '\\' && lastChar != '/')
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
strcat(path, "\\");
|
||||
#else
|
||||
strcat(path, "/");
|
||||
#endif
|
||||
}
|
||||
|
||||
void plFileUtils::AddSlash(wchar* path)
|
||||
{
|
||||
wchar lastChar = path[wcslen(path)-1];
|
||||
if (lastChar != L'\\' && lastChar != L'/')
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
wcscat(path, L"\\");
|
||||
#else
|
||||
wcscat(path, L"/");
|
||||
#endif
|
||||
}
|
||||
|
||||
void plFileUtils::ConcatFileName(char* path, const char* fileName)
|
||||
@ -436,6 +463,12 @@ void plFileUtils::ConcatFileName(char* path, const char* fileName)
|
||||
strcat(path, fileName);
|
||||
}
|
||||
|
||||
void plFileUtils::ConcatFileName(wchar* path, const wchar* fileName)
|
||||
{
|
||||
AddSlash(path);
|
||||
wcscat(path, fileName);
|
||||
}
|
||||
|
||||
//// GetFileSize /////////////////////////////////////////////////////////////
|
||||
|
||||
UInt32 plFileUtils::GetFileSize( const char *path )
|
||||
|
@ -107,9 +107,11 @@ namespace plFileUtils
|
||||
|
||||
// Adds a slash to the end of a filename (or does nothing if it's already there)
|
||||
void AddSlash(char* path);
|
||||
void AddSlash(wchar* path);
|
||||
|
||||
// Concatenates fileName onto path, making sure to add a slash if necessary
|
||||
void ConcatFileName(char* path, const char* fileName);
|
||||
void ConcatFileName(wchar* path, const wchar* fileName);
|
||||
|
||||
// searches the parent directory of filename for the encryption key file, and reads it
|
||||
// into the key passed in. Returns false if the key file didn't exist (and sets key to
|
||||
|
@ -46,6 +46,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#if !HS_BUILD_FOR_WIN32
|
||||
#define INVALID_HANDLE_VALUE 0
|
||||
#endif
|
||||
|
||||
// our default encryption key
|
||||
const UInt32 plSecureStream::kDefaultKey[4] = { 0x6c0a5452, 0x3827d0f, 0x3a170b92, 0x16db7fc2 };
|
||||
|
||||
@ -143,6 +147,7 @@ hsBool plSecureStream::Open(const wchar* name, const wchar* mode)
|
||||
{
|
||||
if (wcscmp(mode, L"rb") == 0)
|
||||
{
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
if (fDeleteOnExit)
|
||||
{
|
||||
fRef = CreateFileW(name,
|
||||
@ -179,6 +184,23 @@ hsBool plSecureStream::Open(const wchar* name, const wchar* mode)
|
||||
|
||||
DWORD numBytesRead;
|
||||
ReadFile(fRef, &fActualFileSize, sizeof(UInt32), &numBytesRead, NULL);
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
const char* cname = hsWStringToString(name);
|
||||
fRef = fopen(cname, "rb");
|
||||
delete[] cname;
|
||||
|
||||
fPosition = 0;
|
||||
|
||||
if (fRef == INVALID_HANDLE_VALUE)
|
||||
return false;
|
||||
|
||||
if (!ICheckMagicString(fRef))
|
||||
{
|
||||
fclose(fRef);
|
||||
fRef = INVALID_HANDLE_VALUE;
|
||||
return false;
|
||||
}
|
||||
#endif
|
||||
|
||||
// The encrypted stream is inefficient if you do reads smaller than
|
||||
// 8 bytes. Since we do a lot of those, any file under a size threshold
|
||||
@ -221,7 +243,11 @@ hsBool plSecureStream::Close()
|
||||
}
|
||||
if (fRef != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
rtn = CloseHandle(fRef);
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
rtn = fclose(fRef);
|
||||
#endif
|
||||
fRef = INVALID_HANDLE_VALUE;
|
||||
}
|
||||
|
||||
@ -248,8 +274,13 @@ UInt32 plSecureStream::IRead(UInt32 bytes, void* buffer)
|
||||
{
|
||||
if (fRef == INVALID_HANDLE_VALUE)
|
||||
return 0;
|
||||
DWORD numItems;
|
||||
bool success = (ReadFile(fRef, buffer, bytes, &numItems, NULL) != 0);
|
||||
UInt32 numItems;
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
bool success = (ReadFile(fRef, buffer, bytes, (LPDWORD)&numItems, NULL) != 0);
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
numItems = fread(buffer, bytes, 1, fRef);
|
||||
bool success = numItems != 0;
|
||||
#endif
|
||||
fBytesRead += numItems;
|
||||
fPosition += numItems;
|
||||
if ((unsigned)numItems < bytes)
|
||||
@ -281,7 +312,11 @@ void plSecureStream::IBufferFile()
|
||||
fRAMStream->Rewind();
|
||||
|
||||
fBufferedStream = true;
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
CloseHandle(fRef);
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
fclose(fRef);
|
||||
#endif
|
||||
fRef = INVALID_HANDLE_VALUE;
|
||||
fPosition = 0;
|
||||
}
|
||||
@ -305,7 +340,11 @@ void plSecureStream::Skip(UInt32 delta)
|
||||
{
|
||||
fBytesRead += delta;
|
||||
fPosition += delta;
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
SetFilePointer(fRef, delta, 0, FILE_CURRENT);
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
fseek(fRef, delta, SEEK_CUR);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -320,7 +359,11 @@ void plSecureStream::Rewind()
|
||||
{
|
||||
fBytesRead = 0;
|
||||
fPosition = 0;
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
SetFilePointer(fRef, kFileStartOffset, 0, FILE_BEGIN);
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
fseek(fRef, kFileStartOffset, SEEK_SET);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -333,7 +376,11 @@ void plSecureStream::FastFwd()
|
||||
}
|
||||
else if (fRef != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
fBytesRead = fPosition = SetFilePointer(fRef, kFileStartOffset + fActualFileSize, 0, FILE_BEGIN);
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
fBytesRead = fPosition = fseek(fRef, 0, SEEK_END);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
@ -551,11 +598,15 @@ bool plSecureStream::FileDecrypt(const wchar* fileName, UInt32* key /* = nil */)
|
||||
return true;
|
||||
}
|
||||
|
||||
bool plSecureStream::ICheckMagicString(HANDLE fp)
|
||||
bool plSecureStream::ICheckMagicString(hsFD fp)
|
||||
{
|
||||
char magicString[kMagicStringLen+1];
|
||||
DWORD numBytesRead;
|
||||
ReadFile(fp, &magicString, kMagicStringLen, &numBytesRead, NULL);
|
||||
#ifdef HS_BUILD_FOR_WIN32
|
||||
DWORD numread;
|
||||
ReadFile(fp, &magicString, kMagicStringLen, &numread, NULL);
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
fread(&magicString, kMagicStringLen, 1, fp);
|
||||
#endif
|
||||
magicString[kMagicStringLen] = '\0';
|
||||
return (hsStrEQ(magicString, kMagicString) != 0);
|
||||
}
|
||||
@ -570,7 +621,9 @@ bool plSecureStream::IsSecureFile(const char* fileName)
|
||||
|
||||
bool plSecureStream::IsSecureFile(const wchar* fileName)
|
||||
{
|
||||
HANDLE fp = INVALID_HANDLE_VALUE;
|
||||
hsFD fp = INVALID_HANDLE_VALUE;
|
||||
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
fp = CreateFileW(fileName,
|
||||
GENERIC_READ, // open for reading
|
||||
0, // no one can open the file until we're done
|
||||
@ -578,13 +631,22 @@ bool plSecureStream::IsSecureFile(const wchar* fileName)
|
||||
OPEN_EXISTING, // only open existing files (no creation)
|
||||
FILE_ATTRIBUTE_NORMAL, // normal file attributes
|
||||
NULL); // no template
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
const char* cfile = hsWStringToString(fileName);
|
||||
fp = fopen(cfile, "rb");
|
||||
delete[] cfile;
|
||||
#endif
|
||||
|
||||
if (fp == INVALID_HANDLE_VALUE)
|
||||
return false;
|
||||
|
||||
bool isEncrypted = ICheckMagicString(fp);
|
||||
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
CloseHandle(fp);
|
||||
#elif HS_BUILD_FOR_UNIX
|
||||
fclose(fp);
|
||||
#endif
|
||||
|
||||
return isEncrypted;
|
||||
}
|
||||
|
@ -43,7 +43,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#define plSecureStream_h_inc
|
||||
|
||||
#include "hsStream.h"
|
||||
|
||||
#if HS_BUILD_FOR_WIN32
|
||||
# include <windows.h>
|
||||
# define hsFD HANDLE
|
||||
#else
|
||||
# define hsFD FILE*
|
||||
#endif
|
||||
|
||||
// A slightly more secure stream then plEncryptedStream in that it uses windows file functions
|
||||
// to prevent other processes from accessing the file it is working with. It also can be set
|
||||
@ -53,7 +59,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
class plSecureStream: public hsStream
|
||||
{
|
||||
protected:
|
||||
HANDLE fRef;
|
||||
hsFD fRef;
|
||||
UInt32 fKey[4];
|
||||
|
||||
UInt32 fActualFileSize;
|
||||
@ -78,7 +84,7 @@ protected:
|
||||
|
||||
bool IWriteEncrypted(hsStream* sourceStream, const wchar* outputFile);
|
||||
|
||||
static bool ICheckMagicString(HANDLE fp);
|
||||
static bool ICheckMagicString(hsFD fp);
|
||||
|
||||
public:
|
||||
plSecureStream(hsBool deleteOnExit = false, UInt32* key = nil); // uses default key if you don't pass one in
|
||||
|
@ -46,6 +46,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "plEncryptedStream.h"
|
||||
#include "plFileUtils.h"
|
||||
|
||||
#if HS_BUILD_FOR_UNIX
|
||||
# include <wctype.h>
|
||||
#endif
|
||||
|
||||
void ToLower(std::wstring& str)
|
||||
{
|
||||
for (unsigned i = 0; i < str.length(); i++)
|
||||
|
@ -3,7 +3,9 @@ include_directories("../../NucleusLib/inc")
|
||||
include_directories("../../NucleusLib")
|
||||
include_directories("../../PubUtilLib")
|
||||
|
||||
if(WIN32)
|
||||
include_directories(${DirectX_INCLUDE_DIR})
|
||||
endif(WIN32)
|
||||
include_directories(${OPENAL_INCLUDE_DIR})
|
||||
|
||||
set(plInputCore_SOURCES
|
||||
|
@ -44,7 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#ifndef PL_INPUT_MANAGER_H
|
||||
#define PL_INPUT_MANAGER_H
|
||||
|
||||
#include <windows.h>
|
||||
#include "hsWindows.h"
|
||||
#include "hsTypes.h"
|
||||
#include "hsTemplates.h"
|
||||
#include "pnKeyedObject/hsKeyedObject.h"
|
||||
|
@ -120,7 +120,10 @@ void plAnimPath::SetCurTime(hsScalar t, UInt32 calcFlags)
|
||||
fVel.Set(pos+1, pos+0);
|
||||
fVel *= kInvSmallDelTime;
|
||||
fVel = fLocalToWorld * fVel;
|
||||
fAccel.Set(&(pos[2] - pos[1]), &(pos[1] - pos[0]));
|
||||
|
||||
hsPoint3 first = pos[2] - pos[1];
|
||||
hsPoint3 second = pos[1] - pos[0];
|
||||
fAccel.Set(&first, &second);
|
||||
fAccel *= kInvSmallDelTime * kInvSmallDelTime;
|
||||
fAccel = fLocalToWorld * fAccel;
|
||||
}
|
||||
|
@ -42,7 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#ifndef plAgeLoadedMsg_INC
|
||||
#define plAgeLoadedMsg_INC
|
||||
|
||||
#include "pnUtils/pnUtils.h"
|
||||
#include "pnMessage/plMessage.h"
|
||||
|
||||
//
|
||||
|
@ -52,7 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "hsStream.h"
|
||||
#include "hsResMgr.h"
|
||||
#include "pnMessage/plMessage.h"
|
||||
#include "pnUtils/pnUtils.h"
|
||||
#include "pnUUID/pnUUID.h"
|
||||
|
||||
class plInputInterface;
|
||||
class plInputIfaceMgrMsg : public plMessage
|
||||
@ -65,7 +65,7 @@ class plInputIfaceMgrMsg : public plMessage
|
||||
const char* ageName;
|
||||
const char* ageFileName;
|
||||
const char* spawnPoint;
|
||||
Uuid ageInstanceGuid;
|
||||
plUUID ageInstanceGuid;
|
||||
plKey fAvKey;
|
||||
public:
|
||||
|
||||
@ -125,8 +125,8 @@ class plInputIfaceMgrMsg : public plMessage
|
||||
const char* GetAgeFileName() { return ageFileName; }
|
||||
void SetSpawnPoint(const char* s) { spawnPoint = s; }
|
||||
const char* GetSpawnPoint() { return spawnPoint; }
|
||||
void SetAgeInstanceGuid(const Uuid& guid) { ageInstanceGuid = guid; }
|
||||
const Uuid& GetAgeInstanceGuid() { return ageInstanceGuid; }
|
||||
void SetAgeInstanceGuid(const plUUID& guid) { ageInstanceGuid = guid; }
|
||||
const plUUID& GetAgeInstanceGuid() { return ageInstanceGuid; }
|
||||
UInt8 GetCommand( void ) { return fCommand; }
|
||||
UInt32 GetPageID( void ) { return fPageID; }
|
||||
void SetIFace( plInputInterface *iface );
|
||||
|
@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#define plLoadAgeMsg_INC
|
||||
|
||||
#include "pnMessage/plMessage.h"
|
||||
#include "plUUID/plUUID.h"
|
||||
#include "pnUUID/pnUUID.h"
|
||||
#include "hsUtils.h"
|
||||
|
||||
//
|
||||
|
@ -45,7 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "hsConfig.h"
|
||||
#include "hsStlUtils.h"
|
||||
#include "pnFactory/plCreatable.h"
|
||||
#include "plUUID/plUUID.h"
|
||||
#include "pnUUID/pnUUID.h"
|
||||
|
||||
class plClientGuid : public plCreatable
|
||||
{
|
||||
|
@ -41,7 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
*==LICENSE==*/
|
||||
#include "plNetCommon.h"
|
||||
#include "hsStlUtils.h"
|
||||
#include "plUUID/plUUID.h"
|
||||
#include "pnUUID/pnUUID.h"
|
||||
#include <algorithm>
|
||||
|
||||
namespace plNetCommon
|
||||
|
@ -55,10 +55,6 @@ REGISTER_CREATABLE( plNetCoreStatsSummary );
|
||||
#endif // SERVER
|
||||
REGISTER_CREATABLE( plCreatableListHelper );
|
||||
|
||||
// HACK: plUUID should have it's own creatable include
|
||||
#include "../plUUID/plUUID.h"
|
||||
REGISTER_CREATABLE( plCreatableUuid );
|
||||
|
||||
#include "plClientGuid.h"
|
||||
REGISTER_CREATABLE( plClientGuid );
|
||||
#include "plNetServerSessionInfo.h"
|
||||
|
@ -47,7 +47,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
#include "pnFactory/plCreatable.h"
|
||||
#include "pnNetCommon/plNetServers.h"
|
||||
#include "plNetCommon/plSpawnPointInfo.h"
|
||||
#include "plUUID/plUUID.h"
|
||||
#include "pnUUID/pnUUID.h"
|
||||
|
||||
|
||||
class hsStream;
|
||||
|
@ -104,7 +104,8 @@ void plConvexVolume::Update(const hsMatrix44 &l2w)
|
||||
{
|
||||
// Since fN is an hsVector3, it will only apply the rotational aspect of the transform...
|
||||
fWorldPlanes[i].fN = l2w * fLocalPlanes[i].fN;
|
||||
planePt.Set(&(fLocalPlanes[i].fN * fLocalPlanes[i].fD));
|
||||
hsVector3 tmp = fLocalPlanes[i].fN * fLocalPlanes[i].fD;
|
||||
planePt.Set(&tmp);
|
||||
fWorldPlanes[i].fD = -(l2w * planePt).InnerProduct(fWorldPlanes[i].fN);
|
||||
}
|
||||
}
|
||||
|
@ -759,7 +759,8 @@ hsBool plParticleFlockEffect::ApplyEffect(const plEffectTargetInfo& target, Int3
|
||||
goal = fDissenterTarget;
|
||||
|
||||
hsVector3 goalDir;
|
||||
goalDir.Set(&(goal - pos));
|
||||
hsPoint3 tmp = goal - pos;
|
||||
goalDir.Set(&tmp);
|
||||
hsScalar distSq = goalDir.MagnitudeSquared();
|
||||
|
||||
goalDir.Normalize();
|
||||
|
@ -410,7 +410,11 @@ void plParticleEmitter::IUpdateParticles(hsScalar delta)
|
||||
|
||||
// This is the only orientation option (so far) that requires an update here
|
||||
if (fMiscFlags & (kOrientationVelocityBased | kOrientationVelocityStretch | kOrientationVelocityFlow))
|
||||
fParticleCores[i].fOrientation.Set(&(*currVelocity * delta)); // mf - want the orientation to be a delposition
|
||||
{
|
||||
// mf - want the orientation to be a delposition
|
||||
hsVector3 tmp = *currVelocity * delta;
|
||||
fParticleCores[i].fOrientation.Set(&tmp);
|
||||
}
|
||||
else if( fParticleExts[i].fRadsPerSec != 0 )
|
||||
{
|
||||
hsScalar sinX, cosX;
|
||||
|
@ -216,7 +216,8 @@ hsBool plSimpleParticleGenerator::AddAutoParticles(plParticleEmitter *emitter, f
|
||||
if( fPartRadsPerSecRange > 0 )
|
||||
radsPerSec = fPartRadsPerSecRange * sRandom.RandMinusOneToOne();
|
||||
|
||||
emitter->AddParticle(currStart, initDirection * initVelocity, tile, fXSize, fYSize, currSizeVar,
|
||||
hsVector3 tmp = initDirection * initVelocity;
|
||||
emitter->AddParticle(currStart, tmp, tile, fXSize, fYSize, currSizeVar,
|
||||
invMass, initLife, orientation, miscFlags, radsPerSec);
|
||||
}
|
||||
|
||||
|
@ -93,7 +93,7 @@ class plObjectInVolumeDetector : public plCollisionDetector
|
||||
public:
|
||||
class plCollisionBookKeepingInfo
|
||||
{
|
||||
friend plObjectInVolumeDetector;
|
||||
friend class plObjectInVolumeDetector;
|
||||
public:
|
||||
plCollisionBookKeepingInfo(plKey& hit)
|
||||
{
|
||||
|
@ -7,7 +7,9 @@ include_directories("../../PubUtilLib")
|
||||
if(Bink_SDK_AVAILABLE)
|
||||
include_directories(${Bink_INCLUDE_DIR})
|
||||
endif()
|
||||
if(WIN32)
|
||||
include_directories(${DirectX_INCLUDE_DIR})
|
||||
endif(WIN32)
|
||||
|
||||
set(plPipeline_SOURCES
|
||||
hsG3DDeviceSelector.cpp
|
||||
|
@ -448,7 +448,7 @@ public:
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include <stdio.h>
|
||||
#include "headspin.h"
|
||||
#include "HeadSpin.h"
|
||||
|
||||
class plDemoDebugFile
|
||||
{
|
||||
|
@ -70,7 +70,7 @@ plProgressMgr *plProgressMgr::fManager = nil;
|
||||
|
||||
char* plProgressMgr::fImageRotation[LOADING_RES_COUNT];
|
||||
|
||||
char* plProgressMgr::fStaticTextIDs[] = {
|
||||
const char* plProgressMgr::fStaticTextIDs[] = {
|
||||
"xLoading_Linking_Text.png",
|
||||
"xLoading_Updating_Text.png"
|
||||
};
|
||||
@ -249,7 +249,7 @@ char* plProgressMgr::GetLoadingFrameID(int index)
|
||||
return fImageRotation[0];
|
||||
}
|
||||
|
||||
char* plProgressMgr::GetStaticTextID(StaticText staticTextType)
|
||||
const char* plProgressMgr::GetStaticTextID(StaticText staticTextType)
|
||||
{
|
||||
return fStaticTextIDs[staticTextType];
|
||||
}
|
||||
|
@ -197,7 +197,7 @@ class plProgressMgr
|
||||
|
||||
static plProgressMgr *fManager;
|
||||
static char* fImageRotation[];
|
||||
static char* fStaticTextIDs[];
|
||||
static const char* fStaticTextIDs[];
|
||||
|
||||
protected:
|
||||
|
||||
@ -230,7 +230,7 @@ class plProgressMgr
|
||||
|
||||
static plProgressMgr* GetInstance() { return fManager; }
|
||||
static char* GetLoadingFrameID(int index);
|
||||
static char* GetStaticTextID(StaticText staticTextType);
|
||||
static const char* GetStaticTextID(StaticText staticTextType);
|
||||
|
||||
virtual void Draw( plPipeline *p ) { }
|
||||
|
||||
|
@ -34,6 +34,7 @@ set(plResMgr_HEADERS
|
||||
)
|
||||
|
||||
add_library(plResMgr STATIC ${plResMgr_SOURCES} ${plResMgr_HEADERS})
|
||||
target_link_libraries(plResMgr CoreLib pnDispatch pnFactory pnKeyedObject pnMessage pnTimer plFile plStatusLog)
|
||||
|
||||
source_group("Source Files" FILES ${plResMgr_SOURCES})
|
||||
source_group("Header Files" FILES ${plResMgr_HEADERS})
|
||||
|
@ -516,8 +516,8 @@ private:
|
||||
plVarDescriptor*& curVar) const;
|
||||
bool IParseStateDesc(const char* fileName, hsStream* stream, char token[], plStateDescriptor*& curDesc) const;
|
||||
|
||||
void DebugMsg(char* fmt, ...) const;
|
||||
void DebugMsgV(char* fmt, va_list args) const;
|
||||
void DebugMsg(const char* fmt, ...) const;
|
||||
void DebugMsgV(const char* fmt, va_list args) const;
|
||||
|
||||
public:
|
||||
|
||||
|
@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
||||
|
||||
static const int kTokenLen=256;
|
||||
|
||||
void plSDLParser::DebugMsg(char* fmt, ...) const
|
||||
void plSDLParser::DebugMsg(const char* fmt, ...) const
|
||||
{
|
||||
return;
|
||||
plNetApp* netApp = plSDLMgr::GetInstance()->GetNetApp();
|
||||
@ -66,7 +66,7 @@ void plSDLParser::DebugMsg(char* fmt, ...) const
|
||||
va_end(args);
|
||||
}
|
||||
|
||||
void plSDLParser::DebugMsgV(char* fmt, va_list args) const
|
||||
void plSDLParser::DebugMsgV(const char* fmt, va_list args) const
|
||||
{
|
||||
if (strlen(fmt)==nil)
|
||||
return;
|
||||
|
@ -185,7 +185,8 @@ plSpaceTree* plSceneNode::IBuildSpaceTree()
|
||||
maker.Reset();
|
||||
|
||||
hsBounds3Ext bnd;
|
||||
bnd.Reset(&hsPoint3(0,0,0));
|
||||
hsPoint3 zero(0, 0, 0);
|
||||
bnd.Reset(&zero);
|
||||
|
||||
int i;
|
||||
for( i = 0; i < fDrawPool.GetCount(); i++ )
|
||||
|
@ -16,6 +16,7 @@ set(plStatusLog_HEADERS
|
||||
)
|
||||
|
||||
add_library(plStatusLog STATIC ${plStatusLog_SOURCES} ${plStatusLog_HEADERS})
|
||||
target_link_libraries(plStatusLog CoreLib plFile plUnifiedTime)
|
||||
|
||||
source_group("Source Files" FILES ${plStatusLog_SOURCES})
|
||||
source_group("Header Files" FILES ${plStatusLog_HEADERS})
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user