Browse Source

Remove global Windows.h include

This is the beginning of efforts to reduce the scope of Windows.h. I have
shuttled it into hsWindows.h (again) and fixed the compilation of the
major apps. There is still some scope work that needs to be done, and the
Max plugin has not yet been addressed.
Adam Johnson 12 years ago
parent
commit
7785c9c85e
  1. 1
      Sources/Plasma/Apps/plClient/plClient.cpp
  2. 6
      Sources/Plasma/Apps/plClient/winmain.cpp
  3. 1
      Sources/Plasma/Apps/plClientPatcher/Pch.h
  4. 1
      Sources/Plasma/Apps/plPythonPack/main.cpp
  5. 1
      Sources/Plasma/Apps/plUruLauncher/Pch.h
  6. 1
      Sources/Plasma/CoreLib/CMakeLists.txt
  7. 1
      Sources/Plasma/CoreLib/HeadSpin.cpp
  8. 100
      Sources/Plasma/CoreLib/HeadSpin.h
  9. 7
      Sources/Plasma/CoreLib/hsCritSect.h
  10. 1
      Sources/Plasma/CoreLib/hsFiles_Win.cpp
  11. 5
      Sources/Plasma/CoreLib/hsThread.h
  12. 75
      Sources/Plasma/CoreLib/hsWindows.h
  13. 1
      Sources/Plasma/CoreLib/plFileUtils.cpp
  14. 1
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp
  15. 10
      Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp
  16. 6
      Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h
  17. 2
      Sources/Plasma/FeatureLib/pfPython/pyAgeVaultGlue.cpp
  18. 20
      Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp
  19. 4
      Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h
  20. 3
      Sources/Plasma/FeatureLib/pfPython/pyDniInfoSourceGlue.cpp
  21. 5
      Sources/Plasma/FeatureLib/pfSurface/plLayerAVI.cpp
  22. 2
      Sources/Plasma/NucleusLib/inc/plProfileManager.cpp
  23. 4
      Sources/Plasma/NucleusLib/pnInputCore/plKeyDef.h
  24. 2
      Sources/Plasma/NucleusLib/pnInputCore/plOSMsg.h
  25. 16
      Sources/Plasma/NucleusLib/pnMessage/plEventCallbackMsg.h
  26. 1
      Sources/Plasma/NucleusLib/pnNetCommon/plNetAddress.h
  27. 1
      Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp
  28. 5
      Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.h
  29. 1
      Sources/Plasma/NucleusLib/pnTimer/hsTimer.cpp
  30. 1
      Sources/Plasma/NucleusLib/pnTimer/pnBuildDates.cpp
  31. 6
      Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.h
  32. 1
      Sources/Plasma/PubUtilLib/plAudio/plWinMicLevel.cpp
  33. 1
      Sources/Plasma/PubUtilLib/plAudioCore/plWavFile.h
  34. 2
      Sources/Plasma/PubUtilLib/plAvatar/plArmatureEffects.cpp
  35. 4
      Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp
  36. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp
  37. 2
      Sources/Plasma/PubUtilLib/plClipboard/plClipboard.cpp
  38. 5
      Sources/Plasma/PubUtilLib/plFile/plBrowseFolder.h
  39. 1
      Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp
  40. 5
      Sources/Plasma/PubUtilLib/plFile/plSecureStream.h
  41. 2
      Sources/Plasma/PubUtilLib/plGImage/hsCodec.h
  42. 1
      Sources/Plasma/PubUtilLib/plGImage/plAVIWriter.cpp
  43. 2
      Sources/Plasma/PubUtilLib/plGImage/plDynSurfaceWriter.h
  44. 2
      Sources/Plasma/PubUtilLib/plGImage/plWinFontCache.h
  45. 1
      Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp
  46. 3
      Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp
  47. 4
      Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h
  48. 3
      Sources/Plasma/PubUtilLib/plPipeline/hsGDDrawDllLoad.cpp
  49. 1
      Sources/Plasma/PubUtilLib/plPipeline/plDTProgressMgr.cpp
  50. 1
      Sources/Plasma/PubUtilLib/plPipeline/plDXDeviceRefs.cpp
  51. 2
      Sources/Plasma/PubUtilLib/plPipeline/plDXEnumerate.cpp
  52. 1
      Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp
  53. 1
      Sources/Plasma/PubUtilLib/plPipeline/plDXPixelShader.cpp
  54. 2
      Sources/Plasma/PubUtilLib/plPipeline/plDXTextFont.cpp
  55. 3
      Sources/Plasma/PubUtilLib/plPipeline/plDXVertexShader.cpp
  56. 2
      Sources/Plasma/PubUtilLib/plPipeline/plGBufferGroup.cpp
  57. 7
      Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp
  58. 1
      Sources/Plasma/PubUtilLib/plPipeline/plTextFont.cpp
  59. 1
      Sources/Plasma/PubUtilLib/plPipeline/plTextGenerator.cpp
  60. 1
      Sources/Plasma/PubUtilLib/plSockets/plBufferedSocketWriter.cpp
  61. 1
      Sources/Plasma/PubUtilLib/plSockets/plFdSet.cpp
  62. 5
      Sources/Plasma/PubUtilLib/plSockets/plNet.h
  63. 1
      Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp
  64. 1
      Sources/Tools/plFontConverter/plFontConverter.cpp
  65. 3
      Sources/Tools/plFontConverter/plFontConverterProc.cpp
  66. 1
      Sources/Tools/plLocalizationEditor/plAddDlgs.h
  67. 1
      Sources/Tools/plLocalizationEditor/plEditDlg.h
  68. 1
      Sources/Tools/plResBrowser/plResBrowser.cpp
  69. 3
      Sources/Tools/plResBrowser/plResBrowserWndProc.cpp
  70. 1
      Sources/Tools/plResBrowser/plResTreeView.cpp
  71. 1
      Sources/Tools/plResBrowser/plWinRegistryTools.cpp

