Browse Source

Merge pull request #496 from dpogue/reorganizing

Code Cleanups & Reorganizing
Adam Johnson 9 years ago
parent
commit
2df97a78ff
  1. 4
      Sources/Plasma/Apps/plClient/plClient.cpp
  2. 2
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  3. 2
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp
  4. 2
      Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp
  5. 2
      Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp
  6. 3
      Sources/Plasma/FeatureLib/pfSurface/plLayerMovie.cpp
  7. 2
      Sources/Plasma/NucleusLib/inc/CMakeLists.txt
  8. 0
      Sources/Plasma/NucleusLib/inc/hsGDeviceRef.h
  9. 0
      Sources/Plasma/NucleusLib/inc/plPipeDebugFlags.h
  10. 7
      Sources/Plasma/NucleusLib/inc/plPipeline.h
  11. 24
      Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcLog.cpp
  12. 18
      Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcLog.h
  13. 2
      Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt
  14. 102
      Sources/Plasma/NucleusLib/pnNetCommon/plNetResManager.cpp
  15. 66
      Sources/Plasma/NucleusLib/pnNetCommon/plNetResManager.h
  16. 2
      Sources/Plasma/PubUtilLib/plAvatar/plAvatarClothing.cpp
  17. 4
      Sources/Plasma/PubUtilLib/plDrawable/CMakeLists.txt
  18. 4
      Sources/Plasma/PubUtilLib/plDrawable/plAccessGeometry.cpp
  19. 2
      Sources/Plasma/PubUtilLib/plDrawable/plAuxSpan.h
  20. 8
      Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp
  21. 2
      Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp
  22. 4
      Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp
  23. 2
      Sources/Plasma/PubUtilLib/plDrawable/plGBufferGroup.cpp
  24. 0
      Sources/Plasma/PubUtilLib/plDrawable/plGBufferGroup.h
  25. 2
      Sources/Plasma/PubUtilLib/plDrawable/plParticleFiller.cpp
  26. 4
      Sources/Plasma/PubUtilLib/plDrawable/plSpanTypes.cpp
  27. 0
      Sources/Plasma/PubUtilLib/plDrawable/plVertCoder.cpp
  28. 0
      Sources/Plasma/PubUtilLib/plDrawable/plVertCoder.h
  29. 4
      Sources/Plasma/PubUtilLib/plGImage/CMakeLists.txt
  30. 2
      Sources/Plasma/PubUtilLib/plGImage/plBitmap.cpp
  31. 1134
      Sources/Plasma/PubUtilLib/plGImage/plDynSurfaceWriter.cpp
  32. 221
      Sources/Plasma/PubUtilLib/plGImage/plDynSurfaceWriter.h
  33. 2
      Sources/Plasma/PubUtilLib/plGImage/plDynamicTextMap.cpp
  34. 3
      Sources/Plasma/PubUtilLib/plGImage/plLODMipmap.cpp
  35. 2
      Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp
  36. 293
      Sources/Plasma/PubUtilLib/plGImage/plWinFontCache.cpp
  37. 130
      Sources/Plasma/PubUtilLib/plGImage/plWinFontCache.h
  38. 4
      Sources/Plasma/PubUtilLib/plGLight/plLightInfo.cpp
  39. 36
      Sources/Plasma/PubUtilLib/plModifier/plSDLModifier.cpp
  40. 2
      Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt
  41. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp
  42. 2
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp
  43. 33
      Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp
  44. 2
      Sources/Plasma/PubUtilLib/plNetCommon/CMakeLists.txt
  45. 20
      Sources/Plasma/PubUtilLib/plNetCommon/plNetObjectDebugger.cpp
  46. 0
      Sources/Plasma/PubUtilLib/plNetCommon/plNetObjectDebugger.h
  47. 8
      Sources/Plasma/PubUtilLib/plPipeline/CMakeLists.txt
  48. 2
      Sources/Plasma/PubUtilLib/plPipeline/DX/plDXDeviceRef.h
  49. 2
      Sources/Plasma/PubUtilLib/plPipeline/DX/plDXDeviceRefs.cpp
  50. 226
      Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.cpp
  51. 15
      Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.h
  52. 2
      Sources/Plasma/PubUtilLib/plPipeline/DX/plDXVertexShader.cpp
  53. 85
      Sources/Plasma/PubUtilLib/plPipeline/hsGColorizer.cpp
  54. 66
      Sources/Plasma/PubUtilLib/plPipeline/hsGColorizer.h
  55. 2
      Sources/Plasma/PubUtilLib/plPipeline/plTextGenerator.cpp
  56. 2
      Sources/Plasma/PubUtilLib/plSurface/plLayer.cpp
  57. 3
      Sources/Plasma/PubUtilLib/plSurface/plShader.cpp
  58. 2
      Sources/Plasma/PubUtilLib/plUnifiedTime/plClientUnifiedTime.cpp
  59. 2
      Sources/Tools/MaxComponent/plParticleComponents.cpp
  60. 4
      Sources/Tools/MaxConvert/plMeshConverter.cpp

4
Sources/Plasma/Apps/plClient/plClient.cpp

