Batch #1715 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_02162 RenderVertexPool::~RenderVertexPool: logic confirmed by peer review Reviewed-by: ragnarok-clanker
34 lines
826 B
C++
34 lines
826 B
C++
#ifndef RAGNAROK_SOURCE_RENDER_PRIMITIVES_RENDERVERTEXPOOL_H
|
|
#define RAGNAROK_SOURCE_RENDER_PRIMITIVES_RENDERVERTEXPOOL_H
|
|
|
|
#include "Render/Primitives/RenderPrimitive.h"
|
|
|
|
#include <forward_list>
|
|
#include <memory>
|
|
#include <vector>
|
|
|
|
class RenderVertexPool {
|
|
public:
|
|
RenderVertexPool();
|
|
~RenderVertexPool();
|
|
RenderVertex* Acquire(unsigned count);
|
|
void Rewind();
|
|
|
|
private:
|
|
struct Block : std::vector<RenderVertex> {
|
|
RenderVertex* Append(unsigned count);
|
|
};
|
|
|
|
/* 00B0 */ unsigned m_minimum;
|
|
/* 00B4 */ unsigned m_used;
|
|
/* 00B8 */ std::forward_list<std::unique_ptr<Block>> m_active;
|
|
/* 00BC */ std::forward_list<std::unique_ptr<Block>> m_unused;
|
|
Block& Activate(unsigned capacity);
|
|
void Release();
|
|
};
|
|
|
|
#if defined(_WIN32) && !defined(_WIN64)
|
|
static_assert(sizeof(RenderVertexPool) == 16);
|
|
#endif
|
|
|
|
#endif
|