Browse Source

Merge branch 'working' of https://foundry.openuru.org/gitblit/r/CWE-ou-minkata into working

tickets/31/31/1^2
ZarothYe 4 years ago
parent
commit
d2a9f008c9
  1. 8
      Build/VS2010/Plasma/Apps/plClient/plClient.vcxproj
  2. 6
      Build/VS2010/Plasma/Apps/plPageOptimizer/plPageOptimizer.vcxproj
  3. 19
      Build/VS2010/Plasma/PubUtilLib/plPipeline/plPipeline.vcxproj
  4. 8
      Build/VS2010/Plasma/PubUtilLib/plPipeline/plPipeline.vcxproj.filters
  5. 104
      Sources/Plasma/Apps/plClient/plClient.cpp
  6. 2
      Sources/Plasma/Apps/plClient/plClient.h
  7. 4
      Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp
  8. 2
      Sources/Plasma/FeatureLib/pfConsole/pfConsoleCommands.cpp
  9. 115
      Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp
  10. 4
      Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp
  11. 22
      Sources/Plasma/PubUtilLib/plGImage/hsDXTDirectXCodec.cpp
  12. 50
      Sources/Plasma/PubUtilLib/plGImage/plFont.cpp
  13. 1243
      Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp
  14. 128
      Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h
  15. 73
      Sources/Plasma/PubUtilLib/plPipeline/hsGDDrawDllLoad.cpp
  16. 59
      Sources/Plasma/PubUtilLib/plPipeline/hsGDDrawDllLoad.h
  17. 107
      Sources/Plasma/PubUtilLib/plPipeline/plDXEnumerate.cpp
  18. 104
      Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp
  19. 45
      Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.h

8
Build/VS2010/Plasma/Apps/plClient/plClient.vcxproj

@ -106,7 +106,7 @@
<StringPooling>true</StringPooling>
</ClCompile>
<Link>
<AdditionalDependencies>winhttp.lib;ws2_32.lib;strmiids.lib;vfw32.lib;version.lib;Rpcrt4.lib;d3dx9.lib;dinput8.lib;dxerr.lib;dxguid.lib;dsound.lib;OpenAL32.lib;libeay32.lib;NxCharacter.lib;PhysXLoader.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opus.lib;vpxmdd.lib;libspeex.lib;libjpeg.lib;zlibd.lib;libpngd.lib;NxCooking.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winhttp.lib;ws2_32.lib;strmiids.lib;vfw32.lib;version.lib;Rpcrt4.lib;d3dx9.lib;d3d9.lib;dinput8.lib;dxerr.lib;dxguid.lib;dsound.lib;OpenAL32.lib;libeay32.lib;NxCharacter.lib;PhysXLoader.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opus.lib;vpxmdd.lib;libspeex.lib;libjpeg.lib;zlibd.lib;libpngd.lib;NxCooking.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\..\StaticSDKs\Win32\DX9.0c\Lib\x86;..\..\..\StaticSDKs\Win32\OpenAL 1.1 with EFX SDK\libs\Win32;..\..\..\StaticSDKs\XPlatform\OpenSSL\lib;..\..\..\StaticSDKs\Win32\PhysX\lib\win32;..\..\..\StaticSDKs\XPlatform\opus\win32\VS2010\Win32\Debug;..\..\..\StaticSDKs\XPlatform\speex-1.0.1\win32\libspeex\Debug;..\..\..\StaticSDKs\XPlatform\webm\libvpx_build_win32_vs10\Win32\Debug;..\..\..\StaticSDKs\XPlatform\oggvorbis\libogg\win32\VS2010\Win32\Debug;..\..\..\StaticSDKs\XPlatform\oggvorbis\libvorbis\win32\VS2010\Win32\Debug;..\..\..\StaticSDKs\XPlatform\speex\win32\libspeex\Debug;..\..\..\StaticSDKs\XPlatform\expat\StaticLibs\Win32;..\..\..\StaticSDKs\XPlatform\jpeg;..\..\..\StaticSDKs\XPlatform\zlib\lib;..\..\..\StaticSDKs\XPlatform\png\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@ -162,7 +162,7 @@
<StringPooling>true</StringPooling>
</ClCompile>
<Link>
<AdditionalDependencies>winhttp.lib;ws2_32.lib;strmiids.lib;vfw32.lib;version.lib;Rpcrt4.lib;d3dx9.lib;dinput8.lib;dxerr.lib;dxguid.lib;dsound.lib;OpenAL32.lib;libeay32.lib;NxCharacter.lib;PhysXLoader.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opus.lib;vpxmdd.lib;libspeex.lib;libjpeg.lib;zlibd.lib;libpngd.lib;NxCooking.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winhttp.lib;ws2_32.lib;strmiids.lib;vfw32.lib;version.lib;Rpcrt4.lib;d3dx9.lib;d3d9.lib;dinput8.lib;dxerr.lib;dxguid.lib;dsound.lib;OpenAL32.lib;libeay32.lib;NxCharacter.lib;PhysXLoader.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opus.lib;vpxmdd.lib;libspeex.lib;libjpeg.lib;zlibd.lib;libpngd.lib;NxCooking.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\..\StaticSDKs\XPlatform\speex-1.0.1\win32\libspeex\Debug;..\..\..\StaticSDKs\Win32\DX9.0c\Lib\x86;..\..\..\StaticSDKs\Win32\OpenAL 1.1 with EFX SDK\libs\Win32;..\..\..\StaticSDKs\XPlatform\OpenSSL\lib;..\..\..\StaticSDKs\Win32\PhysX\lib\win32;..\..\..\StaticSDKs\XPlatform\opus\win32\VS2010\Win32\Debug;..\..\..\StaticSDKs\XPlatform\webm\libvpx_build_win32_vs10\Win32\Debug;..\..\..\StaticSDKs\XPlatform\oggvorbis\libogg\win32\VS2010\Win32\Debug;..\..\..\StaticSDKs\XPlatform\oggvorbis\libvorbis\win32\VS2010\Win32\Debug;..\..\..\StaticSDKs\XPlatform\speex\win32\libspeex\Debug;..\..\..\StaticSDKs\XPlatform\expat\StaticLibs\Win32;..\..\..\StaticSDKs\XPlatform\jpeg;..\..\..\StaticSDKs\XPlatform\zlib\lib;..\..\..\StaticSDKs\XPlatform\png\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@ -222,7 +222,7 @@
<BufferSecurityCheck>true</BufferSecurityCheck>
</ClCompile>
<Link>
<AdditionalDependencies>winhttp.lib;ws2_32.lib;strmiids.lib;vfw32.lib;version.lib;Rpcrt4.lib;d3dx9.lib;dinput8.lib;dxerr.lib;dxguid.lib;dsound.lib;OpenAL32.lib;libeay32.lib;NxCharacter.lib;PhysXLoader.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opus.lib;vpxmd.lib;libspeex.lib;libjpeg.lib;zlib.lib;libpng.lib;NxCooking.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winhttp.lib;ws2_32.lib;strmiids.lib;vfw32.lib;version.lib;Rpcrt4.lib;d3dx9.lib;d3d9.lib;dinput8.lib;dxerr.lib;dxguid.lib;dsound.lib;OpenAL32.lib;libeay32.lib;NxCharacter.lib;PhysXLoader.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opus.lib;vpxmd.lib;libspeex.lib;libjpeg.lib;zlib.lib;libpng.lib;NxCooking.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\..\StaticSDKs\Win32\DX9.0c\Lib\x86;..\..\..\StaticSDKs\Win32\OpenAL 1.1 with EFX SDK\libs\Win32;..\..\..\StaticSDKs\XPlatform\OpenSSL\lib;..\..\..\StaticSDKs\Win32\PhysX\lib\win32;..\..\..\StaticSDKs\XPlatform\opus\win32\VS2010\Win32\Release;..\..\..\StaticSDKs\XPlatform\webm\libvpx_build_win32_vs10\Win32\Release;..\..\..\StaticSDKs\XPlatform\oggvorbis\libogg\win32\VS2010\Win32\Release;..\..\..\StaticSDKs\XPlatform\oggvorbis\libvorbis\win32\VS2010\Win32\Release;..\..\..\StaticSDKs\XPlatform\speex\win32\libspeex\Release;..\..\..\StaticSDKs\XPlatform\expat\StaticLibs\Win32;..\..\..\StaticSDKs\XPlatform\jpeg;..\..\..\StaticSDKs\XPlatform\zlib\lib;..\..\..\StaticSDKs\XPlatform\png\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
@ -283,7 +283,7 @@
<BufferSecurityCheck>true</BufferSecurityCheck>
</ClCompile>
<Link>
<AdditionalDependencies>winhttp.lib;ws2_32.lib;strmiids.lib;vfw32.lib;version.lib;Rpcrt4.lib;d3dx9.lib;dinput8.lib;dxerr.lib;dxguid.lib;dsound.lib;OpenAL32.lib;libeay32.lib;NxCharacter.lib;PhysXLoader.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opus.lib;vpxmd.lib;libspeex.lib;libjpeg.lib;zlib.lib;libpng.lib;NxCooking.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>winhttp.lib;ws2_32.lib;strmiids.lib;vfw32.lib;version.lib;Rpcrt4.lib;d3dx9.lib;d3d9.lib;dinput8.lib;dxerr.lib;dxguid.lib;dsound.lib;OpenAL32.lib;libeay32.lib;NxCharacter.lib;PhysXLoader.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;opus.lib;vpxmd.lib;libspeex.lib;libjpeg.lib;zlib.lib;libpng.lib;NxCooking.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<SuppressStartupBanner>true</SuppressStartupBanner>
<AdditionalLibraryDirectories>..\..\..\StaticSDKs\Win32\DX9.0c\Lib\x86;..\..\..\StaticSDKs\Win32\OpenAL 1.1 with EFX SDK\libs\Win32;..\..\..\StaticSDKs\XPlatform\OpenSSL\lib;..\..\..\StaticSDKs\Win32\PhysX\lib\win32;..\..\..\StaticSDKs\XPlatform\speex\win32\libspeex\Release;..\..\..\StaticSDKs\XPlatform\opus\win32\VS2010\Win32\Release;..\..\..\StaticSDKs\XPlatform\webm\libvpx_build_win32_vs10\Win32\Release;..\..\..\StaticSDKs\XPlatform\oggvorbis\libogg\win32\VS2010\Win32\Release;..\..\..\StaticSDKs\XPlatform\oggvorbis\libvorbis\win32\VS2010\Win32\Release;..\..\..\StaticSDKs\XPlatform\expat\StaticLibs\Win32;..\..\..\StaticSDKs\XPlatform\jpeg;..\..\..\StaticSDKs\XPlatform\zlib\lib;..\..\..\StaticSDKs\XPlatform\png\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>

6
Build/VS2010/Plasma/Apps/plPageOptimizer/plPageOptimizer.vcxproj

