Commit 5325a921 authored by nadro's avatar nadro

- Minor improvements for both COGLCoreTexture::lock and CD3D9Texture::lock methods.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5238 dfc29bdd-3216-0410-991c-e03cc46cb475
parent e12ef3a4
......@@ -137,17 +137,15 @@ CD3D9Texture::~CD3D9Texture()
void* CD3D9Texture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel)
{
if (LockData)
return LockData;
if (IImage::isCompressedFormat(ColorFormat) || mipmapLevel > 0) // TO-DO
return 0;
bool lockReadOnly = (mode == ETLM_READ_ONLY);
LockLevel = mipmapLevel;
if (LockData)
return LockData;
LockLevel = mipmapLevel;
HRESULT hr;
D3DLOCKED_RECT rect;
......
......@@ -181,15 +181,15 @@ public:
{
// TO-DO - this method will be improved.
if (LockImage)
return LockImage->getData();
if (IImage::isCompressedFormat(ColorFormat) || IsRenderTarget || mipmapLevel > 0) // TO-DO
return 0;
LockReadOnly |= (mode == ETLM_READ_ONLY);
LockLevel = mipmapLevel;
if (LockImage)
return LockImage->getData();
if (KeepImage && mipmapLevel == 0)
{
LockImage = Image[0];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment