Skip to content

Commit

Permalink
Move isFixed functionality to GameObject
Browse files Browse the repository at this point in the history
Previously, it was on Primitive
  • Loading branch information
aeris170 committed Jan 28, 2020
1 parent eb14dfd commit 08e4ed1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
11 changes: 8 additions & 3 deletions Engine/DoaGameObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@ namespace doa::scene {

class DOA_API GameObject {
protected:
glm::vec3* m_position;
glm::vec3* m_rotation;
glm::vec2* m_scale;
glm::vec3* m_position{ NULL };
glm::vec3* m_rotation{ NULL };
glm::vec2* m_scale{ NULL };

bool m_is_fixed{ false };

shader::ShaderProgram* m_shader{ NULL };

Expand All @@ -29,6 +31,9 @@ namespace doa::scene {
virtual inline void SetScale(const glm::vec2& newScale) { *m_scale = newScale; }
virtual inline void SetScale(float newScaleX, float newScaleY) { m_scale->x = newScaleX; m_scale->y = newScaleY; }

virtual inline const bool IsFixed() const { return m_is_fixed; }
virtual inline void SetFixed(const bool isFixed) { m_is_fixed = isFixed; }

virtual inline const shader::ShaderProgram* GetShaderProgramID() const { return m_shader; }
virtual inline void SetShaderProgram(shader::ShaderProgram* shader) { m_shader = shader; }

Expand Down
4 changes: 0 additions & 4 deletions Engine/DoaPrimitive.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ namespace doa::primitive {
RenderMode m_rMode;
DisplayMode m_dMode;

bool m_is_fixed{ false };

GLfloat* m_colors{ NULL };
int m_colors_count{ 0 };
mutable bool m_colors_changed{ false };
Expand Down Expand Up @@ -47,8 +45,6 @@ namespace doa::primitive {
virtual inline void SetRenderMode(const RenderMode rMode) { m_rMode = rMode; }
virtual inline const DisplayMode GetDisplayMode() const { return m_dMode; }
virtual inline void SetDisplayMode(const DisplayMode dMode) { m_dMode = dMode; }
virtual inline const bool IsFixed() const { return m_is_fixed; }
virtual inline void SetFixed(const bool isFixed) { m_is_fixed = isFixed; }
virtual inline float* GetVertexColors() const { return m_colors; }
virtual inline void SetVertexColor(const int vertex_index, const glm::vec3& color) {
if (vertex_index < 0 || vertex_index > m_type) return;
Expand Down

0 comments on commit 08e4ed1

Please sign in to comment.