diff --git a/Generals/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp b/Generals/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp index 1345a71a1f8..4231d764312 100644 --- a/Generals/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp +++ b/Generals/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp @@ -542,12 +542,10 @@ void TextureClass::Apply_Null(unsigned int stage) void TextureClass::Apply_New_Surface(bool initialized) { - if (D3DTexture) D3DTexture->Release(); - D3DTexture=TextureLoadTask->Peek_D3D_Texture(); - D3DTexture->AddRef(); + Set_D3D_Base_Texture(TextureLoadTask->Peek_D3D_Texture()); if (initialized) Initialized=true; - WWASSERT(D3DTexture); + WWASSERT(Peek_D3D_Base_Texture()); IDirect3DSurface8* surface; DX8_ErrorCode(Peek_D3D_Texture()->GetSurfaceLevel(0,&surface)); D3DSURFACE_DESC d3d_desc; diff --git a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp index df53dadbaff..623f26ac6b5 100644 --- a/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp +++ b/GeneralsMD/Code/Libraries/Source/WWVegas/WW3D2/texture.cpp @@ -895,12 +895,7 @@ void TextureClass::Apply_New_Surface bool disable_auto_invalidation ) { - IDirect3DBaseTexture8* d3d_tex=Peek_D3D_Base_Texture(); - - if (d3d_tex) d3d_tex->Release(); - - Poke_Texture(d3d_texture);//TextureLoadTask->Peek_D3D_Texture(); - d3d_texture->AddRef(); + Set_D3D_Base_Texture(d3d_texture); if (initialized) Initialized=true; if (disable_auto_invalidation) InactivationTime = 0; @@ -1276,12 +1271,7 @@ void ZTextureClass::Apply_New_Surface bool disable_auto_invalidation ) { - IDirect3DBaseTexture8* d3d_tex=Peek_D3D_Base_Texture(); - - if (d3d_tex) d3d_tex->Release(); - - Poke_Texture(d3d_texture);//TextureLoadTask->Peek_D3D_Texture(); - d3d_texture->AddRef(); + Set_D3D_Base_Texture(d3d_texture); if (initialized) Initialized=true; if (disable_auto_invalidation) InactivationTime = 0; @@ -1595,12 +1585,7 @@ void CubeTextureClass::Apply_New_Surface bool disable_auto_invalidation ) { - IDirect3DBaseTexture8* d3d_tex=Peek_D3D_Base_Texture(); - - if (d3d_tex) d3d_tex->Release(); - - Poke_Texture(d3d_texture);//TextureLoadTask->Peek_D3D_Texture(); - d3d_texture->AddRef(); + Set_D3D_Base_Texture(d3d_texture); if (initialized) Initialized=true; if (disable_auto_invalidation) InactivationTime = 0; @@ -1883,12 +1868,7 @@ void VolumeTextureClass::Apply_New_Surface bool disable_auto_invalidation ) { - IDirect3DBaseTexture8* d3d_tex=Peek_D3D_Base_Texture(); - - if (d3d_tex) d3d_tex->Release(); - - Poke_Texture(d3d_texture);//TextureLoadTask->Peek_D3D_Texture(); - d3d_texture->AddRef(); + Set_D3D_Base_Texture(d3d_texture); if (initialized) Initialized=true; if (disable_auto_invalidation) InactivationTime = 0;