@ -61,7 +61,7 @@
<StringPooling>true</StringPooling>
</ClCompile>
<Link>
<AdditionalDependencies>CoreLib.lib;CoreLibExe.lib;pfAnimation.lib;pfAudio.lib;pfCamera.lib;pfCharacter.lib;pfConditional.lib;pfGameGUIMgr.lib;pfGameMgr.lib;pfGameScoreMgr.lib;pfJournalBook.lib;pfLocalizationMgr.lib;pfMessage.lib;pfPython.lib;pfSurface.lib;pnAddrInfo.lib;pnAsyncCore.lib;pnAsyncCoreExe.lib;pnDispatch.lib;pnFactory.lib;pnGameMgr.lib;pnIni.lib;pnIniExe.lib;pnInputCore.lib;pnKeyedObject.lib;pnMessage.lib;pnModifier.lib;pnNetBase.lib;pnNetCli.lib;pnNetCommon.lib;pnNetProtocol.lib;pnNucleusInc.lib;pnProduct.lib;pnSceneObject.lib;pnTimer.lib;pnUtils.lib;pnUtilsExe.lib;plAgeDescription.lib;plAgeLoader.lib;plAudible.lib;plAudio.lib;plAudioCore.lib;plAvatar.lib;plClientResMgr.lib;plCompression.lib;plContainer.lib;plDrawable.lib;plEncryption.lib;plFile.lib;plGImage.lib;plGLight.lib;plInputCore.lib;plInterp.lib;plIntersect.lib;plJPEG.lib;plMath.lib;plMessage.lib;plModifier.lib;plNetClient.lib;plNetClientComm.lib;plNetClientRecorder.lib;plNetCommon.lib;plNetGameLib.lib;plNetMessage.lib;plNetTransport.lib;plParticleSystem.lib;plPhysical.lib;plPhysX.lib;plPipeline.lib;plProgressMgr.lib;plResMgr.lib;plScene.lib;plSDL.lib;plStatusLog.lib;plSurface.lib;plTransform.lib;plUnifiedTime.lib;plUUID.lib;plVault.lib;winhttp.lib;ws2_32.lib;strmiids.lib;vfw32.lib;Rpcrt4.lib;pythoncore_static.lib;d3dx9.lib;dinput8.lib;dxerr.lib;dxguid.lib;dsound.lib;OpenAL32.lib;libeay32.lib;NxCharacter.lib;PhysXLoader.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;libspeex.lib;libjpeg.lib;libpngd.lib;zlibd.lib;NxCooking.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>CoreLib.lib;CoreLibExe.lib;pfAnimation.lib;pfAudio.lib;pfCamera.lib;pfCharacter.lib;pfConditional.lib;pfGameGUIMgr.lib;pfGameMgr.lib;pfGameScoreMgr.lib;pfJournalBook.lib;pfLocalizationMgr.lib;pfMessage.lib;pfPython.lib;pfSurface.lib;pnAddrInfo.lib;pnAsyncCore.lib;pnAsyncCoreExe.lib;pnDispatch.lib;pnFactory.lib;pnGameMgr.lib;pnIni.lib;pnIniExe.lib;pnInputCore.lib;pnKeyedObject.lib;pnMessage.lib;pnModifier.lib;pnNetBase.lib;pnNetCli.lib;pnNetCommon.lib;pnNetProtocol.lib;pnNucleusInc.lib;pnProduct.lib;pnSceneObject.lib;pnTimer.lib;pnUtils.lib;pnUtilsExe.lib;plAgeDescription.lib;plAgeLoader.lib;plAudible.lib;plAudio.lib;plAudioCore.lib;plAvatar.lib;plClientResMgr.lib;plCompression.lib;plContainer.lib;plDrawable.lib;plEncryption.lib;plFile.lib;plGImage.lib;plGLight.lib;plInputCore.lib;plInterp.lib;plIntersect.lib;plJPEG.lib;plMath.lib;plMessage.lib;plModifier.lib;plNetClient.lib;plNetClientComm.lib;plNetClientRecorder.lib;plNetCommon.lib;plNetGameLib.lib;plNetMessage.lib;plNetTransport.lib;plParticleSystem.lib;plPhysical.lib;plPhysX.lib;plPipeline.lib;plProgressMgr.lib;plResMgr.lib;plScene.lib;plSDL.lib;plStatusLog.lib;plSurface.lib;plTransform.lib;plUnifiedTime.lib;plUUID.lib;plVault.lib;winhttp.lib;ws2_32.lib;strmiids.lib;vfw32.lib;Rpcrt4.lib;pythoncore_static.lib;d3dx9.lib;d3d9.lib;dinput8.lib;dxerr.lib;dxguid.lib;dsound.lib;OpenAL32.lib;libeay32.lib;NxCharacter.lib;PhysXLoader.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;libspeex.lib;libjpeg.lib;libpngd.lib;zlibd.lib;NxCooking.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\CoreLib\Debug;..\..\CoreLibExe\Debug;..\..\FeatureLib\pfAnimation\Debug;..\..\FeatureLib\pfAudio\Debug;..\..\FeatureLib\pfCamera\Debug;..\..\FeatureLib\pfCharacter\Debug;..\..\FeatureLib\pfConditional\Debug;..\..\FeatureLib\pfGameGUIMgr\Debug;..\..\FeatureLib\pfGameMgr\Debug;..\..\FeatureLib\pfGameScoreMgr\Debug;..\..\FeatureLib\pfJournalBook\Debug;..\..\FeatureLib\pfLocalizationMgr\Debug;..\..\FeatureLib\pfMessage\Debug;..\..\FeatureLib\pfPython\Debug;..\..\FeatureLib\pfSurface\Debug;..\..\NucleusLib\pnAddrInfo\Debug;..\..\NucleusLib\pnAsyncCore\Debug;..\..\NucleusLib\pnAsyncCoreExe\Debug;..\..\NucleusLib\pnDispatch\Debug;..\..\NucleusLib\pnFactory\Debug;..\..\NucleusLib\pnGameMgr\Debug;..\..\NucleusLib\pnIni\Debug;..\..\NucleusLib\pnIniExe\Debug;..\..\NucleusLib\pnInputCore\Debug;..\..\NucleusLib\pnKeyedObject\Debug;..\..\NucleusLib\pnMessage\Debug;..\..\NucleusLib\pnModifier\Debug;..\..\NucleusLib\pnNetBase\Debug;..\..\NucleusLib\pnNetCli\Debug;..\..\NucleusLib\pnNetCommon\Debug;..\..\NucleusLib\pnNetProtocol\Debug;..\..\NucleusLib\pnNucleusInc\Debug;..\..\NucleusLib\pnProduct\Debug;..\..\NucleusLib\pnSceneObject\Debug;..\..\NucleusLib\pnTimer\Debug;..\..\NucleusLib\pnUtils\Debug;..\..\NucleusLib\pnUtilsExe\Debug;..\..\PubUtilLib\plAgeDescription\Debug;..\..\PubUtilLib\plAgeLoader\Debug;..\..\PubUtilLib\plAudible\Debug;..\..\PubUtilLib\plAudio\Debug;..\..\PubUtilLib\plAudioCore\Debug;..\..\PubUtilLib\plAvatar\Debug;..\..\PubUtilLib\plClientResMgr\Debug;..\..\PubUtilLib\plCompression\Debug;..\..\PubUtilLib\plContainer\Debug;..\..\PubUtilLib\plDrawable\Debug;..\..\PubUtilLib\plEncryption\Debug;..\..\PubUtilLib\plFile\Debug;..\..\PubUtilLib\plGImage\Debug;..\..\PubUtilLib\plGLight\Debug;..\..\PubUtilLib\plInputCore\Debug;..\..\PubUtilLib\plInterp\Debug;..\..\PubUtilLib\plIntersect\Debug;..\..\PubUtilLib\plJPEG\Debug;..\..\PubUtilLib\plMath\Debug;..\..\PubUtilLib\plMessage\Debug;..\..\PubUtilLib\plModifier\Debug;..\..\PubUtilLib\plNetClient\Debug;..\..\PubUtilLib\plNetClientComm\Debug;..\..\PubUtilLib\plNetClientRecorder\Debug;..\..\PubUtilLib\plNetCommon\Debug;..\..\PubUtilLib\plNetGameLib\Debug;..\..\PubUtilLib\plNetMessage\Debug;..\..\PubUtilLib\plNetTransport\Debug;..\..\PubUtilLib\plParticleSystem\Debug;..\..\PubUtilLib\plPhysical\Debug;..\..\PubUtilLib\plPhysX\Debug;..\..\PubUtilLib\plPipeline\Debug;..\..\PubUtilLib\plProgressMgr\Debug;..\..\PubUtilLib\plResMgr\Debug;..\..\PubUtilLib\plScene\Debug;..\..\PubUtilLib\plSDL\Debug;..\..\PubUtilLib\plStatusLog\Debug;..\..\PubUtilLib\plSurface\Debug;..\..\PubUtilLib\plTransform\Debug;..\..\PubUtilLib\plUnifiedTime\Debug;..\..\PubUtilLib\plUUID\Debug;..\..\PubUtilLib\plVault\Debug;..\..\..\SDKs\XPlatform\Cypython-2.3.3\PCbuild\Debug;..\..\..\StaticSDKs\Win32\DX9.0c\Lib\x86;..\..\..\StaticSDKs\Win32\OpenAL 1.1 with EFX SDK\libs\Win32;..\..\..\StaticSDKs\XPlatform\OpenSSL\lib;..\..\..\StaticSDKs\Win32\PhysX\lib\win32;..\..\..\StaticSDKs\XPlatform\oggvorbis\libogg\win32\VS2010\Win32\Debug;..\..\..\StaticSDKs\XPlatform\oggvorbis\libvorbis\win32\VS2010\Win32\Debug;..\..\..\StaticSDKs\XPlatform\speex\win32\libspeex\Debug;..\..\..\StaticSDKs\XPlatform\expat\StaticLibs\Win32;..\..\..\StaticSDKs\XPlatform\jpeg;..\..\..\StaticSDKs\XPlatform\png\lib;..\..\..\StaticSDKs\XPlatform\zlib\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libc.lib;libcd.lib;libci.lib;libcid.lib;libcmt.lib;libcmtd.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@ -95,7 +95,7 @@
<IntrinsicFunctions>true</IntrinsicFunctions>
</ClCompile>
<Link>
<AdditionalDependencies>CoreLib.lib;CoreLibExe.lib;pfAnimation.lib;pfAudio.lib;pfCamera.lib;pfCharacter.lib;pfConditional.lib;pfGameGUIMgr.lib;pfGameMgr.lib;pfGameScoreMgr.lib;pfJournalBook.lib;pfLocalizationMgr.lib;pfMessage.lib;pfPython.lib;pfSurface.lib;pnAddrInfo.lib;pnAsyncCore.lib;pnAsyncCoreExe.lib;pnDispatch.lib;pnFactory.lib;pnGameMgr.lib;pnIni.lib;pnIniExe.lib;pnInputCore.lib;pnKeyedObject.lib;pnMessage.lib;pnModifier.lib;pnNetBase.lib;pnNetCli.lib;pnNetCommon.lib;pnNetProtocol.lib;pnNucleusInc.lib;pnProduct.lib;pnSceneObject.lib;pnTimer.lib;pnUtils.lib;pnUtilsExe.lib;plAgeDescription.lib;plAgeLoader.lib;plAudible.lib;plAudio.lib;plAudioCore.lib;plAvatar.lib;plClientResMgr.lib;plCompression.lib;plContainer.lib;plDrawable.lib;plEncryption.lib;plFile.lib;plGImage.lib;plGLight.lib;plInputCore.lib;plInterp.lib;plIntersect.lib;plJPEG.lib;plMath.lib;plMessage.lib;plModifier.lib;plNetClient.lib;plNetClientComm.lib;plNetClientRecorder.lib;plNetCommon.lib;plNetGameLib.lib;plNetMessage.lib;plNetTransport.lib;plParticleSystem.lib;plPhysical.lib;plPhysX.lib;plPipeline.lib;plProgressMgr.lib;plResMgr.lib;plScene.lib;plSDL.lib;plStatusLog.lib;plSurface.lib;plTransform.lib;plUnifiedTime.lib;plUUID.lib;plVault.lib;winhttp.lib;ws2_32.lib;strmiids.lib;vfw32.lib;Rpcrt4.lib;pythoncore_static.lib;d3dx9.lib;dinput8.lib;dxerr.lib;dxguid.lib;dsound.lib;OpenAL32.lib;libeay32.lib;NxCharacter.lib;PhysXLoader.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;libspeex.lib;libjpeg.lib;libpng.lib;zlib.lib;NxCooking.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalDependencies>CoreLib.lib;CoreLibExe.lib;pfAnimation.lib;pfAudio.lib;pfCamera.lib;pfCharacter.lib;pfConditional.lib;pfGameGUIMgr.lib;pfGameMgr.lib;pfGameScoreMgr.lib;pfJournalBook.lib;pfLocalizationMgr.lib;pfMessage.lib;pfPython.lib;pfSurface.lib;pnAddrInfo.lib;pnAsyncCore.lib;pnAsyncCoreExe.lib;pnDispatch.lib;pnFactory.lib;pnGameMgr.lib;pnIni.lib;pnIniExe.lib;pnInputCore.lib;pnKeyedObject.lib;pnMessage.lib;pnModifier.lib;pnNetBase.lib;pnNetCli.lib;pnNetCommon.lib;pnNetProtocol.lib;pnNucleusInc.lib;pnProduct.lib;pnSceneObject.lib;pnTimer.lib;pnUtils.lib;pnUtilsExe.lib;plAgeDescription.lib;plAgeLoader.lib;plAudible.lib;plAudio.lib;plAudioCore.lib;plAvatar.lib;plClientResMgr.lib;plCompression.lib;plContainer.lib;plDrawable.lib;plEncryption.lib;plFile.lib;plGImage.lib;plGLight.lib;plInputCore.lib;plInterp.lib;plIntersect.lib;plJPEG.lib;plMath.lib;plMessage.lib;plModifier.lib;plNetClient.lib;plNetClientComm.lib;plNetClientRecorder.lib;plNetCommon.lib;plNetGameLib.lib;plNetMessage.lib;plNetTransport.lib;plParticleSystem.lib;plPhysical.lib;plPhysX.lib;plPipeline.lib;plProgressMgr.lib;plResMgr.lib;plScene.lib;plSDL.lib;plStatusLog.lib;plSurface.lib;plTransform.lib;plUnifiedTime.lib;plUUID.lib;plVault.lib;winhttp.lib;ws2_32.lib;strmiids.lib;vfw32.lib;Rpcrt4.lib;pythoncore_static.lib;d3dx9.lib;d3d9.lib;dinput8.lib;dxerr.lib;dxguid.lib;dsound.lib;OpenAL32.lib;libeay32.lib;NxCharacter.lib;PhysXLoader.lib;libogg_static.lib;libvorbis_static.lib;libvorbisfile_static.lib;libspeex.lib;libjpeg.lib;libpng.lib;zlib.lib;NxCooking.lib;%(AdditionalDependencies)</AdditionalDependencies>
<OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
<AdditionalLibraryDirectories>..\..\CoreLib\Release;..\..\CoreLibExe\Release;..\..\FeatureLib\pfAnimation\Release;..\..\FeatureLib\pfAudio\Release;..\..\FeatureLib\pfCamera\Release;..\..\FeatureLib\pfCharacter\Release;..\..\FeatureLib\pfConditional\Release;..\..\FeatureLib\pfGameGUIMgr\Release;..\..\FeatureLib\pfGameMgr\Release;..\..\FeatureLib\pfGameScoreMgr\Release;..\..\FeatureLib\pfJournalBook\Release;..\..\FeatureLib\pfLocalizationMgr\Release;..\..\FeatureLib\pfMessage\Release;..\..\FeatureLib\pfPython\Release;..\..\FeatureLib\pfSurface\Release;..\..\NucleusLib\pnAddrInfo\Release;..\..\NucleusLib\pnAsyncCore\Release;..\..\NucleusLib\pnAsyncCoreExe\Release;..\..\NucleusLib\pnDispatch\Release;..\..\NucleusLib\pnFactory\Release;..\..\NucleusLib\pnGameMgr\Release;..\..\NucleusLib\pnIni\Release;..\..\NucleusLib\pnIniExe\Release;..\..\NucleusLib\pnInputCore\Release;..\..\NucleusLib\pnKeyedObject\Release;..\..\NucleusLib\pnMessage\Release;..\..\NucleusLib\pnModifier\Release;..\..\NucleusLib\pnNetBase\Release;..\..\NucleusLib\pnNetCli\Release;..\..\NucleusLib\pnNetCommon\Release;..\..\NucleusLib\pnNetProtocol\Release;..\..\NucleusLib\pnNucleusInc\Release;..\..\NucleusLib\pnProduct\Release;..\..\NucleusLib\pnSceneObject\Release;..\..\NucleusLib\pnTimer\Release;..\..\NucleusLib\pnUtils\Release;..\..\NucleusLib\pnUtilsExe\Release;..\..\PubUtilLib\plAgeDescription\Release;..\..\PubUtilLib\plAgeLoader\Release;..\..\PubUtilLib\plAudible\Release;..\..\PubUtilLib\plAudio\Release;..\..\PubUtilLib\plAudioCore\Release;..\..\PubUtilLib\plAvatar\Release;..\..\PubUtilLib\plClientResMgr\Release;..\..\PubUtilLib\plCompression\Release;..\..\PubUtilLib\plContainer\Release;..\..\PubUtilLib\plDrawable\Release;..\..\PubUtilLib\plEncryption\Release;..\..\PubUtilLib\plFile\Release;..\..\PubUtilLib\plGImage\Release;..\..\PubUtilLib\plGLight\Release;..\..\PubUtilLib\plInputCore\Release;..\..\PubUtilLib\plInterp\Release;..\..\PubUtilLib\plIntersect\Release;..\..\PubUtilLib\plJPEG\Release;..\..\PubUtilLib\plMath\Release;..\..\PubUtilLib\plMessage\Release;..\..\PubUtilLib\plModifier\Release;..\..\PubUtilLib\plNetClient\Release;..\..\PubUtilLib\plNetClientComm\Release;..\..\PubUtilLib\plNetClientRecorder\Release;..\..\PubUtilLib\plNetCommon\Release;..\..\PubUtilLib\plNetGameLib\Release;..\..\PubUtilLib\plNetMessage\Release;..\..\PubUtilLib\plNetTransport\Release;..\..\PubUtilLib\plParticleSystem\Release;..\..\PubUtilLib\plPhysical\Release;..\..\PubUtilLib\plPhysX\Release;..\..\PubUtilLib\plPipeline\Release;..\..\PubUtilLib\plProgressMgr\Release;..\..\PubUtilLib\plResMgr\Release;..\..\PubUtilLib\plScene\Release;..\..\PubUtilLib\plSDL\Release;..\..\PubUtilLib\plStatusLog\Release;..\..\PubUtilLib\plSurface\Release;..\..\PubUtilLib\plTransform\Release;..\..\PubUtilLib\plUnifiedTime\Release;..\..\PubUtilLib\plUUID\Release;..\..\PubUtilLib\plVault\Release;..\..\..\SDKs\XPlatform\Cypython-2.3.3\PCbuild\Release;..\..\..\StaticSDKs\Win32\DX9.0c\Lib\x86;..\..\..\StaticSDKs\Win32\OpenAL 1.1 with EFX SDK\libs\Win32;..\..\..\StaticSDKs\XPlatform\OpenSSL\lib;..\..\..\StaticSDKs\Win32\PhysX\lib\win32;..\..\..\StaticSDKs\XPlatform\oggvorbis\libogg\win32\VS2010\Win32\Release;..\..\..\StaticSDKs\XPlatform\oggvorbis\libvorbis\win32\VS2010\Win32\Release;..\..\..\StaticSDKs\XPlatform\speex\win32\libspeex\Release;..\..\..\StaticSDKs\XPlatform\expat\StaticLibs\Win32;..\..\..\StaticSDKs\XPlatform\jpeg;..\..\..\StaticSDKs\XPlatform\png\lib;..\..\..\StaticSDKs\XPlatform\zlib\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<IgnoreSpecificDefaultLibraries>libc.lib;libci.lib;libcmt.lib;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@ -129,4 +129,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

