Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -964,12 +964,15 @@ void WaterRenderObjClass::ReAcquireResources(void)
if (m_whiteTexture && !m_whiteTexture->Is_Initialized())
{ m_whiteTexture->Init();
SurfaceClass *surface=m_whiteTexture->Get_Surface_Level();
int pitch;
void *pBits = surface->Lock(&pitch);
const unsigned int bytesPerPixel = surface->Get_Bytes_Per_Pixel();
surface->Draw_Pixel(0, 0, 0xffffffff, bytesPerPixel, pBits, pitch);
surface->Unlock();
REF_PTR_RELEASE(surface);
if (surface)
{
int pitch;
void *pBits = surface->Lock(&pitch);
const unsigned int bytesPerPixel = surface->Get_Bytes_Per_Pixel();
surface->Draw_Pixel(0, 0, 0xffffffff, bytesPerPixel, pBits, pitch);
surface->Unlock();
REF_PTR_RELEASE(surface);
}
}
}

Expand Down Expand Up @@ -1114,12 +1117,15 @@ Int WaterRenderObjClass::init(Real waterLevel, Real dx, Real dy, SceneClass *par
//For some reason setting a null texture does not result in 0xffffffff for pixel shaders so using explicit "white" texture.
m_whiteTexture=MSGNEW("TextureClass") TextureClass(1,1,WW3D_FORMAT_A4R4G4B4,MIP_LEVELS_1);
SurfaceClass *surface=m_whiteTexture->Get_Surface_Level();
int pitch;
void *pBits = surface->Lock(&pitch);
const unsigned int bytesPerPixel = surface->Get_Bytes_Per_Pixel();
surface->Draw_Pixel(0, 0, 0xffffffff, bytesPerPixel, pBits, pitch);
surface->Unlock();
REF_PTR_RELEASE(surface);
if (surface)
{
int pitch;
void *pBits = surface->Lock(&pitch);
const unsigned int bytesPerPixel = surface->Get_Bytes_Per_Pixel();
surface->Draw_Pixel(0, 0, 0xffffffff, bytesPerPixel, pBits, pitch);
surface->Unlock();
REF_PTR_RELEASE(surface);
}

m_waterNoiseTexture=WW3DAssetManager::Get_Instance()->Get_Texture("Noise0000.tga");
m_riverAlphaEdge=WW3DAssetManager::Get_Instance()->Get_Texture("TWAlphaEdge.tga");
Expand Down
Loading