diff --git a/Build/VS2010/Plasma/Apps/plClient/plClient.vcxproj b/Build/VS2010/Plasma/Apps/plClient/plClient.vcxproj index 060030e7..eb1fa5e4 100644 --- a/Build/VS2010/Plasma/Apps/plClient/plClient.vcxproj +++ b/Build/VS2010/Plasma/Apps/plClient/plClient.vcxproj @@ -106,7 +106,7 @@ true - 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) + 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) $(OutDir)$(TargetName)$(TargetExt) true ..\..\..\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) @@ -162,7 +162,7 @@ true - 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) + 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) $(OutDir)$(TargetName)$(TargetExt) true ..\..\..\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) @@ -222,7 +222,7 @@ true - 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) + 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) $(OutDir)$(TargetName)$(TargetExt) true ..\..\..\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) @@ -283,7 +283,7 @@ true - 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) + 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) $(OutDir)$(TargetName)$(TargetExt) true ..\..\..\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) diff --git a/Build/VS2010/Plasma/Apps/plPageOptimizer/plPageOptimizer.vcxproj b/Build/VS2010/Plasma/Apps/plPageOptimizer/plPageOptimizer.vcxproj index 808b8c21..9c309908 100644 --- a/Build/VS2010/Plasma/Apps/plPageOptimizer/plPageOptimizer.vcxproj +++ b/Build/VS2010/Plasma/Apps/plPageOptimizer/plPageOptimizer.vcxproj @@ -61,7 +61,7 @@ true - 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) + 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) $(OutDir)$(TargetName)$(TargetExt) ..\..\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) libc.lib;libcd.lib;libci.lib;libcid.lib;libcmt.lib;libcmtd.lib;%(IgnoreSpecificDefaultLibraries) @@ -95,7 +95,7 @@ true - 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) + 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) $(OutDir)$(TargetName)$(TargetExt) ..\..\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) libc.lib;libci.lib;libcmt.lib;%(IgnoreSpecificDefaultLibraries) @@ -129,4 +129,4 @@ - \ No newline at end of file + diff --git a/Build/VS2010/Plasma/PubUtilLib/plPipeline/plPipeline.vcxproj b/Build/VS2010/Plasma/PubUtilLib/plPipeline/plPipeline.vcxproj index 09cd8f46..5778c67a 100644 --- a/Build/VS2010/Plasma/PubUtilLib/plPipeline/plPipeline.vcxproj +++ b/Build/VS2010/Plasma/PubUtilLib/plPipeline/plPipeline.vcxproj @@ -229,22 +229,6 @@ %(PreprocessorDefinitions) %(PreprocessorDefinitions) - - Disabled - Disabled - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - EnableFastChecks - EnableFastChecks - MaxSpeed - MaxSpeed - %(AdditionalIncludeDirectories) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(PreprocessorDefinitions) - Disabled Disabled @@ -542,7 +526,6 @@ - @@ -584,4 +567,4 @@ - \ No newline at end of file + diff --git a/Build/VS2010/Plasma/PubUtilLib/plPipeline/plPipeline.vcxproj.filters b/Build/VS2010/Plasma/PubUtilLib/plPipeline/plPipeline.vcxproj.filters index 44175c1c..796c1e23 100644 --- a/Build/VS2010/Plasma/PubUtilLib/plPipeline/plPipeline.vcxproj.filters +++ b/Build/VS2010/Plasma/PubUtilLib/plPipeline/plPipeline.vcxproj.filters @@ -20,9 +20,6 @@ Source Files - - Source Files - Source Files @@ -100,9 +97,6 @@ Header Files - - Header Files - Header Files @@ -215,4 +209,4 @@ DeviceRefs - \ No newline at end of file + diff --git a/Sources/Plasma/Apps/plClient/plClient.cpp b/Sources/Plasma/Apps/plClient/plClient.cpp index 4ae4004d..07a2ccb4 100644 --- a/Sources/Plasma/Apps/plClient/plClient.cpp +++ b/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; diff --git a/Sources/Plasma/Apps/plClient/plClient.h b/Sources/Plasma/Apps/plClient/plClient.h index acbbb58c..b4b6072e 100644 --- a/Sources/Plasma/Apps/plClient/plClient.h +++ b/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(); diff --git a/Sources/Plasma/PubUtilLib/plGImage/hsDXTDirectXCodec.cpp b/Sources/Plasma/PubUtilLib/plGImage/hsDXTDirectXCodec.cpp index 9993b252..e3774ca5 100644 --- a/Sources/Plasma/PubUtilLib/plGImage/hsDXTDirectXCodec.cpp +++ b/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 +#include + #include #include @@ -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> 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 /////////////////////////////////////////////////// diff --git a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp index 8f3053b9..57f62b6e 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp +++ b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.cpp @@ -53,14 +53,6 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com #include "hsUtils.h" #include "plPipeline.h" -#ifdef HS_OPEN_GL -#if HS_BUILD_FOR_WIN32 -#include "gls.h" -#include "glswgl.h" -#include "glext.h" -#endif -#endif - /////////////////////////////////////////////////// /////////////////////////////////////////////////// /////////////////////////////////////////////////// @@ -103,50 +95,6 @@ void hsG3DDeviceMode::Clear() fFSAATypes.Reset(); } -void hsG3DDeviceMode::Read( hsStream* s ) -{ - Clear(); - - fFlags = s->ReadSwap32(); - fWidth = s->ReadSwap32(); - fHeight = s->ReadSwap32(); - fDepth = s->ReadSwap32(); - - fZStencilDepths.Reset(); - UInt8 count= s->ReadByte(); - while( count-- ) - fZStencilDepths.Append( s->ReadSwap16() ); - - /// Version 9 - fFSAATypes.Reset(); - count = s->ReadByte(); - while( count-- ) - fFSAATypes.Append( s->ReadByte() ); - - fCanRenderToCubics = s->ReadBool(); -} - -void hsG3DDeviceMode::Write( hsStream* s ) const -{ - s->WriteSwap32(fFlags); - s->WriteSwap32(fWidth); - s->WriteSwap32(fHeight); - s->WriteSwap32(fDepth); - - UInt8 i, count = (UInt8)fZStencilDepths.GetCount(); - s->WriteByte( count ); - for( i = 0; i < count; i++ ) - s->WriteSwap16( fZStencilDepths[ i ] ); - - /// Version 9 - count = (UInt8)fFSAATypes.GetCount(); - s->WriteByte( count ); - for( i = 0; i < count; i++ ) - s->WriteByte( fFSAATypes[ i ] ); - - s->WriteBool( fCanRenderToCubics ); -} - /////////////////////////////////////////////////// /////////////////////////////////////////////////// /////////////////////////////////////////////////// @@ -157,7 +105,7 @@ hsG3DDeviceRecord::hsG3DDeviceRecord() fG3DDriverDesc(nil), fG3DDriverName(nil), fG3DDriverVersion(nil), fG3DDeviceDesc(nil), fLayersAtOnce(0), fMemoryBytes(0), fG3DHALorHEL(hsG3DDeviceSelector::kHHTypeUnknown), - fZBiasRating( 0 ), fRecordVersion( kCurrRecordVersion ), fLODBiasRating( 0 ), + fZBiasRating( 0 ), fLODBiasRating( 0 ), fFogExpApproxStart( 0.0 ), fFogExp2ApproxStart( 0.0 ), fFogEndBias( 0.0 ), fMaxAnisotropicSamples( 1 ) { SetFogKneeParams( kFogExp, 0, 0 ); @@ -174,7 +122,7 @@ hsG3DDeviceRecord::hsG3DDeviceRecord(const hsG3DDeviceRecord& src) fG3DDeviceType(hsG3DDeviceSelector::kDevTypeUnknown), fG3DDriverDesc(nil), fG3DDriverName(nil), fG3DDriverVersion(nil), fG3DDeviceDesc(nil), fG3DHALorHEL(hsG3DDeviceSelector::kHHTypeUnknown), - fZBiasRating( src.fZBiasRating ), fRecordVersion( kCurrRecordVersion ), fLODBiasRating( 0 ), + fZBiasRating( src.fZBiasRating ), fLODBiasRating( 0 ), fFogExpApproxStart( src.fFogExpApproxStart ), fFogExp2ApproxStart( src.fFogExp2ApproxStart ), fFogEndBias( src.fFogEndBias ), fMaxAnisotropicSamples( src.fMaxAnisotropicSamples ) { @@ -247,7 +195,6 @@ const char* hsG3DDeviceRecord::GetG3DDeviceTypeName() const { static char* deviceNames[hsG3DDeviceSelector::kNumDevTypes] = { "Unknown", - "Glide", "Direct3D", "OpenGL" }; @@ -321,149 +268,6 @@ void hsG3DDeviceRecord::Clear() fMaxAnisotropicSamples = 1; } -//// Read ///////////////////////////////////////////////////////////////////// -// 9.6.2000 mcn - Updated to reflect version 2 format -// 9.8.2000 mcn - (temporary?) set to invalid on old (<2) versions - -void hsG3DDeviceRecord::Read(hsStream* s) -{ - Clear(); - - /// Read version - fRecordVersion = s->ReadSwap32(); - hsAssert( fRecordVersion <= kCurrRecordVersion, "Invalid version number in hsG3DDeviceRecord::Read()" ); - if( fRecordVersion == kCurrRecordVersion ) - { - fFlags = s->ReadSwap32(); - } - else - { - SetInvalid(); - return; -// fFlags = fRecordVersion; -// fRecordVersion = 1; -// hsStatusMessage( "WARNING: Old version of hsG3DDeviceRecord found. Attempting to read." ); - } - - /// Now read everything else in as normal - fG3DDeviceType = s->ReadSwap32(); - - int len; - - len = s->ReadSwap32(); - fG3DDriverDesc = TRACKED_NEW char[len + 1]; - s->Read(len, fG3DDriverDesc); - fG3DDriverDesc[len] = 0; - - len = s->ReadSwap32(); - fG3DDriverName = TRACKED_NEW char[len + 1]; - s->Read(len, fG3DDriverName); - fG3DDriverName[len] = 0; - - len = s->ReadSwap32(); - fG3DDriverVersion = TRACKED_NEW char[len + 1]; - s->Read(len, fG3DDriverVersion); - fG3DDriverVersion[len] = 0; - - len = s->ReadSwap32(); - fG3DDeviceDesc = TRACKED_NEW char[len + 1]; - s->Read(len, fG3DDeviceDesc); - fG3DDeviceDesc[len] = 0; - - - fCaps.Read(s); - fLayersAtOnce = s->ReadSwap32(); - fMemoryBytes = s->ReadSwap32(); - - len = s->ReadSwap32(); - fModes.SetCount(len); - int i; - for( i = 0; i < len; i++ ) - fModes[i].Read( s ); - - /// Version 3 stuff - fZBiasRating = s->ReadSwapFloat(); - fLODBiasRating = s->ReadSwapFloat(); - fFogExpApproxStart = s->ReadSwapFloat(); - fFogExp2ApproxStart = s->ReadSwapFloat(); - fFogEndBias = s->ReadSwapFloat(); - - /// Version 7 stuff - float knee, kneeVal; - knee = s->ReadSwapFloat(); kneeVal = s->ReadSwapFloat(); - SetFogKneeParams( kFogExp, knee, kneeVal ); - knee = s->ReadSwapFloat(); kneeVal = s->ReadSwapFloat(); - SetFogKneeParams( kFogExp2, knee, kneeVal ); - - /// Version 9 stuff - fAASetting = s->ReadByte(); - - /// Version A stuff - fMaxAnisotropicSamples = s->ReadByte(); - - /// Reset record version now - fRecordVersion = kCurrRecordVersion; -} - -void hsG3DDeviceRecord::Write(hsStream* s) const -{ - s->WriteSwap32( fRecordVersion ); - - s->WriteSwap32(fFlags); - - s->WriteSwap32(fG3DDeviceType); - - int len; - - len = hsStrlen(fG3DDriverDesc); - s->WriteSwap32(len); - s->Write(len, fG3DDriverDesc); - - len = hsStrlen(fG3DDriverName); - s->WriteSwap32(len); - s->Write(len, fG3DDriverName); - - len = hsStrlen(fG3DDriverVersion); - s->WriteSwap32(len); - s->Write(len, fG3DDriverVersion); - - len = hsStrlen(fG3DDeviceDesc); - s->WriteSwap32(len); - s->Write(len, fG3DDeviceDesc); - - fCaps.Write(s); - s->WriteSwap32(fLayersAtOnce); - s->WriteSwap32(fMemoryBytes); - - s->WriteSwap32(fModes.GetCount()); - int i; - for( i = 0; i < fModes.GetCount(); i++ ) - fModes[i].Write( s ); - - /// Version 3 data - s->WriteSwapFloat( fZBiasRating ); - s->WriteSwapFloat( fLODBiasRating ); - s->WriteSwapFloat( fFogExpApproxStart ); - s->WriteSwapFloat( fFogExp2ApproxStart ); - s->WriteSwapFloat( fFogEndBias ); - - /// Version 7 data - s->WriteSwapFloat( fFogKnees[ kFogExp ] ); - s->WriteSwapFloat( fFogKneeVals[ kFogExp ] ); - s->WriteSwapFloat( fFogKnees[ kFogExp2 ] ); - s->WriteSwapFloat( fFogKneeVals[ kFogExp2 ] ); - - /// Version 9 data - s->WriteByte( fAASetting ); - - /// Version A stuff - s->WriteByte( fMaxAnisotropicSamples ); -} - -/////////////////////////////////////////////////// -/////////////////////////////////////////////////// -/////////////////////////////////////////////////// - hsG3DDeviceModeRecord::hsG3DDeviceModeRecord(const hsG3DDeviceRecord& devRec, const hsG3DDeviceMode& devMode) : fDevice(devRec), fMode(devMode) { @@ -498,10 +302,10 @@ hsG3DDeviceSelector::hsG3DDeviceSelector() hsG3DDeviceSelector::~hsG3DDeviceSelector() { - Clear(); + IClear(); } -void hsG3DDeviceSelector::RemoveDiscarded() +void hsG3DDeviceSelector::IRemoveDiscarded() { int i; for( i = 0; i < fRecords.GetCount(); ) @@ -518,7 +322,7 @@ void hsG3DDeviceSelector::RemoveDiscarded() } } -void hsG3DDeviceSelector::Clear() +void hsG3DDeviceSelector::IClear() { int i; for( i = 0; i < fRecords.GetCount(); i++ ) @@ -528,7 +332,6 @@ void hsG3DDeviceSelector::Clear() void hsG3DDeviceSelector::RemoveUnusableDevModes(hsBool bTough) { - plDemoDebugFile::Write( "Removing unusable devices and modes..." ); for (int i = 0; i < fRecords.GetCount(); i++) { // @@ -542,21 +345,13 @@ void hsG3DDeviceSelector::RemoveUnusableDevModes(hsBool bTough) (modes[j].GetHeight() == 0) && (modes[j].GetColorDepth() == 0)) { - plDemoDebugFile::Write( " Removing windowed mode on ", (char *)fRecords[ i ].GetDriverDesc() ); modes[j].SetDiscarded(true); } // If tough, remove modes less than 640x480 else if (bTough && ((modes[j].GetWidth() < 640) || (modes[j].GetHeight() < 480))) { - plDemoDebugFile::Write( " Removing mode < 640x480 on ", (char *)fRecords[ i ].GetDriverDesc() ); modes[j].SetDiscarded(true); } - else - { - char str[ 256 ]; - sprintf( str, " Keeping mode (%dx%d) on device %s", modes[j].GetWidth(), modes[j].GetHeight(), fRecords[ i ].GetDriverDesc() ); - plDemoDebugFile::Write( str ); - } } // @@ -564,65 +359,27 @@ void hsG3DDeviceSelector::RemoveUnusableDevModes(hsBool bTough) // if (fRecords[i].GetG3DDeviceType() == hsG3DDeviceSelector::kDevTypeUnknown) { - plDemoDebugFile::Write( " Removing unknown device. Description", (char *)fRecords[ i ].GetDriverDesc() ); fRecords[i].SetDiscarded(true); } - else if( fRecords[i].GetG3DDeviceType() == hsG3DDeviceSelector::kDevTypeDirect3D || - fRecords[i].GetG3DDeviceType() == hsG3DDeviceSelector::kDevTypeDirect3DTnL ) + else if( fRecords[i].GetG3DDeviceType() == hsG3DDeviceSelector::kDevTypeDirect3D ) { UInt32 totalMem; - char devDesc[ 256 ]; - - - // For our 3dfx test later - strncpy( devDesc, fRecords[i].GetDriverDesc(), sizeof( devDesc ) - 1 ); - hsStrLower( devDesc ); // Remove software Direct3D devices if ((fRecords[i].GetG3DHALorHEL() != hsG3DDeviceSelector::kHHD3DHALDev) && - (fRecords[i].GetG3DHALorHEL() != hsG3DDeviceSelector::kHHD3DTnLHalDev) && - (fRecords[i].GetG3DHALorHEL() != hsG3DDeviceSelector::kHHD3D3dfxDev) && - (fRecords[i].GetG3DHALorHEL() != hsG3DDeviceSelector::kHHD3D3dfxVoodoo5Dev) -#ifdef HS_ALLOW_D3D_REF_DRIVER - && (fRecords[i].GetG3DHALorHEL() != hsG3DDeviceSelector::kHHD3DRefDev) -#endif - ) + (fRecords[i].GetG3DHALorHEL() != hsG3DDeviceSelector::kHHD3DTnLHalDev)) { - plDemoDebugFile::Write( " Removing software Direct3D device. Description", (char *)fRecords[ i ].GetDriverDesc() ); - fRecords[i].SetDiscarded(true); - } - // Remove 3Dfx Direct3D devices, take 2 - // 10.13.2000 mcn - Now we do it even when we're wimpy - // 10.25.2000 mcn - Think again. - // 11.3.2000 mcn - Shesh, is this EVER going to be stable?? - else if( bTough && fRecords[i].GetG3DHALorHEL() == hsG3DDeviceSelector::kHHD3D3dfxDev ) -// else if( bTough && ( strstr( devDesc, "3dfx" ) || strstr( devDesc, "voodoo" ) ) ) - { - plDemoDebugFile::Write( " Removing 3Dfx non-Voodoo5 Direct3D device (We only support Glide on 3Dfx). Description", (char *)fRecords[ i ].GetDriverDesc() ); fRecords[i].SetDiscarded(true); } // Remove Direct3D devices with less than 11 megs of RAM else if (bTough && ( totalMem = IAdjustDirectXMemory( fRecords[i].GetMemoryBytes() ) ) < 11*1024*1024 ) { - char str[ 256 ]; - sprintf( str, " Removing Direct3D device with < 11MB RAM. Device RAM (in kB): %d (Description: %s)", - totalMem / 1024, fRecords[ i ].GetDriverDesc() ); - plDemoDebugFile::Write( str ); fRecords[i].SetDiscarded(true); } - else - { - if( fRecords[i].GetG3DDeviceType() == hsG3DDeviceSelector::kDevTypeDirect3DTnL ) - plDemoDebugFile::Write( " Keeping DX8 Direct3D device", (char *)fRecords[ i ].GetDriverDesc() ); - else - plDemoDebugFile::Write( " Keeping Direct3D device", (char *)fRecords[ i ].GetDriverDesc() ); - } } - else - plDemoDebugFile::Write( " Keeping device", (char *)fRecords[ i ].GetDriverDesc() ); } - RemoveDiscarded(); + IRemoveDiscarded(); } //// IAdjustDirectXMemory ///////////////////////////////////////////////////// @@ -652,20 +409,9 @@ UInt32 hsG3DDeviceSelector::IAdjustDirectXMemory( UInt32 cardMem ) #endif } -hsBool hsG3DDeviceSelector::Init( void ) -{ - // See if we're all capable of initing - if( !IInitDirect3D() ) - { - return false; - } - - return true; -} - void hsG3DDeviceSelector::Enumerate(hsWinRef winRef) { - Clear(); + IClear(); #ifdef HS_BUILD_FOR_WIN32 /// 9.6.2000 - Create the class to use as our temporary window class @@ -681,15 +427,8 @@ void hsG3DDeviceSelector::Enumerate(hsWinRef winRef) hsAssert(ret, "Cannot create temporary window class to test for device modes" ); #endif - /// Now try our devices -#ifdef HS_SELECT_DX7 - ITryDirect3D(winRef); -#endif // HS_SELECT_DX7 - ITryDirect3DTnL(winRef); -// ITryOpenGL(winRef); - #ifdef HS_BUILD_FOR_WIN32 /// Get rid of the class UnregisterClass( fTempWinClass, GetModuleHandle( nil ) ); @@ -709,7 +448,6 @@ hsBool hsG3DDeviceSelector::GetDefault (hsG3DDeviceModeRecord *dmr) switch (fRecords[i].GetG3DDeviceType()) { case kDevTypeDirect3D: - case kDevTypeDirect3DTnL: if (fRecords[i].GetG3DHALorHEL() == kHHD3DTnLHalDev) { if (iTnL == -1 @@ -721,7 +459,7 @@ hsBool hsG3DDeviceSelector::GetDefault (hsG3DDeviceModeRecord *dmr) iTnL = i; } } - else if (fRecords[i].GetG3DHALorHEL() == kHHD3DHALDev || fRecords[i].GetG3DHALorHEL() == kHHD3D3dfxVoodoo5Dev ) + else if (fRecords[i].GetG3DHALorHEL() == kHHD3DHALDev ) { if (iD3D == -1 #ifndef PLASMA_EXTERNAL_RELEASE @@ -789,437 +527,6 @@ hsBool hsG3DDeviceSelector::GetDefault (hsG3DDeviceModeRecord *dmr) return true; } -//// ITryOpenGL /////////////////////////////////////////////////////////////// -// Updated 8.24.2000 mcn to (hopefully) detect OpenGL drivers. - -void hsG3DDeviceSelector::ITryOpenGL(hsWinRef winRef) -{ -#ifdef HS_OPEN_GL -#if HS_BUILD_FOR_WIN32 - int i, numDrivers; - int modeRes[ 6 ][ 3 ] = { { 640, 480, 16 }, { 800, 600, 16 }, { 1024, 768, 16 }, - { 1152, 864, 16 }, { 1280, 1024, 16 }, { 1600, 1200, 16 } }; - gls_driver_info driverInfo; - hsG3DDeviceRecord devRec; - hsG3DDeviceMode devMode; - char str[ 128 ]; - HDC hDC; - HGLRC tempContext; - HWND testWindow = nil, testWindow2 = nil; - - WINDOWPLACEMENT oldWindowPlace; - - - /// Save old window position - oldWindowPlace.length = sizeof( oldWindowPlace ); - GetWindowPlacement( (HWND)winRef, &oldWindowPlace ); - - /// Use the GLS API to get us a list of all OpenGL drivers available on - /// this system and their capabilities - numDrivers = glsGetNumberOfDrivers(); - for( i = 0; i < numDrivers; i++ ) - { - /// Get main driver info - glsGetDriverInfo( i, &driverInfo ); - - devRec.SetG3DDeviceType( kDevTypeOpenGL ); - - devRec.SetDriverDesc( driverInfo.aDriverDescription ); - devRec.SetDriverName( driverInfo.GLDriver.aDriverFilePath ); - - sprintf( str, "%d.%d", driverInfo.GLDriver.DriverFileVersionHigh, - driverInfo.GLDriver.DriverFileVersionLow ); - devRec.SetDriverVersion( str ); - - devRec.SetCap( kCapsMipmap ); - devRec.SetCap( kCapsMipmap ); - devRec.SetCap( kCapsPerspective ); - - if( driverInfo.DriverFlags & GLS_FLAGS_FULLSCREEN_ONLY ) - devRec.SetCap( kCapsNoWindow ); - if( !( driverInfo.DriverFlags & GLS_FLAGS_SOFTWARE_ONLY ) ) - devRec.SetCap( kCapsHardware ); - devRec.SetCap( kCapsDoesSmallTextures ); - - /// We have a problem here--OpenGL has no way of detecting the rest of - /// the information we want, so we'll have to guess/kludge on most of it. - - glsLoadDriver( i ); - sprintf( str, "ITryOpenGL(): FOUND OpenGL Driver: %s (%s)\n", driverInfo.aDriverDescription, - driverInfo.GLDriver.aDriverFilePath ); - hsStatusMessage( str ); - - /// (and of COURSE we have to open a bloody rendering context for - /// glGetString to work...whose bright idea was THAT?) - testWindow = CreateWindowEx( WS_EX_APPWINDOW, fTempWinClass, "OpenGL Screen Test Window", - WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE, - 0, 0, 640, 480, nil, nil, GetModuleHandle( nil ), 0 ); - hDC = GetDC( testWindow ); - tempContext = (HGLRC)ICreateTempOpenGLContext( hDC, - driverInfo.DriverFlags & GLS_FLAGS_FULLSCREEN_ONLY ); - if( tempContext != nil ) - { - wglMakeCurrent( hDC, tempContext ); - - IGetExtOpenGLInfo( devRec ); - - /// Reset everything back now - wglMakeCurrent( nil, nil ); - wglDeleteContext( tempContext ); - ReleaseDC( testWindow, hDC ); - } - - /// Resize window to hide what we're about to do - SetWindowPos( testWindow, nil, 0, 0, 1600, 1200, SWP_NOZORDER | SWP_NOMOVE ); - - /// Check for windowed screen mode (which SOMEBODY decided to test for - /// bitdepth of 0 instead of the caps flag we're setting....hmmmm wasn't me....) - if( !( driverInfo.DriverFlags & GLS_FLAGS_FULLSCREEN_ONLY ) ) - { - devMode.Clear(); - devMode.SetWidth( 0 ); - devMode.SetHeight( 0 ); - devMode.SetColorDepth( 0 ); - devRec.GetModes().Append( devMode ); - } - - /// Go get the screen modes - IGetOpenGLModes( devRec, driverInfo.aDriverDescription ); - - /// Get rid of the window now - DestroyWindow( testWindow ); - - /// Unload this driver now - glsUnloadDriver(); - } - - /// Restore old window position - SetWindowPlacement( (HWND)winRef, &oldWindowPlace ); -#endif -#endif -} - -//// IGetOpenGLModes ////////////////////////////////////////////////////////// -// Scans through all the possible imaginable combinations of screen modes, -// pixel formats whatnot and adds the final, culled-down list of graphics -// modes to the given device record. - -void hsG3DDeviceSelector::IGetOpenGLModes( hsG3DDeviceRecord &devRec, char *driverName ) -{ -#ifdef HS_OPEN_GL -#if HS_BUILD_FOR_WIN32 - int j; - int maxMode, mode; - int modeRes[ 6 ][ 3 ] = { { 640, 480, 16 }, { 800, 600, 16 }, { 1024, 768, 16 }, - { 1152, 864, 16 }, { 1280, 1024, 16 }, { 1600, 1200, 16 } }; - int bitDepths[ 3 ] = { 32, 24, 16 }, bitDepth; - hsG3DDeviceMode devMode; - DEVMODE modeInfo; - HWND testWindow = nil, testWindow2 = nil; - char str[ 128 ]; - - - /// Find the maximum resolution that we can support on this monitor--then - /// we'll start there and work down until we find a mode supported by OpenGL - modeInfo.dmSize = sizeof( modeInfo ); - maxMode = -1; - for( j = 0; EnumDisplaySettings( nil, j, &modeInfo ) != 0; j++ ) - { - for( mode = 0; mode < sizeof( modeRes ) / sizeof( modeRes[ 0 ] ); mode++ ) - { - if( modeRes[ mode ][ 0 ] == modeInfo.dmPelsWidth && - modeRes[ mode ][ 1 ] == modeInfo.dmPelsHeight ) - { - if( modeInfo.dmBitsPerPel > modeRes[ mode ][ 2 ] ) - modeRes[ mode ][ 2 ] = modeInfo.dmBitsPerPel; - - if( mode > maxMode ) - { - maxMode = mode; - break; - } - } - } - } - if( maxMode != -1 ) - { - /// Outer loop: loop through color depths - for( bitDepth = 0; bitDepth < 3; bitDepth++ ) - { - /// Loop through each of the display settings, starting at - /// the maxMode and going down, happily get pixel formats for each - modeInfo.dmSize = sizeof( modeInfo ); - modeInfo.dmFields = DM_PELSWIDTH | DM_PELSHEIGHT | DM_BITSPERPEL; - for( mode = maxMode; mode >= 0; mode-- ) - { - /// Does this resolution work at this bit depth? - if( modeRes[ mode ][ 2 ] < bitDepths[ bitDepth ] ) - continue; - - /// Attempt to set this screen mode - modeInfo.dmPelsWidth = modeRes[ mode ][ 0 ]; - modeInfo.dmPelsHeight = modeRes[ mode ][ 1 ]; - modeInfo.dmBitsPerPel = bitDepths[ bitDepth ]; - if( ChangeDisplaySettings( &modeInfo, CDS_FULLSCREEN ) == DISP_CHANGE_SUCCESSFUL ) - { - if( ITestOpenGLRes( modeRes[ mode ][ 0 ], modeRes[ mode ][ 1 ], - bitDepths[ bitDepth ], - devRec, driverName ) ) - { - /// Go and add the rest of 'em (we just assume that we can get - /// lower resolutions if we got this one) - for( mode--; mode >= 0; mode-- ) - { - devMode.SetWidth( modeRes[ mode ][ 0 ] ); - devMode.SetHeight( modeRes[ mode ][ 1 ] ); - devMode.SetColorDepth( bitDepths[ bitDepth ] ); - devRec.GetModes().Append( devMode ); - - sprintf( str, "ITryOpenGL(): Assuming mode: %dx%dx%dbpp, %s\n", - modeRes[ mode ][ 0 ], modeRes[ mode ][ 1 ], bitDepths[ bitDepth ], driverName ); - hsStatusMessage( str ); - } - } - } - } - } - - /// Note: this will also reset the screen after any mode changes from - /// creating our context - ChangeDisplaySettings( nil, 0 ); - - if( devRec.GetModes().GetCount() ) - fRecords.Append( devRec ); - } -#endif -#endif -} - -//// ITestOpenGLRes /////////////////////////////////////////////////////////// -// Tests all the possible OpenGL settings once the screen has been set -// to a given test resolution. - -hsBool hsG3DDeviceSelector::ITestOpenGLRes( int width, int height, int bitDepth, - hsG3DDeviceRecord &devRec, char *driverName ) -{ - hsBool retValue = false; - -#ifdef HS_OPEN_GL -#if HS_BUILD_FOR_WIN32 - int j, bitDepthFlags, myBitDepth; - hsG3DDeviceMode devMode; - char str[ 128 ]; - HDC hDC, hDC2; - HGLRC tempContext; - HWND testWindow = nil, testWindow2 = nil; - - PIXELFORMATDESCRIPTOR pfd; - - - /// Create test window #1 - testWindow = CreateWindowEx( WS_EX_APPWINDOW, fTempWinClass, "OpenGL Screen Test Window", - WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE, - 0, 0, width, height, - nil, nil, GetModuleHandle( nil ), 0 ); - hDC = GetDC( testWindow ); - - /// Loop through using DescribePixelFormat in an attempt to find all the - /// pixel formats we actually do support using this OpenGL driver - devMode.Clear(); - pfd.nSize = sizeof( pfd ); - bitDepthFlags = 0; - for( j = 1; retValue == false && DescribePixelFormat( hDC, j, sizeof( pfd ), &pfd ) != 0; j++ ) - { - /// Can we use this one? - if( pfd.cColorBits != bitDepth ) - continue; - - myBitDepth = ( pfd.cColorBits == 32 ) ? 0x04 : ( pfd.cColorBits == 24 ) ? 0x02 : 0x01; - - if( ( pfd.dwFlags & PFD_SUPPORT_OPENGL ) && - ( pfd.dwFlags & PFD_DRAW_TO_WINDOW ) && - ( pfd.dwFlags & PFD_DOUBLEBUFFER ) && - ( pfd.iPixelType == PFD_TYPE_RGBA ) && - ( pfd.iLayerType == PFD_MAIN_PLANE ) && - ( ( bitDepthFlags & myBitDepth ) == 0 ) ) - { - /// Looks like it! But is it REALLY? - testWindow2 = CreateWindowEx( WS_EX_APPWINDOW, fTempWinClass, "OpenGL Screen Test Window #2", - WS_POPUP | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_VISIBLE, - 0, 0, width, height, - nil, nil, GetModuleHandle( nil ), 0 ); - hDC2 = GetDC( testWindow2 ); - - if( SetPixelFormat( hDC2, j, &pfd ) ) - { - tempContext = wglCreateContext( hDC2 ); - if( tempContext != nil ) - { - if( wglMakeCurrent( hDC2, tempContext ) ) - { - /// Guess it really does work... - devMode.SetWidth( width ); - devMode.SetHeight( height ); - devMode.SetColorDepth( pfd.cColorBits ); - devRec.GetModes().Append( devMode ); - bitDepthFlags |= myBitDepth; - - sprintf( str, "ITryOpenGL(): Adding mode: %dx%dx%dbpp, %s\n", - width, height, pfd.cColorBits, driverName ); - hsStatusMessage( str ); - - wglMakeCurrent( nil, nil ); - retValue = true; /// Break us out - } - wglDeleteContext( tempContext ); - } - } - ReleaseDC( testWindow2, hDC2 ); - DestroyWindow( testWindow2 ); - } - } - ReleaseDC( testWindow, hDC ); - DestroyWindow( testWindow ); - -#endif -#endif - return retValue; -} - - -//// IGetExtOpenGLInfo //////////////////////////////////////////////////////// -// Gets extended info--i.e. info requiring an OpenGL context. Assumes the -// said context is already created and active. - -void hsG3DDeviceSelector::IGetExtOpenGLInfo( hsG3DDeviceRecord &devRec ) -{ -#ifdef HS_OPEN_GL -#if HS_BUILD_FOR_WIN32 - GLint numTMUs; - char *extString, *c, *c2; - char str[ 128 ]; - int j; - - - if( ( extString = (char *)glGetString( GL_RENDERER ) ) != nil ) - { - devRec.SetDeviceDesc( extString ); - - /// Can we guess at the amount of texture memory? - c = strstr( extString, "MB" ); - if( c != nil && c != extString && ( isdigit( *( c - 1 ) ) || isspace( *( c - 1 ) ) ) ) - { - /// Looks like we found a "xxMB" texture memory specification--use it - /// as our guess - c2 = c; - do { - c2--; - } while( c2 >= extString && ( isdigit( *c2 ) || isspace( *c2 ) ) ); - c2++; - - strncpy( str, c2, (UInt32)c - (UInt32)c2 ); - j = atoi( str ); - sprintf( str, "ITryOpenGL(): Device has %d MB texture memory\n", j ); - hsStatusMessage( str ); - - j *= 1024 * 1024; /// Translate to bytes - devRec.SetMemoryBytes( j ); - } - else - { - devRec.SetMemoryBytes( 4 * 1024 * 1024 ); - hsStatusMessage( "ITryOpenGL(): WARNING: Cannot determine texture memory for this card, assuming 4MB\n" ); - } - } - else - { - devRec.SetDeviceDesc( "" ); - devRec.SetMemoryBytes( 4 * 1024 * 1024 ); - hsStatusMessage( "ITryOpenGL(): WARNING: Cannot determine texture memory for this card, assuming 4MB\n" ); - } - - - if( ( extString = (char *)glGetString( GL_EXTENSIONS ) ) != nil ) - { - /// For the number of TMUs, we'll detect for the availability of the - /// multitexture extension--if it's there, we'll assume we have two TMUs - /// (if we don't, OpenGL will probably handle it for us--or rather, it BETTER). - if( strstr( extString, "ARB_multitexture" ) ) - devRec.SetLayersAtOnce( 2 ); - else - devRec.SetLayersAtOnce( 1 ); - - /// Can we use compressed textures? - if( strstr( extString, "ARB_texture_compression" ) ) - devRec.SetCap( kCapsCompressTextures ); - } - - /// Get TMU count - glGetIntegerv( GL_MAX_TEXTURE_UNITS_ARB, &numTMUs ); - if( numTMUs <= 0 ) - numTMUs = 0; - devRec.SetLayersAtOnce( numTMUs ); -#endif -#endif -} - -//// ICreateTempOpenGLContext ///////////////////////////////////////////////// -// Creates a temporary context for testing OpenGL stuff with. - -#ifdef HS_OPEN_GL -#if HS_BUILD_FOR_WIN32 - -UInt32 hsG3DDeviceSelector::ICreateTempOpenGLContext( HDC hDC, hsBool32 makeItFull ) -{ - DEVMODE modeInfo; - int pixFmt; - - - if( makeItFull ) - { - /// Attempt resolution change to 640x480x32bpp - memset( &modeInfo, 0, sizeof( modeInfo ) ); - modeInfo.dmSize = sizeof( modeInfo ); - modeInfo.dmBitsPerPel = 16; - modeInfo.dmPelsWidth = 640; - modeInfo.dmPelsHeight = 480; - if( ChangeDisplaySettings( &modeInfo, CDS_FULLSCREEN ) != DISP_CHANGE_SUCCESSFUL ) - { - return nil; /// We want fullscreen, can't get it, oops. - } - } - - /// Now try to set a pixel format - PIXELFORMATDESCRIPTOR pfd = { - sizeof(PIXELFORMATDESCRIPTOR), // size of this pfd - 1, // version number - PFD_DRAW_TO_WINDOW | // support window - PFD_SUPPORT_OPENGL | // support OpenGL - PFD_DOUBLEBUFFER, // double buffered - PFD_TYPE_RGBA, // RGBA type - 16, // 24-bit color depth - 0, 0, 0, 0, 0, 0, // color bits ignored - 0, // no alpha buffer - 0, // shift bit ignored - 0, // no accumulation buffer - 0, 0, 0, 0, // accum bits ignored - 0, // 32-bit z-buffer - 0, // no stencil buffer - 0, // no auxiliary buffer - PFD_MAIN_PLANE, // main layer - 0, // reserved - 0, 0, 0 // layer masks ignored - }; - - pixFmt = ChoosePixelFormat( hDC, &pfd ); - if( pixFmt > 0 && SetPixelFormat( hDC, pixFmt, &pfd ) ) - return (UInt32)wglCreateContext( hDC ); - - return 0; -} -#endif -#endif - /////////////////////////////////////////////////////////////////////////////// //// Fudging Routines ///////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////// @@ -1253,29 +560,12 @@ namespace enum { kDefaultChipset = 0x00, - kSavage4Chipset, - kATIRageFuryChipset, - kATIRageProChipset, - kNVidiaTNTChipset, - kNVidiaGeForceChipset, - kMatroxG400Chipset, kIntelI810Chipset, kSavage2000Chipset, kS3GenericChipset, - kATIGenericChipset, - kMatroxGenericChipset, - kKYROChipset, - k3dfxV5Chipset, - kSavage3DChipset, kATIRadeonChipset, - kATIR7X00Chipset, - kATIR7500Chipset, kATIR8X00Chipset, kMatroxParhelia, - kNVidiaGeForce2Chipset, - kNVidiaGeForce3Chipset, - kNVidiaGeForce4MXChipset, - kNVidiaGeForce4Chipset, kNVidiaGeForceFXChipset }; @@ -1291,8 +581,6 @@ namespace } FogTweakTable; FogTweakTable dsDefaultFogVals = { 0, 0, 254.0 / 255.0, 0.5f, 0.15f, 0.5f, 0.15f }; - FogTweakTable dsATIFogVals = { 0.1f, 0.1f, 254.0 / 255.0, 0.85f, 0.15f, 0.5f, 0.15f }; - FogTweakTable dsS3DFogVals = { 0, 0, 254.0 / 255.0, 1.0f, 1.0f, 1.0f, 1.0f }; FogTweakTable dsi810FogVals = { 0, 0, 254.0 / 255.0, 0.6f, 0.15f, 0.4f, 0.15f }; FogTweakTable dsRadeonFogVals = { 0, 0, 254.0 / 255.0, 0.7f, 0.15f, 0.5f, 0.2f }; @@ -1307,25 +595,10 @@ namespace FogTweakTable *fFogTweaks; } CFTable; - UInt32 dsSavageCapsClr[] = { - 4, // First integer is always the length - hsG3DDeviceSelector::kCapsCompressTextures, - hsG3DDeviceSelector::kCapsFogExp, - hsG3DDeviceSelector::kCapsFogExp2, - hsG3DDeviceSelector::kCapsDoesSmallTextures }; - - UInt32 dsSavageCapsSet[] = { + UInt32 dsGeForceFXCapsSet[] = { 1, // First integer is always the length - hsG3DDeviceSelector::kCapsBadYonStuff }; + hsG3DDeviceSelector::kCapsNoAA }; - UInt32 dsSavage2kCapsClr[] = { - 5, // First integer is always the length - hsG3DDeviceSelector::kCapsCompressTextures, - hsG3DDeviceSelector::kCapsPixelFog, - hsG3DDeviceSelector::kCapsFogExp, - hsG3DDeviceSelector::kCapsFogExp2, - hsG3DDeviceSelector::kCapsDoesSmallTextures }; - UInt32 dsS3GenerCapsClr[] = { 4, // First integer is always the length hsG3DDeviceSelector::kCapsCompressTextures, @@ -1333,59 +606,6 @@ namespace hsG3DDeviceSelector::kCapsFogExp2, hsG3DDeviceSelector::kCapsDoesSmallTextures }; - UInt32 dsATIFuryCapsClr[] = { - 3, // First integer is always the length - hsG3DDeviceSelector::kCapsFogExp, - hsG3DDeviceSelector::kCapsFogExp2, - hsG3DDeviceSelector::kCapsPixelFog }; - - UInt32 dsATIRageCapsClr[] = { - 4, // First integer is always the length - hsG3DDeviceSelector::kCapsFogExp, - hsG3DDeviceSelector::kCapsFogExp2, - hsG3DDeviceSelector::kCapsDoesSmallTextures, - hsG3DDeviceSelector::kCapsPixelFog }; - - UInt32 dsATIGenerCapsClr[] = { - 4, // First integer is always the length - hsG3DDeviceSelector::kCapsPixelFog, - hsG3DDeviceSelector::kCapsFogExp, - hsG3DDeviceSelector::kCapsFogExp2, - hsG3DDeviceSelector::kCapsDoesSmallTextures }; - - UInt32 dsATIRadeonCapsSet[] = { - 2, // First integer is always the length - hsG3DDeviceSelector::kCapsBadManaged, - hsG3DDeviceSelector::kCapsShareDepth - }; - - UInt32 dsATIRadeonCapsClr[] = { - 2, // First integer is always the length - hsG3DDeviceSelector::kCapsWBuffer, - hsG3DDeviceSelector::kCapsDoesSmallTextures }; - - UInt32 dsATIR7X00CapsSet[] = { - 4, // First integer is always the length - hsG3DDeviceSelector::kCapsCantShadow, - hsG3DDeviceSelector::kCapsBadManaged, - hsG3DDeviceSelector::kCapsShareDepth, - hsG3DDeviceSelector::kCapsNoAniso - }; - - UInt32 dsATIR7500CapsSet[] = { - 5, // First integer is always the length - hsG3DDeviceSelector::kCapsMaxUVWSrc2, - hsG3DDeviceSelector::kCapsCantShadow, - hsG3DDeviceSelector::kCapsBadManaged, - hsG3DDeviceSelector::kCapsShareDepth, - hsG3DDeviceSelector::kCapsNoAniso - }; - - UInt32 dsATIR7X00CapsClr[] = { - 2, // First integer is always the length - hsG3DDeviceSelector::kCapsWBuffer, - hsG3DDeviceSelector::kCapsDoesSmallTextures }; - UInt32 dsATIR8X00CapsSet[] = { 2, // First integer is always the length hsG3DDeviceSelector::kCapsBadManaged, @@ -1393,89 +613,19 @@ namespace }; UInt32 dsATIR8X00CapsClr[] = { - 2, // First integer is always the length - hsG3DDeviceSelector::kCapsWBuffer, - hsG3DDeviceSelector::kCapsDoesSmallTextures }; - - UInt32 dsTNTCapsClr[] = { - 1, // First integer is always the length + 1, // First integer is always the lengt hsG3DDeviceSelector::kCapsDoesSmallTextures }; UInt32 dsDefaultCapsClr[] = { 1, // First integer is always the length hsG3DDeviceSelector::kCapsDoesSmallTextures }; - UInt32 dsMG400CapsClr[] = { - 1, // First integer is always the length - hsG3DDeviceSelector::kCapsDoesSmallTextures }; - - UInt32 dsKYROCapsClr[] = { - 2, // First integer is always the length - hsG3DDeviceSelector::kCapsDoesSmallTextures, - hsG3DDeviceSelector::kCapsPixelFog }; - - UInt32 dsKYROCapsSet[] = { - 1, // First integer is always the length - hsG3DDeviceSelector::kCapsNoKindaSmallTexs }; - - UInt32 ds3dfxV5CapsClr[] = { - 2, // First integer is always the length - hsG3DDeviceSelector::kCapsFogExp, - hsG3DDeviceSelector::kCapsFogExp2 }; - - UInt32 dsMatroxParheliaSet[] = { - 1, - hsG3DDeviceSelector::kCapsNoAA }; - - UInt32 dsGeForceSet[] = { - 2, - hsG3DDeviceSelector::kCapsCantProj, - hsG3DDeviceSelector::kCapsDoubleFlush }; - - UInt32 dsGeForce2Set[] = { - 1, - hsG3DDeviceSelector::kCapsDoubleFlush }; - - UInt32 dsGeForce3Set[] = { - 1, - hsG3DDeviceSelector::kCapsSingleFlush }; - - UInt32 dsGeForce4MXSet[] = { - 1, - hsG3DDeviceSelector::kCapsSingleFlush }; - - UInt32 dsGeForce4Set[] = { - 1, - hsG3DDeviceSelector::kCapsSingleFlush - }; - CFTable dsCFTable[] = { // Chipset ID // F2Set // F2Clear // ZSuck // MaxLayers // LODBias // Fog Value Tables { kDefaultChipset, nil, dsDefaultCapsClr, 0, 0, 0, &dsDefaultFogVals }, - { kATIRageFuryChipset, nil, dsATIFuryCapsClr, 4.25f, 1, 0, &dsATIFogVals }, - { kATIRageProChipset, nil, dsATIRageCapsClr, 4.25f, 1, 0, &dsATIFogVals }, - { kATIGenericChipset, nil, dsATIGenerCapsClr, 4.25f, 1, 0, &dsATIFogVals }, - { kNVidiaTNTChipset, nil, dsTNTCapsClr, 0, 0, 0, &dsDefaultFogVals }, - { kNVidiaGeForce2Chipset,dsGeForce2Set, nil, 0, 0, 0, &dsDefaultFogVals }, - { kNVidiaGeForce3Chipset,dsGeForce3Set, nil, 0, 0, 0, &dsDefaultFogVals }, - { kNVidiaGeForce4MXChipset,dsGeForce4MXSet, nil, 0, 0, 0, &dsDefaultFogVals }, - { kNVidiaGeForce4Chipset,dsGeForce4Set, nil, 0, 0, 0, &dsDefaultFogVals }, - { kNVidiaGeForceChipset,dsGeForceSet, nil, 0, 0, 0, &dsDefaultFogVals }, { kNVidiaGeForceFXChipset,nil, nil, 0, 0, 0, &dsDefaultFogVals }, - { kMatroxG400Chipset, nil, dsMG400CapsClr, 3.25f, 0, 0, &dsDefaultFogVals }, - { kMatroxParhelia, dsMatroxParheliaSet,nil, 0, 0, 0, &dsDefaultFogVals }, - { kMatroxGenericChipset,nil, dsMG400CapsClr, 3.25f, 0, 0, &dsDefaultFogVals }, - { kIntelI810Chipset, nil, dsDefaultCapsClr, 4.5f, 1, -0.5f, &dsi810FogVals }, - { kSavage4Chipset, dsSavageCapsSet, dsSavageCapsClr, 4.0f, 1, 0, &dsDefaultFogVals }, // LOD bias should be -0.5 here - { kSavage2000Chipset, dsSavageCapsSet, dsSavage2kCapsClr, 4.0f, 1, 0, &dsDefaultFogVals }, - { kS3GenericChipset, dsSavageCapsSet, dsS3GenerCapsClr, 4.0f, 1, 0, &dsDefaultFogVals }, - { kKYROChipset, dsKYROCapsSet, dsKYROCapsClr, -151.0f, 1, 0, &dsDefaultFogVals }, - { k3dfxV5Chipset, nil, ds3dfxV5CapsClr, 3.5f, 0, 0, &dsDefaultFogVals }, - { kSavage3DChipset, nil, dsDefaultCapsClr, 0, 0, 0, &dsS3DFogVals }, - { kATIRadeonChipset, dsATIRadeonCapsSet, dsATIRadeonCapsClr, 0, 0, 0, &dsRadeonFogVals }, - { kATIR7X00Chipset, dsATIR7X00CapsSet, dsATIR7X00CapsClr, 3.f, 2, 0, &dsRadeonFogVals }, - { kATIR7500Chipset, dsATIR7500CapsSet, dsATIR7X00CapsClr, 3.f, 2, 0, &dsRadeonFogVals }, + { kIntelI810Chipset, nil, dsDefaultCapsClr, 4.5f, 1, -0.5f, &dsi810FogVals }, { kATIR8X00Chipset, dsATIR8X00CapsSet, dsATIR8X00CapsClr, 0, 0, 0, &dsRadeonFogVals }, }; @@ -1496,7 +646,7 @@ void hsG3DDeviceSelector::IFudgeDirectXDevice( hsG3DDeviceRecord &record, /// Send it off to each D3D device, respectively - if( record.GetG3DDeviceType() == kDevTypeDirect3DTnL ) + if( record.GetG3DDeviceType() == kDevTypeDirect3D ) { if( !IGetD3DCardInfo( record, driverInfo, deviceInfo, &vendorID, &deviceID, &szDriver, &szDesc ) ) { @@ -1504,16 +654,6 @@ void hsG3DDeviceSelector::IFudgeDirectXDevice( hsG3DDeviceRecord &record, hsAssert( false, "Trying to fudge D3D device but D3D support isn't in this EXE!" ); } } -#ifdef HS_SELECT_DX7 - else if( record.GetG3DDeviceType() == kDevTypeDirect3D ) - { - if( !IGetD3D7CardInfo( record, driverInfo, deviceInfo, &vendorID, &deviceID, &szDriver, &szDesc ) ) - { - // {} to make VC6 happy in release build - hsAssert( false, "Trying to fudge D3D7 device but D3D7 support isn't in this EXE!" ); - } - } -#endif // HS_SELECT_DX7 else { hsAssert( false, "IFudgeDirectXDevice got a device type that support wasn't compiled for!" ); @@ -1523,110 +663,28 @@ void hsG3DDeviceSelector::IFudgeDirectXDevice( hsG3DDeviceRecord &record, hsAssert( strlen( szDesc ) < sizeof( desc ), "D3D device description longer than expected!" ); hsStrcpy( desc, szDesc ); hsStrLower( desc ); - - //// S3-based Cards /////////////////////////////////////////////////////// - /// Detect Savage 4 chipset - if( deviceID == 0x00008a22 || stricmp( szDriver, "s3savg4.dll" ) == 0 || - ( strstr( desc, "diamond" ) != nil && strstr( desc, "stealth iii" ) != nil ) || - strstr( desc, "savage4 " ) != nil ) - { - /// Yup, Savage 4. - hsStatusMessage( "== Using fudge factors for a Savage 4 chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for a Savage 4 chipset" ); - ISetFudgeFactors( kSavage4Chipset, record ); - } - /// Detect Savage 2000 chipset - else if( deviceID == 0x00009102 || - stricmp( szDriver, "s3sav2k.dll" ) == 0 || - ( strstr( desc, "diamond" ) != nil && - strstr( desc, "viperii" ) != nil ) || - strstr( desc, "savage2000 " ) != nil ) - { - /// Yup, Savage 2000. - hsStatusMessage( "== Using fudge factors for a Savage 2000 chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for a Savage 2000 chipset" ); - ISetFudgeFactors( kSavage2000Chipset, record ); - } - /// Detect Savage3D chipset - else if( deviceID == 0x00008a20 || - stricmp( szDriver, "s3_6.dll" ) == 0 || - strstr( desc, "savage3d" ) != nil ) - { - /// Yup, Savage3D. - hsStatusMessage( "== Using fudge factors for a Savage3D chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for a Savage3D chipset" ); - ISetFudgeFactors( kSavage3DChipset, record ); - } - /// Detect Generic S3 chipset - else if( ( strncmp( szDriver, "s3", 2 ) == 0 ) || ( strstr( desc, "savage" ) != nil ) ) - { - /// Yup, Generic S3. - hsStatusMessage( "== Using fudge factors for a generic S3 chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for a generic S3 chipset" ); - ISetFudgeFactors( kS3GenericChipset, record ); - } - //// ATI-based Cards ////////////////////////////////////////////////////// - /// Detect ATI Rage 128 Pro chipset - else if( ( deviceID == 0x00005046 && // Normal ATI Rage 128 Pro detection - ( stricmp( szDriver, "ati2dvaa.dll" ) == 0 - || strstr( desc, "rage 128 pro" ) != nil ) ) || - ( deviceID == 0x00005246 && // ATI All-in-wonder--same chipset, diff values - ( stricmp( szDriver, "ati3draa.dll" ) == 0 - || strstr( desc, "all-in-wonder 128" ) != nil ) ) ) - { - hsStatusMessage( "== Using fudge factors for an ATI Rage 128 Pro chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for an ATI Rage 128 Pro chipset" ); - ISetFudgeFactors( kATIRageProChipset, record ); - } - /// Detect(detest?) ATI Rage FURY MAXX chipset - else if( deviceID == 0x00005046 && - ( stricmp( szDriver, "ati3drau.dll" ) == 0 - || strstr( desc, "rage fury" ) != nil ) ) - { - hsStatusMessage( "== Using fudge factors for an ATI Rage Fury MAXX chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for an ATI Rage Fury MAXX chipset" ); - ISetFudgeFactors( kATIRageFuryChipset, record ); - } /// Detect ATI Radeon chipset // We will probably need to differentiate between different Radeons at some point in // the future, but not now. - else if( // deviceID == 0x00005144 && - ( stricmp( szDriver, "ati2dvag.dll" ) == 0 - || strstr( desc, "radeon" ) != nil ) ) + if(stricmp( szDriver, "ati2dvag.dll" ) == 0 || strstr( desc, "radeon" ) != nil) { int series = 0; const char* str = strstr(desc, "radeon"); if( str ) str += strlen("radeon"); - else - { - str = strstr(desc, "all-in-wonder"); - if( str ) - str += strlen("all-in-wonder"); - } if( str ) { if( 1 == sscanf(str, "%d", &series) ) { - if( (series == 7500) || (series == 7200) ) - { - hsStatusMessage( "== Using fudge factors for ATI Radeon 7200/7500 chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for ATI Radeon 7200/7500 chipset" ); - ISetFudgeFactors( kATIR7500Chipset, record ); - } - else - if( (series >= 7000) && (series < 8000) ) - { - hsStatusMessage( "== Using fudge factors for ATI Radeon 7X00 chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for ATI Radeon 7X00 chipset" ); - ISetFudgeFactors( kATIR7X00Chipset, record ); - } - else if( (series >= 8000) && (series < 9000) ) { hsStatusMessage( "== Using fudge factors for ATI Radeon 8X00 chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for ATI Radeon 8X00 chipset" ); + ISetFudgeFactors( kATIR8X00Chipset, record ); + } + else if (( series >= 9000)) + { + hsStatusMessage( "== Using fudge factors for ATI Radeon 9X00 chipset ==\n" ); ISetFudgeFactors( kATIR8X00Chipset, record ); } else @@ -1637,162 +695,35 @@ void hsG3DDeviceSelector::IFudgeDirectXDevice( hsG3DDeviceRecord &record, else { series = 0; - - // Skip white space - while( *str && (*str <= 0x32) ) - str++; - - // I've still never seen either of these, so I'm just going by ATI's site. - // Don't have the option of using device-id's. - if( (str[0] == 'v') && (str[1] == 'e') ) - { - // Got an alias here. If it's an All-in-Wonder VE, it's really a 7500. - // If it's a Radeon VE, it's really a 7000. - if( strstr(desc, "radeon") ) - series = 7000; - else if( strstr(desc, "all-in-wonder") ) - series = 7500; - } } } - if( !series ) + if(series == 0) { - hsStatusMessage( "== Using fudge factors for ATI Radeon chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for ATI Radeon chipset" ); - ISetFudgeFactors( kATIRadeonChipset, record ); + hsStatusMessage( "== Using fudge factors for ATI/AMD Radeon X/HD/R chipset ==\n" ); + ISetFudgeFactors( kDefaultChipset, record ); } } - /// Detect generic ATI chipset - else if( ( strncmp( szDriver, "ati", 3 ) == 0 ) || ( strstr( desc, "ati " ) != nil ) ) - { - hsStatusMessage( "== Using fudge factors for a generic ATI chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for a generic ATI chipset" ); - ISetFudgeFactors( kATIGenericChipset, record ); - } - - //// Matrox-based Cards /////////////////////////////////////////////////// - else if( (deviceID == 0x527) - || strstr(desc, "parhelia") ) - { - hsStatusMessage( "== Using fudge factors for a Matrox Parhelia chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for a Matrox Millenium G400 chipset" ); - ISetFudgeFactors( kMatroxParhelia, record ); - } - /// Detect Matrox G400 chipset - else if( deviceID == 0x00000525 && - ( stricmp( szDriver, "g400d.dll" ) == 0 - || ( strstr( desc, "matrox" ) != nil && strstr( desc, "g400" ) != nil ) ) ) - { - hsStatusMessage( "== Using fudge factors for a Matrox Millenium G400 chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for a Matrox Millenium G400 chipset" ); - ISetFudgeFactors( kMatroxG400Chipset, record ); - } - /// Detect generic Matrox chipset - else if( strstr( desc, "matrox" ) != nil ) - { - hsStatusMessage( "== Using fudge factors for a generic Matrox chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for a generic Matrox chipset" ); - ISetFudgeFactors( kMatroxGenericChipset, record ); - } //// Other Cards ////////////////////////////////////////////////////////// - /// Detect NVidia RIVA TNT chipset - else if( deviceID == 0x00000020 && - ( stricmp( szDriver, "nvdd32.dll" ) == 0 - || strstr( desc, "nvidia riva tnt" ) != nil ) ) - { - hsStatusMessage( "== Using fudge factors for an NVidia RIVA TNT chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for an NVidia RIVA TNT chipset" ); - ISetFudgeFactors( kNVidiaTNTChipset, record ); - if( record.GetMemoryBytes() < 16 * 1024 * 1024 ) - { - hsStatusMessage( "== (also fudging memory up to 16MB) ==\n" ); - plDemoDebugFile::Write( " (also fudging memory up to 16MB)" ); - record.SetMemoryBytes( 16 * 1024 * 1024 ); - } - } /// Detect Intel i810 chipset else if( deviceID == 0x00007125 && ( stricmp( szDriver, "i81xdd.dll" ) == 0 || ( strstr( desc, "intel" ) != nil && strstr( desc, "810" ) != nil ) ) ) { hsStatusMessage( "== Using fudge factors for an Intel i810 chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for an Intel i810 chipset" ); ISetFudgeFactors( kIntelI810Chipset, record ); } - /// Detect STMicroelectronics KYRO chipset - else if( deviceID == 0x00000010 && ( strstr( desc, "kyro" ) != nil ) ) - { - hsStatusMessage( "== Using fudge factors for a KYRO chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for a KYRO chipset" ); - ISetFudgeFactors( kKYROChipset, record ); - } - /// Detect for a 3dfx Voodoo5 - else if( vendorID == 0x121a && deviceID == 0x00000009 && - stricmp( szDriver, "3dfxvs.dll" ) == 0 ) - { - hsStatusMessage( "== Using fudge factors for a 3dfx Voodoo5 chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for a 3dfx Voodoo5 chipset" ); - ISetFudgeFactors( k3dfxV5Chipset, record ); - } - /// Detect for a GeForce-class card. We can be loose here because we want - /// to get ALL GeForce/2/256 cards - else if( strstr( desc, "nvidia" ) != nil && strstr( desc, "geforce2" ) != nil ) - { - hsStatusMessage( "== Using fudge factors for an NVidia GeForce2-based chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for an NVidia GeForce2-based chipset" ); - ISetFudgeFactors( kNVidiaGeForce2Chipset, record ); - } - else if( strstr( desc, "nvidia" ) != nil && strstr( desc, "geforce3" ) != nil ) - { - hsStatusMessage( "== Using fudge factors for an NVidia GeForce3-based chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for an NVidia GeForce3-based chipset" ); - ISetFudgeFactors( kNVidiaGeForce3Chipset, record ); - } - else if( strstr( desc, "nvidia" ) != nil && strstr( desc, "geforce4 mx" ) != nil ) - { - hsStatusMessage( "== Using fudge factors for an NVidia GeForce4MX-based chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for an NVidia GeForce4MX-based chipset" ); - ISetFudgeFactors( kNVidiaGeForce4MXChipset, record ); - } - else if( strstr( desc, "nvidia" ) != nil && strstr( desc, "geforce4" ) != nil ) - { - hsStatusMessage( "== Using fudge factors for an NVidia GeForce4-based chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for an NVidia GeForce4-based chipset" ); - ISetFudgeFactors( kNVidiaGeForce4Chipset, record ); - } - else if( - strstr( desc, "nvidia" ) && strstr( desc, "geforce" ) - && ( - (deviceID == 0x101) - ||(deviceID == 0x100) - ||strstr(desc, "256") - ) - ) - { - hsStatusMessage( "== Using fudge factors for an NVidia GeForce-based chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for an NVidia GeForce-based chipset" ); - ISetFudgeFactors( kNVidiaGeForceChipset, record ); - } - else if( strstr( desc, "nvidia" ) != nil && strstr( desc, "geforce" ) != nil ) + /// Detect for a GeForc FX card. We only need to nerf the really low end one. + else if( strstr( desc, "nvidia" ) != nil && strstr( desc, "geforce fx 5200" ) != nil ) { hsStatusMessage( "== Using fudge factors for an NVidia GeForceFX-based chipset ==\n" ); - plDemoDebugFile::Write( " Using fudge factors for an NVidia GeForceFX-based chipset" ); ISetFudgeFactors( kNVidiaGeForceFXChipset, record ); } - /// Detect for a TNT-based card and force it to >= 16MB memory, so we always use it - else if( strstr( desc, "tnt" ) != nil && record.GetMemoryBytes() < 16 * 1024 * 1024 ) - { - hsStatusMessage( "== NVidia TNT-based card detected. Fudging memory reading to 16MB ==\n" ); - plDemoDebugFile::Write( " NVidia TNT-based card detected. Fudging memory reading to 16MB" ); - record.SetMemoryBytes( 16 * 1024 * 1024 ); - } /// Default fudge values else { hsStatusMessage( "== Using default fudge factors ==\n" ); - plDemoDebugFile::Write( " Using default fudge factors" ); ISetFudgeFactors( kDefaultChipset, record ); } } @@ -1860,125 +791,3 @@ void hsG3DDeviceSelector::ISetFudgeFactors( UInt8 chipsetID, hsG3DDeviceRecord & } } - - -/////////////////////////////////////////////////////////////////////////////// -// -// Demo Debug File functions -// Created 10.10.2000 by Mathew Burrack @ Cyan, Inc. -// Modified 10.11 mcn to conform (more) to coding standards. -// -/////////////////////////////////////////////////////////////////////////////// - -//// Local Globals //////////////////////////////////////////////////////////// - -#if M3DDEMOINFO // Demo Debug Build -static plDemoDebugFile sMyDDFWriter; - -hsBool plDemoDebugFile::fIsOpen = false; -FILE *plDemoDebugFile::fDemoDebugFP = nil; -hsBool plDemoDebugFile::fEnabled = false; -#endif - - -//// IDDFOpen ///////////////////////////////////////////////////////////////// -// Internal function--opens the demo debug file for writing. Returns true -// if successful, false otherwise. - -hsBool plDemoDebugFile::IDDFOpen( void ) -{ -#if M3DDEMOINFO // Demo Debug Build - char fileName[] = "log/debug_info.dat"; - time_t currTime; - struct tm *localTime; - char timeString[ 27 ]; // see definition of asctime() - char *c; - - - /// Don't open if we're not enabled - if( !fEnabled ) - return false; - - /// Open the file - if( fDemoDebugFP == nil ) - fDemoDebugFP = fopen( fileName, "wt" ); - - if( fDemoDebugFP == nil ) - return( fIsOpen = false ); - - /// Write out a header line - time( &currTime ); - localTime = localtime( &currTime ); - - // Note: asctime includes a carriage return. Gotta strip... - strcpy( timeString, asctime( localTime ) ); - c = strchr( timeString, '\n' ); - if( c != nil ) - *c = 0; - - fprintf( fDemoDebugFP, "\n--- Demo Debug Info File (Created %s) ---\n", timeString ); - - /// All done! - return( fIsOpen = true ); -#else - return false; -#endif -} - -//// IDDFClose //////////////////////////////////////////////////////////////// -// "Whatcha gonna do when the lightning strikes and hits you...." -// -- "Lightning Strikes", Yes, 1999 - - -void plDemoDebugFile::IDDFClose( void ) -{ -#if M3DDEMOINFO // Demo Debug Build - if( fDemoDebugFP != nil ) - { - // Write an exit line (fun fun) - fputs( "--- End of Demo Debug Info File ---\n\n", fDemoDebugFP ); - - // Close - fclose( fDemoDebugFP ); - } - - fIsOpen = false; -#endif -} - -//// Write //////////////////////////////////////////////////////////////////// -// Writes a string to the DDF. If the DDF isn't open, opens it. - -void plDemoDebugFile::Write( char *string ) -{ -#if M3DDEMOINFO // Demo Debug Build - if( !fIsOpen ) - IDDFOpen(); - - if( fIsOpen ) - fprintf( fDemoDebugFP, "%s\n", string ); -#endif -} - -void plDemoDebugFile::Write( char *string1, char *string2 ) -{ -#if M3DDEMOINFO // Demo Debug Build - if( !fIsOpen ) - IDDFOpen(); - - if( fIsOpen ) - fprintf( fDemoDebugFP, "%s: %s\n", string1, string2 ); -#endif -} - -void plDemoDebugFile::Write( char *string1, Int32 value ) -{ -#if M3DDEMOINFO // Demo Debug Build - if( !fIsOpen ) - IDDFOpen(); - - if( fIsOpen ) - fprintf( fDemoDebugFP, "%s: %d (0x%x)\n", string1, value, value ); -#endif -} - diff --git a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h b/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h index dd5a63ea..1e34a1a6 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/hsG3DDeviceSelector.h +++ b/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 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& 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 -#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 diff --git a/Sources/Plasma/PubUtilLib/plPipeline/hsGDDrawDllLoad.cpp b/Sources/Plasma/PubUtilLib/plPipeline/hsGDDrawDllLoad.cpp deleted file mode 100644 index 1b468b7e..00000000 --- a/Sources/Plasma/PubUtilLib/plPipeline/hsGDDrawDllLoad.cpp +++ /dev/null @@ -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 . - -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 - -#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; -} \ No newline at end of file diff --git a/Sources/Plasma/PubUtilLib/plPipeline/hsGDDrawDllLoad.h b/Sources/Plasma/PubUtilLib/plPipeline/hsGDDrawDllLoad.h deleted file mode 100644 index ed33f7a8..00000000 --- a/Sources/Plasma/PubUtilLib/plPipeline/hsGDDrawDllLoad.h +++ /dev/null @@ -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 . - -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 diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plDXEnumerate.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plDXEnumerate.cpp index 25b6b008..73eaa4b2 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plDXEnumerate.cpp +++ b/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 - -#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 ); diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp index 2b67c678..61ff1e9a 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.cpp +++ b/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 -#include #include #include @@ -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(); diff --git a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.h b/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.h index 71d75637..8c2d2a1f 100644 --- a/Sources/Plasma/PubUtilLib/plPipeline/plDXPipeline.h +++ b/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,