1
Sources/Plasma/Apps/plClient/plClient.cpp

@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#pragma warning(disable: 4284)
#include "HeadSpin.h"
#include "hsWindows.h"
#include "plClient.h"
#include "hsStream.h"
#include "plResMgr/plResManager.h"

6
Sources/Plasma/Apps/plClient/winmain.cpp

@ -40,9 +40,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsWindows.h"
#include <stdio.h>
#include <direct.h> // windows directory handling fxns (for chdir)
#include <process.h>
#include <Shellapi.h> // ShellExecuteA
//#define DETACH_EXE // Microsoft trick to force loading of exe to memory
#ifdef DETACH_EXE
@ -51,7 +55,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <curl/curl.h>
#include "HeadSpin.h"
#include "hsStream.h"
#include "plClient.h"
@ -78,7 +81,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "res/resource.h"
//#include <shellapi.h>
//
// Defines
//

1
Sources/Plasma/Apps/plClientPatcher/Pch.h

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_APPS_PLCLIENTPATCHER_PCH_H
#include "hsWindows.h"
#include <process.h>
#include <time.h>
#include "pnUtils/pnUtils.h"

1
Sources/Plasma/Apps/plPythonPack/main.cpp

@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <algorithm>
#if HS_BUILD_FOR_WIN32
# include "hsWindows.h"
# include <direct.h>
# define getcwd _getcwd

1
Sources/Plasma/Apps/plUruLauncher/Pch.h

@ -50,6 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#endif
#define PLASMA20_SOURCES_PLASMA_APPS_PLURULAUNCHER_PCH_H
#include "hsWindows.h"
#include <process.h>
#include <time.h>

1
Sources/Plasma/CoreLib/CMakeLists.txt

