mirror of
https://github.com/love2d/love.git
synced 2026-08-16 08:11:02 +02:00
Always use explicitly typed buffers, even in internal code
This commit is contained in:
@@ -35,25 +35,8 @@ namespace graphics
|
||||
namespace opengl
|
||||
{
|
||||
|
||||
Buffer::Buffer(const Settings &settings, const void *data, size_t size)
|
||||
: love::graphics::Buffer(settings, data, size)
|
||||
{
|
||||
initialize(data);
|
||||
}
|
||||
|
||||
Buffer::Buffer(love::graphics::Graphics *gfx, const Settings &settings, const std::vector<DataDeclaration> &format, const void *data, size_t size, size_t arraylength)
|
||||
: love::graphics::Buffer(gfx, settings, format, data, size, arraylength)
|
||||
{
|
||||
initialize(data);
|
||||
}
|
||||
|
||||
Buffer::~Buffer()
|
||||
{
|
||||
unloadVolatile();
|
||||
delete[] memoryMap;
|
||||
}
|
||||
|
||||
void Buffer::initialize(const void *data)
|
||||
: love::graphics::Buffer(gfx, settings, format, size, arraylength)
|
||||
{
|
||||
if (typeFlags & TYPEFLAG_VERTEX)
|
||||
mapType = BUFFERTYPE_VERTEX;
|
||||
@@ -81,6 +64,12 @@ void Buffer::initialize(const void *data)
|
||||
}
|
||||
}
|
||||
|
||||
Buffer::~Buffer()
|
||||
{
|
||||
unloadVolatile();
|
||||
delete[] memoryMap;
|
||||
}
|
||||
|
||||
bool Buffer::loadVolatile()
|
||||
{
|
||||
return load(true);
|
||||
|
||||
Reference in New Issue
Block a user