1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-15 15:02:34 +02:00

Rename Model -> Clump

This commit is contained in:
Daniel Evans 2017-01-03 14:18:06 +00:00
parent 66dd55620d
commit 8e4d73fca9
35 changed files with 127 additions and 128 deletions

View File

@ -1,6 +1,6 @@
#include <btBulletDynamicsCommon.h>
#include <ai/CharacterController.hpp>
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <engine/Animator.hpp>
#include <engine/GameData.hpp>
#include <engine/GameWorld.hpp>

View File

@ -8,7 +8,7 @@
#include <vector>
#include <data/CollisionModel.hpp>
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <data/PathData.hpp>
#include <rw/defines.hpp>
#ifdef RW_WINDOWS
@ -133,13 +133,13 @@ public:
}
/// @todo change with librw
void setAtomic(Model* model, int n, ModelFrame* atomic) {
void setAtomic(Clump* model, int n, ModelFrame* atomic) {
model_ = model;
atomics_[n] = atomic;
}
/// @todo remove this
Model* getModel() const {
Clump* getModel() const {
return model_;
}
@ -204,7 +204,7 @@ public:
};
private:
Model* model_ = nullptr;
Clump* model_ = nullptr;
ModelFrame* atomics_[3] = {};
float loddistances_[3] = {};
uint8_t numatomics_ = 0;
@ -231,11 +231,11 @@ public:
ClumpModelInfo(ModelDataType type) : BaseModelInfo(type) {
}
void setModel(Model* model) {
void setModel(Clump* model) {
model_ = model;
}
Model* getModel() const {
Clump* getModel() const {
return model_;
}
@ -249,7 +249,7 @@ public:
}
private:
Model* model_ = nullptr;
Clump* model_ = nullptr;
};
/**

View File

@ -1,4 +1,4 @@
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <data/Skeleton.hpp>
#include <glm/gtc/matrix_transform.hpp>

View File

@ -1,10 +1,10 @@
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <data/Skeleton.hpp>
#include <engine/Animator.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <loaders/LoaderDFF.hpp>
Animator::Animator(Model* model, Skeleton* skeleton)
Animator::Animator(Clump* model, Skeleton* skeleton)
: model(model), skeleton(skeleton) {
}

View File

@ -8,7 +8,7 @@
#include <map>
#include <rw/defines.hpp>
class Model;
class Clump;
class ModelFrame;
class Skeleton;
@ -49,7 +49,7 @@ class Animator {
/**
* @brief model The model being animated.
*/
Model* model;
Clump* model;
/**
* @brief Skeleton instance.
@ -62,7 +62,7 @@ class Animator {
std::vector<AnimationState> animations;
public:
Animator(Model* model, Skeleton* skeleton);
Animator(Clump* model, Skeleton* skeleton);
Animation* getAnimation(unsigned int slot) {
if (slot < animations.size()) {

View File

@ -1,4 +1,4 @@
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <data/ModelData.hpp>
#include <data/WeaponData.hpp>
#include <engine/GameData.hpp>
@ -363,7 +363,7 @@ void GameData::getNameAndLod(std::string& name, int& lod) {
}
}
Model* GameData::loadClump(const std::string& name) {
Clump* GameData::loadClump(const std::string& name) {
auto file = index.openFile(name);
if (!file) {
logger->error("Data", "Failed to load model " + name);

View File

@ -133,7 +133,7 @@ public:
/**
* Loads an archived model and returns it directly
*/
Model* loadClump(const std::string& name);
Clump* loadClump(const std::string& name);
/**
* Loads a DFF and associates its atomics with models.

View File

@ -7,7 +7,7 @@
#include <BulletCollision/CollisionDispatch/btGhostObject.h>
#include <ai/DefaultAIController.hpp>
#include <ai/TrafficDirector.hpp>
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <data/WeaponData.hpp>
#include <loaders/LoaderIDE.hpp>
#include <loaders/LoaderIPL.hpp>

View File

@ -3,7 +3,7 @@
#include <objects/CutsceneObject.hpp>
CutsceneObject::CutsceneObject(GameWorld *engine, const glm::vec3 &pos,
const glm::quat &rot, Model *model,
const glm::quat &rot, Clump *model,
BaseModelInfo *modelinfo)
: GameObject(engine, pos, rot, modelinfo)
, _parent(nullptr)

View File

@ -12,7 +12,7 @@ class CutsceneObject : public GameObject {
public:
CutsceneObject(GameWorld* engine, const glm::vec3& pos,
const glm::quat& rot, Model* model,
const glm::quat& rot, Clump* model,
BaseModelInfo* modelinfo);
~CutsceneObject();

View File

@ -2,7 +2,7 @@
#ifndef _GAMEOBJECT_HPP_
#define _GAMEOBJECT_HPP_
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <glm/gtc/matrix_transform.hpp>
#include <glm/gtc/quaternion.hpp>
#include <loaders/LoaderIDE.hpp>
@ -33,7 +33,7 @@ class GameObject {
/**
* Model used for rendering
*/
Model* model_;
Clump* model_;
protected:
void changeModelInfo(BaseModelInfo* next) {
@ -106,14 +106,14 @@ public:
/**
* @return The model used in rendering
*/
Model* getModel() const {
Clump* getModel() const {
return model_;
}
/**
* Changes the current model, used for re-dressing chars
*/
void setModel(Model* model) {
void setModel(Clump* model) {
model_ = model;
}

View File

@ -1,6 +1,6 @@
#include <BulletDynamics/Vehicle/btRaycastVehicle.h>
#include <data/CollisionModel.hpp>
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <data/Skeleton.hpp>
#include <dynamics/CollisionInstance.hpp>
#include <dynamics/RaycastCallbacks.hpp>

View File

@ -1,7 +1,7 @@
#pragma once
#include <LinearMath/btIDebugDraw.h>
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <render/GameRenderer.hpp>
class DebugDraw : public btIDebugDraw {
@ -28,7 +28,7 @@ public:
protected:
int debugMode;
std::vector<Model::GeometryVertex> lines;
std::vector<Clump::GeometryVertex> lines;
size_t maxlines;
GeometryBuffer *lineBuff;
DrawBuffer *dbuff;

View File

@ -1,4 +1,4 @@
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <engine/Animator.hpp>
#include <engine/GameState.hpp>
#include <engine/GameWorld.hpp>
@ -475,11 +475,11 @@ void GameRenderer::renderPostProcess() {
renderer->drawArrays(glm::mat4(), &ssRectDraw, wdp);
}
void GameRenderer::renderGeometry(Model* model, size_t g,
void GameRenderer::renderGeometry(Clump* model, size_t g,
const glm::mat4& modelMatrix, float opacity,
GameObject* object) {
for (size_t sg = 0; sg < model->geometries[g]->subgeom.size(); ++sg) {
Model::SubGeometry& subgeom = model->geometries[g]->subgeom[sg];
Clump::SubGeometry& subgeom = model->geometries[g]->subgeom[sg];
Renderer::DrawParameters dp;
@ -489,7 +489,7 @@ void GameRenderer::renderGeometry(Model* model, size_t g,
dp.textures = {0};
if (model->geometries[g]->materials.size() > subgeom.material) {
Model::Material& mat =
Clump::Material& mat =
model->geometries[g]->materials[subgeom.material];
if (mat.textures.size() > 0) {
@ -656,7 +656,7 @@ void GameRenderer::drawColour(const glm::vec4& colour, glm::vec4 extents) {
renderer->invalidate();
}
bool GameRenderer::renderFrame(Model* m, ModelFrame* f, const glm::mat4& matrix,
bool GameRenderer::renderFrame(Clump* m, ModelFrame* f, const glm::mat4& matrix,
GameObject* object, float opacity,
bool queueTransparent) {
auto localmatrix = matrix;
@ -693,7 +693,7 @@ bool GameRenderer::renderFrame(Model* m, ModelFrame* f, const glm::mat4& matrix,
return true;
}
void GameRenderer::renderModel(Model* model, const glm::mat4& modelMatrix,
void GameRenderer::renderModel(Clump* model, const glm::mat4& modelMatrix,
GameObject* object) {
renderFrame(model, model->frames[model->rootFrameIdx], modelMatrix, object,
1.f);

View File

@ -16,7 +16,7 @@ class Logger;
#include "TextRenderer.hpp"
#include "WaterRenderer.hpp"
class Model;
class Clump;
class ModelFrame;
class GameWorld;
class GameObject;
@ -53,7 +53,7 @@ class GameRenderer {
/** Stores data for deferring transparent objects */
struct RQueueEntry {
Model* model;
Clump* model;
size_t g;
size_t sg;
glm::mat4 matrix;
@ -71,7 +71,7 @@ class GameRenderer {
* materials
* @return True if the frame was drawn, false if it should be queued
*/
bool renderFrame(Model* m, ModelFrame* f, const glm::mat4& matrix,
bool renderFrame(Clump* m, ModelFrame* f, const glm::mat4& matrix,
GameObject* object, float opacity,
bool queueTransparent = true);
@ -158,10 +158,10 @@ public:
/**
* Renders a model (who'd have thought)
*/
void renderModel(Model*, const glm::mat4& modelMatrix,
void renderModel(Clump*, const glm::mat4& modelMatrix,
GameObject* = nullptr);
void renderGeometry(Model*, size_t geom, const glm::mat4& modelMatrix,
void renderGeometry(Clump*, size_t geom, const glm::mat4& modelMatrix,
float opacity, GameObject* = nullptr);
/** method for rendering AI debug information */
@ -207,15 +207,15 @@ public:
*
* GameRenderer will take ownership of the Model* pointer
*/
void setSpecialModel(SpecialModel usage, Model* model) {
void setSpecialModel(SpecialModel usage, Clump* model) {
specialmodels_[usage].reset(model);
}
private:
/// Hard-coded models to use for each of the special models
std::unique_ptr<Model>
std::unique_ptr<Clump>
specialmodels_[SpecialModel::SpecialModelCount];
Model* getSpecialModel(SpecialModel usage) const {
Clump* getSpecialModel(SpecialModel usage) const {
return specialmodels_[usage].get();
}
};

View File

@ -1,5 +1,5 @@
#include <data/CutsceneData.hpp>
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <data/Skeleton.hpp>
#include <engine/GameData.hpp>
#include <engine/GameState.hpp>
@ -33,11 +33,11 @@ RenderKey createKey(bool transparent, float normalizedDepth,
uint8_t(0xFF & (textures.size() > 0 ? textures[0] : 0)) << 0;
}
void ObjectRenderer::renderGeometry(Model* model, size_t g,
void ObjectRenderer::renderGeometry(Clump* model, size_t g,
const glm::mat4& modelMatrix, float opacity,
GameObject* object, RenderList& outList) {
for (size_t sg = 0; sg < model->geometries[g]->subgeom.size(); ++sg) {
Model::SubGeometry& subgeom = model->geometries[g]->subgeom[sg];
Clump::SubGeometry& subgeom = model->geometries[g]->subgeom[sg];
bool isTransparent = false;
@ -56,7 +56,7 @@ void ObjectRenderer::renderGeometry(Model* model, size_t g,
}
if (model->geometries[g]->materials.size() > subgeom.material) {
Model::Material& mat =
Clump::Material& mat =
model->geometries[g]->materials[subgeom.material];
if (mat.textures.size() > 0) {
@ -107,7 +107,7 @@ void ObjectRenderer::renderGeometry(Model* model, size_t g,
&model->geometries[g]->dbuff, dp);
}
}
bool ObjectRenderer::renderFrame(Model* m, ModelFrame* f,
bool ObjectRenderer::renderFrame(Clump* m, ModelFrame* f,
const glm::mat4& matrix, GameObject* object,
float opacity, RenderList& outList) {
auto localmatrix = matrix;
@ -175,12 +175,12 @@ void ObjectRenderer::renderInstance(InstanceObject* instance,
instance->getModel()->getBoundingRadius();
mindist *= 1.f / kDrawDistanceFactor;
Model* model = nullptr;
Clump* model = nullptr;
ModelFrame* frame = nullptr;
// These are used to gracefully fade out things that are just out of view
// distance.
Model* fadingModel = nullptr;
Clump* fadingModel = nullptr;
ModelFrame* fadingFrame = nullptr;
auto fadingMatrix = matrixModel;
float opacity = 0.f;

View File

@ -37,10 +37,10 @@ public:
size_t culled;
void buildRenderList(GameObject* object, RenderList& outList);
bool renderFrame(Model* m, ModelFrame* f, const glm::mat4& matrix,
bool renderFrame(Clump* m, ModelFrame* f, const glm::mat4& matrix,
GameObject* object, float opacity, RenderList& outList);
void renderGeometry(Model* model, size_t g, const glm::mat4& modelMatrix,
void renderGeometry(Clump* model, size_t g, const glm::mat4& modelMatrix,
float opacity, GameObject* object, RenderList& outList);
private:

View File

@ -6,7 +6,7 @@
#include <ai/PlayerController.hpp>
#include <data/CutsceneData.hpp>
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <data/WeaponData.hpp>
#include <dynamics/CollisionInstance.hpp>
#include <dynamics/RaycastCallbacks.hpp>

View File

@ -23,8 +23,8 @@ SET(RWLIB_SOURCES
"source/platform/FileIndex.hpp"
"source/platform/FileIndex.cpp"
"source/data/Model.hpp"
"source/data/Model.cpp"
"source/data/Clump.hpp"
"source/data/Clump.cpp"
"source/loaders/LoaderIMG.hpp"
"source/loaders/LoaderIMG.cpp"

View File

@ -1,12 +1,12 @@
#include "data/Model.hpp"
#include "data/Clump.hpp"
#include <iostream>
#include <glm/gtc/matrix_transform.hpp>
Model::Geometry::Geometry() : flags(0) {
Clump::Geometry::Geometry() : flags(0) {
}
Model::Geometry::~Geometry() {
Clump::Geometry::~Geometry() {
}
ModelFrame::ModelFrame(unsigned int index, ModelFrame* parent, glm::mat3 dR,
@ -30,13 +30,13 @@ void ModelFrame::addGeometry(size_t idx) {
geometries.push_back(idx);
}
Model::~Model() {
Clump::~Clump() {
for (auto mf : frames) {
delete mf;
}
}
void Model::recalculateMetrics() {
void Clump::recalculateMetrics() {
boundingRadius = std::numeric_limits<float>::min();
for (size_t g = 0; g < geometries.size(); g++) {
RW::BSGeometryBounds& bounds = geometries[g]->geometryBounds;

View File

@ -76,10 +76,9 @@ public:
};
/**
* Model stores all the data contained within a DFF, as well as data required
* to render them.
* A clump is a collection of Frames and Atomics
*/
class Model {
class Clump {
public:
enum FaceType { Triangles = 0, TriangleStrip = 1 };
@ -167,7 +166,7 @@ public:
return fit != frames.end() ? *fit : nullptr;
}
~Model();
~Clump();
void recalculateMetrics();

View File

@ -1,4 +1,4 @@
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <loaders/LoaderDFF.hpp>
#include <algorithm>
@ -40,7 +40,7 @@ struct RWBSFrame {
uint32_t matrixflags; // Not used
};
void LoaderDFF::readFrameList(Model *model, const RWBStream &stream) {
void LoaderDFF::readFrameList(Clump *model, const RWBStream &stream) {
auto listStream = stream.getInnerStream();
auto listStructID = listStream.getNextChunk();
@ -102,7 +102,7 @@ void LoaderDFF::readFrameList(Model *model, const RWBStream &stream) {
}
}
void LoaderDFF::readGeometryList(Model *model, const RWBStream &stream) {
void LoaderDFF::readGeometryList(Clump *model, const RWBStream &stream) {
auto listStream = stream.getInnerStream();
auto listStructID = listStream.getNextChunk();
@ -129,7 +129,7 @@ void LoaderDFF::readGeometryList(Model *model, const RWBStream &stream) {
}
}
void LoaderDFF::readGeometry(Model *model, const RWBStream &stream) {
void LoaderDFF::readGeometry(Clump *model, const RWBStream &stream) {
auto geomStream = stream.getInnerStream();
auto geomStructID = geomStream.getNextChunk();
@ -137,7 +137,7 @@ void LoaderDFF::readGeometry(Model *model, const RWBStream &stream) {
throw DFFLoaderException("Geometry missing struct chunk");
}
std::shared_ptr<Model::Geometry> geom(new Model::Geometry);
std::shared_ptr<Clump::Geometry> geom(new Clump::Geometry);
char *headerPtr = geomStream.getCursor();
@ -156,7 +156,7 @@ void LoaderDFF::readGeometry(Model *model, const RWBStream &stream) {
/*unsigned int numFrames = *(std::uint32_t*)headerPtr;*/
headerPtr += sizeof(std::uint32_t);
std::vector<Model::GeometryVertex> verts;
std::vector<Clump::GeometryVertex> verts;
verts.resize(numVerts);
if (geomStream.getChunkVersion() < 0x1003FFFF) {
@ -235,7 +235,7 @@ void LoaderDFF::readGeometry(Model *model, const RWBStream &stream) {
}
geom->dbuff.setFaceType(
geom->facetype == Model::Triangles ? GL_TRIANGLES : GL_TRIANGLE_STRIP);
geom->facetype == Clump::Triangles ? GL_TRIANGLES : GL_TRIANGLE_STRIP);
geom->gbuff.uploadVertices(verts);
geom->dbuff.addGeometry(&geom->gbuff);
@ -244,7 +244,7 @@ void LoaderDFF::readGeometry(Model *model, const RWBStream &stream) {
size_t icount = std::accumulate(
geom->subgeom.begin(), geom->subgeom.end(), 0u,
[](size_t a, const Model::SubGeometry &b) { return a + b.numIndices; });
[](size_t a, const Clump::SubGeometry &b) { return a + b.numIndices; });
glBufferData(GL_ELEMENT_ARRAY_BUFFER, sizeof(uint32_t) * icount, 0,
GL_STATIC_DRAW);
for (auto &sg : geom->subgeom) {
@ -253,7 +253,7 @@ void LoaderDFF::readGeometry(Model *model, const RWBStream &stream) {
}
}
void LoaderDFF::readMaterialList(Model *model, const RWBStream &stream) {
void LoaderDFF::readMaterialList(Clump *model, const RWBStream &stream) {
auto listStream = stream.getInnerStream();
auto listStructID = listStream.getNextChunk();
@ -277,7 +277,7 @@ void LoaderDFF::readMaterialList(Model *model, const RWBStream &stream) {
}
}
void LoaderDFF::readMaterial(Model *model, const RWBStream &stream) {
void LoaderDFF::readMaterial(Clump *model, const RWBStream &stream) {
auto materialStream = stream.getInnerStream();
auto matStructID = materialStream.getNextChunk();
@ -287,7 +287,7 @@ void LoaderDFF::readMaterial(Model *model, const RWBStream &stream) {
char *matData = materialStream.getCursor();
Model::Material material;
Clump::Material material;
// Unkown
matData += sizeof(std::uint32_t);
@ -320,7 +320,7 @@ void LoaderDFF::readMaterial(Model *model, const RWBStream &stream) {
}
}
void LoaderDFF::readTexture(Model *model, const RWBStream &stream) {
void LoaderDFF::readTexture(Clump *model, const RWBStream &stream) {
auto texStream = stream.getInnerStream();
auto texStructID = texStream.getNextChunk();
@ -347,7 +347,7 @@ void LoaderDFF::readTexture(Model *model, const RWBStream &stream) {
{name, alpha, textureinst});
}
void LoaderDFF::readGeometryExtension(Model *model, const RWBStream &stream) {
void LoaderDFF::readGeometryExtension(Clump *model, const RWBStream &stream) {
auto extStream = stream.getInnerStream();
RWBStream::ChunkID chunkID;
@ -362,11 +362,11 @@ void LoaderDFF::readGeometryExtension(Model *model, const RWBStream &stream) {
}
}
void LoaderDFF::readBinMeshPLG(Model *model, const RWBStream &stream) {
void LoaderDFF::readBinMeshPLG(Clump *model, const RWBStream &stream) {
auto data = stream.getCursor();
model->geometries.back()->facetype =
static_cast<Model::FaceType>(*(std::uint32_t *)data);
static_cast<Clump::FaceType>(*(std::uint32_t *)data);
data += sizeof(std::uint32_t);
unsigned int numSplits = *(std::uint32_t *)data;
@ -380,7 +380,7 @@ void LoaderDFF::readBinMeshPLG(Model *model, const RWBStream &stream) {
size_t start = 0;
for (size_t s = 0; s < numSplits; ++s) {
Model::SubGeometry sg;
Clump::SubGeometry sg;
sg.numIndices = *(std::uint32_t *)data;
data += sizeof(std::uint32_t);
sg.material = *(std::uint32_t *)data;
@ -397,7 +397,7 @@ void LoaderDFF::readBinMeshPLG(Model *model, const RWBStream &stream) {
}
}
void LoaderDFF::readAtomic(Model *model, const RWBStream &stream) {
void LoaderDFF::readAtomic(Clump *model, const RWBStream &stream) {
auto atomicStream = stream.getInnerStream();
auto atomicStructID = atomicStream.getNextChunk();
@ -405,7 +405,7 @@ void LoaderDFF::readAtomic(Model *model, const RWBStream &stream) {
throw DFFLoaderException("Atomic missing struct chunk");
}
Model::Atomic atom;
Clump::Atomic atom;
auto data = atomicStream.getCursor();
atom.frame = *(std::uint32_t *)data;
data += sizeof(std::uint32_t);
@ -416,8 +416,8 @@ void LoaderDFF::readAtomic(Model *model, const RWBStream &stream) {
/// @todo are any atomic extensions important?
}
Model *LoaderDFF::loadFromMemory(FileHandle file) {
auto model = new Model;
Clump *LoaderDFF::loadFromMemory(FileHandle file) {
auto model = new Clump;
RWBStream rootStream(file->data, file->length);

View File

@ -9,7 +9,7 @@
#include <functional>
#include <string>
class Model;
class Clump;
class DFFLoaderException {
std::string _message;
@ -29,29 +29,29 @@ class LoaderDFF {
* @param model
* @param stream
*/
void readFrameList(Model* model, const RWBStream& stream);
void readFrameList(Clump* model, const RWBStream& stream);
void readGeometryList(Model* model, const RWBStream& stream);
void readGeometryList(Clump* model, const RWBStream& stream);
void readGeometry(Model* model, const RWBStream& stream);
void readGeometry(Clump* model, const RWBStream& stream);
void readMaterialList(Model* model, const RWBStream& stream);
void readMaterialList(Clump* model, const RWBStream& stream);
void readMaterial(Model* model, const RWBStream& stream);
void readMaterial(Clump* model, const RWBStream& stream);
void readTexture(Model* model, const RWBStream& stream);
void readTexture(Clump* model, const RWBStream& stream);
void readGeometryExtension(Model* model, const RWBStream& stream);
void readGeometryExtension(Clump* model, const RWBStream& stream);
void readBinMeshPLG(Model* model, const RWBStream& stream);
void readBinMeshPLG(Clump* model, const RWBStream& stream);
void readAtomic(Model* model, const RWBStream& stream);
void readAtomic(Clump* model, const RWBStream& stream);
public:
using TextureLookupCallback = std::function<TextureData::Handle(
const std::string&, const std::string&)>;
Model* loadFromMemory(FileHandle file);
Clump* loadFromMemory(FileHandle file);
void setTextureLookupCallback(TextureLookupCallback tlc) {
texturelookup = tlc;

View File

@ -2,7 +2,7 @@
#include <QFileDialog>
#include <QMouseEvent>
#include <algorithm>
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <data/Skeleton.hpp>
#include <engine/Animator.hpp>
#include <glm/gtc/type_ptr.hpp>
@ -103,7 +103,7 @@ void ViewerWidget::paintGL() {
vc.frustum.fov = viewFov;
vc.frustum.aspectRatio = width() / (height() * 1.f);
Model* model = activeModel;
Clump* model = activeModel;
if (model != _lastModel) {
_lastModel = model;
emit modelChanged(_lastModel);
@ -197,7 +197,7 @@ void ViewerWidget::showObject(qint16 item) {
}
}
void ViewerWidget::showModel(Model* model) {
void ViewerWidget::showModel(Clump* model) {
if (dummyObject) gworld->destroyObject(dummyObject);
dummyObject = nullptr;
activeModel = model;
@ -259,7 +259,7 @@ void ViewerWidget::keyReleaseEvent(QKeyEvent* e) {
if (e->key() == Qt::Key_Shift) moveFast = false;
}
Model* ViewerWidget::currentModel() const {
Clump* ViewerWidget::currentModel() const {
return activeModel;
}

View File

@ -2,7 +2,7 @@
#ifndef _VIEWERWIDGET_HPP_
#define _VIEWERWIDGET_HPP_
#include <QTimer>
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <engine/GameData.hpp>
#include <engine/GameWorld.hpp>
#include <gl/DrawBuffer.hpp>
@ -16,7 +16,7 @@
#include <QGLWidget>
class GameRenderer;
class Model;
class Clump;
class ViewerWidget : public QGLWidget {
Q_OBJECT
@ -27,12 +27,12 @@ class ViewerWidget : public QGLWidget {
QTimer timer;
GameWorld* gworld;
Model* activeModel;
Clump* activeModel;
ModelFrame* selectedFrame;
GameObject* dummyObject;
quint16 currentObjectID;
Model* _lastModel;
Clump* _lastModel;
Animation* canimation;
float viewDistance;
@ -60,7 +60,7 @@ public:
virtual void paintGL();
Model* currentModel() const;
Clump* currentModel() const;
GameObject* currentObject() const;
GameWorld* world();
@ -68,7 +68,7 @@ public:
public slots:
void showObject(qint16 item);
void showModel(Model* model);
void showModel(Clump* model);
void selectFrame(ModelFrame* frame);
void exportModel();
@ -81,7 +81,7 @@ signals:
void fileOpened(const QString& file);
void modelChanged(Model* model);
void modelChanged(Clump* model);
protected:
void keyPressEvent(QKeyEvent*) override;

View File

@ -1,8 +1,8 @@
#include "DFFFramesTreeModel.hpp"
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <data/Skeleton.hpp>
DFFFramesTreeModel::DFFFramesTreeModel(Model* m, Skeleton* skel,
DFFFramesTreeModel::DFFFramesTreeModel(Clump* m, Skeleton* skel,
QObject* parent)
: QAbstractItemModel(parent), model(m), skeleton(skel) {
}

View File

@ -4,15 +4,15 @@
#include <QAbstractItemModel>
#include <rw/types.hpp>
class Model;
class Clump;
class Skeleton;
class DFFFramesTreeModel : public QAbstractItemModel {
Model* model;
Clump* model;
Skeleton* skeleton;
public:
explicit DFFFramesTreeModel(Model* m, Skeleton* skel, QObject* parent = 0);
explicit DFFFramesTreeModel(Clump* m, Skeleton* skel, QObject* parent = 0);
virtual int columnCount(const QModelIndex& parent = QModelIndex()) const;

View File

@ -40,7 +40,7 @@ void ModelViewer::setViewerWidget(ViewerWidget* widget) {
showModel(viewing);
}
void ModelViewer::showModel(Model* model) {
void ModelViewer::showModel(Clump* model) {
viewing = model;
if (skeleton) {
delete skeleton;

View File

@ -14,7 +14,7 @@
#include <QVBoxLayout>
class ViewerWidget;
class Model;
class Clump;
class Skeleton;
class ModelFramesWidget;
class Animation;
@ -22,7 +22,7 @@ class Animation;
class ModelViewer : public ViewerInterface {
Q_OBJECT
Model* viewing;
Clump* viewing;
Skeleton* skeleton;
QSplitter* mainSplit;
@ -45,7 +45,7 @@ public slots:
/**
* Display a raw model
*/
void showModel(Model* model);
void showModel(Clump* model);
/**
* Display a game object's model

View File

@ -12,7 +12,7 @@
#include <QTableView>
class ViewerWidget;
class Model;
class Clump;
class ObjectViewer : public ViewerInterface {
Q_OBJECT
@ -40,7 +40,7 @@ protected:
signals:
void modelChanged(Model* model);
void modelChanged(Clump* model);
void showObjectModel(uint16_t object);

View File

@ -1,8 +1,8 @@
#include "ModelFramesWidget.hpp"
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <glm/gtx/string_cast.hpp>
void ModelFramesWidget::updateInfoBox(Model* model, ModelFrame* f) {
void ModelFramesWidget::updateInfoBox(Clump* model, ModelFrame* f) {
if (f == nullptr) {
_frameLabel->setText("");
} else {
@ -14,8 +14,8 @@ void ModelFramesWidget::updateInfoBox(Model* model, ModelFrame* f) {
for (size_t gi : f->getGeometries()) {
auto& g = model->geometries[gi];
// for(Model::SubGeometry& sg : g->subgeom)
for (Model::Material& m : g->materials) {
for (Model::Texture& t : m.textures) {
for (Clump::Material& m : g->materials) {
for (Clump::Texture& t : m.textures) {
geomString += QString("\n %1 (%2)")
.arg(t.name.c_str())
.arg(t.alphaName.c_str());
@ -46,7 +46,7 @@ ModelFramesWidget::ModelFramesWidget(QWidget* parent, Qt::WindowFlags flags)
setLayout(_layout);
}
void ModelFramesWidget::setModel(Model* model, Skeleton* skeleton) {
void ModelFramesWidget::setModel(Clump* model, Skeleton* skeleton) {
if (framemodel) {
delete framemodel;
framemodel = nullptr;

View File

@ -13,7 +13,7 @@ class ModelFrame;
class ModelFramesWidget : public QWidget {
Q_OBJECT
Model* gmodel;
Clump* gmodel;
DFFFramesTreeModel* framemodel;
QTreeView* tree;
QVBoxLayout* _layout;
@ -21,7 +21,7 @@ class ModelFramesWidget : public QWidget {
private slots:
void updateInfoBox(Model* model, ModelFrame* f);
void updateInfoBox(Clump* model, ModelFrame* f);
void selectedModelChanged(const QModelIndex&, const QModelIndex&);
@ -30,7 +30,7 @@ public:
public slots:
void setModel(Model* model, Skeleton* skeleton);
void setModel(Clump* model, Skeleton* skeleton);
signals:

View File

@ -1,5 +1,5 @@
#include <boost/test/unit_test.hpp>
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <data/Skeleton.hpp>
#include <engine/Animator.hpp>
#include <glm/gtx/string_cast.hpp>

View File

@ -1,5 +1,5 @@
#include <boost/test/unit_test.hpp>
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include "test_globals.hpp"
BOOST_AUTO_TEST_SUITE(LoaderDFFTests)
@ -11,7 +11,7 @@ BOOST_AUTO_TEST_CASE(test_load_dff) {
LoaderDFF loader;
Model* m = loader.loadFromMemory(d);
Clump* m = loader.loadFromMemory(d);
BOOST_REQUIRE(m != nullptr);
@ -27,7 +27,7 @@ BOOST_AUTO_TEST_CASE(test_load_dff) {
BOOST_REQUIRE(m->atomics.size() > 0);
for (Model::Atomic& a : m->atomics) {
for (Clump::Atomic& a : m->atomics) {
BOOST_CHECK(a.frame < m->frames.size());
BOOST_CHECK(a.geometry < m->geometries.size());
}

View File

@ -1,5 +1,5 @@
#include <boost/test/unit_test.hpp>
#include <data/Model.hpp>
#include <data/Clump.hpp>
#include <data/Skeleton.hpp>
#include <objects/VehicleObject.hpp>
#include "test_globals.hpp"