diff --git a/Generals/Code/GameEngine/Include/Common/GameLOD.h b/Generals/Code/GameEngine/Include/Common/GameLOD.h index 61d13e3d7e..520dc648e2 100644 --- a/Generals/Code/GameEngine/Include/Common/GameLOD.h +++ b/Generals/Code/GameEngine/Include/Common/GameLOD.h @@ -176,8 +176,6 @@ class GameLODManager Bool setDynamicLODLevel(DynamicGameLODLevel level); ///< set the current dynamic LOD level. DynamicGameLODLevel getDynamicLODLevel(void) { return m_currentDynamicLOD;} void init(void); ///m_useShadowVolumes=lodInfo->m_useShadowVolumes; TheWritableGlobalData->m_useShadowDecals=lodInfo->m_useShadowDecals; - //Check if texture resolution changed. No need to apply when current is unknown because display will do it - if (requestedTextureReduction != m_currentTextureReduction) - { - TheWritableGlobalData->m_textureReductionFactor = requestedTextureReduction; - if (TheGameClient) - TheGameClient->adjustLOD(0); //apply the new setting stored in globaldata - } + TheWritableGlobalData->m_textureReductionFactor = requestedTextureReduction; //Check if shadow state changed if (m_currentStaticLOD == STATIC_GAME_LOD_UNKNOWN || @@ -623,9 +616,12 @@ void GameLODManager::applyStaticLODLevel(StaticGameLODLevel level) TheWritableGlobalData->m_shellMapOn = false; } } + if (TheTerrainVisual) TheTerrainVisual->setTerrainTracksDetail(); + if (TheGameClient) + TheGameClient->setTextureLOD(requestedTextureReduction); } /**Parse a description of all the LOD settings for a given detail level*/ diff --git a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index 1f6d2f8bf5..94395c0055 100644 --- a/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -75,6 +75,8 @@ //used to access a messagebox that does "ok" and "cancel" #include "GameClient/MessageBox.h" +#include "ww3d.h" + // This is for non-RC builds only!!! #define VERBOSE_VERSION L"Release" @@ -1112,18 +1114,14 @@ static void saveOptions( void ) //------------------------------------------------------------------------------------------------- // Texture resolution slider { - AsciiString prefString; - - val = GadgetSliderGetPosition(sliderTextureResolution); - val = 2-val; + val = 2 - GadgetSliderGetPosition(sliderTextureResolution); + AsciiString prefString; prefString.format("%d",val); (*pref)["TextureReduction"] = prefString; - if (TheGlobalData->m_textureReductionFactor != val) - { - TheGameClient->adjustLOD(val-TheGlobalData->m_textureReductionFactor); //apply the new setting - } + TheWritableGlobalData->m_textureReductionFactor = val; + TheGameClient->setTextureLOD(val); } TheWritableGlobalData->m_useShadowVolumes = GadgetCheckBoxIsChecked( check3DShadows ); @@ -1855,10 +1853,9 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) TheGameLODManager->setStaticLODLevel(TheGameLODManager->getRecommendedStaticLODLevel()); } - Int txtFact=TheGameLODManager->getCurrentTextureReduction(); GadgetComboBoxSetSelectedPos(comboBoxDetail, (Int)TheGameLODManager->getStaticLODLevel()); - GadgetSliderSetPosition( sliderTextureResolution, 2-txtFact); + GadgetSliderSetPosition( sliderTextureResolution, 2-WW3D::Get_Texture_Reduction()); GadgetCheckBoxSetChecked( check3DShadows, TheGlobalData->m_useShadowVolumes); diff --git a/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp index fd5f717b72..37241be0b2 100644 --- a/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp +++ b/Generals/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp @@ -88,6 +88,7 @@ #include "GameNetwork/GameSpyOverlay.h" #include "GameNetwork/GameSpy/BuddyThread.h" +#include "ww3d.h" #if defined(RTS_DEBUG) @@ -3785,7 +3786,8 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage //----------------------------------------------------------------------------------------- case GameMessage::MSG_META_DEMO_LOD_DECREASE: { - TheGameClient->adjustLOD(-1); + const Int level = clamp(0, WW3D::Get_Texture_Reduction() - 1, 4); + TheGameClient->setTextureLOD(level); TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:DebugDecreaseLOD", L"Decrease LOD") ); disp = DESTROY_MESSAGE; break; @@ -3795,7 +3797,8 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage //----------------------------------------------------------------------------------------- case GameMessage::MSG_META_DEMO_LOD_INCREASE: { - TheGameClient->adjustLOD(1); + const Int level = clamp(0, WW3D::Get_Texture_Reduction() + 1, 4); + TheGameClient->setTextureLOD(level); TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:DebugIncreaseLOD", L"Increase LOD") ); disp = DESTROY_MESSAGE; break; diff --git a/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameClient.h b/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameClient.h index f7bdb9e4a2..848dbd7198 100644 --- a/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameClient.h +++ b/Generals/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameClient.h @@ -88,7 +88,7 @@ class W3DGameClient : public GameClient //--------------------------------------------------------------------------- virtual void setTeamColor( Int red, Int green, Int blue ); ///< @todo superhack for demo, remove!!! - virtual void adjustLOD( Int adj ); ///< @todo hack for evaluation, remove. + virtual void setTextureLOD( Int level ); protected: diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/TerrainTex.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/TerrainTex.cpp index 76de020a9e..91c0d47eea 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/TerrainTex.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/TerrainTex.cpp @@ -187,8 +187,8 @@ int TerrainTextureClass::update(WorldHeightMap *htMap) surface_level->UnlockRect(); surface_level->Release(); DX8_ErrorCode(D3DXFilterTexture(Peek_D3D_Texture(), NULL, 0, D3DX_FILTER_BOX)); - if (TheWritableGlobalData->m_textureReductionFactor) { - Peek_D3D_Texture()->SetLOD(TheWritableGlobalData->m_textureReductionFactor); + if (WW3D::Get_Texture_Reduction()) { + Peek_D3D_Texture()->SetLOD(WW3D::Get_Texture_Reduction()); } return(surface_desc.Height); } diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp index 1c64f1e530..e6209f3ef5 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp @@ -745,14 +745,10 @@ void W3DDisplay::init( void ) TheGameLODManager->setStaticLODLevel(TheGameLODManager->getRecommendedStaticLODLevel()); } else - { //Static LOD level was applied during GameLOD manager init except for texture reduction + { + //Static LOD level was applied during GameLOD manager init except for texture reduction //which needs to be applied here. - Int txtReduction=TheWritableGlobalData->m_textureReductionFactor; - if (txtReduction > 0) - { WW3D::Set_Texture_Reduction(txtReduction,6); - //Tell LOD manager that texture reduction was applied. - TheGameLODManager->setCurrentTextureReduction(txtReduction); - } + TheGameClient->setTextureLOD(TheWritableGlobalData->m_textureReductionFactor); } if (TheGlobalData->m_displayGamma != 1.0f) diff --git a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DGameClient.cpp b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DGameClient.cpp index c8ca17e7ed..11f6372e14 100644 --- a/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DGameClient.cpp +++ b/Generals/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DGameClient.cpp @@ -196,29 +196,16 @@ void W3DGameClient::setTeamColor(Int red, Int green, Int blue) } //------------------------------------------------------------------------------------------------- -/** temporary entry point for adjusting LOD for development testing. */ //------------------------------------------------------------------------------------------------- -void W3DGameClient::adjustLOD( Int adj ) +void W3DGameClient::setTextureLOD( Int level ) { - if (TheGlobalData == NULL) - return; - - TheWritableGlobalData->m_textureReductionFactor += adj; - - if (TheWritableGlobalData->m_textureReductionFactor > 4) - TheWritableGlobalData->m_textureReductionFactor = 4; //16x less resolution is probably enough. - if (TheWritableGlobalData->m_textureReductionFactor < 0) - TheWritableGlobalData->m_textureReductionFactor = 0; + if (WW3D::Get_Texture_Reduction() != level) + { + WW3D::Set_Texture_Reduction(level, 6); - if (WW3D::Get_Texture_Reduction() != TheWritableGlobalData->m_textureReductionFactor) - { WW3D::Set_Texture_Reduction(TheWritableGlobalData->m_textureReductionFactor,6); - TheGameLODManager->setCurrentTextureReduction(TheWritableGlobalData->m_textureReductionFactor); + //I commented this out because we're no longer using terrain LOD. So I + //stole this function and keys to adjust the texture resolution instead. -MW + //if( TheTerrainRenderObject ) + // TheTerrainRenderObject->setTextureLOD(level); } - -//I commented this out because we're no longer using terrain LOD. So I -//stole this function and keys to adjust the texture resolution instead. -MW - -// if( TheTerrainRenderObject ) -// TheTerrainRenderObject->adjustTerrainLOD( adj ); - } diff --git a/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h b/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h index e9ddaa78dd..7b3b206f3e 100644 --- a/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h +++ b/GeneralsMD/Code/GameEngine/Include/Common/GameLOD.h @@ -177,8 +177,6 @@ class GameLODManager Bool setDynamicLODLevel(DynamicGameLODLevel level); ///< set the current dynamic LOD level. DynamicGameLODLevel getDynamicLODLevel(void) { return m_currentDynamicLOD;} void init(void); ///m_useShadowVolumes=lodInfo->m_useShadowVolumes; TheWritableGlobalData->m_useShadowDecals=lodInfo->m_useShadowDecals; - //Check if texture resolution changed. No need to apply when current is unknown because display will do it - if (requestedTextureReduction != m_currentTextureReduction) - { - TheWritableGlobalData->m_textureReductionFactor = requestedTextureReduction; - if (TheGameClient) - TheGameClient->adjustLOD(0); //apply the new setting stored in globaldata - } + TheWritableGlobalData->m_textureReductionFactor = requestedTextureReduction; //Check if shadow state changed if (m_currentStaticLOD == STATIC_GAME_LOD_UNKNOWN || @@ -629,9 +622,12 @@ void GameLODManager::applyStaticLODLevel(StaticGameLODLevel level) TheWritableGlobalData->m_shellMapOn = false; } } + if (TheTerrainVisual) TheTerrainVisual->setTerrainTracksDetail(); + if (TheGameClient) + TheGameClient->setTextureLOD(requestedTextureReduction); } /**Parse a description of all the LOD settings for a given detail level*/ diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp index ab379e892d..ae99c6735d 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/GUI/GUICallbacks/Menus/OptionsMenu.cpp @@ -75,6 +75,8 @@ //used to access a messagebox that does "ok" and "cancel" #include "GameClient/MessageBox.h" +#include "ww3d.h" + // This is for non-RC builds only!!! #define VERBOSE_VERSION L"Release" @@ -1163,18 +1165,14 @@ static void saveOptions( void ) //------------------------------------------------------------------------------------------------- // Texture resolution slider { - AsciiString prefString; - - val = GadgetSliderGetPosition(sliderTextureResolution); - val = 2-val; + val = 2 - GadgetSliderGetPosition(sliderTextureResolution); + AsciiString prefString; prefString.format("%d",val); (*pref)["TextureReduction"] = prefString; - if (TheGlobalData->m_textureReductionFactor != val) - { - TheGameClient->adjustLOD(val-TheGlobalData->m_textureReductionFactor); //apply the new setting - } + TheWritableGlobalData->m_textureReductionFactor = val; + TheGameClient->setTextureLOD(val); } TheWritableGlobalData->m_useShadowVolumes = GadgetCheckBoxIsChecked( check3DShadows ); @@ -1922,10 +1920,9 @@ void OptionsMenuInit( WindowLayout *layout, void *userData ) TheGameLODManager->setStaticLODLevel(TheGameLODManager->getRecommendedStaticLODLevel()); } - Int txtFact=TheGameLODManager->getCurrentTextureReduction(); GadgetComboBoxSetSelectedPos(comboBoxDetail, (Int)TheGameLODManager->getStaticLODLevel()); - GadgetSliderSetPosition( sliderTextureResolution, 2-txtFact); + GadgetSliderSetPosition( sliderTextureResolution, 2-WW3D::Get_Texture_Reduction()); GadgetCheckBoxSetChecked( check3DShadows, TheGlobalData->m_useShadowVolumes); diff --git a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp index a6f96ca201..7dd70033b9 100644 --- a/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp +++ b/GeneralsMD/Code/GameEngine/Source/GameClient/MessageStream/CommandXlat.cpp @@ -88,7 +88,7 @@ #include "GameNetwork/GameSpyOverlay.h" #include "GameNetwork/GameSpy/BuddyThread.h" - +#include "ww3d.h" #define dont_ALLOW_ALT_F4 @@ -4179,7 +4179,8 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage //----------------------------------------------------------------------------------------- case GameMessage::MSG_META_DEMO_LOD_DECREASE: { - TheGameClient->adjustLOD(-1); + const Int level = clamp(0, WW3D::Get_Texture_Reduction() - 1, 4); + TheGameClient->setTextureLOD(level); TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:DebugDecreaseLOD", L"Decrease LOD") ); disp = DESTROY_MESSAGE; break; @@ -4189,7 +4190,8 @@ GameMessageDisposition CommandTranslator::translateGameMessage(const GameMessage //----------------------------------------------------------------------------------------- case GameMessage::MSG_META_DEMO_LOD_INCREASE: { - TheGameClient->adjustLOD(1); + const Int level = clamp(0, WW3D::Get_Texture_Reduction() + 1, 4); + TheGameClient->setTextureLOD(level); TheInGameUI->messageNoFormat( TheGameText->FETCH_OR_SUBSTITUTE_FORMAT("GUI:DebugIncreaseLOD", L"Increase LOD") ); disp = DESTROY_MESSAGE; break; diff --git a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameClient.h b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameClient.h index 83d24ddb95..545ca43850 100644 --- a/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameClient.h +++ b/GeneralsMD/Code/GameEngineDevice/Include/W3DDevice/GameClient/W3DGameClient.h @@ -92,7 +92,7 @@ class W3DGameClient : public GameClient //--------------------------------------------------------------------------- virtual void setTeamColor( Int red, Int green, Int blue ); ///< @todo superhack for demo, remove!!! - virtual void adjustLOD( Int adj ); ///< @todo hack for evaluation, remove. + virtual void setTextureLOD( Int level ); virtual void notifyTerrainObjectMoved(Object *obj); protected: diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/TerrainTex.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/TerrainTex.cpp index 61b9492190..7702b77b66 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/TerrainTex.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/TerrainTex.cpp @@ -195,8 +195,8 @@ int TerrainTextureClass::update(WorldHeightMap *htMap) surface_level->UnlockRect(); surface_level->Release(); DX8_ErrorCode(D3DXFilterTexture(Peek_D3D_Texture(), NULL, 0, D3DX_FILTER_BOX)); - if (TheWritableGlobalData->m_textureReductionFactor) { - Peek_D3D_Texture()->SetLOD(TheWritableGlobalData->m_textureReductionFactor); + if (WW3D::Get_Texture_Reduction()) { + Peek_D3D_Texture()->SetLOD(WW3D::Get_Texture_Reduction()); } return(surface_desc.Height); } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp index 517eb95a90..b2949a68ca 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DDisplay.cpp @@ -795,14 +795,10 @@ void W3DDisplay::init( void ) TheGameLODManager->setStaticLODLevel(TheGameLODManager->getRecommendedStaticLODLevel()); } else - { //Static LOD level was applied during GameLOD manager init except for texture reduction + { + //Static LOD level was applied during GameLOD manager init except for texture reduction //which needs to be applied here. - Int txtReduction=TheWritableGlobalData->m_textureReductionFactor; - if (txtReduction > 0) - { WW3D::Set_Texture_Reduction(txtReduction,32); - //Tell LOD manager that texture reduction was applied. - TheGameLODManager->setCurrentTextureReduction(txtReduction); - } + TheGameClient->setTextureLOD(TheWritableGlobalData->m_textureReductionFactor); } if (TheGlobalData->m_displayGamma != 1.0f) diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DGameClient.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DGameClient.cpp index 2852b2031c..4f5dbd6dd6 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DGameClient.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DGameClient.cpp @@ -196,27 +196,16 @@ void W3DGameClient::setTeamColor(Int red, Int green, Int blue) } //------------------------------------------------------------------------------------------------- -/** temporary entry point for adjusting LOD for development testing. */ //------------------------------------------------------------------------------------------------- -void W3DGameClient::adjustLOD( Int adj ) +void W3DGameClient::setTextureLOD( Int level ) { - if (TheGlobalData == NULL) - return; - - TheWritableGlobalData->m_textureReductionFactor += adj; - - if (TheWritableGlobalData->m_textureReductionFactor > 4) - TheWritableGlobalData->m_textureReductionFactor = 4; //16x less resolution is probably enough. - if (TheWritableGlobalData->m_textureReductionFactor < 0) - TheWritableGlobalData->m_textureReductionFactor = 0; + if (WW3D::Get_Texture_Reduction() != level) + { + WW3D::Set_Texture_Reduction(level, 32); - if (WW3D::Get_Texture_Reduction() != TheWritableGlobalData->m_textureReductionFactor) - { WW3D::Set_Texture_Reduction(TheWritableGlobalData->m_textureReductionFactor,32); - TheGameLODManager->setCurrentTextureReduction(TheWritableGlobalData->m_textureReductionFactor); if( TheTerrainRenderObject ) - TheTerrainRenderObject->setTextureLOD( TheWritableGlobalData->m_textureReductionFactor ); + TheTerrainRenderObject->setTextureLOD(level); } - } //------------------------------------------------------------------------------------------------- diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp index 087e9dfaa0..0d45c27ef4 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/W3DTreeBuffer.cpp @@ -189,8 +189,8 @@ int W3DTreeBuffer::W3DTreeTextureClass::update(W3DTreeBuffer *buffer) DX8_ErrorCode(surface_level->UnlockRect()); surface_level->Release(); DX8_ErrorCode(D3DXFilterTexture(Peek_D3D_Texture(), NULL, (UINT)0, D3DX_FILTER_BOX)); - if (TheWritableGlobalData->m_textureReductionFactor) { - DX8_ErrorCode(Peek_D3D_Texture()->SetLOD((DWORD)TheWritableGlobalData->m_textureReductionFactor)); + if (WW3D::Get_Texture_Reduction()) { + DX8_ErrorCode(Peek_D3D_Texture()->SetLOD((DWORD)WW3D::Get_Texture_Reduction())); } return(surface_desc.Height); } diff --git a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp index 53efa14dbb..64a3ae4ce4 100644 --- a/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp +++ b/GeneralsMD/Code/GameEngineDevice/Source/W3DDevice/GameClient/WorldHeightMap.cpp @@ -2214,8 +2214,8 @@ TextureClass *WorldHeightMap::getEdgeTerrainTexture(void) TerrainTextureClass *WorldHeightMap::getFlatTexture(Int xCell, Int yCell, Int cellWidth, Int pixelsPerCell) { - if (TheWritableGlobalData->m_textureReductionFactor) { - if (TheWritableGlobalData->m_textureReductionFactor>1) { + if (WW3D::Get_Texture_Reduction()) { + if (WW3D::Get_Texture_Reduction()>1) { pixelsPerCell /= 4; } else { pixelsPerCell /= 2;