19
Build/VS2010/Plasma/PubUtilLib/plPipeline/plPipeline.vcxproj

@ -229,22 +229,6 @@
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release_Internal|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\hsGDDrawDllLoad.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug_Internal|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug_Internal|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug_Internal|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug_Internal|Win32'">EnableFastChecks</BasicRuntimeChecks>
<BasicRuntimeChecks Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">EnableFastChecks</BasicRuntimeChecks>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release_Internal|Win32'">MaxSpeed</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">MaxSpeed</Optimization>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release_Internal|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release_Internal|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
</ClCompile>
<ClCompile Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\plCaptureRender.cpp">
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug_Internal|Win32'">Disabled</Optimization>
<Optimization Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">Disabled</Optimization>
@ -542,7 +526,6 @@
<ClInclude Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\hsFogControl.h" />
<ClInclude Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\hsG3DDeviceSelector.h" />
<ClInclude Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\hsGColorizer.h" />
<ClInclude Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\hsGDDrawDllLoad.h" />
<ClInclude Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\hsWinRef.h" />
<ClInclude Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\plBinkPlayer.h" />
<ClInclude Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\plCaptureRender.h" />
@ -584,4 +567,4 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
</Project>
</Project>

8
Build/VS2010/Plasma/PubUtilLib/plPipeline/plPipeline.vcxproj.filters

@ -20,9 +20,6 @@
<ClCompile Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\hsGColorizer.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\hsGDDrawDllLoad.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\plCaptureRender.cpp">
<Filter>Source Files</Filter>
</ClCompile>
@ -100,9 +97,6 @@
<ClInclude Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\hsGColorizer.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\hsGDDrawDllLoad.h">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\..\Sources\Plasma\PubUtilLib\plPipeline\hsWinRef.h">
<Filter>Header Files</Filter>
</ClInclude>
@ -215,4 +209,4 @@
<Filter>DeviceRefs</Filter>
</ClInclude>
</ItemGroup>
</Project>
</Project>

104
Sources/Plasma/Apps/plClient/plClient.cpp

@ -2129,78 +2129,6 @@ void plClient::IAddRenderRequest(plRenderRequest* req)
}
}
hsG3DDeviceModeRecord plClient::ILoadDevMode(const char* devModeFile)
{
hsStatusMessage("Load DevMode client\n");
HWND hWnd = fWindowHndl;
hsUNIXStream stream;
hsBool gottaCreate = false;
// If DevModeFind is specified, use the old method
// if ((GetGameFlags() & kDevModeFind))
// FindAndSaveDevMode(hWnd, devModeFile);
// Otherwise, use the new method
hsG3DDeviceModeRecord dmr;
if (stream.Open(devModeFile, "rb"))
{
/// It's there, but is the device record valid?
hsG3DDeviceRecord selRec;
hsG3DDeviceMode selMode;
selRec.Read(&stream);
if( selRec.IsInvalid() )
{
hsStatusMessage( "WARNING: Old DeviceRecord found on file. Setting defaults..." );
gottaCreate = true;
}
else
{
/// Read the rest in
selMode.Read(&stream);
UInt16 performance = stream.ReadSwap16();
if( performance < 25 )
plBitmap::SetGlobalLevelChopCount( 2 );
else if( performance < 75 )
plBitmap::SetGlobalLevelChopCount( 1 );
else
plBitmap::SetGlobalLevelChopCount( 0 );
}
stream.Close();
dmr = hsG3DDeviceModeRecord(selRec, selMode);
}
else
gottaCreate = true;
if( gottaCreate )
{
hsG3DDeviceSelector devSel;
devSel.Enumerate(hWnd);
devSel.RemoveUnusableDevModes(true);
if (!devSel.GetDefault(&dmr))
{
//hsAssert(0, "plGame::LoadDevMode - No acceptable hardware found");
hsMessageBox("No suitable rendering devices found.","realMYST",hsMessageBoxNormal);
return dmr;
}
if (stream.Open(devModeFile, "wb"))
{
dmr.GetDevice()->Write(&stream);
dmr.GetMode()->Write(&stream);
stream.WriteSwap16((UInt16)(0*100));
stream.Close();
}
}
return dmr;
}
void plClient::ResetDisplayDevice(int Width, int Height, int ColorDepth, hsBool Windowed, int NumAASamples, int MaxAnisotropicSamples, hsBool VSync)
{
if(!fPipeline) return;
@ -2296,9 +2224,6 @@ void plClient::IDetectAudioVideoSettings()
hsBool pixelshaders = rec->GetCap(hsG3DDeviceSelector::kCapsPixelShader);
int psMajor = 0, psMinor = 0;
rec->GetPixelShaderVersion(psMajor, psMinor);
hsBool refDevice = false;
if(rec->GetG3DHALorHEL() == hsG3DDeviceSelector::kHHD3DRefDev)
refDevice = true;
plPipeline::fDefaultPipeParams.ColorDepth = hsG3DDeviceSelector::kDefaultDepth;
#if defined(HS_DEBUGGING) || defined(DEBUG)
@ -2325,17 +2250,10 @@ void plClient::IDetectAudioVideoSettings()
plPipeline::fDefaultPipeParams.Shadows = 1;
// enable planar reflections if pixelshaders are available
if(pixelshaders && !refDevice)
{
plPipeline::fDefaultPipeParams.PlanarReflections = 1;
}
else
{
plPipeline::fDefaultPipeParams.PlanarReflections = 0;
}
// enable 2x antialiasing and anisotropic to 2 samples if pixelshader version is greater that 2.0
if(psMajor >= 2 && !refDevice)
if(psMajor >= 2)
{
plPipeline::fDefaultPipeParams.AntiAliasingAmount = rec->GetMaxAnisotropicSamples() ? 2 : 0;
plPipeline::fDefaultPipeParams.AnisotropicLevel = mode->GetNumFSAATypes() ? 2 : 0;
@ -2346,26 +2264,10 @@ void plClient::IDetectAudioVideoSettings()
plPipeline::fDefaultPipeParams.AnisotropicLevel = 0;
}
if(refDevice)
{
plPipeline::fDefaultPipeParams.TextureQuality = 0;
plPipeline::fDefaultPipeParams.VideoQuality = 0;
}
else
{
plPipeline::fDefaultPipeParams.TextureQuality = psMajor >= 2 ? 2 : 1;
plPipeline::fDefaultPipeParams.VideoQuality = pixelshaders ? 2 : 1;
}
plPipeline::fDefaultPipeParams.TextureQuality = psMajor >= 2 ? 2 : 1;
plPipeline::fDefaultPipeParams.VideoQuality = pixelshaders ? 2 : 1;
plPipeline::fDefaultPipeParams.VSync = false;
// card specific overrides
if(strstr(rec->GetDriverDesc(), "FX 5200"))
{
plPipeline::fDefaultPipeParams.AntiAliasingAmount = 0;
}
int val = 0;
hsStream *stream = nil;
hsUNIXStream s;

2
Sources/Plasma/Apps/plClient/plClient.h

@ -135,8 +135,6 @@ protected:
pfGameGUIMgr *fGameGUIMgr;
virtual hsG3DDeviceModeRecord ILoadDevMode(const char* devModeFile);
hsBool IUpdate();
hsBool IDraw();
hsBool IDrawProgress();

4
Sources/Plasma/Apps/plClientPatcher/UruPlayer.cpp

@ -329,9 +329,9 @@ static void DecompressOgg (ManifestFile *mf) {
}
if (hsCheckBits(flags, plManifestFile::kSndFlagCacheSplit))
plAudioFileReader::CacheFile(path, true, true);
plAudioFileReader::CacheFile(path, true, false);
if (hsCheckBits(flags, plManifestFile::kSndFlagCacheStereo))
plAudioFileReader::CacheFile(path, false, true);
plAudioFileReader::CacheFile(path, false, false);
}
break;
}

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

