From f9158592e1478b2013afc7041d9ed041cf2d2f4a Mon Sep 17 00:00:00 2001 From: David Walter Seikel Date: Mon, 13 Jan 2014 19:47:58 +1000 Subject: Update Irrlicht to 1.8.1. Include actual change markers this time. lol --- .../irrlicht-1.8.1/source/Irrlicht/CZBuffer.cpp | 109 +++++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 libraries/irrlicht-1.8.1/source/Irrlicht/CZBuffer.cpp (limited to 'libraries/irrlicht-1.8.1/source/Irrlicht/CZBuffer.cpp') diff --git a/libraries/irrlicht-1.8.1/source/Irrlicht/CZBuffer.cpp b/libraries/irrlicht-1.8.1/source/Irrlicht/CZBuffer.cpp new file mode 100644 index 0000000..23b515b --- /dev/null +++ b/libraries/irrlicht-1.8.1/source/Irrlicht/CZBuffer.cpp @@ -0,0 +1,109 @@ +// Copyright (C) 2002-2012 Nikolaus Gebhardt +// This file is part of the "Irrlicht Engine". +// For conditions of distribution and use, see copyright notice in irrlicht.h + +#include "IrrCompileConfig.h" +#include "CZBuffer.h" +#include "irrString.h" + +#ifdef _IRR_COMPILE_WITH_SOFTWARE_ + +namespace irr +{ +namespace video +{ + + +//! constructor +CZBuffer::CZBuffer(const core::dimension2d& size) +: Buffer(0), BufferEnd(0), Size(0,0), TotalSize(0) +{ + #ifdef _DEBUG + setDebugName("CZBuffer"); + #endif + + setSize(size); +} + + + +//! destructor +CZBuffer::~CZBuffer() +{ + delete [] Buffer; +} + + + +//! clears the zbuffer +void CZBuffer::clear() +{ + memset(Buffer, 0, (BufferEnd-Buffer)*sizeof(TZBufferType)); +} + + + +//! sets the new size of the zbuffer +void CZBuffer::setSize(const core::dimension2d& size) +{ + if (size == Size) + return; + + Size = size; + + delete [] Buffer; + + TotalSize = size.Width * size.Height; + Buffer = new TZBufferType[TotalSize]; + BufferEnd = Buffer + TotalSize; +} + + + +//! returns the size of the zbuffer +const core::dimension2d& CZBuffer::getSize() const +{ + return Size; +} + + + +//! locks the zbuffer +TZBufferType* CZBuffer::lock() +{ + return Buffer; +} + + + +//! unlocks the zbuffer +void CZBuffer::unlock() +{ +} + +} // end namespace video +} // end namespace irr + +#endif // _IRR_COMPILE_WITH_SOFTWARE_ + +namespace irr +{ +namespace video +{ + +//! creates a ZBuffer +IZBuffer* createZBuffer(const core::dimension2d& size) +{ + #ifdef _IRR_COMPILE_WITH_SOFTWARE_ + return new CZBuffer(size); + #else + return 0; + #endif // _IRR_COMPILE_WITH_SOFTWARE_ +} + + +} // end namespace video +} // end namespace irr + + + -- cgit v1.1