Remove software depth buffer

This commit is contained in:
Vincent Lejeune 2015-01-10 23:58:28 +01:00
parent c17a093d83
commit f68ac808d6
3 changed files with 0 additions and 272 deletions

View File

@ -73,7 +73,6 @@ source/Irrlicht/CBoneSceneNode.cpp
source/Irrlicht/CNPKReader.cpp
source/Irrlicht/COpenGLSLMaterialRenderer.cpp
source/Irrlicht/CParticleRotationAffector.cpp
source/Irrlicht/CDepthBuffer.cpp
source/Irrlicht/CImageLoaderPSD.cpp
source/Irrlicht/CTriangleBBSelector.cpp
source/Irrlicht/CGUIComboBox.cpp
@ -290,7 +289,6 @@ source/Irrlicht/CImageLoaderJPG.h
source/Irrlicht/CBillboardSceneNode.h
source/Irrlicht/CIrrDeviceSDL.h
source/Irrlicht/CSkyDomeSceneNode.h
source/Irrlicht/CDepthBuffer.h
source/Irrlicht/CGUIInOutFader.h
source/Irrlicht/CGUIFont.h
source/Irrlicht/CGUIImageList.h

View File

@ -1,176 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#include "IrrCompileConfig.h"
#include "SoftwareDriver2_compile_config.h"
#include "CDepthBuffer.h"
#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
namespace irr
{
namespace video
{
//! constructor
CDepthBuffer::CDepthBuffer(const core::dimension2d<u32>& size)
: Buffer(0), Size(0,0)
{
#ifdef _DEBUG
setDebugName("CDepthBuffer");
#endif
setSize(size);
}
//! destructor
CDepthBuffer::~CDepthBuffer()
{
if (Buffer)
delete [] Buffer;
}
//! clears the zbuffer
void CDepthBuffer::clear()
{
#ifdef SOFTWARE_DRIVER_2_USE_WBUFFER
f32 zMax = 0.f;
#else
f32 zMax = 1.f;
#endif
u32 zMaxValue;
zMaxValue = IR(zMax);
memset32 ( Buffer, zMaxValue, TotalSize );
}
//! sets the new size of the zbuffer
void CDepthBuffer::setSize(const core::dimension2d<u32>& size)
{
if (size == Size)
return;
Size = size;
if (Buffer)
delete [] Buffer;
Pitch = size.Width * sizeof ( fp24 );
TotalSize = Pitch * size.Height;
Buffer = new u8[TotalSize];
clear ();
}
//! returns the size of the zbuffer
const core::dimension2d<u32>& CDepthBuffer::getSize() const
{
return Size;
}
// -----------------------------------------------------------------
//! constructor
CStencilBuffer::CStencilBuffer(const core::dimension2d<u32>& size)
: Buffer(0), Size(0,0)
{
#ifdef _DEBUG
setDebugName("CDepthBuffer");
#endif
setSize(size);
}
//! destructor
CStencilBuffer::~CStencilBuffer()
{
if (Buffer)
delete [] Buffer;
}
//! clears the zbuffer
void CStencilBuffer::clear()
{
memset32 ( Buffer, 0, TotalSize );
}
//! sets the new size of the zbuffer
void CStencilBuffer::setSize(const core::dimension2d<u32>& size)
{
if (size == Size)
return;
Size = size;
if (Buffer)
delete [] Buffer;
Pitch = size.Width * sizeof ( u32 );
TotalSize = Pitch * size.Height;
Buffer = new u8[TotalSize];
clear ();
}
//! returns the size of the zbuffer
const core::dimension2d<u32>& CStencilBuffer::getSize() const
{
return Size;
}
} // end namespace video
} // end namespace irr
#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_
namespace irr
{
namespace video
{
//! creates a ZBuffer
IDepthBuffer* createDepthBuffer(const core::dimension2d<u32>& size)
{
#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
return new CDepthBuffer(size);
#else
return 0;
#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_
}
//! creates a ZBuffer
IStencilBuffer* createStencilBuffer(const core::dimension2d<u32>& size)
{
#ifdef _IRR_COMPILE_WITH_BURNINGSVIDEO_
return new CStencilBuffer(size);
#else
return 0;
#endif // _IRR_COMPILE_WITH_BURNINGSVIDEO_
}
} // end namespace video
} // end namespace irr

View File

@ -1,94 +0,0 @@
// Copyright (C) 2002-2012 Nikolaus Gebhardt / Thomas Alten
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __C_Z_BUFFER_H_INCLUDED__
#define __C_Z_BUFFER_H_INCLUDED__
#include "IDepthBuffer.h"
namespace irr
{
namespace video
{
class CDepthBuffer : public IDepthBuffer
{
public:
//! constructor
CDepthBuffer(const core::dimension2d<u32>& size);
//! destructor
virtual ~CDepthBuffer();
//! clears the zbuffer
virtual void clear();
//! sets the new size of the zbuffer
virtual void setSize(const core::dimension2d<u32>& size);
//! returns the size of the zbuffer
virtual const core::dimension2d<u32>& getSize() const;
//! locks the zbuffer
virtual void* lock() { return (void*) Buffer; }
//! unlocks the zbuffer
virtual void unlock() {}
//! returns pitch of depthbuffer (in bytes)
virtual u32 getPitch() const { return Pitch; }
private:
u8* Buffer;
core::dimension2d<u32> Size;
u32 TotalSize;
u32 Pitch;
};
class CStencilBuffer : public IStencilBuffer
{
public:
//! constructor
CStencilBuffer(const core::dimension2d<u32>& size);
//! destructor
virtual ~CStencilBuffer();
//! clears the zbuffer
virtual void clear();
//! sets the new size of the zbuffer
virtual void setSize(const core::dimension2d<u32>& size);
//! returns the size of the zbuffer
virtual const core::dimension2d<u32>& getSize() const;
//! locks the zbuffer
virtual void* lock() { return (void*) Buffer; }
//! unlocks the zbuffer
virtual void unlock() {}
//! returns pitch of depthbuffer (in bytes)
virtual u32 getPitch() const { return Pitch; }
private:
u8* Buffer;
core::dimension2d<u32> Size;
u32 TotalSize;
u32 Pitch;
};
} // end namespace video
} // end namespace irr
#endif