From 3e3d713b3bdba22d671b11ae70269a29fa502a3a Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 23 Oct 2011 17:53:59 -0700 Subject: [PATCH 01/42] Fixes to CoreLib and CoreLibExe. --- Sources/Plasma/CoreLib/hsCritSect.cpp | 19 +++++++++++++++++++ Sources/Plasma/CoreLib/hsCritSect.h | 3 +++ Sources/Plasma/CoreLib/hsMatrix44.cpp | 6 ++++-- Sources/Plasma/CoreLibExe/hsExeError.cpp | 10 +++++++--- Sources/Plasma/CoreLibExe/hsExeMalloc.cpp | 4 +++- 5 files changed, 36 insertions(+), 6 deletions(-) diff --git a/Sources/Plasma/CoreLib/hsCritSect.cpp b/Sources/Plasma/CoreLib/hsCritSect.cpp index 4dc347cb..93e299b5 100644 --- a/Sources/Plasma/CoreLib/hsCritSect.cpp +++ b/Sources/Plasma/CoreLib/hsCritSect.cpp @@ -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 diff --git a/Sources/Plasma/CoreLib/hsCritSect.h b/Sources/Plasma/CoreLib/hsCritSect.h index 7d5193d9..803ef6dc 100644 --- a/Sources/Plasma/CoreLib/hsCritSect.h +++ b/Sources/Plasma/CoreLib/hsCritSect.h @@ -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 +typedef pthread_mutex_t CritSectHandle; #else # error "CCritSect: Not implemented on this platform" #endif diff --git a/Sources/Plasma/CoreLib/hsMatrix44.cpp b/Sources/Plasma/CoreLib/hsMatrix44.cpp index 3aad0d4f..30a6bfd1 100644 --- a/Sources/Plasma/CoreLib/hsMatrix44.cpp +++ b/Sources/Plasma/CoreLib/hsMatrix44.cpp @@ -427,7 +427,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(); @@ -458,7 +459,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(); diff --git a/Sources/Plasma/CoreLibExe/hsExeError.cpp b/Sources/Plasma/CoreLibExe/hsExeError.cpp index 5f1e6ba3..ef31f3b7 100644 --- a/Sources/Plasma/CoreLibExe/hsExeError.cpp +++ b/Sources/Plasma/CoreLibExe/hsExeError.cpp @@ -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; diff --git a/Sources/Plasma/CoreLibExe/hsExeMalloc.cpp b/Sources/Plasma/CoreLibExe/hsExeMalloc.cpp index 86bdc875..cb905b1f 100644 --- a/Sources/Plasma/CoreLibExe/hsExeMalloc.cpp +++ b/Sources/Plasma/CoreLibExe/hsExeMalloc.cpp @@ -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; } From 8b610c7228d836d81b5ba1a1b0643b5d1894c0cf Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 23 Oct 2011 17:55:11 -0700 Subject: [PATCH 02/42] Make plFile stuff compile on Linux. No guarantees made that it works though (particularly the plSecureStream stuff). --- .../Plasma/PubUtilLib/plFile/CMakeLists.txt | 2 +- .../Plasma/PubUtilLib/plFile/plFileUtils.cpp | 14 +++- .../PubUtilLib/plFile/plSecureStream.cpp | 71 +++++++++++++++++-- .../Plasma/PubUtilLib/plFile/plSecureStream.h | 12 +++- .../PubUtilLib/plFile/plStreamSource.cpp | 6 +- 5 files changed, 91 insertions(+), 14 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plFile/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plFile/CMakeLists.txt index 71f93727..2e5be567 100644 --- a/Sources/Plasma/PubUtilLib/plFile/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plFile/CMakeLists.txt @@ -35,7 +35,7 @@ set(plFile_HEADERS ) add_library(plFile STATIC ${plFile_SOURCES} ${plFile_HEADERS}) -target_link_libraries(plFile ${ZLIB_LIBRARIES}) +target_link_libraries(plFile CoreLib ${ZLIB_LIBRARIES}) source_group("Source Files" FILES ${plFile_SOURCES}) source_group("Header Files" FILES ${plFile_HEADERS}) diff --git a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp index 13ec4ff1..9c884366 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp @@ -103,7 +103,8 @@ 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); #endif } @@ -148,9 +149,14 @@ 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); +#endif } bool plFileUtils::FileCopy(const char* existingFile, const char* newFile) @@ -169,8 +175,10 @@ 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"); int num = 0; bool retVal = true; if (fp && fw){ diff --git a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp index 3be4f54c..551fa0fd 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp @@ -46,6 +46,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include +#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,22 @@ 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"); + + 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 +242,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 +273,13 @@ UInt32 plSecureStream::IRead(UInt32 bytes, void* buffer) { if (fRef == INVALID_HANDLE_VALUE) return 0; - DWORD numItems; + UInt32 numItems; +#if HS_BUILD_FOR_WIN32 bool success = (ReadFile(fRef, buffer, bytes, &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 +311,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 +339,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 +358,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 +375,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 +597,14 @@ 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 + ReadFile(fp, &magicString, kMagicStringLen, NULL, NULL); +#elif HS_BUILD_FOR_UNIX + fread(&magicString, kMagicStringLen, 1, fp); +#endif magicString[kMagicStringLen] = '\0'; return (hsStrEQ(magicString, kMagicString) != 0); } @@ -570,7 +619,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 +629,21 @@ 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"); +#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; } @@ -637,4 +696,4 @@ hsStream* plSecureStream::OpenSecureFileWrite(const wchar* fileName, UInt32* key s->Open(fileName, L"wb"); return s; -} \ No newline at end of file +} diff --git a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.h b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.h index 1f4c5346..1354618a 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.h +++ b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.h @@ -43,7 +43,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plSecureStream_h_inc #include "hsStream.h" -#include + +#if HS_BUILD_FOR_WIN32 +# include +# 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 diff --git a/Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp b/Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp index d33ec41e..4f58db81 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp @@ -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 +#endif + void ToLower(std::wstring& str) { for (unsigned i = 0; i < str.length(); i++) @@ -209,4 +213,4 @@ plStreamSource* plStreamSource::GetInstance() { static plStreamSource source; return &source; -} \ No newline at end of file +} From 51c46a106e551469c1ed3695f498f16ea7b1a949 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 23 Oct 2011 17:56:23 -0700 Subject: [PATCH 03/42] plPythonPack compiling and running on Linux. --- .../Plasma/Apps/plPythonPack/CMakeLists.txt | 2 +- Sources/Plasma/Apps/plPythonPack/main.cpp | 56 ++++++++++++++----- 2 files changed, 44 insertions(+), 14 deletions(-) diff --git a/Sources/Plasma/Apps/plPythonPack/CMakeLists.txt b/Sources/Plasma/Apps/plPythonPack/CMakeLists.txt index 3fd9cf70..ddc18ed3 100644 --- a/Sources/Plasma/Apps/plPythonPack/CMakeLists.txt +++ b/Sources/Plasma/Apps/plPythonPack/CMakeLists.txt @@ -13,7 +13,7 @@ set(plPythonPack_HEADERS ) add_executable(plPythonPack ${plPythonPack_SOURCES} ${plPythonPack_HEADERS}) -target_link_libraries(plPythonPack CoreLib CoreLibExe plFile) +target_link_libraries(plPythonPack CoreLib CoreLibExe plFile plUnifiedTime) if(PYTHON_DEBUG_LIBRARY) target_link_libraries(plPythonPack debug ${PYTHON_DEBUG_LIBRARY}) diff --git a/Sources/Plasma/Apps/plPythonPack/main.cpp b/Sources/Plasma/Apps/plPythonPack/main.cpp index 82a25b1b..2fc5af5e 100644 --- a/Sources/Plasma/Apps/plPythonPack/main.cpp +++ b/Sources/Plasma/Apps/plPythonPack/main.cpp @@ -48,10 +48,26 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -#include +#if HS_BUILD_FOR_WIN32 +# include + +# define getcwd _getcwd +# define chdir _chdir + +# ifndef MAXPATHLEN +# define MAXPATHLEN MAX_PATH +# endif +#elif HS_BUILD_FOR_UNIX +# include +# include +#endif static const char* kPackFileName = "python.pak"; -static const char* kGlueFile = ".\\plasma\\glue.py"; +#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 &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 dirNames; @@ -476,4 +504,6 @@ void main(int argc, char *argv[]) { PackDirectory(dirNames[i],rootPath,rootPath+dirNames[i]+".pak",dirNames); } + + return 0; } From de9d463563f8fdf0165abf2c791f2215dff2bc96 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Mon, 24 Oct 2011 20:57:33 -0700 Subject: [PATCH 04/42] Semi-hack to CMake to ignore DirectX on Linux. --- CMakeLists.txt | 8 ++++++-- Sources/Plasma/FeatureLib/pfSurface/CMakeLists.txt | 2 +- Sources/Plasma/PubUtilLib/plAudio/CMakeLists.txt | 4 +++- Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt | 4 +++- Sources/Plasma/PubUtilLib/plInputCore/CMakeLists.txt | 4 +++- Sources/Plasma/PubUtilLib/plPipeline/CMakeLists.txt | 6 ++++-- 6 files changed, 20 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4a878f77..7a981a79 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 diff --git a/Sources/Plasma/FeatureLib/pfSurface/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfSurface/CMakeLists.txt index e17488bd..cdd37436 100644 --- a/Sources/Plasma/FeatureLib/pfSurface/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfSurface/CMakeLists.txt @@ -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) diff --git a/Sources/Plasma/PubUtilLib/plAudio/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plAudio/CMakeLists.txt index 27da66ce..d29ffb16 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plAudio/CMakeLists.txt @@ -3,7 +3,9 @@ include_directories("../../NucleusLib/inc") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") -include_directories(${DirectX_INCLUDE_DIR}) +if(WIN32) + include_directories(${DirectX_INCLUDE_DIR}) +endif(WIN32) include_directories(${OPENAL_INCLUDE_DIR}) include_directories(${Speex_INCLUDE_DIR}) diff --git a/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt index 5bfab358..51fb681a 100644 --- a/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt @@ -3,7 +3,9 @@ include_directories("../../NucleusLib/inc") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") -include_directories(${DirectX_INCLUDE_DIR}) +if(WIN32) + include_directories(${DirectX_INCLUDE_DIR}) +endif(WIN32) include_directories(${Ogg_INCLUDE_DIR}) include_directories(${Vorbis_INCLUDE_DIR}) diff --git a/Sources/Plasma/PubUtilLib/plInputCore/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plInputCore/CMakeLists.txt index 27f7f818..10d501db 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plInputCore/CMakeLists.txt @@ -3,7 +3,9 @@ include_directories("../../NucleusLib/inc") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") -include_directories(${DirectX_INCLUDE_DIR}) +if(WIN32) + include_directories(${DirectX_INCLUDE_DIR}) +endif(WIN32) include_directories(${OPENAL_INCLUDE_DIR}) set(plInputCore_SOURCES diff --git a/Sources/Plasma/PubUtilLib/plPipeline/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plPipeline/CMakeLists.txt index 17d27432..e956ee5f 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plPipeline/CMakeLists.txt @@ -7,7 +7,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}) +endif(WIN32) set(plPipeline_SOURCES hsG3DDeviceSelector.cpp @@ -89,4 +91,4 @@ add_library(plPipeline STATIC ${plPipeline_SOURCES} ${plPipeline_HEADERS} ${plPi source_group("Source Files" FILES ${plPipeline_SOURCES}) source_group("Header Files" FILES ${plPipeline_HEADERS}) -source_group("DeviceRefs" FILES ${plPipeline_DEVICEREFS}) \ No newline at end of file +source_group("DeviceRefs" FILES ${plPipeline_DEVICEREFS}) From 3100eab80410144fc09a7a52ba3366ee5e14173a Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Mon, 24 Oct 2011 20:58:18 -0700 Subject: [PATCH 05/42] Apparently these need to be freed. Worth noting that Cyan never seems to do this anywhere... --- Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp index 9c884366..ec7ebdee 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp @@ -105,6 +105,7 @@ hsBool plFileUtils::CreateDir( const wchar *path ) #elif HS_BUILD_FOR_UNIX const char* cpath = hsWStringToString(path); CreateDir(cpath); + delete[] cpath; /* Free the string */ #endif } @@ -156,6 +157,7 @@ bool plFileUtils::RemoveFile(const wchar* filename, bool delReadOnly) #elif HS_BUILD_FOR_UNIX const char* cfilename = hsWStringToString(filename); RemoveFile(cfilename, delReadOnly); + delete[] cfilename; /* Free the string */ #endif } @@ -179,6 +181,8 @@ bool plFileUtils::FileCopy(const wchar* existingFile, const wchar* newFile) 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){ From eef108e02533e2bd9658e42d60f946081fd3db4e Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Mon, 24 Oct 2011 21:01:38 -0700 Subject: [PATCH 06/42] More memleak fixes. --- Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp index 551fa0fd..0d950285 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp @@ -187,6 +187,7 @@ hsBool plSecureStream::Open(const wchar* name, const wchar* mode) #elif HS_BUILD_FOR_UNIX const char* cname = hsWStringToString(name); fRef = fopen(cname, "rb"); + delete[] cname; fPosition = 0; @@ -632,6 +633,7 @@ bool plSecureStream::IsSecureFile(const wchar* fileName) #elif HS_BUILD_FOR_UNIX const char* cfile = hsWStringToString(fileName); fp = fopen(cfile, "rb"); + delete[] cfile; #endif if (fp == INVALID_HANDLE_VALUE) From 9109bbf93763435a98942b93e14a1ba695d48543 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Mon, 24 Oct 2011 23:31:46 -0700 Subject: [PATCH 07/42] Don't need DX at all for plAudioCore. Except maybe if you're building 3DSMax... but someone should check that. --- Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt index 51fb681a..59c221ec 100644 --- a/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt @@ -3,11 +3,13 @@ include_directories("../../NucleusLib/inc") include_directories("../../NucleusLib") include_directories("../../PubUtilLib") -if(WIN32) - include_directories(${DirectX_INCLUDE_DIR}) -endif(WIN32) 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 From 7168174e52eb6ba31033534a26cd0902eac0d2cf Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Tue, 25 Oct 2011 21:17:15 -0700 Subject: [PATCH 08/42] Updates to plUUID for Linux & Windows. Includes linking against libuuid on Linux. --- .../Plasma/PubUtilLib/plUUID/CMakeLists.txt | 4 ++++ Sources/Plasma/PubUtilLib/plUUID/plUUID.cpp | 24 ------------------- Sources/Plasma/PubUtilLib/plUUID/plUUID.h | 6 +++++ .../Plasma/PubUtilLib/plUUID/plUUID_Win32.cpp | 24 +++++++++++++++++++ 4 files changed, 34 insertions(+), 24 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt index 99eaca4c..53e01fcc 100644 --- a/Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt @@ -17,6 +17,10 @@ set(plUUID_HEADERS ) add_library(plUUID STATIC ${plUUID_SOURCES} ${plUUID_HEADERS}) +target_link_libraries(plUUID pnFactory) +if(NOT WIN32) + target_link_libraries(plUUID uuid) +endif(NOT WIN32) source_group("Source Files" FILES ${plUUID_SOURCES}) source_group("Header Files" FILES ${plUUID_HEADERS}) diff --git a/Sources/Plasma/PubUtilLib/plUUID/plUUID.cpp b/Sources/Plasma/PubUtilLib/plUUID/plUUID.cpp index 6531fc22..6dfd79da 100644 --- a/Sources/Plasma/PubUtilLib/plUUID/plUUID.cpp +++ b/Sources/Plasma/PubUtilLib/plUUID/plUUID.cpp @@ -42,8 +42,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plUUID.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,29 +68,12 @@ 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 diff --git a/Sources/Plasma/PubUtilLib/plUUID/plUUID.h b/Sources/Plasma/PubUtilLib/plUUID/plUUID.h index a297e826..bf780949 100644 --- a/Sources/Plasma/PubUtilLib/plUUID/plUUID.h +++ b/Sources/Plasma/PubUtilLib/plUUID/plUUID.h @@ -44,7 +44,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTypes.h" #include "hsStlUtils.h" +#ifdef HS_BUILD_FOR_WIN32 #include "pnUtils/pnUtils.h" +#endif #include "pnFactory/plCreatable.h" class hsStream; @@ -64,7 +66,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,7 +86,9 @@ 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(); }; diff --git a/Sources/Plasma/PubUtilLib/plUUID/plUUID_Win32.cpp b/Sources/Plasma/PubUtilLib/plUUID/plUUID_Win32.cpp index 54853bf4..c7724540 100644 --- a/Sources/Plasma/PubUtilLib/plUUID/plUUID_Win32.cpp +++ b/Sources/Plasma/PubUtilLib/plUUID/plUUID_Win32.cpp @@ -47,6 +47,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsWindows.h" #include +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(); From 68abe52f9c45f89f5205d9e2bf225f2543da976b Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Tue, 25 Oct 2011 21:19:11 -0700 Subject: [PATCH 09/42] Terrible hacks to make pnProduct work on Linux. plUUID has a conversion operator to pnUtil's Uuid class. We're counting on this to work properly on Windows (which hasn't yet been tested) --- Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt | 1 + Sources/Plasma/NucleusLib/pnProduct/Pch.h | 2 +- .../Plasma/NucleusLib/pnProduct/Private/pnPrAllIncludes.h | 3 ++- .../Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp | 6 +++--- Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.h | 2 +- 5 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt index 2acee566..eab2753f 100644 --- a/Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt @@ -1,5 +1,6 @@ include_directories("../../CoreLib") include_directories("../../NucleusLib") +include_directories("../../PubUtilLib") set(pnProduct_HEADERS Pch.h diff --git a/Sources/Plasma/NucleusLib/pnProduct/Pch.h b/Sources/Plasma/NucleusLib/pnProduct/Pch.h index eb3d3e5b..024900da 100644 --- a/Sources/Plasma/NucleusLib/pnProduct/Pch.h +++ b/Sources/Plasma/NucleusLib/pnProduct/Pch.h @@ -51,6 +51,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNPRODUCT_PCH_H -#include "pnUtils/pnUtils.h" +//#include "pnUtils/pnUtils.h" #include "Private/pnPrAllIncludes.h" diff --git a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrAllIncludes.h b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrAllIncludes.h index ccc46fb2..9a137cfe 100644 --- a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrAllIncludes.h +++ b/Sources/Plasma/NucleusLib/pnProduct/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 "plUUID/plUUID.h" #include "pnPrBuildId.h" #include "pnPrBranchId.h" diff --git a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp index 1d757b9a..92b9028e 100644 --- a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp +++ b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp @@ -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", diff --git a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.h b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.h index fd5d6f40..1023fa63 100644 --- a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.h +++ b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.h @@ -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) From f085087c23c5525b7a11532ee51f70ac7859cef4 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Tue, 25 Oct 2011 21:20:40 -0700 Subject: [PATCH 10/42] Build plFileEncrypt in Linux. --- Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt | 3 +-- Sources/Plasma/Apps/plFileEncrypt/main.cpp | 8 +++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt b/Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt index 77e90504..f22b053c 100644 --- a/Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt +++ b/Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt @@ -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 plFile plUnifiedTime pnProduct plUUID) source_group("Source Files" FILES ${plFileEncrypt_SOURCES}) diff --git a/Sources/Plasma/Apps/plFileEncrypt/main.cpp b/Sources/Plasma/Apps/plFileEncrypt/main.cpp index 99278625..37fad98a 100644 --- a/Sources/Plasma/Apps/plFileEncrypt/main.cpp +++ b/Sources/Plasma/Apps/plFileEncrypt/main.cpp @@ -41,10 +41,16 @@ 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 "pnUtils/pnUtils.h" #include "pnProduct/pnProduct.h" #include "hsUtils.h" +/* Hack so that we can pull in the product info */ +#include "pnFactory/plCreator.h" +#include "plUUID/plUUID.h" +REGISTER_CREATABLE( plCreatableUuid); + + void EncryptFiles(const char* dir, const char* ext, bool encrypt); void print_version(){ From 8a28ba9e895b873d1d6aa77c0c3d8b51d7fc60fb Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Tue, 25 Oct 2011 23:40:13 -0700 Subject: [PATCH 11/42] Move plUUID to pnUUID. --HG-- rename : Sources/Plasma/PubUtilLib/plUUID/plUUID.cpp => Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp 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 --- .../Plasma/Apps/plFileEncrypt/CMakeLists.txt | 2 +- Sources/Plasma/Apps/plFileEncrypt/main.cpp | 7 +-- .../pfPython/pyNetServerSessionInfo.h | 2 +- Sources/Plasma/NucleusLib/CMakeLists.txt | 1 + .../NucleusLib/inc/pnNucleusCreatables.h | 1 + .../NucleusLib/pnProduct/CMakeLists.txt | 3 +- .../pnProduct/Private/pnPrAllIncludes.h | 2 +- .../Plasma/NucleusLib/pnUUID/CMakeLists.txt | 28 ++++++++++ .../pnUUID/pnUUID.cpp} | 2 +- .../plUUID.h => NucleusLib/pnUUID/pnUUID.h} | 6 +-- .../NucleusLib/pnUUID/pnUUIDCreatable.h | 54 +++++++++++++++++++ .../pnUUID/pnUUID_Unix.cpp} | 2 +- .../pnUUID/pnUUID_Win32.cpp} | 2 +- Sources/Plasma/PubUtilLib/CMakeLists.txt | 1 - .../PubUtilLib/plAgeLoader/plAgeLoader.h | 2 +- .../PubUtilLib/plMessage/plLoadAgeMsg.h | 2 +- .../PubUtilLib/plNetCommon/plClientGuid.h | 2 +- .../PubUtilLib/plNetCommon/plNetCommon.cpp | 2 +- .../plNetCommon/plNetCommonCreatable.h | 4 -- .../plNetCommon/plNetServerSessionInfo.h | 2 +- .../Plasma/PubUtilLib/plUUID/CMakeLists.txt | 26 --------- 21 files changed, 101 insertions(+), 52 deletions(-) create mode 100644 Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt rename Sources/Plasma/{PubUtilLib/plUUID/plUUID.cpp => NucleusLib/pnUUID/pnUUID.cpp} (99%) rename Sources/Plasma/{PubUtilLib/plUUID/plUUID.h => NucleusLib/pnUUID/pnUUID.h} (98%) create mode 100644 Sources/Plasma/NucleusLib/pnUUID/pnUUIDCreatable.h rename Sources/Plasma/{PubUtilLib/plUUID/plUUID_Unix.cpp => NucleusLib/pnUUID/pnUUID_Unix.cpp} (99%) rename Sources/Plasma/{PubUtilLib/plUUID/plUUID_Win32.cpp => NucleusLib/pnUUID/pnUUID_Win32.cpp} (99%) delete mode 100644 Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt diff --git a/Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt b/Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt index f22b053c..e416ef88 100644 --- a/Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt +++ b/Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt @@ -12,6 +12,6 @@ set(plFileEncrypt_SOURCES ) add_executable(plFileEncrypt ${plFileEncrypt_SOURCES}) -target_link_libraries(plFileEncrypt CoreLib CoreLibExe plFile plUnifiedTime pnProduct plUUID) +target_link_libraries(plFileEncrypt CoreLib CoreLibExe plFile plUnifiedTime pnUUID pnProduct) source_group("Source Files" FILES ${plFileEncrypt_SOURCES}) diff --git a/Sources/Plasma/Apps/plFileEncrypt/main.cpp b/Sources/Plasma/Apps/plFileEncrypt/main.cpp index 37fad98a..731b373b 100644 --- a/Sources/Plasma/Apps/plFileEncrypt/main.cpp +++ b/Sources/Plasma/Apps/plFileEncrypt/main.cpp @@ -44,12 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com //#include "pnUtils/pnUtils.h" #include "pnProduct/pnProduct.h" #include "hsUtils.h" - -/* Hack so that we can pull in the product info */ -#include "pnFactory/plCreator.h" -#include "plUUID/plUUID.h" -REGISTER_CREATABLE( plCreatableUuid); - +#include "pnUUID/pnUUIDCreatable.h" void EncryptFiles(const char* dir, const char* ext, bool encrypt); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h b/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h index 5e2f7bf9..f6320204 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.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 #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/NucleusLib/CMakeLists.txt b/Sources/Plasma/NucleusLib/CMakeLists.txt index 38036bf0..cfee5403 100644 --- a/Sources/Plasma/NucleusLib/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/CMakeLists.txt @@ -32,3 +32,4 @@ add_subdirectory(pnSimpleNet) add_subdirectory(pnTimer) add_subdirectory(pnUtils) add_subdirectory(pnUtilsExe) +add_subdirectory(pnUUID) diff --git a/Sources/Plasma/NucleusLib/inc/pnNucleusCreatables.h b/Sources/Plasma/NucleusLib/inc/pnNucleusCreatables.h index 39a242d4..df20e728 100644 --- a/Sources/Plasma/NucleusLib/inc/pnNucleusCreatables.h +++ b/Sources/Plasma/NucleusLib/inc/pnNucleusCreatables.h @@ -68,5 +68,6 @@ REGISTER_NONCREATABLE( plDispatchBase ); #include "pnNetCommon/pnNetCommonCreatable.h" #include "pnSceneObject/pnSceneObjectCreatable.h" #include "pnTimer/pnTimerCreatable.h" +#include "pnUUID/pnUUIDCreatable.h" #endif // pnNucleusCreatables_inc diff --git a/Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt index eab2753f..6dd8d8f9 100644 --- a/Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt @@ -1,6 +1,5 @@ include_directories("../../CoreLib") include_directories("../../NucleusLib") -include_directories("../../PubUtilLib") set(pnProduct_HEADERS Pch.h @@ -21,5 +20,7 @@ set(pnProduct_PRIVATE add_library(pnProduct STATIC ${pnProduct_HEADERS} ${pnProduct_PRIVATE}) +target_link_libraries(pnProduct pnUUID) + source_group("Header Files" FILES ${pnProduct_HEADERS}) source_group("Private" FILES ${pnProduct_PRIVATE}) diff --git a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrAllIncludes.h b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrAllIncludes.h index 9a137cfe..a4b282ff 100644 --- a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrAllIncludes.h +++ b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrAllIncludes.h @@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com //#include "pnUtils/pnUtils.h" -#include "plUUID/plUUID.h" +#include "pnUUID/pnUUID.h" #include "pnPrBuildId.h" #include "pnPrBranchId.h" diff --git a/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt new file mode 100644 index 00000000..3a183b2a --- /dev/null +++ b/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt @@ -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 + pnUUIDCreatable.h +) + +add_library(pnUUID STATIC ${pnUUID_SOURCES} ${pnUUID_HEADERS}) +target_link_libraries(pnUUID pnFactory) +if(WIN32) + target_link_libraries(pnUUID pnUtils) +else(WIN32) + target_link_libraries(pnUUID uuid) +endif(WIN32) + +source_group("Source Files" FILES ${pnUUID_SOURCES}) +source_group("Header Files" FILES ${pnUUID_HEADERS}) diff --git a/Sources/Plasma/PubUtilLib/plUUID/plUUID.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp similarity index 99% rename from Sources/Plasma/PubUtilLib/plUUID/plUUID.cpp rename to Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp index 6dfd79da..cf4291c6 100644 --- a/Sources/Plasma/PubUtilLib/plUUID/plUUID.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp @@ -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" #include "hsStream.h" plUUID::plUUID() diff --git a/Sources/Plasma/PubUtilLib/plUUID/plUUID.h b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h similarity index 98% rename from Sources/Plasma/PubUtilLib/plUUID/plUUID.h rename to Sources/Plasma/NucleusLib/pnUUID/pnUUID.h index bf780949..24828014 100644 --- a/Sources/Plasma/PubUtilLib/plUUID/plUUID.h +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h @@ -39,8 +39,8 @@ 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" @@ -107,4 +107,4 @@ public: }; -#endif // plUUID_h_inc +#endif // pnUUID_h_inc diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUIDCreatable.h b/Sources/Plasma/NucleusLib/pnUUID/pnUUIDCreatable.h new file mode 100644 index 00000000..0b327aea --- /dev/null +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUIDCreatable.h @@ -0,0 +1,54 @@ +/*==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 . + +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 pnUUIDCreatable_inc +#define pnUUIDCreatable_inc + +#include "pnFactory/plCreator.h" + + +#include "pnUUID.h" + +REGISTER_CREATABLE( plCreatableUuid ); + +#endif // pnUUIDCreatable_inc + diff --git a/Sources/Plasma/PubUtilLib/plUUID/plUUID_Unix.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp similarity index 99% rename from Sources/Plasma/PubUtilLib/plUUID/plUUID_Unix.cpp rename to Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp index cab0fa9b..61856b50 100644 --- a/Sources/Plasma/PubUtilLib/plUUID/plUUID_Unix.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Unix.cpp @@ -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 diff --git a/Sources/Plasma/PubUtilLib/plUUID/plUUID_Win32.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp similarity index 99% rename from Sources/Plasma/PubUtilLib/plUUID/plUUID_Win32.cpp rename to Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp index c7724540..47fcde9e 100644 --- a/Sources/Plasma/PubUtilLib/plUUID/plUUID_Win32.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp @@ -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 diff --git a/Sources/Plasma/PubUtilLib/CMakeLists.txt b/Sources/Plasma/PubUtilLib/CMakeLists.txt index 97fe4c29..1b7a1912 100644 --- a/Sources/Plasma/PubUtilLib/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/CMakeLists.txt @@ -48,5 +48,4 @@ add_subdirectory(plStreamLogger) add_subdirectory(plSurface) add_subdirectory(plTransform) add_subdirectory(plUnifiedTime) -add_subdirectory(plUUID) add_subdirectory(plVault) diff --git a/Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.h b/Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.h index 056066bd..22a6599c 100644 --- a/Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.h +++ b/Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.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 diff --git a/Sources/Plasma/PubUtilLib/plMessage/plLoadAgeMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plLoadAgeMsg.h index 55570026..c33838f3 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plLoadAgeMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plLoadAgeMsg.h @@ -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" // diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.h b/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.h index 53f45510..9e04b5d0 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.h +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plClientGuid.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 { diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.cpp index 0e639056..aebec2f9 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommon.cpp @@ -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 namespace plNetCommon diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonCreatable.h b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonCreatable.h index 25ea1014..85e98e86 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonCreatable.h +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetCommonCreatable.h @@ -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" diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h index 23c21675..6a31d56d 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.h +++ b/Sources/Plasma/PubUtilLib/plNetCommon/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; diff --git a/Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt deleted file mode 100644 index 53e01fcc..00000000 --- a/Sources/Plasma/PubUtilLib/plUUID/CMakeLists.txt +++ /dev/null @@ -1,26 +0,0 @@ -include_directories("../../CoreLib") -include_directories("../../NucleusLib") -include_directories("../../PubUtilLib") - -set(plUUID_SOURCES - plUUID.cpp -) - -if(WIN32) - set(plUUID_SOURCES ${plUUID_SOURCES} plUUID_Win32.cpp) -else(WIN32) - set(plUUID_SOURCES ${plUUID_SOURCES} plUUID_Unix.cpp) -endif(WIN32) - -set(plUUID_HEADERS - plUUID.h -) - -add_library(plUUID STATIC ${plUUID_SOURCES} ${plUUID_HEADERS}) -target_link_libraries(plUUID pnFactory) -if(NOT WIN32) - target_link_libraries(plUUID uuid) -endif(NOT WIN32) - -source_group("Source Files" FILES ${plUUID_SOURCES}) -source_group("Header Files" FILES ${plUUID_HEADERS}) From 71eb7ce8df1f35ee3919d0977e95715456b409fd Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Tue, 25 Oct 2011 23:40:37 -0700 Subject: [PATCH 12/42] Fix an error on Windows. UInt32* isn't a LPDWORD... unless we cast it. --- Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp index 0d950285..e4f4e3ec 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp @@ -276,7 +276,7 @@ UInt32 plSecureStream::IRead(UInt32 bytes, void* buffer) return 0; UInt32 numItems; #if HS_BUILD_FOR_WIN32 - bool success = (ReadFile(fRef, buffer, bytes, &numItems, NULL) != 0); + 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; From da53353cda33f1f7b29b5e2594af74be6c22ff72 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Wed, 26 Oct 2011 20:52:23 -0700 Subject: [PATCH 13/42] Turns out Windows needs Rpcrt4.lib for UUIDs. --- Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt index 3a183b2a..e1d435c7 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt @@ -20,6 +20,7 @@ add_library(pnUUID STATIC ${pnUUID_SOURCES} ${pnUUID_HEADERS}) target_link_libraries(pnUUID pnFactory) if(WIN32) target_link_libraries(pnUUID pnUtils) + target_link_libraries(pnUUID Rpcrt4) else(WIN32) target_link_libraries(pnUUID uuid) endif(WIN32) From c3c67c0a65d81b303a26fe8a8e257044188ac334 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Thu, 27 Oct 2011 10:38:13 -0700 Subject: [PATCH 14/42] Fix plClient, MaxMain, and MaxPlasmaLights. --- Sources/Plasma/Apps/plClient/CMakeLists.txt | 2 +- Sources/Tools/MaxMain/CMakeLists.txt | 2 +- Sources/Tools/MaxPlasmaLights/CMakeLists.txt | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/Apps/plClient/CMakeLists.txt b/Sources/Plasma/Apps/plClient/CMakeLists.txt index 6ae04615..46c230f5 100644 --- a/Sources/Plasma/Apps/plClient/CMakeLists.txt +++ b/Sources/Plasma/Apps/plClient/CMakeLists.txt @@ -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}) diff --git a/Sources/Tools/MaxMain/CMakeLists.txt b/Sources/Tools/MaxMain/CMakeLists.txt index 7836c92f..64ae1bbf 100644 --- a/Sources/Tools/MaxMain/CMakeLists.txt +++ b/Sources/Tools/MaxMain/CMakeLists.txt @@ -173,7 +173,6 @@ target_link_libraries(MaxMain plStreamLogger) target_link_libraries(MaxMain plSurface) target_link_libraries(MaxMain plTransform) target_link_libraries(MaxMain plUnifiedTime) -target_link_libraries(MaxMain plUUID) target_link_libraries(MaxMain plVault) target_link_libraries(MaxMain pnAddrInfo) target_link_libraries(MaxMain pnAsyncCore) @@ -199,6 +198,7 @@ target_link_libraries(MaxMain pnSimpleNet) target_link_libraries(MaxMain pnTimer) target_link_libraries(MaxMain pnUtils) target_link_libraries(MaxMain pnUtilsExe) +target_link_libraries(MaxMain pnUUID) if (WIN32) target_link_libraries(MaxMain Comctl32) diff --git a/Sources/Tools/MaxPlasmaLights/CMakeLists.txt b/Sources/Tools/MaxPlasmaLights/CMakeLists.txt index 01133373..e2f10feb 100644 --- a/Sources/Tools/MaxPlasmaLights/CMakeLists.txt +++ b/Sources/Tools/MaxPlasmaLights/CMakeLists.txt @@ -107,7 +107,6 @@ target_link_libraries(MaxPlasmaLights plStreamLogger) target_link_libraries(MaxPlasmaLights plSurface) target_link_libraries(MaxPlasmaLights plTransform) target_link_libraries(MaxPlasmaLights plUnifiedTime) -target_link_libraries(MaxPlasmaLights plUUID) target_link_libraries(MaxPlasmaLights plVault) target_link_libraries(MaxPlasmaLights pnAddrInfo) target_link_libraries(MaxPlasmaLights pnAsyncCore) @@ -132,6 +131,7 @@ target_link_libraries(MaxPlasmaLights pnSimpleNet) target_link_libraries(MaxPlasmaLights pnTimer) target_link_libraries(MaxPlasmaLights pnUtils) target_link_libraries(MaxPlasmaLights pnUtilsExe) +target_link_libraries(MaxPlasmaLights pnUUID) if (WIN32) target_link_libraries(MaxPlasmaLights Comctl32) From d17711b04c220203daef2b1670cf500cdcac59e6 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Thu, 27 Oct 2011 21:10:31 -0700 Subject: [PATCH 15/42] Fix compiling plContainer. --- Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.cpp b/Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.cpp index 26b4a626..f2aee940 100644 --- a/Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plContainer/plConfigInfo.cpp @@ -797,7 +797,8 @@ bool plIniSectionConfigSource::ReadSubSource( const char * name ) std::vector sections; for ( int i=0; iReadFrom(&plIniSectionConfigSource( name, sections )); + plIniSectionConfigSource src(name, sections); + return fConfigInfo->ReadFrom(&src); } ///////////////////////////////////////////////// From 58e89f81b2856fe3b7aed08c70272153aa16150e Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Thu, 27 Oct 2011 21:12:06 -0700 Subject: [PATCH 16/42] Fix an "address of temporary" error in plCluster. --- Sources/Plasma/PubUtilLib/plDrawable/plCluster.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plCluster.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plCluster.cpp index 88d256f3..4d81bf09 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plCluster.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plCluster.cpp @@ -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); } From ee01c1f01d527819e64deb28545b3ec62c124b68 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Thu, 27 Oct 2011 21:15:55 -0700 Subject: [PATCH 17/42] Fix compilation of plInterp. --- Sources/Plasma/PubUtilLib/plInterp/plAnimPath.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plInterp/plAnimPath.cpp b/Sources/Plasma/PubUtilLib/plInterp/plAnimPath.cpp index 88835e69..291d6478 100644 --- a/Sources/Plasma/PubUtilLib/plInterp/plAnimPath.cpp +++ b/Sources/Plasma/PubUtilLib/plInterp/plAnimPath.cpp @@ -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; } From dbced518cb45959080782000ce6a3fd0d8c7896e Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Thu, 27 Oct 2011 21:20:26 -0700 Subject: [PATCH 18/42] Fix plParticleSystem and plAgeLoadedMsg. --- Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h | 1 - .../Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp | 3 ++- .../Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp | 3 ++- .../PubUtilLib/plParticleSystem/plParticleEmitter.cpp | 6 +++++- .../PubUtilLib/plParticleSystem/plParticleGenerator.cpp | 5 +++-- 5 files changed, 12 insertions(+), 6 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h index 4699883b..2e00fcf3 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plAgeLoadedMsg.h @@ -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" // diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp index 056ebf16..97529b7a 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plConvexVolume.cpp @@ -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); } } diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp index 7e0b9fbf..838a4574 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEffect.cpp @@ -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(); diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp index 06ffa6ce..fe865742 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleEmitter.cpp @@ -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; diff --git a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp index 49351249..c0e0b044 100644 --- a/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp +++ b/Sources/Plasma/PubUtilLib/plParticleSystem/plParticleGenerator.cpp @@ -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); } @@ -451,4 +452,4 @@ void plOneTimeParticleGenerator::Write(hsStream* s, hsResMgr *mgr) fPosition[i].Write(s); fDirection[i].Write(s); } -} \ No newline at end of file +} From 3113150f004b196031afc099a58d69e862acdeb7 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Thu, 27 Oct 2011 21:21:30 -0700 Subject: [PATCH 19/42] Fix this include, but it doesn't fix linux build. --- Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h index 015a7a6b..b45e38b2 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h +++ b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h @@ -448,7 +448,7 @@ public: /////////////////////////////////////////////////////////////////////////////// #include -#include "headspin.h" +#include "HeadSpin.h" class plDemoDebugFile { From 3133161711eaf391a43073a2ab4c6bfe18bc35a8 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Thu, 27 Oct 2011 21:24:13 -0700 Subject: [PATCH 20/42] Fix compiling plScene. --- Sources/Plasma/PubUtilLib/plScene/plSceneNode.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plScene/plSceneNode.cpp b/Sources/Plasma/PubUtilLib/plScene/plSceneNode.cpp index 18fa9668..dbe17388 100644 --- a/Sources/Plasma/PubUtilLib/plScene/plSceneNode.cpp +++ b/Sources/Plasma/PubUtilLib/plScene/plSceneNode.cpp @@ -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++ ) From 7ba977a4808ac043e754101f1840ed5f295423b4 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Thu, 27 Oct 2011 22:01:07 -0700 Subject: [PATCH 21/42] Add wchar* versions of some plFile utils. --- .../Plasma/PubUtilLib/plFile/plFileUtils.cpp | 21 +++++++++++++++++++ .../Plasma/PubUtilLib/plFile/plFileUtils.h | 2 ++ 2 files changed, 23 insertions(+) diff --git a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp index ec7ebdee..d54035db 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.cpp @@ -439,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) @@ -448,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 ) diff --git a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.h b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.h index abf70158..c3718ec7 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plFileUtils.h +++ b/Sources/Plasma/PubUtilLib/plFile/plFileUtils.h @@ -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 From a980fe454f2dab3df6bb6376d84f6ccfd210c27d Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Thu, 27 Oct 2011 22:01:55 -0700 Subject: [PATCH 22/42] Fix building plStatusLog. --- .../PubUtilLib/plStatusLog/plStatusLog.cpp | 57 +++++++++---------- 1 file changed, 27 insertions(+), 30 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp index 501868c9..096d4194 100644 --- a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp +++ b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp @@ -66,7 +66,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" #include "plFile/hsFiles.h" #include "plUnifiedTime/plUnifiedTime.h" -#include "pnUtils/pnUtils.h" #include "pnProduct/pnProduct.h" #include "plEncryptLogLine.h" @@ -91,7 +90,8 @@ plStatusLogMgr::plStatusLogMgr() fDrawer = nil; fLastLogChangeTime = 0; - PathGetLogDirectory(fBasePath, arrsize(fBasePath)); + plFileUtils::ConcatFileName(fBasePath, L"log"); + plFileUtils::EnsureFilePathExists(fBasePath); } plStatusLogMgr::~plStatusLogMgr() @@ -352,6 +352,7 @@ bool plStatusLogMgr::DumpLogs( const wchar *newFolderName ) newPath = newFolderName; IEnsurePathExists(newPath.c_str()); +#if HS_BUILD_FOR_WIN32 hsWFolderIterator folderIterator; if (fBasePath) folderIterator.SetPath(fBasePath); @@ -382,6 +383,7 @@ bool plStatusLogMgr::DumpLogs( const wchar *newFolderName ) bool succeeded = (CopyFileW(source.c_str(), destination.c_str(), FALSE) != 0); retVal = retVal && succeeded; } +#endif return retVal; } @@ -468,21 +470,21 @@ bool plStatusLog::IReOpen( void ) { wchar work[MAX_PATH], work2[MAX_PATH]; swprintf(work, MAX_PATH, L"%s.3%s",fileNoExt,ext); - _wremove(work); + plFileUtils::RemoveFile(work); swprintf(work2, MAX_PATH, L"%s.2%s",fileNoExt,ext); - _wrename(work2, work); + plFileUtils::FileMove(work2, work); swprintf(work, MAX_PATH, L"%s.1%s",fileNoExt,ext); - _wrename(work, work2); - _wrename(fileToOpen, work); + plFileUtils::FileMove(work, work2); + plFileUtils::FileMove(fileToOpen, work); } if (fFlags & kAppendToLast) { - fFileHandle = _wfopen( fileToOpen, fEncryptMe ? L"ab" : L"at" ); + fFileHandle = hsWFopen( fileToOpen, fEncryptMe ? L"ab" : L"at" ); } else { - fFileHandle = _wfopen( fileToOpen, fEncryptMe ? L"wb" : L"wt" ); + fFileHandle = hsWFopen( fileToOpen, fEncryptMe ? L"wb" : L"wt" ); // if we need to reopen lets just append fFlags |= kAppendToLast; } @@ -542,7 +544,7 @@ void plStatusLog::IParseFileName(wchar* file, size_t fnsize, wchar* fileNoExt, w else { wcscpy(fileNoExt, file); - *ext = L""; + *ext = L'\0'; } } @@ -649,7 +651,7 @@ bool plStatusLog::AddLine( const char *line, UInt32 color ) for( str = (char *)line; ( c = strchr( str, '\n' ) ) != nil; str = c + 1 ) { // So if we got here, c points to a carriage return... - ret = IAddLine( str, (UInt32)c - (UInt32)str, color ); + ret = IAddLine( str, (unsigned_ptr)c - (unsigned_ptr)str, color ); } /// We might have some left over @@ -789,49 +791,44 @@ bool plStatusLog::IPrintLineToFile( const char *line, UInt32 count ) { if ( fFlags & kTimestamp ) { - StrPrintf(work, arrsize(work), "(%s) ", plUnifiedTime(kNow).Format("%m/%d %H:%M:%S").c_str()); - StrPack(buf, work, arrsize(buf)); + snprintf(work, arrsize(work), "(%s) ", plUnifiedTime(kNow).Format("%m/%d %H:%M:%S").c_str()); + strncat(buf, work, arrsize(work)); } if ( fFlags & kTimestampGMT ) { - StrPrintf(work, arrsize(work), "(%s) ", plUnifiedTime::GetCurrentTime().Format("%m/%d %H:%M:%S UTC").c_str()); - StrPack(buf, work, arrsize(buf)); + snprintf(work, arrsize(work), "(%s) ", plUnifiedTime::GetCurrentTime().Format("%m/%d %H:%M:%S UTC").c_str()); + strncat(buf, work, arrsize(work)); } if ( fFlags & kTimeInSeconds ) { - StrPrintf(work, arrsize(work), "(%lu) ", (unsigned long)plUnifiedTime(kNow).GetSecs()); - StrPack(buf, work, arrsize(buf)); + snprintf(work, arrsize(work), "(%lu) ", (unsigned long)plUnifiedTime(kNow).GetSecs()); + strncat(buf, work, arrsize(work)); } if ( fFlags & kTimeAsDouble ) { - StrPrintf(work, arrsize(work), "(%f) ", plUnifiedTime(kNow).GetSecsDouble()); - StrPack(buf, work, arrsize(buf)); + snprintf(work, arrsize(work), "(%f) ", plUnifiedTime(kNow).GetSecsDouble()); + strncat(buf, work, arrsize(work)); } if (fFlags & kRawTimeStamp) { - StrPrintf(work, arrsize(work), "[t=%10u] ", hsTimer::GetSeconds()); - StrPack(buf, work, arrsize(buf)); + snprintf(work, arrsize(work), "[t=%10u] ", hsTimer::GetSeconds()); + strncat(buf, work, arrsize(work)); } if (fFlags & kThreadID) { - StrPrintf(work, arrsize(work), "[t=%u] ", hsThread::GetMyThreadId()); - StrPack(buf, work, arrsize(buf)); + snprintf(work, arrsize(work), "[t=%u] ", hsThread::GetMyThreadId()); + strncat(buf, work, arrsize(work)); } - // find the size of the buf plus the size of the line and only pack that much - unsigned BufAndLine = StrLen(buf)+count+1; - if ( BufAndLine > arrsize(buf) ) - BufAndLine = arrsize(buf); - - StrPack(buf, line, BufAndLine ); + strncat(buf, line, arrsize(line)); if(!fEncryptMe ) { - StrPack(buf, "\n", arrsize(buf)); + strncat(buf, "\n", 1); } } - unsigned length = StrLen(buf); + unsigned length = strlen(buf); #ifdef PLASMA_EXTERNAL_RELEASE // Print to a separate line, since we have to encrypt it From 5bb0c7e56b77f4cdc5f035ba820757bca04ffdd7 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Thu, 27 Oct 2011 22:02:15 -0700 Subject: [PATCH 23/42] Fix building plLogDecrypt. --- Sources/Plasma/Apps/plLogDecrypt/CMakeLists.txt | 3 +-- Sources/Plasma/Apps/plLogDecrypt/plLogDecrypt.cpp | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/Apps/plLogDecrypt/CMakeLists.txt b/Sources/Plasma/Apps/plLogDecrypt/CMakeLists.txt index 20372027..d4c10dd2 100644 --- a/Sources/Plasma/Apps/plLogDecrypt/CMakeLists.txt +++ b/Sources/Plasma/Apps/plLogDecrypt/CMakeLists.txt @@ -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 plFile plUnifiedTime plStatusLog pnProduct) source_group("Source Files" FILES ${plLogDecrypt_SOURCES}) diff --git a/Sources/Plasma/Apps/plLogDecrypt/plLogDecrypt.cpp b/Sources/Plasma/Apps/plLogDecrypt/plLogDecrypt.cpp index 5b652fbf..b2bdd348 100644 --- a/Sources/Plasma/Apps/plLogDecrypt/plLogDecrypt.cpp +++ b/Sources/Plasma/Apps/plLogDecrypt/plLogDecrypt.cpp @@ -45,8 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include +#include +#include #include "hsTypes.h" +#include "hsUtils.h" #include "plStatusLog/plEncryptLogLine.h" void IProcessFile(const char *path) From 2073aec6112a01598f8a4303723284c7cb038384 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Thu, 27 Oct 2011 22:05:23 -0700 Subject: [PATCH 24/42] Fix build of plSurface. --- Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp b/Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp index 21462f6d..0f3f3c5f 100644 --- a/Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp +++ b/Sources/Plasma/PubUtilLib/plSurface/plGrassShaderMod.cpp @@ -218,7 +218,7 @@ hsBool plGrassShaderMod::IEval(double secs, hsScalar del, UInt32 dirty) fVShader->SetVector(plGrassVS::kAppConsts, float(hsTimer::GetSysSeconds()), 0.f, 0.f, 0.f); } - return TRUE; + return true; } void plGrassShaderMod::ISetupShaders() @@ -272,4 +272,4 @@ void plGrassShaderMod::ISetupShaders() plLayRefMsg* refMsg = TRACKED_NEW plLayRefMsg(layer->GetKey(), plRefMsg::kOnCreate, 0, plLayRefMsg::kPixelShader); hsgResMgr::ResMgr()->SendRef(fPShader->GetKey(), refMsg, plRefFlags::kActiveRef); } -} \ No newline at end of file +} From 7725e95a0005be7d46bb47db9cf71900d876da2c Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Thu, 27 Oct 2011 22:26:52 -0700 Subject: [PATCH 25/42] Remove two commented out includes. --- Sources/Plasma/Apps/plFileEncrypt/main.cpp | 1 - Sources/Plasma/NucleusLib/pnProduct/Pch.h | 3 --- 2 files changed, 4 deletions(-) diff --git a/Sources/Plasma/Apps/plFileEncrypt/main.cpp b/Sources/Plasma/Apps/plFileEncrypt/main.cpp index 731b373b..e96947ba 100644 --- a/Sources/Plasma/Apps/plFileEncrypt/main.cpp +++ b/Sources/Plasma/Apps/plFileEncrypt/main.cpp @@ -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" #include "pnUUID/pnUUIDCreatable.h" diff --git a/Sources/Plasma/NucleusLib/pnProduct/Pch.h b/Sources/Plasma/NucleusLib/pnProduct/Pch.h index 024900da..71c6e707 100644 --- a/Sources/Plasma/NucleusLib/pnProduct/Pch.h +++ b/Sources/Plasma/NucleusLib/pnProduct/Pch.h @@ -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" From 48d723462cdc3d76b74f862f3c3ce596946c62ab Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:12:21 -0700 Subject: [PATCH 26/42] Fixes for compiler errors in pfAnimation. --- .../pfAnimation/pfObjectFlocker.cpp | 21 +++++++++++++------ .../FeatureLib/pfAnimation/plBlower.cpp | 5 +++-- .../FeatureLib/pfAnimation/plFollowMod.cpp | 3 ++- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp b/Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp index 4603f28f..6ee677b3 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/pfObjectFlocker.cpp @@ -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(); } diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plBlower.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plBlower.cpp index b2d92827..2c1c62a0 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/plBlower.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/plBlower.cpp @@ -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); } @@ -237,4 +238,4 @@ void plBlower::SetConstancy(hsScalar f) hsScalar plBlower::GetConstancy() const { return fBias; -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.cpp b/Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.cpp index 2c0498c7..0ca112bb 100644 --- a/Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.cpp +++ b/Sources/Plasma/FeatureLib/pfAnimation/plFollowMod.cpp @@ -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; From d1608edf4a1653329edff45aaeaa317311f9c623 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:13:23 -0700 Subject: [PATCH 27/42] Fix some warnings in plProgressMgr. --- Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp | 4 ++-- Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp index 1815f7c1..2871d17d 100644 --- a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.cpp @@ -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]; } diff --git a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h index ae72db85..5b156aeb 100644 --- a/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h +++ b/Sources/Plasma/PubUtilLib/plProgressMgr/plProgressMgr.h @@ -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 ) { } From f33589936c4ae9f61ad638055def66b7f1443214 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:14:56 -0700 Subject: [PATCH 28/42] Fix some errors in plAvatar. --- Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp | 6 +++--- Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp index 325d70f9..f5111027 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAGAnimInstance.cpp @@ -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 *********************************************"); } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp index b2e2ec11..431c9bd8 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAnimStage.cpp @@ -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" From 2160df9cd33e8cd67edc4f3225419984754d69aa Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:15:41 -0700 Subject: [PATCH 29/42] plAgeLoader needs unistd for getpid. --- Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.cpp b/Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.cpp index 4b1017bd..f07ebbee 100644 --- a/Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.cpp +++ b/Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.cpp @@ -46,7 +46,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com //#include "hsTimer.h" #include "plResPatcher.h" #include "plBackgroundDownloader.h" -#include "process.h" // for getpid() +#if HS_BUILD_FOR_WIN32 +# include "process.h" // for getpid() +#else +# include +#endif #include "pnProduct/pnProduct.h" From 46e14a43c068d7fb4369dada404c62727a7c329f Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:16:41 -0700 Subject: [PATCH 30/42] Fix warnings in plSDL. --- Sources/Plasma/PubUtilLib/plSDL/plSDL.h | 4 ++-- Sources/Plasma/PubUtilLib/plSDL/plSDLParser.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plSDL/plSDL.h b/Sources/Plasma/PubUtilLib/plSDL/plSDL.h index fbbd91d1..d93bc17f 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plSDL.h +++ b/Sources/Plasma/PubUtilLib/plSDL/plSDL.h @@ -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: diff --git a/Sources/Plasma/PubUtilLib/plSDL/plSDLParser.cpp b/Sources/Plasma/PubUtilLib/plSDL/plSDLParser.cpp index 8ba5c766..41ff6361 100644 --- a/Sources/Plasma/PubUtilLib/plSDL/plSDLParser.cpp +++ b/Sources/Plasma/PubUtilLib/plSDL/plSDLParser.cpp @@ -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; From df57a01d91f0e199bbd36c971bd395a287bb0da7 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:17:19 -0700 Subject: [PATCH 31/42] Change Uuid to plUUID in this message. --- Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.h b/Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.h index 40ed943d..82136163 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plInputIfaceMgrMsg.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 ); From 41495b8e0384cb01d29dc77423a53b897a3edd31 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:18:22 -0700 Subject: [PATCH 32/42] Fix errors in plDrawable. It builds almost the whole project now... until it hits plVisLOSMgr :( --- .../plDrawable/plDrawableGenerator.cpp | 3 ++- .../PubUtilLib/plDrawable/plDrawableSpans.cpp | 5 +++-- .../PubUtilLib/plDrawable/plDynaBulletMgr.cpp | 2 +- .../PubUtilLib/plDrawable/plDynaDecalMgr.cpp | 10 +++++----- .../PubUtilLib/plDrawable/plDynaDecalMgr.h | 4 ++-- .../PubUtilLib/plDrawable/plDynaFootMgr.cpp | 4 ++-- .../PubUtilLib/plDrawable/plDynaPuddleMgr.cpp | 2 +- .../PubUtilLib/plDrawable/plDynaRippleMgr.cpp | 7 ++++--- .../plDrawable/plDynaRippleMgrVS.cpp | 5 +++-- .../PubUtilLib/plDrawable/plDynaTorpedoMgr.cpp | 2 +- .../PubUtilLib/plDrawable/plDynaWakeMgr.cpp | 7 ++++--- .../PubUtilLib/plDrawable/plParticleFiller.cpp | 18 ++++++++++++------ .../PubUtilLib/plDrawable/plSpaceTreeMaker.cpp | 5 +++-- 13 files changed, 43 insertions(+), 31 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableGenerator.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableGenerator.cpp index e66db335..4a8465ee 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableGenerator.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableGenerator.cpp @@ -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 ); } diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp index b7544f78..adb532b6 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp @@ -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; diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaBulletMgr.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDynaBulletMgr.cpp index 3c98180b..7854d8e6 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaBulletMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaBulletMgr.cpp @@ -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(); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp index 5fc6eb07..69f00005 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp @@ -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() ) diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.h b/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.h index c766bfba..b8d54268 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.h +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.h @@ -104,7 +104,7 @@ public: plDynaDecalInfo& Init(const plKey& key); }; -typedef std::map< UInt32, plDynaDecalInfo, std::less > plDynaDecalMap; +typedef std::map< unsigned_ptr, plDynaDecalInfo, std::less > 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); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaFootMgr.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDynaFootMgr.cpp index f89f01d1..2b68e621 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaFootMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaFootMgr.cpp @@ -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); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaPuddleMgr.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDynaPuddleMgr.cpp index a00878c5..e389d7b0 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaPuddleMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaPuddleMgr.cpp @@ -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]); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgr.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgr.cpp index 9d1ca2c7..209a7994 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgr.cpp @@ -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(); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgrVS.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgrVS.cpp index 21a81c1d..9c546208 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgrVS.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaRippleMgrVS.cpp @@ -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(); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaTorpedoMgr.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDynaTorpedoMgr.cpp index eb9d8eb6..632b062e 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaTorpedoMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaTorpedoMgr.cpp @@ -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(); diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plDynaWakeMgr.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plDynaWakeMgr.cpp index c9a40939..6480f085 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plDynaWakeMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plDynaWakeMgr.cpp @@ -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(); @@ -225,4 +226,4 @@ hsBool plDynaWakeMgr::IRippleFromShape(const plPrintShape* shape, hsBool force) retVal = true; } return retVal; -} \ No newline at end of file +} diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plParticleFiller.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plParticleFiller.cpp index 4ff42cb4..45dd04a7 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plParticleFiller.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plParticleFiller.cpp @@ -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 ) diff --git a/Sources/Plasma/PubUtilLib/plDrawable/plSpaceTreeMaker.cpp b/Sources/Plasma/PubUtilLib/plDrawable/plSpaceTreeMaker.cpp index 2eeab115..932bced2 100644 --- a/Sources/Plasma/PubUtilLib/plDrawable/plSpaceTreeMaker.cpp +++ b/Sources/Plasma/PubUtilLib/plDrawable/plSpaceTreeMaker.cpp @@ -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; @@ -734,4 +735,4 @@ void plSpaceTreeMaker::IMakeSpaceTreeRecur(plSpacePrepNode* sub, plSpaceTree* tr IMakeSpaceTreeRecur(sub->fChildren[1], tree, targetLevel, currLevel+1); } -#endif // Leaves first \ No newline at end of file +#endif // Leaves first From 320127dc876d3f68beb1d4640d12457fb168ed0e Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:19:15 -0700 Subject: [PATCH 33/42] Fix syntax error in plCollisionDetector. --- Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.h b/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.h index 9b182d42..8a832b5e 100644 --- a/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.h +++ b/Sources/Plasma/PubUtilLib/plPhysical/plCollisionDetector.h @@ -93,7 +93,7 @@ class plObjectInVolumeDetector : public plCollisionDetector public: class plCollisionBookKeepingInfo { - friend plObjectInVolumeDetector; + friend class plObjectInVolumeDetector; public: plCollisionBookKeepingInfo(plKey& hit) { From 6d6d1c252bf791ac9c9e6d4258f3ce12a7e30a0d Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:19:57 -0700 Subject: [PATCH 34/42] Use hsWindows.h instead of windows.h --- Sources/Plasma/NucleusLib/pnInputCore/plOSMsg.h | 2 +- Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnInputCore/plOSMsg.h b/Sources/Plasma/NucleusLib/pnInputCore/plOSMsg.h index 0e6b630c..0ee37d41 100644 --- a/Sources/Plasma/NucleusLib/pnInputCore/plOSMsg.h +++ b/Sources/Plasma/NucleusLib/pnInputCore/plOSMsg.h @@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plOSMsg_inc #define plOSMsg_inc -#include +#include "hsWindows.h" // // This enum wraps all of the OS messages diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h index 47ee9cb4..4211f948 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h +++ b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h @@ -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 +#include "hsWindows.h" #include "hsTypes.h" #include "hsTemplates.h" #include "pnKeyedObject/hsKeyedObject.h" From c91eb23f92d460175a7c23155b0334e6bcf88ca2 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:21:44 -0700 Subject: [PATCH 35/42] Clean up the linking mess in CMake. (Of the library variety, not the book variety... although that's still confusingly similar terminology) --- Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt | 2 +- Sources/Plasma/Apps/plFileSecure/CMakeLists.txt | 3 +-- Sources/Plasma/Apps/plFileSecure/main.cpp | 3 ++- Sources/Plasma/Apps/plLogDecrypt/CMakeLists.txt | 2 +- Sources/Plasma/Apps/plPythonPack/CMakeLists.txt | 2 +- Sources/Plasma/CoreLib/CMakeLists.txt | 3 +++ Sources/Plasma/NucleusLib/inc/CMakeLists.txt | 1 + Sources/Plasma/NucleusLib/pnDispatch/CMakeLists.txt | 5 +++-- Sources/Plasma/NucleusLib/pnFactory/CMakeLists.txt | 3 ++- Sources/Plasma/NucleusLib/pnKeyedObject/CMakeLists.txt | 1 + Sources/Plasma/NucleusLib/pnMessage/CMakeLists.txt | 1 + Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt | 1 + Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt | 2 +- Sources/Plasma/NucleusLib/pnTimer/CMakeLists.txt | 1 + Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt | 2 +- Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt | 1 + Sources/Plasma/PubUtilLib/plFile/CMakeLists.txt | 2 +- Sources/Plasma/PubUtilLib/plResMgr/CMakeLists.txt | 1 + Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt | 1 + 19 files changed, 25 insertions(+), 12 deletions(-) diff --git a/Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt b/Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt index e416ef88..b4fdd13f 100644 --- a/Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt +++ b/Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt @@ -12,6 +12,6 @@ set(plFileEncrypt_SOURCES ) add_executable(plFileEncrypt ${plFileEncrypt_SOURCES}) -target_link_libraries(plFileEncrypt CoreLib CoreLibExe plFile plUnifiedTime pnUUID pnProduct) +target_link_libraries(plFileEncrypt CoreLib CoreLibExe pnProduct plFile) source_group("Source Files" FILES ${plFileEncrypt_SOURCES}) diff --git a/Sources/Plasma/Apps/plFileSecure/CMakeLists.txt b/Sources/Plasma/Apps/plFileSecure/CMakeLists.txt index 31579f80..09500b00 100644 --- a/Sources/Plasma/Apps/plFileSecure/CMakeLists.txt +++ b/Sources/Plasma/Apps/plFileSecure/CMakeLists.txt @@ -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}) diff --git a/Sources/Plasma/Apps/plFileSecure/main.cpp b/Sources/Plasma/Apps/plFileSecure/main.cpp index e8b613cf..a55b58ed 100644 --- a/Sources/Plasma/Apps/plFileSecure/main.cpp +++ b/Sources/Plasma/Apps/plFileSecure/main.cpp @@ -42,10 +42,11 @@ 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" +#include "pnUUID/pnUUIDCreatable.h" + #include #include diff --git a/Sources/Plasma/Apps/plLogDecrypt/CMakeLists.txt b/Sources/Plasma/Apps/plLogDecrypt/CMakeLists.txt index d4c10dd2..9a62efdc 100644 --- a/Sources/Plasma/Apps/plLogDecrypt/CMakeLists.txt +++ b/Sources/Plasma/Apps/plLogDecrypt/CMakeLists.txt @@ -12,6 +12,6 @@ set(plLogDecrypt_SOURCES ) add_executable(plLogDecrypt ${plLogDecrypt_SOURCES}) -target_link_libraries(plLogDecrypt CoreLib CoreLibExe plFile plUnifiedTime plStatusLog pnProduct) +target_link_libraries(plLogDecrypt CoreLib CoreLibExe plStatusLog pnProduct) source_group("Source Files" FILES ${plLogDecrypt_SOURCES}) diff --git a/Sources/Plasma/Apps/plPythonPack/CMakeLists.txt b/Sources/Plasma/Apps/plPythonPack/CMakeLists.txt index ddc18ed3..3fd9cf70 100644 --- a/Sources/Plasma/Apps/plPythonPack/CMakeLists.txt +++ b/Sources/Plasma/Apps/plPythonPack/CMakeLists.txt @@ -13,7 +13,7 @@ set(plPythonPack_HEADERS ) add_executable(plPythonPack ${plPythonPack_SOURCES} ${plPythonPack_HEADERS}) -target_link_libraries(plPythonPack CoreLib CoreLibExe plFile plUnifiedTime) +target_link_libraries(plPythonPack CoreLib CoreLibExe plFile) if(PYTHON_DEBUG_LIBRARY) target_link_libraries(plPythonPack debug ${PYTHON_DEBUG_LIBRARY}) diff --git a/Sources/Plasma/CoreLib/CMakeLists.txt b/Sources/Plasma/CoreLib/CMakeLists.txt index 70150197..7de9b1ee 100644 --- a/Sources/Plasma/CoreLib/CMakeLists.txt +++ b/Sources/Plasma/CoreLib/CMakeLists.txt @@ -95,6 +95,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}) diff --git a/Sources/Plasma/NucleusLib/inc/CMakeLists.txt b/Sources/Plasma/NucleusLib/inc/CMakeLists.txt index 696f360f..51827345 100644 --- a/Sources/Plasma/NucleusLib/inc/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/inc/CMakeLists.txt @@ -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}) diff --git a/Sources/Plasma/NucleusLib/pnDispatch/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnDispatch/CMakeLists.txt index 7e8eaf6e..8e6c6132 100644 --- a/Sources/Plasma/NucleusLib/pnDispatch/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnDispatch/CMakeLists.txt @@ -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}) \ No newline at end of file +source_group("Header Files" FILES ${pnDispatch_HEADERS}) diff --git a/Sources/Plasma/NucleusLib/pnFactory/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnFactory/CMakeLists.txt index c636c17f..a8a243fa 100644 --- a/Sources/Plasma/NucleusLib/pnFactory/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnFactory/CMakeLists.txt @@ -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}) \ No newline at end of file +source_group("Header Files" FILES ${pnFactory_HEADERS}) diff --git a/Sources/Plasma/NucleusLib/pnKeyedObject/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnKeyedObject/CMakeLists.txt index 19b9b1de..17a81544 100644 --- a/Sources/Plasma/NucleusLib/pnKeyedObject/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnKeyedObject/CMakeLists.txt @@ -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}) diff --git a/Sources/Plasma/NucleusLib/pnMessage/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnMessage/CMakeLists.txt index de4db1b5..29ed0d3d 100644 --- a/Sources/Plasma/NucleusLib/pnMessage/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnMessage/CMakeLists.txt @@ -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}) diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt index b88ce118..6487445f 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt @@ -33,6 +33,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}) diff --git a/Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt index 6dd8d8f9..3b2cc202 100644 --- a/Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnProduct/CMakeLists.txt @@ -20,7 +20,7 @@ set(pnProduct_PRIVATE add_library(pnProduct STATIC ${pnProduct_HEADERS} ${pnProduct_PRIVATE}) -target_link_libraries(pnProduct pnUUID) +target_link_libraries(pnProduct CoreLib pnUUID) source_group("Header Files" FILES ${pnProduct_HEADERS}) source_group("Private" FILES ${pnProduct_PRIVATE}) diff --git a/Sources/Plasma/NucleusLib/pnTimer/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnTimer/CMakeLists.txt index 7989f994..e7202102 100644 --- a/Sources/Plasma/NucleusLib/pnTimer/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnTimer/CMakeLists.txt @@ -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}) diff --git a/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt index e1d435c7..bccb3d67 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt @@ -17,7 +17,7 @@ set(pnUUID_HEADERS ) add_library(pnUUID STATIC ${pnUUID_SOURCES} ${pnUUID_HEADERS}) -target_link_libraries(pnUUID pnFactory) +target_link_libraries(pnUUID CoreLib pnFactory) if(WIN32) target_link_libraries(pnUUID pnUtils) target_link_libraries(pnUUID Rpcrt4) diff --git a/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt index 59c221ec..d9f99d38 100644 --- a/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt @@ -36,6 +36,7 @@ set(plAudioCore_HEADERS ) add_library(plAudioCore STATIC ${plAudioCore_SOURCES} ${plAudioCore_HEADERS}) +target_link_libraries(plAudioCore ogg vorbis vorbisfile) source_group("Source Files" FILES ${plAudioCore_SOURCES}) source_group("Header Files" FILES ${plAudioCore_HEADERS}) diff --git a/Sources/Plasma/PubUtilLib/plFile/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plFile/CMakeLists.txt index 2e5be567..03bc9afe 100644 --- a/Sources/Plasma/PubUtilLib/plFile/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plFile/CMakeLists.txt @@ -35,7 +35,7 @@ set(plFile_HEADERS ) add_library(plFile STATIC ${plFile_SOURCES} ${plFile_HEADERS}) -target_link_libraries(plFile CoreLib ${ZLIB_LIBRARIES}) +target_link_libraries(plFile CoreLib plUnifiedTime ${ZLIB_LIBRARIES}) source_group("Source Files" FILES ${plFile_SOURCES}) source_group("Header Files" FILES ${plFile_HEADERS}) diff --git a/Sources/Plasma/PubUtilLib/plResMgr/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plResMgr/CMakeLists.txt index abc69922..54b59dee 100644 --- a/Sources/Plasma/PubUtilLib/plResMgr/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plResMgr/CMakeLists.txt @@ -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}) diff --git a/Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt index 2c425303..7ffc5080 100644 --- a/Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt @@ -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}) From 853126e063ee08016b1fd5652dca1aeb15669ffe Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:22:55 -0700 Subject: [PATCH 36/42] Don't leak out unistd.h --- Sources/Plasma/PubUtilLib/plFile/hsFiles.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plFile/hsFiles.h b/Sources/Plasma/PubUtilLib/plFile/hsFiles.h index 511fb3b6..80e88e46 100644 --- a/Sources/Plasma/PubUtilLib/plFile/hsFiles.h +++ b/Sources/Plasma/PubUtilLib/plFile/hsFiles.h @@ -48,7 +48,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #if HS_BUILD_FOR_UNIX #include #define kFolderIterator_MaxPath PATH_MAX - #include #define SetCurrentDirectory chdir #elif !HS_BUILD_FOR_PS2 #define kFolderIterator_MaxPath _MAX_PATH From c1f5d5102d3eb1f3f74dc010b05ed46adedbf6a4 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:23:24 -0700 Subject: [PATCH 37/42] Build plPageInfo app. --- Sources/Plasma/Apps/CMakeLists.txt | 1 + Sources/Plasma/Apps/plPageInfo/CMakeLists.txt | 18 +++++++++++++++ .../Apps/plPageInfo/plAllCreatables.cpp | 21 +++++++++-------- Sources/Plasma/Apps/plPageInfo/plPageInfo.cpp | 23 +++++++++---------- 4 files changed, 41 insertions(+), 22 deletions(-) create mode 100644 Sources/Plasma/Apps/plPageInfo/CMakeLists.txt diff --git a/Sources/Plasma/Apps/CMakeLists.txt b/Sources/Plasma/Apps/CMakeLists.txt index ede23503..a2e648d3 100644 --- a/Sources/Plasma/Apps/CMakeLists.txt +++ b/Sources/Plasma/Apps/CMakeLists.txt @@ -5,3 +5,4 @@ add_subdirectory(plUruLauncher) add_subdirectory(plFileSecure) add_subdirectory(plFileEncrypt) add_subdirectory(plLogDecrypt) +add_subdirectory(plPageInfo) diff --git a/Sources/Plasma/Apps/plPageInfo/CMakeLists.txt b/Sources/Plasma/Apps/plPageInfo/CMakeLists.txt new file mode 100644 index 00000000..8fe28883 --- /dev/null +++ b/Sources/Plasma/Apps/plPageInfo/CMakeLists.txt @@ -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}) diff --git a/Sources/Plasma/Apps/plPageInfo/plAllCreatables.cpp b/Sources/Plasma/Apps/plPageInfo/plAllCreatables.cpp index 2fccd6a2..c814d1a0 100644 --- a/Sources/Plasma/Apps/plPageInfo/plAllCreatables.cpp +++ b/Sources/Plasma/Apps/plPageInfo/plAllCreatables.cpp @@ -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,17 @@ 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 "pnUUID/pnUUIDCreatable.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" diff --git a/Sources/Plasma/Apps/plPageInfo/plPageInfo.cpp b/Sources/Plasma/Apps/plPageInfo/plPageInfo.cpp index eef6865d..77ea680f 100644 --- a/Sources/Plasma/Apps/plPageInfo/plPageInfo.cpp +++ b/Sources/Plasma/Apps/plPageInfo/plPageInfo.cpp @@ -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 /////////////////////////////////////////////////////////////// @@ -267,4 +266,4 @@ bool DumpStats(const char* patchDir) plStatDumpIterator statDump(patchDir); gResMgr->IterateAllPages(&statDump); return true; -} \ No newline at end of file +} From 7c7ef7e5706cc4ea70b2f29a4027594dece11a92 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:43:39 -0700 Subject: [PATCH 38/42] Use the auto-library names for ogg and vorbis. --- Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt index d9f99d38..be682a27 100644 --- a/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plAudioCore/CMakeLists.txt @@ -36,7 +36,8 @@ set(plAudioCore_HEADERS ) add_library(plAudioCore STATIC ${plAudioCore_SOURCES} ${plAudioCore_HEADERS}) -target_link_libraries(plAudioCore ogg vorbis vorbisfile) +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}) From 5d9f59fb1acecde8a3d92d741e4c611478210b28 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Fri, 28 Oct 2011 23:52:50 -0700 Subject: [PATCH 39/42] Link pnAddrInfo against ws2_32 on Windows. --- Sources/Plasma/NucleusLib/pnAddrInfo/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/NucleusLib/pnAddrInfo/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnAddrInfo/CMakeLists.txt index 680ebac7..94d2e4ad 100644 --- a/Sources/Plasma/NucleusLib/pnAddrInfo/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnAddrInfo/CMakeLists.txt @@ -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}) \ No newline at end of file +source_group("Header Files" FILES ${pnAddrInfo_HEADERS}) From 89e42ed3613e5852834f929f9468f83333e08bab Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 29 Oct 2011 00:17:57 -0700 Subject: [PATCH 40/42] Move plCreatableUUID somewhere less annoying. --- Sources/Plasma/Apps/plFileEncrypt/main.cpp | 1 - Sources/Plasma/Apps/plFileSecure/main.cpp | 2 -- .../Apps/plPageInfo/plAllCreatables.cpp | 1 - Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp | 1 + .../NucleusLib/pnNetCommon/CMakeLists.txt | 1 + .../plCreatableUuid.h} | 23 ++++++++++++------- .../pnNetCommon/pnNetCommonCreatable.h | 3 +++ .../Plasma/NucleusLib/pnUUID/CMakeLists.txt | 3 +-- Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp | 22 ------------------ Sources/Plasma/NucleusLib/pnUUID/pnUUID.h | 15 ------------ 10 files changed, 21 insertions(+), 51 deletions(-) rename Sources/Plasma/NucleusLib/{pnUUID/pnUUIDCreatable.h => pnNetCommon/plCreatableUuid.h} (74%) diff --git a/Sources/Plasma/Apps/plFileEncrypt/main.cpp b/Sources/Plasma/Apps/plFileEncrypt/main.cpp index e96947ba..0b1f894b 100644 --- a/Sources/Plasma/Apps/plFileEncrypt/main.cpp +++ b/Sources/Plasma/Apps/plFileEncrypt/main.cpp @@ -43,7 +43,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plFile/plEncryptedStream.h" #include "pnProduct/pnProduct.h" #include "hsUtils.h" -#include "pnUUID/pnUUIDCreatable.h" void EncryptFiles(const char* dir, const char* ext, bool encrypt); diff --git a/Sources/Plasma/Apps/plFileSecure/main.cpp b/Sources/Plasma/Apps/plFileSecure/main.cpp index a55b58ed..6503def1 100644 --- a/Sources/Plasma/Apps/plFileSecure/main.cpp +++ b/Sources/Plasma/Apps/plFileSecure/main.cpp @@ -45,8 +45,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnProduct/pnProduct.h" #include "hsUtils.h" -#include "pnUUID/pnUUIDCreatable.h" - #include #include diff --git a/Sources/Plasma/Apps/plPageInfo/plAllCreatables.cpp b/Sources/Plasma/Apps/plPageInfo/plAllCreatables.cpp index c814d1a0..ce7c10f5 100644 --- a/Sources/Plasma/Apps/plPageInfo/plAllCreatables.cpp +++ b/Sources/Plasma/Apps/plPageInfo/plAllCreatables.cpp @@ -61,7 +61,6 @@ REGISTER_NONCREATABLE( plDispatchBase ); #include "pnModifier/pnModifierCreatable.h" #include "pnNetCommon/pnNetCommonCreatable.h" #include "pnTimer/pnTimerCreatable.h" -#include "pnUUID/pnUUIDCreatable.h" #include "plResMgr/plResMgrCreatable.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp index b5a57150..f7e935cd 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp @@ -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" diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt index 6487445f..13974a33 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt @@ -4,6 +4,7 @@ include_directories("../../NucleusLib/inc") include_directories("../../PubUtilLib") set(pnNetCommon_HEADERS + plCreatableUuid.h plGenericVar.h plNetAddress.h plNetApp.h diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUIDCreatable.h b/Sources/Plasma/NucleusLib/pnNetCommon/plCreatableUuid.h similarity index 74% rename from Sources/Plasma/NucleusLib/pnUUID/pnUUIDCreatable.h rename to Sources/Plasma/NucleusLib/pnNetCommon/plCreatableUuid.h index 0b327aea..4d76dd8c 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUIDCreatable.h +++ b/Sources/Plasma/NucleusLib/pnNetCommon/plCreatableUuid.h @@ -39,16 +39,23 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#ifndef pnCreatableUUID_h_inc +#define pnCreatableUUID_h_inc -#ifndef pnUUIDCreatable_inc -#define pnUUIDCreatable_inc +#include "pnUUID/pnUUID.h" +#include "pnFactory/plCreatable.h" -#include "pnFactory/plCreator.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) { } -#include "pnUUID.h" - -REGISTER_CREATABLE( plCreatableUuid ); - -#endif // pnUUIDCreatable_inc + void Read( hsStream * s, hsResMgr* ) { plUUID::Read(s); } + void Write( hsStream * s, hsResMgr* ) { plUUID::Write(s); } +}; +#endif //pnCreatableUUID_h_inc diff --git a/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommonCreatable.h b/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommonCreatable.h index 0f28f4ac..6b6b24b7 100644 --- a/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommonCreatable.h +++ b/Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommonCreatable.h @@ -57,6 +57,9 @@ REGISTER_CREATABLE( plCreatableGenericValue ); #include "pnNetCommon.h" REGISTER_CREATABLE( plCreatableStream ); +#include "plCreatableUuid.h" +REGISTER_CREATABLE( plCreatableUuid ); + #endif // pnNetCommonCreatable_inc diff --git a/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt index bccb3d67..2d9cb98b 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUUID/CMakeLists.txt @@ -13,11 +13,10 @@ endif(WIN32) set(pnUUID_HEADERS pnUUID.h - pnUUIDCreatable.h ) add_library(pnUUID STATIC ${pnUUID_SOURCES} ${pnUUID_HEADERS}) -target_link_libraries(pnUUID CoreLib pnFactory) +target_link_libraries(pnUUID CoreLib) if(WIN32) target_link_libraries(pnUUID pnUtils) target_link_libraries(pnUUID Rpcrt4) diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp index cf4291c6..f6c6073e 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp @@ -73,25 +73,3 @@ const char * plUUID::AsString() const { ToStdString(str); return str.c_str(); } - -/***************************************************************************** -* -* plCreatableUuid -* -***/ - -//============================================================================ -plCreatableUuid::plCreatableUuid () { -} - -//============================================================================ -plCreatableUuid::plCreatableUuid (const plCreatableUuid & other) -: plUUID(other) -{ -} - -//============================================================================ -plCreatableUuid::plCreatableUuid (const plUUID & other) -: plUUID(other) -{ -} diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h index 24828014..7d1a21af 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h @@ -47,7 +47,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifdef HS_BUILD_FOR_WIN32 #include "pnUtils/pnUtils.h" #endif -#include "pnFactory/plCreatable.h" class hsStream; @@ -93,18 +92,4 @@ public: 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 // pnUUID_h_inc From 2599af48157d15d9b6a36c96ce9c60a3f091c024 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 30 Oct 2011 13:04:46 -0700 Subject: [PATCH 41/42] Fix for pnNucleusCreatables.h --- Sources/Plasma/NucleusLib/inc/pnNucleusCreatables.h | 1 - 1 file changed, 1 deletion(-) diff --git a/Sources/Plasma/NucleusLib/inc/pnNucleusCreatables.h b/Sources/Plasma/NucleusLib/inc/pnNucleusCreatables.h index df20e728..39a242d4 100644 --- a/Sources/Plasma/NucleusLib/inc/pnNucleusCreatables.h +++ b/Sources/Plasma/NucleusLib/inc/pnNucleusCreatables.h @@ -68,6 +68,5 @@ REGISTER_NONCREATABLE( plDispatchBase ); #include "pnNetCommon/pnNetCommonCreatable.h" #include "pnSceneObject/pnSceneObjectCreatable.h" #include "pnTimer/pnTimerCreatable.h" -#include "pnUUID/pnUUIDCreatable.h" #endif // pnNucleusCreatables_inc From dc82e003c7543fefcf8d286bd0d059efe08303a9 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 30 Oct 2011 14:06:16 -0700 Subject: [PATCH 42/42] This value is only semi-optional. --- Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp index e4f4e3ec..2c0279f2 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp @@ -602,7 +602,8 @@ bool plSecureStream::ICheckMagicString(hsFD fp) { char magicString[kMagicStringLen+1]; #ifdef HS_BUILD_FOR_WIN32 - ReadFile(fp, &magicString, kMagicStringLen, NULL, NULL); + DWORD numread; + ReadFile(fp, &magicString, kMagicStringLen, &numread, NULL); #elif HS_BUILD_FOR_UNIX fread(&magicString, kMagicStringLen, 1, fp); #endif