Browse Source

Dont use new keyword with unique_ptr

master
Riyyi 4 years ago
parent
commit
e08eec3b36
  1. 4
      inferno/src/inferno/render/renderer.cpp
  2. 2
      inferno/src/inferno/render/renderer.h

4
inferno/src/inferno/render/renderer.cpp

@ -131,7 +131,7 @@ namespace Inferno {
// --------------------------------- // ---------------------------------
// Create array for storing quads vertices // Create array for storing quads vertices
m_vertexBufferBase = std::unique_ptr<QuadVertex[]>(new QuadVertex[vertexCount]); m_vertexBufferBase = std::make_unique<QuadVertex[]>(vertexCount);
m_vertexBufferPtr = m_vertexBufferBase.get(); m_vertexBufferPtr = m_vertexBufferBase.get();
// Set default quad vertex positions // Set default quad vertex positions
@ -288,7 +288,7 @@ namespace Inferno {
// --------------------------------- // ---------------------------------
// Create array for storing quads vertices // Create array for storing quads vertices
m_vertexBufferBase = std::unique_ptr<CharacterVertex[]>(new CharacterVertex[vertexCount]); m_vertexBufferBase = std::make_unique<CharacterVertex[]>(vertexCount);
m_vertexBufferPtr = m_vertexBufferBase.get(); m_vertexBufferPtr = m_vertexBufferBase.get();
// Generate indices // Generate indices

2
inferno/src/inferno/render/renderer.h

@ -2,7 +2,7 @@
#define RENDERER_H #define RENDERER_H
#include <cstdint> // std::uint32_t #include <cstdint> // std::uint32_t
#include <memory> // std::shared_ptr, std::unique_ptr #include <memory> // std::shared_ptr, std::unique_ptr, std::make_shared, std::make_unique
#include "glm/ext/matrix_float4x4.hpp" // glm::mat4 #include "glm/ext/matrix_float4x4.hpp" // glm::mat4
#include "glm/ext/vector_float2.hpp" // glm::vec2 #include "glm/ext/vector_float2.hpp" // glm::vec2

Loading…
Cancel
Save