Browse Source

Completely kill off CoreLibExe

Adam Johnson 12 years ago
parent
commit
91fc595407
  1. 1
      Sources/Plasma/Apps/plClient/CMakeLists.txt
  2. 2
      Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt
  3. 2
      Sources/Plasma/Apps/plFileSecure/CMakeLists.txt
  4. 2
      Sources/Plasma/Apps/plLogDecrypt/CMakeLists.txt
  5. 2
      Sources/Plasma/Apps/plPageInfo/CMakeLists.txt
  6. 2
      Sources/Plasma/Apps/plPythonPack/CMakeLists.txt
  7. 1
      Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt
  8. 2
      Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp
  9. 1
      Sources/Plasma/CMakeLists.txt
  10. 2
      Sources/Plasma/CoreLib/CMakeLists.txt
  11. 93
      Sources/Plasma/CoreLib/HeadSpin.cpp
  12. 1
      Sources/Plasma/CoreLib/HeadSpin.h
  13. 56
      Sources/Plasma/CoreLib/hsMalloc.cpp
  14. 83
      Sources/Plasma/CoreLib/hsMalloc.h
  15. 65
      Sources/Plasma/CoreLib/hsTypes.h
  16. 54
      Sources/Plasma/CoreLib/hsUtils.h
  17. 18
      Sources/Plasma/CoreLibExe/CMakeLists.txt
  18. 65
      Sources/Plasma/CoreLibExe/Intern.h
  19. 68
      Sources/Plasma/CoreLibExe/Pch.h
  20. 266
      Sources/Plasma/CoreLibExe/hsExeError.cpp
  21. 465
      Sources/Plasma/CoreLibExe/hsExeMalloc.cpp
  22. 4
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNt.cpp
  23. 4
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtFile.cpp
  24. 4
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Dns.cpp
  25. 14
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceCore.cpp
  26. 2
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceThread.cpp
  27. 4
      Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceTimer.cpp
  28. 12
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h
  29. 2
      Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp
  30. 2
      Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.cpp
  31. 19
      Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp
  32. 1
      Sources/Tools/MaxMain/CMakeLists.txt
  33. 1
      Sources/Tools/MaxPlasmaLights/CMakeLists.txt
  34. 1
      Sources/Tools/plFontConverter/CMakeLists.txt
  35. 1
      Sources/Tools/plLocalizationEditor/CMakeLists.txt
  36. 1
      Sources/Tools/plResBrowser/CMakeLists.txt

1
Sources/Plasma/Apps/plClient/CMakeLists.txt

@ -71,7 +71,6 @@ if(PLASMA_EXTERNAL_RELEASE)
set_target_properties(plClient PROPERTIES OUTPUT_NAME "UruExplorer")
endif(PLASMA_EXTERNAL_RELEASE)
target_link_libraries(plClient CoreLib)
target_link_libraries(plClient CoreLibExe)
target_link_libraries(plClient pfAnimation)
target_link_libraries(plClient pfAudio)
target_link_libraries(plClient pfCamera)

2
Sources/Plasma/Apps/plFileEncrypt/CMakeLists.txt

@ -12,6 +12,6 @@ set(plFileEncrypt_SOURCES
)
add_executable(plFileEncrypt ${plFileEncrypt_SOURCES})
target_link_libraries(plFileEncrypt CoreLib CoreLibExe pnProduct plFile)
target_link_libraries(plFileEncrypt CoreLib pnProduct plFile)
source_group("Source Files" FILES ${plFileEncrypt_SOURCES})

2
Sources/Plasma/Apps/plFileSecure/CMakeLists.txt

@ -12,6 +12,6 @@ set(plFileSecure_SOURCES
)
add_executable(plFileSecure ${plFileSecure_SOURCES})
target_link_libraries(plFileSecure CoreLib CoreLibExe pnProduct plFile)
target_link_libraries(plFileSecure CoreLib pnProduct plFile)
source_group("Source Files" FILES ${plFileSecure_SOURCES})

2
Sources/Plasma/Apps/plLogDecrypt/CMakeLists.txt

@ -12,6 +12,6 @@ set(plLogDecrypt_SOURCES
)
add_executable(plLogDecrypt ${plLogDecrypt_SOURCES})
target_link_libraries(plLogDecrypt CoreLib CoreLibExe plStatusLog pnProduct)
target_link_libraries(plLogDecrypt CoreLib plStatusLog pnProduct)
source_group("Source Files" FILES ${plLogDecrypt_SOURCES})

2
Sources/Plasma/Apps/plPageInfo/CMakeLists.txt

@ -13,6 +13,6 @@ set(plPageInfo_SOURCES
)
add_executable(plPageInfo ${plPageInfo_SOURCES})
target_link_libraries(plPageInfo CoreLib CoreLibExe pnProduct plResMgr plAudioCore)
target_link_libraries(plPageInfo CoreLib pnProduct plResMgr plAudioCore)
source_group("Source Files" FILES ${plPageInfo_SOURCES})

2
Sources/Plasma/Apps/plPythonPack/CMakeLists.txt

@ -13,7 +13,7 @@ set(plPythonPack_HEADERS
)
add_executable(plPythonPack ${plPythonPack_SOURCES} ${plPythonPack_HEADERS})
target_link_libraries(plPythonPack CoreLib CoreLibExe plFile)
target_link_libraries(plPythonPack CoreLib plFile)
if(PYTHON_DEBUG_LIBRARY)
target_link_libraries(plPythonPack debug ${PYTHON_DEBUG_LIBRARY})

1
Sources/Plasma/Apps/plUruLauncher/CMakeLists.txt

@ -33,7 +33,6 @@ if(PLASMA_EXTERNAL_RELEASE)
set_target_properties(plUruLauncher PROPERTIES OUTPUT_NAME UruLauncher)
endif(PLASMA_EXTERNAL_RELEASE)
target_link_libraries(plUruLauncher CoreLib)
target_link_libraries(plUruLauncher CoreLibExe)
target_link_libraries(plUruLauncher pfConsoleCore)
target_link_libraries(plUruLauncher plAudioCore)
target_link_libraries(plUruLauncher plClientPatcher)

2
Sources/Plasma/Apps/plUruLauncher/SelfPatcher.cpp

