Browse Source

Fix or disable components that don't build on Linux.

Michael Hansen 10 years ago
parent
commit
b12bce00ff
  1. 6
      CMakeLists.txt
  2. 8
      Sources/Plasma/FeatureLib/CMakeLists.txt
  3. 8
      Sources/Plasma/NucleusLib/CMakeLists.txt
  4. 8
      Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp
  5. 42
      Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp
  6. 8
      Sources/Plasma/PubUtilLib/CMakeLists.txt
  7. 4
      Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp
  8. 4
      Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp
  9. 2
      Sources/Plasma/PubUtilLib/plSockets/plBufferedSocketWriter.cpp

6
CMakeLists.txt

@ -106,7 +106,11 @@ option(PLASMA_BUILD_RESOURCE_DAT "Do we want to build resource.dat?" ON)
option(PLASMA_BUILD_LAUNCHER "Do we want to build plUruLauncher?" ON) option(PLASMA_BUILD_LAUNCHER "Do we want to build plUruLauncher?" ON)
option(PLASMA_BUILD_TOOLS "Do we want to build the Plasma tools?" ON) option(PLASMA_BUILD_TOOLS "Do we want to build the Plasma tools?" ON)
option(PLASMA_BUILD_TESTS "Do we want to build the unit tests?" OFF) option(PLASMA_BUILD_TESTS "Do we want to build the unit tests?" OFF)
option(3dsm_BUILD_PLUGIN "Do we want to build the 3ds Max plugin?" OFF) if(WIN32)
option(3dsm_BUILD_PLUGIN "Do we want to build the 3ds Max plugin?" OFF)
else()
set(3dsm_BUILD_PLUGIN OFF)
endif()
if(PLASMA_BUILD_TOOLS) if(PLASMA_BUILD_TOOLS)
# Custom dummy target for compiling all tools # Custom dummy target for compiling all tools

8
Sources/Plasma/FeatureLib/CMakeLists.txt

@ -8,7 +8,9 @@ add_subdirectory(pfCharacter)
add_subdirectory(pfConditional) add_subdirectory(pfConditional)
add_subdirectory(pfConsole) add_subdirectory(pfConsole)
add_subdirectory(pfConsoleCore) add_subdirectory(pfConsoleCore)
add_subdirectory(pfCrashHandler) if(WIN32)
add_subdirectory(pfCrashHandler)
endif()
add_subdirectory(pfGameGUIMgr) add_subdirectory(pfGameGUIMgr)
add_subdirectory(pfGameMgr) add_subdirectory(pfGameMgr)
add_subdirectory(pfGameScoreMgr) add_subdirectory(pfGameScoreMgr)
@ -18,7 +20,9 @@ add_subdirectory(pfJournalBook)
add_subdirectory(pfLocalizationMgr) add_subdirectory(pfLocalizationMgr)
add_subdirectory(pfMessage) add_subdirectory(pfMessage)
add_subdirectory(pfMoviePlayer) add_subdirectory(pfMoviePlayer)
add_subdirectory(pfPasswordStore) if(WIN32 OR APPLE)
add_subdirectory(pfPasswordStore)
endif()
add_subdirectory(pfPatcher) add_subdirectory(pfPatcher)
add_subdirectory(pfPython) add_subdirectory(pfPython)
add_subdirectory(pfSurface) add_subdirectory(pfSurface)

8
Sources/Plasma/NucleusLib/CMakeLists.txt

@ -2,12 +2,16 @@ add_definitions(-D_LIB)
add_subdirectory(inc) add_subdirectory(inc)
add_subdirectory(pnAsyncCore) add_subdirectory(pnAsyncCore)
add_subdirectory(pnAsyncCoreExe) if(WIN32)
add_subdirectory(pnAsyncCoreExe)
endif()
add_subdirectory(pnDispatch) add_subdirectory(pnDispatch)
add_subdirectory(pnEncryption) add_subdirectory(pnEncryption)
add_subdirectory(pnFactory) add_subdirectory(pnFactory)
add_subdirectory(pnGameMgr) add_subdirectory(pnGameMgr)
add_subdirectory(pnInputCore) if(WIN32)
add_subdirectory(pnInputCore)
endif()
add_subdirectory(pnKeyedObject) add_subdirectory(pnKeyedObject)
add_subdirectory(pnMessage) add_subdirectory(pnMessage)
add_subdirectory(pnModifier) add_subdirectory(pnModifier)

8
Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp

