Commit 48e75f34 authored by nadro's avatar nadro

- Fixed issue with CurrentRenderTargetSize vs. CurrentRendertargetSize. Thanks cheqnk for report.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@5255 dfc29bdd-3216-0410-991c-e03cc46cb475
parent adc89d1c
...@@ -818,7 +818,7 @@ bool CD3D9Driver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor ...@@ -818,7 +818,7 @@ bool CD3D9Driver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor
// Set other settings. // Set other settings.
CurrentRendertargetSize = renderTarget->getSize(); CurrentRenderTargetSize = renderTarget->getSize();
Transformation3DChanged = true; Transformation3DChanged = true;
} }
else if (CurrentRenderTarget != target) else if (CurrentRenderTarget != target)
...@@ -861,7 +861,7 @@ bool CD3D9Driver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor ...@@ -861,7 +861,7 @@ bool CD3D9Driver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SColor
// Set other settings. // Set other settings.
CurrentRendertargetSize = core::dimension2d<u32>(0, 0); CurrentRenderTargetSize = core::dimension2d<u32>(0, 0);
Transformation3DChanged = true; Transformation3DChanged = true;
} }
...@@ -1404,7 +1404,7 @@ void CD3D9Driver::draw2D3DVertexPrimitiveList(const void* vertices, ...@@ -1404,7 +1404,7 @@ void CD3D9Driver::draw2D3DVertexPrimitiveList(const void* vertices,
pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_LINESTRIP, 0, vertexCount, pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_LINESTRIP, 0, vertexCount,
primitiveCount - 1, indexList, indexType, vertices, stride); primitiveCount - 1, indexList, indexType, vertices, stride);
u16 tmpIndices[] = {primitiveCount - 1, 0}; u16 tmpIndices[] = {static_cast<u16>(primitiveCount - 1), 0};
pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_LINELIST, 0, vertexCount, pID3DDevice->DrawIndexedPrimitiveUP(D3DPT_LINELIST, 0, vertexCount,
1, tmpIndices, indexType, vertices, stride); 1, tmpIndices, indexType, vertices, stride);
...@@ -3332,16 +3332,6 @@ D3DFORMAT CD3D9Driver::getD3DColorFormat() const ...@@ -3332,16 +3332,6 @@ D3DFORMAT CD3D9Driver::getD3DColorFormat() const
} }
// returns the current size of the screen or rendertarget
const core::dimension2d<u32>& CD3D9Driver::getCurrentRenderTargetSize() const
{
if ( CurrentRendertargetSize.Width == 0 )
return ScreenSize;
else
return CurrentRendertargetSize;
}
// Set/unset a clipping plane. // Set/unset a clipping plane.
bool CD3D9Driver::setClipPlane(u32 index, const core::plane3df& plane, bool enable) bool CD3D9Driver::setClipPlane(u32 index, const core::plane3df& plane, bool enable)
{ {
......
...@@ -347,9 +347,6 @@ namespace video ...@@ -347,9 +347,6 @@ namespace video
virtual ITexture* createDeviceDependentTextureCubemap(const io::path& name, const core::array<IImage*>& image) _IRR_OVERRIDE_; virtual ITexture* createDeviceDependentTextureCubemap(const io::path& name, const core::array<IImage*>& image) _IRR_OVERRIDE_;
//! returns the current size of the screen or rendertarget
virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const _IRR_OVERRIDE_;
//! Adds a new material renderer to the VideoDriver, using pixel and/or //! Adds a new material renderer to the VideoDriver, using pixel and/or
//! vertex shaders to render geometry. //! vertex shaders to render geometry.
s32 addShaderMaterial(const c8* vertexShaderProgram, const c8* pixelShaderProgram, s32 addShaderMaterial(const c8* vertexShaderProgram, const c8* pixelShaderProgram,
...@@ -415,7 +412,6 @@ namespace video ...@@ -415,7 +412,6 @@ namespace video
IDirect3DSurface9* BackBufferSurface; IDirect3DSurface9* BackBufferSurface;
IDirect3DSurface9* DepthStencilSurface; IDirect3DSurface9* DepthStencilSurface;
core::dimension2d<u32> CurrentRendertargetSize;
core::array<bool> ActiveRenderTarget; core::array<bool> ActiveRenderTarget;
HWND WindowId; HWND WindowId;
......
...@@ -968,11 +968,12 @@ IRenderTarget* CNullDriver::getCurrentRenderTarget() const ...@@ -968,11 +968,12 @@ IRenderTarget* CNullDriver::getCurrentRenderTarget() const
} }
//! returns the current render target size,
//! or the screen size if render targets are not implemented
const core::dimension2d<u32>& CNullDriver::getCurrentRenderTargetSize() const const core::dimension2d<u32>& CNullDriver::getCurrentRenderTargetSize() const
{ {
return ScreenSize; if (CurrentRenderTargetSize.Width == 0)
return ScreenSize;
else
return CurrentRenderTargetSize;
} }
......
...@@ -3745,15 +3745,6 @@ bool COpenGLDriver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SCol ...@@ -3745,15 +3745,6 @@ bool COpenGLDriver::setRenderTargetEx(IRenderTarget* target, u16 clearFlag, SCol
} }
// returns the current size of the screen or rendertarget
const core::dimension2d<u32>& COpenGLDriver::getCurrentRenderTargetSize() const
{
if (CurrentRenderTargetSize.Width == 0)
return ScreenSize;
else
return CurrentRenderTargetSize;
}
void COpenGLDriver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil) void COpenGLDriver::clearBuffers(u16 flag, SColor color, f32 depth, u8 stencil)
{ {
GLbitfield mask = 0; GLbitfield mask = 0;
......
...@@ -420,9 +420,6 @@ namespace video ...@@ -420,9 +420,6 @@ namespace video
//! sets the needed renderstates //! sets the needed renderstates
void setRenderStates2DMode(bool alpha, bool texture, bool alphaChannel); void setRenderStates2DMode(bool alpha, bool texture, bool alphaChannel);
// returns the current size of the screen or rendertarget
virtual const core::dimension2d<u32>& getCurrentRenderTargetSize() const _IRR_OVERRIDE_;
void createMaterialRenderers(); void createMaterialRenderers();
//! Assign a hardware light to the specified requested light, if any //! Assign a hardware light to the specified requested light, if any
......
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