From 55155fe4ce60984e0d0e58c4a881c195b6a88169 Mon Sep 17 00:00:00 2001 From: Peter Schaefer Date: Tue, 12 Apr 2016 16:32:15 +0200 Subject: [PATCH] removed Texture from Model (no longer needed) --- Weave/Graphix/Model/IMesh.cpp | 1 - Weave/Graphix/Model/IMetaMesh.cpp | 4 ++-- Weave/Graphix/Model/IMetaMesh.h | 3 +-- Weave/Graphix/Model/Model.cpp | 6 +++--- Weave/Graphix/Model/Model.h | 3 +-- Weave/Graphix/Model/SkyBox.cpp | 4 ++-- Weave/Graphix/Model/SkyBox.h | 2 +- Weave/Scene/SceneObject.cpp | 4 ++-- 8 files changed, 12 insertions(+), 15 deletions(-) diff --git a/Weave/Graphix/Model/IMesh.cpp b/Weave/Graphix/Model/IMesh.cpp index 1ccc687..81c0cec 100644 --- a/Weave/Graphix/Model/IMesh.cpp +++ b/Weave/Graphix/Model/IMesh.cpp @@ -9,7 +9,6 @@ #include #include "../Shader.h" -#include "../Texture.h" #include "../../Message.h" #include "../Graphix.h" diff --git a/Weave/Graphix/Model/IMetaMesh.cpp b/Weave/Graphix/Model/IMetaMesh.cpp index 1b5fccc..6cb7e04 100644 --- a/Weave/Graphix/Model/IMetaMesh.cpp +++ b/Weave/Graphix/Model/IMetaMesh.cpp @@ -146,11 +146,11 @@ void IMetaMesh::unbindShader(Shader* _shader) } } -void IMetaMesh::drawModel(Texture* _texture, const mat4& _modelMat) const +void IMetaMesh::drawModel(const mat4& _modelMat) const { for (auto i = models.begin(); i != models.end(); ++i) { - i->first->drawModel(_texture, _modelMat* i->second); + i->first->drawModel(_modelMat* i->second); } } diff --git a/Weave/Graphix/Model/IMetaMesh.h b/Weave/Graphix/Model/IMetaMesh.h index e5cdce3..781fd29 100644 --- a/Weave/Graphix/Model/IMetaMesh.h +++ b/Weave/Graphix/Model/IMetaMesh.h @@ -8,7 +8,6 @@ class IMesh; class Shader; -class Texture; class IMetaMesh : public Model { @@ -23,7 +22,7 @@ public: void unbindModel() override; void unbindShader(Shader* shader) override; - void drawModel(Texture* texture, const mat4& modelMat) const override; + void drawModel(const mat4& modelMat) const override; void drawBBox(const mat4& modelMat, const vec4& color = vec4(0.9f, 0.f, 0.f, 1.f)) const override; diff --git a/Weave/Graphix/Model/Model.cpp b/Weave/Graphix/Model/Model.cpp index 21f2509..a9739ae 100644 --- a/Weave/Graphix/Model/Model.cpp +++ b/Weave/Graphix/Model/Model.cpp @@ -4,7 +4,7 @@ #include "../../Message.h" #include "../Shader.h" -#include "../Texture.h" + #include "../Graphix.h" @@ -133,7 +133,7 @@ void Model::drawWire() const glBindVertexArray(0); } -void Model::drawModel(Texture* _texture, const mat4& _modelMat) const +void Model::drawModel(const mat4& _modelMat) const { useModel(_modelMat); @@ -172,7 +172,7 @@ void Model::drawBBox(const mat4& _modelMat, const vec4& _color) const vec3 size = (max - min); vec3 center = (max + min) * .5f; Graphix::shader_BBox->useShader(); - getBBoxModel()->drawModel(nullptr, _modelMat*translate(center)*glm::scale(size)); // + getBBoxModel()->drawModel(_modelMat*translate(center)*glm::scale(size)); // } //void Model::getBBcs(vec3& _center, vec3& _size) const diff --git a/Weave/Graphix/Model/Model.h b/Weave/Graphix/Model/Model.h index d8f2209..dba4ac8 100644 --- a/Weave/Graphix/Model/Model.h +++ b/Weave/Graphix/Model/Model.h @@ -7,7 +7,6 @@ #include class Shader; -class Texture; struct aiMesh; typedef unsigned int uint; @@ -25,7 +24,7 @@ public: virtual void unbindShader(Shader* shader); /* Draws Model */ - virtual void drawModel(Texture* texture, const mat4& modelMat) const; + virtual void drawModel(const mat4& modelMat) const; virtual void drawWire(const mat4& modelMat) const; /* Draws a BoundingBox around the Model */ diff --git a/Weave/Graphix/Model/SkyBox.cpp b/Weave/Graphix/Model/SkyBox.cpp index d932564..b17a61e 100644 --- a/Weave/Graphix/Model/SkyBox.cpp +++ b/Weave/Graphix/Model/SkyBox.cpp @@ -25,7 +25,7 @@ SkyBox::~SkyBox() { } -void SkyBox::drawModel(Texture* _texture, const mat4& _modelMat) const +void SkyBox::drawModel(const mat4& _modelMat) const { //_shader->useShader(); //GLint OldCullFaceMode; @@ -35,7 +35,7 @@ void SkyBox::drawModel(Texture* _texture, const mat4& _modelMat) const //glCullFace(GL_FRONT); glDepthFunc(GL_LEQUAL); //glDisable(GL_DEPTH_TEST); - Model::drawModel(_texture, _modelMat); + Model::drawModel(_modelMat); //glEnable(GL_DEPTH_TEST); //glCullFace(OldCullFaceMode); glDepthFunc(OldDepthFuncMode); diff --git a/Weave/Graphix/Model/SkyBox.h b/Weave/Graphix/Model/SkyBox.h index 3371573..2ce87da 100644 --- a/Weave/Graphix/Model/SkyBox.h +++ b/Weave/Graphix/Model/SkyBox.h @@ -10,7 +10,7 @@ public: SkyBox(); ~SkyBox(); - void drawModel(Texture* texture, const mat4& modelMat) const override; + void drawModel(const mat4& modelMat) const override; //uncommend following lines to use default Loaders //void useModelMat(const mat4& model, Shader* shader) const override; diff --git a/Weave/Scene/SceneObject.cpp b/Weave/Scene/SceneObject.cpp index dc0fc4a..c2ecd43 100644 --- a/Weave/Scene/SceneObject.cpp +++ b/Weave/Scene/SceneObject.cpp @@ -233,12 +233,12 @@ void SceneObject::draw() const /* Draw Object*/ shader->useShader(); texture->useTexture(); - model->drawModel(texture, modelMat); + model->drawModel(modelMat); if (Events::isKToggleActive(SDLK_F6) && collision != nullptr) { collision->drawBBox(modelMat); - //collision->drawWire(shader, modelMat); + //collision->drawWire(modelMat); } } -- 2.47.3