@ -678,7 +678,7 @@ static void ClientConnect (NetCli * cli) {
memset(&cli->seed, 0, sizeof(cli->seed)); memset(&cli->seed, 0, sizeof(cli->seed));
unsigned bytes; unsigned bytes;
unsigned char * data = clientSeed.GetData_LE(&bytes); unsigned char * data = clientSeed.GetData_LE(&bytes);
memcpy(cli->seed, data, std::min(bytes, sizeof(cli->seed))); memcpy(cli->seed, data, std::min(size_t(bytes), sizeof(cli->seed)));
delete [] data; delete [] data;
} }
@ -740,7 +740,7 @@ static bool ServerRecvConnect (
memset(&clientSeed, 0, sizeof(clientSeed)); memset(&clientSeed, 0, sizeof(clientSeed));
unsigned bytes; unsigned bytes;
unsigned char * data = clientSeedValue.GetData_LE(&bytes); unsigned char * data = clientSeedValue.GetData_LE(&bytes);
memcpy(clientSeed, data, std::min(bytes, sizeof(clientSeed))); memcpy(clientSeed, data, std::min(size_t(bytes), sizeof(clientSeed)));
delete [] data; delete [] data;
} }
@ -960,8 +960,8 @@ static NetCli * ConnCreate (
//=========================================================================== //===========================================================================
static void SetConnSeed ( static void SetConnSeed (
NetCli * cli, NetCli * cli,
unsigned seedBytes, size_t seedBytes,
const uint8_t seedData[] const uint8_t seedData[]
) { ) {
if (seedBytes) if (seedBytes)
memcpy(cli->seed, seedData, std::min(sizeof(cli->seed), seedBytes)); memcpy(cli->seed, seedData, std::min(sizeof(cli->seed), seedBytes));

42
Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.cpp

@ -72,7 +72,7 @@ const unsigned kNumBlobFields = 4;
//============================================================================ //============================================================================
template <typename T> template <typename T>
static inline void IReadValue (T * value, uint8_t ** buffer, unsigned * bufsz) { inline void IReadValue (T * value, uint8_t ** buffer, unsigned * bufsz) {
ASSERT(*bufsz >= sizeof(T)); ASSERT(*bufsz >= sizeof(T));
*value = *(T *)*buffer; *value = *(T *)*buffer;
*buffer += sizeof(T); *buffer += sizeof(T);
@ -81,7 +81,7 @@ static inline void IReadValue (T * value, uint8_t ** buffer, unsigned * bufsz) {
//============================================================================ //============================================================================
template <typename T> template <typename T>
static inline void IReadArray (T ** buf, unsigned * elems, uint8_t ** buffer, unsigned * bufsz) { inline void IReadArray (T ** buf, unsigned * elems, uint8_t ** buffer, unsigned * bufsz) {
uint32_t bytes; uint32_t bytes;
IReadValue(&bytes, buffer, bufsz); IReadValue(&bytes, buffer, bufsz);
ASSERT(bytes % sizeof(T) == 0); ASSERT(bytes % sizeof(T) == 0);
@ -96,7 +96,7 @@ static inline void IReadArray (T ** buf, unsigned * elems, uint8_t ** buffer, un
//============================================================================ //============================================================================
template <typename T> template <typename T>
static inline void IReadString (T ** buf, uint8_t ** buffer, unsigned * bufsz) { inline void IReadString (T ** buf, uint8_t ** buffer, unsigned * bufsz) {
unsigned elems; unsigned elems;
IReadArray(buf, &elems, buffer, bufsz); IReadArray(buf, &elems, buffer, bufsz);
// ensure the string is null-terminated // ensure the string is null-terminated
@ -106,14 +106,14 @@ static inline void IReadString (T ** buf, uint8_t ** buffer, unsigned * bufsz) {
//============================================================================ //============================================================================
template <typename T> template <typename T>
static inline void IWriteValue (const T & value, ARRAY(uint8_t) * buffer) { inline void IWriteValue (const T & value, ARRAY(uint8_t) * buffer) {
T * ptr = (T *) buffer->New(sizeof(T)); T * ptr = (T *) buffer->New(sizeof(T));
*ptr = value; *ptr = value;
} }
//============================================================================ //============================================================================
template <typename T> template <typename T>
static inline void IWriteArray (const T buf[], unsigned elems, ARRAY(uint8_t) * buffer) { inline void IWriteArray (const T buf[], unsigned elems, ARRAY(uint8_t) * buffer) {
unsigned bytes = elems * sizeof(T); unsigned bytes = elems * sizeof(T);
IWriteValue(bytes, buffer); IWriteValue(bytes, buffer);
T * dst = (T *) buffer->New(bytes); T * dst = (T *) buffer->New(bytes);
@ -122,19 +122,19 @@ static inline void IWriteArray (const T buf[], unsigned elems, ARRAY(uint8_t) *
//============================================================================ //============================================================================
template <typename T> template <typename T>
static inline void IWriteString (const T str[], ARRAY(uint8_t) * buffer) { inline void IWriteString (const T str[], ARRAY(uint8_t) * buffer) {
IWriteArray(str, StrLen(str) + 1, buffer); IWriteArray(str, StrLen(str) + 1, buffer);
} }
//============================================================================ //============================================================================
template <typename T> template <typename T>
static inline bool ICompareValue (const T & lhs, const T & rhs) { inline bool ICompareValue (const T & lhs, const T & rhs) {
return lhs == rhs; return lhs == rhs;
} }
//============================================================================ //============================================================================
template <typename T> template <typename T>
static inline bool ICompareString (const T lhs[], const T rhs[]) { inline bool ICompareString (const T lhs[], const T rhs[]) {
if (!lhs && !rhs) if (!lhs && !rhs)
return true; return true;
if (!lhs || !rhs) if (!lhs || !rhs)
@ -144,7 +144,7 @@ static inline bool ICompareString (const T lhs[], const T rhs[]) {
//============================================================================ //============================================================================
template <typename T> template <typename T>
static inline bool ICompareStringI (const T lhs[], const T rhs[]) { inline bool ICompareStringI (const T lhs[], const T rhs[]) {
if (!lhs && !rhs) if (!lhs && !rhs)
return true; return true;
if (!lhs || !rhs) if (!lhs || !rhs)
@ -159,13 +159,13 @@ static inline bool ICompareArray (const uint8_t lhs[], const uint8_t rhs[]) {
//============================================================================ //============================================================================
template <typename T> template <typename T>
static inline void ICopyValue (T * plhs, const T & rhs) { inline void ICopyValue (T * plhs, const T & rhs) {
*plhs = rhs; *plhs = rhs;
} }
//============================================================================ //============================================================================
template <typename T> template <typename T>
static inline void ICopyString (T ** plhs, const T rhs[]) { inline void ICopyString (T ** plhs, const T rhs[]) {
free(*plhs); free(*plhs);
if (rhs) if (rhs)
*plhs = StrDup(rhs); *plhs = StrDup(rhs);
@ -351,25 +351,25 @@ void NetVaultNode::Clear()
//============================================================================ //============================================================================
template<typename T> template<typename T>
static void IZero(T& dest) inline void IZero(T& dest)
{ {
dest = 0; dest = 0;
} }
template<> template<>
static void IZero<plString>(plString& dest) inline void IZero<plString>(plString& dest)
{ {
dest = ""; dest = "";
} }
template<> template<>
static void IZero<plUUID>(plUUID& dest) inline void IZero<plUUID>(plUUID& dest)
{ {
dest = kNilUuid; dest = kNilUuid;
} }
template<> template<>
static void IZero<NetVaultNode::Blob>(NetVaultNode::Blob& blob) inline void IZero<NetVaultNode::Blob>(NetVaultNode::Blob& blob)
{ {
delete[] blob.buffer; delete[] blob.buffer;
blob.buffer = nullptr; blob.buffer = nullptr;
@ -484,7 +484,7 @@ bool NetVaultNode::Matches(const NetVaultNode* rhs) const
//============================================================================ //============================================================================
template<typename T> template<typename T>
static void IRead(const uint8_t*& buf, T& dest) inline void IRead(const uint8_t*& buf, T& dest)
{ {
const T* ptr = reinterpret_cast<const T*>(buf); const T* ptr = reinterpret_cast<const T*>(buf);
dest = *ptr; dest = *ptr;
@ -492,7 +492,7 @@ static void IRead(const uint8_t*& buf, T& dest)
} }
template<> template<>
static void IRead<plString>(const uint8_t*& buf, plString& dest) inline void IRead<plString>(const uint8_t*& buf, plString& dest)
{ {
uint32_t size = *(reinterpret_cast<const uint32_t*>(buf)); uint32_t size = *(reinterpret_cast<const uint32_t*>(buf));
uint32_t nChars = (size / sizeof(uint16_t)) - 1; uint32_t nChars = (size / sizeof(uint16_t)) - 1;
@ -507,7 +507,7 @@ static void IRead<plString>(const uint8_t*& buf, plString& dest)
} }
template<> template<>
static void IRead<NetVaultNode::Blob>(const uint8_t*& buf, NetVaultNode::Blob& blob) inline void IRead<NetVaultNode::Blob>(const uint8_t*& buf, NetVaultNode::Blob& blob)
{ {
blob.size = *(reinterpret_cast<const uint32_t*>(buf)); blob.size = *(reinterpret_cast<const uint32_t*>(buf));
buf += sizeof(uint32_t); buf += sizeof(uint32_t);
@ -563,14 +563,14 @@ void NetVaultNode::Read(const uint8_t* buf, size_t size)
//============================================================================ //============================================================================
template<typename T> template<typename T>
static void IWrite(ARRAY(uint8_t)* buffer, const T& value) inline void IWrite(ARRAY(uint8_t)* buffer, const T& value)
{ {
uint8_t* ptr = buffer->New(sizeof(T)); uint8_t* ptr = buffer->New(sizeof(T));
memcpy(ptr, &value, sizeof(T)); memcpy(ptr, &value, sizeof(T));
} }
template<> template<>
static void IWrite<plString>(ARRAY(uint8_t)* buffer, const plString& value) inline void IWrite<plString>(ARRAY(uint8_t)* buffer, const plString& value)
{ {
plStringBuffer<uint16_t> utf16 = value.ToUtf16(); plStringBuffer<uint16_t> utf16 = value.ToUtf16();
uint32_t strsz = (utf16.GetSize() + 1) * 2; uint32_t strsz = (utf16.GetSize() + 1) * 2;
@ -581,7 +581,7 @@ static void IWrite<plString>(ARRAY(uint8_t)* buffer, const plString& value)
} }
template<> template<>
static void IWrite<NetVaultNode::Blob>(ARRAY(uint8_t)* buffer, const NetVaultNode::Blob& blob) inline void IWrite<NetVaultNode::Blob>(ARRAY(uint8_t)* buffer, const NetVaultNode::Blob& blob)
{ {
IWrite(buffer, static_cast<uint32_t>(blob.size)); IWrite(buffer, static_cast<uint32_t>(blob.size));

8
Sources/Plasma/PubUtilLib/CMakeLists.txt

@ -15,7 +15,9 @@ add_subdirectory(plDrawable)
add_subdirectory(plFile) add_subdirectory(plFile)
add_subdirectory(plGImage) add_subdirectory(plGImage)
add_subdirectory(plGLight) add_subdirectory(plGLight)
add_subdirectory(plInputCore) if(WIN32)
add_subdirectory(plInputCore)
endif()
add_subdirectory(plInterp) add_subdirectory(plInterp)
add_subdirectory(plIntersect) add_subdirectory(plIntersect)
add_subdirectory(plMath) add_subdirectory(plMath)
@ -30,7 +32,9 @@ add_subdirectory(plNetMessage)
add_subdirectory(plNetTransport) add_subdirectory(plNetTransport)
add_subdirectory(plParticleSystem) add_subdirectory(plParticleSystem)
add_subdirectory(plPhysical) add_subdirectory(plPhysical)
add_subdirectory(plPhysX) if(WIN32)
add_subdirectory(plPhysX)
endif()
add_subdirectory(plPipeline) add_subdirectory(plPipeline)
add_subdirectory(plProgressMgr) add_subdirectory(plProgressMgr)
add_subdirectory(plResMgr) add_subdirectory(plResMgr)

4
Sources/Plasma/PubUtilLib/plNetGameLib/Private/plNglAuth.cpp

@ -5269,8 +5269,8 @@ void NetCliAuthAgeRequest (
//============================================================================ //============================================================================
void NetCliAuthGetEncryptionKey ( void NetCliAuthGetEncryptionKey (
uint32_t key[], uint32_t key[],
unsigned size size_t size
) { ) {
unsigned memSize = std::min(arrsize(s_encryptionKey), size); unsigned memSize = std::min(arrsize(s_encryptionKey), size);
memSize *= sizeof(uint32_t); memSize *= sizeof(uint32_t);

4
Sources/Plasma/PubUtilLib/plSDL/plStateVariable.cpp

@ -2306,7 +2306,7 @@ void plSimpleStateVariable::DumpToObjectDebugger(bool dirtyOnly, int level) cons
} }
pad += "\t"; pad += "\t";
for (size_t i=0; i<GetCount(); i++) for (int i=0; i<GetCount(); i++)
{ {
logMsg << pad; logMsg << pad;
logMsg << "Var:" << i; logMsg << "Var:" << i;
@ -2349,7 +2349,7 @@ void plSimpleStateVariable::DumpToStream(hsStream* stream, bool dirtyOnly, int l
} }
pad += "\t"; pad += "\t";
for (size_t i=0; i<GetCount(); i++) for (int i=0; i<GetCount(); i++)
{ {
logMsg << pad; logMsg << pad;
logMsg << "Var:" << i; logMsg << "Var:" << i;

2
Sources/Plasma/PubUtilLib/plSockets/plBufferedSocketWriter.cpp

@ -43,6 +43,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plBufferedSocketWriter.h" #include "plBufferedSocketWriter.h"
#include "plTcpSocket.h" #include "plTcpSocket.h"
#include <algorithm>
plBufferedSocketWriter::plBufferedSocketWriter(int size, int bytesPerFlush, bool blockOnSend, int flushPoint) plBufferedSocketWriter::plBufferedSocketWriter(int size, int bytesPerFlush, bool blockOnSend, int flushPoint)
: plRingBuffer(size) : plRingBuffer(size)
, fFlushPoint(flushPoint) , fFlushPoint(flushPoint)

Loading…
Cancel
Save