Retour
Version Originale

./aip/1.8aipmod/source/Irrlicht/CZBuffer.cpp :


// Copyright (C) 2002-2011 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<u32>& 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<u32>& 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<u32>& 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<u32>& size)
{
	#ifdef _IRR_COMPILE_WITH_SOFTWARE_
	return new CZBuffer(size);
	#else
	return 0;
	#endif // _IRR_COMPILE_WITH_SOFTWARE_

}


} // end namespace video

} // end namespace irr




Options Liens officiels Caractéristiques Statistiques Communauté
Corrections
irrlicht
irrklang
irredit
irrxml
xhtml 1.0
css 2.1
Propulsé par FluxBB
Traduit par FluxBB.fr
883 membres
1429 sujets
11121 messages
Dernier membre inscrit: Saidov17
32 invités en ligne
Aucun membre connecté
RSS Feed