- BurningVideo: 0.50
- 10 year anniversary update - Lighting model reworked. moved to eyespace like openGL. [Specular Highlights, Fog, Sphere/Reflection Map] - increased internal s4DVertex to support 4 Textures and 4 Colors [switchable] - Textures are handled as sRGB during Mipmap Generation. More accurate, less visual disruption - 2D is drawn as 3D like hardware drivers. [switchable]. enables viewport scaling, material2D - Texture Spatial Resolution Limiting working. [lower memory consumption,SOFTWARE_DRIVER_2_TEXTURE_MAXSIZE] - SuperTuxKart 8.0.1 playable git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/trunk@6086 dfc29bdd-3216-0410-991c-e03cc46cb475
This commit is contained in:
@@ -30,30 +30,32 @@ CDepthBuffer::CDepthBuffer(const core::dimension2d<u32>& size)
|
||||
//! destructor
|
||||
CDepthBuffer::~CDepthBuffer()
|
||||
{
|
||||
delete [] Buffer;
|
||||
if (Buffer)
|
||||
{
|
||||
delete[] Buffer;
|
||||
Buffer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! clears the zbuffer
|
||||
void CDepthBuffer::clear()
|
||||
void CDepthBuffer::clear(f32 value)
|
||||
{
|
||||
ieee754 zMaxValue;
|
||||
|
||||
#ifdef SOFTWARE_DRIVER_2_USE_WBUFFER
|
||||
f32 zMax = 0.f;
|
||||
zMaxValue.f = 1.f-value;
|
||||
#else
|
||||
f32 zMax = 1.f;
|
||||
zMaxValue.f = value;
|
||||
#endif
|
||||
|
||||
u32 zMaxValue;
|
||||
zMaxValue = IR(zMax);
|
||||
|
||||
memset32 ( Buffer, zMaxValue, TotalSize );
|
||||
memset32 ( Buffer, zMaxValue.u, TotalSize );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! sets the new size of the zbuffer
|
||||
//! sets the new size of the buffer
|
||||
void CDepthBuffer::setSize(const core::dimension2d<u32>& size)
|
||||
{
|
||||
if (size == Size)
|
||||
@@ -65,13 +67,13 @@ void CDepthBuffer::setSize(const core::dimension2d<u32>& size)
|
||||
|
||||
Pitch = size.Width * sizeof ( fp24 );
|
||||
TotalSize = Pitch * size.Height;
|
||||
Buffer = new u8[TotalSize];
|
||||
Buffer = new u8[align_next(TotalSize,16)];
|
||||
clear ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! returns the size of the zbuffer
|
||||
//! returns the size of the buffer
|
||||
const core::dimension2d<u32>& CDepthBuffer::getSize() const
|
||||
{
|
||||
return Size;
|
||||
@@ -80,11 +82,11 @@ const core::dimension2d<u32>& CDepthBuffer::getSize() const
|
||||
// -----------------------------------------------------------------
|
||||
|
||||
//! constructor
|
||||
CStencilBuffer::CStencilBuffer(const core::dimension2d<u32>& size)
|
||||
: Buffer(0), Size(0,0)
|
||||
CStencilBuffer::CStencilBuffer(const core::dimension2d<u32>& size, unsigned bit)
|
||||
: Buffer(0), Size(0,0),Bit(bit)
|
||||
{
|
||||
#ifdef _DEBUG
|
||||
setDebugName("CDepthBuffer");
|
||||
setDebugName("CStencilBuffer");
|
||||
#endif
|
||||
|
||||
setSize(size);
|
||||
@@ -95,20 +97,30 @@ CStencilBuffer::CStencilBuffer(const core::dimension2d<u32>& size)
|
||||
//! destructor
|
||||
CStencilBuffer::~CStencilBuffer()
|
||||
{
|
||||
delete [] Buffer;
|
||||
if (Buffer)
|
||||
{
|
||||
delete[] Buffer;
|
||||
Buffer = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! clears the zbuffer
|
||||
void CStencilBuffer::clear()
|
||||
//! clears the buffer
|
||||
void CStencilBuffer::clear(u8 value)
|
||||
{
|
||||
memset32 ( Buffer, 0, TotalSize );
|
||||
u32 set = value;
|
||||
if (Bit == 8)
|
||||
{
|
||||
set |= set << 8;
|
||||
set |= set << 16;
|
||||
}
|
||||
memset32 ( Buffer, set, TotalSize );
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! sets the new size of the zbuffer
|
||||
//! sets the new size of the buffer
|
||||
void CStencilBuffer::setSize(const core::dimension2d<u32>& size)
|
||||
{
|
||||
if (size == Size)
|
||||
@@ -118,15 +130,15 @@ void CStencilBuffer::setSize(const core::dimension2d<u32>& size)
|
||||
|
||||
delete [] Buffer;
|
||||
|
||||
Pitch = size.Width * sizeof ( u32 );
|
||||
Pitch = size.Width * sizeof (tStencilSample);
|
||||
TotalSize = Pitch * size.Height;
|
||||
Buffer = new u8[TotalSize];
|
||||
Buffer = new u8[align_next(TotalSize,16)];
|
||||
clear ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
//! returns the size of the zbuffer
|
||||
//! returns the size of the buffer
|
||||
const core::dimension2d<u32>& CStencilBuffer::getSize() const
|
||||
{
|
||||
return Size;
|
||||
@@ -155,11 +167,11 @@ IDepthBuffer* createDepthBuffer(const core::dimension2d<u32>& size)
|
||||
}
|
||||
|
||||
|
||||
//! creates a ZBuffer
|
||||
IStencilBuffer* createStencilBuffer(const core::dimension2d<u32>& size)
|
||||
//! creates a Stencil Buffer
|
||||
IStencilBuffer* createStencilBuffer(const core::dimension2d<u32>& size, u32 bit)
|
||||
{
|
||||
#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
|
||||
return new CStencilBuffer(size);
|
||||
return new CStencilBuffer(size,bit);
|
||||
#else
|
||||
return 0;
|
||||
#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_
|
||||
|
Reference in New Issue
Block a user