mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
GRIM: Implement destroyMesh [OpenGLS]
This commit is contained in:
parent
77eef29e49
commit
57a3142fd8
@ -268,6 +268,7 @@ public:
|
|||||||
virtual Material *getSpecialtyTexture(int n) { return &_specialty[n]; }
|
virtual Material *getSpecialtyTexture(int n) { return &_specialty[n]; }
|
||||||
|
|
||||||
virtual void createMesh(Mesh *mesh) {}
|
virtual void createMesh(Mesh *mesh) {}
|
||||||
|
virtual void destroyMesh(const Mesh *mesh) {}
|
||||||
virtual void createEMIModel(EMIModel *model) {}
|
virtual void createEMIModel(EMIModel *model) {}
|
||||||
virtual void updateEMIModel(const EMIModel *model) {}
|
virtual void updateEMIModel(const EMIModel *model) {}
|
||||||
|
|
||||||
|
@ -1938,6 +1938,24 @@ void GfxOpenGLS::createMesh(Mesh *mesh) {
|
|||||||
shader->disableVertexAttribute("color", Math::Vector4d(1.f, 1.f, 1.f, 1.f));
|
shader->disableVertexAttribute("color", Math::Vector4d(1.f, 1.f, 1.f, 1.f));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void GfxOpenGLS::destroyMesh(const Mesh *mesh) {
|
||||||
|
ModelUserData *mud = static_cast<ModelUserData *>(mesh->_userData);
|
||||||
|
|
||||||
|
for (int i = 0; i < mesh->_numFaces; ++i) {
|
||||||
|
MeshFace *face = &mesh->_faces[i];
|
||||||
|
if (face->_userData) {
|
||||||
|
uint32 *data = static_cast<uint32 *>(face->_userData);
|
||||||
|
delete data;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!mud)
|
||||||
|
return;
|
||||||
|
|
||||||
|
delete mud->_shader;
|
||||||
|
delete mud;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -201,6 +201,7 @@ public:
|
|||||||
virtual void createSpecialtyTextures() override;
|
virtual void createSpecialtyTextures() override;
|
||||||
|
|
||||||
virtual void createMesh(Mesh *mesh) override;
|
virtual void createMesh(Mesh *mesh) override;
|
||||||
|
virtual void destroyMesh(const Mesh *mesh) override;
|
||||||
virtual void createEMIModel(EMIModel *model) override;
|
virtual void createEMIModel(EMIModel *model) override;
|
||||||
virtual void updateEMIModel(const EMIModel* model) override;
|
virtual void updateEMIModel(const EMIModel* model) override;
|
||||||
|
|
||||||
|
@ -407,6 +407,8 @@ Mesh::Mesh() :
|
|||||||
|
|
||||||
|
|
||||||
Mesh::~Mesh() {
|
Mesh::~Mesh() {
|
||||||
|
g_driver->destroyMesh(this);
|
||||||
|
|
||||||
delete[] _vertices;
|
delete[] _vertices;
|
||||||
delete[] _verticesI;
|
delete[] _verticesI;
|
||||||
delete[] _vertNormals;
|
delete[] _vertNormals;
|
||||||
|
Loading…
Reference in New Issue
Block a user