From 4bf0c485ce7e4e0f5350bc8ae2cd6dd48908a830 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 28 Jan 2012 07:33:34 -0500 Subject: [PATCH 01/51] Fix #121 by removing axfres.h include --- Sources/Tools/plResBrowser/plResBrowserWndProc.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/Sources/Tools/plResBrowser/plResBrowserWndProc.cpp b/Sources/Tools/plResBrowser/plResBrowserWndProc.cpp index b0e698f7..1db259e5 100644 --- a/Sources/Tools/plResBrowser/plResBrowserWndProc.cpp +++ b/Sources/Tools/plResBrowser/plResBrowserWndProc.cpp @@ -41,7 +41,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "HeadSpin.h" #include "hsTemplates.h" -#include "afxres.h" #include "res/resource.h" #include #include From 29064590c538792c2dfa50cafbf1723518ef2354 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 28 Jan 2012 08:49:35 -0500 Subject: [PATCH 02/51] Add PyUnicode support to ptPlayer.__init__ --- .../FeatureLib/pfPython/pyPlayerGlue.cpp | 79 ++++++++++--------- 1 file changed, 43 insertions(+), 36 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp index dced2f27..e64ee87f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp @@ -49,6 +49,23 @@ PYTHON_CLASS_DEFINITION(ptPlayer, pyPlayer); PYTHON_DEFAULT_NEW_DEFINITION(ptPlayer, pyPlayer) PYTHON_DEFAULT_DEALLOC_DEFINITION(ptPlayer) +static char* ConvertString(PyObject* obj) +{ + if (PyString_Check(obj)) + { + return hsStrcpy(PyString_AsString(obj)); + } else if (PyUnicode_Check(obj)) { + size_t size = PyUnicode_GetSize(obj); + wchar_t* temp = new wchar_t[size + 1]; + PyUnicode_AsWideChar((PyUnicodeObject*)obj, temp, size); + temp[size] = 0; + char* buf = hsWStringToString(temp); + delete[] temp; + return buf; + } else + return NULL; // You suck. +} + PYTHON_INIT_DEFINITION(ptPlayer, args, keywords) { // we have two sets of arguments we can use, hence the generic PyObject* pointers @@ -63,56 +80,46 @@ PYTHON_INIT_DEFINITION(ptPlayer, args, keywords) PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); PYTHON_RETURN_INIT_ERROR; } - if (pyKey::Check(firstObj)) // arg set 1 + + pyKey* key = NULL; + char* name = NULL; + uint32_t pid = -1; + float distSeq = -1; + + if (pyKey::Check(firstObj)) { - // make sure the remaining objects fit the arg list - if ((!thirdObj) || (!fourthObj)) - { - // missing arguments - PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); - PYTHON_RETURN_INIT_ERROR; - } - if ((!PyString_Check(secondObj)) || (!PyLong_Check(thirdObj)) || (!PyFloat_Check(fourthObj))) + key = pyKey::ConvertFrom(firstObj); + if (!(name = ConvertString(secondObj))) { - // incorrect types PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); PYTHON_RETURN_INIT_ERROR; } - // all args are correct, convert and init - pyKey* key = pyKey::ConvertFrom(firstObj); - char* name = PyString_AsString(secondObj); - unsigned long pid = PyLong_AsUnsignedLong(thirdObj); - float distsq = (float)PyFloat_AsDouble(fourthObj); - self->fThis->Init(key->getKey(), name, pid, distsq); - PYTHON_RETURN_INIT_OK; - } - else if (PyString_Check(firstObj)) // arg set 2 - { - // make sure there are only two args - if (thirdObj || fourthObj) + if (!(PyLong_Check(thirdObj) && PyFloat_Check(fourthObj))) { - // too many arguments + delete[] name; PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); PYTHON_RETURN_INIT_ERROR; } - char* name = PyString_AsString(firstObj); - unsigned long pid = 0; - if (PyLong_Check(secondObj)) - pid = PyLong_AsUnsignedLong(secondObj); - else if (PyInt_Check(secondObj)) - pid = (unsigned long)PyInt_AsLong(secondObj); - else + + pid = PyLong_AsUnsignedLong(thirdObj); + distSeq = (float)PyFloat_AsDouble(fourthObj); + } else if (name = ConvertString(firstObj)){ + if (!PyLong_Check(secondObj) || thirdObj || fourthObj) { - // incorrect type + delete[] name; PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); PYTHON_RETURN_INIT_ERROR; } - self->fThis->Init(nil, name, pid, -1); - PYTHON_RETURN_INIT_OK; + + pid = PyLong_AsUnsignedLong(secondObj); + } else { + PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); + PYTHON_RETURN_INIT_ERROR; } - // some other args came in - PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); - PYTHON_RETURN_INIT_ERROR; + + self->fThis->Init(key, name, pid, distSeq); + delete[] name; + PYTHON_RETURN_INIT_OK; } PYTHON_RICH_COMPARE_DEFINITION(ptPlayer, obj1, obj2, compareType) From 46c3c9c0492dcb9abee1821b7ec0077c7385c38e Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 28 Jan 2012 16:15:17 -0800 Subject: [PATCH 03/51] Fix some includes for non-MSVC. --- Sources/Plasma/CoreLib/HeadSpin.h | 2 +- Sources/Plasma/CoreLib/hsTypes.h | 1 + Sources/Plasma/CoreLib/hsUtils.h | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/CoreLib/HeadSpin.h b/Sources/Plasma/CoreLib/HeadSpin.h index 0405e223..8c91e1dd 100644 --- a/Sources/Plasma/CoreLib/HeadSpin.h +++ b/Sources/Plasma/CoreLib/HeadSpin.h @@ -48,8 +48,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // Internal Headers // These are only ever included here :) -#include "hsWindows.h" #include "hsTypes.h" +#include "hsWindows.h" #include "hsUtils.h" #endif diff --git a/Sources/Plasma/CoreLib/hsTypes.h b/Sources/Plasma/CoreLib/hsTypes.h index 961cdd28..ed2ec9f9 100644 --- a/Sources/Plasma/CoreLib/hsTypes.h +++ b/Sources/Plasma/CoreLib/hsTypes.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include #include +#include /************************** Basic Macros *****************************/ diff --git a/Sources/Plasma/CoreLib/hsUtils.h b/Sources/Plasma/CoreLib/hsUtils.h index 000e010e..f230762a 100644 --- a/Sources/Plasma/CoreLib/hsUtils.h +++ b/Sources/Plasma/CoreLib/hsUtils.h @@ -46,7 +46,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define _HSUTILS_H #include "HeadSpin.h" -#include +#include +#include #include int hsStrlen(const char src[]); From 3f22efda98acc06fcf19255af48c2a47a097d931 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 28 Jan 2012 16:43:22 -0800 Subject: [PATCH 04/51] Make sure all the InputKeys exist for *nix. Although it really doesn't matter what they are defined as, as long as they exist. This allows pfGameGUIMgr to compile on Linux. --- .../Plasma/NucleusLib/pnInputCore/plKeyDef.h | 118 ++++++++++++++++-- 1 file changed, 107 insertions(+), 11 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnInputCore/plKeyDef.h b/Sources/Plasma/NucleusLib/pnInputCore/plKeyDef.h index 9c638277..60ac846a 100644 --- a/Sources/Plasma/NucleusLib/pnInputCore/plKeyDef.h +++ b/Sources/Plasma/NucleusLib/pnInputCore/plKeyDef.h @@ -141,15 +141,15 @@ enum plKeyDef KEY_PRINTSCREEN = VK_SNAPSHOT, KEY_INSERT = VK_INSERT, KEY_DELETE = VK_DELETE, - KEY_NUMPAD0 = VK_NUMPAD0, - KEY_NUMPAD1 = VK_NUMPAD1, - KEY_NUMPAD2 = VK_NUMPAD2, - KEY_NUMPAD3 = VK_NUMPAD3, - KEY_NUMPAD4 = VK_NUMPAD4, - KEY_NUMPAD5 = VK_NUMPAD5, - KEY_NUMPAD6 = VK_NUMPAD6, - KEY_NUMPAD7 = VK_NUMPAD7, - KEY_NUMPAD8 = VK_NUMPAD8, + KEY_NUMPAD0 = VK_NUMPAD0, + KEY_NUMPAD1 = VK_NUMPAD1, + KEY_NUMPAD2 = VK_NUMPAD2, + KEY_NUMPAD3 = VK_NUMPAD3, + KEY_NUMPAD4 = VK_NUMPAD4, + KEY_NUMPAD5 = VK_NUMPAD5, + KEY_NUMPAD6 = VK_NUMPAD6, + KEY_NUMPAD7 = VK_NUMPAD7, + KEY_NUMPAD8 = VK_NUMPAD8, KEY_NUMPAD9 = VK_NUMPAD9, KEY_NUMPAD_MULTIPLY = VK_MULTIPLY, KEY_NUMPAD_ADD = VK_ADD, @@ -161,11 +161,11 @@ enum plKeyDef KEY_PERIOD = VK_OEM_PERIOD, KEY_DASH = VK_OEM_MINUS, KEY_EQUAL = VK_OEM_PLUS, - + // these are only good in the US of A... KEY_SEMICOLON = VK_OEM_1, KEY_SLASH = VK_OEM_2, - KEY_TILDE = VK_OEM_3, + KEY_TILDE = VK_OEM_3, KEY_LBRACKET = VK_OEM_4, KEY_BACKSLASH = VK_OEM_5, KEY_RBRACKET = VK_OEM_6, @@ -176,8 +176,104 @@ enum plKeyDef #elif HS_BUILD_FOR_UNIX +/* This is a total hack (for now) */ enum plKeyDef { + KEY_A = 0xffffffff, + KEY_B = 0xffffffff, + KEY_C = 0xffffffff, + KEY_D = 0xffffffff, + KEY_E = 0xffffffff, + KEY_F = 0xffffffff, + KEY_G = 0xffffffff, + KEY_H = 0xffffffff, + KEY_I = 0xffffffff, + KEY_J = 0xffffffff, + KEY_K = 0xffffffff, + KEY_L = 0xffffffff, + KEY_M = 0xffffffff, + KEY_N = 0xffffffff, + KEY_O = 0xffffffff, + KEY_P = 0xffffffff, + KEY_Q = 0xffffffff, + KEY_R = 0xffffffff, + KEY_S = 0xffffffff, + KEY_T = 0xffffffff, + KEY_U = 0xffffffff, + KEY_V = 0xffffffff, + KEY_W = 0xffffffff, + KEY_X = 0xffffffff, + KEY_Y = 0xffffffff, + KEY_Z = 0xffffffff, + KEY_0 = 0xffffffff, + KEY_1 = 0xffffffff, + KEY_2 = 0xffffffff, + KEY_3 = 0xffffffff, + KEY_4 = 0xffffffff, + KEY_5 = 0xffffffff, + KEY_6 = 0xffffffff, + KEY_7 = 0xffffffff, + KEY_8 = 0xffffffff, + KEY_9 = 0xffffffff, + KEY_F1 = 0xffffffff, + KEY_F2 = 0xffffffff, + KEY_F3 = 0xffffffff, + KEY_F4 = 0xffffffff, + KEY_F5 = 0xffffffff, + KEY_F6 = 0xffffffff, + KEY_F7 = 0xffffffff, + KEY_F8 = 0xffffffff, + KEY_F9 = 0xffffffff, + KEY_F10 = 0xffffffff, + KEY_F11 = 0xffffffff, + KEY_F12 = 0xffffffff, + KEY_ESCAPE = 0xffffffff, + KEY_TAB = 0xffffffff, + KEY_SHIFT = 0xffffffff, + KEY_CTRL = 0xffffffff, + KEY_ALT = 0xffffffff, + KEY_UP = 0xffffffff, + KEY_DOWN = 0xffffffff, + KEY_LEFT = 0xffffffff, + KEY_RIGHT = 0xffffffff, + KEY_BACKSPACE = 0xffffffff, + KEY_ENTER = 0xffffffff, + KEY_PAUSE = 0xffffffff, + KEY_CAPSLOCK = 0xffffffff, + KEY_PAGEUP = 0xffffffff, + KEY_PAGEDOWN = 0xffffffff, + KEY_END = 0xffffffff, + KEY_HOME = 0xffffffff, + KEY_PRINTSCREEN = 0xffffffff, + KEY_INSERT = 0xffffffff, + KEY_DELETE = 0xffffffff, + KEY_NUMPAD0 = 0xffffffff, + KEY_NUMPAD1 = 0xffffffff, + KEY_NUMPAD2 = 0xffffffff, + KEY_NUMPAD3 = 0xffffffff, + KEY_NUMPAD4 = 0xffffffff, + KEY_NUMPAD5 = 0xffffffff, + KEY_NUMPAD6 = 0xffffffff, + KEY_NUMPAD7 = 0xffffffff, + KEY_NUMPAD8 = 0xffffffff, + KEY_NUMPAD9 = 0xffffffff, + KEY_NUMPAD_MULTIPLY = 0xffffffff, + KEY_NUMPAD_ADD = 0xffffffff, + KEY_NUMPAD_SUBTRACT = 0xffffffff, + KEY_NUMPAD_PERIOD = 0xffffffff, + KEY_NUMPAD_DIVIDE = 0xffffffff, + KEY_SPACE = 0xffffffff, + KEY_COMMA = 0xffffffff, + KEY_PERIOD = 0xffffffff, + KEY_DASH = 0xffffffff, + KEY_EQUAL = 0xffffffff, + KEY_SEMICOLON = 0xffffffff, + KEY_SLASH = 0xffffffff, + KEY_TILDE = 0xffffffff, + KEY_LBRACKET = 0xffffffff, + KEY_BACKSLASH = 0xffffffff, + KEY_RBRACKET = 0xffffffff, + KEY_QUOTE = 0xffffffff, KEY_UNMAPPED = 0xffffffff, }; #endif From b45ad14b788c96130996766e18a03dff1bb8ad8d Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 28 Jan 2012 18:11:22 -0800 Subject: [PATCH 05/51] Fix NxMath conflicts. --- Sources/Plasma/CoreLib/hsWindows.h | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Sources/Plasma/CoreLib/hsWindows.h b/Sources/Plasma/CoreLib/hsWindows.h index 1fcbd83f..2d716736 100644 --- a/Sources/Plasma/CoreLib/hsWindows.h +++ b/Sources/Plasma/CoreLib/hsWindows.h @@ -65,9 +65,26 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com # include # endif // MAXPLUGINCODE # define WIN32_LEAN_AND_MEAN +# define NOMINMAX // Needed to prevent NxMath conflicts # include typedef HWND hsWindowHndl; + typedef HINSTANCE hsWindowInst; #else typedef int32_t* hsWindowHndl; + typedef int32_t* hsWindowInst; #endif // HS_BUILD_FOR_WIN32 + +/**************************************************************************** +* +* max/min inline functions +* +***/ + +#ifdef max +#undef max +#endif + +#ifdef min +#undef min +#endif From a64b909f4f3240246cee97dc3e1f655c7259fe6f Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sat, 28 Jan 2012 21:36:38 -0500 Subject: [PATCH 06/51] Now all the kids can play with ConvertString (and some others) --- .../Plasma/FeatureLib/pfPython/CMakeLists.txt | 1 + .../FeatureLib/pfPython/pyGlueHelpers.cpp | 63 +++++++++++++++++++ .../FeatureLib/pfPython/pyGlueHelpers.h | 6 ++ .../FeatureLib/pfPython/pyPlayerGlue.cpp | 21 +------ 4 files changed, 72 insertions(+), 19 deletions(-) create mode 100644 Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.cpp diff --git a/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt b/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt index c005002c..b390708f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt +++ b/Sources/Plasma/FeatureLib/pfPython/CMakeLists.txt @@ -38,6 +38,7 @@ set(pfPython_SOURCES pyEnum.cpp pyGameScore.cpp pyGeometry3.cpp + pyGlueHelpers.cpp pyGrassShader.cpp pyGUIControl.cpp pyGUIControlButton.cpp diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.cpp new file mode 100644 index 00000000..e6dbf4a9 --- /dev/null +++ b/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.cpp @@ -0,0 +1,63 @@ +/*==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==*/ + +#include "HeadSpin.h" +#include "pyGlueHelpers.h" + +char* PyString_AsStringEx(PyObject* obj) +{ + if (PyString_Check(obj)) + return hsStrcpy(PyString_AsString(obj)); + else if (PyUnicode_Check(obj)) + { + PyObject* utf8 = PyUnicode_AsUTF8String(obj); + char* buf = hsStrcpy(PyString_AsString(utf8)); + Py_DECREF(utf8); + return buf; + } else + return NULL; // You suck. +} + +bool PyString_CheckEx(PyObject* obj) +{ + return (PyString_Check(obj) || PyUnicode_Check(obj)); +} diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.h b/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.h index 1184c1ce..26cf4d5f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGlueHelpers.h @@ -42,6 +42,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef _pyGlueHelpers_h_ #define _pyGlueHelpers_h_ +#include + +// Useful string functions +char* PyString_AsStringEx(PyObject*); +inline bool PyString_CheckEx(PyObject*); + // A set of macros to take at least some of the tediousness out of creating straight python glue code ///////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp index e64ee87f..f2dd94bd 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp @@ -49,23 +49,6 @@ PYTHON_CLASS_DEFINITION(ptPlayer, pyPlayer); PYTHON_DEFAULT_NEW_DEFINITION(ptPlayer, pyPlayer) PYTHON_DEFAULT_DEALLOC_DEFINITION(ptPlayer) -static char* ConvertString(PyObject* obj) -{ - if (PyString_Check(obj)) - { - return hsStrcpy(PyString_AsString(obj)); - } else if (PyUnicode_Check(obj)) { - size_t size = PyUnicode_GetSize(obj); - wchar_t* temp = new wchar_t[size + 1]; - PyUnicode_AsWideChar((PyUnicodeObject*)obj, temp, size); - temp[size] = 0; - char* buf = hsWStringToString(temp); - delete[] temp; - return buf; - } else - return NULL; // You suck. -} - PYTHON_INIT_DEFINITION(ptPlayer, args, keywords) { // we have two sets of arguments we can use, hence the generic PyObject* pointers @@ -89,7 +72,7 @@ PYTHON_INIT_DEFINITION(ptPlayer, args, keywords) if (pyKey::Check(firstObj)) { key = pyKey::ConvertFrom(firstObj); - if (!(name = ConvertString(secondObj))) + if (!(name = PyString_AsStringEx(secondObj))) { PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); PYTHON_RETURN_INIT_ERROR; @@ -103,7 +86,7 @@ PYTHON_INIT_DEFINITION(ptPlayer, args, keywords) pid = PyLong_AsUnsignedLong(thirdObj); distSeq = (float)PyFloat_AsDouble(fourthObj); - } else if (name = ConvertString(firstObj)){ + } else if (name = PyString_AsStringEx(firstObj)){ if (!PyLong_Check(secondObj) || thirdObj || fourthObj) { delete[] name; From a964066656efafe0e75d860e4c984f7612dfda4f Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 28 Jan 2012 22:24:28 -0800 Subject: [PATCH 07/51] Get rid of pnUtils PCH stuff. --HG-- rename : Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxStr.cpp => Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxStr.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxSync.cpp => Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxSync.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxUuid.cpp => Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/W32Int.h => Sources/Plasma/NucleusLib/pnUtils/Win32/W32Int.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Addr.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Dll.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Misc.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Path.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Path.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Str.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Str.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Sync.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Time.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Time.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Uuid.cpp => Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.h => Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAllIncludes.h => Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtArray.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h => Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.h => Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h => Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.h => Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCoreLib.h => Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.h => Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtHash.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h => Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtList.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h => Sources/Plasma/NucleusLib/pnUtils/pnUtList.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.h => Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.h => Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtPath.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.h => Sources/Plasma/NucleusLib/pnUtils/pnUtPath.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPragma.h => Sources/Plasma/NucleusLib/pnUtils/pnUtPragma.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h => Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtRand.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.h => Sources/Plasma/NucleusLib/pnUtils/pnUtRand.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h => Sources/Plasma/NucleusLib/pnUtils/pnUtRef.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h => Sources/Plasma/NucleusLib/pnUtils/pnUtSkipList.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSort.h => Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.h => Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.h => Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSync.h => Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.h => Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtTls.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.h => Sources/Plasma/NucleusLib/pnUtils/pnUtTls.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTypes.h => Sources/Plasma/NucleusLib/pnUtils/pnUtTypes.h rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.cpp => Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp rename : Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h => Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h --- .../Plasma/NucleusLib/pnUtils/CMakeLists.txt | 119 ++++--- Sources/Plasma/NucleusLib/pnUtils/Intern.h | 70 ---- Sources/Plasma/NucleusLib/pnUtils/Pch.h | 11 +- .../NucleusLib/pnUtils/Private/pnUtSubst.cpp | 302 ------------------ .../NucleusLib/pnUtils/Private/pnUtSubst.h | 119 ------- .../pnUtils/{Private => }/Unix/pnUtUxStr.cpp | 3 +- .../pnUtils/{Private => }/Unix/pnUtUxSync.cpp | 3 +- .../pnUtils/{Private => }/Unix/pnUtUxUuid.cpp | 4 +- .../pnUtils/{Private => }/Win32/W32Int.h | 0 .../{Private => }/Win32/pnUtW32Addr.cpp | 0 .../{Private => }/Win32/pnUtW32Dll.cpp | 0 .../{Private => }/Win32/pnUtW32Misc.cpp | 0 .../{Private => }/Win32/pnUtW32Path.cpp | 0 .../{Private => }/Win32/pnUtW32Str.cpp | 0 .../{Private => }/Win32/pnUtW32Sync.cpp | 0 .../{Private => }/Win32/pnUtW32Time.cpp | 0 .../{Private => }/Win32/pnUtW32Uuid.cpp | 0 .../pnUtils/{Private => }/pnUtAddr.cpp | 3 +- .../pnUtils/{Private => }/pnUtAddr.h | 1 + .../pnUtils/{Private => }/pnUtAllIncludes.h | 0 .../pnUtils/{Private => }/pnUtArray.cpp | 3 +- .../pnUtils/{Private => }/pnUtArray.h | 7 +- .../pnUtils/{Private => }/pnUtBase64.cpp | 3 +- .../pnUtils/{Private => }/pnUtBase64.h | 1 + .../pnUtils/{Private => }/pnUtBigNum.cpp | 3 +- .../pnUtils/{Private => }/pnUtBigNum.h | 1 + .../pnUtils/{Private => }/pnUtCmd.cpp | 8 +- .../pnUtils/{Private => }/pnUtCmd.h | 3 + .../pnUtils/{Private => }/pnUtCoreLib.h | 0 .../pnUtils/{Private => }/pnUtCrypt.cpp | 3 +- .../pnUtils/{Private => }/pnUtCrypt.h | 2 + .../pnUtils/{Private => }/pnUtHash.cpp | 6 +- .../pnUtils/{Private => }/pnUtHash.h | 4 + .../pnUtils/{Private => }/pnUtList.cpp | 3 +- .../pnUtils/{Private => }/pnUtList.h | 1 + .../pnUtils/{Private => }/pnUtMath.cpp | 3 +- .../pnUtils/{Private => }/pnUtMath.h | 1 + .../pnUtils/{Private => }/pnUtMisc.cpp | 3 +- .../pnUtils/{Private => }/pnUtMisc.h | 2 + .../pnUtils/{Private => }/pnUtPath.cpp | 4 +- .../pnUtils/{Private => }/pnUtPath.h | 2 + .../pnUtils/{Private => }/pnUtPragma.h | 0 .../pnUtils/{Private => }/pnUtPriQ.h | 1 + .../pnUtils/{Private => }/pnUtRand.cpp | 3 +- .../pnUtils/{Private => }/pnUtRand.h | 1 + .../pnUtils/{Private => }/pnUtRef.h | 0 .../pnUtils/{Private => }/pnUtSkipList.h | 0 .../pnUtils/{Private => }/pnUtSort.h | 0 .../pnUtils/{Private => }/pnUtSpareList.cpp | 3 +- .../pnUtils/{Private => }/pnUtSpareList.h | 2 + .../pnUtils/{Private => }/pnUtStr.cpp | 11 +- .../pnUtils/{Private => }/pnUtStr.h | 2 + .../pnUtils/{Private => }/pnUtSync.h | 1 + .../pnUtils/{Private => }/pnUtTime.cpp | 3 +- .../pnUtils/{Private => }/pnUtTime.h | 1 + .../pnUtils/{Private => }/pnUtTls.cpp | 3 +- .../pnUtils/{Private => }/pnUtTls.h | 1 + .../pnUtils/{Private => }/pnUtTypes.h | 0 .../pnUtils/{Private => }/pnUtUuid.cpp | 3 +- .../pnUtils/{Private => }/pnUtUuid.h | 1 + 60 files changed, 123 insertions(+), 611 deletions(-) delete mode 100644 Sources/Plasma/NucleusLib/pnUtils/Intern.h delete mode 100644 Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.cpp delete mode 100644 Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/Unix/pnUtUxStr.cpp (98%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/Unix/pnUtUxSync.cpp (98%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/Unix/pnUtUxUuid.cpp (98%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/Win32/W32Int.h (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/Win32/pnUtW32Addr.cpp (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/Win32/pnUtW32Dll.cpp (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/Win32/pnUtW32Misc.cpp (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/Win32/pnUtW32Path.cpp (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/Win32/pnUtW32Str.cpp (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/Win32/pnUtW32Sync.cpp (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/Win32/pnUtW32Time.cpp (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/Win32/pnUtW32Uuid.cpp (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtAddr.cpp (98%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtAddr.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtAllIncludes.h (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtArray.cpp (98%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtArray.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtBase64.cpp (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtBase64.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtBigNum.cpp (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtBigNum.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtCmd.cpp (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtCmd.h (98%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtCoreLib.h (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtCrypt.cpp (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtCrypt.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtHash.cpp (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtHash.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtList.cpp (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtList.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtMath.cpp (98%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtMath.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtMisc.cpp (98%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtMisc.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtPath.cpp (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtPath.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtPragma.h (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtPriQ.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtRand.cpp (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtRand.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtRef.h (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtSkipList.h (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtSort.h (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtSpareList.cpp (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtSpareList.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtStr.cpp (98%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtStr.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtSync.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtTime.cpp (98%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtTime.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtTls.cpp (98%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtTls.h (99%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtTypes.h (100%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtUuid.cpp (98%) rename Sources/Plasma/NucleusLib/pnUtils/{Private => }/pnUtUuid.h (99%) diff --git a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt index 6820ede5..e2655a48 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt @@ -2,88 +2,81 @@ include_directories("../../CoreLib") include_directories("../../NucleusLib") set(pnUtils_HEADERS - Intern.h Pch.h pnUtils.h -) - -set(pnUtils_PRIVATE - Private/pnUtAddr.h - Private/pnUtAddr.cpp - Private/pnUtAllIncludes.h - Private/pnUtArray.h - Private/pnUtArray.cpp - Private/pnUtBase64.h - Private/pnUtBase64.cpp - Private/pnUtBigNum.h - Private/pnUtBigNum.cpp - Private/pnUtCmd.h - Private/pnUtCmd.cpp - Private/pnUtCoreLib.h - Private/pnUtCrypt.h - Private/pnUtCrypt.cpp - Private/pnUtHash.h - Private/pnUtHash.cpp - Private/pnUtList.h - Private/pnUtList.cpp - Private/pnUtMath.h - Private/pnUtMath.cpp - Private/pnUtMisc.h - Private/pnUtMisc.cpp - Private/pnUtPath.h - Private/pnUtPath.cpp - Private/pnUtPragma.h - Private/pnUtPriQ.h - Private/pnUtRand.h - Private/pnUtRand.cpp - Private/pnUtRef.h - Private/pnUtSkipList.h - Private/pnUtSort.h - Private/pnUtSpareList.h - Private/pnUtSpareList.cpp - Private/pnUtStr.h - Private/pnUtStr.cpp - Private/pnUtSubst.h - Private/pnUtSubst.cpp - Private/pnUtSync.h - Private/pnUtTime.h - Private/pnUtTime.cpp - Private/pnUtTls.h - Private/pnUtTls.cpp - Private/pnUtUuid.h - Private/pnUtUuid.cpp + pnUtCoreLib.h + pnUtAddr.h + pnUtAllIncludes.h + pnUtArray.h + pnUtBase64.h + pnUtBigNum.h + pnUtCmd.h + pnUtCrypt.h + pnUtHash.h + pnUtList.h + pnUtMath.h + pnUtMisc.h + pnUtPath.h + pnUtPragma.h + pnUtPriQ.h + pnUtRand.h + pnUtRef.h + pnUtSkipList.h + pnUtSort.h + pnUtSpareList.h + pnUtStr.h + pnUtSync.h + pnUtTime.h + pnUtTls.h + pnUtUuid.h ) set(pnUtils_SOURCES - pnUtils.cpp + pnUtAddr.cpp + pnUtArray.cpp + pnUtBase64.cpp + pnUtBigNum.cpp + pnUtCmd.cpp + pnUtHash.cpp + pnUtList.cpp + pnUtMath.cpp + pnUtMisc.cpp + pnUtPath.cpp + pnUtRand.cpp + pnUtSpareList.cpp + pnUtStr.cpp + pnUtTime.cpp ) if(WIN32) set(pnUtils_WIN32 - Private/Win32/pnUtW32Addr.cpp - Private/Win32/pnUtW32Misc.cpp - Private/Win32/pnUtW32Path.cpp - Private/Win32/pnUtW32Str.cpp - Private/Win32/pnUtW32Sync.cpp - Private/Win32/pnUtW32Time.cpp - Private/Win32/pnUtW32Uuid.cpp + Win32/pnUtW32Addr.cpp + Win32/pnUtW32Misc.cpp + Win32/pnUtW32Path.cpp + Win32/pnUtW32Str.cpp + Win32/pnUtW32Sync.cpp + Win32/pnUtW32Time.cpp + Win32/pnUtW32Uuid.cpp + + pnUtCrypt.cpp + pnUtTls.cpp + pnUtUuid.cpp ) else() set(pnUtils_UNIX - Private/Unix/pnUtUxStr.cpp - Private/Unix/pnUtUxSync.cpp - Private/Unix/pnUtUxUuid.cpp + Unix/pnUtUxStr.cpp + #Unix/pnUtUxSync.cpp + #Unix/pnUtUxUuid.cpp ) endif() -add_library(pnUtils STATIC ${pnUtils_HEADERS} ${pnUtils_PRIVATE} ${pnUtils_SOURCES} +add_library(pnUtils STATIC ${pnUtils_HEADERS} ${pnUtils_SOURCES} ${pnUtils_UNIX} ${pnUtils_WIN32}) source_group("Header Files" FILES ${pnUtils_HEADERS}) source_group("Source Files" FILES ${pnUtils_SOURCES}) -source_group("Private" FILES ${pnUtils_PRIVATE}) if(WIN32) - source_group("Private\\Win32" FILES ${pnUtils_WIN32}) + source_group("Win32" FILES ${pnUtils_WIN32}) else() - source_group("Private\\Unix" FILES ${pnUtils_UNIX}) + source_group("Unix" FILES ${pnUtils_UNIX}) endif() diff --git a/Sources/Plasma/NucleusLib/pnUtils/Intern.h b/Sources/Plasma/NucleusLib/pnUtils/Intern.h deleted file mode 100644 index 5c93109e..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/Intern.h +++ /dev/null @@ -1,70 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -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==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Intern.h -* -***/ - -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_INTERN_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Intern.h included more than once" -#endif -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_INTERN_H - - - -/***************************************************************************** -* -* Crypt -* -***/ - -namespace Crypt { - -//============================================================================ -class KeyBase { -public: - virtual void Codec (bool encrypt, ARRAY(uint8_t) * dest, unsigned sourceBytes, const void * sourceData) = 0; - virtual unsigned GetBlockSize () const = 0; -}; - -} // namespace Crypt diff --git a/Sources/Plasma/NucleusLib/pnUtils/Pch.h b/Sources/Plasma/NucleusLib/pnUtils/Pch.h index b956e38c..ac9bcdc7 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Pch.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Pch.h @@ -45,14 +45,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PCH_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Pch.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PCH_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PCH_H -#include "Private/pnUtAllIncludes.h" -#include "Intern.h" - +#include "pnUtCoreLib.h" // must be first in list +#include "pnUtPragma.h" #include "pnProduct/pnProduct.h" #include @@ -66,4 +63,4 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #pragma warning(pop) #endif -#include // _alloca +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.cpp b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.cpp deleted file mode 100644 index 9a671032..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.cpp +++ /dev/null @@ -1,302 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -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==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.cpp -* -***/ - -#include "../Pch.h" -#pragma hdrstop - -#define SUBST_BLOCK SubstParsedData::SubstBlock - -/***************************************************************************** -* -* Internal functions -* -***/ - -//============================================================================ -template -bool IVarSubstitute ( - ARRAY(chartype) * dst, - const chartype src[], - unsigned varCount, - const chartype * varNames[], // [varCount] - const chartype * varValues[] // [varCount] -) { - ASSERT(dst); - ASSERT(src); - ASSERT(varNames); - ASSERT(varValues); - - dst->Reserve(StrLen(src) * 5/4); - - bool result = true; - while (*src) { - // Copy non-substituted strings and escape %% symbols - if ((*src != L'%') || (*++src == L'%')) { - dst->Push(*src++); - continue; - } - - // Find variable definition - const chartype * varStart = src; - const chartype * varEnd = StrChr(varStart, L'%'); - if (!varEnd) { - // Skip % character and continue - result = false; - continue; - } - - // Validate variable name length - chartype varBuffer[256]; - if (varEnd - varStart >= arrsize(varBuffer)) { - result = false; - src = varEnd + 1; - continue; - } - - // Copy variable name excluding trailing '%' - StrCopy(varBuffer, varStart, varEnd - varStart + 1); - src = varEnd + 1; - - // Find the variable value and perform substitution - bool found = false; - for (unsigned i = 0; i < varCount; ++i) { - if (StrCmp(varBuffer, varNames[i])) - continue; - dst->Add(varValues[i], StrLen(varValues[i])); - found = true; - break; - } - - // Check that variable definition exists - result = result && found; - } - - // Terminate string - dst->Push(0); - return result; -} - -//============================================================================ -template -bool IParseForSubst ( - SubstParsedData * dest, - const chartype src[] -) { - const chartype * current = src; - bool result = true; - while (*current) { - // Copy non-substituted strings and escape %% symbols - if ((*current != L'%') || (*++current == L'%')) { - current++; - continue; - } - - // Find variable definition - const chartype * varStart = current; - const chartype * varEnd = StrChr(varStart, L'%'); - if (!varEnd) { - // Skip % character and continue - result = false; - continue; - } - - // We've found a variable, copy the current data to a new object - if (current != src) { - int strLen = (current - src) - 1; - SUBST_BLOCK * block = new SUBST_BLOCK; - block->isVar = false; - block->strLen = strLen; - block->data = (chartype*)calloc((strLen + 1), sizeof(chartype)); - memcpy(block->data, src, strLen * sizeof(chartype)); - - dest->blocks.Add(block); - } - - // Validate variable name length - chartype varBuffer[256]; - if (varEnd - varStart >= arrsize(varBuffer)) { - result = false; - src = current = varEnd + 1; - continue; - } - - // Copy variable name excluding trailing '%' - int strLen = (varEnd - varStart); - SUBST_BLOCK * block = new SUBST_BLOCK; - block->isVar = true; - block->strLen = strLen; - block->data = (chartype*)calloc((strLen + 1), sizeof(chartype)); - memcpy(block->data, varStart, strLen * sizeof(chartype)); - - dest->blocks.Add(block); - - src = current = varEnd + 1; - } - - // Check and see if there's any data remaining - if (current != src) { - int strLen = (current - src); - SUBST_BLOCK * block = new SUBST_BLOCK; - block->isVar = false; - block->strLen = strLen; - block->data = (chartype*)calloc((strLen + 1), sizeof(chartype)); - memcpy(block->data, src, strLen * sizeof(chartype)); - - dest->blocks.Add(block); - } - - return result; -} - -//============================================================================ -template -bool IVarSubstPreParsed ( - ARRAY(chartype) * dst, - const SubstParsedData * src, - unsigned varCount, - const chartype * varNames[], // [varCount] - const chartype * varValues[] // [varCount] -) { - unsigned approxTotalSize = 0; - for (unsigned i = 0; i < src->blocks.Count(); ++i) { - approxTotalSize += src->blocks[i]->strLen; - } - - dst->Reserve(approxTotalSize * 5/4); - - bool foundAll = true; - for (unsigned blockIndex = 0; blockIndex < src->blocks.Count(); ++blockIndex) { - SUBST_BLOCK * block = src->blocks[blockIndex]; - if (block->isVar) { - bool found = false; - for (unsigned varIndex = 0; varIndex < varCount; ++varIndex) { - if (StrCmp(block->data, varNames[varIndex])) { - continue; - } - - dst->Add(varValues[varIndex], StrLen(varValues[varIndex])); - found = true; - break; - } - - foundAll &= found; - } - else { - dst->Add(block->data, block->strLen); - } - } - dst->Push(0); - - return foundAll; -} - - -/***************************************************************************** -* -* Exports -* -***/ - -//============================================================================ -bool ParseForSubst ( - SubstParsedData * dest, - const wchar_t src[] -) { - return IParseForSubst(dest, src); -} - -//============================================================================ -bool ParseForSubst ( - SubstParsedData * dest, - const char src[] -) { - return IParseForSubst(dest, src); -} - -//============================================================================ -bool VarSubstitute ( - ARRAY(wchar_t) * dst, - const wchar_t src[], - unsigned varCount, - const wchar_t * varNames[], // [varCount] - const wchar_t * varValues[] // [varCount] -) { - return IVarSubstitute(dst, src, varCount, varNames, varValues); -} - -//============================================================================ -bool VarSubstitute ( - ARRAY(char) * dst, - const char src[], - unsigned varCount, - const char * varNames[], // [varCount] - const char * varValues[] // [varCount] -) { - return IVarSubstitute(dst, src, varCount, varNames, varValues); -} - -//============================================================================ -bool VarSubstitute ( - ARRAY(wchar_t) * dst, - const SubstParsedData * src, - unsigned varCount, - const wchar_t * varNames[], // [varCount] - const wchar_t * varValues[] // [varCount] -) { - return IVarSubstPreParsed(dst, src, varCount, varNames, varValues); -} - -//============================================================================ -bool VarSubstitute ( - ARRAY(char) * dst, - const SubstParsedData * src, - unsigned varCount, - const char * varNames[], // [varCount] - const char * varValues[] // [varCount] -) { - return IVarSubstPreParsed(dst, src, varCount, varNames, varValues); -} diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h b/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h deleted file mode 100644 index 0490e76c..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h +++ /dev/null @@ -1,119 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -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==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h -* -***/ - -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSUBST_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSubst.h included more than once" -#endif -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSUBST_H - -template -struct SubstParsedData { - template - struct SubstBlock { - bool isVar; - char_type * data; - unsigned strLen; - - SubstBlock() - : isVar(false) - , data(nil) - { - } - - ~SubstBlock() { - free(data); - } - }; - - ARRAY(SubstBlock*) blocks; - - ~SubstParsedData() { - for (unsigned i = 0; i < blocks.Count(); ++i) { - SubstBlock * block = blocks[i]; - delete block; - } - } -}; - -bool ParseForSubst ( - SubstParsedData * dest, - const wchar_t src[] -); -bool ParseForSubst ( - SubstParsedData * dest, - const char src[] -); - -// Return value is for validation purposes only; it may be ignored -bool VarSubstitute ( - ARRAY(wchar_t) * dst, - const wchar_t src[], - unsigned varCount, - const wchar_t * varNames[], // [varCount] - const wchar_t * varValues[] // [varCount] -); -bool VarSubstitute ( - ARRAY(char) * dst, - const char src[], - unsigned varCount, - const char * varNames[], // [varCount] - const char * varValues[] // [varCount] -); -bool VarSubstitute ( - ARRAY(wchar_t) * dst, - const SubstParsedData * src, - unsigned varCount, - const wchar_t * varNames[], // [varCount] - const wchar_t * varValues[] // [varCount] -); -bool VarSubstitute ( - ARRAY(char) * dst, - const SubstParsedData * src, - unsigned varCount, - const char * varNames[], // [varCount] - const char * varValues[] // [varCount] -); diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxStr.cpp b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxStr.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxStr.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxStr.cpp index 768543e3..c375c701 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxStr.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxStr.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtStr.h" #ifdef HS_BUILD_FOR_UNIX diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxSync.cpp b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxSync.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxSync.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxSync.cpp index de4510ef..c43bfea2 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxSync.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxSync.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtSync.h" #ifdef HS_BUILD_FOR_UNIX diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxUuid.cpp b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxUuid.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp index ca4f3f7c..6722e337 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/Unix/pnUtUxUuid.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop - +#include "../pnUtUUID.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/W32Int.h b/Sources/Plasma/NucleusLib/pnUtils/Win32/W32Int.h similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/W32Int.h rename to Sources/Plasma/NucleusLib/pnUtils/Win32/W32Int.h diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Addr.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Addr.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Dll.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Dll.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Misc.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Misc.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Path.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Path.cpp similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Path.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Path.cpp diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Str.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Str.cpp similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Str.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Str.cpp diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Sync.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Sync.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Time.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Time.cpp similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Time.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Time.cpp diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Uuid.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/Win32/pnUtW32Uuid.cpp rename to Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.cpp index 6279e589..cc798f76 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtAddr.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.h index c31756c5..9bc935a1 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTADDR_H +#include "Pch.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAllIncludes.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAllIncludes.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtArray.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtArray.cpp index 52a74857..c7450c99 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtArray.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtArray.h" /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h index 14d97a77..ba7478e6 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h @@ -45,11 +45,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTARRAY_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTARRAY_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTARRAY_H +#include "Pch.h" +#include "pnUtSort.h" /**************************************************************************** * @@ -1081,3 +1081,4 @@ void TSortArray::Sort () { SortKey(elem1) > SortKey(elem2) ); } +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.cpp index 5f2a5c2a..09f10687 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtBase64.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.h index b2c49769..f4ba8756 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBASE64_H +#include "Pch.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.cpp index 270e83e6..1537c322 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtBigNum.h" #include #include diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.h index 675ab4bd..0d2ca4b9 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBIGNUM_H +#include "Pch.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.cpp index 214c7b8d..5f71810b 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.cpp @@ -45,8 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtCmd.h" +#include "pnUtMisc.h" /***************************************************************************** @@ -61,7 +61,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define TOGGLES L"+-" #define ALL WHITESPACE FLAGS SEPARATORS TOGGLES +#if HS_BUILD_FOR_WIN32 static const unsigned kMaxTokenLength = MAX_PATH; +#else +static const unsigned kMaxTokenLength = 1024; +#endif struct CmdArgData { CmdArgDef def; diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.h similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.h index 59fadcf5..a6f940b7 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.h @@ -50,6 +50,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCMD_H +#include "Pch.h" +#include "pnUtArray.h" +#include "pnUtStr.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCoreLib.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCoreLib.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp index 1ec4a4ff..6c4a3801 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtCrypt.h" #include #include diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h index ea08772e..c922fc88 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h @@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCRYPT_H +#include "Pch.h" +#include "pnUtArray.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtHash.cpp index 62cf25f6..92cfb159 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.cpp @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop - +#include "pnUtHash.h" /**************************************************************************** * @@ -91,4 +89,4 @@ const uint32_t CHashValue::s_hashTable[] = { 0x4f23137b, 0x9dfd6434, 0xd1e25d94, 0xbad4c88a, 0x0746edf9, 0x8103a9aa, 0xc8c73617, 0xe0f2759a, 0x00161c79, 0xd4545360, 0x1763cc5b, 0x296361fa, 0xbc35858d, 0xdaed5e93, 0x0b9d0aed, 0x01c45a64, }; - \ No newline at end of file + diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h index b2237185..9e87817c 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h @@ -50,6 +50,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTHASH_H +#include "Pch.h" +#include "pnUtList.h" +#include "pnUtArray.h" +#include "pnUtMath.h" /**************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtList.cpp index 819dc6f2..7ca34e6d 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtList.h" /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtList.h index 2abbbf8d..0bfd4c35 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTLIST_H +#include "Pch.h" /**************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp index 8677abd6..9d240519 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtMath.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h index a73362af..0dd99599 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMATH_H +#include "Pch.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.cpp index 3b451fec..76ad8bd2 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtMisc.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.h index ea9d425f..69e83f2c 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.h @@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMISC_H +#include "Pch.h" +#include "pnUtArray.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtPath.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtPath.cpp index c7d3b96a..77549696 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtPath.cpp @@ -45,8 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtPath.h" +#include "pnUtStr.h" /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtPath.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtPath.h index 47da6567..2c984069 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtPath.h @@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPATH_H +#include "Pch.h" +#include "pnUtArray.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPragma.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtPragma.h similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPragma.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtPragma.h diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h index a6852ac4..cdaa2e5a 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRIQ_H +#include "Pch.h" /**************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtRand.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtRand.cpp index 90fd78b2..4d30e7fe 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtRand.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtRand.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtRand.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtRand.h index 437a8664..4ed1bfcf 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtRand.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTRAND_H +#include "Pch.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtRef.h similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtRef.h diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSkipList.h similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtSkipList.h diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSort.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSort.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.cpp similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.cpp index 562bfafd..75d9e290 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtSpareList.h" /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.h index 280c4b1c..5ea63803 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.h @@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSPARELIST_H +#include "Pch.h" +#include #ifdef HS_DEBUGGING diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp index d75b6d7b..320fec69 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtStr.h" /***************************************************************************** @@ -522,7 +521,7 @@ const wchar_t * StrChrR (const wchar_t str[], wchar_t ch) { unsigned StrPrintf (char * dest, unsigned count, const char format[], ...) { va_list argList; va_start(argList, format); - int result = _vsnprintf((char *)dest, count, (const char *)format, argList); + int result = hsVsnprintf((char *)dest, count, (const char *)format, argList); va_end(argList); return IStrPrintfValidate(dest, count, result); } @@ -531,20 +530,20 @@ unsigned StrPrintf (char * dest, unsigned count, const char format[], ...) { unsigned StrPrintf (wchar_t * dest, unsigned count, const wchar_t format[], ...) { va_list argList; va_start(argList, format); - int result = _vsnwprintf(dest, count, format, argList); + int result = hsVsnwprintf(dest, count, format, argList); va_end(argList); return IStrPrintfValidate(dest, count, result); } //=========================================================================== unsigned StrPrintfV (char * dest, unsigned count, const char format[], va_list args) { - int result = _vsnprintf(dest, count, format, args); + int result = hsVsnprintf(dest, count, format, args); return IStrPrintfValidate(dest, count, result); } //=========================================================================== unsigned StrPrintfV (wchar_t * dest, unsigned count, const wchar_t format[], va_list args) { - int result = _vsnwprintf(dest, count, format, args); + int result = hsVsnwprintf(dest, count, format, args); return IStrPrintfValidate(dest, count, result); } diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h index 538f0437..64b86309 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h @@ -50,6 +50,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSTR_H +#include "Pch.h" +#include "pnUtArray.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSync.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSync.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h index 3af3370b..0800e505 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSync.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSYNC_H +#include "Pch.h" /**************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp index 64f1104e..4f892520 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtTime.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h index 6adebaef..fda2a145 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTIME_H +#include "Pch.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtTls.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtTls.cpp index 5686cba8..730af543 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtTls.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtTls.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtTls.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtTls.h index 6e9e265c..61ffb6d5 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtTls.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTLS_H +#include "Pch.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTypes.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtTypes.h similarity index 100% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTypes.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtTypes.h diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp similarity index 98% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.cpp rename to Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp index d9997ffc..5cda53ed 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../Pch.h" -#pragma hdrstop +#include "pnUtUuid.h" const Uuid kNilGuid; diff --git a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h similarity index 99% rename from Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h rename to Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h index ab58f1f1..ac163a0e 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTUUID_H +#include "Pch.h" /***************************************************************************** * From 959ca7004784997003d56267141972f536c9332b Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 28 Jan 2012 22:25:02 -0800 Subject: [PATCH 08/51] Define MAX_PATH for *nix since it's used all over. --- Sources/Plasma/CoreLib/hsUtils.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/Plasma/CoreLib/hsUtils.h b/Sources/Plasma/CoreLib/hsUtils.h index f230762a..b213687b 100644 --- a/Sources/Plasma/CoreLib/hsUtils.h +++ b/Sources/Plasma/CoreLib/hsUtils.h @@ -164,6 +164,8 @@ inline hsBool hsCompare(float a, float b, float delta=0.0001); # define hsSnwprintf swprintf # define hsWFopen(name, mode) fopen(hsWStringToString(name), hsWStringToString(mode)) + +# define MAX_PATH 1024 #endif // Useful floating point utilities From 7fe124c1e0f8bb477e958e031d5482e4e25b20f1 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 28 Jan 2012 22:25:38 -0800 Subject: [PATCH 09/51] plMessage now build on *nix :D --- Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h b/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h index 996c32b8..784b2fe0 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h @@ -45,15 +45,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifndef PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNETCOMMMSGS_H -#define PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNETCOMMMSGS_H +#ifndef plNetCommMsgs_inc +#define plNetCommMsgs_inc -#include "pnUtils/pnUtils.h" +#include "pnUtils/pnUtArray.h" #include "pnNetBase/pnNetBase.h" #include "pnMessage/plMessage.h" -#include "pnNetProtocol/pnNetProtocol.h" - class plNetCommReplyMsg : public plMessage { public: @@ -173,4 +171,4 @@ public: -#endif // PLASMA20_SOURCES_PLASMA_PUBUTILLIB_PLMESSAGE_PLNETCOMMMSGS_H +#endif // plNetCommMsgs_inc From 454e4c8afb79d66b1a6ac02483dd0b7d834321ea Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 28 Jan 2012 22:32:30 -0800 Subject: [PATCH 10/51] Fix some pnUtils header issues. --- Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h | 1 - Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h | 5 ++--- Sources/Plasma/NucleusLib/pnUtils/pnUtPragma.h | 5 ++--- Sources/Plasma/NucleusLib/pnUtils/pnUtils.h | 2 +- 4 files changed, 5 insertions(+), 8 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h index b3b1cffa..6c06150a 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h @@ -70,7 +70,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnUtMisc.h" #include "pnUtCrypt.h" #include "pnUtSpareList.h" -#include "pnUtSubst.h" #include "pnUtRand.h" #include "pnUtBase64.h" #include "pnUtSkipList.h" diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h index ff4a66f9..c5437947 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCoreLib.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCORELIB_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCoreLib.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCORELIB_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCORELIB_H #pragma warning(push, 0) @@ -58,3 +56,4 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStream.h" #pragma warning(pop) +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtPragma.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtPragma.h index 6b99273e..0d16bcfa 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtPragma.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtPragma.h @@ -45,11 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRAGMA_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPragma.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRAGMA_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRAGMA_H #pragma warning(disable: 4800) // 'type' : forcing value to bool 'true' or 'false' (performance warning) #pragma warning(disable: 4201) // nonstandard extension used : nameless struct/union +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtils.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtils.h index 7aa14fc2..cb1e601d 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtils.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtils.h @@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PNUTILS_H -#include "Private/pnUtAllIncludes.h" +#include "pnUtAllIncludes.h" #endif // PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PNUTILS_H From 65b75f0667be43ac297fbbbd47ce2ad5d185e0aa Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 28 Jan 2012 23:15:16 -0800 Subject: [PATCH 11/51] Don't throw errors when including pnUtils stuff. --- Sources/Plasma/NucleusLib/pnUUID/pnUUID.h | 2 +- .../Plasma/NucleusLib/pnUtils/CMakeLists.txt | 1 - Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.h | 5 +- .../NucleusLib/pnUtils/pnUtAllIncludes.h | 7 +- .../Plasma/NucleusLib/pnUtils/pnUtBase64.h | 5 +- .../Plasma/NucleusLib/pnUtils/pnUtBigNum.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtList.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtPath.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtRand.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtRef.h | 5 +- .../Plasma/NucleusLib/pnUtils/pnUtSkipList.h | 477 ------------------ Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h | 5 +- .../Plasma/NucleusLib/pnUtils/pnUtSpareList.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtTls.h | 5 +- Sources/Plasma/NucleusLib/pnUtils/pnUtTypes.h | 57 --- Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h | 6 +- 25 files changed, 47 insertions(+), 598 deletions(-) delete mode 100644 Sources/Plasma/NucleusLib/pnUtils/pnUtSkipList.h delete mode 100644 Sources/Plasma/NucleusLib/pnUtils/pnUtTypes.h diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h index a07cbb43..91878faa 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h @@ -45,7 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "hsStlUtils.h" #ifdef HS_BUILD_FOR_WIN32 -#include "pnUtils/pnUtils.h" +#include "pnUtils/pnUtUuid.h" #endif class hsStream; diff --git a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt index e2655a48..56366de6 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt @@ -21,7 +21,6 @@ set(pnUtils_HEADERS pnUtPriQ.h pnUtRand.h pnUtRef.h - pnUtSkipList.h pnUtSort.h pnUtSpareList.h pnUtStr.h diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.h index 9bc935a1..d0c28e9e 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtAddr.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTADDR_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtAddr.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTADDR_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTADDR_H #include "Pch.h" @@ -169,3 +167,4 @@ unsigned NetAddressGetLocal ( unsigned count, NetAddressNode addresses[] ); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h index 6c06150a..8a0d9e12 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h @@ -52,16 +52,22 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnUtCoreLib.h" // must be first in list #include "pnUtPragma.h" #include "pnUtAddr.h" +#if HS_BUILD_FOR_WIN32 #include "pnUtUuid.h" +#endif #include "pnUtMath.h" #include "pnUtSort.h" #include "pnUtArray.h" #include "pnUtList.h" #include "pnUtHash.h" #include "pnUtPriQ.h" +#if HS_BUILD_FOR_WIN32 #include "pnUtSync.h" +#endif #include "pnUtTime.h" +#if HS_BUILD_FOR_WIN32 #include "pnUtTls.h" +#endif #include "pnUtStr.h" #include "pnUtRef.h" #include "pnUtPath.h" @@ -72,6 +78,5 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnUtSpareList.h" #include "pnUtRand.h" #include "pnUtBase64.h" -#include "pnUtSkipList.h" #endif // PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTALLINCLUDES_H diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.h index f4ba8756..f6635ebe 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtBase64.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBASE64_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBase64.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBASE64_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBASE64_H #include "Pch.h" @@ -84,3 +82,4 @@ unsigned Base64Decode ( unsigned dstChars, uint8_t * dstData ); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.h index 0d2ca4b9..c6e6f94d 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtBigNum.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBIGNUM_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtBigNum.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBIGNUM_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTBIGNUM_H #include "Pch.h" @@ -228,3 +226,4 @@ public: BN_sub(&m_number, &a.m_number, &b.m_number); } }; +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.h index a6f940b7..08c83364 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCmd.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCMD_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCmd.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCMD_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCMD_H #include "Pch.h" @@ -145,3 +143,4 @@ public: ); }; +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h index c922fc88..fcce7340 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCRYPT_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtCrypt.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCRYPT_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTCRYPT_H #include "Pch.h" @@ -182,3 +180,4 @@ void CryptDecrypt ( unsigned bytes, void * data ); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h index 9e87817c..04c3797d 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTHASH_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtHash.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTHASH_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTHASH_H #include "Pch.h" @@ -746,3 +744,4 @@ typedef THashKeyStr< wchar_t, THashKeyStrCmp > CHashKeyStr; typedef THashKeyStr< wchar_t, THashKeyStrCmpI > CHashKeyStrI; typedef THashKeyStr< char, THashKeyStrCmp > CHashKeyStrChar; typedef THashKeyStr< char, THashKeyStrCmpI > CHashKeyStrCharI; +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h index 0bfd4c35..f9a17bb1 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtList.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTLIST_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtList.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTLIST_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTLIST_H #include "Pch.h" @@ -641,3 +639,4 @@ template void TListDyn::Initialize (int linkOffset) { this->SetLinkOffset(linkOffset); } +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h index 0dd99599..ae1e67b2 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMATH_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMath.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMATH_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMATH_H #include "Pch.h" @@ -115,3 +113,4 @@ inline unsigned MathNextMultiplePow2 (unsigned val, unsigned multiple) { inline uint32_t MathNextPow2 (uint32_t val) { return MathIsPow2(val) ? val : 1 << (MathHighBitPos(val) + 1); } +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.h index 69e83f2c..5e400013 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtMisc.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMISC_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtMisc.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMISC_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTMISC_H #include "Pch.h" @@ -166,3 +164,4 @@ const unsigned kCpuCapTsc = 1<<9; // time stamp counter #define CPU_SIGNATURE_FAMILY(sig) ((sig >> 8) & 0xf) #define CPU_SIGNATURE_MODEL(sig) ((sig >> 4) & 0xf) #define CPU_SIGNATURE_STEPPING(sig) (sig & 0xf) +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtPath.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtPath.h index 2c984069..5eb8c9a4 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtPath.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtPath.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPATH_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPath.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPATH_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPATH_H #include "Pch.h" @@ -325,3 +323,4 @@ void PathSplitEmail ( unsigned subDomainChars, // arrsize(subs[0]) --> 256 unsigned subDomainCount // arrsize(subs) --> 16 ); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h index cdaa2e5a..862970bd 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtPriQ.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRIQ_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtPriQ.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRIQ_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTPRIQ_H #include "Pch.h" @@ -486,3 +484,4 @@ public: private: unsigned m_time; }; +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtRand.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtRand.h index 4ed1bfcf..5383d49d 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtRand.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtRand.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTRAND_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRand.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTRAND_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTRAND_H #include "Pch.h" @@ -66,3 +64,4 @@ float RandFloat (); float RandFloat (float minVal, float maxVal); unsigned RandUnsigned (); unsigned RandUnsigned (unsigned minVal, unsigned maxVal); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtRef.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtRef.h index 2473c415..5b1f50f3 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtRef.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtRef.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTREF_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtRef.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTREF_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTREF_H @@ -179,3 +177,4 @@ protected: private: long m_ref; }; +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtSkipList.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSkipList.h deleted file mode 100644 index df4668dd..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtSkipList.h +++ /dev/null @@ -1,477 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -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==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h -* -***/ - -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSKIPLIST_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSkipList.h included more than once" -#endif -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSKIPLIST_H - - -/***************************************************************************** -* -* Macros -* -***/ - -#define SKIPLIST(type, keyType, keyField, cmp) TSkipList< type, keyType, offsetof(type, keyField), cmp > -#define SKIPLIST_NUMERIC(type, keyType, keyField) SKIPLIST(type, keyType, keyField, TSkipListNumericCmp) -#define SKIPLIST_STRING(type, keyType, keyField) SKIPLIST(type, keyType, keyField, TSkipListStringCmp) -#define SKIPLIST_STRINGI(type, keyType, keyField) SKIPLIST(type, keyType, keyField, TSkipListStringCmpI) - - - -/***************************************************************************** -* -* Typedefs -* -***/ - -typedef void * SkipListTag; - - -/***************************************************************************** -* -* Comparers -* -***/ - - -template -class TSkipListNumericCmp { -public: - static bool Eq (const K & a, const K & b) { return a == b; } - static bool Lt (const K & a, const K & b) { return a < b; } -}; - -template -class TSkipListStringCmp { -public: - static bool Eq (const K & a, const K & b) { return StrCmp(a, b, (unsigned)-1) == 0; } - static bool Lt (const K & a, const K & b) { return StrCmp(a, b, (unsigned)-1) < 0; } -}; - -template -class TSkipListStringCmpI { -public: - static bool Eq (const K & a, const K & b) { return StrCmpI(a, b, (unsigned)-1) == 0; } - static bool Lt (const K & a, const K & b) { return StrCmpI(a, b, (unsigned)-1) < 0; } -}; - - -/***************************************************************************** -* -* TSkipList -* -***/ - -template -class TSkipList { -private: - enum { kMaxLevels = 32 }; - - template - struct TNode { - const K2 * key; - T2 * object; - unsigned level; - TNode * prev; - TNode * next[1]; // variable size array - }; - typedef TNode Node; - - unsigned m_level; - Node * m_head; - Node * m_stop; - unsigned m_randomBits; - unsigned m_randomsLeft; - - Node * AllocNode (unsigned levels); - void FreeNode (Node * node); - unsigned RandomLevel (); - -public: - inline TSkipList (); - inline ~TSkipList (); - inline void Clear (); - inline void Delete (T * object); - inline T * Find (const K & key, SkipListTag * tag = nil) const; - inline T * FindNext (SkipListTag * tag) const; - inline T * Head (SkipListTag * tag) const; - inline T * Next (SkipListTag * tag) const; - inline T * Prev (SkipListTag * tag) const; - inline T * Tail (SkipListTag * tag) const; - inline void Link (T * object); - inline void Unlink (T * object); - inline void Unlink (SkipListTag * tag); - inline void UnlinkAll (); - - #ifdef HS_DEBUGGING - inline void Print () const; - #endif -}; - - -/***************************************************************************** -* -* TSkipList private member functions -* -***/ - -//============================================================================ -template -typename TSkipList::Node* TSkipList::AllocNode (unsigned level) { - - unsigned size = offsetof(Node, next) + (level + 1) * sizeof(Node); - Node * node = (Node *)malloc(size); - node->level = level; - return node; -} - -//============================================================================ -template -void TSkipList::FreeNode (TNode * node) { - - free(node); -} - -//============================================================================ -template -unsigned TSkipList::RandomLevel () { - - unsigned level = 0; - unsigned bits = 0; - - while (!bits) { - bits = m_randomBits % 4; - if (!bits) - ++level; - m_randomBits >>= 2; - m_randomsLeft -= 2; - if (!m_randomsLeft) { - m_randomBits = RandUnsigned(); - m_randomsLeft = 30; - } - } - - return level; -} - - -/***************************************************************************** -* -* TSkipList public member functions -* -***/ - -//============================================================================ -template -TSkipList::TSkipList () { - - m_level = 0; - m_head = AllocNode(kMaxLevels); - m_stop = AllocNode(0); - m_randomBits = RandUnsigned(); - m_randomsLeft = 30; - - // Initialize header and stop skip node pointers - m_stop->prev = m_head; - m_stop->object = nil; - m_stop->next[0] = nil; - m_head->object = nil; - for (unsigned index = 0; index < kMaxLevels; ++index) - m_head->next[index] = m_stop; -} - -//============================================================================ -template -TSkipList::~TSkipList () { - - UnlinkAll(); - ASSERT(m_stop->prev == m_head); - FreeNode(m_head); - FreeNode(m_stop); -} - -//============================================================================ -template -void TSkipList::Clear () { - - Node * ptr = m_head->next[0]; - while (ptr != m_stop) { - Node * next = ptr->next[0]; - delete ptr->object; - FreeNode(ptr); - ptr = next; - } - - m_stop->prev = m_head; - for (unsigned index = 0; index < kMaxLevels; ++index) - m_head->next[index] = m_stop; - m_level = 0; -} - -//============================================================================ -template -void TSkipList::Delete (T * object) { - - Unlink(object); - delete object; -} - -//============================================================================ -template -T * TSkipList::Find (const K & key, SkipListTag * tag) const { - - Node * node = m_head; - - m_stop->key = &key; - for (int level = (int)m_level; level >= 0; --level) - while (Cmp::Lt(*node->next[level]->key, key)) - node = node->next[level]; - - node = node->next[0]; - if (node != m_stop && Cmp::Eq(*node->key, *m_stop->key)) { - if (tag) - *tag = node; - return node->object; - } - else { - if (tag) - *tag = nil; - return nil; - } -} - -//============================================================================ -template -T * TSkipList::FindNext (SkipListTag * tag) const { - - Node * node = (Node *)*tag; - - m_stop->key = node->key; - for (int level = (int)node->level; level >= 0; --level) - while (Cmp::Lt(*node->next[level]->key, *m_stop->key)) - node = node->next[level]; - - node = node->next[0]; - if (node != m_stop && Cmp::Eq(*node->key, *m_stop->key)) { - *tag = node; - return node->object; - } - else { - *tag = nil; - return nil; - } -} - -//============================================================================ -template -T * TSkipList::Head (SkipListTag * tag) const { - - ASSERT(tag); - Node * first = m_head->next[0]; - if (first == m_stop) { - *tag = nil; - return nil; - } - - *tag = first; - return first->object; -} - -//============================================================================ -template -T * TSkipList::Next (SkipListTag * tag) const { - - ASSERT(tag); - Node * node = (Node *)*tag; - ASSERT(node); - if (node->next[0] == m_stop) { - *tag = nil; - return nil; - } - - *tag = node->next[0]; - return node->next[0]->object; -} - -//============================================================================ -template -T * TSkipList::Prev (SkipListTag * tag) const { - - ASSERT(tag); - Node * node = (Node *)*tag; - ASSERT(node); - if (node->prev == m_head) { - *tag = nil; - return nil; - } - - *tag = node->prev; - return node->prev->object; -} - -//============================================================================ -template -T * TSkipList::Tail (SkipListTag * tag) const { - - ASSERT(tag); - Node * last = m_stop->prev; - if (last == m_head) { - *tag = nil; - return nil; - } - - *tag = last; - return last->object; -} - -//============================================================================ -template -void TSkipList::Link (T * object) { - - const K * key = (const K *)((const uint8_t *)object + keyOffset); - - // Find the node's insertion point - m_stop->key = key; - Node * update[kMaxLevels]; - Node * node = m_head; - for (int level = (int)m_level; level >= 0; --level) { - while (Cmp::Lt(*node->next[level]->key, *key)) - node = node->next[level]; - update[level] = node; - } - node = node->next[0]; - - { - // Select a level for the skip node - unsigned newLevel = RandomLevel(); - if (newLevel > m_level) { - if (m_level < kMaxLevels - 1) { - newLevel = ++m_level; - update[newLevel] = m_head; - } - else - newLevel = m_level; - } - - // Create the node and insert it into the skip list - Node * node = AllocNode(newLevel); - node->key = key; - node->object = object; - for (unsigned level = newLevel; level >= 1; --level) { - node->next[level] = update[level]->next[level]; - update[level]->next[level] = node; - } - node->prev = update[0]; - node->next[0] = update[0]->next[0]; - update[0]->next[0]->prev = node; - update[0]->next[0] = node; - } -} - -//============================================================================ -template -void TSkipList::Unlink (T * object) { - - const K * key = (const K *)((const uint8_t *)object + keyOffset); - - Node * node = m_head; - Node * update[kMaxLevels]; - int level = m_level; - - for (;;) { - // Find the node being unlinked - m_stop->key = key; - for (; level >= 0; --level) { - while (Cmp::Lt(*node->next[level]->key, *key)) - node = node->next[level]; - update[level] = node; - } - node = node->next[0]; - - // Node wasn't found so do nothing - if (*node->key != *key || node == m_stop) - return; - - if (node->object == object) - break; - } - - // Update all links - for (level = m_level; level >= 1; --level) { - if (update[level]->next[level] != node) - continue; - update[level]->next[level] = node->next[level]; - } - ASSERT(update[0]->next[0] == node); - node->next[0]->prev = update[0]; - update[0]->next[0] = node->next[0]; - - // Update header - while (m_level && m_head->next[m_level] == m_stop) - --m_level; - - FreeNode(node); -} - -//============================================================================ -template -void TSkipList::UnlinkAll () { - - Node * ptr = m_head->next[0]; - while (ptr != m_stop) { - Node * next = ptr->next[0]; - FreeNode(ptr); - ptr = next; - } - - m_stop->prev = m_head; - for (unsigned index = 0; index < kMaxLevels; ++index) - m_head->next[index] = m_stop; - m_level = 0; -} diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h index a26d8fb9..bd1752ec 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSort.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSORT_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSort.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSORT_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSORT_H @@ -239,3 +237,4 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *(addrOfIndex) = high - (ptr); \ \ } +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.h index 5ea63803..ba660284 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSPARELIST_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSPARELIST_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSPARELIST_H #include "Pch.h" @@ -147,3 +145,4 @@ template T * TSpareList::New () { return new(CBaseSpareList::Alloc(OBJECT_SIZE, typeid(T).name())) T; } +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h index 64b86309..02649403 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSTR_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtStr.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSTR_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSTR_H #include "Pch.h" @@ -156,3 +154,4 @@ bool StrTokenize (const char * source[], char * dest, unsigned chars, const char bool StrTokenize (const wchar_t * source[], wchar_t * dest, unsigned chars, const wchar_t whitespace[], unsigned maxWhitespaceSkipCount = (unsigned)-1); bool StrTokenize (const char * source[], ARRAY(char) * destArray, const char whitespace[], unsigned maxWhitespaceSkipCount = (unsigned)-1); bool StrTokenize (const wchar_t * source[], ARRAY(wchar_t) * destArray, const wchar_t whitespace[], unsigned maxWhitespaceSkipCount = (unsigned)-1); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h index 0800e505..d2dc4977 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSYNC_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSync.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSYNC_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTSYNC_H #include "Pch.h" @@ -133,3 +131,4 @@ public: const EventHandle & Handle () const { return m_handle; } }; +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h index fda2a145..6140683c 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtTime.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTIME_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTime.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTIME_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTIME_H #include "Pch.h" @@ -128,3 +126,4 @@ uint32_t TimeGetSecondsSince1970Utc (); static const uint64_t kTime1601To1970 = 11644473600 * kTimeIntervalsPerSecond; static const uint64_t kTime1601To2001 = 12622780800 * kTimeIntervalsPerSecond; +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtTls.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtTls.h index 61ffb6d5..815c22f6 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtTls.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtTls.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTLS_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTls.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTLS_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTLS_H #include "Pch.h" @@ -71,3 +69,4 @@ void ThreadLocalSetValue (unsigned id, void * value); void ThreadAllowBlock (); void ThreadDenyBlock (); void ThreadAssertCanBlock (const char file[], int line); +#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtTypes.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtTypes.h deleted file mode 100644 index f383f432..00000000 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtTypes.h +++ /dev/null @@ -1,57 +0,0 @@ -/*==LICENSE==* - -CyanWorlds.com Engine - MMOG client, server and tools -Copyright (C) 2011 Cyan Worlds, Inc. - -This program is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or -(at your option) any later version. - -This program is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with this program. If not, see . - -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==*/ -/***************************************************************************** -* -* $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTypes.h -* -* -* By Eric Anderson (10/10/2005) -* Copyright 2005 Cyan Worlds, Inc. -* -***/ - -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTYPES_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtTypes.h included more than once" -#endif -#define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTTYPES_H - - diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h index ac163a0e..4f0f20be 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h @@ -45,9 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#ifdef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTUUID_H -#error "Header $/Plasma20/Sources/Plasma/NucleusLib/pnUtils/Private/pnUtUuid.h included more than once" -#endif +#ifndef PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTUUID_H #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILS_PRIVATE_PNUTUUID_H #include "Pch.h" @@ -117,4 +115,4 @@ struct Uuid { }; #include - +#endif From 945e1ac37ba0e75572b502c47a3dc0b7cdac4ebc Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 00:18:26 -0800 Subject: [PATCH 12/51] Make pnUtUuid compile on *nix. --- Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp | 11 +++++++++++ Sources/Plasma/NucleusLib/pnUUID/pnUUID.h | 6 ------ Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp | 11 ----------- Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt | 4 ++-- Sources/Plasma/NucleusLib/pnUtils/Pch.h | 1 - Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp | 2 +- Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h | 4 ---- Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp | 6 ++++-- Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h | 7 ++++--- Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp | 2 ++ Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h | 4 ++-- 11 files changed, 26 insertions(+), 32 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp index f6c6073e..9780d2bb 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.cpp @@ -57,6 +57,11 @@ plUUID::plUUID( const plUUID & other ) CopyFrom( &other ); } +plUUID::plUUID( const Uuid & uuid ) +{ + memcpy(fData, uuid.data, sizeof(fData)); +} + void plUUID::Read( hsStream * s) { s->LogSubStreamPushDesc("plUUID"); @@ -73,3 +78,9 @@ const char * plUUID::AsString() const { ToStdString(str); return str.c_str(); } + +plUUID::operator Uuid () const { + Uuid uuid; + memcpy(uuid.data, fData, sizeof(uuid.data)); + return uuid; +} diff --git a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h index 91878faa..8438601a 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID.h @@ -44,9 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "HeadSpin.h" #include "hsStlUtils.h" -#ifdef HS_BUILD_FOR_WIN32 #include "pnUtils/pnUtUuid.h" -#endif class hsStream; @@ -65,9 +63,7 @@ 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(); } @@ -85,9 +81,7 @@ 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/NucleusLib/pnUUID/pnUUID_Win32.cpp b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp index 59d585a3..da39532d 100644 --- a/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp +++ b/Sources/Plasma/NucleusLib/pnUUID/pnUUID_Win32.cpp @@ -47,11 +47,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include -plUUID::plUUID( const Uuid & uuid ) -{ - memcpy(fData, uuid.data, sizeof(fData)); -} - void plUUID::Clear() { UuidCreateNil( (GUID *)this ); @@ -85,12 +80,6 @@ void plUUID::CopyFrom( const plUUID & v ) { memcpy(fData, v.fData, sizeof(fData)); } -plUUID::operator Uuid () const { - Uuid uuid; - memcpy(uuid.data, fData, sizeof(uuid.data)); - return uuid; -} - bool plUUID::FromString( const char * str ) { Clear(); diff --git a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt index 56366de6..2774f622 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnUtils/CMakeLists.txt @@ -45,6 +45,7 @@ set(pnUtils_SOURCES pnUtSpareList.cpp pnUtStr.cpp pnUtTime.cpp + pnUtUuid.cpp ) if(WIN32) @@ -59,13 +60,12 @@ if(WIN32) pnUtCrypt.cpp pnUtTls.cpp - pnUtUuid.cpp ) else() set(pnUtils_UNIX Unix/pnUtUxStr.cpp #Unix/pnUtUxSync.cpp - #Unix/pnUtUxUuid.cpp + Unix/pnUtUxUuid.cpp ) endif() diff --git a/Sources/Plasma/NucleusLib/pnUtils/Pch.h b/Sources/Plasma/NucleusLib/pnUtils/Pch.h index ac9bcdc7..b62001ac 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Pch.h +++ b/Sources/Plasma/NucleusLib/pnUtils/Pch.h @@ -50,7 +50,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnUtCoreLib.h" // must be first in list #include "pnUtPragma.h" -#include "pnProduct/pnProduct.h" #include diff --git a/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp index 6722e337..25601fe2 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Unix/pnUtUxUuid.cpp @@ -45,7 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../pnUtUUID.h" +#include "../pnUtUuid.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h index 8a0d9e12..8e167f45 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h @@ -52,18 +52,14 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnUtCoreLib.h" // must be first in list #include "pnUtPragma.h" #include "pnUtAddr.h" -#if HS_BUILD_FOR_WIN32 #include "pnUtUuid.h" -#endif #include "pnUtMath.h" #include "pnUtSort.h" #include "pnUtArray.h" #include "pnUtList.h" #include "pnUtHash.h" #include "pnUtPriQ.h" -#if HS_BUILD_FOR_WIN32 #include "pnUtSync.h" -#endif #include "pnUtTime.h" #if HS_BUILD_FOR_WIN32 #include "pnUtTls.h" diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp index 6c4a3801..1b303595 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtCrypt.cpp @@ -46,6 +46,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ***/ #include "pnUtCrypt.h" +#include "pnUtStr.h" +#include "pnUtTime.h" #include #include @@ -360,13 +362,13 @@ void CryptHashPasswordChallenge ( const ShaDigest & namePassHash, ShaDigest * challengeHash ) { - #include +#pragma pack(push, 1) struct { uint32_t clientChallenge; uint32_t serverChallenge; ShaDigest namePassHash; } buffer; - #include +#pragma pack(pop) buffer.clientChallenge = clientChallenge; buffer.serverChallenge = serverChallenge; buffer.namePassHash = namePassHash; diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h index d2dc4977..750b5bb7 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSync.h @@ -104,9 +104,9 @@ public: #ifdef HS_BUILD_FOR_WIN32 typedef HANDLE EventHandle; -#else -# error "CEvent: Not implemented on this platform" -#endif +//#else +//# error "CEvent: Not implemented on this platform" +//#endif const unsigned kEventWaitForever = (unsigned)-1; @@ -130,5 +130,6 @@ public: const EventHandle & Handle () const { return m_handle; } }; +#endif // HS_BUILD_FOR_WIN32 #endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp index 5cda53ed..c5f31c32 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.cpp @@ -46,6 +46,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ***/ #include "pnUtUuid.h" +#include "pnUtHash.h" +#include "pnUtStr.h" const Uuid kNilGuid; diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h index 4f0f20be..875adcf9 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtUuid.h @@ -95,7 +95,7 @@ bool GuidFromHex (const uint8_t buf[], unsigned length, Uuid * uuid); * ***/ -#include +#pragma pack(push, 1) struct Uuid { union { uint32_t uint32_ts[4]; @@ -113,6 +113,6 @@ struct Uuid { inline bool operator != (const Uuid & rhs) const { return !GuidsAreEqual(*this, rhs); } inline bool operator != (int rhs) const { ASSERT(!rhs); return !GuidsAreEqual(*this, kNilGuid); } }; -#include +#pragma pack(pop) #endif From 85b5842ece3544f5f3a9534cd574ffcc32ab8357 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 00:19:37 -0800 Subject: [PATCH 13/51] Fix all the packed structures. Now we actually build a significant amount of stuff on Linux. --- Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp | 2 +- Sources/Plasma/FeatureLib/pfConsole/pfConsole.h | 2 +- Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h | 4 ++-- Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcLog.cpp | 4 ++-- .../Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h | 2 +- Sources/Plasma/NucleusLib/pnCsrNet/pnCsrNet.h | 4 ++-- .../NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h | 4 ++-- .../NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h | 4 ++-- Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h | 6 +++--- Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h | 4 ++-- .../Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h | 4 ++-- Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h | 4 ++-- Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h | 4 ++-- Sources/Plasma/NucleusLib/pnMail/pnMail.cpp | 4 ++-- Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp | 4 ++-- .../Private/Protocols/Cli2Auth/pnNpCli2Auth.h | 4 ++-- .../pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.h | 4 ++-- .../Private/Protocols/Cli2File/pnNpCli2File.h | 4 ++-- .../Private/Protocols/Cli2Game/pnNpCli2Game.h | 4 ++-- .../Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h | 5 +++-- .../pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h | 4 ++-- .../pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.h | 4 ++-- .../pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h | 4 ++-- .../Private/Protocols/Srv2Score/pnNpSrv2Score.h | 4 ++-- .../Private/Protocols/Srv2State/pnNpSrv2State.h | 4 ++-- .../Private/Protocols/Srv2Vault/pnNpSrv2Vault.h | 4 ++-- .../Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h | 8 ++++---- Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.h | 3 ++- 28 files changed, 57 insertions(+), 55 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp index b6c37b98..c51b06d8 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp @@ -1214,7 +1214,7 @@ void pfConsole::AddLineF(const char * fmt, ...) { char str[1024]; va_list args; va_start(args, fmt); - _vsnprintf(str, arrsize(str), fmt, args); + hsVsnprintf(str, arrsize(str), fmt, args); va_end(args); AddLine(str); } diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.h b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.h index c1e9803d..a6241e81 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.h +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.h @@ -114,7 +114,7 @@ class pfConsole : public hsKeyedObject static uint32_t fConsoleTextColor; static pfConsole *fTheConsole; - static void _cdecl IAddLineCallback( const char *string ); + static void CDECL IAddLineCallback( const char *string ); static plPipeline *fPipeline; diff --git a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h index 56bd5b9b..287e3a4b 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h +++ b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcIo.h @@ -238,7 +238,7 @@ bool AsyncFileSeek ( * ***/ -#include +#pragma pack(push,1) struct AsyncSocketConnectPacket { uint8_t connType; uint16_t hdrBytes; @@ -247,7 +247,7 @@ struct AsyncSocketConnectPacket { uint32_t branchId; Uuid productId; }; -#include +#pragma pack(pop) /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcLog.cpp b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcLog.cpp index e6e02354..edcca438 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcLog.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcLog.cpp @@ -122,7 +122,7 @@ void LogUnregisterHandler (FLogHandler callback) { } //=========================================================================== -void __cdecl LogMsg (ELogSeverity severity, const char format[], ...) { +void CDECL LogMsg (ELogSeverity severity, const char format[], ...) { ASSERT(format); va_list args; @@ -132,7 +132,7 @@ void __cdecl LogMsg (ELogSeverity severity, const char format[], ...) { } //=========================================================================== -void __cdecl LogMsg (ELogSeverity severity, const wchar_t format[], ...) { +void CDECL LogMsg (ELogSeverity severity, const wchar_t format[], ...) { ASSERT(format); va_list args; diff --git a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h index f81feac0..81ca9c24 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h +++ b/Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcThread.h @@ -63,7 +63,7 @@ const unsigned kAsyncTimeInfinite = (unsigned) -1; #ifdef _MSC_VER #define THREADCALL __stdcall #else -#define THREADCALL __cdecl +#define THREADCALL CDECL #endif struct AsyncThread; diff --git a/Sources/Plasma/NucleusLib/pnCsrNet/pnCsrNet.h b/Sources/Plasma/NucleusLib/pnCsrNet/pnCsrNet.h index d72d7225..f5de1923 100644 --- a/Sources/Plasma/NucleusLib/pnCsrNet/pnCsrNet.h +++ b/Sources/Plasma/NucleusLib/pnCsrNet/pnCsrNet.h @@ -67,7 +67,7 @@ enum { //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) #define CSRNET_MSG(a) \ CsrNet_##a () : SimpleNet_MsgHeader(kSimpleNetChannelCsr, kCsrNet_##a) { } @@ -82,7 +82,7 @@ struct CsrNet_ExecConsoleCmd : SimpleNet_MsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) #endif // PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNCSRNET_PNCSRNET_H diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h b/Sources/Plasma/NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h index 1003a0ce..3210c765 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/BlueSpiral/pnGmBlueSpiral.h @@ -93,7 +93,7 @@ enum { //============================================================================ // Begin networked data scructures -#include +#pragma pack(push,1) //============================================================================ //======================================================================== @@ -134,5 +134,5 @@ enum { //============================================================================ // End networked data structures -#include +#pragma pack(pop) //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h b/Sources/Plasma/NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h index 6bf5a2de..9afccb28 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/ClimbingWall/pnGmClimbingWall.h @@ -106,7 +106,7 @@ enum { //============================================================================ // Begin networked data structures -#include +#pragma pack(push,1) //============================================================================ //======================================================================== @@ -180,5 +180,5 @@ enum { //============================================================================ // End networked data structures -#include +#pragma pack(pop) //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h b/Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h index d48304d8..6511680e 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/Heek/pnGmHeek.h @@ -124,7 +124,7 @@ enum { //============================================================================ // Begin networked data structures -#include +#pragma pack(push,1) //============================================================================ //======================================================================== @@ -199,5 +199,5 @@ enum { //============================================================================ // End networked data structures -#include -//============================================================================ \ No newline at end of file +#pragma pack(pop) +//============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h b/Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h index 78215554..a90f39ae 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/Marker/pnGmMarker.h @@ -117,7 +117,7 @@ enum { //============================================================================ // Begin networked data structures -#include +#pragma pack(push,1) //============================================================================ //======================================================================== @@ -225,5 +225,5 @@ enum { //============================================================================ // End networked data structures -#include +#pragma pack(pop) //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h b/Sources/Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h index a0643073..68e85305 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/TicTacToe/pnGmTicTacToe.h @@ -96,7 +96,7 @@ enum { //============================================================================ // Begin networked data scructures -#include +#pragma pack(push,1) //============================================================================ //======================================================================== @@ -132,5 +132,5 @@ enum { //============================================================================ // End networked data structures -#include +#pragma pack(pop) //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h b/Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h index 75c3de39..892a62d7 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/VarSync/pnGmVarSync.h @@ -96,7 +96,7 @@ enum { //============================================================================ // Begin networked data structures -#include +#pragma pack(push,1) //============================================================================ //======================================================================== @@ -153,5 +153,5 @@ enum { //============================================================================ // End networked data structures -#include +#pragma pack(pop) //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h b/Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h index 5797fd7e..3aa9bd66 100644 --- a/Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h +++ b/Sources/Plasma/NucleusLib/pnGameMgr/pnGameMgr.h @@ -165,7 +165,7 @@ enum { //============================================================================ // Begin networked data scructures -#include +#pragma pack(push,1) //============================================================================ struct GameMsgHeader { @@ -247,7 +247,7 @@ enum { //============================================================================ // End networked data structures -#include +#pragma pack(pop) //============================================================================ diff --git a/Sources/Plasma/NucleusLib/pnMail/pnMail.cpp b/Sources/Plasma/NucleusLib/pnMail/pnMail.cpp index 30a36f4a..bed2d193 100644 --- a/Sources/Plasma/NucleusLib/pnMail/pnMail.cpp +++ b/Sources/Plasma/NucleusLib/pnMail/pnMail.cpp @@ -95,7 +95,7 @@ static bool MailNotifyProc ( void ** userState ); -static void __cdecl Send ( +static void CDECL Send ( AsyncSocket sock, const char str[], ... @@ -431,7 +431,7 @@ static bool MailNotifyProc ( } //=========================================================================== -static void __cdecl Send ( +static void CDECL Send ( AsyncSocket sock, const char str[], ... diff --git a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp index 8d557b9d..6ca95acb 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp @@ -603,7 +603,7 @@ namespace Connect { * ***/ -#include +#pragma pack(push,1) enum { kNetCliCli2SrvConnect, kNetCliSrv2CliEncrypt, @@ -627,7 +627,7 @@ struct NetCli_Srv2Cli_Encrypt : NetCli_PacketHeader { struct NetCli_Srv2Cli_Error : NetCli_PacketHeader { uint32_t error; // ENetError }; -#include +#pragma pack(pop) //=========================================================================== diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Auth/pnNpCli2Auth.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Auth/pnNpCli2Auth.h index de66c9f7..1aaef9cb 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Auth/pnNpCli2Auth.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Auth/pnNpCli2Auth.h @@ -218,7 +218,7 @@ COMPILER_ASSERT_HEADER(Cli2Auth, kNumAuth2CliMessages <= (uint16_t)-1); //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -1046,4 +1046,4 @@ struct Auth2Cli_ScoreGetRanksReply { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.h index 49986ec9..df373048 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Csr/pnNpCli2Csr.h @@ -101,7 +101,7 @@ COMPILER_ASSERT_HEADER(Cli2Scr, kNumCsr2CliMessages <= (uint16_t)-1); * Networked structures * ***/ -#include +#pragma pack(push,1) //============================================================================ // Connect packet @@ -174,5 +174,5 @@ struct Csr2Cli_LoginReply : Cli2Csr_MsgHeader { }; -#include +#pragma pack(pop) diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.h index 2207db6a..df08897c 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2File/pnNpCli2File.h @@ -97,7 +97,7 @@ static const unsigned kFileSrvBuildId = 0; //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -208,4 +208,4 @@ struct File2Cli_FileDownloadReply : Cli2File_MsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h index 80665418..f01b2798 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2Game/pnNpCli2Game.h @@ -86,7 +86,7 @@ COMPILER_ASSERT_HEADER(Cli2Game, kNumGame2CliMessages <= (uint16_t)-1); //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -191,4 +191,4 @@ struct Game2Cli_GameMgrMsg { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h index 69b7c71c..7e04142f 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Cli2GateKeeper/pnNpCli2GateKeeper.h @@ -78,7 +78,7 @@ COMPILER_ASSERT_HEADER(Cli2GateKeeper, kNumGateKeeper2CliMessages <= (uint16_t)- //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -154,4 +154,5 @@ struct GateKeeper2Cli_AuthSrvIpAddressReply { uint32_t messageId; uint32_t transId; wchar_t address[24]; -}; \ No newline at end of file +}; +#pragma pack(pop) diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h index e51a7bc7..3bd0a089 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Db/pnNpSrv2Db.h @@ -160,7 +160,7 @@ enum { //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -554,7 +554,7 @@ struct Db2Srv_CsrAcctInfoReply : SrvMsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.h index b7ac0b01..8f8edb68 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Log/pnNpSrv2Log.h @@ -54,7 +54,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) // Srv2Log enum { @@ -103,7 +103,7 @@ struct Srv2Log_LogMsg : SrvMsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h index bcc59484..2296b069 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Mcp/pnNpSrv2Mcp.h @@ -96,7 +96,7 @@ enum { //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -252,7 +252,7 @@ struct Mcp2Srv_PropagateBuffer : SrvMsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.h index cfd69d80..27a5d646 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Score/pnNpSrv2Score.h @@ -54,7 +54,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) // kNetProtocolSrv2Score messages enum { @@ -169,7 +169,7 @@ struct Score2Srv_ScoreGetRanksReply : SrvMsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h index dfb4ab06..31b364e9 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2State/pnNpSrv2State.h @@ -68,7 +68,7 @@ enum { //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -129,7 +129,7 @@ struct State2Srv_ObjectFetched : SrvMsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h index 6c7f519d..1187f2d0 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/Protocols/Srv2Vault/pnNpSrv2Vault.h @@ -142,7 +142,7 @@ enum { //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) /***************************************************************************** @@ -453,7 +453,7 @@ struct Vault2Srv_CurrentPopulationRequest : SrvMsgHeader { //============================================================================ // END PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(pop) /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h index 7666945d..1a3cef0c 100644 --- a/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h +++ b/Sources/Plasma/NucleusLib/pnNetProtocol/Private/pnNpCommon.h @@ -79,14 +79,14 @@ const NetMsgField kNetMsgFieldBuildId = NET_MSG_FIELD_DWORD(); * ***/ -#include +#pragma pack(push,1) struct SrvPlayerInfo { unsigned playerInt; wchar_t playerName[kMaxPlayerNameLength]; wchar_t avatarShape[kMaxVaultNodeStringLength]; unsigned explorer; }; -#include +#pragma pack(pop) /***************************************************************************** @@ -441,14 +441,14 @@ struct NetVaultNodeFieldArray { //============================================================================ // NetVaultNodeRef (packed because is sent over wire directly) //============================================================================ -#include +#pragma pack(push,1) struct NetVaultNodeRef { unsigned parentId; unsigned childId; unsigned ownerId; bool seen; }; -#include +#pragma pack(pop) //============================================================================ // SrvPackBuffer diff --git a/Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.h b/Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.h index 6690c09c..b857e998 100644 --- a/Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.h +++ b/Sources/Plasma/NucleusLib/pnSimpleNet/pnSimpleNet.h @@ -84,7 +84,7 @@ COMPILER_ASSERT_HEADER(ESimpleNetChannel, kMaxSimpleNetChannels <= 0xff); //============================================================================ // BEGIN PACKED DATA STRUCTURES //============================================================================ -#include +#pragma pack(push,1) //============================================================================ // Connect packet @@ -179,5 +179,6 @@ void SimpleNetSend ( SimpleNetConn * conn, SimpleNet_MsgHeader * msg ); +#pragma pack(pop) #endif // PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNSIMPLENET_PNSIMPLENET_H From 1f0547279c8d84718b76669fd5b69342e20795fd Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 28 Jan 2012 18:12:24 -0800 Subject: [PATCH 14/51] Fixes for plInputManager and plResponderModifier. --- .../NucleusLib/pnInputCore/plControlDefinition.h | 8 ++++---- .../PubUtilLib/plInputCore/plInputManager.cpp | 10 ++++++---- .../Plasma/PubUtilLib/plInputCore/plInputManager.h | 13 ++++++++----- .../plInputCore/plSceneInputInterface.cpp | 12 ++++++------ .../PubUtilLib/plInputCore/plSceneInputInterface.h | 4 ++-- .../PubUtilLib/plModifier/plResponderModifier.cpp | 2 +- 6 files changed, 27 insertions(+), 22 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h b/Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h index 7f046db8..f9be1cbb 100644 --- a/Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h +++ b/Sources/Plasma/NucleusLib/pnInputCore/plControlDefinition.h @@ -125,14 +125,14 @@ struct CommandConvert struct plMouseInfo { - plMouseInfo(ControlEventCode _code, uint32_t _flags, hsPoint4 _box, char* _desc) + plMouseInfo(ControlEventCode _code, uint32_t _flags, hsPoint4 _box, const char* _desc) { fCode = _code; fControlFlags = _flags; fBox = _box; fControlDescription = _desc; } - plMouseInfo(ControlEventCode _code, uint32_t _flags, float pt1, float pt2, float pt3, float pt4, char* _desc) + plMouseInfo(ControlEventCode _code, uint32_t _flags, float pt1, float pt2, float pt3, float pt4, const char* _desc) { fCode = _code; fControlFlags = _flags; @@ -140,9 +140,9 @@ struct plMouseInfo fControlDescription = _desc; } ControlEventCode fCode; - uint32_t fControlFlags; + uint32_t fControlFlags; hsPoint4 fBox; - char* fControlDescription; + const char* fControlDescription; }; diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp index 35145eaa..e6af2ab9 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp +++ b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp @@ -117,7 +117,7 @@ typedef int (__stdcall * Pfunc1) (const DIDEVICEINSTANCE* device, void* pRef); plInputManager* plInputManager::fInstance = nil; -plInputManager::plInputManager( HWND hWnd ) : +plInputManager::plInputManager( hsWindowHndl hWnd ) : fDInputMgr(nil), fInterfaceMgr(nil) { @@ -178,7 +178,7 @@ void plInputManager::CreateInterfaceMod(plPipeline* p) fInterfaceMgr->Init(); } -void plInputManager::InitDInput(HINSTANCE hInst, HWND hWnd) +void plInputManager::InitDInput(hsWindowInst hInst, hsWindowHndl hWnd) { if (fUseDInput) { @@ -259,8 +259,9 @@ plKeyDef plInputManager::UntranslateKey(plKeyDef key, hsBool extended) return key; } - -void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM Lparam, HWND hWnd) + +#if HS_BUILD_FOR_WIN32 +void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM Lparam, hsWindowHndl hWnd) { if( !fhWnd ) fhWnd = hWnd; @@ -431,6 +432,7 @@ void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM } } +#endif //// Activate //////////////////////////////////////////////////////////////// // Handles what happens when the app (window) activates/deactivates diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h index 3ebde4e4..d7c701a7 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h +++ b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.h @@ -62,7 +62,7 @@ private: static hsBool fUseDInput; public: plInputManager(); - plInputManager( HWND hWnd ); + plInputManager( hsWindowHndl hWnd ); ~plInputManager(); CLASSNAME_REGISTER( plInputManager ); @@ -70,7 +70,7 @@ public: void AddInputDevice(plInputDevice* pDev); - void InitDInput(HINSTANCE hInst, HWND hWnd); + void InitDInput(hsWindowInst hInst, hsWindowHndl hWnd); static void UseDInput(hsBool b) { fUseDInput = b; } void Update(); @@ -97,16 +97,19 @@ protected: bool fActive, fFirstActivated; float fMouseScale; - static uint8_t bRecenterMouse; - static HWND fhWnd; + static uint8_t bRecenterMouse; + static hsWindowHndl fhWnd; public: +#if HS_BUILD_FOR_WIN32 // event handlers void HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM Lparam, HWND hWnd); +#endif }; - +#if HS_BUILD_FOR_WIN32 // {049DE53E-23A2-4d43-BF68-36AC1B57E357} static const GUID PL_ACTION_GUID = { 0x49de53e, 0x23a2, 0x4d43, { 0xbf, 0x68, 0x36, 0xac, 0x1b, 0x57, 0xe3, 0x57 } }; +#endif #endif diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp index 25605709..d81487be 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp +++ b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp @@ -109,7 +109,7 @@ plSceneInputInterface::plSceneInputInterface() { fPipe = nil; fSpawnPoint = nil; - GuidClear(&fAgeInstanceGuid); + fAgeInstanceGuid.Clear(); fInstance = this; SetEnabled( true ); // Always enabled } @@ -790,7 +790,7 @@ hsBool plSceneInputInterface::MsgReceive( plMessage *msg ) } else if ( mgrMsg->GetCommand() == plInputIfaceMgrMsg::kSetShareAgeInstanceGuid ) { - fAgeInstanceGuid = mgrMsg->GetAgeInstanceGuid(); + fAgeInstanceGuid = plUUID(mgrMsg->GetAgeInstanceGuid()); } } plVaultNotifyMsg* pVaultMsg = plVaultNotifyMsg::ConvertNoRef(msg); @@ -817,15 +817,15 @@ void plSceneInputInterface::ILinkOffereeToAge() info.SetAgeFilename(fOfferedAgeFile); info.SetAgeInstanceName(fOfferedAgeInstance); - bool isAgeInstanceGuidSet = !GuidIsNil(fAgeInstanceGuid); + bool isAgeInstanceGuidSet = fAgeInstanceGuid.IsSet(); plAgeLinkStruct link; if (isAgeInstanceGuidSet) { - info.SetAgeInstanceGuid(&plUUID(fAgeInstanceGuid)); + info.SetAgeInstanceGuid(&fAgeInstanceGuid); link.GetAgeInfo()->CopyFrom(&info); - GuidClear(&fAgeInstanceGuid); + fAgeInstanceGuid.Clear(); } else if (!VaultGetOwnedAgeLink(&info, &link)) { @@ -1236,4 +1236,4 @@ uint32_t plSceneInputInterface::SetCurrentCursorID(uint32_t id) void plSceneInputInterface::RequestAvatarTurnToPointLOS() { IRequestLOSCheck( plMouseDevice::Instance()->GetCursorX(), plMouseDevice::Instance()->GetCursorY(), ID_FIND_WALKABLE_GROUND ); -} \ No newline at end of file +} diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h index 77ae0488..02a0fd2f 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h +++ b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.h @@ -51,7 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plInputInterface.h" #include "hsGeometry3.h" #include "pnKeyedObject/plKey.h" -#include "pnUtils/pnUtils.h" +#include "pnUUID/pnUUID.h" //// Class Definition //////////////////////////////////////////////////////// @@ -86,7 +86,7 @@ class plSceneInputInterface : public plInputInterface const char* fOfferedAgeFile; const char* fOfferedAgeInstance; const char* fSpawnPoint; - Uuid fAgeInstanceGuid; + plUUID fAgeInstanceGuid; struct clickableTest { clickableTest(plKey k) diff --git a/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp b/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp index 3bcd21f0..03fbca95 100644 --- a/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp +++ b/Sources/Plasma/PubUtilLib/plModifier/plResponderModifier.cpp @@ -788,7 +788,7 @@ void plResponderModifier::ILog(uint32_t color, const char* format, ...) char buf[256]; va_list args; va_start(args, format); - int numWritten = _vsnprintf(buf, sizeof(buf), format, args); + int numWritten = hsVsnprintf(buf, sizeof(buf), format, args); hsAssert(numWritten > 0, "Buffer too small"); va_end(args); From 5593212a265ed8024da395081bd14185d0e0f64a Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 00:44:52 -0800 Subject: [PATCH 15/51] Fix plNetClientComm compilation. --- .../plNetClientComm/plNetClientComm.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp index 8cc3e22a..1684c5d0 100644 --- a/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClientComm/plNetClientComm.cpp @@ -485,7 +485,7 @@ static void INetCliAuthDeletePlayerCallback ( ENetError result, void * param ) { - unsigned playerInt = (unsigned)param; + uint32_t playerInt = (uint32_t)((uintptr_t)param); if (IS_NET_ERROR(result)) { LogMsg(kLogDebug, L"Delete player failed: %d %s", playerInt, NetErrorToString(result)); @@ -493,16 +493,16 @@ static void INetCliAuthDeletePlayerCallback ( else { LogMsg(kLogDebug, L"Player deleted: %d", playerInt); - unsigned currPlayer = s_player ? s_player->playerInt : 0; + uint32_t currPlayer = s_player ? s_player->playerInt : 0; - {for (unsigned i = 0; i < s_players.Count(); ++i) { + {for (uint32_t i = 0; i < s_players.Count(); ++i) { if (s_players[i].playerInt == playerInt) { s_players.DeleteUnordered(i); break; } }} - {for (unsigned i = 0; i < s_players.Count(); ++i) { + {for (uint32_t i = 0; i < s_players.Count(); ++i) { if (s_players[i].playerInt == currPlayer) { s_player = &s_players[i]; break; @@ -512,7 +512,7 @@ static void INetCliAuthDeletePlayerCallback ( plAccountUpdateMsg* updateMsg = new plAccountUpdateMsg(plAccountUpdateMsg::kDeletePlayer); updateMsg->SetPlayerInt(playerInt); - updateMsg->SetResult((unsigned)result); + updateMsg->SetResult((uint32_t)result); updateMsg->SetBCastFlag(plMessage::kBCastByExactType); updateMsg->Send(); } @@ -638,7 +638,7 @@ static void INetCliAuthUpgradeVisitorRequestCallback ( ENetError result, void * param ) { - unsigned playerInt = (unsigned)param; + uint32_t playerInt = (uint32_t)((uintptr_t)param); if (IS_NET_ERROR(result)) { LogMsg(kLogDebug, L"Upgrade visitor failed: %d %s", playerInt, NetErrorToString(result)); @@ -646,7 +646,7 @@ static void INetCliAuthUpgradeVisitorRequestCallback ( else { LogMsg(kLogDebug, L"Upgrade visitor succeeded: %d", playerInt); - {for (unsigned i = 0; i < s_players.Count(); ++i) { + {for (uint32_t i = 0; i < s_players.Count(); ++i) { if (s_players[i].playerInt == playerInt) { s_players[i].explorer = true; break; @@ -656,7 +656,7 @@ static void INetCliAuthUpgradeVisitorRequestCallback ( plAccountUpdateMsg* updateMsg = new plAccountUpdateMsg(plAccountUpdateMsg::kUpgradePlayer); updateMsg->SetPlayerInt(playerInt); - updateMsg->SetResult((unsigned)result); + updateMsg->SetResult((uint32_t)result); updateMsg->SetBCastFlag(plMessage::kBCastByExactType); updateMsg->Send(); } From d8ce2aa302d1ab9ce81cec62a1ea9b70a3077347 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 00:45:12 -0800 Subject: [PATCH 16/51] Fix pfCamera compilation. --- Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp | 4 ++-- Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp b/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp index bec4f890..2809a8ea 100644 --- a/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp +++ b/Sources/Plasma/FeatureLib/pfCamera/plCameraBrain.cpp @@ -977,7 +977,7 @@ plCameraBrain1_Avatar::~plCameraBrain1_Avatar() pMsg->SetFadeOut(false); pMsg->SetSubjectKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); pMsg->SetBCastFlag(plMessage::kBCastByExactType); - pMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); + pMsg->SetBCastFlag(plMessage::kNetPropagate, false); pMsg->AddReceiver(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); plgDispatch::MsgSend(pMsg); } @@ -1152,7 +1152,7 @@ void plCameraBrain1_Avatar::ISendFadeMsg(hsBool fade) pMsg->SetFadeOut(fade); pMsg->SetSubjectKey(GetSubject()->GetKey()); pMsg->SetBCastFlag(plMessage::kBCastByExactType); - pMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); + pMsg->SetBCastFlag(plMessage::kNetPropagate, false); pMsg->AddReceiver(GetSubject()->GetKey()); plgDispatch::MsgSend(pMsg); } diff --git a/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp b/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp index 91f271a7..f7ea6769 100644 --- a/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp +++ b/Sources/Plasma/FeatureLib/pfCamera/plVirtualCamNeu.cpp @@ -189,7 +189,7 @@ plVirtualCam1::plVirtualCam1() wchar_t fileAndPath[MAX_PATH]; PathGetLogDirectory(fileAndPath, arrsize(fileAndPath)); PathAddFilename(fileAndPath, fileAndPath, L"camLog.txt", arrsize(fileAndPath)); - foutLog = _wfopen( fileAndPath, L"wt" ); + foutLog = hsWFopen( fileAndPath, L"wt" ); } #endif @@ -1306,7 +1306,7 @@ hsBool plVirtualCam1::MsgReceive(plMessage* msg) pMsg->SetFadeOut(true); pMsg->SetSubjectKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); pMsg->SetBCastFlag(plMessage::kBCastByExactType); - pMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); + pMsg->SetBCastFlag(plMessage::kNetPropagate, false); pMsg->AddReceiver(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); plgDispatch::MsgSend(pMsg); return true; From 668034fd71180add1c0ea084f01dbd6c593fa889 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 00:52:53 -0800 Subject: [PATCH 17/51] Fix plGLight. --- Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp | 2 +- Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp b/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp index 52476bf5..1010458f 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp @@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -#ifndef isnan +#ifdef _MSC_VER #define isnan _isnan #endif diff --git a/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp b/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp index f98f93d1..266b56da 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp @@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -#ifndef isnan +#ifdef _MSC_VER #define isnan _isnan #endif From ad4ff5c26204326c7145ae14576736abd40f321b Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 00:53:11 -0800 Subject: [PATCH 18/51] Fix plNetTransport. Someone should check if we actually need the HS_BUILD_FOR_UNIX check or whether we can just include float.h in VS. --- Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp b/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp index 9fdbfaa9..e9b3bdf2 100644 --- a/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp +++ b/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp @@ -48,6 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetClient/plNetClientMgr.h" #include +#if HS_BUILD_FOR_UNIX +#include +#endif + plNetTransport::~plNetTransport() { ClearMembers(); From 908ab6d6326cefbd01ebe30a90fd147381f35919 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 01:44:23 -0800 Subject: [PATCH 19/51] Fix pnUtilsExe. --- Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h | 2 -- Sources/Plasma/NucleusLib/pnUtilsExe/Private/pnUteTls.cpp | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h index 8e167f45..96305333 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtAllIncludes.h @@ -61,9 +61,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnUtPriQ.h" #include "pnUtSync.h" #include "pnUtTime.h" -#if HS_BUILD_FOR_WIN32 #include "pnUtTls.h" -#endif #include "pnUtStr.h" #include "pnUtRef.h" #include "pnUtPath.h" diff --git a/Sources/Plasma/NucleusLib/pnUtilsExe/Private/pnUteTls.cpp b/Sources/Plasma/NucleusLib/pnUtilsExe/Private/pnUteTls.cpp index a2354b39..4001806b 100644 --- a/Sources/Plasma/NucleusLib/pnUtilsExe/Private/pnUteTls.cpp +++ b/Sources/Plasma/NucleusLib/pnUtilsExe/Private/pnUteTls.cpp @@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "../Pch.h" #pragma hdrstop +#if HS_BUILD_FOR_WIN32 /***************************************************************************** * @@ -105,3 +106,5 @@ void ThreadAssertCanBlock (const char file[], int line) { if (ThreadLocalGetValue(s_tlsNoBlock)) ErrorAssert(line, file, "This thread may not block"); } + +#endif From b1fb2e6dd0d98e826a17f88fdf830d02494347b7 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 01:44:40 -0800 Subject: [PATCH 20/51] Fix pnIniCore. --- Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp b/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp index bf969711..b958cd2c 100644 --- a/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp +++ b/Sources/Plasma/NucleusLib/pnIni/Private/pnIniCore.cpp @@ -295,7 +295,7 @@ static void ParseBuffer ( } if (chr == SECTION_CLOSE_CHAR) { - StrCopy(dst, start, min(buffer - start + 1, arrsize(dst))); + StrCopy(dst, start, min((unsigned long)(buffer - start + 1), arrsize(dst))); section = AddSection(ini, dst); state = STATE_STRIP_TRAILING; } @@ -319,7 +319,7 @@ static void ParseBuffer ( break; } - StrCopy(dst, start, min(buffer - start + 1, arrsize(dst))); + StrCopy(dst, start, min((unsigned long)(buffer - start + 1), arrsize(dst))); value = AddKeyValue(section, dst, lineNum); start = buffer + 1; state = STATE_VALUE; @@ -340,7 +340,7 @@ static void ParseBuffer ( break; } - StrCopy(dst, start, min(buffer - start + 1, arrsize(dst))); + StrCopy(dst, start, min((unsigned long)(buffer - start + 1), arrsize(dst))); AddValueString(value, dst); if (chr == VALUE_SEPARATOR) start = buffer + 1; @@ -352,7 +352,7 @@ static void ParseBuffer ( // cleanup current value if (state == STATE_VALUE) { - StrCopy(dst, start, min(buffer - start + 1, arrsize(dst))); + StrCopy(dst, start, min((unsigned long)(buffer - start + 1), arrsize(dst))); AddValueString(value, dst); } } From 745378f9be37d3825f8854bbf35c6013cfa3a79a Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 01:46:06 -0800 Subject: [PATCH 21/51] Fix plAvatar. --- Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp | 10 +++++----- Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp | 2 +- .../Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp | 4 ++-- Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp | 2 +- .../Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp | 8 ++++---- .../Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h | 2 +- Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp | 3 ++- .../Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp | 2 +- Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp | 2 +- .../Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h | 2 +- .../PubUtilLib/plAvatar/plPhysicalControllerCore.cpp | 4 ++-- Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h | 2 +- Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h | 4 ++-- Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp | 6 ++++-- 14 files changed, 28 insertions(+), 25 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp index 30e6393f..7d18dcf8 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp @@ -438,9 +438,9 @@ void plArmatureModBase::AdjustLOD() hsPoint3 delta = ourPos - camPos; float distanceSquared = delta.MagnitudeSquared(); if (distanceSquared < fLODDistance * fLODDistance) - SetLOD(__max(0, fMinLOD)); + SetLOD(max(0, fMinLOD)); else if (distanceSquared < fLODDistance * fLODDistance * 4.0) - SetLOD(__max(1, fMinLOD)); + SetLOD(max(1, fMinLOD)); else SetLOD(2); } @@ -1102,7 +1102,7 @@ hsBool plArmatureMod::MsgReceive(plMessage* msg) plCorrectionMsg *corMsg = plCorrectionMsg::ConvertNoRef(msg); if (corMsg) { - hsMatrix44 &correction = corMsg->fWorldToLocal * GetTarget(0)->GetLocalToWorld(); + hsMatrix44 correction = corMsg->fWorldToLocal * GetTarget(0)->GetLocalToWorld(); if (fBoneRootAnimator) fBoneRootAnimator->SetCorrection(correction); } @@ -2678,14 +2678,14 @@ void plArmatureMod::DumpToDebugDisplay(int &x, int &y, int lineHeight, char *str hsMatrix44 l2w = SO->GetLocalToWorld(); hsPoint3 worldPos = l2w.GetTranslate(); - char *opaque = IsOpaque() ? "yes" : "no"; + const char *opaque = IsOpaque() ? "yes" : "no"; sprintf(strBuf, "position(world): %.2f, %.2f, %.2f Opaque: %3s", worldPos.fX, worldPos.fY, worldPos.fZ, opaque); debugTxt.DrawString(x, y, strBuf); y += lineHeight; hsPoint3 kPos; - char *kinematic = "n.a."; + const char *kinematic = "n.a."; const char* frozen = "n.a."; if (fController) { diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp index cf6a7ff1..709ebc58 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBehaviors.cpp @@ -104,7 +104,7 @@ void plArmatureBehavior::DumpDebug(int &x, int &y, int lineHeight, char *strBuf, float strength = GetStrength(); const char *onOff = strength > 0 ? "on" : "off"; char blendBar[11] = "||||||||||"; - int bars = (int)__min(10 * strength, 10); + int bars = (int)min(10 * strength, 10); blendBar[bars] = '\0'; if (fAnim) diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp index 88003c14..465515aa 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainCritter.cpp @@ -330,8 +330,8 @@ void plAvBrainCritter::SightCone(float coneRad) fSightConeAngle = coneRad; // calculate the minimum dot product for the cone of sight (angle/2 vector dotted with straight ahead) - hsVector3 straightVector(1, 0, 0), viewVector(1, 0, 0); - hsQuat rotation(fSightConeAngle/2, &hsVector3(0, 1, 0)); + hsVector3 straightVector(1, 0, 0), viewVector(1, 0, 0), up(0, 1, 0); + hsQuat rotation(fSightConeAngle/2, &up); viewVector = hsVector3(rotation.Rotate(&viewVector)); viewVector.Normalize(); fSightConeDotMin = straightVector * viewVector; diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp index 884a0f68..59ab447b 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp @@ -183,7 +183,7 @@ public: // hsAssert(0, "fixme physx"); float oldSpeed = fabs(fSwimBrain->fCallbackAction->GetTurnStrength()); float thisInc = elapsed * incPerSec; - float newSpeed = __min(oldSpeed + thisInc, maxTurnSpeed); + float newSpeed = min(oldSpeed + thisInc, maxTurnSpeed); fSwimBrain->fCallbackAction->SetTurnStrength(newSpeed * fAvMod->GetKeyTurnStrength() + fAvMod->GetAnalogTurnStrength()); // the turn is actually applied during PhysicsUpdate } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp index 946721a2..c59b5f4f 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvCallbackAction.cpp @@ -48,9 +48,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plPhysicalControllerCore.h" // Generic geom utils. -hsBool LinearVelocity(hsVector3 &outputV, float elapsed, hsMatrix44 &prevMat, hsMatrix44 &curMat); -void AngularVelocity(float &outputV, float elapsed, hsMatrix44 &prevMat, hsMatrix44 &curMat); -float AngleRad2d (float x1, float y1, float x3, float y3); +static hsBool LinearVelocity(hsVector3 &outputV, float elapsed, hsMatrix44 &prevMat, hsMatrix44 &curMat); +static void AngularVelocity(float &outputV, float elapsed, hsMatrix44 &prevMat, hsMatrix44 &curMat); +static float AngleRad2d (float x1, float y1, float x3, float y3); inline hsVector3 GetYAxis(hsMatrix44 &mat) { return hsVector3(mat.fMap[1][0], mat.fMap[1][1], mat.fMap[1][2]); @@ -195,7 +195,7 @@ bool plWalkingController::EnableControlledFlight(bool status) fWaitingForGround = true; } else - fControlledFlight = __max(--fControlledFlight, 0); + fControlledFlight = max(--fControlledFlight, 0); return status; } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h b/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h index b63cfbf7..42a710fa 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvLadderModifier.h @@ -100,4 +100,4 @@ protected: // Don't try to trigger during this time. }; -#endif plAvLadderMod_INC +#endif //plAvLadderMod_INC diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp index a720ab14..4f1a8166 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvTaskSeek.cpp @@ -314,7 +314,8 @@ void plAvTaskSeek::LeaveAge(plArmatureMod *avatar) hsBool plAvTaskSeek::IAnalyze(plArmatureMod *avatar) { avatar->GetPositionAndRotationSim(&fPosition, &fRotation); - fGoalVec.Set(&(hsScalarTriple)(fSeekPos - fPosition)); + hsScalarTriple tmp(fSeekPos - fPosition); + fGoalVec.Set(&tmp); hsVector3 normalizedGoalVec(fGoalVec); normalizedGoalVec.Normalize(); diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp index 5c497296..2e6dc9c3 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp @@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsTemplates.h" #include "hsStream.h" #include "hsResMgr.h" -#include "plGDispatch.h" +#include "plgDispatch.h" #include "pnKeyedObject/plKey.h" #include "pnKeyedObject/plFixedKey.h" #include "pnSceneObject/plSceneObject.h" diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp index d961f5c1..4c5f6617 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plAvatarMgr.cpp @@ -636,7 +636,7 @@ void plAvatarMgr::RemoveOneShot(plOneShotMod *oneshot) if(oneshot == thisOneshot) { - i = fOneShots.erase(i); + fOneShots.erase(i); // destroy our copy of the target name delete[] name; } else { diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h b/Sources/Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h index 551af57c..38a0cd29 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plClothingSDLModifier.h @@ -99,7 +99,7 @@ public: static void HandleSingleSDR(const plStateDataRecord *sdr, plClothingOutfit *clothing = nil, plClosetItem *closetItem = nil); static void PutSingleItemIntoSDR(plClosetItem *item, plStateDataRecord *sdr); - static const plClothingSDLModifier *plClothingSDLModifier::FindClothingSDLModifier(const plSceneObject *obj); + static const plClothingSDLModifier *FindClothingSDLModifier(const plSceneObject *obj); }; #endif // plClothingSDLModifier_inc diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp index 8fcbc8c7..f43af2ec 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plPhysicalControllerCore.cpp @@ -48,8 +48,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plArmatureMod.h" // for LOS enum type #include "plMatrixChannel.h" #include "hsTimer.h" -#include "plPhysx/plSimulationMgr.h" -#include "plPhysx/plPXPhysical.h" +#include "plPhysX/plSimulationMgr.h" +#include "plPhysX/plPXPhysical.h" #include "pnMessage/plSetNetGroupIDMsg.h" #define kSWIMRADIUS 1.1f #define kSWIMHEIGHT 2.8f diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h b/Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h index ddc2f21a..13cecd34 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plPointChannel.h @@ -158,7 +158,7 @@ public: plPointBlend(plPointChannel *channelA, plPointChannel *channelB, plScalarChannel *channelBias); virtual ~plPointBlend(); - plAGChannel * plPointBlend::Remove(plAGChannel *srceToRemove); + plAGChannel * Remove(plAGChannel *srceToRemove); const plPointChannel * GetPointChannelA() const { return fPointA; } void SetPointChannelA(plPointChannel *the_PointA) { fPointA = the_PointA; } diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h b/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h index ff6c66a5..e99c417a 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h +++ b/Sources/Plasma/PubUtilLib/plAvatar/plSittingModifier.h @@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ///////////////////////////////////////////////////////////////////////////////////////// #include "pnModifier/plSingleModifier.h" // base class -#include "pnKeyedobject/plKey.h" // for the notification keys +#include "pnKeyedObject/plKey.h" // for the notification keys #include "hsTemplates.h" // for the array they're kept in ///////////////////////////////////////////////////////////////////////////////////////// @@ -125,4 +125,4 @@ protected: -#endif plSittingModifier_inc +#endif //plSittingModifier_inc diff --git a/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp b/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp index 30dd34df..0b174439 100644 --- a/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp +++ b/Sources/Plasma/PubUtilLib/plAvatar/plSwimRegion.cpp @@ -136,7 +136,8 @@ void plSwimCircularCurrentRegion::GetCurrent(plPhysicalControllerCore *physical, } hsPoint3 center, pos; - center.Set(&fCurrentSO->GetLocalToWorld().GetTranslate()); + hsScalarTriple xlate = fCurrentSO->GetLocalToWorld().GetTranslate(); + center.Set(&xlate); plKey worldKey = physical->GetSubworld(); if (worldKey) @@ -254,7 +255,8 @@ void plSwimStraightCurrentRegion::GetCurrent(plPhysicalControllerCore *physical, hsPoint3 center, pos; hsVector3 current = fCurrentSO->GetLocalToWorld() * hsVector3(0.f, 1.f, 0.f); - center.Set(&fCurrentSO->GetLocalToWorld().GetTranslate()); + hsScalarTriple xlate = fCurrentSO->GetLocalToWorld().GetTranslate(); + center.Set(&xlate); physical->GetPositionSim(pos); plKey worldKey = physical->GetSubworld(); From e7319c8ab29f33d7d66b6be8310f9faa59182cf8 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 01:46:26 -0800 Subject: [PATCH 22/51] Fix plNetClient. --- .../PubUtilLib/plNetClient/plNetClientMgr.cpp | 5 +++-- .../plNetClient/plNetClientMgrSend.cpp | 3 ++- .../plNetClient/plNetClientMgrVoice.cpp | 1 + .../plNetClient/plNetClientMsgHandler.cpp | 4 ++-- .../PubUtilLib/plNetClient/plNetLinkingMgr.cpp | 16 ++++++++++------ .../plNetCommon/plNetServerSessionInfo.cpp | 3 ++- 6 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp index 2bd48065..bc00775f 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp @@ -461,7 +461,8 @@ void plNetClientMgr::StartLinkInFX() plLinkEffectsTriggerMsg* lem = new plLinkEffectsTriggerMsg(); lem->SetLeavingAge(false); // linking in lem->SetLinkKey(fLocalPlayerKey); - lem->SetLinkInAnimKey(avMod->GetLinkInAnimKey()); + plKey animKey = avMod->GetLinkInAnimKey(); + lem->SetLinkInAnimKey(animKey); // indicate if we are invisible if (avMod && avMod->IsInStealthMode() && avMod->GetTarget(0)) @@ -1287,7 +1288,7 @@ void plNetClientMgr::QueueDisableNet (bool showDlg, const char str[]) { msg->Ref(); fDisableMsg = msg; IDisableNet(); -#endif; +#endif } void plNetClientMgr::IDisableNet () { diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp index f9950354..10164592 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp @@ -163,7 +163,8 @@ void plNetClientMgr::ISendCCRPetition(plCCRPetitionMsg* petMsg) // write config info formatted like an ini file to a buffer hsRAMStream ram; - info.WriteTo( &plIniStreamConfigSource( &ram ) ); + plIniStreamConfigSource src(&ram); + info.WriteTo(&src); int size = ram.GetPosition(); ram.Rewind(); std::string buf; diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp index c4f1fffc..af7880e9 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrVoice.cpp @@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include +#include #include "hsMatrix44.h" #include "hsGeometry3.h" #include "plNetClientMgr.h" diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp index 2420ec2f..979d9f85 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetClientMsgHandler.cpp @@ -402,8 +402,8 @@ MSG_HANDLER_DEFN(plNetClientMsgHandler,plNetMsgVoice) int bufLen = m->GetVoiceDataLen(); const char* buf = m->GetVoiceData(); - BYTE flags = m->GetFlags(); - BYTE numFrames = m->GetNumFrames(); + uint8_t flags = m->GetFlags(); + uint8_t numFrames = m->GetNumFrames(); plKey key = NULL; // plKey key=hsgResMgr::ResMgr()->FindKey(m->ObjectInfo()->GetUoid()); diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp index ea092f92..7d9bfe74 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp @@ -912,8 +912,10 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) //-------------------------------------------------------------------- // BASIC LINK. Link to a unique instance of the age, if no instance specified. case plNetCommon::LinkingRules::kBasicLink: - if (!info->HasAgeInstanceGuid()) - info->SetAgeInstanceGuid(&plUUID(GuidGenerate())); + if (!info->HasAgeInstanceGuid()) { + plUUID newuuid(GuidGenerate()); + info->SetAgeInstanceGuid(&newuuid); + } break; //-------------------------------------------------------------------- @@ -952,7 +954,8 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) info->SetAgeDescription(desc.c_str()); } if (!info->HasAgeInstanceGuid()) { - info->SetAgeInstanceGuid(&plUUID(GuidGenerate())); + plUUID newuuid(GuidGenerate()); + info->SetAgeInstanceGuid(&newuuid); } // register this as an owned age now before we link to it. @@ -992,7 +995,8 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) } if (!info->HasAgeInstanceGuid()) { - info->SetAgeInstanceGuid(&plUUID(GuidGenerate())); + plUUID newuuid(GuidGenerate()); + info->SetAgeInstanceGuid(&newuuid); } VaultRegisterOwnedAge(link); @@ -1078,10 +1082,10 @@ uint8_t plNetLinkingMgr::IPreProcessLink(void) case hsFail: success = kLinkFailed; break; - case FALSE: + case false: success = kLinkDeferred; break; - case TRUE: + case true: success = kLinkImmediately; } diff --git a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp index 3df7e2f1..4004ccc3 100644 --- a/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp +++ b/Sources/Plasma/PubUtilLib/plNetCommon/plNetServerSessionInfo.cpp @@ -171,7 +171,8 @@ void plAgeInfoStruct::CopyFrom(const NetAgeInfo & info) { StrToAnsi(tmp, info.ageDesc, arrsize(tmp)); SetAgeDescription(tmp); - SetAgeInstanceGuid(&plUUID(info.ageInstId)); + plUUID inst(info.ageInstId); + SetAgeInstanceGuid(&inst); SetAgeSequenceNumber(info.ageSequenceNumber); SetAgeLanguage(info.ageLanguage); } From 75a3701f3e0267d650cce3577b76defe5c47dd40 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 02:01:19 -0800 Subject: [PATCH 23/51] Fix pfJournalBook. --- .../pfJournalBook/pfJournalBook.cpp | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp b/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp index a0ec74b8..6f4872be 100644 --- a/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp +++ b/Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp @@ -1841,7 +1841,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & } else if( lastParChunk != nil ) { - uint32_t count = ((uint32_t)c - (uint32_t)start)/2; // wchar_t is 2 bytes + uint32_t count = ((uintptr_t)c - (uintptr_t)start)/2; // wchar_t is 2 bytes wchar_t *temp = new wchar_t[ count + 1 ]; wcsncpy( temp, start, count ); @@ -1901,7 +1901,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & } else if( wcsicmp( name, L"link" ) == 0 ) { - chunk->fEventID = _wtoi( option ); + chunk->fEventID = wcstol(option, NULL, 0); chunk->fFlags |= pfEsHTMLChunk::kCanLink; } else if( wcsicmp( name, L"blend" ) == 0 ) @@ -1917,10 +1917,10 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & if( comma != nil ) { - chunk->fAbsoluteY = _wtoi( comma + 1 ); + chunk->fAbsoluteY = wcstol(comma + 1, NULL, 0); *comma = 0; } - chunk->fAbsoluteX = _wtoi( option ); + chunk->fAbsoluteX = wcstol(option, NULL, 0); } else if( wcsicmp( name, L"glow" ) == 0 ) { @@ -1961,7 +1961,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & wchar_t *comma2 = wcschr( comma + 1, L',' ); if( comma2 != nil ) { - if( _wtoi( comma2 + 1 ) != 0 ) + if( wcstol(comma2 + 1, NULL, 0) != 0 ) chunk->fFlags |= pfEsHTMLChunk::kChecked; *comma2 = 0; } @@ -2089,7 +2089,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & } else if( wcsicmp( name, L"size" ) == 0 ) { - chunk->fFontSize = _wtoi( option ); + chunk->fFontSize = wcstol(option, NULL, 0); if (fBookGUIs[fCurBookGUI]->IsEditable()) { fBookGUIs[fCurBookGUI]->GetEditCtrl(pfJournalDlgProc::kTagRightEditCtrl)->SetFontSize(chunk->fFontSize); @@ -2112,7 +2112,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & } else if( wcsicmp( name, L"spacing" ) == 0 ) { - chunk->fLineSpacing = _wtoi(option); + chunk->fLineSpacing = wcstol(option, NULL, 0); chunk->fFlags |= pfEsHTMLChunk::kFontSpacing; } } @@ -2127,13 +2127,13 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & while(IGetNextOption(c,name,option)) { if (wcsicmp(name,L"top") == 0) - fPageTMargin = _wtoi(option); + fPageTMargin = wcstol(option, NULL, 0); else if (wcsicmp(name,L"left") == 0) - fPageLMargin = _wtoi(option); + fPageLMargin = wcstol(option, NULL, 0); else if (wcsicmp(name,L"bottom") == 0) - fPageBMargin = _wtoi(option); + fPageBMargin = wcstol(option, NULL, 0); else if (wcsicmp(name,L"right") == 0) - fPageRMargin = _wtoi(option); + fPageRMargin = wcstol(option, NULL, 0); } // set the edit controls to the margins we just set if (fBookGUIs[fCurBookGUI]->IsEditable()) @@ -2203,10 +2203,10 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & if( comma != nil ) { - chunk->fAbsoluteY = _wtoi( comma + 1 ); + chunk->fAbsoluteY = wcstol(comma + 1, NULL, 0); *comma = 0; } - chunk->fAbsoluteX = _wtoi( option ); + chunk->fAbsoluteX = wcstol(option, NULL, 0); } else if (wcsicmp(name,L"resize")==0) { @@ -2251,7 +2251,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & } else if( wcsicmp( name, L"link" ) == 0 ) { - chunk->fEventID = _wtoi( option ); + chunk->fEventID = wcstol(option, NULL, 0); chunk->fFlags |= pfEsHTMLChunk::kCanLink; } else if( wcsicmp( name, L"pos" ) == 0 ) @@ -2262,10 +2262,10 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & if( comma != nil ) { - chunk->fAbsoluteY = _wtoi( comma + 1 ); + chunk->fAbsoluteY = wcstol(comma + 1, NULL, 0); *comma = 0; } - chunk->fAbsoluteX = _wtoi( option ); + chunk->fAbsoluteX = wcstol(option, NULL, 0); } else if (wcsicmp(name,L"resize")==0) { @@ -2336,7 +2336,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation & } else if( lastParChunk != nil ) { - uint32_t count = (uint32_t)c - (uint32_t)start; + uint32_t count = (uintptr_t)c - (uintptr_t)start; wchar_t *temp = new wchar_t[ count + 1 ]; wcsncpy( temp, start, count + 1 ); @@ -2422,7 +2422,7 @@ hsBool pfJournalBook::IGetNextOption( const wchar_t *&string, wchar_t *name, wc return false; // Copy name - uint32_t len = ((uint32_t)string - (uint32_t)c)/2; // divide length by 2 because each character is two bytes + uint32_t len = ((uintptr_t)string - (uintptr_t)c)/2; // divide length by 2 because each character is two bytes wcsncpy( name, c, len ); name[len] = L'\0'; @@ -2442,7 +2442,7 @@ hsBool pfJournalBook::IGetNextOption( const wchar_t *&string, wchar_t *name, wc while( *string != L'>' && *string != L'\"' && *string != L'\0' ) string++; - len = ((uint32_t)string - (uint32_t)c)/2; // divide length by 2 because each character is two bytes + len = ((uintptr_t)string - (uintptr_t)c)/2; // divide length by 2 because each character is two bytes wcsncpy( option, c, len ); option[len] = L'\0'; @@ -2457,7 +2457,7 @@ hsBool pfJournalBook::IGetNextOption( const wchar_t *&string, wchar_t *name, wc while( *string != L' ' && *string != L'>' && *string != L'\0' ) string++; - len = ((uint32_t)string - (uint32_t)c)/2; // divide length by 2 because each character is two bytes + len = ((uintptr_t)string - (uintptr_t)c)/2; // divide length by 2 because each character is two bytes wcsncpy( option, c, len ); option[len] = L'\0'; From eeaae57cc3472354b66873159afb8139f255089a Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 29 Jan 2012 16:47:02 -0500 Subject: [PATCH 24/51] Be less anal--use PyNumber instead of PyLong --- Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp index f2dd94bd..517c43e7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyPlayerGlue.cpp @@ -77,24 +77,24 @@ PYTHON_INIT_DEFINITION(ptPlayer, args, keywords) PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); PYTHON_RETURN_INIT_ERROR; } - if (!(PyLong_Check(thirdObj) && PyFloat_Check(fourthObj))) + if (!(PyNumber_Check(thirdObj) && PyFloat_Check(fourthObj))) { delete[] name; PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); PYTHON_RETURN_INIT_ERROR; } - pid = PyLong_AsUnsignedLong(thirdObj); + pid = PyNumber_AsSsize_t(thirdObj, NULL); distSeq = (float)PyFloat_AsDouble(fourthObj); - } else if (name = PyString_AsStringEx(firstObj)){ - if (!PyLong_Check(secondObj) || thirdObj || fourthObj) + } else if (name = PyString_AsStringEx(firstObj)) { + if (!PyNumber_Check(secondObj) || thirdObj || fourthObj) { delete[] name; PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); PYTHON_RETURN_INIT_ERROR; } - pid = PyLong_AsUnsignedLong(secondObj); + pid = PyNumber_AsSsize_t(secondObj, NULL); } else { PyErr_SetString(PyExc_TypeError, "__init__ expects one of two argument lists: (ptKey, string, unsigned long, float) or (string, unsigned long)"); PYTHON_RETURN_INIT_ERROR; From f58161ace055ff2d1ac59a9c64f421876530e151 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 17:21:07 -0800 Subject: [PATCH 25/51] Fix pnUtils for clang. --- Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h | 2 +- Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h | 3 +- Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp | 39 +++++++++---------- Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h | 1 + 4 files changed, 23 insertions(+), 22 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h index ba7478e6..38c32b8f 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtArray.h @@ -823,7 +823,7 @@ void TArray::AdjustSizeChunked (unsigned newAlloc, unsigned newCount) { // Process growing the allocation else - newAlloc = CalcAllocGrowth(newAlloc, this->m_alloc, &this->m_chunkSize); + newAlloc = this->CalcAllocGrowth(newAlloc, this->m_alloc, &this->m_chunkSize); // Perform the allocation this->AdjustSize(newAlloc, newCount); diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h index 04c3797d..1f44c2d9 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtHash.h @@ -52,6 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnUtList.h" #include "pnUtArray.h" #include "pnUtMath.h" +#include "pnUtStr.h" /**************************************************************************** * @@ -536,7 +537,7 @@ const T * THashTable::Find (const K & key) const { unsigned hash = key.GetHash(); const LIST(T) & slotList = this->GetSlotList(hash); for (const T * curr = slotList.Head(); curr; curr = slotList.Next(curr)) - if ((GetHash(curr) == hash) && (*curr == key)) + if ((this->GetHash(curr) == hash) && (*curr == key)) return curr; return nil; } diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp index 320fec69..016bb7b6 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.cpp @@ -69,6 +69,25 @@ static uint32_t s_hashValue[] = { * Internal functions * ***/ +//=========================================================================== +template +static unsigned IStrLen (const chartype str[]) { + unsigned chars = 0; + for (; *str++; ++chars) + NULL_STMT; + return chars; +} + +//=========================================================================== +template +static void IStrCopy (chartype * dest, const chartype source[], unsigned chars) { + while ((chars > 1) && ((*dest = *source++) != 0)) { + --chars; + ++dest; + } + if (chars) + *dest = 0; +} //=========================================================================== template @@ -207,17 +226,6 @@ static int IStrCmpI (const chartype str1[], const chartype str2[], unsigned char return 0; } -//=========================================================================== -template -static void IStrCopy (chartype * dest, const chartype source[], unsigned chars) { - while ((chars > 1) && ((*dest = *source++) != 0)) { - --chars; - ++dest; - } - if (chars) - *dest = 0; -} - //=========================================================================== // returns StrLen(dest) template @@ -284,15 +292,6 @@ static chartype * IStrStrI (chartype source[], const chartype match[]) { return nil; } -//=========================================================================== -template -static unsigned IStrLen (const chartype str[]) { - unsigned chars = 0; - for (; *str++; ++chars) - NULL_STMT; - return chars; -} - //=========================================================================== template static void IStrLower (chartype * dest, unsigned chars) { diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h index 02649403..3ab23464 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtStr.h @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "Pch.h" #include "pnUtArray.h" +#include /***************************************************************************** * From 704a49fe739923ad39f5b7d17e863d6515a99013 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 29 Jan 2012 17:21:37 -0800 Subject: [PATCH 26/51] Fix plVault. This means that everything that doesn't depend on non-portable code is able to compile. --- .../PubUtilLib/plVault/plVaultClientApi.cpp | 44 +++++++++---------- .../PubUtilLib/plVault/plVaultNodeAccess.cpp | 3 +- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp index 9dcf9133..7f7132bf 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultClientApi.cpp @@ -285,7 +285,7 @@ static void VaultNodeFound ( //============================================================================ static void VaultNodeAddedDownloadCallback(ENetError result, void * param) { - unsigned childId = (unsigned)param; + unsigned childId = (unsigned)((uintptr_t)param); INotifyAfterDownload* notify = s_notifyAfterDownload.Find(childId); @@ -313,7 +313,7 @@ static void VaultNodeAddedDownloadCallback(ENetError result, void * param) { } //============================================================================ -static void __cdecl LogDumpProc ( +static void CDECL LogDumpProc ( void * , const wchar_t fmt[], ... @@ -1182,7 +1182,7 @@ RelVaultNode * RelVaultNode::GetParentNodeIncRef ( unsigned maxDepth ) { if (maxDepth == 0) - return false; + return nil; RelVaultNodeLink * link; link = state->parents.Head(); @@ -1208,7 +1208,7 @@ RelVaultNode * RelVaultNode::GetChildNodeIncRef ( unsigned maxDepth ) { if (maxDepth == 0) - return false; + return nil; RelVaultNodeLink * link; link = state->children.Head(); @@ -2831,7 +2831,7 @@ namespace _VaultRegisterOwnedAge { void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to create AgeLink (async)"); - delete param; + delete (_Params*)param; return; } @@ -2846,10 +2846,10 @@ namespace _VaultRegisterOwnedAge { RelVaultNode* agesIOwn = VaultGetAgesIOwnFolderIncRef(); RelVaultNode* plyrInfo = VaultGetPlayerInfoNodeIncRef(); VaultAddChildNode(agesIOwn->nodeId, node->nodeId, 0, (FVaultAddChildNodeCallback)_AddAgeLinkNode, nil); - VaultAddChildNode(node->nodeId, (uint32_t)p->fAgeInfoId, 0, (FVaultAddChildNodeCallback)_AddAgeInfoNode, nil); + VaultAddChildNode(node->nodeId, (uint32_t)((uintptr_t)p->fAgeInfoId), 0, (FVaultAddChildNodeCallback)_AddAgeInfoNode, nil); // Add our PlayerInfo to important places - if (RelVaultNode* rvnAgeInfo = VaultGetNodeIncRef((uint32_t)p->fAgeInfoId)) { + if (RelVaultNode* rvnAgeInfo = VaultGetNodeIncRef((uint32_t)((uintptr_t)p->fAgeInfoId))) { if (RelVaultNode* rvnAgeOwners = rvnAgeInfo->GetChildPlayerInfoListNodeIncRef(plVault::kAgeOwnersFolder, 1)) { VaultAddChildNode(rvnAgeOwners->nodeId, plyrInfo->nodeId, 0, (FVaultAddChildNodeCallback)_AddPlayerInfoNode, nil); rvnAgeOwners->DecRef(); @@ -2874,7 +2874,7 @@ namespace _VaultRegisterOwnedAge { void _DownloadCallback(ENetError result, void* param) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "VaultRegisterOwnedAge: Failed to download age vault (async)"); - delete param; + delete (_Params*)param; } else VaultCreateNode(plVault::kNodeType_AgeLink, (FVaultCreateNodeCallback)_CreateAgeLinkNode, nil, param); } @@ -3190,12 +3190,12 @@ namespace _VaultRegisterVisitAge { void _CreateAgeLinkNode(ENetError result, void* state, void* param, RelVaultNode* node) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "RegisterVisitAge: Failed to create AgeLink (async)"); - delete param; + delete (_Params*)param; return; } _Params* p = (_Params*)param; - RelVaultNode* ageInfo = VaultGetNodeIncRef((uint32_t)p->fAgeInfoId); + RelVaultNode* ageInfo = VaultGetNodeIncRef((uint32_t)((uintptr_t)p->fAgeInfoId)); // Add ourselves to the Can Visit folder of the age if (RelVaultNode * playerInfo = VaultGetPlayerInfoNodeIncRef()) { @@ -3225,13 +3225,13 @@ namespace _VaultRegisterVisitAge { msg->Send(); //Don't leak memory - delete param; + delete (_Params*)param; } void _DownloadCallback(ENetError result, void* param) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "RegisterVisitAge: Failed to download age vault (async)"); - delete param; + delete (_Params*)param; return; } @@ -3242,7 +3242,7 @@ namespace _VaultRegisterVisitAge { void _InitAgeCallback(ENetError result, void* state, void* param, uint32_t ageVaultId, uint32_t ageInfoId) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "RegisterVisitAge: Failed to init age vault (async)"); - delete param; + delete (_Params*)param; return; } @@ -4422,7 +4422,7 @@ namespace _VaultCreateSubAge { } // Add the children to the right places - VaultAddChildNode(node->nodeId, (uint32_t)param, 0, nil, nil); + VaultAddChildNode(node->nodeId, (uint32_t)((uintptr_t)param), 0, nil, nil); if (RelVaultNode* saFldr = VaultGetAgeSubAgesFolderIncRef()) { VaultAddChildNode(saFldr->nodeId, node->nodeId, 0, nil, nil); saFldr->DecRef(); @@ -4782,15 +4782,15 @@ namespace _VaultCreateChildAge { void _CreateNodeCallback(ENetError result, void* state, void* param, RelVaultNode* node) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "CreateChildAge: Failed to create AgeLink (async)"); - delete param; + delete (_Params*)param; return; } _Params* p = (_Params*)param; // Add the children to the right places - VaultAddChildNode(node->nodeId, (uint32_t)p->fAgeInfoId, 0, nil, nil); - VaultAddChildNode((uint32_t)p->fChildAgesFldr, node->nodeId, 0, nil, nil); + VaultAddChildNode(node->nodeId, (uint32_t)((uintptr_t)p->fAgeInfoId), 0, nil, nil); + VaultAddChildNode((uint32_t)((uintptr_t)p->fChildAgesFldr), node->nodeId, 0, nil, nil); // Send the VaultNotify that the plNetLinkingMgr wants... plVaultNotifyMsg * msg = NEWZERO(plVaultNotifyMsg); @@ -4799,13 +4799,13 @@ namespace _VaultCreateChildAge { msg->GetArgs()->AddInt(plNetCommon::VaultTaskArgs::kAgeLinkNode, node->nodeId); msg->Send(); - delete param; + delete (_Params*)param; } void _DownloadCallback(ENetError result, void* param) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "CreateChildAge: Failed to download age vault (async)"); - delete param; + delete (_Params*)param; return; } @@ -4820,7 +4820,7 @@ namespace _VaultCreateChildAge { void _InitAgeCallback(ENetError result, void* state, void* param, uint32_t ageVaultId, uint32_t ageInfoId) { if (IS_NET_ERROR(result)) { LogMsg(kLogError, "CreateChildAge: Failed to init age (async)"); - delete param; + delete (_Params*)param; return; } @@ -4888,7 +4888,7 @@ uint8_t VaultAgeFindOrCreateChildAgeLink( rvnAgeLink->DecRef(); rvnAgeInfo->DecRef(); - retval = TRUE; + retval = true; } else { _Params* p = new _Params; p->fChildAgesFldr = (void*)rvnChildAges->nodeId; @@ -4900,7 +4900,7 @@ uint8_t VaultAgeFindOrCreateChildAgeLink( nil, p ); - retval = FALSE; + retval = false; } temp->DecRef(); diff --git a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp index 2c31fd31..754b6288 100644 --- a/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp +++ b/Sources/Plasma/PubUtilLib/plVault/plVaultNodeAccess.cpp @@ -466,7 +466,8 @@ bool VaultTextNoteNode::GetVisitInfo (plAgeInfoStruct * info) { if (StrLen(token) > 0) { Uuid guid; GuidFromString(token, &guid); - info->SetAgeInstanceGuid(&plUUID(guid)); + plUUID uuid(guid); + info->SetAgeInstanceGuid(&uuid); } } break; From 0787aa10e98cce7a3085b55655ec94620b2e8448 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 29 Jan 2012 20:29:46 -0500 Subject: [PATCH 27/51] Add and Remove PRPs from the ResManager appropriately --- .../PubUtilLib/plAgeLoader/plResPatcher.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp b/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp index 9a4d2352..a98d146d 100644 --- a/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp +++ b/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp @@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #include "plResPatcher.h" +#include "hsResMgr.h" #include "plAgeLoader/plAgeLoader.h" #include "plCompression/plZlibStream.h" @@ -50,6 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pnNetBase/pnNbError.h" #include "plNetGameLib/plNetGameLib.h" #include "plProgressMgr/plProgressMgr.h" +#include "plResMgr/plResManager.h" #include "plStatusLog/plStatusLog.h" ///////////////////////////////////////////////////////////////////////////// @@ -74,6 +76,8 @@ public: else return fOutput->Write(count, buf); } + + bool IsZipped() const { return fIsZipped; } }; ///////////////////////////////////////////////////////////////////////////// @@ -86,6 +90,8 @@ static void FileDownloaded( { plResPatcher* patcher = (plResPatcher*)param; char* name = hsWStringToString(filename); + if (((plResDownloadStream*)writer)->IsZipped()) + plFileUtils::StripExt(name); // Kill off .gz writer->Close(); delete writer; @@ -93,6 +99,12 @@ static void FileDownloaded( { case kNetSuccess: PatcherLog(kStatus, " Download Complete: %s", name); + + // If this is a PRP, then we need to add it to the ResManager + if (stricmp(plFileUtils::GetFileExt(name), "prp") == 0) + ((plResManager*)hsgResMgr::ResMgr())->AddSinglePage(name); + + // Continue down the warpath patcher->IssueRequest(); delete[] name; return; @@ -215,6 +227,10 @@ void plResPatcher::IssueRequest() PatcherLog(kMajorStatus, " Downloading file... %s", eapSucksString); xtl::format(title, L"Downloading... %s", plFileUtils::GetFileName(req.fFriendlyName.c_str())); + // If this is a PRP, we need to unload it from the ResManager + if (stricmp(plFileUtils::GetFileExt(eapSucksString), "prp") == 0) + ((plResManager*)hsgResMgr::ResMgr())->RemoveSinglePage(eapSucksString); + plFileUtils::EnsureFilePathExists(req.fFriendlyName.c_str()); plResDownloadStream* stream = new plResDownloadStream(fProgress, req.fFile.c_str()); if(stream->Open(eapSucksString, "wb")) From 18b5a02479c801a19c55a541bf287c7d4a1f2cd6 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 30 Jan 2012 21:46:34 -0500 Subject: [PATCH 28/51] Fix the Relto panic link weird stuff The ladder region fixes introduced the panic link. Now we should always verify the following when changing anything related to the stupid kinematic actor turd: - Linking to any Ahnoying Sphere's main LIP does not result in a panic link - The Teledahn hatch ladder camera works as expected - That the game doesn't crash on anything stupid, like a nil SceneNode --- .../plPhysX/plPXPhysicalControllerCore.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp index 233040eb..f764521b 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp @@ -395,7 +395,10 @@ void plPXPhysicalControllerCore::IMatchKinematicToController() kinPos.z = (NxReal)cPos.z; if (plSimulationMgr::fExtraProfile) SimLog("Match setting kinematic from %f,%f,%f to %f,%f,%f",prevKinPos.x,prevKinPos.y,prevKinPos.z,kinPos.x,kinPos.y,kinPos.z ); - fKinematicActor->moveGlobalPosition(kinPos); + if (fBehavingLikeAnimatedPhys && fKinematic) // if NX_BF_KINEMATIC && (avatar is on a ladder or something) + fKinematicActor->moveGlobalPosition(kinPos); + else + fKinematicActor->setGlobalPosition(kinPos); } } void plPXPhysicalControllerCore::UpdateControllerAndPhysicalRep() @@ -406,7 +409,7 @@ void plPXPhysicalControllerCore::UpdateControllerAndPhysicalRep() {//this means we are moving the controller and then synchnig the kin NxExtendedVec3 ControllerPos= fController->getPosition(); NxVec3 NewKinPos((NxReal)ControllerPos.x, (NxReal)ControllerPos.y, (NxReal)ControllerPos.z); - if (fEnabled && fKinematicActor->readBodyFlag(NX_BF_KINEMATIC)) + if (fEnabled || fKinematic) { if (plSimulationMgr::fExtraProfile) SimLog("Moving kinematic to %f,%f,%f",NewKinPos.x, NewKinPos.y, NewKinPos.z ); @@ -414,7 +417,7 @@ void plPXPhysicalControllerCore::UpdateControllerAndPhysicalRep() fKinematicActor->moveGlobalPosition(NewKinPos); } - else if (fEnabled) + else { if (plSimulationMgr::fExtraProfile) SimLog("Setting kinematic to %f,%f,%f", NewKinPos.x, NewKinPos.y, NewKinPos.z ); @@ -446,14 +449,14 @@ void plPXPhysicalControllerCore::MoveKinematicToController(hsPoint3& pos) newPos.x = (NxReal)pos.fX; newPos.y = (NxReal)pos.fY; newPos.z = (NxReal)pos.fZ+kPhysZOffset; - if (fEnabled && fKinematicActor->readBodyFlag(NX_BF_KINEMATIC)) + if ((fEnabled || fKinematic) && fBehavingLikeAnimatedPhys) { if (plSimulationMgr::fExtraProfile) SimLog("Moving kinematic from %f,%f,%f to %f,%f,%f",pos.fX,pos.fY,pos.fZ+kPhysZOffset,kinPos.x,kinPos.y,kinPos.z ); // use the position fKinematicActor->moveGlobalPosition(newPos); } - else if (fEnabled) + else { if (plSimulationMgr::fExtraProfile) SimLog("Setting kinematic from %f,%f,%f to %f,%f,%f",pos.fX,pos.fY,pos.fZ+kPhysZOffset,kinPos.x,kinPos.y,kinPos.z ); @@ -488,9 +491,9 @@ void plPXPhysicalControllerCore::ISetKinematicLoc(const hsMatrix44& l2w) // add z offset kPos.fZ += kPhysZOffset; // Update the physical position of kinematic - if (fEnabled && fKinematicActor->readBodyFlag(NX_BF_KINEMATIC)) + if (fEnabled || fBehavingLikeAnimatedPhys) fKinematicActor->moveGlobalPosition(plPXConvert::Point(kPos)); - else if (fEnabled) + else fKinematicActor->setGlobalPosition(plPXConvert::Point(kPos)); } void plPXPhysicalControllerCore::IGetPositionSim(hsPoint3& pos) const From 6750a033d2144fbc30f83ec673199459a11bddd7 Mon Sep 17 00:00:00 2001 From: NadnerbD Date: Tue, 31 Jan 2012 02:34:19 -0500 Subject: [PATCH 29/51] Fixed python multi-line entry by preventing double enter events --- Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp index b6c37b98..6b0b9b2e 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp @@ -540,8 +540,9 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg ) static hsBool findAgain = false; static uint32_t findCounter = 0; - - if( !msg->GetKeyDown() ) + // filter out keyUps and ascii control characters + // as the control functions are handled on the keyDown event + if( !msg->GetKeyDown() || (msg->GetKeyChar() > '\0' && msg->GetKeyChar() < ' ')) return; if( msg->GetKeyCode() == KEY_ESCAPE ) From 84849b22382c1efba3336fcd196428a0dac40a68 Mon Sep 17 00:00:00 2001 From: NadnerbD Date: Tue, 31 Jan 2012 02:35:16 -0500 Subject: [PATCH 30/51] Lined up the input line with the output buffer --- Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp index 6b0b9b2e..0e028081 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp @@ -1142,7 +1142,7 @@ void pfConsole::Draw( plPipeline *p ) strcpy( tmp, "]" ); drawText.DrawString( 10, y, tmp, 255, 255, 255, 255 ); - i = 10 + drawText.CalcStringWidth( tmp ) + 4; + i = 19 + drawText.CalcStringWidth( tmp ); drawText.DrawString( i, y, fWorkingLine, fConsoleTextColor ); if( fCursorTicks >= 0 ) From 2493cf8f73e075f4044de16a3f539ea159ce4950 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Mon, 30 Jan 2012 23:59:20 -0800 Subject: [PATCH 31/51] Some fixes for pfConsole. --- .../Plasma/FeatureLib/pfConsole/pfConsole.cpp | 3 ++- .../pfConsole/pfConsoleCommands.cpp | 22 +++++++++++-------- .../pfConsole/pfConsoleCommandsNet.cpp | 11 ++++++---- 3 files changed, 22 insertions(+), 14 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp index c51b06d8..02860cba 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp @@ -45,6 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // ////////////////////////////////////////////////////////////////////////////// +#include "pfPython/cyPythonInterface.h" + #include "HeadSpin.h" #include "pfConsole.h" #include "pfConsoleCore/pfConsoleEngine.h" @@ -62,7 +64,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plgDispatch.h" #include "plPipeline.h" -#include "pfPython/cyPythonInterface.h" #include "plNetClient/plNetClientMgr.h" #ifndef PLASMA_EXTERNAL_RELEASE diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp index cb6990a1..b2060575 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp @@ -49,6 +49,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define LIMIT_CONSOLE_COMMANDS 1 #endif +#include "pfPython/cyPythonInterface.h" +#include "pfPython/plPythonSDLModifier.h" #include "pfConsoleCore/pfConsoleCmd.h" #include "plgDispatch.h" @@ -163,10 +165,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" #include "hsTemplates.h" - -#include "pfPython/cyPythonInterface.h" -#include "pfPython/plPythonSDLModifier.h" - #include "plResMgr/plResManagerHelper.h" #include "plResMgr/plResMgrSettings.h" #include "plResMgr/plLocalization.h" @@ -2466,11 +2464,10 @@ PF_CONSOLE_CMD( App, // groupName "", // paramList "Quit the client app" ) // helpString { - if( plClient::GetInstance() ) - PostMessage(plClient::GetInstance()->GetWindowHandle(), - WM_SYSCOMMAND, - SC_CLOSE, - 0); + if( plClient::GetInstance() ) { + plClientMsg* msg = new plClientMsg(plClientMsg::kQuit); + msg->Send(hsgResMgr::ResMgr()->FindKey(kClient_KEY)); + } } #ifndef LIMIT_CONSOLE_COMMANDS @@ -2510,8 +2507,12 @@ PF_CONSOLE_CMD(App, "", "Set low priority for this process") { +#if HS_BUILD_FOR_WIN32 SetPriorityClass( GetCurrentProcess(), IDLE_PRIORITY_CLASS ); PrintString( "Set process priority to lowest setting" ); +#else + PrintString("Not implemented on your platform!"); +#endif } @@ -3933,6 +3934,8 @@ PF_CONSOLE_CMD( Nav, PageInNodeList, // Group name, Function name "string roomNameBase", // Params "Pages in all scene nodes that start with name." ) // Help string { +/* This is really old and hasn't worked since 2002 anyways. */ +#if HS_BUILD_FOR_WIN32 plSynchEnabler ps(false); // disable dirty tracking while paging in std::string pageInNodesStr; @@ -3950,6 +3953,7 @@ PF_CONSOLE_CMD( Nav, PageInNodeList, // Group name, Function name } pMsg1->AddReceiver( plClient::GetInstance()->GetKey() ); plgDispatch::MsgSend(pMsg1); +#endif } #ifndef LIMIT_CONSOLE_COMMANDS diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp index fe20bba3..56903cb9 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp @@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #endif +#include "pfPython/plPythonSDLModifier.h" #include "pfConsoleCore/pfConsoleCmd.h" #include "plgDispatch.h" @@ -355,7 +356,8 @@ PF_CONSOLE_CMD( Net, // groupName link.GetAgeInfo()->SetAgeFilename( params[0] ); //link.GetAgeInfo()->SetAgeInstanceName( params[0] ); //link.GetAgeInfo()->SetAgeUserDefinedName( params[0] ); - link.GetAgeInfo()->SetAgeInstanceGuid( &plUUID( params[1] ) ); + plUUID guid(params[1]); + link.GetAgeInfo()->SetAgeInstanceGuid( &guid ); link.SetLinkingRules( plNetCommon::LinkingRules::kBasicLink ); plNetLinkingMgr::GetInstance()->LinkToAge( &link ); PrintString("Linking to age..."); @@ -637,7 +639,6 @@ PF_CONSOLE_CMD( Net_DebugObject, // groupName plNetObjectDebugger::GetInstance()->ClearAllDebugObjects(); } -#include "pfPython/plPythonSDLModifier.h" PF_CONSOLE_CMD( Net_DebugObject, // groupName DumpAgeSDLHook, // fxnName "bool dirtyOnly", // paramList @@ -810,7 +811,8 @@ PF_CONSOLE_CMD( Net_Vault, plAgeLinkStruct link; link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeInstanceName( params[0] ); - link.GetAgeInfo()->SetAgeInstanceGuid( &plUUID(GuidGenerate())); + plUUID guid(GuidGenerate()); + link.GetAgeInfo()->SetAgeInstanceGuid( &guid); link.SetSpawnPoint( kDefaultSpawnPoint ); bool success = VaultRegisterOwnedAgeAndWait(&link); PrintStringF(PrintString, "Operation %s.", success ? "Successful" : "Failed"); @@ -837,7 +839,8 @@ PF_CONSOLE_CMD( Net_Vault, plAgeLinkStruct link; link.GetAgeInfo()->SetAgeFilename( params[0] ); link.GetAgeInfo()->SetAgeInstanceName( params[0] ); - link.GetAgeInfo()->SetAgeInstanceGuid( &plUUID(GuidGenerate())); + plUUID guid(GuidGenerate()); + link.GetAgeInfo()->SetAgeInstanceGuid( &guid); link.SetSpawnPoint( kDefaultSpawnPoint ); bool success = VaultRegisterOwnedAgeAndWait(&link); PrintStringF(PrintString, "Operation %s.", success ? "Successful" : "Failed"); From b5ff772f477830f55b5c25bc4edc9e534da4a9e7 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Tue, 31 Jan 2012 00:00:03 -0800 Subject: [PATCH 32/51] Fix pfPython to compile on Linux. --- .../Games/BlueSpiral/pyBlueSpiralGame.h | 2 +- .../Games/BlueSpiral/pyBlueSpiralMsg.h | 2 +- .../Games/ClimbingWall/pyClimbingWallGame.h | 2 +- .../Games/ClimbingWall/pyClimbingWallMsg.h | 2 +- .../pfPython/Games/Heek/pyHeekGame.h | 2 +- .../pfPython/Games/Heek/pyHeekMsg.h | 2 +- .../pfPython/Games/Marker/pyMarkerGame.h | 2 +- .../pfPython/Games/Marker/pyMarkerMsg.h | 2 +- .../pfPython/Games/TicTacToe/pyTTTGame.h | 2 +- .../pfPython/Games/TicTacToe/pyTTTMsg.h | 2 +- .../pfPython/Games/VarSync/pyVarSyncGame.h | 2 +- .../pfPython/Games/VarSync/pyVarSyncMsg.h | 2 +- .../FeatureLib/pfPython/Games/pyGameCli.h | 2 +- .../pfPython/Games/pyGameCliMsg.cpp | 12 +++++----- .../FeatureLib/pfPython/Games/pyGameCliMsg.h | 2 +- .../FeatureLib/pfPython/Games/pyGameMgrMsg.h | 2 +- .../FeatureLib/pfPython/cyAnimation.cpp | 2 +- .../Plasma/FeatureLib/pfPython/cyAnimation.h | 2 +- .../Plasma/FeatureLib/pfPython/cyAvatar.cpp | 3 ++- Sources/Plasma/FeatureLib/pfPython/cyAvatar.h | 2 +- .../FeatureLib/pfPython/cyAvatarGlue.cpp | 8 +++---- Sources/Plasma/FeatureLib/pfPython/cyCamera.h | 2 +- Sources/Plasma/FeatureLib/pfPython/cyDraw.h | 2 +- .../Plasma/FeatureLib/pfPython/cyDrawGlue.cpp | 10 ++++---- .../pfPython/cyInputInterfaceGlue.cpp | 7 +++--- Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp | 23 +++++++++++-------- .../FeatureLib/pfPython/cyMiscGlue2.cpp | 8 +++---- .../FeatureLib/pfPython/cyParticleSys.h | 2 +- .../FeatureLib/pfPython/cyParticleSysGlue.cpp | 8 +++---- .../Plasma/FeatureLib/pfPython/cyPhysics.h | 2 +- .../FeatureLib/pfPython/cyPhysicsGlue.cpp | 10 ++++---- .../FeatureLib/pfPython/cyPythonInterface.h | 2 +- .../FeatureLib/pfPython/plPythonFileMod.cpp | 2 +- .../FeatureLib/pfPython/plPythonFileMod.h | 2 +- .../FeatureLib/pfPython/plPythonPack.cpp | 2 +- .../Plasma/FeatureLib/pfPython/plPythonPack.h | 2 +- .../pfPython/plPythonSDLModifier.cpp | 1 - .../FeatureLib/pfPython/plPythonSDLModifier.h | 4 +++- .../FeatureLib/pfPython/pyAgeInfoStruct.cpp | 12 ++++++---- .../FeatureLib/pfPython/pyAgeInfoStruct.h | 2 +- .../FeatureLib/pfPython/pyAgeLinkStruct.cpp | 2 +- .../FeatureLib/pfPython/pyAgeLinkStruct.h | 2 +- .../Plasma/FeatureLib/pfPython/pyAgeVault.h | 2 +- Sources/Plasma/FeatureLib/pfPython/pyAlarm.h | 2 +- .../FeatureLib/pfPython/pyAudioControl.h | 2 +- .../FeatureLib/pfPython/pyCCRMgrGlue.cpp | 2 +- .../FeatureLib/pfPython/pyCCRMgrGlue2.cpp | 2 +- .../Plasma/FeatureLib/pfPython/pyCluster.h | 4 ++-- Sources/Plasma/FeatureLib/pfPython/pyColor.h | 2 +- .../FeatureLib/pfPython/pyDniCoordinates.h | 2 +- .../FeatureLib/pfPython/pyDniInfoSource.cpp | 2 +- .../FeatureLib/pfPython/pyDniInfoSource.h | 3 +-- .../FeatureLib/pfPython/pyDrawControl.h | 2 +- .../FeatureLib/pfPython/pyDynamicText.cpp | 20 ++++++++++------ .../FeatureLib/pfPython/pyDynamicText.h | 3 ++- .../FeatureLib/pfPython/pyGUIControl.cpp | 2 +- .../Plasma/FeatureLib/pfPython/pyGUIControl.h | 2 +- .../FeatureLib/pfPython/pyGUIControlButton.h | 2 +- .../pfPython/pyGUIControlCheckBox.h | 2 +- .../pfPython/pyGUIControlClickMap.h | 2 +- .../FeatureLib/pfPython/pyGUIControlDragBar.h | 2 +- .../pfPython/pyGUIControlDraggable.h | 2 +- .../pfPython/pyGUIControlDynamicText.h | 2 +- .../FeatureLib/pfPython/pyGUIControlEditBox.h | 2 +- .../pfPython/pyGUIControlListBox.cpp | 2 +- .../FeatureLib/pfPython/pyGUIControlListBox.h | 2 +- .../pfPython/pyGUIControlMultiLineEdit.cpp | 7 +++--- .../pfPython/pyGUIControlMultiLineEdit.h | 2 +- .../pfPython/pyGUIControlRadioGroup.h | 2 +- .../FeatureLib/pfPython/pyGUIControlTextBox.h | 2 +- .../Plasma/FeatureLib/pfPython/pyGUIDialog.h | 2 +- .../FeatureLib/pfPython/pyGUIDialogGlue.cpp | 2 +- .../FeatureLib/pfPython/pyGUIPopUpMenu.h | 2 +- .../Plasma/FeatureLib/pfPython/pyGameScore.h | 4 ++-- .../Plasma/FeatureLib/pfPython/pyGeometry3.h | 2 +- .../FeatureLib/pfPython/pyGrassShader.h | 2 +- Sources/Plasma/FeatureLib/pfPython/pyImage.h | 2 +- .../FeatureLib/pfPython/pyJournalBook.h | 2 +- Sources/Plasma/FeatureLib/pfPython/pyKey.h | 2 +- Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h | 2 +- .../Plasma/FeatureLib/pfPython/pyMarkerMgr.h | 2 +- .../Plasma/FeatureLib/pfPython/pyMatrix44.h | 2 +- .../FeatureLib/pfPython/pyMoviePlayer.h | 2 +- .../FeatureLib/pfPython/pyNetLinkingMgr.cpp | 2 +- .../FeatureLib/pfPython/pyNetLinkingMgr.h | 2 +- .../pfPython/pyNetServerSessionInfo.h | 2 +- .../Plasma/FeatureLib/pfPython/pyNotify.cpp | 2 +- Sources/Plasma/FeatureLib/pfPython/pyNotify.h | 2 +- Sources/Plasma/FeatureLib/pfPython/pyPlayer.h | 2 +- Sources/Plasma/FeatureLib/pfPython/pySDL.h | 2 +- .../FeatureLib/pfPython/pySceneObject.cpp | 2 +- .../FeatureLib/pfPython/pySceneObject.h | 2 +- .../Plasma/FeatureLib/pfPython/pyScoreMgr.h | 4 ++-- .../FeatureLib/pfPython/pySpawnPointInfo.h | 2 +- .../Plasma/FeatureLib/pfPython/pyStatusLog.h | 2 +- Sources/Plasma/FeatureLib/pfPython/pyStream.h | 2 +- .../pfPython/pySwimCurrentInterface.h | 4 ++-- .../Plasma/FeatureLib/pfPython/pyVault.cpp | 13 +++++++---- Sources/Plasma/FeatureLib/pfPython/pyVault.h | 2 +- .../pfPython/pyVaultAgeInfoListNode.h | 2 +- .../pfPython/pyVaultAgeInfoNode.cpp | 2 +- .../FeatureLib/pfPython/pyVaultAgeInfoNode.h | 2 +- .../FeatureLib/pfPython/pyVaultAgeLinkNode.h | 2 +- .../pfPython/pyVaultChronicleNode.h | 2 +- .../FeatureLib/pfPython/pyVaultFolderNode.h | 2 +- .../FeatureLib/pfPython/pyVaultImageNode.cpp | 2 +- .../FeatureLib/pfPython/pyVaultImageNode.h | 2 +- .../pfPython/pyVaultMarkerGameNode.cpp | 3 +-- .../pfPython/pyVaultMarkerGameNode.h | 2 +- .../FeatureLib/pfPython/pyVaultNode.cpp | 2 +- .../Plasma/FeatureLib/pfPython/pyVaultNode.h | 2 +- .../FeatureLib/pfPython/pyVaultNodeRef.h | 2 +- .../pfPython/pyVaultPlayerInfoListNode.h | 2 +- .../pfPython/pyVaultPlayerInfoNode.h | 2 +- .../FeatureLib/pfPython/pyVaultPlayerNode.cpp | 3 ++- .../FeatureLib/pfPython/pyVaultPlayerNode.h | 2 +- .../FeatureLib/pfPython/pyVaultSDLNode.h | 2 +- .../FeatureLib/pfPython/pyVaultSystemNode.h | 2 +- .../FeatureLib/pfPython/pyVaultTextNoteNode.h | 2 +- .../Plasma/FeatureLib/pfPython/pyWaveSet.h | 4 ++-- 120 files changed, 195 insertions(+), 175 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h index 71769008..0ca9484a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralGame.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for the BlueSpiral game client // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsg.h index 78f27f17..fc992b51 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/BlueSpiral/pyBlueSpiralMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for BlueSpiral game messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h index 02b34c95..0ce90a89 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallGame.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for the climbing wall game client // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsg.h index 85636b4e..5b111d9f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/ClimbingWall/pyClimbingWallMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for ClimbingWall game messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h index c028b320..ebd6073c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekGame.h @@ -49,9 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper for the Heek game client // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h index 1515f1b2..f87cc1d1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Heek/pyHeekMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for Heek game messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h index 1490855b..2f02005f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerGame.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for the Marker game client // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h index 1515d6eb..8671dbb5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/Marker/pyMarkerMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for Marker game messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h index afe04552..40653dc7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTGame.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for the TTT game client // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsg.h index efb716e7..2f512fca 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/TicTacToe/pyTTTMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for TTT game messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h index 4776d560..a5b25fc3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncGame.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for the VarSync game client // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCli.h" #include "../../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h index 98537e8b..8c173e48 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/VarSync/pyVarSyncMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for VarSync game messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../../pyGlueHelpers.h" #include "../pyGameCliMsg.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h index 1fef769f..51d53684 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCli.h @@ -49,9 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper for the game client base class // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../pyGlueHelpers.h" #include "../pyKey.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.cpp b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.cpp index f1571571..c840e939 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.cpp @@ -42,11 +42,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyGameCliMsg.h" #include "pyGameCli.h" -#include "TicTacToe\pyTTTMsg.h" -#include "Heek\pyHeekMsg.h" -#include "Marker\pyMarkerMsg.h" -#include "BlueSpiral\pyBlueSpiralMsg.h" -#include "ClimbingWall\pyClimbingWallMsg.h" +#include "TicTacToe/pyTTTMsg.h" +#include "Heek/pyHeekMsg.h" +#include "Marker/pyMarkerMsg.h" +#include "BlueSpiral/pyBlueSpiralMsg.h" +#include "ClimbingWall/pyClimbingWallMsg.h" #include "VarSync/pyVarSyncMsg.h" /////////////////////////////////////////////////////////////////////////////// @@ -239,4 +239,4 @@ unsigned long pyGameCliOwnerChangeMsg::OwnerID() const return gmMsg->ownerId; } return 0; -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.h index 1793fcb5..4b5ec2ce 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameCliMsg.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for game client messages // +#include #include "pfGameMgr/pfGameMgr.h" -#include #include "../pyGlueHelpers.h" class pyGameCliMsg diff --git a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h index 01d45582..5906df9d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h +++ b/Sources/Plasma/FeatureLib/pfPython/Games/pyGameMgrMsg.h @@ -49,10 +49,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper for game manager messages // +#include #include "hsStlUtils.h" #include "pfGameMgr/pfGameMgr.h" -#include #include "../pyGlueHelpers.h" class pyGameMgrMsg diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp index 71efed9e..56498b9c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.cpp @@ -46,11 +46,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper to map animation functions to plasma2 message // +#include "cyAnimation.h" #include "plgDispatch.h" #include "plMessage/plAnimCmdMsg.h" #include "pnMessage/plEventCallbackMsg.h" -#include "cyAnimation.h" cyAnimation::cyAnimation() { diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h index 9734c39c..d0ce9fb5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyAnimation.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper to map animation functions to plasma2 message // +#include #include "pyKey.h" #include "hsTemplates.h" -#include #include "pyGlueHelpers.h" class cyAnimation diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp index 6751e1bd..6a999bb1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.cpp @@ -118,7 +118,8 @@ void cyAvatar::SetNetForce(hsBool state) void cyAvatar::SetSenderKey(pyKey& pKey) { - SetSender(pKey.getKey()); + plKey k = pKey.getKey(); + SetSender(k); } diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h index ded3c41e..d372b818 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatar.h @@ -48,12 +48,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper to map animation functions to plasma2 message // +#include #include "hsStlUtils.h" #include "hsTemplates.h" #include "hsBitVector.h" #include "pnKeyedObject/plKey.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp index feb49db1..a6b79e49 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyAvatarGlue.cpp @@ -803,10 +803,10 @@ PYTHON_CLASS_NEW_IMPL(ptAvatar, cyAvatar) static PyObject* New(PyObject* sender, PyObject* recvr = nil) { ptAvatar* newObj = (ptAvatar*)ptAvatar_type.tp_new(&ptAvatar_type, NULL, NULL); - pyKey* senderKey = pyKey::ConvertFrom(sender); - pyKey* recvrKey = pyKey::ConvertFrom(recvr); - newObj->fThis->SetSender(senderKey->getKey()); - newObj->fThis->AddRecvr(recvrKey->getKey()); + plKey senderKey = pyKey::ConvertFrom(sender)->getKey(); + plKey recvrKey = pyKey::ConvertFrom(recvr)->getKey(); + newObj->fThis->SetSender(senderKey); + newObj->fThis->AddRecvr(recvrKey); newObj->fThis->SetNetForce(false); return (PyObject*) newObj; } diff --git a/Sources/Plasma/FeatureLib/pfPython/cyCamera.h b/Sources/Plasma/FeatureLib/pfPython/cyCamera.h index 209429ad..6c438c4e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyCamera.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyCamera.h @@ -48,12 +48,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper to map camera functions to plasma2 message // +#include #include "HeadSpin.h" #include "pnKeyedObject/plKey.h" class pyKey; -#include #include "pyGlueHelpers.h" class cyCamera diff --git a/Sources/Plasma/FeatureLib/pfPython/cyDraw.h b/Sources/Plasma/FeatureLib/pfPython/cyDraw.h index 55373719..fb0dfb4f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyDraw.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyDraw.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper to map draw functions to plasma2 message // +#include #include "hsTemplates.h" #include "pnKeyedObject/plKey.h" -#include #include "pyGlueHelpers.h" class cyDraw diff --git a/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp index 5422222e..93daa9a4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyDrawGlue.cpp @@ -97,13 +97,13 @@ PyObject *cyDraw::New(PyObject *sender, PyObject *recvr) ptDraw *newObj = (ptDraw*)ptDraw_type.tp_new(&ptDraw_type, NULL, NULL); if (sender != NULL) { - pyKey *senderKey = pyKey::ConvertFrom(sender); - newObj->fThis->SetSender(senderKey->getKey()); + plKey senderKey = pyKey::ConvertFrom(sender)->getKey(); + newObj->fThis->SetSender(senderKey); } if (recvr != NULL) { - pyKey *recvrKey = pyKey::ConvertFrom(recvr); - newObj->fThis->AddRecvr(recvrKey->getKey()); + plKey recvrKey = pyKey::ConvertFrom(recvr)->getKey(); + newObj->fThis->AddRecvr(recvrKey); } newObj->fThis->fNetForce = false; @@ -122,4 +122,4 @@ void cyDraw::AddPlasmaClasses(PyObject *m) PYTHON_CLASS_IMPORT_START(m); PYTHON_CLASS_IMPORT(m, ptDraw); PYTHON_CLASS_IMPORT_END(m); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp index 0b3ff593..9d5ed431 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyInputInterfaceGlue.cpp @@ -39,10 +39,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ -#include "HeadSpin.h" -#include "cyInputInterface.h" - #include +#include "cyInputInterface.h" +#include "HeadSpin.h" // glue functions PYTHON_CLASS_DEFINITION(ptInputInterface, cyInputInterface); @@ -80,4 +79,4 @@ void cyInputInterface::AddPlasmaClasses(PyObject *m) PYTHON_CLASS_IMPORT_START(m); PYTHON_CLASS_IMPORT(m, ptInputInterface); PYTHON_CLASS_IMPORT_END(m); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp index 3993fdf9..dd5f84f3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMisc.cpp @@ -1319,7 +1319,8 @@ void cyMisc::SetPrivateChatList(const std::vector & tolist) for (int i=0 ; iGetClientList()->Append(tolist[i]->GetPlayerID()); - pMsg->SetRemovedKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); + plKey k = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + pMsg->SetRemovedKey(k); pMsg->Send(); } } @@ -1336,7 +1337,8 @@ void cyMisc::SetPrivateChatList(const std::vector & tolist) void cyMisc::ClearPrivateChatList(pyKey& member) { plNetVoiceListMsg* pMsg = new plNetVoiceListMsg(plNetVoiceListMsg::kDistanceMode); - pMsg->SetRemovedKey( member.getKey() ); + plKey k = member.getKey(); + pMsg->SetRemovedKey(k); pMsg->Send(); } @@ -1550,7 +1552,7 @@ void cyMisc::EnableAvatarCursorFade() plIfaceFadeAvatarMsg* iMsg = new plIfaceFadeAvatarMsg; iMsg->SetSubjectKey(nmgr->GetLocalPlayerKey()); iMsg->SetBCastFlag(plMessage::kBCastByExactType); - iMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); + iMsg->SetBCastFlag(plMessage::kNetPropagate, false); iMsg->Enable(); iMsg->Send(); } @@ -1564,7 +1566,7 @@ void cyMisc::DisableAvatarCursorFade() plIfaceFadeAvatarMsg* iMsg = new plIfaceFadeAvatarMsg; iMsg->SetSubjectKey(nmgr->GetLocalPlayerKey()); iMsg->SetBCastFlag(plMessage::kBCastByExactType); - iMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); + iMsg->SetBCastFlag(plMessage::kNetPropagate, false); iMsg->Disable(); iMsg->Send(); } @@ -1579,7 +1581,7 @@ void cyMisc::FadeLocalPlayer(hsBool fade) pMsg->SetFadeOut(fade); pMsg->SetSubjectKey(nmgr->GetLocalPlayerKey()); pMsg->SetBCastFlag(plMessage::kBCastByExactType); - pMsg->SetBCastFlag(plMessage::kNetPropagate, FALSE); + pMsg->SetBCastFlag(plMessage::kNetPropagate, false); pMsg->AddReceiver(nmgr->GetLocalPlayerKey()); plgDispatch::MsgSend(pMsg); } @@ -1661,7 +1663,8 @@ void cyMisc::ToggleAvatarClickability(hsBool on) pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kGUIEnableAvatarClickable); else pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kGUIDisableAvatarClickable); - pMsg->SetAvKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); + plKey k = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + pMsg->SetAvKey(k); pMsg->SetBCastFlag(plMessage::kNetPropagate); pMsg->SetBCastFlag(plMessage::kNetForce); pMsg->Send(); @@ -1671,7 +1674,8 @@ void cyMisc::ToggleAvatarClickability(hsBool on) void cyMisc::SetShareSpawnPoint(const char* spawnPoint) { plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kSetShareSpawnPoint); - pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); + plKey k = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + pMsg->SetSender(k); pMsg->SetSpawnPoint(spawnPoint); pMsg->Send(); } @@ -1679,7 +1683,8 @@ void cyMisc::SetShareSpawnPoint(const char* spawnPoint) void cyMisc::SetShareAgeInstanceGuid(const Uuid& guid) { plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kSetShareAgeInstanceGuid); - pMsg->SetSender(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); + plKey k = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + pMsg->SetSender(k); pMsg->SetAgeInstanceGuid(guid); pMsg->Send(); } @@ -2427,7 +2432,7 @@ int cyMisc::GetKILevel() StrToUnicode(wStr, pfKIMsg::kChronicleKILevel, arrsize(wStr)); if (RelVaultNode * rvn = VaultFindChronicleEntryIncRef(wStr)) { VaultChronicleNode chron(rvn); - result = _wtoi(chron.entryValue); + result = wcstol(chron.entryValue, nil, 0); rvn->DecRef(); } diff --git a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp index 348931cc..34bc8efa 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyMiscGlue2.cpp @@ -39,6 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include #include "cyMisc.h" #include "pyGlueHelpers.h" #include "pyKey.h" @@ -47,11 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyEnum.h" // for enums -#include "plNetCommon\plNetCommon.h" -#include "plResMgr\plLocalization.h" -#include "plMessage\plLOSRequestMsg.h" +#include "plNetCommon/plNetCommon.h" +#include "plResMgr/plLocalization.h" +#include "plMessage/plLOSRequestMsg.h" -#include PYTHON_GLOBAL_METHOD_DEFINITION(PtYesNoDialog, args, "Params: selfkey,dialogMessage\nThis will display a Yes/No dialog to the user with the text dialogMessage\n" "This dialog _has_ to be answered by the user.\n" diff --git a/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h b/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h index 4065a6a2..60f3a7f7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyParticleSys.h @@ -48,12 +48,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper to for Particle System // +#include #include "hsTemplates.h" #include "pnKeyedObject/plKey.h" class pyKey; -#include #include "pyGlueHelpers.h" class cyParticleSys diff --git a/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp index 16ce0fe5..de65bbc9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyParticleSysGlue.cpp @@ -120,13 +120,13 @@ PyObject *cyParticleSys::New(PyObject *sender, PyObject *recvr) ptParticle *newObj = (ptParticle*)ptParticle_type.tp_new(&ptParticle_type, NULL, NULL); if (sender != NULL) { - pyKey *senderKey = pyKey::ConvertFrom(sender); - newObj->fThis->SetSender(senderKey->getKey()); + plKey senderKey = pyKey::ConvertFrom(sender)->getKey(); + newObj->fThis->SetSender(senderKey); } if (recvr != NULL) { - pyKey *recvrKey = pyKey::ConvertFrom(recvr); - newObj->fThis->AddRecvr(recvrKey->getKey()); + plKey recvrKey = pyKey::ConvertFrom(recvr)->getKey(); + newObj->fThis->AddRecvr(recvrKey); } newObj->fThis->SetNetForce(false); return (PyObject*)newObj; diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h b/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h index b1e61a16..c953ee63 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyPhysics.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper to map animation functions to plasma2 message // +#include #include "hsTemplates.h" #include "pnKeyedObject/plKey.h" -#include #include "pyGlueHelpers.h" class pyPoint3; diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp index 905a96d1..ac0b7f0c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/cyPhysicsGlue.cpp @@ -396,13 +396,13 @@ PyObject *cyPhysics::New(PyObject *sender, PyObject *recvr) ptPhysics *newObj = (ptPhysics*)ptPhysics_type.tp_new(&ptPhysics_type, NULL, NULL); if (sender != NULL) { - pyKey *senderKey = pyKey::ConvertFrom(sender); - newObj->fThis->SetSender(senderKey->getKey()); + plKey senderKey = pyKey::ConvertFrom(sender)->getKey(); + newObj->fThis->SetSender(senderKey); } if (recvr != NULL) { - pyKey *recvrKey = pyKey::ConvertFrom(recvr); - newObj->fThis->AddRecvr(recvrKey->getKey()); + plKey recvrKey = pyKey::ConvertFrom(recvr)->getKey(); + newObj->fThis->AddRecvr(recvrKey); } newObj->fThis->SetNetForce(false); return (PyObject*)newObj; @@ -420,4 +420,4 @@ void cyPhysics::AddPlasmaClasses(PyObject *m) PYTHON_CLASS_IMPORT_START(m); PYTHON_CLASS_IMPORT(m, ptPhysics); PYTHON_CLASS_IMPORT_END(m); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h b/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h index 7078705c..9e16611e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h +++ b/Sources/Plasma/FeatureLib/pfPython/cyPythonInterface.h @@ -46,9 +46,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // NOTE: Eventually, this will be made into a separate dll, because there should // only be one instance of this interface. // +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #if defined(HAVE_CYPYTHONIDE) && !defined(PLASMA_EXTERNAL_RELEASE) #include "../../Apps/CyPythonIDE/plCyDebug/plCyDebServer.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp index 24970057..6714954e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.cpp @@ -46,6 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // This modifier will handle the interface to python code that has been file-ized. // ////////////////////////////////////////////////////////////////////////// +#include "plPythonFileMod.h" #include "HeadSpin.h" #include "hsStream.h" @@ -97,7 +98,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plProfile.h" -#include "plPythonFileMod.h" #include "cyPythonInterface.h" #include "pyKey.h" #include "cyDraw.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h index 8c23857e..062a6aea 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonFileMod.h @@ -49,12 +49,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // This modifier will handle the interface to python code that has been file-ized. // ////////////////////////////////////////////////////////////////////// +#include #include "pnModifier/plMultiModifier.h" #include "hsGeometry3.h" #include "hsResMgr.h" -#include #include "plPythonParameter.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp b/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp index d44cd821..f672fbb4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonPack.cpp @@ -39,9 +39,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include "plPythonPack.h" #include "HeadSpin.h" #include "hsStlUtils.h" -#include "plPythonPack.h" #include "hsStream.h" #include "plFile/hsFiles.h" #include "plFile/plSecureStream.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonPack.h b/Sources/Plasma/FeatureLib/pfPython/plPythonPack.h index b1a98cd5..9a35c547 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonPack.h +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonPack.h @@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef plPythonPack_h_inc #define plPythonPack_h_inc -#include "Python.h" +#include #include "HeadSpin.h" namespace PythonPack diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp index 79d75164..bd7026a2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.cpp @@ -39,7 +39,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ -#include "HeadSpin.h" #include "plPythonSDLModifier.h" #include "cyPythonInterface.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h index 1181e06a..604d0ae8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h +++ b/Sources/Plasma/FeatureLib/pfPython/plPythonSDLModifier.h @@ -46,10 +46,12 @@ class plPythonFileMod; class plStateDataRecord; class plSimpleStateVariable; +#include + +#include "HeadSpin.h" #include "hsStlUtils.h" #include "plModifier/plSDLModifier.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp index 853b1b02..3ce53b32 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.cpp @@ -39,9 +39,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include "pyAgeInfoStruct.h" #include "hsStlUtils.h" +#include "pnUtils/pnUtCrypt.h" -#include "pyAgeInfoStruct.h" /////////////////////////////////////////////////////////////////////////// @@ -133,8 +134,10 @@ void pyAgeInfoStruct::SetAgeInstanceGuid( const char * guid ) CryptDigest(kCryptMd5, instanceGuid.fData , y.length(), y.c_str()); fAgeInfo.SetAgeInstanceGuid(&instanceGuid); } - else - fAgeInfo.SetAgeInstanceGuid( &plUUID( guid ) ); + else { + plUUID temp(guid); + fAgeInfo.SetAgeInstanceGuid( &temp ); + } } int32_t pyAgeInfoStruct::GetAgeSequenceNumber() const @@ -220,7 +223,8 @@ const char * pyAgeInfoStructRef::GetAgeInstanceGuid() const void pyAgeInfoStructRef::SetAgeInstanceGuid( const char * guid ) { - fAgeInfo.SetAgeInstanceGuid( &plUUID( guid ) ); + plUUID tmp(guid); + fAgeInfo.SetAgeInstanceGuid( &tmp ); } int32_t pyAgeInfoStructRef::GetAgeSequenceNumber() const diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h index fba8b231..039970e9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeInfoStruct.h @@ -41,12 +41,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #ifndef pyAgeInfoStruct_h_inc #define pyAgeInfoStruct_h_inc +#include #include "HeadSpin.h" #include "hsStlUtils.h" #include "plNetCommon/plNetServerSessionInfo.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.cpp b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.cpp index 7c18bac1..744a89db 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.cpp @@ -39,9 +39,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include "pyAgeLinkStruct.h" #include "hsStlUtils.h" -#include "pyAgeLinkStruct.h" #include "pySpawnPointInfo.h" /////////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h index f21e554d..ca6528c0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeLinkStruct.h @@ -42,12 +42,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pyAgeLinkStruct_h_inc #define pyAgeLinkStruct_h_inc +#include #include "HeadSpin.h" #include "hsStlUtils.h" #include "plNetCommon/plNetServerSessionInfo.h" #include "pyAgeInfoStruct.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h index d2d40a8a..8560c0fa 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h @@ -51,11 +51,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyAgeVault - a wrapper class to provide interface to the plVaultAgeNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" class pyVaultNode; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAlarm.h b/Sources/Plasma/FeatureLib/pfPython/pyAlarm.h index e0d3a30f..0f86310c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAlarm.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAlarm.h @@ -42,9 +42,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pyAlarm_h_inc #define pyAlarm_h_inc +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include struct pyAlarm; class pyAlarmMgr diff --git a/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h b/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h index 4a0edf63..382a2851 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyAudioControl.h @@ -48,9 +48,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" -#include #include "pyGlueHelpers.h" class pyAudioControl diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue.cpp index 1f7eb058..cca82970 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue.cpp @@ -39,7 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include #include "pyCCRMgr.h" #include "pyAgeLinkStruct.h" -#include diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue2.cpp b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue2.cpp index 52592ada..2dc8cdc8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue2.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyCCRMgrGlue2.cpp @@ -39,6 +39,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include #include "pyCCRMgr.h" -#include diff --git a/Sources/Plasma/FeatureLib/pfPython/pyCluster.h b/Sources/Plasma/FeatureLib/pfPython/pyCluster.h index 9b29be1a..311e82a2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyCluster.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyCluster.h @@ -42,9 +42,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pyCluster_h #define pyCluster_h +#include #include "pyKey.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// @@ -79,4 +79,4 @@ public: }; -#endif // pyCluster_h \ No newline at end of file +#endif // pyCluster_h diff --git a/Sources/Plasma/FeatureLib/pfPython/pyColor.h b/Sources/Plasma/FeatureLib/pfPython/pyColor.h index 9b311e85..4452e0c2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyColor.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyColor.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyColor - the wrapper class for hsColorRGBA structure // ////////////////////////////////////////////////////////////////////// +#include #include "hsColorRGBA.h" -#include #include "pyGlueHelpers.h" class pyColor diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h index 8fe5a383..4370a2d6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniCoordinates.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsGeometry3.h" -#include #include "pyGlueHelpers.h" class plDniCoordinateInfo; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp index a761e26c..4fbd03ca 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp @@ -39,11 +39,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ +#include "pyDniInfoSource.h" #include "pnUtils/pnUtils.h" #include "plUnifiedTime/plUnifiedTime.h" #include "plVault/plAgeInfoSource.h" #include "plVault/plVault.h" -#include "pyDniInfoSource.h" #include "pyDniCoordinates.h" pyDniInfoSource::pyDniInfoSource() diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h index 9fe1881f..e22a31f3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h @@ -41,12 +41,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #ifndef pyDniInfoSource_h_inc #define pyDniInfoSource_h_inc +#include #include "HeadSpin.h" #include "hsStlUtils.h" - -#include #include "pyGlueHelpers.h" class pyDniCoordinates; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h b/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h index 29ce034f..18b535a6 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDrawControl.h @@ -47,12 +47,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyDrawControl - a wrapper class all the draw/pipeline control functions // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" class pyDrawControl diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp index 63b48590..3ad7aa99 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.cpp @@ -46,6 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // ////////////////////////////////////////////////////////////////////////////// +#include "pyDynamicText.h" #include "plgDispatch.h" #include "plMessage/plDynamicTextMsg.h" #include "pyKey.h" @@ -54,7 +55,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyImage.h" #include "plGImage/plDynamicTextMap.h" -#include "pyDynamicText.h" pyDynamicText::pyDynamicText() { @@ -154,7 +154,8 @@ void pyDynamicText::ClearToColor( pyColor& color ) plDynamicTextMsg* pMsg = ICreateDTMsg(); if ( pMsg ) { - pMsg->ClearToColor(color.getColor()); + hsColorRGBA col = color.getColor(); + pMsg->ClearToColor(col); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } @@ -193,7 +194,8 @@ void pyDynamicText::SetTextColor2( pyColor& color, bool blockRGB ) plDynamicTextMsg* pMsg = ICreateDTMsg(); if ( pMsg ) { - pMsg->SetTextColor(color.getColor(),blockRGB); + hsColorRGBA col = color.getColor(); + pMsg->SetTextColor(col,blockRGB); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } } @@ -215,7 +217,8 @@ void pyDynamicText::FillRect( uint16_t left, uint16_t top, uint16_t right, uint1 plDynamicTextMsg* pMsg = ICreateDTMsg(); if ( pMsg ) { - pMsg->FillRect(left,top,right,bottom,color.getColor()); + hsColorRGBA col = color.getColor(); + pMsg->FillRect(left,top,right,bottom,col); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } } @@ -226,7 +229,8 @@ void pyDynamicText::FrameRect( uint16_t left, uint16_t top, uint16_t right, uint plDynamicTextMsg* pMsg = ICreateDTMsg(); if ( pMsg ) { - pMsg->FrameRect(left,top,right,bottom,color.getColor()); + hsColorRGBA col = color.getColor(); + pMsg->FrameRect(left,top,right,bottom,col); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } } @@ -311,7 +315,8 @@ void pyDynamicText::DrawImage( uint16_t x, uint16_t y, pyImage& image, hsBool re plDynamicTextMsg* pMsg = ICreateDTMsg(); if ( pMsg ) { - pMsg->DrawImage( x, y, image.GetKey(), respectAlpha); + plKey k = image.GetKey(); + pMsg->DrawImage( x, y, k, respectAlpha); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } } @@ -326,7 +331,8 @@ void pyDynamicText::DrawImageClipped( uint16_t x, uint16_t y, pyImage& image, ui plDynamicTextMsg* pMsg = ICreateDTMsg(); if ( pMsg ) { - pMsg->DrawClippedImage( x, y, image.GetKey(), cx, cy, cw, ch, respectAlpha); + plKey k = image.GetKey(); + pMsg->DrawClippedImage( x, y, k, cx, cy, cw, ch, respectAlpha); plgDispatch::MsgSend( pMsg ); // whoosh... off it goes } } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h index 0088f6bb..665f495c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyDynamicText.h @@ -53,10 +53,11 @@ class pyKey; class pyColor; class pyImage; +#include #include "hsTemplates.h" #include "hsStlUtils.h" +#include "hsResMgr.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.cpp index 7baee232..543e2457 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.cpp @@ -43,12 +43,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // /////////////////////////////////////////////// +#include "pyGUIControl.h" #include "pfGameGUIMgr/pfGUIControlMod.h" #include "pfGameGUIMgr/pfGUIDialogMod.h" #include "pyKey.h" -#include "pyGUIControl.h" #include "pyGUIDialog.h" #include "pyColor.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h index d2d854d7..36be2c94 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControl.h @@ -49,10 +49,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyGeometry3.h" -#include #include "pyGlueHelpers.h" class pyGUIDialog; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h index 2c504714..c27b9a25 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlButton.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlButton // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyGeometry3.h" -#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h index 37549191..8e13fa7b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlCheckBox.h @@ -49,9 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" -#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h index 6cda66db..c27d0502 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlClickMap.h @@ -49,9 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" -#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h index eaaa0090..89b65d56 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDragBar.h @@ -49,9 +49,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" -#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h index 2fdecfd6..83c72ff3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDraggable.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlDraggable // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" -#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h index 86afe0b1..a4f9f2f0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlDynamicText.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlDynamicText // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyGUIControl.h" -#include #include "pyGlueHelpers.h" class pyDynamicText; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h index c3bd31fa..56c6a495 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlEditBox.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlEditBox // ////////////////////////////////////////////////////////////////////// +#include #include "hsStlUtils.h" #include "pyKey.h" -#include #include "pyGlueHelpers.h" #include "pyGUIControl.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp index 113480b8..083cbc87 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.cpp @@ -250,7 +250,7 @@ class pfColorListElement : public pfGUIListText { size_t length = wcslen( fString1 ) + wcslen( fString2 ) + 3; thestring = new wchar_t[ length ]; - snwprintf( thestring, length, L"%s %s", fString1, fString2 ); + hsSnwprintf( thestring, length, L"%s %s", fString1, fString2 ); wemade_string = true; } else if (fString1) diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h index 8b8f8d97..ce813ef8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlListBox.h @@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControl (such as Button, ListBox, etc.) // ////////////////////////////////////////////////////////////////////// +#include #include "hsTemplates.h" @@ -55,7 +56,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "pyKey.h" #include "pyGUIControl.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp index 561fa415..0bdefb1b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp @@ -182,7 +182,7 @@ void pyGUIControlMultiLineEdit::SetEncodedBuffer( PyObject* buffer_object ) { // something to do here... later uint8_t* daBuffer = nil; - int length; + ssize_t length; PyObject_AsReadBuffer( buffer_object, (const void**)&daBuffer, &length); if ( daBuffer != nil ) { @@ -218,7 +218,7 @@ void pyGUIControlMultiLineEdit::SetEncodedBufferW( PyObject* buffer_object ) { // something to do here... later uint16_t* daBuffer = nil; - int length; + ssize_t length; PyObject_AsReadBuffer( buffer_object, (const void**)&daBuffer, &length); if ( daBuffer != nil ) { @@ -392,7 +392,8 @@ void pyGUIControlMultiLineEdit::InsertColor( pyColor& color ) pfGUIMultiLineEditCtrl* pbmod = pfGUIMultiLineEditCtrl::ConvertNoRef(fGCkey->ObjectIsLoaded()); if ( pbmod ) { - pbmod->InsertColor(color.getColor()); + hsColorRGBA col = color.getColor(); + pbmod->InsertColor(col); } } } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h index 1db5213f..d0d2799b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlMultiLineEdit // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyGUIControl.h" -#include #include "pyGlueHelpers.h" class pyColor; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h index a5a6c63f..ed056d5a 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlRadioGroup.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlRadioGroup // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyGUIControl.h" -#include #include "pyGlueHelpers.h" class pyGUIControlRadioGroup :public pyGUIControl diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h index 53436613..1efa3f0c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlTextBox.h @@ -48,12 +48,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a GUIControlTextBox // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyGUIControl.h" #include "pfGameGUIMgr/pfGUIControlMod.h" -#include #include "pyGlueHelpers.h" class pyColor; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h index 5e2689b9..da74181f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialog.h @@ -49,10 +49,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "hsStlUtils.h" #include "pyKey.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp index 82c440dc..749c66d5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIDialogGlue.cpp @@ -378,4 +378,4 @@ void pyGUIDialog::AddPlasmaMethods(std::vector &methods) PYTHON_BASIC_GLOBAL_METHOD(methods, PtGUICursorOff); PYTHON_BASIC_GLOBAL_METHOD(methods, PtGUICursorOn); PYTHON_BASIC_GLOBAL_METHOD(methods, PtGUICursorDimmed); -} \ No newline at end of file +} diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h index 4f453ba5..c2c5e943 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIPopUpMenu.h @@ -49,11 +49,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "pfGameGUIMgr/pfGUIPopUpMenu.h" #include "pyKey.h" -#include #include "pyGlueHelpers.h" class pyColor; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h b/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h index b0112dfc..bf0bca76 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGameScore.h @@ -49,10 +49,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: a wrapper class to provide access to a game score // +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" struct pfGameScore; @@ -87,4 +87,4 @@ public: bool SetPoints(int numPoints); }; -#endif \ No newline at end of file +#endif diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h b/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h index 92df489b..a7511020 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGeometry3.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyGeometry3 - the wrapper class for hsPoint3 and hsVector3 // ////////////////////////////////////////////////////////////////////// +#include #include "hsGeometry3.h" -#include #include "pyGlueHelpers.h" class pyPoint3 diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h b/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h index 195c014f..4a4754c0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyGrassShader.h @@ -42,11 +42,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pyGrassShader_h #define pyGrassShader_h +#include #include "hsStlUtils.h" #include "pyKey.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyImage.h b/Sources/Plasma/FeatureLib/pfPython/pyImage.h index f5791847..86e9337f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyImage.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyImage.h @@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // PURPOSE: Class wrapper for Python to a plMipMap image // +#include #include "hsStlUtils.h" #include "pyKey.h" @@ -59,7 +60,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plGImage/plMipmap.h" #endif -#include #include "pyGlueHelpers.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h index 23c6b085..e6898571 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyJournalBook.h @@ -48,12 +48,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "hsStlUtils.h" #include "pyKey.h" #include "pyGeometry3.h" -#include #include "pyGlueHelpers.h" class pyImage; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKey.h b/Sources/Plasma/FeatureLib/pfPython/pyKey.h index e966120d..88236b11 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKey.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyKey.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyKey - the wrapper class around a plKey so that Python can handle it // ////////////////////////////////////////////////////////////////////// +#include #include "pnKeyedObject/plKey.h" -#include #include "pyGlueHelpers.h" class plPythonFileMod; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h b/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h index b0f295f0..71a56f12 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyKeyMap.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "pnInputCore/plKeyMap.h" -#include #include "pyGlueHelpers.h" class pyKeyMap diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h index c6e470f7..1ece9214 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyMarkerMgr.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyMarkerMgr - a wrapper class to provide interface to the pfMarkerMgr stuff // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" -#include #include "pyGlueHelpers.h" class pyMarkerMgr diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h index 05382273..cfce21e4 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyMatrix44.h @@ -41,13 +41,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #ifndef pyMatrix44_h_inc #define pyMatrix44_h_inc +#include #include "hsStlUtils.h" #include "hsMatrix44.h" #include "pyGeometry3.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h index 0e6a0faf..af28c7f8 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyMoviePlayer.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyMoviePlayer - a wrapper class all the movie player functions // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "pyColor.h" -#include #include "pyGlueHelpers.h" class pyMoviePlayer diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.cpp b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.cpp index 67b227f8..d9e4ec24 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.cpp @@ -44,9 +44,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com # error "pyNetLinkingMgr is not compatible with pyPlasma.pyd. Use BUILDING_PYPLASMA macro to ifdef out unwanted headers." #endif +#include "pyNetLinkingMgr.h" #include "hsStlUtils.h" -#include "pyNetLinkingMgr.h" #include "plNetClient/plNetLinkingMgr.h" #include "plAvatar/plAvatarMgr.h" #include "plAvatar/plArmatureMod.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h index 271f8f72..99d3b467 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetLinkingMgr.h @@ -41,11 +41,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #ifndef pyNetLinkingMgr_h_inc #define pyNetLinkingMgr_h_inc +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h b/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h index 3d351a5e..19b49ecb 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyNetServerSessionInfo.h @@ -41,12 +41,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #ifndef pyNetServerSessionInfo_h_inc #define pyNetServerSessionInfo_h_inc +#include #include "HeadSpin.h" #include "plNetCommon/plNetServerSessionInfo.h" #include "pnUUID/pnUUID.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp b/Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp index 9352eeaf..a8846251 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyNotify.cpp @@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyNotify - a wrapper class to provide interface to send a NotifyMsg // ////////////////////////////////////////////////////////////////////// +#include "pyNotify.h" #include "plgDispatch.h" #include "pnMessage/plNotifyMsg.h" @@ -51,7 +52,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plPythonFileMod.h" #include "pyGeometry3.h" -#include "pyNotify.h" pyNotify::pyNotify() { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyNotify.h b/Sources/Plasma/FeatureLib/pfPython/pyNotify.h index 72eb86c7..b02b6ffe 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyNotify.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyNotify.h @@ -48,12 +48,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "pnMessage/plNotifyMsg.h" #include "pyKey.h" #include "pyGeometry3.h" -#include #include "pyGlueHelpers.h" class pyNotify diff --git a/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h b/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h index a90c716e..22dad7c2 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyPlayer.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: Class wrapper for Python to the player data // +#include #include "hsStlUtils.h" #include "pyKey.h" -#include #include "pyGlueHelpers.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pySDL.h b/Sources/Plasma/FeatureLib/pfPython/pySDL.h index 17e1ec49..c27bb919 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySDL.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySDL.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pySDL - python subset of the plSDL library. // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" class plStateDataRecord; diff --git a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp index 1764244a..2242a42f 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.cpp @@ -39,8 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com Mead, WA 99021 *==LICENSE==*/ -#include "HeadSpin.h" // TEMP, for STL warnings #include "pySceneObject.h" +#include "HeadSpin.h" // TEMP, for STL warnings #include "pnKeyedObject/plKey.h" #include "cyAvatar.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h index a4a380e2..dd35819d 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySceneObject.h @@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // attached to a SceneObject // ////////////////////////////////////////////////////////////////////// +#include #include "pyKey.h" #include "cyDraw.h" @@ -57,7 +58,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyScoreMgr.h b/Sources/Plasma/FeatureLib/pfPython/pyScoreMgr.h index 970a24c4..8cafbff0 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyScoreMgr.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyScoreMgr.h @@ -48,11 +48,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // PURPOSE: a wrapper class to provide an interface to the scoring system // +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" @@ -112,4 +112,4 @@ public: ); }; -#endif \ No newline at end of file +#endif diff --git a/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h b/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h index c12e9d70..88901f86 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySpawnPointInfo.h @@ -41,12 +41,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com *==LICENSE==*/ #ifndef pySpawnPointInfo_h_inc #define pySpawnPointInfo_h_inc +#include #include "HeadSpin.h" #include "hsStlUtils.h" #include "plNetCommon/plSpawnPointInfo.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h b/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h index 60b59c4e..390e4ef1 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyStatusLog.h @@ -48,10 +48,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // // and interface to the ChatLog (ptChatStatusLog) ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" -#include #include "pyGlueHelpers.h" #include "pyColor.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyStream.h b/Sources/Plasma/FeatureLib/pfPython/pyStream.h index 7da64f6d..4845b6ba 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyStream.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyStream.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyStream - a wrapper class to provide interface to the File stream stuff // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h index 385ca669..9f06495b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h +++ b/Sources/Plasma/FeatureLib/pfPython/pySwimCurrentInterface.h @@ -42,9 +42,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pySwimCurrentInterface_h #define pySwimCurrentInterface_h +#include #include "pyKey.h" -#include #include "pyGlueHelpers.h" class pySwimCurrentInterface @@ -88,4 +88,4 @@ public: void disable(); }; -#endif \ No newline at end of file +#endif diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp index e4e05880..b1444ce9 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVault.cpp @@ -575,7 +575,8 @@ void pyVault::UnRegisterVisitAge( const char * guidstr ) Uuid uuid; GuidFromString(guidstr, &uuid); plAgeInfoStruct info; - info.SetAgeInstanceGuid(&plUUID(uuid)); + plUUID guid(uuid); + info.SetAgeInstanceGuid(&guid); VaultUnregisterVisitAgeAndWait(&info); } @@ -583,7 +584,7 @@ void pyVault::UnRegisterVisitAge( const char * guidstr ) void _InvitePlayerToAge(ENetError result, void* state, void* param, RelVaultNode* node) { if (result == kNetSuccess) - VaultSendNode(node, (uint32_t)param); + VaultSendNode(node, (uint32_t)((uintptr_t)param)); } void pyVault::InvitePlayerToAge( const pyAgeLinkStruct & link, uint32_t playerID ) @@ -602,13 +603,14 @@ void pyVault::InvitePlayerToAge( const pyAgeLinkStruct & link, uint32_t playerID void _UninvitePlayerToAge(ENetError result, void* state, void* param, RelVaultNode* node) { if (result == kNetSuccess) - VaultSendNode(node, (uint32_t)param); + VaultSendNode(node, (uint32_t)((uintptr_t)param)); } void pyVault::UnInvitePlayerToAge( const char * str, uint32_t playerID ) { plAgeInfoStruct info; - info.SetAgeInstanceGuid(&plUUID(str)); + plUUID guid(str); + info.SetAgeInstanceGuid(&guid); if (RelVaultNode * rvnLink = VaultGetOwnedAgeLinkIncRef(&info)) { if (RelVaultNode * rvnInfo = rvnLink->GetChildNodeIncRef(plVault::kNodeType_AgeInfo, 1)) { @@ -667,7 +669,8 @@ void pyVault::CreateNeighborhood() xtl::format( desc, "%s's %s", nc->GetPlayerName(), link.GetAgeInfo()->GetAgeInstanceName() ); } - link.GetAgeInfo()->SetAgeInstanceGuid(&plUUID(GuidGenerate())); + plUUID guid(GuidGenerate()); + link.GetAgeInfo()->SetAgeInstanceGuid(&guid); link.GetAgeInfo()->SetAgeUserDefinedName( title.c_str() ); link.GetAgeInfo()->SetAgeDescription( desc.c_str() ); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVault.h b/Sources/Plasma/FeatureLib/pfPython/pyVault.h index ec67026d..1d52c5da 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVault.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVault.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVault - a wrapper class to provide interface to the plVault and the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" -#include #include "pyGlueHelpers.h" class plKey; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h index 231a96c9..c6ba4313 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoListNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultAgeInfoListNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultFolderNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp index 11e6f81c..559b9601 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.cpp @@ -44,10 +44,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultAgeInfoNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include "pyVaultAgeInfoNode.h" #include "hsStlUtils.h" -#include "pyVaultAgeInfoNode.h" #include "pyVaultAgeInfoListNode.h" #include "pyVaultPlayerInfoListNode.h" #include "pyVaultPlayerInfoNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h index 0e01f9ac..7e5a0f21 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeInfoNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultAgeInfoNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h index db713571..162f4d41 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultAgeLinkNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultAgeLinkNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h index e1b262a4..59504e8b 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultChronicleNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultChronicleNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h index 50d123d2..2c0a236e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultFolderNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultFolderNode - a wrapper class to provide interface to the plVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp index 2b96a240..f6101a53 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp @@ -211,7 +211,7 @@ void pyVaultImageNode::SetImageFromBuf( PyObject * pybuf ) } uint8_t * buffer = nil; - int bytes; + ssize_t bytes; PyObject_AsReadBuffer(pybuf, (const void **)&buffer, &bytes); if (buffer) { VaultImageNode access(fNode); diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h index 8e13f539..daefefb5 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultImageNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp index b2f60bcb..8821e7d3 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.cpp @@ -44,11 +44,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultMarkerGameNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include "pyVaultMarkerGameNode.h" #include "hsStlUtils.h" -#include "pyVaultMarkerGameNode.h" - #include "plVault/plVault.h" // should only be created from C++ side diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h index 183ab7bd..7af1e406 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultMarkerGameNode.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultMarkerGameNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp index d030a55d..e5afc01e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.cpp @@ -82,7 +82,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com /////////////////////////////////////////////////////////////////////////// -static void __cdecl LogDumpProc ( +static void CDECL LogDumpProc ( void * , const wchar_t fmt[], ... diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h index 1d770781..55d8c312 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNode.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" struct RelVaultNode; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h index d93545f0..401a8657 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultNodeRef.h @@ -47,10 +47,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultNodeRef - a wrapper class to provide interface to the plVaultNodeRef // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" -#include #include "pyGlueHelpers.h" struct RelVaultNode; diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h index 25d72457..d5da151e 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoListNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultPlayerInfoListNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultFolderNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h index 1ba6b5fa..6318dbea 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerInfoNode.h @@ -48,8 +48,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// -#include "pyVaultNode.h" #include +#include "pyVaultNode.h" #include "pyGlueHelpers.h" class pyVaultPlayerInfoNode : public pyVaultNode diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp index 20946203..a09bd428 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.cpp @@ -238,7 +238,8 @@ void pyVaultPlayerNode::RemoveVisitAgeLink(const char *guidstr) Uuid uuid; GuidFromString(guidstr, &uuid); plAgeInfoStruct info; - info.SetAgeInstanceGuid(&plUUID(uuid)); + plUUID guid(uuid); + info.SetAgeInstanceGuid(&guid); VaultUnregisterOwnedAgeAndWait(&info); } diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h index f319d06a..18900214 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultPlayerNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultPlayerNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pfPython/pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h index ccf3523b..fe32d5ac 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSDLNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultSDLNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h index 3d8da8f4..87143b72 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultSystemNode.h @@ -47,11 +47,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // pyVaultSystemNode - a wrapper class to provide interface to the RelVaultNode // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h index 3a7bbd6a..b2c05932 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultTextNoteNode.h @@ -48,9 +48,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com // ////////////////////////////////////////////////////////////////////// +#include #include "HeadSpin.h" #include "hsStlUtils.h" -#include #include "pyGlueHelpers.h" #include "pyVaultNode.h" diff --git a/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h b/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h index e9c095e3..d0560da7 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h +++ b/Sources/Plasma/FeatureLib/pfPython/pyWaveSet.h @@ -42,11 +42,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef pyWaveSet_h #define pyWaveSet_h +#include #include "pyKey.h" #include "pyGeometry3.h" #include "pyColor.h" -#include #include "pyGlueHelpers.h" ////////////////////////////////////////////////////////////////////// @@ -216,4 +216,4 @@ public: }; -#endif // pyWaveSet_h \ No newline at end of file +#endif // pyWaveSet_h From be9dca97e8d9107b01f7d689910478c1a4b89934 Mon Sep 17 00:00:00 2001 From: NadnerbD Date: Wed, 1 Feb 2012 00:13:58 -0500 Subject: [PATCH 33/51] Separated line histories for python and normal console modes --- .../Plasma/FeatureLib/pfConsole/pfConsole.cpp | 31 +++++++++---------- .../Plasma/FeatureLib/pfConsole/pfConsole.h | 7 +++-- 2 files changed, 20 insertions(+), 18 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp index 0e028081..e10648cc 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp @@ -225,7 +225,6 @@ void pfConsole::Init( pfConsoleEngine *engine ) fWorkingCursor = 0; memset( fHistory, 0, sizeof( fHistory ) ); - fHistoryCursor = fHistoryRecallCursor = 0; fEffectCounter = 0; fMode = 0; @@ -626,11 +625,11 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg ) } else if( msg->GetKeyCode() == KEY_UP ) { - i = ( fHistoryRecallCursor > 0 ) ? fHistoryRecallCursor - 1 : kNumHistoryItems - 1; - if( fHistory[ i ][ 0 ] != 0 ) + i = ( fHistory[ fPythonMode ].fRecallCursor > 0 ) ? fHistory[ fPythonMode ].fRecallCursor - 1 : kNumHistoryItems - 1; + if( fHistory[ fPythonMode ].fData[ i ][ 0 ] != 0 ) { - fHistoryRecallCursor = i; - strcpy( fWorkingLine, fHistory[ fHistoryRecallCursor ] ); + fHistory[ fPythonMode ].fRecallCursor = i; + strcpy( fWorkingLine, fHistory[ fPythonMode ].fData[ fHistory[ fPythonMode ].fRecallCursor ] ); findAgain = false; findCounter = 0; fWorkingCursor = strlen( fWorkingLine ); @@ -639,18 +638,18 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg ) } else if( msg->GetKeyCode() == KEY_DOWN ) { - if( fHistoryRecallCursor != fHistoryCursor ) + if( fHistory[ fPythonMode ].fRecallCursor != fHistory[ fPythonMode ].fCursor ) { - i = ( fHistoryRecallCursor < kNumHistoryItems - 1 ) ? fHistoryRecallCursor + 1 : 0; - if( i != fHistoryCursor ) + i = ( fHistory[ fPythonMode ].fRecallCursor < kNumHistoryItems - 1 ) ? fHistory[ fPythonMode ].fRecallCursor + 1 : 0; + if( i != fHistory[ fPythonMode ].fCursor ) { - fHistoryRecallCursor = i; - strcpy( fWorkingLine, fHistory[ fHistoryRecallCursor ] ); + fHistory[ fPythonMode ].fRecallCursor = i; + strcpy( fWorkingLine, fHistory[ fPythonMode ].fData[ fHistory[ fPythonMode ].fRecallCursor ] ); } else { memset( fWorkingLine, 0, sizeof( fWorkingLine ) ); - fHistoryRecallCursor = fHistoryCursor; + fHistory[ fPythonMode ].fRecallCursor = fHistory[ fPythonMode ].fCursor; } findAgain = false; findCounter = 0; @@ -726,9 +725,9 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg ) if( fWorkingLine[ 0 ] != 0 ) { // Save to history - strcpy( fHistory[ fHistoryCursor ], fWorkingLine ); - fHistoryCursor = ( fHistoryCursor < kNumHistoryItems - 1 ) ? fHistoryCursor + 1 : 0; - fHistoryRecallCursor = fHistoryCursor; + strcpy( fHistory[ fPythonMode ].fData[ fHistory[ fPythonMode ].fCursor ], fWorkingLine ); + fHistory[ fPythonMode ].fCursor = ( fHistory[ fPythonMode ].fCursor < kNumHistoryItems - 1 ) ? fHistory[ fPythonMode ].fCursor + 1 : 0; + fHistory[ fPythonMode ].fRecallCursor = fHistory[ fPythonMode ].fCursor; } // EXECUTE!!! (warning: DESTROYS fWorkingLine) @@ -772,10 +771,10 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg ) for ( i=fPythonMultiLines; i>0 ; i--) { // reach back in the history and find this line and paste it in here - int recall = fHistoryCursor - i; + int recall = fHistory[ fPythonMode ].fCursor - i; if ( recall < 0 ) recall += kNumHistoryItems; - strcat(biglines,fHistory[ recall ]); + strcat(biglines,fHistory[ fPythonMode ].fData[ recall ]); strcat(biglines,"\n"); } // now evaluate this mess they made diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.h b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.h index c1e9803d..3ddc1961 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.h +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.h @@ -76,6 +76,7 @@ class pfConsole : public hsKeyedObject enum Konstants { kNumHistoryItems = 16, + kNumHistoryTypes = 2, kModeHidden = 0, kModeSingleLine = 1, kModeFull = 2, @@ -100,8 +101,10 @@ class pfConsole : public hsKeyedObject short fCursorTicks; uint32_t fMsgTimeoutTimer; - char fHistory[ kNumHistoryItems ][ kMaxCharsWide ]; - uint32_t fHistoryCursor, fHistoryRecallCursor; + struct _fHistory { + char fData[ kNumHistoryItems ][ kMaxCharsWide ]; + uint32_t fCursor, fRecallCursor; + } fHistory[ kNumHistoryTypes ]; char *fDisplayBuffer; char fWorkingLine[ kWorkingLineSize ]; uint32_t fWorkingCursor; From 02118488bd3c509eb60616fc85ff0a38cb96ef23 Mon Sep 17 00:00:00 2001 From: NadnerbD Date: Wed, 1 Feb 2012 20:44:49 -0500 Subject: [PATCH 34/51] prevent pfConsole from crashing when inserting text into a max length line --- Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp index e10648cc..9d2d57e4 100644 --- a/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp +++ b/Sources/Plasma/FeatureLib/pfConsole/pfConsole.cpp @@ -873,7 +873,7 @@ void pfConsole::IHandleKey( plKeyEventMsg *msg ) } } // or are they just typing in a working line - else if( fWorkingCursor < kMaxCharsWide - 2 && key != 0 ) + else if( strlen( fWorkingLine ) < kMaxCharsWide - 2 && key != 0 ) { for( i = strlen( fWorkingLine ) + 1; i > fWorkingCursor; i-- ) fWorkingLine[ i ] = fWorkingLine[ i - 1 ]; From 3e811a4a8702f69e263a725220e4a0ef8a740c3e Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 3 Feb 2012 09:44:22 -0500 Subject: [PATCH 35/51] More PhysX region tweaks --- .../Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp index f764521b..5393a404 100644 --- a/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp +++ b/Sources/Plasma/PubUtilLib/plPhysX/plPXPhysicalControllerCore.cpp @@ -449,7 +449,7 @@ void plPXPhysicalControllerCore::MoveKinematicToController(hsPoint3& pos) newPos.x = (NxReal)pos.fX; newPos.y = (NxReal)pos.fY; newPos.z = (NxReal)pos.fZ+kPhysZOffset; - if ((fEnabled || fKinematic) && fBehavingLikeAnimatedPhys) + if (fBehavingLikeAnimatedPhys) { if (plSimulationMgr::fExtraProfile) SimLog("Moving kinematic from %f,%f,%f to %f,%f,%f",pos.fX,pos.fY,pos.fZ+kPhysZOffset,kinPos.x,kinPos.y,kinPos.z ); @@ -491,7 +491,7 @@ void plPXPhysicalControllerCore::ISetKinematicLoc(const hsMatrix44& l2w) // add z offset kPos.fZ += kPhysZOffset; // Update the physical position of kinematic - if (fEnabled || fBehavingLikeAnimatedPhys) + if (fBehavingLikeAnimatedPhys) fKinematicActor->moveGlobalPosition(plPXConvert::Point(kPos)); else fKinematicActor->setGlobalPosition(plPXConvert::Point(kPos)); From db29c9d3259eeb295d2576abe1d8c6af08ac88af Mon Sep 17 00:00:00 2001 From: Joseph Davies Date: Fri, 3 Feb 2012 11:53:20 -0800 Subject: [PATCH 36/51] Change default fullscreen resolution to use desktop settings. --- Sources/Plasma/Apps/plClient/plClient.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/Apps/plClient/plClient.cpp b/Sources/Plasma/Apps/plClient/plClient.cpp index 968a3736..6cff6ef1 100644 --- a/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/Sources/Plasma/Apps/plClient/plClient.cpp @@ -2252,8 +2252,6 @@ void plClient::IDetectAudioVideoSettings() if(rec->GetG3DHALorHEL() == hsG3DDeviceSelector::kHHD3DRefDev) refDevice = true; - plPipeline::fDefaultPipeParams.Width = hsG3DDeviceSelector::kDefaultWidth; - plPipeline::fDefaultPipeParams.Height = hsG3DDeviceSelector::kDefaultHeight; plPipeline::fDefaultPipeParams.ColorDepth = hsG3DDeviceSelector::kDefaultDepth; #if defined(HS_DEBUGGING) || defined(DEBUG) plPipeline::fDefaultPipeParams.Windowed = true; @@ -2261,6 +2259,18 @@ void plClient::IDetectAudioVideoSettings() plPipeline::fDefaultPipeParams.Windowed = false; #endif + // Use current desktop resolution for fullscreen mode + if(!plPipeline::fDefaultPipeParams.Windowed) + { + plPipeline::fDefaultPipeParams.Width = GetSystemMetrics(SM_CXSCREEN); + plPipeline::fDefaultPipeParams.Height = GetSystemMetrics(SM_CYSCREEN); + } + else + { + plPipeline::fDefaultPipeParams.Width = hsG3DDeviceSelector::kDefaultWidth; + plPipeline::fDefaultPipeParams.Height = hsG3DDeviceSelector::kDefaultHeight; + } + plPipeline::fDefaultPipeParams.Shadows = 0; // enable shadows if TnL is available, meaning not an intel extreme. if(rec->GetG3DHALorHEL() == hsG3DDeviceSelector::kHHD3DTnLHalDev) From 1f78a7673717c8cc071692d7fde0751ec615bfee Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 3 Feb 2012 23:23:57 -0500 Subject: [PATCH 37/51] Handle failed downloads better Now, we unlink anything that fails to download. This is more useful than leaving a truncated (0 byte) file on the user's HD. --- .../PubUtilLib/plAgeLoader/plResPatcher.cpp | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp b/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp index a98d146d..c7599db3 100644 --- a/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp +++ b/Sources/Plasma/PubUtilLib/plAgeLoader/plResPatcher.cpp @@ -59,15 +59,28 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com class plResDownloadStream : public plZlibStream { plOperationProgress* fProgress; + char* fFilename; bool fIsZipped; public: plResDownloadStream(plOperationProgress* prog, const wchar_t* reqFile) - : fProgress(prog) + : fProgress(prog), fFilename(nil) { fIsZipped = wcscmp(plFileUtils::GetFileExt(reqFile), L"gz") == 0; } + ~plResDownloadStream() + { + if (fFilename) + delete[] fFilename; + } + + hsBool Open(const char* filename, const char* mode) + { + fFilename = hsStrcpy(filename); + return plZlibStream::Open(filename, mode); + } + uint32_t Write(uint32_t count, const void* buf) { fProgress->Increment((float)count); @@ -78,6 +91,7 @@ public: } bool IsZipped() const { return fIsZipped; } + void Unlink() const { plFileUtils::RemoveFile(fFilename); } }; ///////////////////////////////////////////////////////////////////////////// @@ -93,7 +107,6 @@ static void FileDownloaded( if (((plResDownloadStream*)writer)->IsZipped()) plFileUtils::StripExt(name); // Kill off .gz writer->Close(); - delete writer; switch (result) { @@ -107,6 +120,7 @@ static void FileDownloaded( // Continue down the warpath patcher->IssueRequest(); delete[] name; + delete writer; return; case kNetErrFileNotFound: PatcherLog(kError, " Download Failed: %s not found", name); @@ -119,8 +133,10 @@ static void FileDownloaded( } // Failure case + ((plResDownloadStream*)writer)->Unlink(); patcher->Finish(false); delete[] name; + delete writer; } static void ManifestDownloaded( From 2599bfbd7a8c6b145dc59d6bc6fc6f0f57764cc1 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 3 Feb 2012 23:24:49 -0500 Subject: [PATCH 38/51] Add an error message for NCAgeJoiner failures Since we have a pfSecurePreloader that doesn't redownload every single launch, I don't feel bad about presenting an error message to the user and killing the client. This is really better than letting them languish at a black screen, groping for the relto book. --- .../PubUtilLib/plNetClient/plNetLinkingMgr.cpp | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp index ea092f92..9749fb4f 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp @@ -47,6 +47,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetTransport/plNetTransportMember.h" // OfferLinkToPlayer() #include "plgDispatch.h" +#include "pnMessage/plClientMsg.h" #include "pnMessage/plTimeMsg.h" #include "plMessage/plLinkToAgeMsg.h" #include "pnKeyedObject/plKey.h" @@ -159,8 +160,19 @@ void plNetLinkingMgr::NCAgeJoinerCallback ( void * notify, void * userState ) { - plNetLinkingMgr * lm = plNetLinkingMgr::GetInstance(); + NCAgeJoinerCompleteNotify* params = (NCAgeJoinerCompleteNotify*)notify; + + // Tell the user we failed to link. + // In the future, we might want to try graceful recovery (link back to Relto?) + if (!params->success) { + plNetClientMgr::StaticErrorMsg(params->msg); + hsMessageBox(params->msg, "Linking Error", hsMessageBoxNormal, hsMessageBoxIconError); + plClientMsg* clientMsg = new plClientMsg(plClientMsg::kQuit); + clientMsg->Send(hsgResMgr::ResMgr()->FindKey(kClient_KEY)); + return; + } + plNetLinkingMgr * lm = plNetLinkingMgr::GetInstance(); switch (type) { case kAgeJoinerComplete: { ASSERT(joiner == s_ageJoiner); From e6f31948330c7cbb29b2d697fce43ffa24a77f70 Mon Sep 17 00:00:00 2001 From: branan Date: Sat, 4 Feb 2012 09:41:18 -0800 Subject: [PATCH 39/51] Only shutdown external clients on link fail --- Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp index 9749fb4f..9c0fdc9d 100644 --- a/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp +++ b/Sources/Plasma/PubUtilLib/plNetClient/plNetLinkingMgr.cpp @@ -167,8 +167,10 @@ void plNetLinkingMgr::NCAgeJoinerCallback ( if (!params->success) { plNetClientMgr::StaticErrorMsg(params->msg); hsMessageBox(params->msg, "Linking Error", hsMessageBoxNormal, hsMessageBoxIconError); +#ifdef PLASMA_EXTERNAL_RELEASE plClientMsg* clientMsg = new plClientMsg(plClientMsg::kQuit); clientMsg->Send(hsgResMgr::ResMgr()->FindKey(kClient_KEY)); +#endif return; } From b27fc17b00fd7ed8b87869212601c896e49c09c2 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 4 Feb 2012 19:13:58 -0800 Subject: [PATCH 40/51] Some fixes for the Win32 branch of pnUtils. --- .../NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp | 3 +- .../NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp | 3 +- .../NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp | 3 +- .../NucleusLib/pnUtils/Win32/pnUtW32Path.cpp | 4 +-- .../NucleusLib/pnUtils/Win32/pnUtW32Str.cpp | 3 +- .../NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp | 3 +- .../NucleusLib/pnUtils/Win32/pnUtW32Time.cpp | 3 +- .../NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp | 9 ++--- .../Plasma/NucleusLib/pnUtils/pnUtMath.cpp | 33 ------------------- Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h | 16 +-------- Sources/Plasma/NucleusLib/pnUtilsExe/Pch.h | 2 +- 11 files changed, 15 insertions(+), 67 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp index 4e7c8545..b043a71f 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Addr.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp index ff2a53d5..9c32e117 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Dll.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp index 841fc7cf..8da3adb0 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" /***************************************************************************** * diff --git a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Path.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Path.cpp index b81d199c..ccc846a6 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Path.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Path.cpp @@ -45,8 +45,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" +#include "pnProduct/pnProduct.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Str.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Str.cpp index b7fc3b76..42edb140 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Str.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Str.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp index 17c96136..e5100e52 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Sync.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" /**************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Time.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Time.cpp index cd4eea61..6f344434 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Time.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Time.cpp @@ -45,8 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" /***************************************************************************** diff --git a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp index c5a734b0..6c0b1c38 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Uuid.cpp @@ -45,8 +45,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com * ***/ -#include "../../Pch.h" -#pragma hdrstop +#include "../pnUtils.h" +#include +#include #if 0 @@ -162,12 +163,12 @@ bool GuidIsNil (const Uuid & uuid) { const wchar_t * GuidToString (const Uuid & uuid, wchar_t * dst, unsigned chars) { wchar_t * src; RPC_STATUS s; - s = UuidToStringW( (GUID *) &uuid, (RPC_WSTR*)&src ); + s = UuidToStringW( (GUID *) &uuid, (unsigned short**)&src ); if (RPC_S_OK == s) StrCopy(dst, src, chars); else StrCopy(dst, L"", chars); - RpcStringFreeW( (RPC_WSTR *)&src ); + RpcStringFreeW( (unsigned short**)&src ); return dst; } diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp index 9d240519..431ea740 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.cpp @@ -55,42 +55,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com ***/ //=========================================================================== -#ifndef _M_IX86 unsigned MathHighBitPos (uint32_t val) { ASSERT(val); double f = (double)val; return (*((uint32_t *)&f + 1) >> 20) - 1023; } - -#else - -__declspec(naked) unsigned __fastcall MathHighBitPos (uint32_t) { - __asm { - bsr eax, ecx - ret 0 - }; -} - -#endif - -//=========================================================================== -#ifndef _M_IX86 - -unsigned MathLowBitPos (uint32_t val) { - val &= ~(val - 1); // clear all but the low bit - ASSERT(val); - double f = (double)val; - return (*((uint32_t *)&f + 1) >> 20) - 1023; -} - -#else - -__declspec(naked) unsigned __fastcall MathLowBitPos (uint32_t) { - __asm { - bsf eax, ecx - ret 0 - }; -} - -#endif diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h index ae1e67b2..7080bb83 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtMath.h @@ -50,27 +50,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "Pch.h" -/***************************************************************************** -* -* Calling conventions -* -***/ - -#ifdef _M_IX86 -#define MATHCALL __fastcall -#else -#define MATHCALL -#endif - - /***************************************************************************** * * Bit manipulation functions * ***/ -unsigned MATHCALL MathLowBitPos (uint32_t val); -unsigned MATHCALL MathHighBitPos (uint32_t val); +unsigned MathHighBitPos (uint32_t val); //=========================================================================== inline unsigned MathBitCount (uint32_t val) { diff --git a/Sources/Plasma/NucleusLib/pnUtilsExe/Pch.h b/Sources/Plasma/NucleusLib/pnUtilsExe/Pch.h index aceee762..32908b69 100644 --- a/Sources/Plasma/NucleusLib/pnUtilsExe/Pch.h +++ b/Sources/Plasma/NucleusLib/pnUtilsExe/Pch.h @@ -51,7 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define PLASMA20_SOURCES_PLASMA_NUCLEUSLIB_PNUTILSEXE_PCH_H -#include "pnUtils/Pch.h" +#include "pnUtils/pnUtils.h" #include "Intern.h" #include From 8416c8ed42c492d412c05a13544e87fa1e46caef Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 4 Feb 2012 19:15:35 -0800 Subject: [PATCH 41/51] Fixes for MinGW's flawed _WIN32_WINNT stuff. --- Sources/Plasma/CoreLib/hsWindows.h | 13 ++++++++++++- .../Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp | 6 ++++-- 2 files changed, 16 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/CoreLib/hsWindows.h b/Sources/Plasma/CoreLib/hsWindows.h index 2d716736..b683c73c 100644 --- a/Sources/Plasma/CoreLib/hsWindows.h +++ b/Sources/Plasma/CoreLib/hsWindows.h @@ -58,6 +58,15 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com # pragma warning( disable : 4305 4503 4018 4786 4284 4800) # endif // _MSC_VER + // Terrible hacks for MinGW because they don't have a reasonable + // default for the Windows version. We cheat and say it's XP. +# ifdef __MINGW32__ +# undef _WIN32_WINNT +# define _WIN32_WINNT 0x501 +# undef _WIN32_IE +# define _WIN32_IE 0x400 +# endif + // Windows.h includes winsock.h (winsocks 1), so we need to manually include winsock2 // and tell Windows.h to only bring in modern headers # ifndef MAXPLUGINCODE @@ -65,7 +74,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com # include # endif // MAXPLUGINCODE # define WIN32_LEAN_AND_MEAN -# define NOMINMAX // Needed to prevent NxMath conflicts +# ifndef NOMINMAX +# define NOMINMAX // Needed to prevent NxMath conflicts +# endif # include typedef HWND hsWindowHndl; diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp index 20aafd23..9dfca82c 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp @@ -57,9 +57,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -#ifdef DX_OLD_SDK +#if defined(DX_OLD_SDK) || defined(__MINGW32__) #include - #define DXGetErrorString9 DXGetErrorString + #ifndef DXGetErrorString9 + #define DXGetErrorString9 DXGetErrorString + #endif #else #include #endif From d39a8ab298f6de0908cd33db76fc043dc19dc531 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 4 Feb 2012 19:16:50 -0800 Subject: [PATCH 42/51] Fix some minGW bugs. --- .../NucleusLib/pnProduct/Private/pnPrProductId.cpp | 2 +- Sources/Plasma/NucleusLib/pnSceneObject/CMakeLists.txt | 1 + .../Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp | 2 ++ Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt | 2 +- Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp | 10 +++++----- Sources/Tools/plResBrowser/plResTreeView.cpp | 2 +- 6 files changed, 11 insertions(+), 8 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp index d76b0fe9..5f928da1 100644 --- a/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp +++ b/Sources/Plasma/NucleusLib/pnProduct/Private/pnPrProductId.cpp @@ -119,7 +119,7 @@ const wchar_t * ProductLongName () { //============================================================================ void ProductString (wchar_t * dest, unsigned destChars) { // Example: "UruLive.2.214 - External.Release" - swprintf( + hsSnwprintf( dest, destChars, L"%s.%u.%u - %s.%s", diff --git a/Sources/Plasma/NucleusLib/pnSceneObject/CMakeLists.txt b/Sources/Plasma/NucleusLib/pnSceneObject/CMakeLists.txt index ac027b41..d33c49c4 100644 --- a/Sources/Plasma/NucleusLib/pnSceneObject/CMakeLists.txt +++ b/Sources/Plasma/NucleusLib/pnSceneObject/CMakeLists.txt @@ -23,6 +23,7 @@ set(pnSceneObject_SOURCES ) add_library(pnSceneObject STATIC ${pnSceneObject_HEADERS} ${pnSceneObject_SOURCES}) +target_link_libraries(pnSceneObject CoreLib pnKeyedObject pnNetCommon) source_group("Header Files" FILES ${pnSceneObject_HEADERS}) source_group("Source Files" FILES ${pnSceneObject_SOURCES}) diff --git a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp index 8da3adb0..e6a9837b 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/Win32/pnUtW32Misc.cpp @@ -141,6 +141,7 @@ void CpuGetInfo ( uint32_t flags[2] = { 0, 0 }; cpuVendor[0] = 0; +#ifdef _MSC_VER _asm { // Detect if cpuid instruction is supported by attempting // to change the ID bit of EFLAGS @@ -187,6 +188,7 @@ void CpuGetInfo ( DONE: } +#endif // Decode capability flags const static struct CpuCap { diff --git a/Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt b/Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt index 7ffc5080..d8629d8f 100644 --- a/Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt +++ b/Sources/Plasma/PubUtilLib/plStatusLog/CMakeLists.txt @@ -16,7 +16,7 @@ set(plStatusLog_HEADERS ) add_library(plStatusLog STATIC ${plStatusLog_SOURCES} ${plStatusLog_HEADERS}) -target_link_libraries(plStatusLog CoreLib plFile plUnifiedTime) +target_link_libraries(plStatusLog CoreLib plFile plUnifiedTime pnProduct) source_group("Source Files" FILES ${plStatusLog_SOURCES}) source_group("Header Files" FILES ${plStatusLog_HEADERS}) diff --git a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp index b7626041..ed1f488d 100644 --- a/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp +++ b/Sources/Plasma/PubUtilLib/plStatusLog/plStatusLog.cpp @@ -480,15 +480,15 @@ bool plStatusLog::IReOpen( void ) ext = L".elf"; #endif wchar_t fileToOpen[MAX_PATH]; - swprintf(fileToOpen, MAX_PATH, L"%s.0%s", fileNoExt, ext); + hsSnwprintf(fileToOpen, MAX_PATH, L"%s.0%s", fileNoExt, ext); if (!(fFlags & kDontRotateLogs)) { wchar_t work[MAX_PATH], work2[MAX_PATH]; - swprintf(work, MAX_PATH, L"%s.3%s",fileNoExt,ext); + hsSnwprintf(work, MAX_PATH, L"%s.3%s",fileNoExt,ext); plFileUtils::RemoveFile(work); - swprintf(work2, MAX_PATH, L"%s.2%s",fileNoExt,ext); + hsSnwprintf(work2, MAX_PATH, L"%s.2%s",fileNoExt,ext); plFileUtils::FileMove(work2, work); - swprintf(work, MAX_PATH, L"%s.1%s",fileNoExt,ext); + hsSnwprintf(work, MAX_PATH, L"%s.1%s",fileNoExt,ext); plFileUtils::FileMove(work, work2); plFileUtils::FileMove(fileToOpen, work); } @@ -541,7 +541,7 @@ void plStatusLog::IParseFileName(wchar_t* file, size_t fnsize, wchar_t* fileNoEx { const wchar_t *base = plStatusLogMgr::IGetBasePath(); if( wcslen( base ) != nil ) - swprintf( file, fnsize, L"%s%s%s", base, WPATH_SEPARATOR_STR, fFilename.c_str() ); + hsSnwprintf( file, fnsize, L"%s%s%s", base, WPATH_SEPARATOR_STR, fFilename.c_str() ); else wcscpy( file, fFilename.c_str() ); diff --git a/Sources/Tools/plResBrowser/plResTreeView.cpp b/Sources/Tools/plResBrowser/plResTreeView.cpp index 5bc6600d..bc661430 100644 --- a/Sources/Tools/plResBrowser/plResTreeView.cpp +++ b/Sources/Tools/plResBrowser/plResTreeView.cpp @@ -116,7 +116,7 @@ class plResDlgLoader : public plRegistryPageIterator, public plRegistryKeyIterat { TVITEM tvi = {0}; tvi.mask = TVIF_TEXT | TVIF_PARAM; - tvi.pszText = text ? (char*)text : ""; + tvi.pszText = text ? (char*)text : (char*)""; tvi.cchTextMax = text ? strlen(text) : 7; tvi.lParam = (LPARAM)info; From de2b7c347188c537e36535a86d008f00449ffffc Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 4 Feb 2012 19:17:24 -0800 Subject: [PATCH 43/51] Fix plPipeline under minGW. --- Sources/Plasma/PubUtilLib/plPipeline/plDXDeviceRefs.cpp | 2 +- Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp | 8 +++++--- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plDXDeviceRefs.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plDXDeviceRefs.cpp index 016d8175..7263ae43 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plDXDeviceRefs.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plDXDeviceRefs.cpp @@ -235,7 +235,7 @@ void plDXTextureRef::Release( void ) { plProfile_DelMem(MemTexture, fDataSize + sizeof(plDXTextureRef)); plProfile_Extern(ManagedMem); - PROFILE_POOL_MEM(D3DPOOL_MANAGED, fDataSize, false, (fOwner ? fOwner->GetKey() ? fOwner->GetKey()->GetUoid().GetObjectName() : "(UnknownTexture)" : "(UnknownTexture)")); + PROFILE_POOL_MEM(D3DPOOL_MANAGED, fDataSize, false, (char*)(fOwner ? fOwner->GetKey() ? fOwner->GetKey()->GetUoid().GetObjectName() : "(UnknownTexture)" : "(UnknownTexture)")); plDXPipeline::FreeManagedTexture(fDataSize); fDataSize = 0; diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp index 9dfca82c..16d89a6b 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp @@ -8309,7 +8309,7 @@ IDirect3DTexture9 *plDXPipeline::IMakeD3DTexture( plDXTextureRef *ref, D3DFORM ref->fMaxWidth, ref->fMaxHeight, ref->fMMLvs, ref->GetFlags() ); return nil; } - PROFILE_POOL_MEM(poolType, ref->fDataSize, true, (ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName() : "(UnknownTexture)" : "(UnknownTexture)")); + PROFILE_POOL_MEM(poolType, ref->fDataSize, true, (char*)(ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName() : "(UnknownTexture)" : "(UnknownTexture)")); fTexManaged += ref->fDataSize; return texPtr; @@ -8362,7 +8362,7 @@ IDirect3DCubeTexture9 *plDXPipeline::IMakeD3DCubeTexture( plDXTextureRef *ref, IDirect3DCubeTexture9 *texPtr = nil; fManagedAlloced = true; WEAK_ERROR_CHECK(fD3DDevice->CreateCubeTexture( ref->fMaxWidth, ref->fMMLvs, 0, formatType, poolType, &texPtr, NULL)); - PROFILE_POOL_MEM(poolType, ref->fDataSize, true, (ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName() : "(UnknownTexture)" : "(UnknownTexture)")); + PROFILE_POOL_MEM(poolType, ref->fDataSize, true, (char*)(ref->fOwner ? ref->fOwner->GetKey() ? ref->fOwner->GetKey()->GetUoid().GetObjectName() : "(UnknownTexture)" : "(UnknownTexture)")); fTexManaged += ref->fDataSize; return texPtr; } @@ -11834,7 +11834,7 @@ void plDXPipeline::ISetErrorMessage( char *errStr ) // Convert the last D3D error code to a string (probably "Conflicting Render State"). void plDXPipeline::IGetD3DError() { - sprintf( fSettings.fErrorStr, "D3DError : %s", (char *)DXGetErrorString( fSettings.fDXError ) ); + sprintf( fSettings.fErrorStr, "D3DError : %s", (char *)DXGetErrorString9( fSettings.fDXError ) ); } // IShowErrorMessage ///////////////////////////////////////////////////////////// @@ -12025,6 +12025,7 @@ const char *plDXPipeline::IGetDXFormatName( D3DFORMAT format ) // This is obsolete as of DX8 void plDXPipeline::IFPUCheck() { +#ifdef _MSC_VER WORD wSave, wTemp; __asm fstcw wSave if (wSave & 0x300 || // Not single mode @@ -12041,6 +12042,7 @@ void plDXPipeline::IFPUCheck() fldcw wTemp } } +#endif } // PushPiggyBackLayer ///////////////////////////////////////////////////// From a1b500da49fdb283476bb284de51f7da3ea0de40 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 4 Feb 2012 20:06:15 -0800 Subject: [PATCH 44/51] More MinGW fixes. --- Sources/Plasma/Apps/plClientPatcher/CMakeLists.txt | 1 + .../NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp | 2 +- Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp | 2 +- Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp | 3 --- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/Sources/Plasma/Apps/plClientPatcher/CMakeLists.txt b/Sources/Plasma/Apps/plClientPatcher/CMakeLists.txt index 21e3d82e..7e99acda 100644 --- a/Sources/Plasma/Apps/plClientPatcher/CMakeLists.txt +++ b/Sources/Plasma/Apps/plClientPatcher/CMakeLists.txt @@ -18,6 +18,7 @@ set(plClientPatcher_SOURCES ) add_library(plClientPatcher STATIC ${plClientPatcher_HEADERS} ${plClientPatcher_SOURCES}) +target_link_libraries(plClientPatcher CoreLib plAudioCore) source_group("Header Files" FILES ${plClientPatcher_HEADERS}) source_group("Source Files" FILES ${plClientPatcher_SOURCES}) diff --git a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp index e4ef0e54..cf291ac8 100644 --- a/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp +++ b/Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/W9x/pnAceW9xThread.cpp @@ -219,7 +219,7 @@ AsyncId CThreadDispObject::Queue (void * op) { ***/ //=========================================================================== -static unsigned CALLBACK W9xThreadProc (AsyncThread *) { +static unsigned THREADCALL W9xThreadProc (AsyncThread *) { // Perform the main thread loop for (;;) { diff --git a/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp b/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp index 75a44c55..91c61abc 100644 --- a/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp +++ b/Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.cpp @@ -61,7 +61,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #if HS_BUILD_FOR_WIN32 -# ifdef DX_OLD_SDK +# if defined(DX_OLD_SDK) || defined(__MINGW32__) # include # else # include diff --git a/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp b/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp index e9b3bdf2..da69d874 100644 --- a/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp +++ b/Sources/Plasma/PubUtilLib/plNetTransport/plNetTransport.cpp @@ -47,10 +47,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "plNetMessage/plNetMessage.h" #include "plNetClient/plNetClientMgr.h" #include - -#if HS_BUILD_FOR_UNIX #include -#endif plNetTransport::~plNetTransport() { From 8e05891be0e16bb5e6a79956a5f054bed4a1d596 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 4 Feb 2012 20:06:39 -0800 Subject: [PATCH 45/51] FIXME: Hack for MinGW. --- Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp index 6ca95acb..422910da 100644 --- a/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp +++ b/Sources/Plasma/NucleusLib/pnNetCli/pnNcCli.cpp @@ -53,7 +53,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com # pragma message("Compiling pnNetCli with debugging on") # define NCCLI_LOG LogMsg #else -# define NCCLI_LOG NULL_STMT +# define NCCLI_LOG LogMsg #endif #ifndef PLASMA_EXTERNAL_RELEASE From f3b3b2a35464ba6c3ca03d5c90e993ddcf177e65 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 4 Feb 2012 21:05:12 -0800 Subject: [PATCH 46/51] Fix the Py_ssize_t issues. --- .../Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp | 4 ++-- Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp index 0bdefb1b..8b928671 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyGUIControlMultiLineEdit.cpp @@ -182,7 +182,7 @@ void pyGUIControlMultiLineEdit::SetEncodedBuffer( PyObject* buffer_object ) { // something to do here... later uint8_t* daBuffer = nil; - ssize_t length; + Py_ssize_t length; PyObject_AsReadBuffer( buffer_object, (const void**)&daBuffer, &length); if ( daBuffer != nil ) { @@ -218,7 +218,7 @@ void pyGUIControlMultiLineEdit::SetEncodedBufferW( PyObject* buffer_object ) { // something to do here... later uint16_t* daBuffer = nil; - ssize_t length; + Py_ssize_t length; PyObject_AsReadBuffer( buffer_object, (const void**)&daBuffer, &length); if ( daBuffer != nil ) { diff --git a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp index f6101a53..f4c7368c 100644 --- a/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp +++ b/Sources/Plasma/FeatureLib/pfPython/pyVaultImageNode.cpp @@ -211,7 +211,7 @@ void pyVaultImageNode::SetImageFromBuf( PyObject * pybuf ) } uint8_t * buffer = nil; - ssize_t bytes; + Py_ssize_t bytes; PyObject_AsReadBuffer(pybuf, (const void **)&buffer, &bytes); if (buffer) { VaultImageNode access(fNode); From c815fd8a147d415016eb090043e13c22d2784318 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 4 Feb 2012 23:16:53 -0800 Subject: [PATCH 47/51] More minGW fixes. --- .../FeatureLib/pfMessage/pfMessageCreatable.h | 2 +- .../PubUtilLib/plInputCore/plInputManager.cpp | 2 +- .../plInputCore/plSceneInputInterface.cpp | 24 ++++++++++++------- .../Plasma/PubUtilLib/plNetGameLib/Intern.h | 2 +- .../PubUtilLib/plPipeline/hsFogControl.h | 2 +- .../plStatGather/plProfileManagerFull.cpp | 4 ++-- 6 files changed, 22 insertions(+), 14 deletions(-) diff --git a/Sources/Plasma/FeatureLib/pfMessage/pfMessageCreatable.h b/Sources/Plasma/FeatureLib/pfMessage/pfMessageCreatable.h index 293da492..945d6adc 100644 --- a/Sources/Plasma/FeatureLib/pfMessage/pfMessageCreatable.h +++ b/Sources/Plasma/FeatureLib/pfMessage/pfMessageCreatable.h @@ -99,4 +99,4 @@ REGISTER_CREATABLE(pfBackdoorMsg); REGISTER_CREATABLE(pfMovieEventMsg); -#endif pfMessageCreatable_inc +#endif //pfMessageCreatable_inc diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp index e6af2ab9..d5d3f9ab 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp +++ b/Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp @@ -295,7 +295,7 @@ void plInputManager::HandleWin32ControlEvent(UINT message, WPARAM Wparam, LPARAM break; BYTE scan = (BYTE)(Lparam >> 16); - UINT vkey = MapVirtualKey(scan, MAPVK_VSC_TO_VK); + UINT vkey = MapVirtualKey(scan, 1); //MAPVK_VSC_TO_VK bExtended = Lparam >> 24 & 1; hsBool bRepeat = ((Lparam >> 29) & 0xf) != 0; diff --git a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp index d81487be..b803f3ff 100644 --- a/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp +++ b/Sources/Plasma/PubUtilLib/plInputCore/plSceneInputInterface.cpp @@ -608,7 +608,8 @@ hsBool plSceneInputInterface::MsgReceive( plMessage *msg ) if (fBookMode == kBookOffered) { // and put our own dialog back up... - ISendOfferNotification(plNetClientMgr::GetInstance()->GetLocalPlayerKey(), 0, false); + plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + ISendOfferNotification(avKey, 0, false); //IManageIgnoredAvatars(fOffereeKey, false); fOffereeKey = nil; fBookMode = kNotOffering; @@ -627,7 +628,8 @@ hsBool plSceneInputInterface::MsgReceive( plMessage *msg ) // tell them to ignore us plInputIfaceMgrMsg* pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kDisableAvatarClickable); - pMsg->SetAvKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); + plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + pMsg->SetAvKey(avKey); pMsg->SetBCastFlag(plMessage::kNetPropagate); pMsg->SetBCastFlag(plMessage::kNetForce); pMsg->SetBCastFlag(plMessage::kLocalPropagate, false); @@ -754,7 +756,8 @@ hsBool plSceneInputInterface::MsgReceive( plMessage *msg ) if (fBookMode == kBookOffered) { // and put our own dialog back up... - ISendOfferNotification(plNetClientMgr::GetInstance()->GetLocalPlayerKey(), 0, false); + plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + ISendOfferNotification(avKey, 0, false); //IManageIgnoredAvatars(fOffereeKey, false); fBookMode = kOfferBook; fOffereeKey = nil; @@ -830,7 +833,8 @@ void plSceneInputInterface::ILinkOffereeToAge() else if (!VaultGetOwnedAgeLink(&info, &link)) { // We must have an owned copy of the age before we can offer it, so make one now - info.SetAgeInstanceGuid(&plUUID(GuidGenerate())); + plUUID guid(GuidGenerate()); + info.SetAgeInstanceGuid(&guid); std::string title; std::string desc; @@ -858,7 +862,8 @@ void plSceneInputInterface::ILinkOffereeToAge() VaultAgeLinkNode linkAcc(linkNode); if (linkAcc.volat) { if (VaultUnregisterOwnedAgeAndWait(link.GetAgeInfo())) { - link.GetAgeInfo()->SetAgeInstanceGuid(&plUUID(GuidGenerate())); + plUUID guid(GuidGenerate()); + link.GetAgeInfo()->SetAgeInstanceGuid(&guid); VaultRegisterOwnedAgeAndWait(&link); } } @@ -882,7 +887,8 @@ void plSceneInputInterface::ILinkOffereeToAge() if (!fPendingLink && stricmp(fOfferedAgeFile, kPersonalAgeFilename)) { // tell our local dialog to pop up again... - ISendOfferNotification(plNetClientMgr::GetInstance()->GetLocalPlayerKey(), 0, false); + plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + ISendOfferNotification(avKey, 0, false); // make them clickable again(in case they come back?) //IManageIgnoredAvatars(fOffereeKey, false); @@ -1041,7 +1047,8 @@ hsBool plSceneInputInterface::InterpretInputEvent( plInputEventMsg *pMsg ) { // and put our own dialog back up... ISendOfferNotification(fOffereeKey, -999, true); - ISendOfferNotification(plNetClientMgr::GetInstance()->GetLocalPlayerKey(), 0, false); + plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + ISendOfferNotification(avKey, 0, false); //IManageIgnoredAvatars(fOffereeKey, false); fBookMode = kOfferBook; fOffereeKey = nil; @@ -1138,7 +1145,8 @@ void plSceneInputInterface::ISendAvatarDisabledNotification(hsBool enabled) pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kEnableAvatarClickable); else pMsg = new plInputIfaceMgrMsg(plInputIfaceMgrMsg::kDisableAvatarClickable); - pMsg->SetAvKey(plNetClientMgr::GetInstance()->GetLocalPlayerKey()); + plKey avKey = plNetClientMgr::GetInstance()->GetLocalPlayerKey(); + pMsg->SetAvKey(avKey); pMsg->SetBCastFlag(plMessage::kNetPropagate); pMsg->SetBCastFlag(plMessage::kNetForce); pMsg->SetBCastFlag(plMessage::kLocalPropagate, false); diff --git a/Sources/Plasma/PubUtilLib/plNetGameLib/Intern.h b/Sources/Plasma/PubUtilLib/plNetGameLib/Intern.h index e9eb0575..11e43355 100644 --- a/Sources/Plasma/PubUtilLib/plNetGameLib/Intern.h +++ b/Sources/Plasma/PubUtilLib/plNetGameLib/Intern.h @@ -225,7 +225,7 @@ enum ETransType { kNumTransTypes }; -static char * s_transTypes[] = { +static const char * s_transTypes[] = { // NglAuth.cpp "PingRequestTrans", "LoginRequestTrans", diff --git a/Sources/Plasma/PubUtilLib/plPipeline/hsFogControl.h b/Sources/Plasma/PubUtilLib/plPipeline/hsFogControl.h index 013b21f0..db16015a 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/hsFogControl.h +++ b/Sources/Plasma/PubUtilLib/plPipeline/hsFogControl.h @@ -148,4 +148,4 @@ public: }; #endif // Move up to FeatureLevel -#endif hsFogControl_inc +#endif //hsFogControl_inc diff --git a/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp b/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp index 69491d4a..484d7b0f 100644 --- a/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp +++ b/Sources/Plasma/PubUtilLib/plStatGather/plProfileManagerFull.cpp @@ -443,7 +443,7 @@ const wchar_t* plProfileManagerFull::GetProfilePath() plFileUtils::CreateDir(profilePath); wchar_t buff[256]; - swprintf(buff, 256, L"%02d-%02d-%04d_%02d-%02d//", + hsSnwprintf(buff, 256, L"%02d-%02d-%04d_%02d-%02d//", curTime.GetMonth(), curTime.GetDay(), curTime.GetYear(), @@ -460,7 +460,7 @@ const wchar_t* plProfileManagerFull::GetProfilePath() void plProfileManagerFull::ILogStats() { wchar_t statFilename[256]; - swprintf(statFilename, 256, L"%s%s.csv", GetProfilePath(), fLogAgeName.c_str()); + hsSnwprintf(statFilename, 256, L"%s%s.csv", GetProfilePath(), fLogAgeName.c_str()); bool exists = plFileUtils::FileExists(statFilename); From 53c8c1aa9b61b31ef8be59348593dd7bf326efa5 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sat, 4 Feb 2012 23:17:50 -0800 Subject: [PATCH 48/51] Fix a problem linking plNetCommMsgs. --- Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp | 2 +- Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp | 2 +- Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp b/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp index 1010458f..03f0f172 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plPerspDirSlave.cpp @@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -#ifdef _MSC_VER +#ifdef HS_BUILD_FOR_WIN32 #define isnan _isnan #endif diff --git a/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp b/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp index 266b56da..61817a24 100644 --- a/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp +++ b/Sources/Plasma/PubUtilLib/plGLight/plShadowSlave.cpp @@ -48,7 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include #include -#ifdef _MSC_VER +#ifdef HS_BUILD_FOR_WIN32 #define isnan _isnan #endif diff --git a/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h b/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h index 784b2fe0..59da9b9c 100644 --- a/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h +++ b/Sources/Plasma/PubUtilLib/plMessage/plNetCommMsgs.h @@ -49,9 +49,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #define plNetCommMsgs_inc -#include "pnUtils/pnUtArray.h" +#include "pnUtils/pnUtils.h" #include "pnNetBase/pnNetBase.h" #include "pnMessage/plMessage.h" +#include "pnNetProtocol/pnNetProtocol.h" class plNetCommReplyMsg : public plMessage { public: From 6654f41dceb99d4d2dcc3f177ebb7afc755ed797 Mon Sep 17 00:00:00 2001 From: Darryl Pogue Date: Sun, 5 Feb 2012 14:38:18 -0800 Subject: [PATCH 49/51] Fix a DirectX/VS/MinGW problem. --- Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp index 16d89a6b..094b8def 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp @@ -62,6 +62,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #ifndef DXGetErrorString9 #define DXGetErrorString9 DXGetErrorString #endif + #ifdef __MINGW32__ // UGH! + #define DXGetErrorString DXGetErrorString9 + #endif #else #include #endif @@ -11834,7 +11837,7 @@ void plDXPipeline::ISetErrorMessage( char *errStr ) // Convert the last D3D error code to a string (probably "Conflicting Render State"). void plDXPipeline::IGetD3DError() { - sprintf( fSettings.fErrorStr, "D3DError : %s", (char *)DXGetErrorString9( fSettings.fDXError ) ); + sprintf( fSettings.fErrorStr, "D3DError : %s", (char *)DXGetErrorString( fSettings.fDXError ) ); } // IShowErrorMessage ///////////////////////////////////////////////////////////// From 091b90efd2306c353cfada403871079fb1929127 Mon Sep 17 00:00:00 2001 From: branan Date: Sun, 5 Feb 2012 14:51:31 -0800 Subject: [PATCH 50/51] Fix function conflict with win32 headers --- Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp b/Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp index dc96362a..938fca29 100644 --- a/Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp +++ b/Sources/Plasma/NucleusLib/pnNetDiag/pnNetSys.cpp @@ -68,7 +68,7 @@ typedef DWORD (PASCAL FAR * FGetAdaptersInfo)( * ***/ -static FGetAdaptersInfo GetAdaptersInfo; +static FGetAdaptersInfo getAdaptersInfo; /***************************************************************************** @@ -81,14 +81,14 @@ static FGetAdaptersInfo GetAdaptersInfo; void SysStartup () { if (g_lib) { - GetAdaptersInfo = (FGetAdaptersInfo)GetProcAddress(g_lib, "GetAdaptersInfo"); + getAdaptersInfo = (FGetAdaptersInfo)GetProcAddress(g_lib, "GetAdaptersInfo"); } } //============================================================================ void SysShutdown () { - GetAdaptersInfo = nil; + getAdaptersInfo = nil; } @@ -150,17 +150,17 @@ void NetDiagSys ( } { // Adapters - if (!GetAdaptersInfo) { + if (!getAdaptersInfo) { dump(L"[SYS] Failed to load IP helper API"); callback(diag, kNetProtocolNil, kNetErrNotSupported, param); return; } ULONG ulOutBufLen = 0; - GetAdaptersInfo(nil, &ulOutBufLen); + getAdaptersInfo(nil, &ulOutBufLen); PIP_ADAPTER_INFO pInfo = (PIP_ADAPTER_INFO)malloc(ulOutBufLen); PIP_ADAPTER_INFO pAdapter; - if (GetAdaptersInfo(pInfo, &ulOutBufLen) == NO_ERROR) { + if (getAdaptersInfo(pInfo, &ulOutBufLen) == NO_ERROR) { pAdapter = pInfo; while (pAdapter) { dump(L"[SYS] NIC: %S", pAdapter->Description); From b2e8edb725f4339136756e2e0b83c87ae1b4ff84 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Sun, 5 Feb 2012 19:59:15 -0500 Subject: [PATCH 51/51] I blame the QA Kitty for letting this one slip through... --- Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.cpp b/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.cpp index 75d9e290..8bc75878 100644 --- a/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.cpp +++ b/Sources/Plasma/NucleusLib/pnUtils/pnUtSpareList.cpp @@ -141,7 +141,7 @@ void CBaseSpareList::CleanUp (const char typeName[]) { #ifdef CLIENT { char buffer[256]; - StrPrintf(buffer, arrsize(buffer), "Memory leak: %s", typeName); + snprintf(buffer, arrsize(buffer), "Memory leak: %s", typeName); FATAL(buffer); } #else