@ -83,6 +83,7 @@ set(CoreLib_HEADERS
hsTemplates.h
hsThread.h
hsWide.h
hsWindows.h
pcSmallRect.h
plFileUtils.h
plGeneric.h

1
Sources/Plasma/CoreLib/HeadSpin.cpp

@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsWindows.h"
#ifdef _MSC_VER
# include <crtdbg.h>

100
Sources/Plasma/CoreLib/HeadSpin.h

@ -46,6 +46,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
# define HS_DEBUGGING
#endif // defined(_DEBUG) || defined(UNIX_DENUG)
//======================================
// Some standard includes
//======================================
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <stdarg.h>
#include <stdint.h>
//======================================
// Winblows Hacks
//======================================
@ -61,67 +72,21 @@ 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
# include <WinSock2.h>
# include <ws2tcpip.h>
# define WIN32_LEAN_AND_MEAN
# ifndef NOMINMAX
# define NOMINMAX // Needed to prevent NxMath conflicts
# endif
# include <Windows.h>
// This needs to be after #include <windows.h>, since it also includes windows.h
# ifdef USE_VLD
# include <vld.h>
# endif
#endif // HS_BUILD_FOR_WIN32
//======================================
// We don't want the Windows.h min/max!
//======================================
#ifdef max
# undef max
#endif
#ifdef min
# undef min
#endif
//======================================
// Some standard includes
//======================================
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <stdarg.h>
#include <stdint.h>
//======================================
// Just some fun typedefs...
//======================================
#ifdef HS_BUILD_FOR_WIN32
// Kind of nasty looking forward declarations, but this is Win32.... it'll never change!
// If you want to argue: would you rather pull in the entire Windows.h? Windows 8 makes it
// even more bloated than before!
struct HWND__; typedef struct HWND__ *HWND;
struct HINSTANCE__; typedef struct HINSTANCE__ *HINSTANCE;
typedef HWND hsWindowHndl;
typedef HINSTANCE hsWindowInst;
typedef HINSTANCE HMODULE;
typedef long HRESULT;
#else
typedef int32_t* hsWindowHndl;
typedef int32_t* hsWindowInst;
#endif // HS_BUILD_FOR_WIN32
//======================================
// Basic macros
//======================================
@ -547,31 +512,16 @@ void DebugMsg(const char fmt[], ...);
/*****************************************************************************
*
* Atomic Operations
* FIXME: Replace with std::atomic when VS2012 supports WinXP
*
***/
// *value += increment; return original value of *value; thread safe
inline long AtomicAdd(long* value, long increment)
{
#ifdef HS_BUILD_FOR_WIN32
return InterlockedExchangeAdd(value, increment);
#elif __GNUC__
return __sync_fetch_and_add(value, increment);
#else
# error "No Atomic Set support on this architecture"
#endif
}
// *value = value; return original value of *value; thread safe
inline long AtomicSet(long* value, long set)
{
#ifdef HS_BUILD_FOR_WIN32
return InterlockedExchange(value, set);
#ifdef _MSC_VER
# define AtomicAdd(value, increment) InterlockedExchangeAdd(value, increment)
# define AtomicSet(value, set) InterlockedExchange(value, set)
#elif __GNUC__
return __sync_lock_test_and_set(value, set);
#else
# error "No Atomic Set support on this architecture"
# define AtomicAdd(value, increment) __sync_fetch_and_add(value, increment)
# define AtomicSet(value, set) __sync_lock_test_and_set(value, set)
#endif
}
#endif

7
Sources/Plasma/CoreLib/hsCritSect.h

@ -60,10 +60,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifdef HS_BUILD_FOR_WIN32
typedef CRITICAL_SECTION CritSectHandle;
# include "hsWindows.h"
typedef CRITICAL_SECTION CritSectHandle;
#elif HS_BUILD_FOR_UNIX
# include <pthread.h>
typedef pthread_mutex_t CritSectHandle;
# include <pthread.h>
typedef pthread_mutex_t CritSectHandle;
#else
# error "CCritSect: Not implemented on this platform"
#endif

1
Sources/Plasma/CoreLib/hsFiles_Win.cpp

@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "hsFiles.h"
#include "HeadSpin.h"
#include "hsWindows.h"
#if HS_BUILD_FOR_WIN32

5
Sources/Plasma/CoreLib/hsThread.h

@ -46,8 +46,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
typedef uint32_t hsMilliseconds;
#ifdef HS_BUILD_FOR_UNIX
#ifdef HS_BUILD_FOR_WIN32
# include "hsWindows.h"
#elif defined(HS_BUILD_FOR_UNIX)
#include <pthread.h>
#include <semaphore.h>
// We can't wait with a timeout with semas

75
Sources/Plasma/CoreLib/hsWindows.h

@ -0,0 +1,75 @@
/*==LICENSE==*
CyanWorlds.com Engine - MMOG client, server and tools
Copyright (C) 2011 Cyan Worlds, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Additional permissions under GNU GPL version 3 section 7
If you modify this Program, or any covered work, by linking or
combining it with any of RAD Game Tools Bink SDK, Autodesk 3ds Max SDK,
NVIDIA PhysX SDK, Microsoft DirectX SDK, OpenSSL library, Independent
JPEG Group JPEG library, Microsoft Windows Media SDK, or Apple QuickTime SDK
(or a modified version of those libraries),
containing parts covered by the terms of the Bink SDK EULA, 3ds Max EULA,
PhysX SDK EULA, DirectX SDK EULA, OpenSSL and SSLeay licenses, IJG
JPEG Library README, Windows Media SDK EULA, or QuickTime SDK EULA, the
licensors of this Program grant you additional
permission to convey the resulting work. Corresponding Source for a
non-source form of such a combination shall include the source code for
the parts of OpenSSL and IJG JPEG Library used as well as that of the covered
work.
You can contact Cyan Worlds, Inc. by email legal@cyan.com
or by snail mail at:
Cyan Worlds, Inc.
14617 N Newport Hwy
Mead, WA 99021
*==LICENSE==*/
#ifndef _hsWindows_inc_
#define _hsWindows_inc_
/** \file hsWindows.h
* \brief Pulls in Windows core headers
*
* This file pulls in the core Windows headers and Winsock2. It is separate from
* HeadSpin.h to improve build times and to facillitate adding precompiled headers.
* You should avoid including this header from other headers!
*/
#ifdef HS_BUILD_FOR_WIN32
// 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
# define NOMINMAX
# define WIN32_LEAN_AND_MEAN
# include <Windows.h>
# include <ws2tcpip.h> // Pulls in WinSock 2 for us
// This needs to be after #include <windows.h>, since it also includes windows.h
# ifdef USE_VLD
# include <vld.h>
# endif // USE_VLD
#endif // HS_BUILD_FOR_WIN32
#endif // _hsWindows_inc_

1
Sources/Plasma/CoreLib/plFileUtils.cpp

@ -51,6 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//////////////////////////////////////////////////////////////////////////////
#include "HeadSpin.h"
#include "hsWindows.h"
#include "hsStlUtils.h"
#include "plFileUtils.h"
#include "hsFiles.h"

1
Sources/Plasma/FeatureLib/pfConsole/pfConsoleDirSrc.cpp

@ -51,6 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifdef HS_BUILD_FOR_WIN32
#include "hsWindows.h"
#include <sstream>

10
Sources/Plasma/FeatureLib/pfPython/pyAgeVault.cpp

@ -184,18 +184,16 @@ PyObject* pyAgeVault::GetSubAgeLink( const pyAgeInfoStruct & info )
PYTHON_RETURN_NONE;
}
const char* pyAgeVault::GetAgeGuid( void )
plUUID pyAgeVault::GetAgeGuid( void )
{
RelVaultNode * rvn = VaultGetAgeInfoNodeIncRef();
if (rvn) {
VaultAgeInfoNode ageInfo(rvn);
GuidToString(ageInfo.ageInstUuid, fAgeGuid, arrsize(fAgeGuid));
plUUID uuid = plUUID(ageInfo.ageInstUuid);
rvn->DecRef();
return uuid;
}
else {
fAgeGuid[0] = 0;
}
return fAgeGuid;
return plUUID();
}