@ -2603,7 +2603,7 @@ PF_CONSOLE_CMD(App,
#endif // LIMIT_CONSOLE_COMMANDS
#ifdef LIMIT_CONSOLE_COMMANDS // for now, disable languages in external clients
#ifndef LIMIT_CONSOLE_COMMANDS // for now, disable languages in external clients
PF_CONSOLE_CMD(App,
SetLanguage,
"string language",

115
Sources/Plasma/FeatureLib/pfJournalBook/pfJournalBook.cpp

@ -125,7 +125,7 @@ class pfEsHTMLChunk
hsScalar fCurrOpacity; // For SFX images
hsScalar fSFXTime; // For SFX images
hsScalar fMinOpacity, fMaxOpacity;
hsScalar fMinOpacity, fMaxOpacity;
hsColorRGBA fCurrColor;
hsColorRGBA fOffColor, fOnColor;
@ -156,7 +156,7 @@ class pfEsHTMLChunk
kCanLink = 0x00000008,
kFloating = 0x00000010,
kGlowing = 0x00000020,
kActAsCB = 0x00000040, // Cause the image to act in a checkbox-like fashion.
kActAsCB = 0x00000040, // Cause the image to act in a checkbox-like fashion.
// Min opacity turns into "off opacity" and max opacity
// is "on opacity"
kChecked = 0x00000080, // Only for kActAsCB, set if it's currently "checked"
@ -469,7 +469,7 @@ pfBookData::pfBookData(const char *guiName /* = nil */)
fTurnFrontEditCtrl = fTurnBackEditCtrl = nil;
fEditable = false;
fAdjustCursorTo = -1;
if (guiName)
fGUIName = guiName;
else
@ -542,7 +542,7 @@ hsBool pfBookData::MsgReceive(plMessage *pMsg)
else if( fCurrentlyTurning )
{
if( callback->fUser & 0x04 )
IFillUncoveringPage( (hsBool)( callback->fUser & 0x01 ) ? true : false );
IFillUncoveringPage( (hsBool)( callback->fUser & 0x01 ) ? true : false );
else if( callback->fUser & 0x02 )
StartTriggeredFlip( (hsBool)( callback->fUser & 0x01 ) ? true : false );
else
@ -564,7 +564,7 @@ hsBool pfBookData::MsgReceive(plMessage *pMsg)
if( time != nil && fCurrSFXPages != kNoSides && !fCurrentlyTurning && fCurrentlyOpen )
{
IHandleSFX( (hsScalar)time->DSeconds() );
return true;
return true;
}
plTimerCallbackMsg* timerMsg = plTimerCallbackMsg::ConvertNoRef(pMsg);
@ -590,13 +590,13 @@ void pfBookData::IInitTemplate(pfGUIDialogMod *templateDlg)
hsAssert(templateDlg != nil, "Nil template in pfBookData::IInitTemplate()!");
// Init and ref our fDialog pointer
hsgResMgr::ResMgr()->SendRef(templateDlg->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefDialog), plRefFlags::kPassiveRef);
hsgResMgr::ResMgr()->SendRef(templateDlg->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefDialog), plRefFlags::kPassiveRef);
// Hijack the dialog proc with our own
templateDlg->SetHandlerForAll(TRACKED_NEW pfJournalDlgProc(this));
// Find our animation keys
// And other interesting pointers
fCoverButton = pfGUICheckBoxCtrl::ConvertNoRef(templateDlg->GetControlFromTag(pfJournalDlgProc::kTagBookCover));
fTurnPageButton = pfGUICheckBoxCtrl::ConvertNoRef(templateDlg->GetControlFromTag(pfJournalDlgProc::kTagTurnPageCtrl));
@ -621,7 +621,7 @@ void pfBookData::IInitTemplate(pfGUIDialogMod *templateDlg)
// Grab and ref the default cover mipmap
plLayer *lay = plLayer::ConvertNoRef(fCoverLayer);
if((lay != nil)&&(lay->GetTexture() != nil))
hsgResMgr::ResMgr()->AddViaNotify(lay->GetTexture()->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefDefaultCover), plRefFlags::kPassiveRef);
hsgResMgr::ResMgr()->AddViaNotify(lay->GetTexture()->GetKey(), TRACKED_NEW plGenRefMsg(GetKey(), plRefMsg::kOnCreate, -1, kRefDefaultCover), plRefFlags::kPassiveRef);
fLeftPageMap->SetFlag(pfGUIClickMapCtrl::kReportHovering);
fRightPageMap->SetFlag(pfGUIClickMapCtrl::kReportHovering);
@ -663,7 +663,7 @@ void pfBookData::IInitTemplate(pfGUIDialogMod *templateDlg)
}
//// IGetDTMap ///////////////////////////////////////////////////////////////
// Just a quick helper
// Just a quick helper
plDynamicTextMap *pfBookData::GetDTMap(UInt32 which)
{
@ -691,7 +691,7 @@ pfGUIMultiLineEditCtrl *pfBookData::GetEditCtrl(UInt32 which)
}
//// IRegisterForSFX /////////////////////////////////////////////////////////
// Registers (or unregisters) for time messages so we can process special FX
// Registers (or unregisters) for time messages so we can process special FX
// if we need to
void pfBookData::RegisterForSFX(WhichSide whichPages)
@ -705,7 +705,7 @@ void pfBookData::RegisterForSFX(WhichSide whichPages)
}
else
plgDispatch::Dispatch()->UnRegisterForExactType(plTimeMsg::Index(), GetKey());
fCurrSFXPages = whichPages;
}
@ -747,7 +747,7 @@ void pfBookData::IHandleSFX(hsScalar currTime, WhichSide whichSide /*= kNoSides*
for(idx = fCurrBook->fPageStarts[fCurrBook->fCurrentPage + inc]; idx < fCurrBook->fPageStarts[fCurrBook->fCurrentPage + inc + 1]; idx++)
{
pfEsHTMLChunk *chunk = fCurrBook->fHTMLSource[idx];
if(chunk->fFlags & pfEsHTMLChunk::kGlowing)
{
// Glow SFX: animate opacity based on time offset
@ -843,7 +843,7 @@ void pfBookData::IFillUncoveringPage(hsBool rightSide)
// The right edit ctrl doesn't update until the page flip animation is done
id = 98;
}
// create a timer so we can hide the old left or right turn page right before the animation finishes to prevent flicker
plTimerCallbackMsg* pTimerMsg = TRACKED_NEW plTimerCallbackMsg(GetKey(),id);
plgTimerCallbackMgr::NewTimer( .5, pTimerMsg ); // .5 found by trial and error
@ -882,7 +882,7 @@ void pfBookData::ITriggerPageFlip(hsBool flipBackwards, hsBool immediate)
}
msg->SetAnimName(flipBackwards ? "backward" : "forward");
msg->AddReceivers(keys);
// Here's the whole reason why we're not just checking the checkbox: so we can attach a callback
// so we know when the animation completes. Pretty sad, huh? Poor checkbox.
plEventCallbackMsg *eventMsg = TRACKED_NEW plEventCallbackMsg;
@ -920,7 +920,7 @@ void pfBookData::ITriggerPageFlip(hsBool flipBackwards, hsBool immediate)
}
//// StartTriggeredFlip /////////////////////////////////////////////////////
// Finishes the start of the triggered page flip (once we're sure the
// Finishes the start of the triggered page flip (once we're sure the
// animation is at the new frame)
void pfBookData::StartTriggeredFlip(hsBool flipBackwards)
@ -1206,7 +1206,7 @@ void pfJournalBook::UnloadAllGUIs()
// the name of the mipmap to use as the cover of the book. The callback
// key is the keyed object to send event messages to (see <img> tag).
pfJournalBook::pfJournalBook( const char *esHTMLSource, plKey coverImageKey, plKey callbackKey /*= nil*/,
pfJournalBook::pfJournalBook( const char *esHTMLSource, plKey coverImageKey, plKey callbackKey /*= nil*/,
const plLocation &hintLoc /* = plLocation::kGlobalFixedLoc */, const char *guiName /* = nil */ )
{
if (guiName && (strcmp(guiName,"") != 0))
@ -1219,7 +1219,7 @@ pfJournalBook::pfJournalBook( const char *esHTMLSource, plKey coverImageKey, plK
hsgResMgr::ResMgr()->NewKey(fCurBookGUI.c_str(),fBookGUIs[fCurBookGUI],pfGameGUIMgr::GetInstance()->GetKey()->GetUoid().GetLocation());
fBookGUIs[fCurBookGUI]->LoadGUI();
}
fCurrentPage = 0;
fLastPage = -1;
fCoverMipKey = coverImageKey;
@ -1242,7 +1242,7 @@ pfJournalBook::pfJournalBook( const char *esHTMLSource, plKey coverImageKey, plK
delete [] wESHTMLSource;
}
pfJournalBook::pfJournalBook( const wchar_t *esHTMLSource, plKey coverImageKey, plKey callbackKey /*= nil*/,
pfJournalBook::pfJournalBook( const wchar_t *esHTMLSource, plKey coverImageKey, plKey callbackKey /*= nil*/,
const plLocation &hintLoc /* = plLocation::kGlobalFixedLoc */, const char *guiName /* = nil */ )
{
if (guiName && (strcmp(guiName,"") != 0))
@ -1255,7 +1255,7 @@ pfJournalBook::pfJournalBook( const wchar_t *esHTMLSource, plKey coverImageKey,
hsgResMgr::ResMgr()->NewKey(fCurBookGUI.c_str(),fBookGUIs[fCurBookGUI],pfGameGUIMgr::GetInstance()->GetKey()->GetUoid().GetLocation());
fBookGUIs[fCurBookGUI]->LoadGUI();
}
fCurrentPage = 0;
fLastPage = -1;
fCoverMipKey = coverImageKey;
@ -1498,7 +1498,7 @@ void pfJournalBook::ITriggerCloseWithNotify( hsBool closeNotOpen, hsBool immedia
}
msg->SetAnimName( animName );
msg->AddReceivers( keys );
plEventCallbackMsg *eventMsg = TRACKED_NEW plEventCallbackMsg;
eventMsg->AddReceiver( fBookGUIs[fCurBookGUI]->GetKey() );
eventMsg->fRepeats = 0;
@ -1548,7 +1548,7 @@ void pfJournalBook::NextPage( void )
fVisibleLinks.Reset();
// Swap the right DT map into the turn page front DTMap, then render
// the new current page into turn page back and currPage+1 into
// the new current page into turn page back and currPage+1 into
// the right DTMap
plDynamicTextMap *turnFront = fBookGUIs[fCurBookGUI]->GetDTMap( pfJournalDlgProc::kTagTurnFrontDTMap );
plDynamicTextMap *right = fBookGUIs[fCurBookGUI]->GetDTMap( pfJournalDlgProc::kTagRightDTMap );
@ -1588,7 +1588,7 @@ void pfJournalBook::PreviousPage( void )
{
if (fCurrentPage >= 2) // this variable can get out of whack if we open the book to a page in the middle
fCurrentPage -= 2; // just making sure that this doesn't go below zero (and therefore wrap around)
pfGUIMultiLineEditCtrl *right = fBookGUIs[fCurBookGUI]->GetEditCtrl(pfJournalDlgProc::kTagRightEditCtrl);
pfGUIMultiLineEditCtrl *left = fBookGUIs[fCurBookGUI]->GetEditCtrl(pfJournalDlgProc::kTagLeftEditCtrl);
pfGUIMultiLineEditCtrl *turnFront = fBookGUIs[fCurBookGUI]->GetEditCtrl(pfJournalDlgProc::kTagTurnFrontEditCtrl);
@ -1602,7 +1602,7 @@ void pfJournalBook::PreviousPage( void )
// At this point, only the left and right pages are visible, we don't want to actually update anything until the animation
// starts so that nothing flashes or overdraws.
fBookGUIs[fCurBookGUI]->StartTriggeredFlip( true );
fBookGUIs[fCurBookGUI]->TurnPageButton()->PlaySound( pfGUICheckBoxCtrl::kMouseUp );
ISendNotify(kNotifyPreviousPage);
@ -1618,7 +1618,7 @@ void pfJournalBook::PreviousPage( void )
fVisibleLinks.Reset();
// Swap the left DT map into the turn page back DTMap, then render
// the new current page into the left and currPage+1 into
// the new current page into the left and currPage+1 into
// the turn page front DTMap
plDynamicTextMap *turnBack = fBookGUIs[fCurBookGUI]->GetDTMap( pfJournalDlgProc::kTagTurnBackDTMap );
plDynamicTextMap *left = fBookGUIs[fCurBookGUI]->GetDTMap( pfJournalDlgProc::kTagLeftDTMap );
@ -1844,7 +1844,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &h
UInt8 type = IGetTagType( c );
if( type != pfEsHTMLChunk::kEmpty )
{
// First, end the current paragraph chunk, which is a special case 'cause its
// First, end the current paragraph chunk, which is a special case 'cause its
// text is defined outside the tag
if( start == c )
{
@ -1855,7 +1855,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &h
else if( lastParChunk != nil )
{
UInt32 count = ((UInt32)c - (UInt32)start)/2; // wchar_t is 2 bytes
wchar_t *temp = TRACKED_NEW wchar_t[ count + 1 ];
wcsncpy( temp, start, count );
temp[count] = L'\0';
@ -2010,7 +2010,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &h
break;
case pfEsHTMLChunk::kCover:
// Don't create an actual chunk for this one, just use the "src" and
// Don't create an actual chunk for this one, just use the "src" and
// grab the mipmap key for our cover
c += 6;
while( IGetNextOption( c, name, option ) )
@ -2181,7 +2181,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &h
}
fHeightScale = 1.f - bookHeight;
fWidthScale = 1.f - bookWidth;
// Still gotta create a new par chunk
lastParChunk = TRACKED_NEW pfEsHTMLChunk( nil );
lastParChunk->fFlags = IFindLastAlignment();
@ -2316,7 +2316,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &h
lastParChunk = TRACKED_NEW pfEsHTMLChunk( nil );
lastParChunk->fFlags = IFindLastAlignment();
break;
case pfEsHTMLChunk::kEditable:
c += 9;
SetEditable(true);
@ -2350,12 +2350,12 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &h
else if( lastParChunk != nil )
{
UInt32 count = (UInt32)c - (UInt32)start;
wchar_t *temp = TRACKED_NEW wchar_t[ count + 1 ];
wcsncpy( temp, start, count + 1 );
lastParChunk->fText = temp;
delete [] temp;
// Special case to remove any last trailing carriage return
// if( count > 1 && lastParChunk->fText[ count - 1 ] == '\n' )
// lastParChunk->fText[ count - 1 ] = 0;
@ -2370,7 +2370,7 @@ hsBool pfJournalBook::ICompileSource( const wchar_t *source, const plLocation &h
fLastPage = 0;
else
fLastPage = -1;
return true;
}
@ -2394,7 +2394,7 @@ UInt8 pfJournalBook::IGetTagType( const wchar_t *string )
{ L"movie", pfEsHTMLChunk::kMovie },
{ L"editable", pfEsHTMLChunk::kEditable },
{ nil, pfEsHTMLChunk::kEmpty } };
UInt32 i;
for( i = 0; tags[ i ].fTag != nil; i++ )
@ -2458,7 +2458,7 @@ hsBool pfJournalBook::IGetNextOption( const wchar_t *&string, wchar_t *name, wch
len = ((UInt32)string - (UInt32)c)/2; // divide length by 2 because each character is two bytes
wcsncpy( option, c, len );
option[len] = L'\0';
if( *string == L'\"' )
string++;
@ -2473,14 +2473,14 @@ hsBool pfJournalBook::IGetNextOption( const wchar_t *&string, wchar_t *name, wch
len = ((UInt32)string - (UInt32)c)/2; // divide length by 2 because each character is two bytes
wcsncpy( option, c, len );
option[len] = L'\0';
return true;
}
void pfJournalBook::IFreeSource( void )
{
UInt32 i;
for( i = 0; i < fHTMLSource.GetCount(); i++ )
delete fHTMLSource[ i ];
fHTMLSource.Reset();
@ -2573,7 +2573,7 @@ void pfJournalBook::IRenderPage( UInt32 page, UInt32 whichDTMap, hsBool suppress
{
if (fAreEditing)
return; // we don't render if we are editing the book
// Grab the DTMap via the GUI system
plDynamicTextMap *dtMap = fBookGUIs[fCurBookGUI]->GetDTMap( whichDTMap );
hsAssert( dtMap != nil, "Invalid DT map in IRenderPage()" );
@ -2619,12 +2619,12 @@ void pfJournalBook::IRenderPage( UInt32 page, UInt32 whichDTMap, hsBool suppress
#endif // USE_BINK_SDK
hsAssert(page < fPageStarts.GetCount() || page > fLastPage, "UnInitialized page start!");
if( page <= fLastPage
if( page <= fLastPage
&& page < fPageStarts.GetCount()) // Added this as a crash-prevention bandaid - MT
{
UInt32 idx;
UInt16 width, height, y, x, ascent, lastX, lastY;
UInt8 fontFlags, fontSize;
const wchar_t *fontFace;
hsColorRGBA fontColor;
@ -2647,7 +2647,7 @@ void pfJournalBook::IRenderPage( UInt32 page, UInt32 whichDTMap, hsBool suppress
switch( chunk->fType )
{
case pfEsHTMLChunk::kParagraph:
case pfEsHTMLChunk::kParagraph:
if( ( chunk->fFlags & pfEsHTMLChunk::kAlignMask ) == pfEsHTMLChunk::kLeft )
{
dtMap->SetJustify( plDynamicTextMap::kLeftJustify );
@ -2668,10 +2668,14 @@ void pfJournalBook::IRenderPage( UInt32 page, UInt32 whichDTMap, hsBool suppress
width = (UInt16)(512 - fPageLMargin - fPageRMargin);
height = (UInt16)(512 - fPageBMargin - y);
UInt32 lastChar;
dtMap->CalcWrappedStringSize( chunk->fText.c_str(), &width, &height, &lastChar, &ascent, &lastX, &lastY );
const wchar_t *chunkTextStr; // initialize later to avoid compile errors inside case block
int chunkTextStrLen;
chunkTextStr = chunk->fText.c_str();
chunkTextStrLen = chunk->fText.length();
dtMap->CalcWrappedStringSize( chunkTextStr, &width, &height, &lastChar, &ascent, &lastX, &lastY );
width = (UInt16)(512 - fPageLMargin - fPageRMargin);
if( !suppressRendering )
dtMap->DrawWrappedString( (UInt16)fPageLMargin, y, chunk->fText.c_str(), width, (UInt16)(512 - fPageBMargin - y), &lastX, &lastY );
dtMap->DrawWrappedString( (UInt16)fPageLMargin, y, chunkTextStr, width, (UInt16)(512 - fPageBMargin - y), &lastX, &lastY );
if( lastChar == 0 )
{
@ -2682,17 +2686,16 @@ void pfJournalBook::IRenderPage( UInt32 page, UInt32 whichDTMap, hsBool suppress
idx--;
break;
}
if( chunk->fText[ lastChar ] != 0 )
if( chunkTextStr[ lastChar ] != L'\0' )
{
// Didn't get to render the whole paragraph in this go, so we're going to cheat
// and split the paragraph up into two so that we can handle it properly. Note:
// this changes the chunk array beyond this point, so we need to invalidate the
// cache, but that's ok 'cause if we're doing this, it's probably invalid (or empty)
// anyway
int fTextLen = chunk->fText.length();
wchar_t *s = TRACKED_NEW wchar_t[fTextLen+1];
wcscpy(s,chunk->fText.c_str());
s[fTextLen] = L'\0';
wchar_t *s = TRACKED_NEW wchar_t[chunkTextStrLen+1];
wcscpy(s,chunkTextStr);
s[chunkTextStrLen] = L'\0';
// Note: Makes a copy of the string
pfEsHTMLChunk *c2 = TRACKED_NEW pfEsHTMLChunk( &s[ lastChar ] );
@ -2711,7 +2714,7 @@ void pfJournalBook::IRenderPage( UInt32 page, UInt32 whichDTMap, hsBool suppress
y += 512;
break;
}
x = lastX;
y = (UInt16)(lastY - dtMap->GetCurrFont()->GetAscent()); // Since our text is top-justified
@ -2750,13 +2753,13 @@ void pfJournalBook::IRenderPage( UInt32 page, UInt32 whichDTMap, hsBool suppress
{
// Mipmap overlaps the bottom of this page, so forcibly break so we'll
// end up marking the page break here (note that, unlike paragraphs, we
// can't really break the mipmap into two...well, OK, we could, but it
// can't really break the mipmap into two...well, OK, we could, but it
// wouldn't make much sense :)
y += (UInt16)(mip->GetHeight());
// Wonderful, the break breaks us from the switch(), which means the for()
// loops runs once more and increments idx. So this is to counter that.
// (We better check tho, just to make sure nobody feeds us an extra-large
// (We better check tho, just to make sure nobody feeds us an extra-large
// image and sends us on an infinite loop)
if( idx > fPageStarts[ page ] )
idx--;
@ -2796,7 +2799,7 @@ void pfJournalBook::IRenderPage( UInt32 page, UInt32 whichDTMap, hsBool suppress
x = (UInt16)fPageLMargin;
break;
case pfEsHTMLChunk::kFontChange:
case pfEsHTMLChunk::kFontChange:
IFindFontProps( idx, fontFace, fontSize, fontFlags, fontColor, fontSpacing );
dtMap->SetFont( fontFace, fontSize, fontFlags, false );
dtMap->SetTextColor( fontColor, true );
@ -2824,7 +2827,7 @@ void pfJournalBook::IRenderPage( UInt32 page, UInt32 whichDTMap, hsBool suppress
// Wonderful, the break breaks us from the switch(), which means the for()
// loops runs once more and increments idx. So this is to counter that.
// (We better check tho, just to make sure nobody feeds us an extra-large
// (We better check tho, just to make sure nobody feeds us an extra-large
// image and sends us on an infinite loop)
if( idx > fPageStarts[ page ] )
idx--;
@ -2963,7 +2966,7 @@ void pfJournalBook::IDrawMipmap( pfEsHTMLChunk *chunk, UInt16 x, UInt16 y, plMip
else
x -= xShift;
}
copy->SetCurrLevel(0); // resize the image so it will look unchanged when rendered on the altered book
copy->ResizeNicely((UInt16)width,(UInt16)height,plMipmap::kDefaultFilter);
}
@ -2978,7 +2981,7 @@ void pfJournalBook::IDrawMipmap( pfEsHTMLChunk *chunk, UInt16 x, UInt16 y, plMip
opts.fBlueTint = chunk->fCurrColor.b;
opts.fOpacity = (UInt8)(chunk->fCurrColor.a * 255.f);
}
else
else
{
if( chunk->fFlags & pfEsHTMLChunk::kGlowing )
opts.fFlags = ( chunk->fFlags & pfEsHTMLChunk::kBlendAlpha ) ? 0 : plMipmap::kMaskSrcAlpha;
@ -3174,7 +3177,7 @@ plLayerBink *pfJournalBook::IMakeMovieLayer(pfEsHTMLChunk *chunk, UInt16 x, UInt
else
flipMat = hsMatrix44::IdentityMatrix();
}
hsMatrix44 xfm;
xfm = translateMat * scaleMat * flipMat;
@ -3547,7 +3550,7 @@ void pfJournalBook::ILoadAllImages( hsBool unload )
fBookGUIs[fCurBookGUI]->GetKey()->Release( fHTMLSource[ i ]->fImageKey );
else
{
plGenRefMsg *ref = TRACKED_NEW plGenRefMsg( fBookGUIs[fCurBookGUI]->GetKey(), plRefMsg::kOnCreate, -1, kRefImage );
plGenRefMsg *ref = TRACKED_NEW plGenRefMsg( fBookGUIs[fCurBookGUI]->GetKey(), plRefMsg::kOnCreate, -1, kRefImage );
hsgResMgr::ResMgr()->AddViaNotify( fHTMLSource[ i ]->fImageKey, ref, plRefFlags::kActiveRef );
}
}

4
Sources/Plasma/PubUtilLib/plAgeDescription/plAgeDescription.cpp

@ -316,7 +316,7 @@ plLocation plAgeDescription::CalcPageLocation( const char *page ) const
{
// Combine our sequence # together
Int32 combined;
hsAssert(abs(fSeqPrefix) < 0xFF, "Age sequence prefex is out of range!"); // sequence prefix can NOT be larger or equal to 1-byte max value
hsAssert(abs(fSeqPrefix) < 0x7FFF, "Age sequence prefex is out of range!"); // sequence prefix can NOT be larger or equal to 2-byte max value
UInt32 suffix = ap->GetSeqSuffix();
hsAssert(suffix <= 0xFFFF, "Page sequence number is out of range!"); // page sequence number can NOT be larger then 2-byte max value
if( fSeqPrefix < 0 ) // we are a global age
@ -562,4 +562,4 @@ bool plAgeDescription::FindLocation(const plLocation& loc) const
return true;
}
return false;
}
}

22
Sources/Plasma/PubUtilLib/plGImage/hsDXTDirectXCodec.cpp

@ -54,6 +54,9 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsConfig.h"
#include "hsWindows.h"
#include <functional>
#include <memory>
#include <ddraw.h>
#include <d3d9.h>
@ -61,7 +64,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsDXTDirectXCodec.h"
#include "plMipmap.h"
#include "hsCodecManager.h"
#include "../plPipeline/hsGDDrawDllLoad.h"
namespace {
typedef HRESULT(WINAPI * DIRECTDRAWCREATEEX)( GUID*, VOID**, REFIID, IUnknown* );
@ -138,26 +140,20 @@ hsBool hsDXTDirectXCodec::IInitialize()
{
fFlags |= kInitialized;
// if( hsGDDrawDllLoad::GetDDrawDll() == nil )
// return false;
DIRECTDRAWCREATEEX DirectDrawCreateEx = 0;
DIRECTDRAWCREATEEX DirectDrawCreateEx = nil;
// Initialize DirectDraw
HRESULT hr;
DirectDrawCreateEx = (DIRECTDRAWCREATEEX)GetProcAddress( hsGDDrawDllLoad::GetD3DDll(), "DirectDrawCreateEx" );
if( DirectDrawCreateEx == nil )
std::unique_ptr<HINSTANCE__, std::function<BOOL(HMODULE)>> ddraw(LoadLibraryA("ddraw.dll"), FreeLibrary);
DirectDrawCreateEx = (DIRECTDRAWCREATEEX)GetProcAddress(ddraw.get(), "DirectDrawCreateEx");
if (!DirectDrawCreateEx)
return false;
/// Using EMULATIONONLY here usually fails--using NULL forces the
/// use of the standard display driver, which DOES work.
if (FAILED(hr = DirectDrawCreateEx((GUID FAR *)NULL/*DDCREATE_EMULATIONONLY*/, (VOID**)&fDirectDraw, IID_IDirectDraw7, NULL)))
return false;
if (FAILED(hr = fDirectDraw->SetCooperativeLevel(NULL, DDSCL_NORMAL)))
if (FAILED(DirectDrawCreateEx((GUID FAR *)NULL/*DDCREATE_EMULATIONONLY*/, (VOID**)&fDirectDraw, IID_IDirectDraw7, NULL)))
return false;
return true;
return SUCCEEDED(fDirectDraw->SetCooperativeLevel(NULL, DDSCL_NORMAL));
}
//// CreateCompressedMipmap ///////////////////////////////////////////////////

50
Sources/Plasma/PubUtilLib/plGImage/plFont.cpp

@ -288,7 +288,16 @@ void plFont::IRenderString( plMipmap *mip, UInt16 x, UInt16 y, const wchar_t *st
if( justCalc )
{
plCharacter &ch = fCharacters[ (UInt16)string[ 0 ] - fFirstChar ];
UInt16 ixFC = (UInt16)L' ' - fFirstChar;
if (fCharacters.Count() <= ((UInt16)string[0] - fFirstChar)) {
UInt16 w = wctob((UInt16)string[0]);
if ((w != EOF) && (fCharacters.Count() > (w - fFirstChar)))
ixFC = w - fFirstChar;
} else {
ixFC = (UInt16)string[0] - fFirstChar;
}
plCharacter &ch = fCharacters[ixFC];
fRenderInfo.fX = fRenderInfo.fFarthestX = x - (Int16)ch.fLeftKern;
if( fRenderInfo.fX < 0 )
fRenderInfo.fX = 0;
@ -387,7 +396,16 @@ void plFont::IRenderString( plMipmap *mip, UInt16 x, UInt16 y, const wchar_t *st
// Just calculating, no wrapping, so the max is as far as we can go
// Note: 32767 isn't quite right, since we'll be adding the left kern in before we
// calc the first character, so adjust so we make sure we don't underflow
plCharacter &ch = fCharacters[ (UInt16)(UInt8)string[ 0 ] - fFirstChar ];
UInt16 ixFC = (UInt16)L' ' - fFirstChar;
if (fCharacters.Count() <= ((UInt16)string[0] - fFirstChar)) {
UInt16 w = wctob((UInt16)string[0]);
if ((w != EOF) && (fCharacters.Count() > (w - fFirstChar)))
ixFC = w - fFirstChar;
} else {
ixFC = (UInt16)string[0] - fFirstChar;
}
plCharacter &ch = fCharacters[ixFC];
fRenderInfo.fMaxHeight = (Int16)fMaxCharHeight;
fRenderInfo.fMaxWidth = (Int16)32767 + (Int16)ch.fLeftKern;
@ -451,11 +469,16 @@ void plFont::IRenderString( plMipmap *mip, UInt16 x, UInt16 y, const wchar_t *st
}
// handle invalid chars discretely
plCharacter* charToDraw = NULL;
if (fCharacters.Count() <= ((UInt16)string[i] - fFirstChar))
charToDraw = &(fCharacters[(UInt16)L' ' - fFirstChar]);
else
charToDraw = &(fCharacters[(UInt16)string[i] - fFirstChar]);
UInt16 ixFC = (UInt16)L' ' - fFirstChar;
if (fCharacters.Count() <= ((UInt16)string[i] - fFirstChar)) {
UInt16 w = wctob((UInt16)string[i]);
if ((w != EOF) && (fCharacters.Count() > (w - fFirstChar)))
ixFC = w - fFirstChar;
} else {
ixFC = (UInt16)string[i] - fFirstChar;
}
plCharacter* charToDraw = &(fCharacters[ixFC]);
Int16 leftKern = (Int16)charToDraw->fLeftKern;
if( fRenderInfo.fFlags & kRenderScaleAA )
@ -584,8 +607,17 @@ void plFont::IRenderString( plMipmap *mip, UInt16 x, UInt16 y, const wchar_t *st
else if( ( fRenderInfo.fFlags & kRenderJustXMask ) == kRenderJustXForceLeft )
{
Int16 baseX = fRenderInfo.fX;
plCharacter &ch = fCharacters[ (UInt16)string[ 0 ] - fFirstChar ];
UInt16 ixFC = (UInt16)L' ' - fFirstChar;
if (fCharacters.Count() <= ((UInt16)string[0] - fFirstChar)) {
UInt16 w = wctob((UInt16)string[0]);
if ((w != EOF) && (fCharacters.Count() > (w - fFirstChar)))
ixFC = w - fFirstChar;
} else {
ixFC = (UInt16)string[0] - fFirstChar;
}
plCharacter &ch = fCharacters[ixFC];
fRenderInfo.fX -= (Int16)ch.fLeftKern;
fRenderInfo.fDestPtr -= (Int16)ch.fLeftKern * fRenderInfo.fDestBPP;

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

File diff suppressed because it is too large Load Diff

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

@ -69,9 +69,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#define DYNAHEADER 1
#endif // HS_BUILD_FOR_WIN32
/// #define the following to allow selection of the D3D reference driver
#define HS_ALLOW_D3D_REF_DRIVER 1
class hsStream;
struct D3DEnum_DeviceInfo;
@ -127,9 +124,6 @@ public:
void AddFSAAType( UInt8 type ) { fFSAATypes.Append( type ); }
void SetCanRenderToCubics( hsBool can ) { fCanRenderToCubics = can; }
void Read(hsStream* s);
void Write(hsStream* s) const;
};
class hsG3DDeviceRecord
@ -149,24 +143,6 @@ public:
protected:
UInt32 fRecordVersion; /// Version starts at 2 (see .cpp for explanation)
enum {
kCurrRecordVersion = 0x0b
/// Version history:
/// 1 - Initial version (had no version #)
/// 2 - Added Z and LOD bias
/// 3 - Changed Z and LOD bias to floats, added fog tweaks
/// 4 - Changed values for fog tweaks; force reload through version #
/// 5 - Same as #4, updated fog end bias to be based solely on fog quantization/bit depth
/// 6 - Updated values for the ATI boards, Matrox, and i810
/// 7 - Added fog knee tweaks
/// 8 - Added support for multiple depth/stencil formats per mode
/// 9 - Added multisample types to the mode record
/// A - Added anisotropic sample field
/// B - Added flag for cubic textures support
};
/// Version < 2 Data
UInt32 fFlags;
UInt32 fG3DDeviceType;
@ -184,7 +160,6 @@ protected:
hsTArray<hsG3DDeviceMode> fModes;
/// New to Version 3
float fZBiasRating;
float fLODBiasRating;
float fFogExpApproxStart;
@ -193,14 +168,11 @@ protected:
// (i.e. for Z fog, it's a percentage of 1 to add on,
// for W fog, it's a percentage of the yon)
/// Version 7 - Fog Knee values
float fFogKnees[ kNumFogTypes ];
float fFogKneeVals[ kNumFogTypes ];
/// Version 9 - The actual AA setting we use
UInt8 fAASetting;
/// Version A - the anisotropic level we use
UInt8 fMaxAnisotropicSamples; // 1 to disable, up to max allowed in hardware
int fPixelShaderMajorVer;
int fPixelShaderMinorVer;
@ -275,16 +247,8 @@ public:
void Clear();
void RemoveDiscarded();
// PlaceHolder - Whether a mode can window is restricted by the current setup
// of the PC. E.g. if the user changes from 16 bit to TrueColor, the Modes that
// can window are pretty much flipped. So we'll have to pass in enough info (like
// the hWnd?) to find out what the current setup is to make sure it's compatible.
hsBool ModeCanWindow(void* ctx, hsG3DDeviceMode* mode) { return false; }
void SetPixelShaderVersion(int major, int minor) { fPixelShaderMajorVer = major; fPixelShaderMinorVer = minor; }
void GetPixelShaderVersion(int &major, int &minor) { major = fPixelShaderMajorVer; minor = fPixelShaderMinorVer; }
void Read(hsStream* s);
void Write(hsStream* s) const;
};
class hsG3DDeviceModeRecord
@ -309,47 +273,34 @@ class hsG3DDeviceSelector : public hsRefCnt
public:
enum {
kDevTypeUnknown = 0,
kDevTypeGlide,
kDevTypeDirect3D,
kDevTypeOpenGL,
kDevTypeDirect3DTnL,
kNumDevTypes
};
enum {
kHHTypeUnknown = 0,
kHHD3DNullDev,
kHHD3DRampDev,
kHHD3DRGBDev,
kHHD3DHALDev,
kHHD3DMMXDev,
kHHD3DTnLHalDev,
kHHD3DRefDev,
kHHD3D3dfxDev,
kHHD3D3dfxVoodoo5Dev,
kNumHHTypes
};
enum {
kCapsNone = 0,
kCapsNoWindow,
kCapsMipmap,
kCapsPerspective,
kCapsHardware,
kCapsWBuffer,
kCapsCompressTextures,
kCapsHWTransform,
kCapsDither,
kCapsFogLinear,
kCapsFogExp,
kCapsFogExp2,
kCapsFogRange,
kCapsLODWatch,
kCapsUNUSED,
kCapsDoesSmallTextures,
kCapsPixelFog,
kCapsBadYonStuff,
kCapsNoKindaSmallTexs,
kCapsCubicTextures,
kCapsCubicMipmap,
kCapsZBias,
@ -360,7 +311,6 @@ public:
kCapsCantShadow,
kCapsMaxUVWSrc2,
kCapsCantProj,
kCapsLimitedProj,
kCapsShareDepth,
kCapsBadManaged,
kCapsNoAniso,
@ -381,37 +331,19 @@ protected:
char fErrorString[ 128 ];
void IClear();
void IRemoveDiscarded();
void ITryDirect3DTnLDevice(D3DEnum_DeviceInfo* devInfo, hsG3DDeviceRecord& srcDevRec);
void ITryDirect3DTnLDriver(D3DEnum_DriverInfo* drivInfo);
void ITryDirect3DTnL(hsWinRef winRef);
hsBool IInitDirect3D( void );
#ifdef HS_SELECT_DX7
void ITryDirect3DDevice(D3DEnum_DeviceInfo* devInfo, hsG3DDeviceRecord& srcDevRec);
void ITryDirect3DDriver(D3DEnum_DriverInfo* drivInfo);
void ITryDirect3D(hsWinRef winRef);
#endif // HS_SELECT_DX7
void IFudgeDirectXDevice( hsG3DDeviceRecord &record,
D3DEnum_DriverInfo *driverInfo, D3DEnum_DeviceInfo *deviceInfo );
UInt32 IAdjustDirectXMemory( UInt32 cardMem );
hsBool IGetD3DCardInfo( hsG3DDeviceRecord &record, void *driverInfo, void *deviceInfo,
DWORD *vendorID, DWORD *deviceID, char **driverString, char **descString );
#ifdef HS_SELECT_DX7
hsBool IGetD3D7CardInfo( hsG3DDeviceRecord &record, void *driverInfo, void *deviceInfo,
DWORD *vendorID, DWORD *deviceID, char **driverString, char **descString );
#endif // HS_SELECT_DX7
void ITryOpenGL( hsWinRef winRef );
void IGetExtOpenGLInfo( hsG3DDeviceRecord &devRec );
void IGetOpenGLModes( hsG3DDeviceRecord &devRec, char *driverName );
hsBool ITestOpenGLRes( int width, int height, int bitDepth,
hsG3DDeviceRecord &devRec, char *driverName );
#ifdef HS_OPEN_GL
#if HS_BUILD_FOR_WIN32
UInt32 ICreateTempOpenGLContext( HDC hDC, hsBool makeItFull );
#endif
#endif
void ISetFudgeFactors( UInt8 chipsetID, hsG3DDeviceRecord &record );
@ -419,66 +351,12 @@ public:
hsG3DDeviceSelector();
virtual ~hsG3DDeviceSelector();
void Clear();
void RemoveDiscarded();
void RemoveUnusableDevModes(hsBool bTough); // Removes modes and devices not allowed supported in release
hsBool Init( void ); // Returns false if couldn't init
const char *GetErrorString( void ) { return fErrorString; }
void Enumerate(hsWinRef winRef);
hsTArray<hsG3DDeviceRecord>& GetDeviceRecords() { return fRecords; }
hsBool GetDefault(hsG3DDeviceModeRecord *dmr);
hsG3DDeviceRecord* GetRecord(int i) { return &fRecords[i]; }
void Read(hsStream* s);
void Write(hsStream* s);
};
#define M3DDEMOINFO 1 /// Always compiled now, but only enabled if
/// WIN_INIT has DemoInfoOutput in it
///////////////////////////////////////////////////////////////////////////////
//
// Demo Debug File header file stuff
// Created 10.10.2000 by Mathew Burrack @ Cyan, Inc.
//
///////////////////////////////////////////////////////////////////////////////
#include <stdio.h>
#include "headspin.h"
class plDemoDebugFile
{
public:
plDemoDebugFile() { fDemoDebugFP = nil; fIsOpen = false; fEnabled = false; }
~plDemoDebugFile() { IDDFClose(); }
// Static function to write a string to the DDF
static void Write( char *string );
// Static function to write two strings to the DDF
static void Write( char *string1, char *string2 );
// Static function to write a string and a signed integer value to the DDF
static void Write( char *string1, Int32 value );
// Enables or disables the DDF class
static void Enable( hsBool yes ) { fEnabled = yes; }
protected:
static hsBool fIsOpen;
static FILE *fDemoDebugFP;
static hsBool fEnabled;
// Opens the DDF for writing
static hsBool IDDFOpen( void );
// Closes the DDF
static void IDDFClose( void );
};
#endif // hsG3DDeviceSelector_inc

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

@ -1,73 +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 "hsTypes.h"
#include <ddraw.h>
#include "hsGDDrawDllLoad.h"
static hsGDDrawDllLoad staticDllLoad;
hsGDDrawDllLoad::hsGDDrawDllLoad()
{
hsAssert(!staticDllLoad.fD3DDll, "Don't make instances of this class, just use GetDDrawDll func");
fD3DDll = LoadLibrary( "D3D9.DLL" );
if (fD3DDll)
hsStatusMessage( "--- D3D9.DLL loaded successfully.\n" );
else
hsStatusMessage( "--- Unable to load D3D9.DLL successfully.\n" );
}
hsGDDrawDllLoad::~hsGDDrawDllLoad()
{
if (fD3DDll != nil)
{
hsStatusMessage( "--- Unloading D3D.DLL.\n" );
FreeLibrary(fD3DDll);
}
}
HMODULE hsGDDrawDllLoad::GetD3DDll()
{
return staticDllLoad.fD3DDll;
}

59
Sources/Plasma/PubUtilLib/plPipeline/hsGDDrawDllLoad.h

@ -1,59 +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 hsGDDrawDllLoad_inc
#define hsGDDrawDllLoad_inc
class hsGDDrawDllLoad
{
private:
HMODULE fD3DDll;
public:
hsGDDrawDllLoad();
~hsGDDrawDllLoad();
static HMODULE GetD3DDll();
};
#endif hsGDDrawDllLoad_inc

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

@ -40,9 +40,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
*==LICENSE==*/
#include "plDXEnumerate.h"
#include <ddraw.h>
#include "hsGDDrawDllLoad.h"
#include "hsG3DDeviceSelector.h"
#include "hsUtils.h"
@ -102,9 +99,6 @@ HRESULT hsGDirect3DTnLEnumerate::SelectFromDevMode(const hsG3DDeviceRecord* devR
if( !colorDepth )
enumFlags |= D3DENUM_CANWINDOW;
enumFlags |= D3DENUM_TNLHAL;
#ifdef HS_ALLOW_D3D_REF_DRIVER
enumFlags |= D3DENUM_REFERENCERAST;
#endif
D3DEnum_SelectDefaultDriver(enumFlags);
@ -217,11 +211,9 @@ HRESULT hsGDirect3DTnLEnumerate::D3DEnum_SelectDefaultDriver( DWORD dwFlags )
}
else
{
#if !HS_BUILD_FOR_XBOX
if( dwFlags & D3DENUM_CANWINDOW )
{
if( (pDriver == &fDrivers[0])
&&( pDevice->fDDCaps.Caps2 & DDCAPS2_CANRENDERWINDOWED ) )
if( (pDriver == &fDrivers[0]) )
{
if( ( pDevice->fDDCaps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT )
^ !(dwFlags & D3DENUM_TNLHAL) )
@ -229,7 +221,6 @@ HRESULT hsGDirect3DTnLEnumerate::D3DEnum_SelectDefaultDriver( DWORD dwFlags )
}
}
else
#endif
if( dwFlags & D3DENUM_PRIMARYHAL )
{
if( pDriver == &fDrivers[0] )
@ -289,29 +280,8 @@ hsGDirect3DTnLEnumerate::hsGDirect3DTnLEnumerate()
fDrivers.Reset(); // List of DD drivers
/// New DX Enumeration
// Get a pointer to the creation function
#if !HS_BUILD_FOR_XBOX
if( hsGDDrawDllLoad::GetD3DDll() == nil )
{
strcpy( fEnumeErrorStr, "Cannot load Direct3D driver!" );
return;
}
Direct3DCreateProc procPtr;
procPtr = (Direct3DCreateProc)GetProcAddress( hsGDDrawDllLoad::GetD3DDll(), "Direct3DCreate9" );
if( procPtr == nil )
{
strcpy( fEnumeErrorStr, "Cannot load D3D Create Proc!" );
return;
}
// Create a D3D object to use
IDirect3D9 *pD3D = procPtr( D3D_SDK_VERSION );
#else
IDirect3D9 *pD3D = Direct3DCreate9( D3D_SDK_VERSION );
#endif
if( pD3D == nil )
{
strcpy( fEnumeErrorStr, "Cannot load DirectX!" );
@ -397,12 +367,7 @@ void hsGDirect3DTnLEnumerate::IEnumAdapterDevices( IDirect3D9 *pD3D, UINT iAdapt
/// Confirm that HW vertex processing works on this device
if (deviceInfo->fDDCaps.DevCaps & D3DDEVCAPS_PUREDEVICE)
{
#if 0
behavior[iFormat] = D3DCREATE_HARDWARE_VERTEXPROCESSING |
D3DCREATE_PUREDEVICE;
#else
behavior[iFormat] = D3DCREATE_HARDWARE_VERTEXPROCESSING;
#endif
if (SUCCEEDED(IConfirmDevice(&deviceInfo->fDDCaps, behavior[iFormat],
currFormat)))
{
@ -672,16 +637,6 @@ hsBool hsG3DDeviceSelector::IGetD3DCardInfo( hsG3DDeviceRecord &record, // In
adapterInfo = &driverD3DInfo->fAdapterInfo;
/// Print out to our demo data file
plDemoDebugFile::Write( "DeviceSelector detected DX Direct3D device. Info:" );
plDemoDebugFile::Write( " Driver Description", (char *)adapterInfo->Description );
plDemoDebugFile::Write( " Driver Name", (char *)adapterInfo->Driver );
plDemoDebugFile::Write( " Vendor ID", (Int32)adapterInfo->VendorId );
plDemoDebugFile::Write( " Device ID", (Int32)adapterInfo->DeviceId );
plDemoDebugFile::Write( " Version", (char *)record.GetDriverVersion() );
plDemoDebugFile::Write( " Memory size (in MB)", record.GetMemoryBytes() / ( 1024 * 1024 ) );
plDemoDebugFile::Write( " Memory size (in bytes)", record.GetMemoryBytes() );
*vendorID = adapterInfo->VendorId;
*deviceID = adapterInfo->DeviceId;
*driverString = adapterInfo->Driver;
@ -690,37 +645,6 @@ hsBool hsG3DDeviceSelector::IGetD3DCardInfo( hsG3DDeviceRecord &record, // In
return true;
}
//// IInitDirect3D ////////////////////////////////////////////////////////////
hsBool hsG3DDeviceSelector::IInitDirect3D( void )
{
if( hsGDDrawDllLoad::GetD3DDll() == nil )
{
strcpy( fErrorString, "Cannot load Direct3D driver!" );
return false;
}
Direct3DCreateProc procPtr;
procPtr = (Direct3DCreateProc)GetProcAddress( hsGDDrawDllLoad::GetD3DDll(), "Direct3DCreate9" );
if( procPtr == nil )
{
strcpy( fErrorString, "Cannot load D3D Create Proc!" );
return false;
}
// Create a D3D object to use
IDirect3D9 *pD3D = procPtr( D3D_SDK_VERSION );
if( pD3D == nil )
{
strcpy( fErrorString, "Cannot load DirectX!" );
return false;
}
pD3D->Release();
fErrorString[ 0 ] = 0;
return true;
}
//// ITryDirect3DTnL //////////////////////////////////////////////////////////
void hsG3DDeviceSelector::ITryDirect3DTnL(hsWinRef winRef)
@ -742,7 +666,7 @@ void hsG3DDeviceSelector::ITryDirect3DTnLDriver(D3DEnum_DriverInfo* drivInfo)
{
hsG3DDeviceRecord devRec;
devRec.Clear();
devRec.SetG3DDeviceType( kDevTypeDirect3DTnL );
devRec.SetG3DDeviceType( kDevTypeDirect3D );
devRec.SetDriverName( drivInfo->fAdapterInfo.Driver );
devRec.SetDriverDesc( drivInfo->fAdapterInfo.Description );
@ -768,29 +692,6 @@ void hsG3DDeviceSelector::ITryDirect3DTnLDriver(D3DEnum_DriverInfo* drivInfo)
/// Done first now, so we can alter the D3D type later
ITryDirect3DTnLDevice( &drivInfo->fDevices[i], currDevRec );
/// Check the vendor ID to see if it's 3dfx (#0x121a). If it is, don't add it.
/// (we don't support 3dfx D3D devices) -mcn
/// 11.25.2000 mcn - Knew this was going to come back and bite me. Now we just
/// append (3dfx) to the end of the device description, so that our latter test
/// can throw it out or not, depending on whether we're "strong".
if( drivInfo->fAdapterInfo.VendorId == 0x121a &&
( currDevRec.GetG3DHALorHEL() == hsG3DDeviceSelector::kHHD3DHALDev ||
currDevRec.GetG3DHALorHEL() == hsG3DDeviceSelector::kHHD3DTnLHalDev ) )
{
if( drivInfo->fAdapterInfo.DeviceId >= 0x00000009 )
{
currDevRec.SetG3DHALorHEL( kHHD3D3dfxVoodoo5Dev );
plDemoDebugFile::Write( " Tagging device as a 3dfx Voodoo5 or above" );
}
else
{
currDevRec.SetG3DHALorHEL( kHHD3D3dfxDev );
plDemoDebugFile::Write( " Tagging device as a non-V5 3dfx card" );
}
}
IFudgeDirectXDevice( currDevRec, (D3DEnum_DriverInfo *)drivInfo, (D3DEnum_DeviceInfo *)&drivInfo->fDevices[ i ] );
if( currDevRec.GetModes().GetCount() )
@ -832,10 +733,6 @@ void hsG3DDeviceSelector::ITryDirect3DTnLDevice(D3DEnum_DeviceInfo* devInfo, hsG
devRec.SetCap(kCapsPerspective);
if( devInfo->fIsHardware )
devRec.SetCap( kCapsHardware );
if( devInfo->fDDCaps.RasterCaps & D3DPRASTERCAPS_DITHER )
devRec.SetCap(kCapsDither);
if( devInfo->fDDCaps.RasterCaps & D3DPRASTERCAPS_WBUFFER )
devRec.SetCap(kCapsWBuffer);
if( devInfo->fDDCaps.RasterCaps & D3DPRASTERCAPS_FOGTABLE )
{
devRec.SetCap( kCapsFogLinear );

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

@ -55,7 +55,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "hsWindows.h"
#include <d3d9.h>
#include <ddraw.h>
#include <d3dx9mesh.h>
#include <dxerr.h>
@ -67,7 +66,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
#include "plDebugText.h"
#include "plDXEnumerate.h"
#include "hsG3DDeviceSelector.h"
#include "hsGDDrawDllLoad.h"
#include "hsResMgr.h"
#include "plStatusLogDrawer.h"
#include "plQuality.h"
@ -857,7 +855,6 @@ void plDXGeneralSettings::Reset()
fNoGammaCorrect = false;
fMaxUVWSrc = 8;
fCantProj = false;
fLimitedProj = false;
fBadManaged = false;
fShareDepth = false;
fCurrAnisotropy = false;
@ -896,7 +893,7 @@ void plDXPipeline::IInitDeviceState()
fD3DDevice->SetRenderState( D3DRS_ZFUNC, D3DCMP_LESSEQUAL );
fD3DDevice->SetRenderState( D3DRS_ZWRITEENABLE, TRUE );
fD3DDevice->SetRenderState( D3DRS_ZENABLE, ( fSettings.fD3DCaps & kCapsWBuffer ) ? D3DZB_USEW : D3DZB_TRUE );
fD3DDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE );
fD3DDevice->SetRenderState( D3DRS_CLIPPING, TRUE );
fD3DDevice->SetRenderState( D3DRS_CULLMODE, fCurrCullMode );
ISetCullMode();
@ -908,7 +905,7 @@ void plDXPipeline::IInitDeviceState()
fD3DDevice->SetRenderState( D3DRS_MULTISAMPLEANTIALIAS, ( fSettings.fD3DCaps & kCapsFSAntiAlias ) ? TRUE : FALSE );
fD3DDevice->SetRenderState( D3DRS_ANTIALIASEDLINEENABLE, FALSE );
fD3DDevice->SetRenderState( D3DRS_DITHERENABLE, ( fSettings.fD3DCaps & kCapsDither ) ? TRUE : FALSE );
fD3DDevice->SetRenderState( D3DRS_DITHERENABLE, FALSE );
fD3DDevice->SetRenderState( D3DRS_SPECULARENABLE, FALSE );
fD3DDevice->SetRenderState( D3DRS_LIGHTING, FALSE );
fCurrD3DLiteState = false;
@ -1005,10 +1002,6 @@ void plDXPipeline::ISetCaps()
fSettings.fD3DCaps |= kCapsMipmap;
if( fCurrentDevice->fDDCaps.TextureCaps & D3DPTEXTURECAPS_MIPCUBEMAP )
fSettings.fD3DCaps |= kCapsCubicMipmap;
if( fCurrentDevice->fDDCaps.RasterCaps & D3DPRASTERCAPS_WBUFFER )
fSettings.fD3DCaps |= kCapsWBuffer;
if( fCurrentDevice->fDDCaps.RasterCaps & D3DPRASTERCAPS_DITHER )
fSettings.fD3DCaps |= kCapsDither;
if( fSettings.fNumAASamples > 0 )
fSettings.fD3DCaps |= kCapsFSAntiAlias;
if( fCurrentDevice->fDDCaps.RasterCaps & D3DPRASTERCAPS_WFOG )
@ -1017,8 +1010,8 @@ void plDXPipeline::ISetCaps()
fSettings.fD3DCaps |= kCapsCubicTextures;
/// New 1.5.2000 - cull out mixed vertex processing
if( fCurrentDevice->fDDCaps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT
&& fCurrentMode->fDDBehavior == D3DCREATE_HARDWARE_VERTEXPROCESSING
if( (fCurrentDevice->fDDCaps.DevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT)
&& (fCurrentMode->fDDBehavior == D3DCREATE_HARDWARE_VERTEXPROCESSING)
)
fSettings.fD3DCaps |= kCapsHWTransform;
@ -1115,16 +1108,8 @@ void plDXPipeline::IRestrictCaps( const hsG3DDeviceRecord& devRec )
fSettings.fD3DCaps &= ~kCapsMipmap;
if( !devRec.GetCap( hsG3DDeviceSelector::kCapsCubicMipmap ) )
fSettings.fD3DCaps &= ~kCapsCubicMipmap;
if( !devRec.GetCap( hsG3DDeviceSelector::kCapsWBuffer ) )
fSettings.fD3DCaps &= ~kCapsWBuffer;
if( !devRec.GetCap( hsG3DDeviceSelector::kCapsZBias ) )
fSettings.fD3DCaps &= ~kCapsZBias;
// if( !devRec.GetCap( hsG3DDeviceSelector::kCapsHWTransform ) )
// fSettings.fD3DCaps &= ~kCapsHWTransform;
if( !devRec.GetCap( hsG3DDeviceSelector::kCapsDither ) )
fSettings.fD3DCaps &= ~kCapsDither;
// if( devRec.GetAASetting() == 0 )
// fSettings.fD3DCaps &= ~kCapsFSAntiAlias;
if( !devRec.GetCap( hsG3DDeviceSelector::kCapsFogExp ) )
fSettings.fD3DCaps &= ~kCapsExpFog;
if( !devRec.GetCap( hsG3DDeviceSelector::kCapsCubicTextures ) )
@ -1135,8 +1120,6 @@ void plDXPipeline::IRestrictCaps( const hsG3DDeviceRecord& devRec )
if( devRec.GetCap(hsG3DDeviceSelector::kCapsCantProj) )
fSettings.fCantProj = true;
if( devRec.GetCap(hsG3DDeviceSelector::kCapsLimitedProj) )
fSettings.fLimitedProj = true;
if( devRec.GetCap(hsG3DDeviceSelector::kCapsBadManaged) )
fSettings.fBadManaged = true;
if( devRec.GetCap(hsG3DDeviceSelector::kCapsShareDepth) )
@ -1152,11 +1135,6 @@ void plDXPipeline::IRestrictCaps( const hsG3DDeviceRecord& devRec )
if( devRec.GetCap( hsG3DDeviceSelector::kCapsBadYonStuff ) )
fSettings.fD3DCaps |= kCapsHasBadYonStuff;
/// 10.31.2000 mcn - Flag for can't-handle-under-8-pixel-dimensions-on-textures
/// (see, isn't the name flag actually better in retrospect? :)
if( devRec.GetCap( hsG3DDeviceSelector::kCapsNoKindaSmallTexs ) )
fSettings.fD3DCaps |= kCapsNoKindaSmallTexs;
/// Note: the following SHOULD be here, but we later detect for texture
/// formats and reset this flag. It should only be set if it is set already,
/// but that means ensuring it's set beforehand, which it might not be.
@ -1218,15 +1196,8 @@ void plDXPipeline::IRestrictCaps( const hsG3DDeviceRecord& devRec )
fManagedCutoff = 1;
}
//// Our temp debug flag to force z-buffering...
if( !( fDbgSetupInitFlags & 0x00000001 ) )
fSettings.fD3DCaps &= ~kCapsWBuffer;
/// Set up the z-bias scale values, based on z- or w-buffering
if( fSettings.fD3DCaps & kCapsWBuffer )
fTweaks.fDefaultPerspLayerScale = kPerspLayerScaleW;
else
fTweaks.fDefaultPerspLayerScale = kPerspLayerScale;
/// Set up the z-bias scale values
fTweaks.fDefaultPerspLayerScale = kPerspLayerScale;
// Less than 4 layers at once means we have to fallback on uv bumpmapping
@ -1541,16 +1512,7 @@ hsBool plDXPipeline::ICreateMaster()
hsAssert( !fD3DObject, "ICreateMaster() should only be called for Master Direct3DDevice" );
/// The new DirectX Way: Create a Direct3D object, out of which everything else springs
if( hsGDDrawDllLoad::GetD3DDll() == nil )
return ICreateFail( "Cannot load Direct3D driver!" );
Direct3DCreateProc procPtr;
procPtr = (Direct3DCreateProc)GetProcAddress( hsGDDrawDllLoad::GetD3DDll(), "Direct3DCreate9" );
if( procPtr == nil )
return ICreateFail( "Cannot load D3D Create Proc!" );
// Create a D3D object to use
fD3DObject = procPtr( D3D_SDK_VERSION );
fD3DObject = Direct3DCreate9( D3D_SDK_VERSION );
if( fD3DObject == nil )
return ICreateFail( "Cannot create Direct3D object" );
@ -3869,9 +3831,7 @@ hsBool plDXPipeline::BeginRender()
}
// Superfluous setting of Z state.
fD3DDevice->SetRenderState( D3DRS_ZENABLE,
( fView.IsPerspective() && ( fSettings.fD3DCaps & kCapsWBuffer ) )
? D3DZB_USEW : D3DZB_TRUE );
fD3DDevice->SetRenderState( D3DRS_ZENABLE, D3DZB_TRUE );
/// If we have a renderTarget active, use its viewport
ISetViewport();
@ -8651,11 +8611,6 @@ hsBool plDXPipeline::IProcessMipmapLevels( plMipmap *mipmap, UInt32 &numLevels,
{
UInt32 sizeMask = 0x03;
/// 10.31.2000 - If we have this flag set, we really have to cut out
/// sizes under 8x8. So far only true on the KYRO...
if( fSettings.fD3DCaps & kCapsNoKindaSmallTexs )
sizeMask = 0x07;
int maxLevel = mipmap->GetNumLevels() - 1;
/// 9.7.2000 - Also do this test if the card doesn't support
@ -9668,34 +9623,14 @@ hsMatrix44 plDXPipeline::IGetCameraToNDC()
// is [x/w, y/w, z/w + t/s, 1/sw]
if( fSettings.fD3DCaps & kCapsWBuffer )
{
// W-buffering is only true w-buffering on 3dfx cards. On everything else,
// they REALLY base it off the Z value. So we want to scale (but NOT translate)
// the Z...
// Note: the base value for perspLayerScale should be 0.001 for w-buffering,
// not the normal 0.00001
float scale = 1.f - float(fCurrRenderLayer) * fTweaks.fPerspLayerScale;
float scale = 1.f - float(fCurrRenderLayer) * fTweaks.fPerspLayerScale;
float zTrans = -scale * float(fCurrRenderLayer) * fTweaks.fPerspLayerTrans;
cam2ndc.fMap[0][0] *= scale;
cam2ndc.fMap[1][1] *= scale;
cam2ndc.fMap[2][2] *= scale;
cam2ndc.fMap[3][2] *= scale;
}
else
{
// Z-buffering, so do it the traditional way
float scale = 1.f - float(fCurrRenderLayer) * fTweaks.fPerspLayerScale;
// scale = -1.f;
float zTrans = -scale * float(fCurrRenderLayer) * fTweaks.fPerspLayerTrans;
cam2ndc.fMap[0][0] *= scale;
cam2ndc.fMap[1][1] *= scale;
cam2ndc.fMap[2][2] *= scale;
cam2ndc.fMap[2][2] += zTrans * cam2ndc.fMap[3][2];
cam2ndc.fMap[3][2] *= scale;
}
cam2ndc.fMap[0][0] *= scale;
cam2ndc.fMap[1][1] *= scale;
cam2ndc.fMap[2][2] *= scale;
cam2ndc.fMap[2][2] += zTrans * cam2ndc.fMap[3][2];
cam2ndc.fMap[3][2] *= scale;
}
else
{
@ -11387,9 +11322,6 @@ void plDXPipeline::IRenderProjectionEach(const plRenderPrimFunc& render, hsGMate
int iNextPass = iPass + fCurrNumLayers;
if( fSettings.fLimitedProj && (material->GetLayer(iPass)->GetUVWSrc() & ~plLayerInterface::kUVWIdxMask) )
return;
// For each projector:
int k;
for( k = 0; k < fLights.fProjEach.GetCount(); k++ )
@ -12216,12 +12148,6 @@ void plDXPipeline::SubmitShadowSlave(plShadowSlave* slave)
if( !(slave && slave->fCaster && slave->fCaster->GetKey()) )
return;
// A board with limited projection capability (i.e. GeForce1) can't
// do perspective shadows (from point source lights) because it
// requires a count3 uvw on 2 texture units (0,1) simultaneously. Just skip.
if( (fSettings.fLimitedProj || fSettings.fCantProj) && slave->fView.GetPerspective() )
return;
// Ref the shadow caster so we're sure it will still be around when we go to
// render it.
slave->fCaster->GetKey()->RefObject();

45
Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.h

@ -177,30 +177,27 @@ class plDXPipeline : public plPipeline
{
protected:
enum {
kCapsNone = 0x0,
kCapsCompressTextures = 0x1,
kCapsMipmap = 0x2,
kCapsHWTransform = 0x4,
kCapsHWLighting = 0x8,
kCapsZBias = 0x10,
kCapsLinearFog = 0x20,
kCapsExpFog = 0x40,
kCapsExp2Fog = 0x80,
kCapsRangeFog = 0x100,
kCapsWBuffer = 0x200,
kCapsTexBoundToStage = 0x400,
kCapsDither = 0x800,
kCapsLODWatch = 0x1000,
kCapsFSAntiAlias = 0x2000,
kCapsLuminanceTextures = 0x4000,
kCapsDoesSmallTextures = 0x8000,
kCapsDoesWFog = 0x10000,
kCapsPixelFog = 0x20000,
kCapsHasBadYonStuff = 0x40000,
kCapsNoKindaSmallTexs = 0x80000,
kCapsCubicTextures = 0x200000,
kCapsCubicMipmap = 0x400000
kCapsNone = 0x00000000,
kCapsCompressTextures = 0x00000001,
kCapsMipmap = 0x00000002,
kCapsHWTransform = 0x00000004,
kCapsHWLighting = 0x00000008,
kCapsZBias = 0x00000010,
kCapsLinearFog = 0x00000020,
kCapsExpFog = 0x00000040,
kCapsExp2Fog = 0x00000080,
kCapsRangeFog = 0x00000100,
kCapsTexBoundToStage = 0x00000200,
kCapsLODWatch = 0x00000400,
kCapsFSAntiAlias = 0x00000800,
kCapsLuminanceTextures = 0x00001000,
kCapsDoesSmallTextures = 0x00002000,
kCapsDoesWFog = 0x00004000,
kCapsPixelFog = 0x00008000,
kCapsHasBadYonStuff = 0x00010000,
kCapsNpotTextures = 0x00020000,
kCapsCubicTextures = 0x00040000,
kCapsCubicMipmap = 0x00080000
};
enum {
kKNone = 0x0,

Loading…
Cancel
Save