@ -193,7 +193,7 @@ static void ManifestCallback (
StrToAnsi(ansi, s_newPatcherFile, arrsize(ansi));
SelfPatcherStream * stream = NEWZERO(SelfPatcherStream);
if (!stream->Open(ansi, "wb"))
ErrorFatal(__LINE__, __FILE__, "Failed to create file: %s, errno: %u", ansi, errno);
ErrorAssert(__LINE__, __FILE__, "Failed to create file: %s, errno: %u", ansi, errno);
NetCliFileDownloadRequest(manifest[0].downloadName, stream, DownloadCallback, nil);
}

1
Sources/Plasma/CMakeLists.txt

@ -1,6 +1,5 @@
add_subdirectory(Apps)
add_subdirectory(CoreLib)
add_subdirectory(CoreLibExe)
add_subdirectory(FeatureLib)
add_subdirectory(NucleusLib)
add_subdirectory(PubUtilLib)

2
Sources/Plasma/CoreLib/CMakeLists.txt

@ -8,7 +8,6 @@ set(CoreLib_SOURCES
hsExceptionStack.cpp
hsFastMath.cpp
hsGeometry3.cpp
hsMalloc.cpp
hsMatrix33.cpp
hsMatrix44.cpp
hsMemory.cpp
@ -51,7 +50,6 @@ set(CoreLib_HEADERS
hsFastMath.h
hsGeometry3.h
hsHashTable.h
hsMalloc.h
hsMatrix44.h
hsMemory.h
hsPoint2.h

93
Sources/Plasma/CoreLib/HeadSpin.cpp

@ -45,6 +45,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsExceptions.h"
#include <math.h>
#ifdef _MSC_VER
# include <crtdbg.h>
#endif
///////////////////////////////////////////////////////////////////////////
/////////////////// For Status Messages ///////////////////////////////////
@ -100,6 +104,95 @@ void hsDebugMessage (const char message[], long val)
}
#endif
static bool s_GuiAsserts = true;
void ErrorEnableGui(bool enabled)
{
s_GuiAsserts = enabled;
}
void ErrorAssert(int line, const char file[], const char fmt[], ...)
{
#if defined(HS_DEBUGGING) || !defined(PLASMA_EXTERNAL_RELEASE)
char msg[1024];
va_list args;
va_start(args, fmt);
vsnprintf(msg, sizeof(msg), fmt, args);
#ifdef _MSC_VER
#ifndef PLASMA_EXTERNAL_RELEASE
if (s_GuiAsserts)
{
if(_CrtDbgReport(_CRT_ASSERT, file, line, NULL, msg))
DebugBreak();
} else
#endif // PLASMA_EXTERNAL_RELEASE
#endif // _MSC_VER
if (DebugIsDebuggerPresent()) {
char str[] = "-------\nASSERTION FAILED:\nFile: %s Line: %i\nMessage: %s\n-------";
DebugMsg(str, file, line, msg);
}
#else
DebugBreakIfDebuggerPresent();
#endif // defined(HS_DEBUGGING) || !defined(PLASMA_EXTERNAL_RELEASE)
}
bool DebugIsDebuggerPresent()
{
#ifdef _MSC_VER
return IsDebuggerPresent();
#else
// FIXME
return false;
#endif
}
void DebugBreakIfDebuggerPresent()
{
#ifdef _MSC_VER
__try
{
__debugbreak();
} __except(EXCEPTION_EXECUTE_HANDLER) {
// Debugger not present or some such shwiz.
// Whatever. Don't crash here.
}
#endif // _MSC_VER
}
void DebugMsg(const char fmt[], ...)
{
char msg[1024];
va_list args;
va_start(args, fmt);
vsnprintf(msg, sizeof(msg), fmt, args);
if (DebugIsDebuggerPresent())
{
#ifdef _MSC_VER
OutputDebugStringA(msg);
OutputDebugStringA("\n");
#endif
} else {
fprintf(stderr, msg);
fprintf(stderr, "\n");
}
}
void ErrorMinimizeAppWindow ()
{
#ifdef HS_BUILD_FOR_WIN32
// If the application's topmost window is a fullscreen
// popup window, minimize it before displaying an error
HWND appWindow = GetActiveWindow();
if ( ((GetWindowLong(appWindow, GWL_STYLE) & WS_POPUP) != 0) )
SetWindowPos(
appWindow,
HWND_NOTOPMOST,
0, 0, // position
0, 0, // size
SWP_HIDEWINDOW | SWP_NOMOVE | SWP_NOSIZE
);
#endif
}
///////////////////////////////////////////////////////////////////

1
Sources/Plasma/CoreLib/HeadSpin.h

@ -51,6 +51,5 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsWindows.h"
#include "hsTypes.h"
#include "hsUtils.h"
#include "hsMalloc.h"
#endif

56
Sources/Plasma/CoreLib/hsMalloc.cpp

@ -1,56 +0,0 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
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/CoreLib/hsMalloc.cpp
*
***/
#include "HeadSpin.h"
/*****************************************************************************
*
* Exports
*
***/

83
Sources/Plasma/CoreLib/hsMalloc.h

@ -1,83 +0,0 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
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/CoreLib/hsMalloc.h
*
***/
#ifdef _HSMALLOC_H
# error "Do not include hsMalloc.h directly--use HeadSpin.h"
#endif // _HSMALLOC_H
#define _HSMALLOC_H
#include "HeadSpin.h"
/****************************************************************************
*
* Allocation functions
*
***/
#ifdef __cplusplus
extern "C" {
#endif
unsigned MemSize (void * ptr);
#ifdef __cplusplus
}
#endif
/****************************************************************************
*
* Macros
*
***/
#ifdef __cplusplus
#include <new>
#define NEWZERO(t) new(calloc(sizeof(t), 1)) t
#endif // __cplusplus

65
Sources/Plasma/CoreLib/hsTypes.h

@ -440,71 +440,6 @@ void SWAP (T & a, T & b) {
#define IS_POW2(val) (!((val) & ((val) - 1)))
/************************ Debug/Error Macros **************************/
typedef void (*hsDebugMessageProc)(const char message[]);
extern hsDebugMessageProc gHSDebugProc;
#define HSDebugProc(m) { if (gHSDebugProc) gHSDebugProc(m); }
hsDebugMessageProc hsSetDebugMessageProc(hsDebugMessageProc newProc);
extern hsDebugMessageProc gHSStatusProc;
hsDebugMessageProc hsSetStatusMessageProc(hsDebugMessageProc newProc);
void CDECL ErrorAssert (int line, const char file[], const char fmt[], ...);
void CDECL ErrorFatal (int line, const char file[], const char fmt[], ...);
void ErrorMinimizeAppWindow ();
enum EErrorOption {
kErrOptNonGuiAsserts,
kErrOptDisableMemLeakChecking,
kNumErrorOptions
};
bool ErrorSetOption (EErrorOption option, bool on);
bool ErrorGetOption (EErrorOption option);
bool DebugIsDebuggerPresent ();
void DebugBreakIfDebuggerPresent ();
void DebugMsg (const char fmt[], ...);
void DebugMsgV (const char fmt[], va_list args);
#ifdef HS_DEBUGGING
void hsDebugMessage(const char message[], long refcon);
#define hsDebugCode(code) code
#define hsIfDebugMessage(expr, msg, ref) (void)( ((expr) != 0) || (hsDebugMessage(msg, ref), 0) )
#define hsAssert(expr, msg) (void)( ((expr) != 0) || (ErrorAssert(__LINE__, __FILE__, msg), 0) )
#define ASSERT(expr) (void)( ((expr) != 0) || (ErrorAssert(__LINE__, __FILE__, #expr), 0) )
#define ASSERTMSG(expr, msg) (void)( ((expr) != 0) || (ErrorAssert(__LINE__, __FILE__, msg), 0) )
#define FATAL(msg) ErrorAssert(__LINE__, __FILE__, msg)
#define DEBUG_MSG DebugMsg
#define DEBUG_MSGV DebugMsgV
#define DEBUG_BREAK_IF_DEBUGGER_PRESENT DebugBreakIfDebuggerPresent
#else /* Not debugging */
#define hsDebugMessage(message, refcon) NULL_STMT
#define hsDebugCode(code) /* empty */
#define hsIfDebugMessage(expr, msg, ref) NULL_STMT
#define hsAssert(expr, msg) NULL_STMT
#define ASSERT(expr) NULL_STMT
#define ASSERTMSG(expr, msg) NULL_STMT
#define FATAL(msg) NULL_STMT
#define DEBUG_MSG (void)
#define DEBUG_MSGV NULL_STMT
#define DEBUG_BREAK_IF_DEBUGGER_PRESENT NULL_STMT
#endif // HS_DEBUGGING
#ifdef _MSC_VER
#define DEFAULT_FATAL(var) default: FATAL("No valid case for switch variable '" #var "'"); __assume(0); break;
#else
#define DEFAULT_FATAL(var) default: FATAL("No valid case for switch variable '" #var "'"); break;
#endif
#ifdef PLASMA_EXTERNAL_RELEASE
#define hsStatusMessage(x) NULL_STMT

54
Sources/Plasma/CoreLib/hsUtils.h

@ -170,6 +170,8 @@ inline float hsDegreesToRadians(float deg) { return float(deg * (M_PI / 180)); }
inline float hsRadiansToDegrees(float rad) { return float(rad * (180 / M_PI)); }
#define hsInvert(a) (1 / (a))
#include <new>
#define NEWZERO(t) new(calloc(sizeof(t), 1)) t
/////////////////////////////
// Physical memory functions
@ -192,3 +194,55 @@ void hsRandSeed(int seed);
#define hsFopen(name, mode) fopen(name, mode)
char** DisplaySystemVersion();
/************************ Debug/Error Macros **************************/
typedef void (*hsDebugMessageProc)(const char message[]);
extern hsDebugMessageProc gHSDebugProc;
#define HSDebugProc(m) { if (gHSDebugProc) gHSDebugProc(m); }
hsDebugMessageProc hsSetDebugMessageProc(hsDebugMessageProc newProc);
extern hsDebugMessageProc gHSStatusProc;
hsDebugMessageProc hsSetStatusMessageProc(hsDebugMessageProc newProc);
void ErrorEnableGui (bool enabled);
void ErrorAssert (int line, const char file[], const char fmt[], ...);
void ErrorMinimizeAppWindow ();
bool DebugIsDebuggerPresent ();
void DebugBreakIfDebuggerPresent ();
void DebugMsg(const char fmt[], ...);
#ifdef HS_DEBUGGING
void hsDebugMessage(const char message[], long refcon);
#define hsDebugCode(code) code
#define hsIfDebugMessage(expr, msg, ref) (void)( ((expr) != 0) || (hsDebugMessage(msg, ref), 0) )
#define hsAssert(expr, msg) (void)( ((expr) != 0) || (ErrorAssert(__LINE__, __FILE__, msg), 0) )
#define ASSERT(expr) (void)( ((expr) != 0) || (ErrorAssert(__LINE__, __FILE__, #expr), 0) )
#define ASSERTMSG(expr, msg) (void)( ((expr) != 0) || (ErrorAssert(__LINE__, __FILE__, msg), 0) )
#define FATAL(msg) ErrorAssert(__LINE__, __FILE__, msg)
#define DEBUG_MSG DebugMsg
#define DEBUG_BREAK_IF_DEBUGGER_PRESENT DebugBreakIfDebuggerPresent
#else /* Not debugging */
#define hsDebugMessage(message, refcon) NULL_STMT
#define hsDebugCode(code) /* empty */
#define hsIfDebugMessage(expr, msg, ref) NULL_STMT
#define hsAssert(expr, msg) NULL_STMT
#define ASSERT(expr) NULL_STMT
#define ASSERTMSG(expr, msg) NULL_STMT
#define FATAL(msg) NULL_STMT
#define DEBUG_MSG (void)
#define DEBUG_MSGV NULL_STMT
#define DEBUG_BREAK_IF_DEBUGGER_PRESENT NULL_STMT
#endif // HS_DEBUGGING
#ifdef _MSC_VER
#define DEFAULT_FATAL(var) default: FATAL("No valid case for switch variable '" #var "'"); __assume(0); break;
#else
#define DEFAULT_FATAL(var) default: FATAL("No valid case for switch variable '" #var "'"); break;
#endif

18
Sources/Plasma/CoreLibExe/CMakeLists.txt

@ -1,18 +0,0 @@
add_definitions(-D_LIB)
include_directories("../../Plasma/CoreLib")
set(CoreLibExe_SOURCES
hsExeError.cpp
hsExeMalloc.cpp
)
set(CoreLibExe_HEADERS
Intern.h
Pch.h
)
add_library(CoreLibExe STATIC ${CoreLibExe_SOURCES} ${CoreLibExe_HEADERS})
source_group("Source Files" FILES ${CoreLibExe_SOURCES})
source_group("Header Files" FILES ${CoreLibExe_HEADERS})

65
Sources/Plasma/CoreLibExe/Intern.h

@ -1,65 +0,0 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
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/CoreLibExe/Intern.h
*
***/
#ifdef PLASMA20_SOURCES_PLASMA_CORELIBEXE_INTERN_H
#error "Header $/Plasma20/Sources/Plasma/CoreLibExe/Intern.h included more than once"
#endif
#define PLASMA20_SOURCES_PLASMA_CORELIBEXE_INTERN_H
namespace ExeMalloc {
/*****************************************************************************
*
* hsExeMalloc
*
***/
void MemSetLeakChecking (bool on);
} using namespace ExeMalloc;

68
Sources/Plasma/CoreLibExe/Pch.h

@ -1,68 +0,0 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
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/CoreLibExe/Pch.h
*
***/
#ifdef PLASMA20_SOURCES_PLASMA_CORELIBEXE_PCH_H
#error "Header $/Plasma20/Sources/Plasma/CoreLibExe/Pch.h included more than once"
#endif
#define PLASMA20_SOURCES_PLASMA_CORELIBEXE_PCH_H
#pragma warning(push, 3)
#include "HeadSpin.h"
#include "hsCritSect.h"
#pragma warning(pop)
#include "Intern.h"
#include <malloc.h>
#if _MSC_VER
#include <crtdbg.h>
#endif

266
Sources/Plasma/CoreLibExe/hsExeError.cpp

@ -1,266 +0,0 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
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/CoreLibExe/hsExeError.cpp
*
***/
#include "Pch.h"
#pragma hdrstop
/*****************************************************************************
*
* Private
*
***/
static bool s_skipBreak;
#if HS_BUILD_FOR_WIN32
static CCritSect * s_critsect;
#endif
// User options
static bool s_options[kNumErrorOptions];
/*****************************************************************************
*
* Internal functions
*
***/
//===========================================================================
#if HS_BUILD_FOR_WIN32
AUTO_INIT_FUNC(hsExeErrorInit) {
// The critical section has to be initialized
// before program startup and never freed
static uint8_t rawMemory[sizeof(CCritSect)];
s_critsect = new(rawMemory) CCritSect;
}
#endif
//============================================================================
static void DoAssert (int line, const char file[], const char msg[]) {
ErrorMinimizeAppWindow();
#ifdef HS_BUILD_FOR_WIN32
if (!s_options[kErrOptNonGuiAsserts]) {
#ifdef HS_DEBUGGING
bool wasLeakChecking = ErrorSetOption(kErrOptDisableMemLeakChecking, true);
if (s_critsect)
s_critsect->Enter();
if (_CrtDbgReport(_CRT_ASSERT, file, line, NULL, msg))
DebugBreak();
if (s_critsect)
s_critsect->Leave();
(void) ErrorSetOption(kErrOptDisableMemLeakChecking, wasLeakChecking);
#else
DebugBreakIfDebuggerPresent();
#endif
}
else {
DebugMsg(msg);
DebugBreakIfDebuggerPresent();
}
#else // !HS_BUILD_FOR_WIN32
DebugMsg(msg);
DebugBreakIfDebuggerPresent();
#endif
}
/*****************************************************************************
*
* Exports
*
***/
//============================================================================
#pragma auto_inline(off)
void CDECL ErrorFatal (int line, const char file[], const char fmt[], ...) {
char buffer[256];
va_list args;
va_start(args, fmt);
hsVsnprintf(buffer, arrsize(buffer), fmt, args);
va_end(args);
ErrorSetOption(kErrOptDisableMemLeakChecking, true);
DoAssert(line, file, buffer);
// Ensure thread crashes immediately by writing to invalid memory
* (int *) 0 = 0;
}
#pragma auto_inline()
//============================================================================
#pragma auto_inline(off)
void CDECL ErrorAssert (int line, const char file[], const char fmt[], ...) {
char buffer[256];
va_list args;
va_start(args, fmt);
hsVsnprintf(buffer, arrsize(buffer), fmt, args);
va_end(args);
DoAssert(line, file, buffer);
}
#pragma auto_inline()
//============================================================================
void ErrorMinimizeAppWindow () {
#ifdef HS_BUILD_FOR_WIN32
// If the application's topmost window is a fullscreen
// popup window, minimize it before displaying an error
HWND appWindow = GetActiveWindow();
if ( ((GetWindowLong(appWindow, GWL_STYLE) & WS_POPUP) != 0) )
SetWindowPos(
appWindow,
HWND_NOTOPMOST,
0, 0, // position
0, 0, // size
SWP_HIDEWINDOW | SWP_NOMOVE | SWP_NOSIZE
);
#endif
}
//============================================================================
bool ErrorSetOption (EErrorOption option, bool on) {
SWAP(s_options[option], on);
if (option == kErrOptDisableMemLeakChecking)
MemSetLeakChecking(on); // reverse logic, so use prev value
return on;
}
//============================================================================
bool ErrorGetOption (EErrorOption option) {
return s_options[option];
}
//============================================================================
bool DebugIsDebuggerPresent () {
bool status = false;
#ifdef HS_BUILD_FOR_WIN32
status = 0 != IsDebuggerPresent();
#endif
return status;
}
//============================================================================
void DebugBreakIfDebuggerPresent () {
#ifdef HS_DEBUGGING
// try breakpoint?
if (s_skipBreak)
return;
__try {
// break into debugger
#ifdef _M_IX86
__asm int 3
#else
__debugbreak();
#endif
}
__except(EXCEPTION_EXECUTE_HANDLER) {
// debugger not present, stop attempting breaks
s_skipBreak = true;
}
#endif
}
//============================================================================
void DebugMsgV (const char fmt[], va_list args) {
#ifdef HS_DEBUGGING
// Don't bother with debug output if no debugger attached
if (!DebugIsDebuggerPresent())
return;
char msg[512];
hsVsnprintf(msg, arrsize(msg), fmt, args);
// MsDev trashes strings with colons in them; replace with period instead
for (char * ptr = msg; *ptr; ++ptr) {
if (*ptr == ':')
*ptr = '.';
}
// Too many threads printing to OutputDebugString causes bizarre
// results in developer studio; use critsect to serialize writes
if (s_critsect)
s_critsect->Enter();
#ifdef HS_BUILD_FOR_WIN32
OutputDebugStringA(msg);
OutputDebugStringA("\n");
#else
fprintf(stdout, msg);
fprintf(stdout, "\n");
#endif
if (s_critsect)
s_critsect->Leave();
#endif
}
//============================================================================
void CDECL DebugMsg (const char fmt[], ...) {
#ifdef HS_DEBUGGING
va_list args;
va_start(args, fmt);
DebugMsgV(fmt, args);
va_end(args);
#endif
}

465
Sources/Plasma/CoreLibExe/hsExeMalloc.cpp

@ -1,465 +0,0 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
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/CoreLibExe/hsExeMalloc.cpp
*
***/
#include "Pch.h"
#pragma hdrstop
/****************************************************************************
*
* Local constants
*
***/
#if defined(NO_MEM_TRACKER) || !defined(HS_FIND_MEM_LEAKS) || !defined(HS_BUILD_FOR_WIN32) || !defined(_MSC_VER)
// no mem debugging
#else
# undef MEM_DEBUG
# define MEM_DEBUG
#endif
#ifndef MEM_DEBUG
# define _malloc_dbg(s, t, f, l) malloc(s)
# define _calloc_dbg(c, s, t, f, l) calloc(c, s)
# define _realloc_dbg(p, s, t, f, l) realloc(p, s)
# define _expand_dbg(p, s, t, f, l) _expand(p, s)
# define _free_dbg(p, t) free(p)
# define _msize_dbg(p, t) _msize(p)
# ifndef _CLIENT_BLOCK
# define _CLIENT_BLOCK 0
# endif
# ifndef _IGNORE_BLOCK
# define _IGNORE_BLOCK 0
# endif
# ifndef _CRTDBG_ALLOC_MEM_DF
# define _CRTDBG_ALLOC_MEM_DF 0
# endif
# define SET_CRT_DEBUG_FIELD(a)
# define CLEAR_CRT_DEBUG_FIELD(a)
#endif // !MEM_DEBUG
/*****************************************************************************
*
* Private data
*
***/
#ifdef MEM_DEBUG
#define SET_CRT_DEBUG_FIELD(a) \
_CrtSetDbgFlag((a) | _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG))
#define CLEAR_CRT_DEBUG_FIELD(a) \
_CrtSetDbgFlag(~(a) & _CrtSetDbgFlag(_CRTDBG_REPORT_FLAG))
// From dbgint.h
#define nNoMansLandSize 4
typedef struct _CrtMemBlockHeader
{
struct _CrtMemBlockHeader * pBlockHeaderNext;
struct _CrtMemBlockHeader * pBlockHeaderPrev;
char * szFileName;
int nLine;
#ifdef _WIN64
/* These items are reversed on Win64 to eliminate gaps in the struct
* and ensure that sizeof(struct)%16 == 0, so 16-byte alignment is
* maintained in the debug heap.
*/
int nBlockUse;
size_t nDataSize;
#else /* _WIN64 */
size_t nDataSize;
int nBlockUse;
#endif /* _WIN64 */
long lRequest;
unsigned char gap[nNoMansLandSize];
/* followed by:
* unsigned char data[nDataSize];
* unsigned char anotherGap[nNoMansLandSize];
*/
} _CrtMemBlockHeader;
#define pbData(pblock) ((unsigned char *)((_CrtMemBlockHeader *)pblock + 1))
#define pHdr(pbData) (((_CrtMemBlockHeader *)pbData)-1)
enum EMemFile {
kMemErr,
kMemLeaks,
kMemUsage,
kMemAllocs,
kNumMemFiles
};
static char * s_memFilename[kNumMemFiles] = {
"MemErr.log",
"MemLeaks.log",
"MemUsage.log",
"MemAllocs.log",
};
static char * s_memDlgTitle[kNumMemFiles] = {
"Memory error",
"Memory leak",
nil,
nil,
};
static HANDLE s_memFile[kNumMemFiles] = {
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
INVALID_HANDLE_VALUE,
};
struct MemDumpParam {
EMemFile file;
bool showDialog;
};
static unsigned s_memColor;
static unsigned s_memCheckOff;
static CCritSect * s_critsect;
#endif // MEM_DEBUG
namespace ExeMalloc {
/*****************************************************************************
*
* Internal functions
*
***/
//===========================================================================
#ifdef MEM_DEBUG
static void ConvertFilename (
const char src[],
unsigned chars,
char * dst
) {
// Because the filename field may point into a DLL that has been
// unloaded, this code validates and converts the string into a
// reasonable value
__try {
unsigned pos = 0;
for (;;) {
// If the file name is too long then assume it is bogus
if (pos >= chars) {
pos = 0;
break;
}
// Get the next character
unsigned chr = src[pos];
if (!chr)
break;
// If the character isn't valid low-ASCII
// then assume that the name is bogus
if ((chr < 32) || (chr > 127)) {
pos = 0;
break;
}
// Store character
dst[pos++] = (char) chr;
}
// Ensure that name is terminated
dst[pos] = 0;
}
__except(EXCEPTION_EXECUTE_HANDLER) {
dst[0] = 0;
}
// Print the address of the filename; it may be of some
// use given the load address and the map file of the DLL
if (!dst[0])
snprintf(dst, chars, "@%p", src);
}
#endif // MEM_DEBUG
//===========================================================================
#ifdef MEM_DEBUG
static void OpenErrorFile (EMemFile file) {
ASSERT(INVALID_HANDLE_VALUE == s_memFile[file]);
s_memFile[file] = CreateFile(
s_memFilename[file],
GENERIC_WRITE,
FILE_SHARE_READ,
(LPSECURITY_ATTRIBUTES) NULL,
CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL,
NULL
);
}
#endif // MEM_DEBUG
//===========================================================================
#ifdef MEM_DEBUG
static void __cdecl ReportMem (EMemFile file, bool showDialog, const char fmt[], ...) {
if (s_memFile[file] == INVALID_HANDLE_VALUE) {
DebugBreakIfDebuggerPresent();
OpenErrorFile(file);
ErrorMinimizeAppWindow();
}
char buffer[512];
va_list args;
va_start(args, fmt);
DWORD length = hsVsnprintf(buffer, arrsize(buffer), fmt, args);
va_end(args);
#ifdef HS_BUILD_FOR_WIN32
OutputDebugStringA(buffer);
if (s_memFile[file] != INVALID_HANDLE_VALUE)
WriteFile(s_memFile[file], buffer, length, &length, NULL);
static bool s_skip;
if (showDialog && !s_skip && !ErrorGetOption(kErrOptNonGuiAsserts)) {
s_skip = IDOK != MessageBox(
NULL,
buffer,
s_memDlgTitle[file],
MB_ICONSTOP | MB_SETFOREGROUND | MB_TASKMODAL | MB_OKCANCEL
);
}
#else
fputs(buffer, stderr);
#endif
}
#endif
//============================================================================
#ifdef MEM_DEBUG
static void __cdecl MemDumpCallback (void * mem, void * param) {
const _CrtMemBlockHeader * pHead = pHdr(mem);
MemDumpParam * dumpParam = (MemDumpParam *) param;
char filename[MAX_PATH];
ConvertFilename(
pHead->szFileName,
arrsize(filename),
filename
);
// HACK: Don't report array memory leaks since these underly the hash
// table type and may not be cleaned up until after the mem leak
// checker runs. =(
if (strstr(filename, "pnUtArray"))
return;
ReportMem(
dumpParam->file,
dumpParam->showDialog,
"Offset %p size %u at %s:%d\r\n",
mem,
pHead->nDataSize,
filename,
pHead->nLine
);
}
#endif // MEM_DEBUG
//============================================================================
#ifdef MEM_DEBUG
static void __cdecl OnExitMemDumpCallback (void * mem, size_t) {
static MemDumpParam param = { kMemLeaks, true };
if (!ErrorGetOption(kErrOptDisableMemLeakChecking))
MemDumpCallback(mem, &param);
}
#endif // MEM_DEBUG
//===========================================================================
#ifdef MEM_DEBUG
static void __cdecl CheckLeaksOnExit () {
if (!ErrorGetOption(kErrOptDisableMemLeakChecking)) {
MemDumpParam param;
param.file = kMemLeaks;
param.showDialog = true;
_CrtDoForAllClientObjects(MemDumpCallback, &param);
}
}
#endif // MEM_DEBUG
//============================================================================
#ifdef MEM_DEBUG
static int __cdecl CrtAllocHook (
int method,
void * pUserData,
size_t nSize,
int nBlockUse,
long lRequest,
const unsigned char * szFileName,
int nLine
) {
if (nBlockUse == _NORMAL_BLOCK) {
int xx = 0;
}
return 1;
}
#endif // MEM_DEBUG
//===========================================================================
#ifdef MEM_DEBUG
AUTO_INIT_FUNC(hsExeMallocInit) {
// The critical section has to be initialized
// before program startup and never freed
static uint8_t rawMemory[sizeof CCritSect];
s_critsect = new(rawMemory) CCritSect;
SET_CRT_DEBUG_FIELD(_CRTDBG_LEAK_CHECK_DF);
_CrtSetAllocHook(CrtAllocHook);
_CrtSetDumpClient(OnExitMemDumpCallback);
// atexit(CheckLeaksOnExit);
}
#endif // MEM_DEBUG
/*****************************************************************************
*
* Module functions
*
***/
//============================================================================
void MemSetLeakChecking (bool on) {
if (on)
SET_CRT_DEBUG_FIELD(_CRTDBG_LEAK_CHECK_DF);
else
CLEAR_CRT_DEBUG_FIELD(_CRTDBG_LEAK_CHECK_DF);
}
} using namespace ExeMalloc;
/****************************************************************************
*
* Exports
*
***/
//============================================================================
void MemDumpAllocReport () {
#ifdef MEM_DEBUG
MemDumpParam param;
param.file = kMemAllocs;
param.showDialog = true;
_CrtDoForAllClientObjects(MemDumpCallback, &param);
#endif // MEM_DEBUG
}
//============================================================================
void MemDumpUsageReport () {
#ifdef MEM_DEBUG
#endif // MEM_DEBUG
}
//============================================================================
void MemValidateNow () {
#ifdef MEM_DEBUG
#endif // MEM_DEBUG
}
//============================================================================
void MemSetValidation (unsigned on) {
#ifdef MEM_DEBUG
#endif // MEM_DEBUG
}
//============================================================================
void MemPushDisableTracking () {
#ifdef MEM_DEBUG
++s_memCheckOff;
#endif // MEM_DEBUG
}
//============================================================================
void MemPopDisableTracking () {
#ifdef MEM_DEBUG
ASSERT(s_memCheckOff);
--s_memCheckOff;
#endif // MEM_DEBUG
}
//============================================================================
void MemSetColor (unsigned short color) {
#ifdef MEM_DEBUG
s_memColor = color & 0xFFFF;
#endif // MEM_DEBUG
}
//============================================================================
unsigned MemSize (void * ptr) {
ASSERT(ptr);
unsigned result = 0;
#ifdef MEM_DEBUG
const _CrtMemBlockHeader * pHead = pHdr(ptr);
unsigned block = pHead->nBlockUse;
#endif
#if HS_BUILD_FOR_WIN32
result = (unsigned)_msize_dbg(ptr, block);
#endif
return result;
}

4
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNt.cpp

@ -374,11 +374,11 @@ void NtInitialize () {
(LPCTSTR) nil // name
);
if (!s_waitEvent)
ErrorFatal(__LINE__, __FILE__, "CreateEvent %#x", GetLastError());
ErrorAssert(__LINE__, __FILE__, "CreateEvent %#x", GetLastError());
// create IO completion port
if (0 == (s_ioPort = CreateIoCompletionPort(INVALID_HANDLE_VALUE, 0, 0, 0)))
ErrorFatal(__LINE__, __FILE__, "CreateIoCompletionPort %#x", GetLastError());
ErrorAssert(__LINE__, __FILE__, "CreateIoCompletionPort %#x", GetLastError());
// calculate number of IO worker threads to create
if (!s_pageSizeMask) {

4
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Nt/pnAceNtFile.cpp

@ -123,7 +123,7 @@ static void FatalOnNonRecoverableError (
}
ASSERT((op.opType == kOpFileRead) || (op.opType == kOpFileWrite));
ErrorFatal(
ErrorAssert(
__LINE__, __FILE__,
"Disk %s failed, error: %u",
op.opType == kOpFileRead ? "read" : "write",
@ -446,7 +446,7 @@ bool INtFileOpCompleteReadWrite (
// adjust outstanding bytes
if (bytes != op->win32Bytes) {
if (!file->sectorSizeMask)
ErrorFatal(__LINE__, __FILE__, "Disk %s failed", op->opType == kOpFileRead ? "read" : "write");
ErrorAssert(__LINE__, __FILE__, "Disk %s failed", op->opType == kOpFileRead ? "read" : "write");
if (op->opType == kOpFileRead)
memset(op->rw.buffer + bytes, 0, op->win32Bytes - bytes);
}

4
Sources/Plasma/NucleusLib/pnAsyncCoreExe/Private/Win32/pnAceW32Dns.cpp

@ -175,7 +175,7 @@ static unsigned THREADCALL LookupThreadProc (AsyncThread * thread) {
0
);
if (!s_lookupWindow)
ErrorFatal(__LINE__, __FILE__, "CreateWindow %#x", GetLastError());
ErrorAssert(__LINE__, __FILE__, "CreateWindow %#x", GetLastError());
HANDLE lookupStartEvent = (HANDLE) thread->argument;
SetEvent(lookupStartEvent);
@ -228,7 +228,7 @@ static void StartLookupThread () {
(LPCTSTR) 0 // name
);
if (!lookupStartEvent)
ErrorFatal(__LINE__, __FILE__, "CreateEvent %#x", GetLastError());
ErrorAssert(__LINE__, __FILE__, "CreateEvent %#x", GetLastError());
// create a thread to perform lookups
s_lookupThread = (HANDLE) AsyncThreadCreate(

14
Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceCore.cpp

@ -94,7 +94,7 @@ static void IAsyncInitUseW9x () {
#ifdef HS_BUILD_FOR_WIN32
W9xGetApi(&g_api);
#else
ErrorFatal("W9x I/O Not supported on this platform");
ErrorAssert("W9x I/O Not supported on this platform");
#endif
}
@ -103,7 +103,7 @@ static void IAsyncInitUseNt () {
#ifdef HS_BUILD_FOR_WIN32
NtGetApi(&g_api);
#else
ErrorFatal("Nt I/O Not supported on this platform");
ErrorAssert("Nt I/O Not supported on this platform");
#endif
}
@ -113,7 +113,7 @@ static void IAsyncInitUseUnix () {
#error Unix I/O not implemented yet
UxGetApi(&g_api);
#else
ErrorFatal(__LINE__, __FILE__, "Unix I/O Not supported on this platform");
ErrorAssert(__LINE__, __FILE__, "Unix I/O Not supported on this platform");
#endif
}
@ -130,7 +130,7 @@ static void IAsyncInitForClient () {
#elif HS_BUILD_FOR_UNIX
IAsyncInitUseUnix();
#else
ErrorFatal("AsyncCore: No default implementation for this platform");
ErrorAssert("AsyncCore: No default implementation for this platform");
#endif
}
@ -141,7 +141,7 @@ static void IAsyncInitForServer () {
#elif HS_BUILD_FOR_UNIX
IAsyncInitUseUnix();
#else
ErrorFatal("AsyncCore: No default implementation for this platform");
ErrorAssert("AsyncCore: No default implementation for this platform");
#endif
}
@ -185,9 +185,9 @@ void AsyncCoreInitialize () {
// Initialize WinSock
WSADATA wsaData;
if (WSAStartup(0x101, &wsaData))
ErrorFatal(__LINE__, __FILE__, "WSA startup failed");
ErrorAssert(__LINE__, __FILE__, "WSA startup failed");
if (wsaData.wVersion != 0x101)
ErrorFatal(__LINE__, __FILE__, "WSA version failed");
ErrorAssert(__LINE__, __FILE__, "WSA version failed");
#endif
#ifdef CLIENT

2
Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceThread.cpp

@ -128,7 +128,7 @@ void * AsyncThreadCreate (
);
if (!handle) {
LogMsg(kLogFatal, "%s (%u)", __FILE__, GetLastError());
ErrorFatal(__LINE__, __FILE__, "_beginthreadex failed");
ErrorAssert(__LINE__, __FILE__, "_beginthreadex failed");
}
thread->handle = handle;

4
Sources/Plasma/NucleusLib/pnAsyncCoreExe/pnAceTimer.cpp

@ -187,7 +187,7 @@ static inline void InitializeTimer () {
(LPCTSTR) nil
);
if (!s_timerEvent)
ErrorFatal(__LINE__, __FILE__, "CreateEvent %u", GetLastError());
ErrorAssert(__LINE__, __FILE__, "CreateEvent %u", GetLastError());
s_timerThread = (HANDLE) AsyncThreadCreate(
TimerThreadProc,
@ -230,7 +230,7 @@ void TimerDestroy (unsigned exitThreadWaitMs) {
s_timerCrit.Leave();
if (AsyncTimer * timer = s_timerProcs.Root())
ErrorFatal(__LINE__, __FILE__, "TimerProc not destroyed: %p", timer->timerProc);
ErrorAssert(__LINE__, __FILE__, "TimerProc not destroyed: %p", timer->timerProc);
}

12
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtArray.h

@ -157,8 +157,8 @@ TBuffer<T> & TBuffer<T>::operator= (const TBuffer<T> & source) {
//===========================================================================
template<class T>
bool TBuffer<T>::operator== (const TBuffer<T> & source) const {
unsigned size = MemSize(m_data);
return (size == MemSize(source.m_data)) && !memcmp(m_data, source.m_data, size);
unsigned size = _m_size(m_data);
return (size == _m_size(source.m_data)) && !memcmp(m_data, source.m_data, size);
}
//===========================================================================
@ -181,13 +181,13 @@ void TBuffer<T>::Attach (T * source, unsigned count) {
if (m_data)
free(m_data);
m_data = source;
ASSERT(MemSize(source) >= count * sizeof(T));
ASSERT(_m_size(source) >= count * sizeof(T));
}
//===========================================================================
template<class T>
unsigned TBuffer<T>::Bytes () const {
return m_data ? MemSize(m_data) : 0;
return m_data ? _m_size(m_data) : 0;
}
//===========================================================================
@ -202,7 +202,7 @@ void TBuffer<T>::Clear () {
//===========================================================================
template<class T>
unsigned TBuffer<T>::Count () const {
return m_data ? (MemSize(m_data) / sizeof(T)) : 0;
return m_data ? (_m_size(m_data) / sizeof(T)) : 0;
}
//===========================================================================
@ -558,7 +558,7 @@ void TFArray<T,C>::Attach (T * source, unsigned count) {
if (m_data)
free(m_data);
m_data = source;
m_alloc = MemSize(source) / sizeof(T);
m_alloc = _m_size(source) / sizeof(T);
m_count = count;
ASSERT(m_alloc >= m_count);
}

2
Sources/Plasma/NucleusLib/pnUtils/Private/pnUtSpareList.cpp

@ -138,7 +138,7 @@ void CBaseSpareList::GrowSpareList (unsigned objectSize, const char typeName[])
void CBaseSpareList::CleanUp (const char typeName[]) {
// warn of resource leaks
#ifdef SPARELIST_TRACK_MEMORY
if (m_unfreedObjects && !ErrorGetOption(kErrOptDisableMemLeakChecking)) {
if (m_unfreedObjects) {
#ifdef CLIENT
{
char buffer[256];

2
Sources/Plasma/PubUtilLib/plAgeLoader/plAgeLoader.cpp

@ -212,7 +212,7 @@ bool plAgeLoader::ILoadAge(const char ageName[])
nc->DebugMsg( "Net: Loading age %s", fAgeName);
if ((fFlags & kLoadMask) != 0)
ErrorFatal(__LINE__, __FILE__, "Fatal Error:\nAlready loading or unloading an age.\n%S will now exit.", ProductShortName());
ErrorAssert(__LINE__, __FILE__, "Fatal Error:\nAlready loading or unloading an age.\n%S will now exit.", ProductShortName());
fFlags |= kLoadingAge;

19
Sources/Plasma/PubUtilLib/plPhysX/plSimulationMgr.cpp

@ -293,23 +293,6 @@ class ErrorStream : public NxUserOutputStream
}
} gErrorStream;
// This class allows PhysX to use our heap manager
static class HeapAllocator : public NxUserAllocator {
public:
void * malloc (NxU32 size) {
return malloc(size);
}
void * mallocDEBUG (NxU32 size, const char * fileName, int line) {
return malloc(size);
}
void * realloc (void * memory, NxU32 size) {
return realloc(memory, size);
}
void free (void * memory) {
free(memory);
}
} gHeapAllocator;
/////////////////////////////////////////////////////////////////
//
@ -419,7 +402,7 @@ plSimulationMgr::plSimulationMgr()
bool plSimulationMgr::InitSimulation()
{
fSDK = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION, &gHeapAllocator, &gErrorStream);
fSDK = NxCreatePhysicsSDK(NX_PHYSICS_SDK_VERSION, NULL, &gErrorStream);
if (!fSDK)
return false; // client will handle this and ask user to install

1
Sources/Tools/MaxMain/CMakeLists.txt

@ -110,7 +110,6 @@ target_link_libraries(MaxMain ${Vorbis_LIBRARIES})
# Carbon copy from plClient
# TODO: Maybe see if some of these can be removed?
target_link_libraries(MaxMain CoreLib)
target_link_libraries(MaxMain CoreLibExe)
target_link_libraries(MaxMain pfAnimation)
target_link_libraries(MaxMain pfAudio)
target_link_libraries(MaxMain pfCamera)

1
Sources/Tools/MaxPlasmaLights/CMakeLists.txt

@ -46,7 +46,6 @@ target_link_libraries(MaxPlasmaLights ${3dsm_LIBRARIES})
# Carbon copy from plClient
# TODO: Maybe see if some of these can be removed?
target_link_libraries(MaxPlasmaLights CoreLib)
target_link_libraries(MaxPlasmaLights CoreLibExe)
target_link_libraries(MaxPlasmaLights pfAnimation)
target_link_libraries(MaxPlasmaLights pfAudio)
target_link_libraries(MaxPlasmaLights pfCamera)

1
Sources/Tools/plFontConverter/CMakeLists.txt

@ -23,7 +23,6 @@ set(plFontConverter_RESOURCES
add_executable(plFontConverter WIN32 ${plFontConverter_SOURCES} ${plFontConverter_HEADERS} ${plFontConverter_RESOURCES})
target_link_libraries(plFontConverter CoreLib)
target_link_libraries(plFontConverter CoreLibExe)
target_link_libraries(plFontConverter pnKeyedObject)
target_link_libraries(plFontConverter pnSceneObject)
target_link_libraries(plFontConverter pnProduct)

1
Sources/Tools/plLocalizationEditor/CMakeLists.txt

@ -28,7 +28,6 @@ set(plLocalizationEditor_RESOURCES
add_executable(plLocalizationEditor WIN32 ${plLocalizationEditor_HEADERS} ${plLocalizationEditor_SOURCES} ${plLocalizationEditor_RESOURCES})
target_link_libraries(plLocalizationEditor CoreLib)
target_link_libraries(plLocalizationEditor CoreLibExe)
target_link_libraries(plLocalizationEditor pnProduct)
target_link_libraries(plLocalizationEditor pnSceneObject)
target_link_libraries(plLocalizationEditor plResMgr)

1
Sources/Tools/plResBrowser/CMakeLists.txt

@ -34,7 +34,6 @@ set(plResBrowser_RESOURCES
add_executable(plResBrowser WIN32 ${plResBrowser_SOURCES} ${plResBrowser_HEADERS} ${plResBrowser_RESOURCES})
target_link_libraries(plResBrowser CoreLib)
target_link_libraries(plResBrowser CoreLibExe)
target_link_libraries(plResBrowser plFile)
target_link_libraries(plResBrowser plMessage)
target_link_libraries(plResBrowser plResMgr)

Loading…
Cancel
Save