6
Sources/Plasma/FeatureLib/pfPython/pyAgeVault.h

@ -64,12 +64,10 @@ class pyAgeInfoStruct;
class pyVaultChronicleNode;
class pySDLStateDataRecord;
class pyVaultTextNoteNode;
class plUUID;
class pyAgeVault
{
private:
mutable char fAgeGuid[MAX_PATH]; // for getting Age GUID
protected:
pyAgeVault();
@ -84,7 +82,7 @@ public:
static void AddPlasmaClasses(PyObject *m);
const char* GetAgeGuid( void );
plUUID GetAgeGuid( void );
PyObject * GetAgeSDL() const; // returns pySDLStateDataRecord
void UpdateAgeSDL( pySDLStateDataRecord & pyrec );

2
Sources/Plasma/FeatureLib/pfPython/pyAgeVaultGlue.cpp

@ -117,7 +117,7 @@ PYTHON_METHOD_DEFINITION(ptAgeVault, getSubAgeLink, args)
PYTHON_METHOD_DEFINITION_NOARGS(ptAgeVault, getAgeGuid)
{
return PyString_FromString(self->fThis->GetAgeGuid());
return PyString_FromString(self->fThis->GetAgeGuid().AsString().c_str());
}
PYTHON_METHOD_DEFINITION(ptAgeVault, addDevice, args)

20
Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.cpp

@ -44,7 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#pragma hdrstop
#include "pyDniInfoSource.h"
#include "pnUtils/pnUtils.h"
#include "pnUUID/pnUUID.h"
#include "plUnifiedTime/plUnifiedTime.h"
#include "plVault/plAgeInfoSource.h"
#include "plVault/plVault.h"
@ -100,16 +100,16 @@ const char * pyDniInfoSource::GetAgeName( void ) const
return fAgeName;
}
const char * pyDniInfoSource::GetAgeGuid( void ) const
plUUID pyDniInfoSource::GetAgeGuid( void ) const
{
RelVaultNode * node = VaultGetAgeInfoNodeIncRef();
if (!node)
return "";
if (RelVaultNode * node = VaultGetAgeInfoNodeIncRef())
{
VaultAgeInfoNode ageInfo(node);
plUUID uuid = plUUID(ageInfo.ageInstUuid);
node->DecRef();
VaultAgeInfoNode ageInfo(node);
GuidToString(ageInfo.ageInstUuid, fAgeGuid, arrsize(fAgeGuid));
node->DecRef();
return uuid;
}
return fAgeGuid;
return plUUID();
}

4
Sources/Plasma/FeatureLib/pfPython/pyDniInfoSource.h

@ -46,12 +46,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pyGlueHelpers.h"
class pyDniCoordinates;
class plUUID;
class pyDniInfoSource
{
private:
mutable char * fAgeName;
mutable char fAgeGuid[MAX_PATH];
protected:
pyDniInfoSource();
@ -74,7 +74,7 @@ public:
// name of current age
const char * GetAgeName( void ) const;
// unique identifier for this age instance
const char * GetAgeGuid( void ) const;
plUUID GetAgeGuid( void ) const;
};

