2
3
mirror of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git synced 2025-07-14 02:27:40 -04:00

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.
This commit is contained in:
2012-11-17 16:11:17 -05:00
parent 5de87cdaca
commit 7785c9c85e
71 changed files with 223 additions and 151 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -46,6 +46,17 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
# define HS_DEBUGGING # define HS_DEBUGGING
#endif // defined(_DEBUG) || defined(UNIX_DENUG) #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 // 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) # pragma warning( disable : 4305 4503 4018 4786 4284 4800)
# endif // _MSC_VER # endif // _MSC_VER
// Terrible hacks for MinGW because they don't have a reasonable // Kind of nasty looking forward declarations, but this is Win32.... it'll never change!
// default for the Windows version. We cheat and say it's XP. // If you want to argue: would you rather pull in the entire Windows.h? Windows 8 makes it
# ifdef __MINGW32__ // even more bloated than before!
# undef _WIN32_WINNT struct HWND__; typedef struct HWND__ *HWND;
# define _WIN32_WINNT 0x501 struct HINSTANCE__; typedef struct HINSTANCE__ *HINSTANCE;
# 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
typedef HWND hsWindowHndl; typedef HWND hsWindowHndl;
typedef HINSTANCE hsWindowInst; typedef HINSTANCE hsWindowInst;
typedef HINSTANCE HMODULE;
typedef long HRESULT;
#else #else
typedef int32_t* hsWindowHndl; typedef int32_t* hsWindowHndl;
typedef int32_t* hsWindowInst; typedef int32_t* hsWindowInst;
#endif // HS_BUILD_FOR_WIN32 #endif // HS_BUILD_FOR_WIN32
//====================================== //======================================
// Basic macros // Basic macros
//====================================== //======================================
@ -547,31 +512,16 @@ void DebugMsg(const char fmt[], ...);
/***************************************************************************** /*****************************************************************************
* *
* Atomic Operations * Atomic Operations
* FIXME: Replace with std::atomic when VS2012 supports WinXP
* *
***/ ***/
// *value += increment; return original value of *value; thread safe #ifdef _MSC_VER
inline long AtomicAdd(long* value, long increment) # define AtomicAdd(value, increment) InterlockedExchangeAdd(value, increment)
{ # define AtomicSet(value, set) InterlockedExchange(value, set)
#ifdef HS_BUILD_FOR_WIN32
return InterlockedExchangeAdd(value, increment);
#elif __GNUC__ #elif __GNUC__
return __sync_fetch_and_add(value, increment); # define AtomicAdd(value, increment) __sync_fetch_and_add(value, increment)
#else # define AtomicSet(value, set) __sync_lock_test_and_set(value, set)
# error "No Atomic Set support on this architecture"
#endif #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);
#elif __GNUC__
return __sync_lock_test_and_set(value, set);
#else
# error "No Atomic Set support on this architecture"
#endif
}
#endif #endif

View File

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

View File

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

View File

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

View File

@ -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_

View File

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

View File

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

View File

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

View File

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

View File

@ -117,7 +117,7 @@ PYTHON_METHOD_DEFINITION(ptAgeVault, getSubAgeLink, args)
PYTHON_METHOD_DEFINITION_NOARGS(ptAgeVault, getAgeGuid) 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) PYTHON_METHOD_DEFINITION(ptAgeVault, addDevice, args)

View File

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

View File

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

View File

@ -44,6 +44,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#pragma hdrstop #pragma hdrstop
#include "pyDniInfoSource.h" #include "pyDniInfoSource.h"
#include "pnUUID/pnUUID.h"
// glue functions // glue functions
PYTHON_CLASS_DEFINITION(ptDniInfoSource, pyDniInfoSource); PYTHON_CLASS_DEFINITION(ptDniInfoSource, pyDniInfoSource);
@ -73,7 +74,7 @@ PYTHON_METHOD_DEFINITION_NOARGS(ptDniInfoSource, getAgeName)
PYTHON_METHOD_DEFINITION_NOARGS(ptDniInfoSource, getAgeGuid) 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) PYTHON_START_METHODS_TABLE(ptDniInfoSource)

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -396,10 +396,10 @@ protected:
uint32_t IAdjustDirectXMemory( uint32_t cardMem ); uint32_t IAdjustDirectXMemory( uint32_t cardMem );
bool IGetD3DCardInfo( hsG3DDeviceRecord &record, void *driverInfo, void *deviceInfo, 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 #ifdef HS_SELECT_DX7
bool IGetD3D7CardInfo( hsG3DDeviceRecord &record, void *driverInfo, void *deviceInfo, 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 #endif // HS_SELECT_DX7
void ITryOpenGL( hsWinRef winRef ); void ITryOpenGL( hsWinRef winRef );

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -63,13 +63,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plClientResMgr/plClientResMgr.h" #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 /////////////////////////////////////////////////////// //// plPlate Functions ///////////////////////////////////////////////////////

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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