mirror of
https://gitea.wildfiregames.com/0ad/0ad.git
synced 2026-07-24 08:33:32 +00:00
# New territory border rendering.
Add textured line overlay rendering. Change terrain height calculations to be triangulation-dependent for improved accuracy. Add triangulation-dependent terrain normal function. Support separate S/T wrap modes for textures. Rename CVector2D_Maths since it no longer conflicts with simulation CVector2D. Coalesce freed chunks in vertex buffers, to avoid excessive fragmentation. Add some things to help debug vertex buffer allocation a little. This was SVN commit r9929.
This commit is contained in:
@@ -26,14 +26,10 @@
|
||||
#include "lib/ogl.h"
|
||||
#include "ps/CLogger.h"
|
||||
|
||||
#define DUMP_VB_STATS 0 // for debugging
|
||||
|
||||
CVertexBufferManager g_VBMan;
|
||||
|
||||
// janwas 2004-06-14: added dtor
|
||||
|
||||
CVertexBufferManager::~CVertexBufferManager()
|
||||
{
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// Explicit shutdown of the vertex buffer subsystem.
|
||||
// This avoids the ordering issues that arise when using destructors of
|
||||
@@ -61,9 +57,22 @@ CVertexBuffer::VBChunk* CVertexBufferManager::Allocate(size_t vertexSize, size_t
|
||||
|
||||
// TODO, RC - run some sanity checks on allocation request
|
||||
|
||||
typedef std::list<CVertexBuffer*>::iterator Iter;
|
||||
|
||||
#if DUMP_VB_STATS
|
||||
debug_printf(L"\n============================\n# allocate vsize=%d nverts=%d\n\n", vertexSize, numVertices);
|
||||
for (Iter iter = m_Buffers.begin(); iter != m_Buffers.end(); ++iter) {
|
||||
CVertexBuffer* buffer = *iter;
|
||||
if (buffer->CompatibleVertexType(vertexSize, usage, target))
|
||||
{
|
||||
debug_printf(L"%p\n", buffer);
|
||||
buffer->DumpStatus();
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
// iterate through all existing buffers testing for one that'll
|
||||
// satisfy the allocation
|
||||
typedef std::list<CVertexBuffer*>::iterator Iter;
|
||||
for (Iter iter = m_Buffers.begin(); iter != m_Buffers.end(); ++iter) {
|
||||
CVertexBuffer* buffer = *iter;
|
||||
result = buffer->Allocate(vertexSize, numVertices, usage, target);
|
||||
@@ -89,6 +98,9 @@ CVertexBuffer::VBChunk* CVertexBufferManager::Allocate(size_t vertexSize, size_t
|
||||
void CVertexBufferManager::Release(CVertexBuffer::VBChunk* chunk)
|
||||
{
|
||||
ENSURE(chunk);
|
||||
#if DUMP_VB_STATS
|
||||
debug_printf(L"\n============================\n# release %p nverts=%d\n\n", chunk, chunk->m_Count);
|
||||
#endif
|
||||
chunk->m_Owner->Release(chunk);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user