@ -91,8 +91,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plStatGather/plProfileManagerFull.h"
#include "plPipeline.h"
#include "plPipeDebugFlags.h"
#include "plPipeline/plPipelineCreate.h"
#include "plPipeline/plPipeDebugFlags.h"
#include "plPipeline/plTransitionMgr.h"
#include "plPipeline/plCaptureRender.h"
#include "plPipeline/plDynamicEnvMap.h"
@ -135,7 +135,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pfAnimation/plAnimDebugList.h"
#include "pfGameGUIMgr/pfGUICtrlGenerator.h"
#include "plGImage/plWinFontCache.h"
#include "plGImage/plFontCache.h"
#include "pfJournalBook/pfJournalBook.h"
@ -2202,7 +2201,6 @@ void plClient::IOnAsyncInitComplete () {
// Load our custom fonts from our current dat directory
fFontCache->LoadCustomFonts("dat");
plWinFontCache::GetInstance().LoadCustomFonts("dat");
// We'd like to do a SetHoldLoadRequests here, but the GUI stuff doesn't draw right
// if you try to delay the loading for it. To work around that, we allocate a

2
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp

@ -58,7 +58,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAgeLoader/plAgeLoader.h"
#include "plNetClient/plNetClientMgr.h"
#include "plPipeline/plDebugText.h"
#include "plPipeline/plPipeDebugFlags.h"
#include "plPipeDebugFlags.h"
#include "plMessage/plMovieMsg.h"
#include "plDrawable/plDrawableSpans.h"
#include "plPipeline.h"

2
Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommandsNet.cpp

@ -55,7 +55,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plgDispatch.h"
#include "plAgeLoader/plAgeLoader.h"
#include "plNetClient/plNetObjectDebugger.h"
#include "plNetCommon/plNetObjectDebugger.h"
#include "plNetClient/plNetClientMgr.h"
#include "plNetClient/plNetLinkingMgr.h"
#include "plAgeLoader/plResPatcher.h"

2
Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp

@ -67,7 +67,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pfMessage/pfGUINotifyMsg.h"
#include "plGImage/plMipmap.h"
#include "plGImage/plDynamicTextMap.h"
#include "plPipeline/hsGDeviceRef.h"
#include "hsGDeviceRef.h"
#include "plMessage/plAnimCmdMsg.h"
#include "pnKeyedObject/plFixedKey.h"
#include "pnMessage/plRefMsg.h"

2
Sources/Plasma/FeatureLib/pfMoviePlayer/plMoviePlayer.cpp

@ -58,7 +58,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAudio/plWin32VideoSound.h"
#include "plGImage/plMipmap.h"
#include "pnKeyedObject/plUoid.h"
#include "plPipeline/hsGDeviceRef.h"
#include "hsGDeviceRef.h"
#include "plPipeline/plPlates.h"
#include "plResMgr/plLocalization.h"
#include "plStatusLog/plStatusLog.h"

3
Sources/Plasma/FeatureLib/pfSurface/plLayerMovie.cpp

@ -44,11 +44,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plLayerMovie.h"
#include "hsStream.h"
#include "hsResMgr.h"
#include "hsGDeviceRef.h"
#include "plMessage/plAnimCmdMsg.h"
#include "plGImage/plMipmap.h"
#include "plPipeline/hsGDeviceRef.h"
plLayerMovie::plLayerMovie()
: fCurrentFrame(-1),

2
Sources/Plasma/NucleusLib/inc/CMakeLists.txt

@ -3,6 +3,7 @@ include_directories("../../NucleusLib")
include_directories("../../NucleusLib/inc")
set(pnNucleusInc_HEADERS
hsGDeviceRef.h
hsGMatState.h
hsGMatState.inl
hsResMgr.h
@ -16,6 +17,7 @@ set(pnNucleusInc_HEADERS
plgDispatch.h
plLoggable.h
plPhysical.h
plPipeDebugFlags.h
plPipeline.h
plPipeResReq.h
plProfile.h

0
Sources/Plasma/PubUtilLib/plPipeline/hsGDeviceRef.h → Sources/Plasma/NucleusLib/inc/hsGDeviceRef.h

0
Sources/Plasma/PubUtilLib/plPipeline/plPipeDebugFlags.h → Sources/Plasma/NucleusLib/inc/plPipeDebugFlags.h

7
Sources/Plasma/NucleusLib/inc/plPipeline.h

@ -228,9 +228,6 @@ public:
virtual bool EndRender() = 0;
virtual void RenderScreenElements( void ) = 0;
virtual bool BeginDrawable(plDrawable* d) = 0;
virtual bool EndDrawable(plDrawable* d) = 0;
virtual void BeginVisMgr(plVisMgr* visMgr) = 0;
virtual void EndVisMgr(plVisMgr* visMgr) = 0;
@ -321,10 +318,6 @@ public:
virtual void PopMaterialOverride(const hsGMatState& restore, bool on) = 0;
virtual const hsGMatState& GetMaterialOverride(bool on) const = 0;
virtual hsColorOverride PushColorOverride(const hsColorOverride& over) = 0;
virtual void PopColorOverride(const hsColorOverride& restore) = 0;
virtual const hsColorOverride& GetColorOverride() const = 0;
virtual void SubmitShadowSlave(plShadowSlave* slave) = 0;
virtual void SubmitClothingOutfit(plClothingOutfit* co) = 0;

24
Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcLog.cpp

@ -97,27 +97,3 @@ void LogMsgV (ELogSeverity severity, const wchar_t *format, va_list args) {
plStatusLog::AddLineS("OLD_ASYNC_LOG.log", to_log);
delete[] to_log;
}
//============================================================================
#ifdef HS_DEBUGGING
void LogMsgDebug (const char *format, ...) {
ASSERT(format);
va_list args;
va_start(args, format);
LogMsgV(kLogDebug, format, args);
va_end(args);
}
#endif
//============================================================================
#ifdef HS_DEBUGGING
void LogMsgDebug (const wchar_t *format, ...) {
ASSERT(format);
va_list args;
va_start(args, format);
LogMsgV(kLogDebug, format, args);
va_end(args);
}
#endif

18
Sources/Plasma/NucleusLib/pnAsyncCore/Private/pnAcLog.h

@ -80,21 +80,3 @@ void LogMsg (ELogSeverity severity, const char *format, ...);
void LogMsg (ELogSeverity severity, const wchar_t *format, ...);
void LogMsgV (ELogSeverity severity, const char *format, va_list args);
void LogMsgV (ELogSeverity severity, const wchar_t *format, va_list args);
/****************************************************************************
*
* Debugging API
*
***/
#ifdef HS_DEBUGGING
void LogMsgDebug (const char *format, ...);
void LogMsgDebug (const wchar_t *format, ...);
#else
inline void LogMsgDebug (const char *, ...) { }
inline void LogMsgDebug (const wchar_t *, ...) { }
#endif

2
Sources/Plasma/NucleusLib/pnNetCommon/CMakeLists.txt

@ -9,7 +9,6 @@ set(pnNetCommon_HEADERS
plNetAddress.h
plNetApp.h
plNetGroup.h
plNetResManager.h
plNetServers.h
plNetSharedState.h
plSDLTypes.h
@ -24,7 +23,6 @@ set(pnNetCommon_SOURCES
plNetAddress.cpp
plNetApp.cpp
plNetGroup.cpp
plNetResManager.cpp
plNetServers.cpp
plNetSharedState.cpp
plSDLTypes.cpp

102
Sources/Plasma/NucleusLib/pnNetCommon/plNetResManager.cpp

@ -1,102 +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==*/
//////////////////////////////////////////////////////////////////////////////
//
// plNetResManager
//
//// Philosophy //////////////////////////////////////////////////////////////
//
// "Cannot say. Saying, I would know. Do not know, so cannot say."
// -- Zathras, "Babylon 5"
//
// Normally, plResManager would be plenty for the servers and then some.
// However, the normal resManager tries to do things smart, such as read in
// keys from disk if they don't already exist and so forth. However, all the
// servers care about is reading in enough of a key to be able to turn around
// and write it back out to a stream. So, we overload ReadKeyAndReg() to just
// read in a new key and return it. Our new key reffing system will guarantee
// that the key eventually gets freed once we're done with it, and we don't
// care about sharing keys because all we're interested in is the uoid anyway,
// so no need to store the keys in the registry or anything.
//
//////////////////////////////////////////////////////////////////////////////
#include "plNetResManager.h"
#include "pnKeyedObject/plKeyImp.h"
#include "pnKeyedObject/plUoid.h"
#include "pnKeyedObject/hsKeyedObject.h"
#include "pnFactory/plCreatable.h"
#include "pnNetCommon/plNetApp.h"
#include "hsStream.h"
plNetResManager::plNetResManager()
{
}
plNetResManager::~plNetResManager()
{
}
plCreatable* plNetResManager::IReadCreatable(hsStream* s) const
{
uint16_t hClass = s->ReadLE16();
if (plFactory::CanCreate(hClass))
{
plCreatable *pCre = plFactory::Create(hClass);
if (!pCre)
hsAssert(hClass == 0x8000, "Invalid creatable index");
return pCre;
}
plNetApp::StaticWarningMsg(plFormat("NetResMgr::Can't create class {}", plFactory::GetNameOfClass(hClass)));
return nil;
}
void plNetResManager::IKeyReffed(plKeyImp* key)
{
}
void plNetResManager::IKeyUnreffed(plKeyImp* key)
{
delete key;
}

66
Sources/Plasma/NucleusLib/pnNetCommon/plNetResManager.h

@ -1,66 +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==*/
#ifndef plNetResMgr_h
#define plNetResMgr_h
#include "plResMgr/plResManager.h"
#include "pnKeyedObject/plKey.h"
//
// plNetResMgr - Keys? Disk? What? Nah, we'll just create new ones and give them to ya
//
class hsStream;
class plNetResManager : public plResManager
{
public:
plNetResManager();
~plNetResManager();
protected:
plCreatable* IReadCreatable(hsStream* s) const;
virtual void IKeyReffed(plKeyImp* key);
virtual void IKeyUnreffed(plKeyImp* key);
};
#endif // plNetResMgr_h

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

@ -53,7 +53,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pfMessage/plClothingMsg.h"
#include "plMessage/plRenderMsg.h"
#include "plGImage/plMipmap.h"
#include "plPipeline/hsGDeviceRef.h"
#include "hsGDeviceRef.h"
#include "plPipeline/plRenderTarget.h"
#include "plPipeline.h"
#include "plClothingLayout.h"

4
Sources/Plasma/PubUtilLib/plDrawable/CMakeLists.txt

@ -26,6 +26,7 @@ set(plDrawable_SOURCES
plDynaTorpedoVSMgr.cpp
plDynaWakeMgr.cpp
plFixedWaterState7.cpp
plGBufferGroup.cpp
plGeometrySpan.cpp
plGeoSpanDice.cpp
plInstanceDrawInterface.cpp
@ -43,6 +44,7 @@ set(plDrawable_SOURCES
plSpanInstance.cpp
plSpanTemplate.cpp
plSpanTypes.cpp
plVertCoder.cpp
plVisLOSMgr.cpp
plWaveSet7.cpp
plWaveSetBase.cpp
@ -76,6 +78,7 @@ set(plDrawable_HEADERS
plDynaTorpedoVSMgr.h
plDynaWakeMgr.h
plFixedWaterState7.h
plGBufferGroup.h
plGeometrySpan.h
plGeoSpanDice.h
plInstanceDrawInterface.h
@ -95,6 +98,7 @@ set(plDrawable_HEADERS
plSpanTemplate.h
plSpanTypes.h
plTimedInterp.h
plVertCoder.h
plVisLOSMgr.h
plWaveSet7.h
plWaveSetBase.h

4
Sources/Plasma/PubUtilLib/plDrawable/plAccessGeometry.cpp

@ -57,8 +57,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAccessSnapShot.h"
// For dipping directly into device buffers.
#include "plPipeline/plGBufferGroup.h"
#include "plPipeline/hsGDeviceRef.h"
#include "plGBufferGroup.h"
#include "hsGDeviceRef.h"
#include "plPipeline.h"
#include "plTweak.h"

2
Sources/Plasma/PubUtilLib/plDrawable/plAuxSpan.h

@ -46,7 +46,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsTemplates.h"
#include "plSpanTypes.h"
#include "plPipeline/plGBufferGroup.h"
#include "plGBufferGroup.h"
class plDrawableSpans;
class hsGMaterial;

8
Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpans.cpp

@ -63,6 +63,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsStream.h"
#include "hsResMgr.h"
#include "plPipeline.h"
#include "plPipeDebugFlags.h"
#include "plGeometrySpan.h"
#include "plSpaceTree.h"
#include "plParticleFiller.h"
@ -71,19 +72,18 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plClusterGroup.h"
#include "plCluster.h"
#include "plSpanTemplate.h"
#include "plGBufferGroup.h"
#include "plMath/hsRadixSort.h"
#include "plSurface/hsGMaterial.h"
#include "plSurface/plLayerInterface.h"
#include "plPipeline/plFogEnvironment.h"
#include "plPipeline/hsGDeviceRef.h"
#include "plPipeline/plPipeDebugFlags.h"
#include "hsGDeviceRef.h"
#include "pnMessage/plRefMsg.h"
#include "pnMessage/plNodeRefMsg.h"
#include "pnMessage/plDISpansMsg.h"
#include "plMessage/plDeviceRecreateMsg.h"
#include "plMessage/plRenderMsg.h"
#include "plPipeline/plGBufferGroup.h"
#include "pnSceneObject/plDrawInterface.h"
#include "pnKeyedObject/plKey.h"
#include "plParticleSystem/plParticleEmitter.h"

2
Sources/Plasma/PubUtilLib/plDrawable/plDrawableSpansExport.cpp

@ -55,6 +55,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsResMgr.h"
#include "plPipeline.h"
#include "plGeometrySpan.h"
#include "plGBufferGroup.h"
#include "plSpaceTree.h"
#include "plSpaceTreeMaker.h" // This is fun and amusing and wonderful to have here.
@ -64,7 +65,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnMessage/plRefMsg.h"
#include "pnMessage/plNodeRefMsg.h" // for NodeRefMsg
#include "plMessage/plDeviceRecreateMsg.h"
#include "plPipeline/plGBufferGroup.h"
#include "plSurface/hsGMaterial.h"
#include "plSurface/plLayerInterface.h"
#include "plGImage/plBitmap.h"

4
Sources/Plasma/PubUtilLib/plDrawable/plDynaDecalMgr.cpp

@ -48,6 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plAccessGeometry.h"
#include "plAccessSpan.h"
#include "plGBufferGroup.h"
#include "plDrawableSpans.h"
#include "plAuxSpan.h"
@ -66,8 +67,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plSurface/plLayerInterface.h"
#include "plScene/plPageTreeMgr.h"
#include "plPipeline/plGBufferGroup.h"
#include "plPipeline/hsGDeviceRef.h"
#include "hsGDeviceRef.h"
#include "plMessage/plAgeLoadedMsg.h"
#include "plMessage/plDynaDecalEnableMsg.h"

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

@ -56,7 +56,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsStream.h"
#include "plSurface/hsGMaterial.h"
#include "plDrawable/plGeometrySpan.h"
#include "plGeometrySpan.h"
#include "plPipeline.h"
#include "hsGDeviceRef.h"
#include "plProfile.h"

0
Sources/Plasma/PubUtilLib/plPipeline/plGBufferGroup.h → Sources/Plasma/PubUtilLib/plDrawable/plGBufferGroup.h

2
Sources/Plasma/PubUtilLib/plDrawable/plParticleFiller.cpp

@ -53,7 +53,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
// Getting at the destination data
#include "pnSceneObject/plDrawInterface.h"
#include "plDrawable/plDrawableSpans.h"
#include "plPipeline/plGBufferGroup.h"
#include "plGBufferGroup.h"
// For shading
#include "plGLight/plLightInfo.h"

4
Sources/Plasma/PubUtilLib/plDrawable/plSpanTypes.cpp

@ -53,8 +53,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plSpanTypes.h"
#include "hsStream.h"
#include "pnKeyedObject/plKey.h"
#include "plPipeline/plGBufferGroup.h"
#include "plPipeline/hsGDeviceRef.h"
#include "plGBufferGroup.h"
#include "hsGDeviceRef.h"
#include "plGLight/plLightInfo.h"
#include "plDrawable.h"
#include "plAuxSpan.h"

0
Sources/Plasma/PubUtilLib/plPipeline/plVertCoder.cpp → Sources/Plasma/PubUtilLib/plDrawable/plVertCoder.cpp

0
Sources/Plasma/PubUtilLib/plPipeline/plVertCoder.h → Sources/Plasma/PubUtilLib/plDrawable/plVertCoder.h

4
Sources/Plasma/PubUtilLib/plGImage/CMakeLists.txt

@ -15,7 +15,6 @@ set(plGImage_SOURCES
plBumpMapGen.cpp
plCubicEnvironmap.cpp
plDynamicTextMap.cpp
plDynSurfaceWriter.cpp
plFont.cpp
plFontCache.cpp
plJPEG.cpp
@ -23,7 +22,6 @@ set(plGImage_SOURCES
plMipmap.cpp
plPNG.cpp
plTGAWriter.cpp
plWinFontCache.cpp
)
set(plGImage_HEADERS
@ -35,7 +33,6 @@ set(plGImage_HEADERS
plBumpMapGen.h
plCubicEnvironmap.h
plDynamicTextMap.h
plDynSurfaceWriter.h
plFont.h
plFontCache.h
plGImageCreatable.h
@ -44,7 +41,6 @@ set(plGImage_HEADERS
plMipmap.h
plPNG.h
plTGAWriter.h
plWinFontCache.h
)
add_library(plGImage STATIC ${plGImage_SOURCES} ${plGImage_HEADERS})

2
Sources/Plasma/PubUtilLib/plGImage/plBitmap.cpp

@ -57,8 +57,8 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsResMgr.h"
#include "hsStream.h"
#include "hsGDeviceRef.h"
#include "pnKeyedObject/plKey.h"
#include "plPipeline/hsGDeviceRef.h"
//// Static Members ///////////////////////////////////////////////////////////

1134
Sources/Plasma/PubUtilLib/plGImage/plDynSurfaceWriter.cpp

File diff suppressed because it is too large Load Diff

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

@ -1,221 +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==*/
///////////////////////////////////////////////////////////////////////////////
// //
// plDynSurfaceWriter Class Header //
// Abstract class wrapping around Windows GDI functionality for writing to //
// a generic RGBA surface. Allows us to create one writer per DTMap or a //
// single shared writer to conserve OS resources on 98/ME. //
// //
// Cyan, Inc. //
// //
//// Version History //////////////////////////////////////////////////////////
// //
// 10.28.2002 mcn - Created. //
// //
///////////////////////////////////////////////////////////////////////////////
#ifndef _plDynSurfaceWriter_h
#define _plDynSurfaceWriter_h
#include "hsColorRGBA.h"
#include "hsWindows.h" // FIXME: windows :(
struct hsMatrix44;
class plDynamicTextMap;
//// Class Definition /////////////////////////////////////////////////////////
class plDynSurfaceWriter
{
public:
//// Public Flags ////
enum Justify
{
kLeftJustify = 0,
kCenter,
kRightJustify
};
enum Flags
{
kSupportAlpha = 0x00000001,
kFontBold = 0x00000002,
kFontItalic = 0x00000004,
kFontShadowed = 0x00000008,
kFontMask = 0x0000000e,
kDiscardOnFlush = 0x00000010
};
//// Public Data /////
//// Public Members ////
plDynSurfaceWriter();
plDynSurfaceWriter( plDynamicTextMap *target, uint32_t flags = 0 );
virtual ~plDynSurfaceWriter();
/// Operations to perform on the text block
void ClearToColor( hsColorRGBA &color );
void SetFont( const char *face, uint16_t size, uint8_t fontFlags = 0, bool antiAliasRGB = true );
void SetTextColor( hsColorRGBA &color, bool blockRGB = false );
void SetJustify( Justify j );
void DrawString( uint16_t x, uint16_t y, const char *text );
void DrawClippedString( int16_t x, int16_t y, const char *text, uint16_t width, uint16_t height );
void DrawClippedString( int16_t x, int16_t y, const char *text, uint16_t clipX, uint16_t clipY, uint16_t width, uint16_t height );
void DrawWrappedString( uint16_t x, uint16_t y, const char *text, uint16_t width, uint16_t height );
uint16_t CalcStringWidth( const char *text, uint16_t *height = nil );
void CalcWrappedStringSize( const char *text, uint16_t *width, uint16_t *height );
void FillRect( uint16_t x, uint16_t y, uint16_t width, uint16_t height, hsColorRGBA &color );
void FrameRect( uint16_t x, uint16_t y, uint16_t width, uint16_t height, hsColorRGBA &color );
// void DrawImage( uint16_t x, uint16_t y, plMipmap *image, bool respectAlpha = false );
// void DrawClippedImage( uint16_t x, uint16_t y, plMipmap *image, uint16_t srcClipX, uint16_t srcClipY,
// uint16_t srcClipWidth, uint16_t srcClipHeight, bool respectAlpha = false );
// Copy the raw data from the given buffer.
// void SetBitsFromBuffer( uint32_t *clearBuffer, uint16_t width, uint16_t height )
/// Target switching operations
// Flushes all ops to the target.
void FlushToTarget( void );
// Switches targets. Will flush to old target before switching. Also, if kDiscard isn't specified, will copy contents of new target to working surface
void SwitchTarget( plDynamicTextMap *target ); // Will force a flush
// Clears and resets everything. Does NOT flush.
void Reset( void );
bool IsValid( void ) const;
static bool CanHandleLotsOfThem( void );
protected:
//// Protected Members ////
void IInit( void );
void IEnsureSurfaceUpdated( void );
void IRefreshOSJustify( void );
void ISetTextColor( hsColorRGBA &color, bool blockRGB );
void ISetFont( const plString &face, uint16_t size, uint8_t fontFlags = 0, bool antiAliasRGB = true );
plDynamicTextMap *fCurrTarget;
uint32_t fFlags;
Justify fJustify;
bool fFlushed;
plString fFontFace;
uint16_t fFontSize;
uint8_t fFontFlags;
bool fFontAntiAliasRGB;
bool fFontBlockedRGB;
static bool fForceSharedSurfaces;
static bool fOSDetected;
static bool fOSCanShareSurfaces;
#if HS_BUILD_FOR_WIN32
class plWinSurface
{
protected:
void *fBits;
virtual uint8_t IBitsPerPixel( void ) const = 0;
public:
HDC fDC;
HBITMAP fBitmap;
HFONT fFont;
COLORREF fTextColor;
int fSaveNum;
uint16_t fWidth, fHeight;
plString fFontFace;
uint16_t fFontSize;
uint8_t fFontFlags;
bool fFontAntiAliasRGB, fFontBlockedRGB;
plWinSurface();
~plWinSurface();
void Allocate( uint16_t w, uint16_t h );
void Release( void );
bool WillFit( uint16_t w, uint16_t h );
bool FontMatches( const plString &face, uint16_t size, uint8_t flags, bool aaRGB );
void SetFont( const plString &face, uint16_t size, uint8_t flags, bool aaRGB );
};
class plWinRGBSurface : public plWinSurface
{
virtual uint8_t IBitsPerPixel( void ) const { return 32; }
public:
uint32_t *GetBits( void ) const { return (uint32_t *)fBits; }
};
class plWinAlphaSurface : public plWinSurface
{
virtual uint8_t IBitsPerPixel( void ) const { return 8; }
public:
uint8_t *GetBits( void ) const { return (uint8_t *)fBits; }
};
plWinRGBSurface fRGBSurface;
plWinAlphaSurface fAlphaSurface;
#endif
};
#endif // _plDynSurfaceWriter_h

2
Sources/Plasma/PubUtilLib/plGImage/plDynamicTextMap.cpp

@ -58,7 +58,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsExceptions.h"
#include "hsMatrix44.h"
#include "plPipeline/hsGDeviceRef.h"
#include "hsGDeviceRef.h"
#include "plMessage/plDynamicTextMsg.h"
#include "pnKeyedObject/plKey.h"
#include "plProfile.h"

3
Sources/Plasma/PubUtilLib/plGImage/plLODMipmap.cpp

@ -44,12 +44,11 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plLODMipmap.h"
#include "hsResMgr.h"
#include "hsGDeviceRef.h"
#include "pnKeyedObject/plKey.h"
#include "pnKeyedObject/plUoid.h"
#include "pnMessage/plRefMsg.h"
#include "plPipeline/hsGDeviceRef.h"
plLODMipmap::plLODMipmap()
: fBase(nil),

2
Sources/Plasma/PubUtilLib/plGImage/plMipmap.cpp

@ -57,7 +57,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsExceptions.h"
#include "hsColorRGBA.h"
#include "plPipeline/hsGDeviceRef.h"
#include "hsGDeviceRef.h"
#include "plProfile.h"
#include "plJPEG.h"
#include <cmath>

293
Sources/Plasma/PubUtilLib/plGImage/plWinFontCache.cpp

@ -1,293 +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==*/
///////////////////////////////////////////////////////////////////////////////
// //
// plWinFontCache Class Header //
// I've stopped keeping track, there are far too many reasons already to //
// hate Microsoft. Anyway, this class keeps track of various Win32 fonts we //
// allocate because Win98/ME seems to have problems re-allocating the exact //
// same freaking goddamn font over and over again. I mean, you'd think //
// there'd be a rule somewhere about deterministic behavior when calling //
// the exact same function with the exact same parameters over and over... //
// Oh, wait... //
// //
// Cyan, Inc. //
// //
//// Version History //////////////////////////////////////////////////////////
// //
// 11.25.2002 mcn - Created. //
// //
///////////////////////////////////////////////////////////////////////////////
#include "HeadSpin.h"
#include "plWinFontCache.h"
#include "plStatusLog/plStatusLog.h"
#include "plGImage/plDynSurfaceWriter.h"
#if HS_BUILD_FOR_WIN32
#include <wingdi.h>
const char* plWinFontCache::kCustFontExtension = ".prf";
plWinFontCache::plWinFontCache()
{
fInShutdown = false;
fCustFontDir = nil;
}
plWinFontCache::~plWinFontCache()
{
fInShutdown = true;
Clear();
delete [] fCustFontDir;
}
plWinFontCache &plWinFontCache::GetInstance( void )
{
static plWinFontCache cache;
return cache;
}
HFONT plWinFontCache::IFindFont( const plString &face, int height, int weight, bool italic, uint32_t quality )
{
int i;
for( i = 0; i < fFontCache.GetCount(); i++ )
{
// Do other tests first, since they're cheaper
if( fFontCache[ i ].fHeight == height &&
fFontCache[ i ].fWeight == weight &&
fFontCache[ i ].fItalic == italic &&
fFontCache[ i ].fQuality == quality )
{
if (fFontCache[i].fFace == face)
return fFontCache[ i ].fFont;
}
}
return nil;
}
HFONT plWinFontCache::IMakeFont( const plString &face, int height, int weight, bool italic, uint32_t quality )
{
plFontRecord myRec;
int i;
// Find a cached name for us
for( i = 0; i < fFontNameCache.GetCount(); i++ )
{
if (face == fFontNameCache[i])
break;
}
if( i == fFontNameCache.GetCount() )
fFontNameCache.Append(face);
myRec.fFace = fFontNameCache[ i ];
myRec.fHeight = height;
myRec.fWeight = weight;
myRec.fItalic = italic;
myRec.fQuality = quality;
myRec.fFont = CreateFontW( height, 0, 0, 0, weight, italic ? TRUE : FALSE, FALSE, FALSE, ANSI_CHARSET, OUT_DEFAULT_PRECIS,
CLIP_DEFAULT_PRECIS, DEFAULT_QUALITY, VARIABLE_PITCH, face.ToWchar().GetData() );
if( myRec.fFont != nil )
{
//#ifdef HS_DEBUGGING
#if 1
LOGFONT fontInfo;
if( GetObject( myRec.fFont, sizeof( fontInfo ), &fontInfo ) )
{
const char *err = nil;
if( fontInfo.lfQuality != quality )
err = "Quality of created font does not match";
if( fontInfo.lfHeight != height )
err = "Height of created font does not match";
if( fontInfo.lfWeight != weight )
err = "Weight of created font does not match";
if( static_cast<bool>(fontInfo.lfItalic) != italic )
err = "Italic-ness of created font does not match";
if( face.CompareI(fontInfo.lfFaceName) != 0 )
err = "Face of created font does not match";
if( err != nil )
{
static bool triedClearing = false;
if( fontInfo.lfQuality != quality )
{
plStatusLog::AddLineS( "pipeline.log", "ERROR: CreateFont() failed to return proper font (%s). Using what was given...", err );
}
else
{
plStatusLog::AddLineS( "pipeline.log", "ERROR: CreateFont() failed to return proper font (%s). %s", err, triedClearing ? "" : "Clearing cache and retrying..." );
if( !triedClearing )
{
triedClearing = true;
// Didn't work, so get rid of it
DeleteObject( myRec.fFont );
// Clear all fonts and try again
Clear();
// Make sure we reload our custom fonts tho
ILoadCustomFonts();
// Try again
HFONT font = IMakeFont( face, height, weight, italic, quality );
triedClearing = false;
return font;
}
}
}
}
#endif
fFontCache.Append( myRec );
}
else
{
plStatusLog::AddLineS( "pipeline.log", "ERROR: CreateFont() call FAILED (face: %s, size: %d %s %s)",
face.c_str(), -height, weight == FW_BOLD ? "bold" : "", italic ? "italic" : "" );
}
return myRec.fFont;
}
HFONT plWinFontCache::GetMeAFont( const plString &face, int height, int weight, bool italic, uint32_t quality )
{
HFONT font = IFindFont( face, height, weight, italic, quality );
if( font == nil )
font = IMakeFont( face, height, weight, italic, quality );
return font;
}
void plWinFontCache::Clear( void )
{
int i;
if( !fInShutdown )
plStatusLog::AddLineS( "pipeline.log", "** Clearing Win32 font cache **" );
for( i = 0; i < fFontCache.GetCount(); i++ )
DeleteObject( fFontCache[ i ].fFont );
fFontCache.Reset();
fFontNameCache.Reset();
for( i = 0; i < fCustFonts.GetCount(); i++ )
{
#if (_WIN32_WINNT >= 0x0500)
if (plDynSurfaceWriter::CanHandleLotsOfThem())
RemoveFontResourceExW(fCustFonts[i]->fFilename.AsString().ToWchar(), FR_PRIVATE, 0);
else
#endif
if (RemoveFontResourceW(fCustFonts[i]->fFilename.AsString().ToWchar()) == 0)
{
int q= 0;
DWORD e = GetLastError();
}
delete fCustFonts[ i ];
}
fCustFonts.Reset();
}
void plWinFontCache::FreeFont( HFONT font )
{
// Currently a no-op, but should do some sort of ref-counting
}
void plWinFontCache::LoadCustomFonts( const char *dir )
{
delete [] fCustFontDir;
fCustFontDir = ( dir != nil ) ? hsStrcpy( dir ) : nil;
ILoadCustomFonts();
}
void plWinFontCache::ILoadCustomFonts( void )
{
if( fCustFontDir == nil )
return;
// Iterate through all the custom fonts in our dir
int numAdded;
std::vector<plFileName> fonts = plFileSystem::ListDir(fCustFontDir, kCustFontExtension);
for (auto iter = fonts.begin(); iter != fonts.end(); ++iter)
{
// Note that this call can be translated as "does my OS suck?"
#if (_WIN32_WINNT >= 0x0500)
if( plDynSurfaceWriter::CanHandleLotsOfThem() )
numAdded = AddFontResourceExW(iter->AsString().ToWchar(), FR_PRIVATE, 0);
else
#endif
numAdded = AddFontResourceW(iter->AsString().ToWchar());
if( numAdded > 0 )
{
plStatusLog::AddLineS( "pipeline.log", "WinFontCache: Added custom font %s, %d fonts", iter->GetFileName().c_str(), numAdded );
fCustFonts.Append(new plCustFont(*iter));
}
else
{
plStatusLog::AddLineS( "pipeline.log", "WinFontCache: Unable to load custom font %s", iter->GetFileName().c_str() );
}
}
}
#endif

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

@ -1,130 +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==*/
///////////////////////////////////////////////////////////////////////////////
// //
// plWinFontCache Class Header //
// I've stopped keeping track, there are far too many reasons already to //
// hate Microsoft. Anyway, this class keeps track of various Win32 fonts we //
// allocate because Win98/ME seems to have problems re-allocating the exact //
// same freaking goddamn font over and over again. I mean, you'd think //
// there'd be a rule somewhere about deterministic behavior when calling //
// the exact same function with the exact same parameters over and over... //
// Oh, wait... //
// //
// Cyan, Inc. //
// //
//// Version History //////////////////////////////////////////////////////////
// //
// 11.25.2002 mcn - Created. //
// //
///////////////////////////////////////////////////////////////////////////////
#ifndef _plWinFontCache_h
#define _plWinFontCache_h
#include "hsColorRGBA.h"
#include "hsTemplates.h"
#include "hsWindows.h" // FIXME: Windows header level include :(
#if HS_BUILD_FOR_WIN32
//// Class Definition /////////////////////////////////////////////////////////
class plWinFontCache
{
protected:
class plFontRecord
{
public:
HFONT fFont;
plString fFace;
int fHeight;
int fWeight;
bool fItalic;
uint32_t fQuality;
};
class plCustFont
{
public:
plFileName fFilename;
plCustFont(const plFileName &c) { fFilename = c; }
};
bool fInShutdown;
hsTArray<plFontRecord> fFontCache;
hsTArray<plString> fFontNameCache;
char *fCustFontDir;
hsTArray<plCustFont *> fCustFonts;
plWinFontCache();
HFONT IFindFont( const plString &face, int height, int weight, bool italic, uint32_t quality );
HFONT IMakeFont( const plString &face, int height, int weight, bool italic, uint32_t quality );
void ILoadCustomFonts( void );
public:
virtual ~plWinFontCache();
static plWinFontCache &GetInstance( void );
HFONT GetMeAFont( const plString &face, int height, int weight, bool italic, uint32_t quality );
void FreeFont( HFONT font );
void Clear( void );
void LoadCustomFonts( const char *dir );
// Our custom font extension
static const char* kCustFontExtension;
};
#endif // HS_BUILD_FOR_WIN32
#endif // _plWinFontCache_h

4
Sources/Plasma/PubUtilLib/plGLight/plLightInfo.cpp

@ -52,7 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plDrawable/plSpaceTree.h"
#include "plDrawable/plDrawableGenerator.h"
#include "plDrawable/plDrawableSpans.h"
#include "plPipeline/hsGDeviceRef.h"
#include "hsGDeviceRef.h"
#include "plPipeline/plRenderTarget.h"
#include "hsFastMath.h"
#include "pnSceneObject/plDrawInterface.h"
@ -65,7 +65,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plScene/plRenderRequest.h"
#include "plPipeline.h"
#include "plIntersect/plSoftVolume.h"
#include "plPipeline/plPipeDebugFlags.h"
#include "plPipeDebugFlags.h"
#include "pnMessage/plPipeResMakeMsg.h"
#include "plScene/plVisRegion.h"

36
Sources/Plasma/PubUtilLib/plModifier/plSDLModifier.cpp

@ -46,10 +46,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnSceneObject/plSceneObject.h"
#include "pnMessage/plSDLModifierMsg.h"
#include "plNetCommon/plNetObjectDebugger.h"
#include "plNetMessage/plNetMessage.h"
#include "plSDL/plSDL.h"
#include "plNetClient/plNetClientMgr.h"
#include "plNetClient/plNetObjectDebugger.h"
plSDLModifier::plSDLModifier() : fStateCache(nil), fSentOrRecvdState(false)
{
@ -92,15 +91,40 @@ void plSDLModifier::ISendNetMsg(plStateDataRecord*& state, plKey senderKey, uint
bool dirtyOnly = (sendFlags & plSynchedObject::kForceFullSend) == 0;
bool broadcast = (sendFlags & plSynchedObject::kBCastToClients) != 0;
int writeOptions=0;
// if (dirtyOnly)
writeOptions |= plSDL::kDirtyOnly;
if (broadcast)
writeOptions |= plSDL::kBroadcast;
writeOptions |= plSDL::kTimeStampOnRead;
plNetClientMgr::GetInstance()->StoreSDLState(state, senderKey->GetUoid(), sendFlags, writeOptions);
// send to server
plNetMsgSDLState* msg = state->PrepNetMsg(0, writeOptions);
msg->SetNetProtocol(kNetProtocolCli2Game);
msg->ObjectInfo()->SetUoid(senderKey->GetUoid());
if (sendFlags & plSynchedObject::kNewState)
msg->SetBit(plNetMessage::kNewSDLState);
if (sendFlags & plSynchedObject::kUseRelevanceRegions)
msg->SetBit(plNetMessage::kUseRelevanceRegions);
if (sendFlags & plSynchedObject::kDontPersistOnServer)
msg->SetPersistOnServer(false);
if (sendFlags & plSynchedObject::kIsAvatarState)
msg->SetIsAvatarState(true);
if (broadcast && plNetClientApp::GetInstance())
{
msg->SetPlayerID(plNetClientApp::GetInstance()->GetPlayerID());
}
plNetClientApp::GetInstance()->SendMsg(msg);
msg->UnRef();
fSentOrRecvdState = true;
}

2
Sources/Plasma/PubUtilLib/plNetClient/CMakeLists.txt

@ -19,7 +19,6 @@ set(plNetClient_SOURCES
plNetClientMsgHandler.cpp
plNetClientMsgScreener.cpp
plNetLinkingMgr.cpp
plNetObjectDebugger.cpp
plNetVoiceList.cpp
)
@ -33,7 +32,6 @@ set(plNetClient_HEADERS
plNetClientMsgHandler.h
plNetClientMsgScreener.h
plNetLinkingMgr.h
plNetObjectDebugger.h
plNetVoiceList.h
)

2
Sources/Plasma/PubUtilLib/plNetClient/plNetCliAgeJoiner.cpp

@ -50,7 +50,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plNetCliAgeJoiner.h"
#include "plNetClientMgr.h"
#include "plNetLinkingMgr.h"
#include "plNetObjectDebugger.h"
#include "plNetCommon/plNetObjectDebugger.h"
#include "pnSceneObject/plSceneObject.h"
#include "pnSceneObject/plCoordinateInterface.h"

2
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgr.cpp

@ -47,7 +47,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plPhysical.h"
#include "plNetClientMsgHandler.h"
#include "plNetLinkingMgr.h"
#include "plNetObjectDebugger.h"
#include "plNetCommon/plNetObjectDebugger.h"
#include "pnUtils/pnUtils.h"
#include "plProduct.h"

33
Sources/Plasma/PubUtilLib/plNetClient/plNetClientMgrSend.cpp

@ -43,7 +43,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsResMgr.h"
#include "plNetClientMgr.h"
#include "plCreatableIndex.h"
#include "plNetObjectDebugger.h"
#include "plNetCommon/plNetObjectDebugger.h"
#include "pnNetCommon/plSynchedObject.h"
#include "pnNetCommon/plSDLTypes.h"
@ -437,34 +437,3 @@ int plNetClientMgr::SendMsg(plNetMessage* msg)
return ret;
}
void plNetClientMgr::StoreSDLState(const plStateDataRecord* sdRec, const plUoid& uoid,
uint32_t sendFlags, uint32_t writeOptions)
{
// send to server
plNetMsgSDLState* msg = sdRec->PrepNetMsg(0, writeOptions);
msg->SetNetProtocol(kNetProtocolCli2Game);
msg->ObjectInfo()->SetUoid(uoid);
if (sendFlags & plSynchedObject::kNewState)
msg->SetBit(plNetMessage::kNewSDLState);
if (sendFlags & plSynchedObject::kUseRelevanceRegions)
msg->SetBit(plNetMessage::kUseRelevanceRegions);
if (sendFlags & plSynchedObject::kDontPersistOnServer)
msg->SetPersistOnServer(false);
if (sendFlags & plSynchedObject::kIsAvatarState)
msg->SetIsAvatarState(true);
bool broadcast = (sendFlags & plSynchedObject::kBCastToClients) != 0;
if (broadcast && plNetClientApp::GetInstance())
{
msg->SetPlayerID(plNetClientApp::GetInstance()->GetPlayerID());
}
SendMsg(msg);
delete msg;
}

2
Sources/Plasma/PubUtilLib/plNetCommon/CMakeLists.txt

@ -10,6 +10,7 @@ set(plNetCommon_SOURCES
plNetCommonHelpers.cpp
plNetMember.cpp
plNetMsgScreener.cpp
plNetObjectDebugger.cpp
plNetServerSessionInfo.cpp
plSpawnPointInfo.cpp
)
@ -23,6 +24,7 @@ set(plNetCommon_HEADERS
plNetMember.h
plNetMsgHandler.h
plNetMsgScreener.h
plNetObjectDebugger.h
plNetServerSessionInfo.h
plSpawnPointInfo.h
)

20
Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.cpp → Sources/Plasma/PubUtilLib/plNetCommon/plNetObjectDebugger.cpp

@ -51,10 +51,10 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plNetClient/plNetClientMgr.h"
#include "plAgeLoader/plAgeLoader.h"
plNetObjectDebugger::DebugObject::DebugObject(const char* objName, plLocation& loc, uint32_t flags) :
fLoc(loc),
plNetObjectDebugger::DebugObject::DebugObject(const char* objName, plLocation& loc, uint32_t flags) :
fLoc(loc),
fFlags(flags)
{
{
std::string tmp = objName;
hsStrLower((char*)tmp.c_str());
fObjName = tmp;
@ -102,7 +102,7 @@ bool plNetObjectDebugger::DebugObject::StringMatches(const char* str) const
// if both objName and pageName are provided, and this object has page info,
// return true if object matches both string and location.
// else just return true if object matches string
//
//
bool plNetObjectDebugger::DebugObject::ObjectMatches(const char* objName, const char* pageName)
{
if (!objName)
@ -143,9 +143,9 @@ plNetObjectDebugger::plNetObjectDebugger() : fStatusLog(nil), fDebugging(false)
{
}
plNetObjectDebugger::~plNetObjectDebugger()
{
ClearAllDebugObjects();
plNetObjectDebugger::~plNetObjectDebugger()
{
ClearAllDebugObjects();
delete fStatusLog;
}
@ -155,8 +155,8 @@ plNetObjectDebugger::~plNetObjectDebugger()
plNetObjectDebugger* plNetObjectDebugger::GetInstance()
{
static plNetObjectDebugger gNetObjectDebugger;
if (plNetObjectDebuggerBase::GetInstance()==nil)
if (plNetObjectDebuggerBase::GetInstance() == nullptr)
plNetObjectDebuggerBase::SetInstance(&gNetObjectDebugger);
return &gNetObjectDebugger;
@ -169,7 +169,7 @@ void plNetObjectDebugger::ICreateStatusLog() const
{
if (!fStatusLog)
{
fStatusLog = plStatusLogMgr::GetInstance().CreateStatusLog(40, "NetObject.log",
fStatusLog = plStatusLogMgr::GetInstance().CreateStatusLog(40, "NetObject.log",
plStatusLog::kFilledBackground | plStatusLog::kAlignToTop | plStatusLog::kTimestamp );
}
}

0
Sources/Plasma/PubUtilLib/plNetClient/plNetObjectDebugger.h → Sources/Plasma/PubUtilLib/plNetCommon/plNetObjectDebugger.h

8
Sources/Plasma/PubUtilLib/plPipeline/CMakeLists.txt

@ -10,7 +10,6 @@ endif(WIN32)
set(plPipeline_SOURCES
hsG3DDeviceSelector.cpp
hsGColorizer.cpp
plCaptureRender.cpp
plCubicRenderTargetModifier.cpp
plCullTree.cpp
@ -18,14 +17,12 @@ set(plPipeline_SOURCES
plDTProgressMgr.cpp
plDynamicEnvMap.cpp
plFogEnvironment.cpp
plGBufferGroup.cpp
plPlates.cpp
plRenderTarget.cpp
plStatusLogDrawer.cpp
plTextFont.cpp
plTextGenerator.cpp
plTransitionMgr.cpp
plVertCoder.cpp
)
set(plDXPipeline_SOURCES
@ -42,8 +39,6 @@ set(plDXPipeline_SOURCES
set(plPipeline_HEADERS
hsFogControl.h
hsG3DDeviceSelector.h
hsGColorizer.h
hsGDeviceRef.h
hsWinRef.h
plCaptureRender.h
plCubicRenderTarget.h
@ -55,8 +50,6 @@ set(plPipeline_HEADERS
plDTProgressMgr.h
plDynamicEnvMap.h
plFogEnvironment.h
plGBufferGroup.h
plPipeDebugFlags.h
plPipelineCreatable.h
plPipelineCreate.h
plPlates.h
@ -66,7 +59,6 @@ set(plPipeline_HEADERS
plTextFont.h
plTextGenerator.h
plTransitionMgr.h
plVertCoder.h
)
set(plDXPipeline_HEADERS

2
Sources/Plasma/PubUtilLib/plPipeline/DX/plDXDeviceRef.h

@ -54,7 +54,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define _plDXDeviceRef_h
#include "HeadSpin.h"
#include "plPipeline/hsGDeviceRef.h"
#include "hsGDeviceRef.h"
//// Definition ///////////////////////////////////////////////////////////////

2
Sources/Plasma/PubUtilLib/plPipeline/DX/plDXDeviceRefs.cpp

@ -64,7 +64,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plDXLightRef.h"
#include "plDXTextureRef.h"
#include "plDXRenderTargetRef.h"
#include "plPipeline/plGBufferGroup.h"
#include "plDrawable/plGBufferGroup.h"
#include "plDrawable/plGeometrySpan.h"
#include "plDrawable/plDrawableSpans.h"
#include "plGLight/plLightInfo.h"

226
Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.cpp

@ -82,7 +82,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plPipeline/plStatusLogDrawer.h"
#include "plQuality.h"
#include "plPipeline/plPipeDebugFlags.h"
#include "plPipeDebugFlags.h"
#include "hsTemplates.h"
//#include "hsGEnviron.h"
@ -112,7 +112,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plPipeline/plDebugText.h"
#include "plPipeline/plFogEnvironment.h"
#include "plDXTextFont.h"
#include "plPipeline/plGBufferGroup.h"
#include "plDrawable/plGBufferGroup.h"
#include "hsTimer.h"
#include "plgDispatch.h"
#include "plScene/plRenderRequest.h"
@ -2884,21 +2884,6 @@ void plDXPipeline::Render( plDrawable *d, const hsTArray<int16_t>& visList )
}
}
//// BeginDrawable ////////////////////////////////////////////////////////////
// Obsolete, should be removed
bool plDXPipeline::BeginDrawable( plDrawable *d )
{
return true;
}
//// EndDrawable //////////////////////////////////////////////////////////////
// Obsolete, should be removed
bool plDXPipeline::EndDrawable( plDrawable *d )
{
return true;
}
// IMakeLightLists ///////////////////////////////////////////////////////////
// Look through all the current lights, and fill out two lists.
// Only active lights (not disabled, not exactly black, and not
@ -5202,9 +5187,7 @@ void plDXPipeline::ClearRenderTarget( plDrawable* d )
fView.fDrawableTypeMask = plDrawable::kNormal;
fView.fSubDrawableTypeMask = uint32_t(-1);
BeginDrawable(d);
Draw(d);
EndDrawable(d);
fView.fSubDrawableTypeMask = sdtm;
fView.fDrawableTypeMask = dtm;
@ -9132,25 +9115,6 @@ void plDXPipeline::SetDepth(float hither, float yon)
IGetViewTransform().SetDepth(hither, yon);
}
//// ISavageYonHack ///////////////////////////////////////////////////////////
// Corrects the yon for the *#(&$*#&$(*& Savage4 chipset (ex. Diamond Stealth
// III S540). Let's just say this card SUCKS.
// Obsolete since we don't support the Savage4 chipset any more.
void plDXPipeline::ISavageYonHack()
{
float yon = GetViewTransform().GetYon();
if( ( yon > 128.f - 5.0f ) && ( yon < 128.f + 1.01f ) )
yon = 128.f + 1.01f;
else if( ( yon > 256.f - 10.0f ) && ( yon < 256.f + 1.02f ) )
yon = 256.f + 1.02f;
else if( ( yon > 512.f - 35.0f ) && ( yon < 512.f + 1.02f ) )
yon = 512.f + 1.02f;
else if( ( yon > 1024.f - 120.0f ) && ( yon < 1024.f + 1.f ) )
yon = 1024.f + 1.f;
}
//// GetWorldToCamera /////////////////////////////////////////////////////////
// Return current world to camera transform.
const hsMatrix44& plDXPipeline::GetWorldToCamera() const
@ -9557,49 +9521,6 @@ const hsGMatState& plDXPipeline::GetMaterialOverride(bool on) const
return on ? fMatOverOn : fMatOverOff;
}
//// PushColorOverride //////////////////////////////////////////////////
// Obsolete and unused.
hsColorOverride plDXPipeline::PushColorOverride(const hsColorOverride& over)
{
hsColorOverride ret = GetColorOverride();
PopColorOverride( over );
return ret;
}
// PopColorOverride ////////////////////////////////////////////////////////
// Obsolete and unused.
void plDXPipeline::PopColorOverride(const hsColorOverride& restore)
{
return;
/*
hsColorOverride cpy = restore;
if( !(cpy.fFlags & hsColorOverride::kModAlpha) )
cpy.fColor.a = 1.f;
if( !(cpy.fFlags & (hsColorOverride::kModAlpha | hsColorOverride::kModColor)) )
fDev->SetColorNormal();
else
fDev->SetColorOverride(cpy.fColor, !(cpy.fFlags & hsColorOverride::kModColor));
*/
}
//// GetColorOverride /////////////////////////////////////////////////////////
// Obsolete and unused.
const hsColorOverride& plDXPipeline::GetColorOverride() const
{
static hsColorOverride ret;
return ret;
/* ret.fFlags = hsColorOverride::kNone;
if( fDev->GetDebugFlags() & hsG3DDevice::kDeviceColor )
ret.fFlags |= hsColorOverride::kModColor;
if( fDev->GetDebugFlags() & hsG3DDevice::kDeviceAlpha )
ret.fFlags |= hsColorOverride::kModAlpha;
ret.fColor = fDev->GetColorOverride();
*/
return ret;
}
///////////////////////////////////////////////////////////////////////////////
//// Transforms ///////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
@ -10316,123 +10237,6 @@ void plDXPipeline::IEndAllocUnManaged()
fManagedSeen = 0;
}
// ICheckTextureUsage ////////////////////////////////////////////////////////////////////
// Obsolete, unused.
// Deletes textures LRU to try to get around NVidia memory manager bug. Found a
// more robust/efficent way. Besides, it didn't help. See OSVERSION.
void plDXPipeline::ICheckTextureUsage()
{
plProfile_IncCount(fTexUsed, fTexUsed);
plProfile_IncCount(fTexManaged, fTexManaged);
plConst(uint32_t) kMinTexManaged(5000000);
if( fTexManaged < kMinTexManaged )
return;
plConst(uint32_t) kScale(2);
if( fTexUsed * kScale < fTexManaged )
{
// Find the stalest
uint32_t stalest = fTextUseTime;
plDXTextureRef* ref = fTextureRefList;
while( ref )
{
// I don't know if render targets even get put in this list.
if( !(ref->GetFlags() & plDXTextureRef::kRenderTarget) && (ref->fUseTime < stalest) )
stalest = ref->fUseTime;
ref = ref->GetNext();
}
stalest = fTextUseTime - stalest;
// If the stalest is fresh, live with thrashing
plConst(uint32_t) kMinAge(60);
if( stalest < kMinAge )
return;
// Kill the stalest, and everything more than half as stale
stalest /= 2;
if( stalest < kMinAge )
stalest = kMinAge;
stalest = fTextUseTime - stalest;
// Go through again slaughtering left and right
ref = fTextureRefList;
while( ref )
{
if( !(ref->GetFlags() & plDXTextureRef::kRenderTarget) && (ref->fUseTime < stalest) )
{
plDXTextureRef* nuke = ref;
ref = ref->GetNext();
nuke->Release();
nuke->Unlink();
}
else
{
ref = ref->GetNext();
}
}
}
}
// ICheckVtxUsage ////////////////////////////////////////////////////////////////////
// Obsolete, unused.
// Deletes textures LRU to try to get around NVidia memory manager bug. Found a
// more robust/efficent way. Besides, it didn't help. See OSVERSION.
void plDXPipeline::ICheckVtxUsage()
{
plProfile_IncCount(fVtxUsed, fVtxUsed);
plProfile_IncCount(fVtxManaged, fVtxManaged);
plConst(uint32_t) kMinVtxManaged(5000000);
if( fVtxManaged < kMinVtxManaged )
return;
plConst(uint32_t) kScale(2);
if( fVtxUsed * kScale < fVtxManaged )
{
// Find the stalest
uint32_t stalest = fTextUseTime;
plDXVertexBufferRef* ref = fVtxBuffRefList;
while( ref )
{
if( !ref->Volatile() && (ref->fUseTime < stalest) )
stalest = ref->fUseTime;
ref = ref->GetNext();
}
stalest = fTextUseTime - stalest;
// If the stalest is fresh, live with thrashing
plConst(uint32_t) kMinAge(60);
if( stalest < kMinAge )
return;
// Kill the stalest, and everything more than half as stale
stalest /= 2;
if( stalest < kMinAge )
stalest = kMinAge;
stalest = fTextUseTime - stalest;
// Go through again slaughtering left and right
ref = fVtxBuffRefList;
while( ref )
{
if( !ref->Volatile() && (ref->fUseTime < stalest) )
{
plDXVertexBufferRef* nuke = ref;
ref = ref->GetNext();
nuke->Release();
nuke->Unlink();
}
else
{
ref = ref->GetNext();
}
}
}
}
bool plDXPipeline::CheckResources()
{
if ((fClothingOutfits.GetCount() <= 1 && fAvRTPool.GetCount() > 1) ||
@ -11973,32 +11777,6 @@ const char *plDXPipeline::IGetDXFormatName( D3DFORMAT format )
}
}
//// IFPUCheck ////////////////////////////////////////////////////////////////
// Checks the FPU to make sure it's in the right mode
// This should return wSave to allow it to be restored after rendering.
// This is obsolete as of DX8
void plDXPipeline::IFPUCheck()
{
#ifdef _MSC_VER
WORD wSave, wTemp;
__asm fstcw wSave
if (wSave & 0x300 || // Not single mode
0x3f != (wSave & 0x3f) || // Exceptions enabled
wSave & 0xC00) // Not round to nearest mode
{
__asm
{
mov ax, wSave
and ax, not 0x300 ;; single mode
or ax, 0x3f ;; disable all exceptions
and ax, not 0xC00 ;; round to nearest mode
mov wTemp, ax
fldcw wTemp
}
}
#endif
}
// PushPiggyBackLayer /////////////////////////////////////////////////////
// Push a piggy back onto the stack.
plLayerInterface* plDXPipeline::PushPiggyBackLayer(plLayerInterface* li)

15
Sources/Plasma/PubUtilLib/plPipeline/DX/plDXPipeline.h

@ -52,7 +52,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsGeometry3.h"
#include "hsTemplates.h"
#include "hsColorRGBA.h"
#include "plPipeline/hsGDeviceRef.h"
#include "hsGDeviceRef.h"
#include "hsPoint2.h"
class plAccessSpan;
@ -338,8 +338,6 @@ protected:
void IBeginAllocUnManaged();
void IEndAllocUnManaged();
void ICheckTextureUsage();
void ICheckVtxUsage();
inline void ICheckVBUsage(plDXVertexBufferRef* vRef);
bool IRefreshDynVertices(plGBufferGroup* group, plDXVertexBufferRef* vRef);
@ -480,9 +478,6 @@ protected:
void IShowErrorMessage( char *errStr = nil );
bool ICreateFail( char *errStr );
// FPU mode check
void IFPUCheck();
// Device initialization
void IInvalidateState();
void IInitDeviceState();
@ -525,7 +520,6 @@ protected:
void IProjectionMatrixToD3D();
void IWorldToCameraToD3D();
void ILocalToWorldToD3D();
void ISavageYonHack();
void ISetLocalToWorld( const hsMatrix44& l2w, const hsMatrix44& w2l );
void ISetCullMode(bool flip=false);
bool inline IIsViewLeftHanded();
@ -645,9 +639,6 @@ public:
virtual bool EndRender();
virtual void RenderScreenElements();
virtual bool BeginDrawable(plDrawable* d);
virtual bool EndDrawable(plDrawable* d);
virtual void BeginVisMgr(plVisMgr* visMgr);
virtual void EndVisMgr(plVisMgr* visMgr);
@ -770,10 +761,6 @@ public:
virtual void PopMaterialOverride(const hsGMatState& restore, bool on);
virtual const hsGMatState& GetMaterialOverride(bool on) const;
virtual hsColorOverride PushColorOverride(const hsColorOverride& over);
virtual void PopColorOverride(const hsColorOverride& restore);
virtual const hsColorOverride& GetColorOverride() const;
virtual void SubmitShadowSlave(plShadowSlave* slave);
virtual void SubmitClothingOutfit(plClothingOutfit* co);

2
Sources/Plasma/PubUtilLib/plPipeline/DX/plDXVertexShader.cpp

@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plSurface/plShader.h"
#include "plPipeline/plGBufferGroup.h"
#include "plDrawable/plGBufferGroup.h"
#include "plDXPipeline.h"
plDXVertexShader::plDXVertexShader(plShader* owner)

85
Sources/Plasma/PubUtilLib/plPipeline/hsGColorizer.cpp

@ -1,85 +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==*/
#include "HeadSpin.h"
#include "plPipeline.h"
#include "hsGColorizer.h"
bool hsGColorizer::Colorizing()
{
return fPipeline ? 0 != (fPipeline->GetColorOverride().fFlags & hsColorOverride::kModColor) : false;
}
bool hsGColorizer::Alpharizing()
{
return fPipeline ? 0 != (fPipeline->GetColorOverride().fFlags & hsColorOverride::kModAlpha) : false;
}
hsColorRGBA hsGColorizer::GetCurrentColor()
{
return fPipeline ? fPipeline->GetColorOverride().fColor : hsColorRGBA().Set(1.f,1.f,1.f,1.f);
}
void hsGColorizer::Init(plPipeline* pipe)
{
fPipeline = pipe;
}
void hsGColorizer::PushColorize(hsColorRGBA& col, bool alphaOnly)
{
if( fPipeline )
{
hsColorOverride colorOver;
colorOver.fFlags = alphaOnly ? hsColorOverride::kModAlpha : hsColorOverride::kModColor | hsColorOverride::kModAlpha;
colorOver.fColor = col;
fResetColor = fPipeline->PushColorOverride(colorOver);
}
}
void hsGColorizer::PopColorize()
{
if( fPipeline )
{
fPipeline->PopColorOverride(fResetColor);
}
}

66
Sources/Plasma/PubUtilLib/plPipeline/hsGColorizer.h

@ -1,66 +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==*/
#ifndef hsGColorizer_inc
#define hsGColorizer_inc
#include "HeadSpin.h"
#include "hsColorRGBA.h"
class plPipeline;
class hsGColorizer {
protected:
hsColorOverride fResetColor;
plPipeline* fPipeline;
public:
hsGColorizer() : fPipeline(nil) {}
bool Colorizing();
bool Alpharizing();
hsColorRGBA GetCurrentColor();
void Init(plPipeline* pipe);
void PushColorize(hsColorRGBA& col, bool alphaOnly);
void PopColorize();
};
#endif // hsGColorizer_inc

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

@ -57,7 +57,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "pnKeyedObject/hsKeyedObject.h"
#include "plTextGenerator.h"
#include "plGImage/plMipmap.h"
#include "plPipeline/hsGDeviceRef.h"
#include "hsGDeviceRef.h"
#include "pnMessage/plRefMsg.h"
#include "plgDispatch.h"

2
Sources/Plasma/PubUtilLib/plSurface/plLayer.cpp

@ -49,7 +49,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsGMatState.inl"
#include "plMessage/plLayRefMsg.h"
#include "plGImage/plBitmap.h"
#include "plPipeline/hsGDeviceRef.h"
#include "hsGDeviceRef.h"
#include "plShader.h"
#include "plPipeline.h"

3
Sources/Plasma/PubUtilLib/plSurface/plShader.cpp

@ -48,8 +48,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsStream.h"
#include "hsMatrix44.h"
#include "hsColorRGBA.h"
#include "plPipeline/hsGDeviceRef.h"
#include "hsGDeviceRef.h"
// Little shader const helper

2
Sources/Plasma/PubUtilLib/plUnifiedTime/plClientUnifiedTime.cpp

@ -45,7 +45,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plClientUnifiedTime.h"
#if 0
#include "plNetClient/plNetObjectDebugger.h"
#include "plNetCommon/plNetObjectDebugger.h"
#include "plNetClient/plNetClientMgr.h"
#endif

2
Sources/Tools/MaxComponent/plParticleComponents.cpp

@ -80,7 +80,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "MaxMain/MaxCompat.h"
#include "pnKeyedObject/plKey.h"
#include "plSurface/hsGMaterial.h"
#include "plPipeline/plGBufferGroup.h"
#include "plDrawable/plGBufferGroup.h"
#include "plParticleSystem/plParticleSystem.h"
#include "plParticleSystem/plParticleEmitter.h"

4
Sources/Tools/MaxConvert/plMeshConverter.cpp

@ -78,7 +78,7 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "MaxPlasmaMtls/Materials/plPassMtl.h"
#include "MaxPlasmaMtls/Materials/plCompositeMtlPB.h"
#include "MaxPlasmaMtls/Materials/plPassMtlBasicPB.h"
#include "plPipeline/plGBufferGroup.h"
#include "plDrawable/plGBufferGroup.h"
#include "plParticleSystem/plConvexVolume.h"
#include "plDrawable/plGeoSpanDice.h"
@ -2555,4 +2555,4 @@ void SetWaterColor(hsTArray<plGeometrySpan*>& spans)
int i;
for( i = 0; i < spans.GetCount(); i++ )
SetWaterColor(spans[i]);
}
}

Loading…
Cancel
Save