Initialize raw pointers as nullptr
This commit is contained in:
@@ -9,7 +9,7 @@ namespace Inferno {
|
|||||||
class LuaScript;
|
class LuaScript;
|
||||||
|
|
||||||
struct LuaScriptComponent {
|
struct LuaScriptComponent {
|
||||||
LuaScript* instance = nullptr;
|
LuaScript* instance { nullptr };
|
||||||
std::string path;
|
std::string path;
|
||||||
|
|
||||||
// Dont allow manually setting instance during construction
|
// Dont allow manually setting instance during construction
|
||||||
|
|||||||
@@ -7,7 +7,7 @@
|
|||||||
namespace Inferno {
|
namespace Inferno {
|
||||||
|
|
||||||
struct NativeScriptComponent {
|
struct NativeScriptComponent {
|
||||||
NativeScript* instance = nullptr;
|
NativeScript* instance { nullptr };
|
||||||
|
|
||||||
NativeScript* (*initialize)();
|
NativeScript* (*initialize)();
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,7 @@ namespace Inferno {
|
|||||||
virtual ~StringLogStream() override;
|
virtual ~StringLogStream() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
std::string* m_fill;
|
std::string* m_fill { nullptr };
|
||||||
};
|
};
|
||||||
|
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ namespace Inferno {
|
|||||||
void setCurrent();
|
void setCurrent();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
GLFWwindow* m_window;
|
GLFWwindow* m_window { nullptr };
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -88,8 +88,8 @@ namespace Inferno {
|
|||||||
std::array<std::shared_ptr<Texture>, textureUnitPerBatch> m_textureUnits;
|
std::array<std::shared_ptr<Texture>, textureUnitPerBatch> m_textureUnits;
|
||||||
|
|
||||||
// GPU objects
|
// GPU objects
|
||||||
std::shared_ptr<Shader> m_shader = nullptr;
|
std::shared_ptr<Shader> m_shader;
|
||||||
std::shared_ptr<VertexArray> m_vertexArray = nullptr;
|
std::shared_ptr<VertexArray> m_vertexArray;
|
||||||
};
|
};
|
||||||
|
|
||||||
// -----------------------------------------
|
// -----------------------------------------
|
||||||
@@ -122,8 +122,8 @@ namespace Inferno {
|
|||||||
void nextBatch() override;
|
void nextBatch() override;
|
||||||
|
|
||||||
// CPU quad vertices
|
// CPU quad vertices
|
||||||
std::unique_ptr<QuadVertex[]> m_vertexBufferBase = nullptr;
|
std::unique_ptr<QuadVertex[]> m_vertexBufferBase;
|
||||||
QuadVertex* m_vertexBufferPtr = nullptr;
|
QuadVertex* m_vertexBufferPtr { nullptr };
|
||||||
|
|
||||||
// Default quad vertex positions
|
// Default quad vertex positions
|
||||||
glm::vec4 m_vertexPositions[vertexPerQuad];
|
glm::vec4 m_vertexPositions[vertexPerQuad];
|
||||||
@@ -156,8 +156,8 @@ namespace Inferno {
|
|||||||
void nextBatch() override;
|
void nextBatch() override;
|
||||||
|
|
||||||
// CPU quad vertices
|
// CPU quad vertices
|
||||||
std::unique_ptr<CharacterVertex[]> m_vertexBufferBase = nullptr;
|
std::unique_ptr<CharacterVertex[]> m_vertexBufferBase;
|
||||||
CharacterVertex* m_vertexBufferPtr = nullptr;
|
CharacterVertex* m_vertexBufferPtr { nullptr };
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ namespace Inferno {
|
|||||||
void updatePerspective(float deltaTime);
|
void updatePerspective(float deltaTime);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CameraComponent* m_camera;
|
CameraComponent* m_camera { nullptr };
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,9 +45,9 @@ namespace Inferno {
|
|||||||
sol::state m_state;
|
sol::state m_state;
|
||||||
std::string m_path = "";
|
std::string m_path = "";
|
||||||
|
|
||||||
Scene* m_scene = nullptr;
|
Scene* m_scene { nullptr };
|
||||||
uint32_t m_entity = 0;
|
uint32_t m_entity { 0 };
|
||||||
TransformComponent* transform = nullptr;
|
TransformComponent* transform { nullptr };
|
||||||
|
|
||||||
friend class ScriptSystem;
|
friend class ScriptSystem;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,11 +22,11 @@ namespace Inferno {
|
|||||||
return m_scene->getComponent<T>(m_entity);
|
return m_scene->getComponent<T>(m_entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
TransformComponent* transform = nullptr;
|
TransformComponent* transform { nullptr };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Scene* m_scene = nullptr;
|
Scene* m_scene { nullptr };
|
||||||
uint32_t m_entity = 0;
|
uint32_t m_entity { 0 };
|
||||||
|
|
||||||
friend class ScriptSystem;
|
friend class ScriptSystem;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace Inferno {
|
|||||||
void setScene(Scene* scene) { m_scene = scene; }
|
void setScene(Scene* scene) { m_scene = scene; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Scene* m_scene;
|
Scene* m_scene { nullptr };
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user