3
Sources/Plasma/FeatureLib/pfPython/pyDniInfoSourceGlue.cpp

@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#pragma hdrstop
#include "pyDniInfoSource.h"
#include "pnUUID/pnUUID.h"
// glue functions
PYTHON_CLASS_DEFINITION(ptDniInfoSource, pyDniInfoSource);
@ -73,7 +74,7 @@ PYTHON_METHOD_DEFINITION_NOARGS(ptDniInfoSource, getAgeName)
PYTHON_METHOD_DEFINITION_NOARGS(ptDniInfoSource, getAgeGuid)
{
return PyString_FromString(self->fThis->GetAgeGuid());
return PyString_FromString(self->fThis->GetAgeGuid().AsString().c_str());
}
PYTHON_START_METHODS_TABLE(ptDniInfoSource)

5
Sources/Plasma/FeatureLib/pfSurface/plLayerAVI.cpp

@ -40,10 +40,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#if HS_BUILD_FOR_WIN32
#include "vfw.h"
# include "hsWindows.h"
# include <vfw.h>
#endif // HS_BUILD_FOR_WIN32
#include "plLayerAVI.h"

2
Sources/Plasma/NucleusLib/inc/plProfileManager.cpp

@ -42,7 +42,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plProfileManager.h"
#include "plProfile.h"
#include "hsTimer.h"
#include "hsWindows.h"
static uint32_t gCyclesPerMS = 0;

4
Sources/Plasma/NucleusLib/pnInputCore/plKeyDef.h

@ -42,10 +42,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plKeyDef_inc
#define plKeyDef_inc
#include "HeadSpin.h"
#if HS_BUILD_FOR_WIN32
#include "hsWindows.h" // FIXME: This gives me a sad.
#define VK_BACK_QUOTE 0xc0
// MinGW is missing these definitions:
#ifndef VK_OEM_PLUS

2
Sources/Plasma/NucleusLib/pnInputCore/plOSMsg.h

