"include/svn:/svn.code.sf.net/p/irrlicht/code/trunk@5214" did not exist on "15fce47e246723aa7fbd5bb9e246c94df0943994"
Commit c6f5e6d9 authored by nadro's avatar nadro

- Replaced ITexture::lock 'mipmapLevel' param by 'layer' param.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5279 dfc29bdd-3216-0410-991c-e03cc46cb475
parent 9f88ed7d
...@@ -139,12 +139,11 @@ public: ...@@ -139,12 +139,11 @@ public:
only mode or read from in write only mode. only mode or read from in write only mode.
Support for this feature depends on the driver, so don't rely on the Support for this feature depends on the driver, so don't rely on the
texture being write-protected when locking with read-only, etc. texture being write-protected when locking with read-only, etc.
\param mipmapLevel Number of the mipmapLevel to lock. 0 is main texture. \param layer It determines which cubemap face or texture array layer should be locked.
Non-existing levels will silently fail and return 0.
\return Returns a pointer to the pixel data. The format of the pixel can \return Returns a pointer to the pixel data. The format of the pixel can
be determined by using getColorFormat(). 0 is returned, if be determined by using getColorFormat(). 0 is returned, if
the texture cannot be locked. */ the texture cannot be locked. */
virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) = 0; virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 layer = 0) = 0;
//! Unlock function. Must be called after a lock() to the texture. //! Unlock function. Must be called after a lock() to the texture.
/** One should avoid to call unlock more than once before another lock. /** One should avoid to call unlock more than once before another lock.
......
...@@ -16,8 +16,8 @@ namespace video ...@@ -16,8 +16,8 @@ namespace video
{ {
CD3D9Texture::CD3D9Texture(const io::path& name, const core::array<IImage*>& image, E_TEXTURE_TYPE type, CD3D9Driver* driver) CD3D9Texture::CD3D9Texture(const io::path& name, const core::array<IImage*>& image, E_TEXTURE_TYPE type, CD3D9Driver* driver)
: ITexture(name, type), Driver(driver), InternalFormat(D3DFMT_UNKNOWN), LockData(0), LockLevel(0), AutoGenerateMipMaps(false), : ITexture(name, type), Driver(driver), InternalFormat(D3DFMT_UNKNOWN), LockReadOnly(false), LockData(0), LockLayer(0),
Device(0), Texture(0), CubeTexture(0), RTTSurface(0) AutoGenerateMipMaps(false), Device(0), Texture(0), CubeTexture(0), RTTSurface(0)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("CD3D9Texture"); setDebugName("CD3D9Texture");
...@@ -115,8 +115,8 @@ CD3D9Texture::CD3D9Texture(const io::path& name, const core::array<IImage*>& ima ...@@ -115,8 +115,8 @@ CD3D9Texture::CD3D9Texture(const io::path& name, const core::array<IImage*>& ima
} }
CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<u32>& size, const io::path& name, const ECOLOR_FORMAT format) CD3D9Texture::CD3D9Texture(CD3D9Driver* driver, const core::dimension2d<u32>& size, const io::path& name, const ECOLOR_FORMAT format)
: ITexture(name, ETT_2D), Driver(driver), InternalFormat(D3DFMT_UNKNOWN), LockData(0), LockLevel(0), AutoGenerateMipMaps(false), : ITexture(name, ETT_2D), Driver(driver), InternalFormat(D3DFMT_UNKNOWN), LockReadOnly(false), LockData(0), LockLayer(0),
Device(0), Texture(0), CubeTexture(0), RTTSurface(0) AutoGenerateMipMaps(false), Device(0), Texture(0), CubeTexture(0), RTTSurface(0)
{ {
#ifdef _DEBUG #ifdef _DEBUG
setDebugName("CD3D9Texture"); setDebugName("CD3D9Texture");
...@@ -164,16 +164,16 @@ CD3D9Texture::~CD3D9Texture() ...@@ -164,16 +164,16 @@ CD3D9Texture::~CD3D9Texture()
Device->Release(); Device->Release();
} }
void* CD3D9Texture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel) void* CD3D9Texture::lock(E_TEXTURE_LOCK_MODE mode, u32 layer)
{ {
if (LockData) if (LockData)
return LockData; return LockData;
if (IImage::isCompressedFormat(ColorFormat) || mipmapLevel > 0) // TO-DO if (IImage::isCompressedFormat(ColorFormat))
return 0; return 0;
bool lockReadOnly = (mode == ETLM_READ_ONLY); LockReadOnly = (mode == ETLM_READ_ONLY);
LockLevel = mipmapLevel; LockLayer = layer;
HRESULT hr; HRESULT hr;
D3DLOCKED_RECT rect; D3DLOCKED_RECT rect;
...@@ -182,12 +182,13 @@ void* CD3D9Texture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel) ...@@ -182,12 +182,13 @@ void* CD3D9Texture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel)
{ {
if (Texture) if (Texture)
{ {
hr = Texture->LockRect(mipmapLevel, &rect, 0, lockReadOnly ? D3DLOCK_READONLY : 0); hr = Texture->LockRect(0, &rect, 0, LockReadOnly ? D3DLOCK_READONLY : 0);
} }
else if (CubeTexture) else if (CubeTexture)
{ {
// TO-DO -> hardcoded D3DCUBEMAP_FACE_POSITIVE_X. _IRR_DEBUG_BREAK_IF(layer > 5)
hr = CubeTexture->LockRect(D3DCUBEMAP_FACE_POSITIVE_X, mipmapLevel, &rect, 0, lockReadOnly ? D3DLOCK_READONLY : 0);
hr = CubeTexture->LockRect(static_cast<_D3DCUBEMAP_FACES>(layer), 0, &rect, 0, LockReadOnly ? D3DLOCK_READONLY : 0);
} }
if (FAILED(hr)) if (FAILED(hr))
...@@ -212,7 +213,7 @@ void* CD3D9Texture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel) ...@@ -212,7 +213,7 @@ void* CD3D9Texture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel)
} }
IDirect3DSurface9 *surface = 0; IDirect3DSurface9 *surface = 0;
hr = Texture->GetSurfaceLevel(mipmapLevel, &surface); hr = Texture->GetSurfaceLevel(0, &surface);
if (FAILED(hr)) if (FAILED(hr))
{ {
os::Printer::log("Could not lock DIRECT3D9 Texture", "Could not get surface.", ELL_ERROR); os::Printer::log("Could not lock DIRECT3D9 Texture", "Could not get surface.", ELL_ERROR);
...@@ -225,7 +226,7 @@ void* CD3D9Texture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel) ...@@ -225,7 +226,7 @@ void* CD3D9Texture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel)
os::Printer::log("Could not lock DIRECT3D9 Texture", "Data copy failed.", ELL_ERROR); os::Printer::log("Could not lock DIRECT3D9 Texture", "Data copy failed.", ELL_ERROR);
return 0; return 0;
} }
hr = RTTSurface->LockRect(&rect, 0, lockReadOnly ? D3DLOCK_READONLY : 0); hr = RTTSurface->LockRect(&rect, 0, LockReadOnly ? D3DLOCK_READONLY : 0);
if(FAILED(hr)) if(FAILED(hr))
{ {
os::Printer::log("Could not lock DIRECT3D9 Texture", "LockRect failed.", ELL_ERROR); os::Printer::log("Could not lock DIRECT3D9 Texture", "LockRect failed.", ELL_ERROR);
...@@ -247,12 +248,11 @@ void CD3D9Texture::unlock() ...@@ -247,12 +248,11 @@ void CD3D9Texture::unlock()
{ {
if (Texture) if (Texture)
{ {
Texture->UnlockRect(LockLevel); Texture->UnlockRect(0);
} }
else if (CubeTexture) else if (CubeTexture)
{ {
// TO-DO -> hardcoded D3DCUBEMAP_FACE_POSITIVE_X. CubeTexture->UnlockRect(static_cast<_D3DCUBEMAP_FACES>(LockLayer), 0);
CubeTexture->UnlockRect(D3DCUBEMAP_FACE_POSITIVE_X, LockLevel);
} }
} }
else if (RTTSurface) else if (RTTSurface)
...@@ -260,11 +260,12 @@ void CD3D9Texture::unlock() ...@@ -260,11 +260,12 @@ void CD3D9Texture::unlock()
RTTSurface->UnlockRect(); RTTSurface->UnlockRect();
} }
if (LockLevel == 0) if (!LockReadOnly)
regenerateMipMapLevels(0); regenerateMipMapLevels(0, LockLayer);
LockReadOnly = false;
LockData = 0; LockData = 0;
LockLevel = 0; LockLayer = 0;
} }
void CD3D9Texture::regenerateMipMapLevels(void* data, u32 layer) void CD3D9Texture::regenerateMipMapLevels(void* data, u32 layer)
...@@ -456,13 +457,6 @@ void CD3D9Texture::uploadTexture(u32 layer, u32 level, void* data) ...@@ -456,13 +457,6 @@ void CD3D9Texture::uploadTexture(u32 layer, u32 level, void* data)
u32 width = Size.Width >> level; u32 width = Size.Width >> level;
u32 height = Size.Height >> level; u32 height = Size.Height >> level;
const D3DCUBEMAP_FACES cubeTextureType[6] =
{
D3DCUBEMAP_FACE_POSITIVE_X, D3DCUBEMAP_FACE_NEGATIVE_X,
D3DCUBEMAP_FACE_POSITIVE_Y, D3DCUBEMAP_FACE_NEGATIVE_Y,
D3DCUBEMAP_FACE_POSITIVE_Z, D3DCUBEMAP_FACE_NEGATIVE_Z
};
u32 dataSize = IImage::getDataSizeFromFormat(ColorFormat, width, height); u32 dataSize = IImage::getDataSizeFromFormat(ColorFormat, width, height);
HRESULT hr = 0; HRESULT hr = 0;
...@@ -475,8 +469,9 @@ void CD3D9Texture::uploadTexture(u32 layer, u32 level, void* data) ...@@ -475,8 +469,9 @@ void CD3D9Texture::uploadTexture(u32 layer, u32 level, void* data)
} }
else if (CubeTexture) else if (CubeTexture)
{ {
const D3DCUBEMAP_FACES tmpCubeTextureType = cubeTextureType[(layer < 6) ? layer : 0]; _IRR_DEBUG_BREAK_IF(layer > 5)
hr = CubeTexture->LockRect(tmpCubeTextureType, level, &lockRectangle, 0, 0);
hr = CubeTexture->LockRect(static_cast<_D3DCUBEMAP_FACES>(layer), level, &lockRectangle, 0, 0);
} }
if (FAILED(hr)) if (FAILED(hr))
...@@ -493,8 +488,7 @@ void CD3D9Texture::uploadTexture(u32 layer, u32 level, void* data) ...@@ -493,8 +488,7 @@ void CD3D9Texture::uploadTexture(u32 layer, u32 level, void* data)
} }
else if (CubeTexture) else if (CubeTexture)
{ {
const D3DCUBEMAP_FACES tmpCubeTextureType = cubeTextureType[(layer < 6) ? layer : 0]; hr = CubeTexture->UnlockRect(static_cast<_D3DCUBEMAP_FACES>(layer), level);
hr = CubeTexture->UnlockRect(tmpCubeTextureType, level);
} }
if (FAILED(hr)) if (FAILED(hr))
......
...@@ -32,7 +32,7 @@ public: ...@@ -32,7 +32,7 @@ public:
virtual ~CD3D9Texture(); virtual ~CD3D9Texture();
virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 mipmapLevel = 0) _IRR_OVERRIDE_; virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 layer = 0) _IRR_OVERRIDE_;
virtual void unlock() _IRR_OVERRIDE_; virtual void unlock() _IRR_OVERRIDE_;
...@@ -59,8 +59,9 @@ private: ...@@ -59,8 +59,9 @@ private:
D3DFORMAT InternalFormat; D3DFORMAT InternalFormat;
bool LockReadOnly;
void* LockData; void* LockData;
u32 LockLevel; u32 LockLayer;
bool AutoGenerateMipMaps; bool AutoGenerateMipMaps;
......
...@@ -768,7 +768,7 @@ namespace video ...@@ -768,7 +768,7 @@ namespace video
{ {
SDummyTexture(const io::path& name, E_TEXTURE_TYPE type) : ITexture(name, type) {}; SDummyTexture(const io::path& name, E_TEXTURE_TYPE type) : ITexture(name, type) {};
virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) _IRR_OVERRIDE_ { return 0; } virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 layer = 0) _IRR_OVERRIDE_ { return 0; }
virtual void unlock()_IRR_OVERRIDE_ {} virtual void unlock()_IRR_OVERRIDE_ {}
virtual void regenerateMipMapLevels(void* data = 0, u32 layer = 0) _IRR_OVERRIDE_ {} virtual void regenerateMipMapLevels(void* data = 0, u32 layer = 0) _IRR_OVERRIDE_ {}
}; };
......
...@@ -46,7 +46,7 @@ public: ...@@ -46,7 +46,7 @@ public:
}; };
COpenGLCoreTexture(const io::path& name, const core::array<IImage*>& image, E_TEXTURE_TYPE type, TOpenGLDriver* driver) : ITexture(name, type), Driver(driver), TextureType(GL_TEXTURE_2D), COpenGLCoreTexture(const io::path& name, const core::array<IImage*>& image, E_TEXTURE_TYPE type, TOpenGLDriver* driver) : ITexture(name, type), Driver(driver), TextureType(GL_TEXTURE_2D),
TextureName(0), InternalFormat(GL_RGBA), PixelFormat(GL_RGBA), PixelType(GL_UNSIGNED_BYTE), Converter(0), LockReadOnly(false), LockImage(0), LockLevel(0), TextureName(0), InternalFormat(GL_RGBA), PixelFormat(GL_RGBA), PixelType(GL_UNSIGNED_BYTE), Converter(0), LockReadOnly(false), LockImage(0), LockLayer(0),
KeepImage(false), AutoGenerateMipMaps(false) KeepImage(false), AutoGenerateMipMaps(false)
{ {
_IRR_DEBUG_BREAK_IF(image.size() == 0) _IRR_DEBUG_BREAK_IF(image.size() == 0)
...@@ -134,7 +134,7 @@ public: ...@@ -134,7 +134,7 @@ public:
} }
COpenGLCoreTexture(const io::path& name, const core::dimension2d<u32>& size, ECOLOR_FORMAT format, TOpenGLDriver* driver) : ITexture(name, ETT_2D), Driver(driver), TextureType(GL_TEXTURE_2D), COpenGLCoreTexture(const io::path& name, const core::dimension2d<u32>& size, ECOLOR_FORMAT format, TOpenGLDriver* driver) : ITexture(name, ETT_2D), Driver(driver), TextureType(GL_TEXTURE_2D),
TextureName(0), InternalFormat(GL_RGBA), PixelFormat(GL_RGBA), PixelType(GL_UNSIGNED_BYTE), Converter(0), LockReadOnly(false), LockImage(0), LockLevel(0), KeepImage(false), TextureName(0), InternalFormat(GL_RGBA), PixelFormat(GL_RGBA), PixelType(GL_UNSIGNED_BYTE), Converter(0), LockReadOnly(false), LockImage(0), LockLayer(0), KeepImage(false),
AutoGenerateMipMaps(false) AutoGenerateMipMaps(false)
{ {
DriverType = Driver->getDriverType(); DriverType = Driver->getDriverType();
...@@ -189,7 +189,7 @@ public: ...@@ -189,7 +189,7 @@ public:
Image[i]->drop(); Image[i]->drop();
} }
virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 mipmapLevel = 0) _IRR_OVERRIDE_ virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 layer = 0) _IRR_OVERRIDE_
{ {
if (LockImage) if (LockImage)
return LockImage->getData(); return LockImage->getData();
...@@ -198,24 +198,25 @@ public: ...@@ -198,24 +198,25 @@ public:
return 0; return 0;
LockReadOnly |= (mode == ETLM_READ_ONLY); LockReadOnly |= (mode == ETLM_READ_ONLY);
LockLevel = mipmapLevel; LockLayer = layer;
if (KeepImage && mipmapLevel == 0) if (KeepImage)
{ {
LockImage = Image[0]; _IRR_DEBUG_BREAK_IF(LockLayer > Image.size())
LockImage = Image[LockLayer];
LockImage->grab(); LockImage->grab();
} }
else else
{ {
const core::dimension2d<u32> lockImageSize(Size.Width >> mipmapLevel, Size.Height >> mipmapLevel); LockImage = Driver->createImage(ColorFormat, Size);
LockImage = Driver->createImage(ColorFormat, lockImageSize);
if (LockImage && mode != ETLM_WRITE_ONLY) if (LockImage && mode != ETLM_WRITE_ONLY)
{ {
IImage* tmpImage = Driver->createImage(ECF_A8R8G8B8, lockImageSize); IImage* tmpImage = Driver->createImage(ECF_A8R8G8B8, Size);
#if 0 // This method doesn't work properly in some cases #if 0 // This method doesn't work properly in some cases
glGetTexImage(GL_TEXTURE_2D, mipmapLevel, GL_RGBA, GL_UNSIGNED_BYTE, tmpImage->getData()); glGetTexImage(GL_TEXTURE_2D, 0, GL_RGBA, GL_UNSIGNED_BYTE, tmpImage->getData());
if (IsRenderTarget) if (IsRenderTarget)
{ {
...@@ -238,7 +239,7 @@ public: ...@@ -238,7 +239,7 @@ public:
delete[] tmpBuffer; delete[] tmpBuffer;
} }
#else #else
COpenGLCoreTexture* tmpTexture = new COpenGLCoreTexture("OGL_CORE_LOCK_TEXTURE", lockImageSize, ColorFormat, Driver); COpenGLCoreTexture* tmpTexture = new COpenGLCoreTexture("OGL_CORE_LOCK_TEXTURE", Size, ColorFormat, Driver);
GLuint tmpFBO = 0; GLuint tmpFBO = 0;
Driver->irrGlGenFramebuffers(1, &tmpFBO); Driver->irrGlGenFramebuffers(1, &tmpFBO);
...@@ -248,7 +249,7 @@ public: ...@@ -248,7 +249,7 @@ public:
GLsizei prevViewportWidth = 0; GLsizei prevViewportWidth = 0;
GLsizei prevViewportHeight = 0; GLsizei prevViewportHeight = 0;
Driver->getCacheHandler()->getViewport(prevViewportX, prevViewportY, prevViewportWidth, prevViewportHeight); Driver->getCacheHandler()->getViewport(prevViewportX, prevViewportY, prevViewportWidth, prevViewportHeight);
Driver->getCacheHandler()->setViewport(0, 0, lockImageSize.Width, lockImageSize.Height); Driver->getCacheHandler()->setViewport(0, 0, Size.Width, Size.Height);
GLuint prevFBO = 0; GLuint prevFBO = 0;
Driver->getCacheHandler()->getFBO(prevFBO); Driver->getCacheHandler()->getFBO(prevFBO);
...@@ -258,7 +259,7 @@ public: ...@@ -258,7 +259,7 @@ public:
Driver->draw2DImage(this, true); Driver->draw2DImage(this, true);
glReadPixels(0, 0, lockImageSize.Width, lockImageSize.Height, GL_RGBA, GL_UNSIGNED_BYTE, tmpImage->getData()); glReadPixels(0, 0, Size.Width, Size.Height, GL_RGBA, GL_UNSIGNED_BYTE, tmpImage->getData());
Driver->getCacheHandler()->setFBO(prevFBO); Driver->getCacheHandler()->setFBO(prevFBO);
Driver->getCacheHandler()->setViewport(prevViewportX, prevViewportY, prevViewportWidth, prevViewportHeight); Driver->getCacheHandler()->setViewport(prevViewportX, prevViewportY, prevViewportWidth, prevViewportHeight);
...@@ -313,19 +314,18 @@ public: ...@@ -313,19 +314,18 @@ public:
const COpenGLCoreTexture* prevTexture = Driver->getCacheHandler()->getTextureCache().get(0); const COpenGLCoreTexture* prevTexture = Driver->getCacheHandler()->getTextureCache().get(0);
Driver->getCacheHandler()->getTextureCache().set(0, this); Driver->getCacheHandler()->getTextureCache().set(0, this);
uploadTexture(false, 0, LockLevel, LockImage->getData()); uploadTexture(false, LockLayer, 0, LockImage->getData());
Driver->getCacheHandler()->getTextureCache().set(0, prevTexture); Driver->getCacheHandler()->getTextureCache().set(0, prevTexture);
if (LockLevel == 0) regenerateMipMapLevels(0, LockLayer);
regenerateMipMapLevels(0);
} }
LockImage->drop(); LockImage->drop();
LockReadOnly = false; LockReadOnly = false;
LockImage = 0; LockImage = 0;
LockLevel = 0; LockLayer = 0;
} }
virtual void regenerateMipMapLevels(void* data = 0, u32 layer = 0) _IRR_OVERRIDE_ virtual void regenerateMipMapLevels(void* data = 0, u32 layer = 0) _IRR_OVERRIDE_
...@@ -481,6 +481,12 @@ protected: ...@@ -481,6 +481,12 @@ protected:
u32 width = Size.Width >> level; u32 width = Size.Width >> level;
u32 height = Size.Height >> level; u32 height = Size.Height >> level;
GLenum tmpTextureType = TextureType;
if (tmpTextureType == GL_TEXTURE_CUBE_MAP)
{
_IRR_DEBUG_BREAK_IF(layer > 5)
const GLenum cubeTextureType[6] = const GLenum cubeTextureType[6] =
{ {
GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X, GL_TEXTURE_CUBE_MAP_POSITIVE_X, GL_TEXTURE_CUBE_MAP_NEGATIVE_X,
...@@ -488,7 +494,8 @@ protected: ...@@ -488,7 +494,8 @@ protected:
GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z GL_TEXTURE_CUBE_MAP_POSITIVE_Z, GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
}; };
GLenum tmpTextureType = (TextureType == GL_TEXTURE_CUBE_MAP) ? cubeTextureType[(layer < 6) ? layer : 0] : TextureType; tmpTextureType = cubeTextureType[layer];
}
if (!IImage::isCompressedFormat(ColorFormat)) if (!IImage::isCompressedFormat(ColorFormat))
{ {
...@@ -552,7 +559,7 @@ protected: ...@@ -552,7 +559,7 @@ protected:
bool LockReadOnly; bool LockReadOnly;
IImage* LockImage; IImage* LockImage;
u32 LockLevel; u32 LockLayer;
bool KeepImage; bool KeepImage;
core::array<IImage*> Image; core::array<IImage*> Image;
......
...@@ -76,7 +76,7 @@ CSoftwareTexture::~CSoftwareTexture() ...@@ -76,7 +76,7 @@ CSoftwareTexture::~CSoftwareTexture()
//! lock function //! lock function
void* CSoftwareTexture::lock(E_TEXTURE_LOCK_MODE mode, u32 mipmapLevel) void* CSoftwareTexture::lock(E_TEXTURE_LOCK_MODE mode, u32 layer)
{ {
return Image->getData(); return Image->getData();
} }
......
...@@ -30,7 +30,7 @@ public: ...@@ -30,7 +30,7 @@ public:
virtual ~CSoftwareTexture(); virtual ~CSoftwareTexture();
//! lock function //! lock function
virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) _IRR_OVERRIDE_; virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 layer = 0) _IRR_OVERRIDE_;
//! unlock function //! unlock function
virtual void unlock() _IRR_OVERRIDE_; virtual void unlock() _IRR_OVERRIDE_;
......
...@@ -38,11 +38,11 @@ public: ...@@ -38,11 +38,11 @@ public:
virtual ~CSoftwareTexture2(); virtual ~CSoftwareTexture2();
//! lock function //! lock function
virtual void* lock(E_TEXTURE_LOCK_MODE mode=ETLM_READ_WRITE, u32 mipmapLevel=0) _IRR_OVERRIDE_ virtual void* lock(E_TEXTURE_LOCK_MODE mode = ETLM_READ_WRITE, u32 layer = 0) _IRR_OVERRIDE_
{ {
if (Flags & GEN_MIPMAP) if (Flags & GEN_MIPMAP)
{ {
MipMapLOD = mipmapLevel; MipMapLOD = 0;
Size = MipMap[MipMapLOD]->getDimension(); Size = MipMap[MipMapLOD]->getDimension();
Pitch = MipMap[MipMapLOD]->getPitch(); Pitch = MipMap[MipMapLOD]->getPitch();
} }
......
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