@ -53,6 +53,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// for Win32:
#ifdef HS_BUILD_FOR_WIN32
#include "hsWindows.h" // FIXME: This gives me a sad
enum plOSMsg
{
KEYDOWN = WM_KEYDOWN,

16
Sources/Plasma/NucleusLib/pnMessage/plEventCallbackMsg.h

@ -116,9 +116,19 @@ protected:
plMessage *fMsg;
public:
plMessage *GetMessage() { return fMsg; }
void SetMessage(plMessage *msg) { fMsg = msg; hsRefCnt_SafeRef(msg); }
void SendMessage() { fMsg->SendAndKeep(); }
plMessage* GetMessageNoRef() const { return fMsg; }
void SetMessageRef(plMessage *msg)
{
hsRefCnt_SafeUnRef(fMsg);
hsRefCnt_SafeRef(msg);
fMsg = msg;
}
void SendMessageAndKeep()
{
if (fMsg)
fMsg->SendAndKeep();
}
plEventCallbackInterceptMsg() : plEventCallbackMsg(), fMsg(nil) {}
~plEventCallbackInterceptMsg() { hsRefCnt_SafeUnRef(fMsg); fMsg = nil; }

1
Sources/Plasma/NucleusLib/pnNetCommon/plNetAddress.h

@ -45,6 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define plNetAddress_h_inc
#include "HeadSpin.h"
#include "hsWindows.h" // FIXME
#include "plString.h"
#include "hsStlUtils.h"

1
Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.cpp

@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "pnNetCommon.h"
#include "hsWindows.h"
#if HS_BUILD_FOR_UNIX
# include <sys/socket.h>

5
Sources/Plasma/NucleusLib/pnNetCommon/pnNetCommon.h

@ -42,13 +42,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef pnNetCommon_h_inc
#define pnNetCommon_h_inc
#include "HeadSpin.h"
#include "plString.h"
#include "hsStlUtils.h"
#include "hsRefCnt.h"
#include "hsStream.h"
#include "pnFactory/plCreatable.h"
class plString;
//
// main logging switch
//

1
Sources/Plasma/NucleusLib/pnTimer/hsTimer.cpp

@ -41,6 +41,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "hsTimer.h"
#include "HeadSpin.h"
#include "hsWindows.h"
#include "plTweak.h"

1
Sources/Plasma/NucleusLib/pnTimer/pnBuildDates.cpp

@ -52,6 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//////////////////////////////////////////////////////////////////////////////
#include "HeadSpin.h"
#include "hsWindows.h"
#include "pnTimer/pnBuildDates.h"
char pnBuildDates::fBuildDate[ 128 ] = __DATE__;

6
Sources/Plasma/PubUtilLib/plAudio/plEAXEffects.h

@ -65,8 +65,10 @@ typedef struct _EAXREVERBPROPERTIES EAXREVERBPROPERTIES;
#include "plEAXStructures.h"
#endif
#if !HS_BUILD_FOR_WIN32
#define GUID char*
#if HS_BUILD_FOR_WIN32
typedef struct _GUID GUID;
#else
# define GUID char*
#endif
class plEAXListener

1
Sources/Plasma/PubUtilLib/plAudio/plWinMicLevel.cpp

@ -57,6 +57,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#if HS_BUILD_FOR_WIN32
#include "hsWindows.h"
#include <mmsystem.h>

1
Sources/Plasma/PubUtilLib/plAudioCore/plWavFile.h

@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "HeadSpin.h"
#include "hsStlUtils.h"
#include "hsWindows.h" // FIXME
#include <mmsystem.h>
#include "plAudioFileReader.h"

2
Sources/Plasma/PubUtilLib/plAvatar/plArmatureEffects.cpp

@ -110,7 +110,7 @@ bool plArmatureEffectsMgr::MsgReceive(plMessage* msg)
if (iMsg)
{
if (fEnabled)
iMsg->SendMessage();
iMsg->SendMessageAndKeep();
}
plArmatureEffectMsg *eMsg = plArmatureEffectMsg::ConvertNoRef(msg);

4
Sources/Plasma/PubUtilLib/plAvatar/plArmatureMod.cpp

@ -2430,7 +2430,7 @@ void plArmatureMod::ISetupMarkerCallbacks(plATCAnim *anim, plAnimTimeConvert *at
iMsg->AddReceiver(fEffects->GetKey());
iMsg->fEventTime = time;
iMsg->fEvent = kTime;
iMsg->SetMessage(msg);
iMsg->SetMessageRef(msg);
atc->AddCallback(iMsg);
hsRefCnt_SafeUnRef(msg);
hsRefCnt_SafeUnRef(iMsg);
@ -2442,7 +2442,7 @@ void plArmatureMod::ISetupMarkerCallbacks(plATCAnim *anim, plAnimTimeConvert *at
iMsg->AddReceiver(fEffects->GetKey());
iMsg->fEventTime = time;
iMsg->fEvent = kTime;
iMsg->SetMessage(foot);
iMsg->SetMessageRef(foot);
atc->AddCallback(iMsg);
hsRefCnt_SafeUnRef(foot);
hsRefCnt_SafeUnRef(iMsg);

2
Sources/Plasma/PubUtilLib/plAvatar/plAvBrainSwim.cpp

@ -285,7 +285,7 @@ bool plAvBrainSwim::Apply(double time, float elapsed)
iMsg->AddReceiver(fAvMod->GetArmatureEffects()->GetKey());
iMsg->fEventTime = (float)time;
iMsg->fEvent = kTime;
iMsg->SetMessage(msg);
iMsg->SetMessageRef(msg);
iMsg->Send();
}
}

2
Sources/Plasma/PubUtilLib/plClipboard/plClipboard.cpp

@ -40,8 +40,8 @@ Mead, WA 99021
*==LICENSE==*/
#include "HeadSpin.h"
#include "plClipboard.h"
#include "hsWindows.h"
plClipboard& plClipboard::GetInstance()
{

5
Sources/Plasma/PubUtilLib/plFile/plBrowseFolder.h

@ -42,10 +42,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef plBrowseFolder_h_inc
#define plBrowseFolder_h_inc
#include "HeadSpin.h"
#ifdef HS_BUILD_FOR_WIN32
#include "HeadSpin.h"
#include "hsWindows.h"
//
// Gets a directory using the "Browse for Folder" dialog.
//

1
Sources/Plasma/PubUtilLib/plFile/plSecureStream.cpp

@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "plSecureStream.h"
#include "hsWindows.h"
#include "plFileUtils.h"
#include "hsSTLStream.h"

5
Sources/Plasma/PubUtilLib/plFile/plSecureStream.h

@ -46,9 +46,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsStream.h"
#if HS_BUILD_FOR_WIN32
# define hsFD HANDLE
typedef void* HANDLE;
# define hsFD HANDLE
#else
# define hsFD FILE*
# define hsFD FILE*
#endif
// A slightly more secure stream then plEncryptedStream in that it uses windows file functions

2
Sources/Plasma/PubUtilLib/plGImage/hsCodec.h

@ -42,6 +42,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#ifndef hsCodec_inc
#define hsCodec_inc
#include "HeadSpin.h"
class plMipmap;
class hsCodec

1
Sources/Plasma/PubUtilLib/plGImage/plAVIWriter.cpp

@ -46,6 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#if HS_BUILD_FOR_WIN32
#include "hsWindows.h"
#include <vfw.h>
#endif

2
Sources/Plasma/PubUtilLib/plGImage/plDynSurfaceWriter.h

@ -58,7 +58,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define _plDynSurfaceWriter_h
#include "hsColorRGBA.h"
// EVIL
#include "hsWindows.h" // FIXME: windows :(
struct hsMatrix44;

2
Sources/Plasma/PubUtilLib/plGImage/plWinFontCache.h

@ -63,8 +63,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsColorRGBA.h"
// EVIL
#include "hsTemplates.h"
#include "hsWindows.h" // FIXME: Windows header level include :(
#if HS_BUILD_FOR_WIN32

1
Sources/Plasma/PubUtilLib/plInputCore/plInputManager.cpp

@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsWindows.h"
// plInputManager.cpp
#define DIRECTINPUT_VERSION 0x0800
#include <dinput.h>

3
Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp

@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//#define DYNAHEADER_CREATE_STORAGE
#include "HeadSpin.h"
#include "hsWindows.h"
#include <time.h>
@ -1491,7 +1492,7 @@ void hsG3DDeviceSelector::IFudgeDirectXDevice( hsG3DDeviceRecord &record,
D3DEnum_DeviceInfo *deviceInfo )
{
char desc[ 512 ]; // Can't rely on D3D constant, since that's in another file now
DWORD vendorID, deviceID;
uint32_t vendorID, deviceID;
char *szDriver, *szDesc;

4
Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h

@ -396,10 +396,10 @@ protected:
uint32_t IAdjustDirectXMemory( uint32_t cardMem );
bool IGetD3DCardInfo( hsG3DDeviceRecord &record, void *driverInfo, void *deviceInfo,
DWORD *vendorID, DWORD *deviceID, char **driverString, char **descString );
uint32_t *vendorID, uint32_t *deviceID, char **driverString, char **descString );
#ifdef HS_SELECT_DX7
bool IGetD3D7CardInfo( hsG3DDeviceRecord &record, void *driverInfo, void *deviceInfo,
DWORD *vendorID, DWORD *deviceID, char **driverString, char **descString );
uint32_t *vendorID, uint32_t *deviceID, char **driverString, char **descString );
#endif // HS_SELECT_DX7
void ITryOpenGL( hsWinRef winRef );

3
Sources/Plasma/PubUtilLib/plPipeline/hsGDDrawDllLoad.cpp

@ -39,7 +39,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsWindows.h"
#include <ddraw.h>

1
Sources/Plasma/PubUtilLib/plPipeline/plDTProgressMgr.cpp

@ -49,7 +49,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// //
//////////////////////////////////////////////////////////////////////////////
#include <stdlib.h>
#include "HeadSpin.h"
#include "plDTProgressMgr.h"
#include "plPipeline.h"

1
Sources/Plasma/PubUtilLib/plPipeline/plDXDeviceRefs.cpp

@ -51,6 +51,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
///////////////////////////////////////////////////////////////////////////////
#include "HeadSpin.h"
#include "hsWindows.h"
#include <d3d9.h>
#include <ddraw.h>

2
Sources/Plasma/PubUtilLib/plPipeline/plDXEnumerate.cpp

@ -652,7 +652,7 @@ short hsGDirect3DTnLEnumerate::IGetDXBitDepth( D3DFORMAT format )
bool hsG3DDeviceSelector::IGetD3DCardInfo( hsG3DDeviceRecord &record, // In
void *driverInfo,
void *deviceInfo,
DWORD *vendorID, DWORD *deviceID, // Out
uint32_t *vendorID, uint32_t *deviceID, // Out
char **driverString, char **descString )
{
D3DEnum_DriverInfo *driverD3DInfo = (D3DEnum_DriverInfo *)driverInfo;

1
Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp

@ -52,6 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
///////////////////////////////////////////////////////////////////////////////
#include "HeadSpin.h"
#include "hsWindows.h"
#include <d3d9.h>
#include <ddraw.h>

1
Sources/Plasma/PubUtilLib/plPipeline/plDXPixelShader.cpp

@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsWindows.h"
#include <D3d9.h>
#include <D3dx9core.h>

2
Sources/Plasma/PubUtilLib/plPipeline/plDXTextFont.cpp

@ -51,13 +51,13 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
///////////////////////////////////////////////////////////////////////////////
#include "HeadSpin.h"
#include "hsWindows.h"
#include <d3d9.h>
#include <ddraw.h>
#include <d3dx9mesh.h>
#include "hsWinRef.h"
#include "HeadSpin.h"
#include "plDXTextFont.h"
#include "plDXPipeline.h"

3
Sources/Plasma/PubUtilLib/plPipeline/plDXVertexShader.cpp

@ -40,12 +40,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsWindows.h"
#include <D3d9.h>
#include <D3dx9core.h>
#include "HeadSpin.h"
#include "plDXVertexShader.h"
#include "plSurface/plShader.h"

2
Sources/Plasma/PubUtilLib/plPipeline/plGBufferGroup.cpp

@ -353,7 +353,7 @@ uint8_t plGBufferGroup::ICalcVertexSize( uint8_t &liteStride )
}
liteStride = size;
size += sizeof( DWORD ) * 2; // diffuse + specular
size += sizeof( uint32_t ) * 2; // diffuse + specular
return size;
}

7
Sources/Plasma/PubUtilLib/plPipeline/plPlates.cpp

@ -63,13 +63,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plClientResMgr/plClientResMgr.h"
// A bit of a hack so that we will have the correct instance in the SceneViewer
static HINSTANCE gHInstance = GetModuleHandle(nil);
void SetHInstance(void *instance)
{
gHInstance = (HINSTANCE)instance;
}
//////////////////////////////////////////////////////////////////////////////
//// plPlate Functions ///////////////////////////////////////////////////////

1
Sources/Plasma/PubUtilLib/plPipeline/plTextFont.cpp

@ -52,6 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "HeadSpin.h"
#include "hsWindows.h"
#include "plTextFont.h"
#include "plDebugText.h"

1
Sources/Plasma/PubUtilLib/plPipeline/plTextGenerator.cpp

@ -52,6 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "HeadSpin.h"
#include "hsWindows.h"
#include "hsMatrix44.h"
#include "pnKeyedObject/hsKeyedObject.h"
#include "plTextGenerator.h"

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

@ -39,6 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021
*==LICENSE==*/
#include "HeadSpin.h"
#include "plBufferedSocketWriter.h"
#include "plTcpSocket.h"

1
Sources/Plasma/PubUtilLib/plSockets/plFdSet.cpp

@ -39,6 +39,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
Mead, WA 99021
*==LICENSE==*/
#include "HeadSpin.h"
#include "plFdSet.h"
#include "plSocket.h"

5
Sources/Plasma/PubUtilLib/plSockets/plNet.h

@ -43,13 +43,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define plNet_h_inc
#include "HeadSpin.h"
////////////////////////////////////////////////////
// Windows net types
#if HS_BUILD_FOR_WIN32
#include "hsWindows.h"
const int kBlockingError = WSAEWOULDBLOCK;
const int kTimeoutError = WSAETIMEDOUT;
const SOCKET kBadSocket = 0xffffffff;

1
Sources/Plasma/PubUtilLib/plUnifiedTime/plUnifiedTime.cpp

@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include <cmath>
#include "plUnifiedTime.h"
#include "hsStlUtils.h"
#include "hsWindows.h"
#if HS_BUILD_FOR_UNIX

1
Sources/Tools/plFontConverter/plFontConverter.cpp

@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define WINDOWNAME "plFontConverter"
#include "HeadSpin.h"
#include "hsWindows.h"
#include "res/resource.h"
#include "pnAllCreatables.h"

3
Sources/Tools/plFontConverter/plFontConverterProc.cpp

@ -40,9 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsWindows.h"
#include "res/resource.h"
#include <shlwapi.h>
#include <shellapi.h>
#include <shlobj.h>
#include <commdlg.h>
#include <commctrl.h>
#include <time.h>

1
Sources/Tools/plLocalizationEditor/plAddDlgs.h

@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define __plAddDlgs_h__
#include "HeadSpin.h"
#include "hsWindows.h"
#include <string>
class plAddElementDlg

1
Sources/Tools/plLocalizationEditor/plEditDlg.h

@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define _pfEditDlg_h
#include "HeadSpin.h"
#include "hsWindows.h"
#include <string>
// Little trick to show a wait cursor while something is working

1
Sources/Tools/plResBrowser/plResBrowser.cpp

@ -43,6 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define WINDOWNAME "plResBrowser"
#include "HeadSpin.h"
#include "hsWindows.h"
#include "res/resource.h"
#include "pnAllCreatables.h"

3
Sources/Tools/plResBrowser/plResBrowserWndProc.cpp

@ -40,9 +40,12 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsWindows.h"
#include "hsTemplates.h"
#include "res/resource.h"
#include <commdlg.h>
#include <commctrl.h>
#include <shellapi.h>
#include <shlwapi.h>
#include <shlobj.h>

1
Sources/Tools/plResBrowser/plResTreeView.cpp

@ -40,6 +40,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "HeadSpin.h"
#include "hsWindows.h"
#include "plResTreeView.h"

1
Sources/Tools/plResBrowser/plWinRegistryTools.cpp

@ -49,6 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
//////////////////////////////////////////////////////////////////////////////
#include "HeadSpin.h"
#include "hsWindows.h"
#include "plWinRegistryTools.h"

Loading…
Cancel
Save