Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengtuggy committed Jan 31, 2025
1 parent 7be29bd commit 7638e9c
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
15 changes: 8 additions & 7 deletions engine/src/gfx/lod_coll.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,17 @@ LodColl & LodColl::operator=(LodColl && other) noexcept {
return *this;
}

std::shared_ptr<LodColl> LodColl::Create(const std::string &hash_name, std::shared_ptr<Mesh> original) {
std::shared_ptr<LodColl> LodColl::Create(const std::string &filename, const int faction, Flightgroup *fg, const std::vector<std::string> &override_texture) {
std::shared_ptr<LodColl> return_value = std::make_shared<LodColl>(Private());
return_value->LoadMesh(hash_name, original);

// return_value->LoadMesh(filename, original);
return return_value;
}

void LodColl::LoadMesh(const std::string &hash_name, std::shared_ptr<Mesh> original) {
this->hash_name_ = hash_name;
this->original_mesh_ = original;
// ...
}
// void LodColl::LoadMesh(const std::string &hash_name, std::shared_ptr<Mesh> original) {
// this->hash_name_ = hash_name;
// this->original_mesh_ = original;
// // ...
// }

} // vega_gfx
2 changes: 1 addition & 1 deletion engine/src/gfx/lod_coll.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class LodColl: public std::enable_shared_from_this<LodColl> {
LodColl(LodColl&&) noexcept;
LodColl& operator=(LodColl&&) noexcept;

static std::shared_ptr<LodColl> Create(const std::string& hash_name, std::shared_ptr<Mesh> original);
static std::shared_ptr<LodColl> Create(const std::string& filename, int faction, Flightgroup *fg, const std::vector<std::string> &override_texture);

size_t NumberOfLODs() const;

Expand Down
7 changes: 3 additions & 4 deletions engine/src/gfx/mesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ class Mesh : public std::enable_shared_from_this<Mesh> {
}

private:
static std::shared_ptr<Mesh> create(const char *filename, const Vector &scalex, int faction, class Flightgroup *fg,
static std::shared_ptr<Mesh> Create(const char *filename, const Vector &scalex, int faction, class Flightgroup *fg,
bool orig, const std::vector<std::string> &textureOverride) {
std::shared_ptr<Mesh> return_value = std::make_shared<Mesh>();
return_value->hash_name = filename;
Expand Down Expand Up @@ -223,8 +223,8 @@ class Mesh : public std::enable_shared_from_this<Mesh> {
return return_value;
}

protected:
static std::shared_ptr<Mesh> create(std::string filename, const Vector &scalex, int faction, class Flightgroup *fg, bool orig) {
public:
static std::shared_ptr<Mesh> Create(std::string filename, const Vector &scalex, int faction, class Flightgroup *fg, bool orig) {
std::shared_ptr<Mesh> return_value = std::make_shared<Mesh>();
return_value->hash_name = filename;
return_value->convex = false;
Expand Down Expand Up @@ -264,7 +264,6 @@ class Mesh : public std::enable_shared_from_this<Mesh> {
}

///Loads a mesh that has been found in the hash table into this mesh (copying original data)
public:
bool LoadExistant(std::shared_ptr<Mesh> mesh);
bool LoadExistant(const string filehash, const Vector &scale, int faction);
protected:
Expand Down
4 changes: 2 additions & 2 deletions engine/src/gfx/mesh_xml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -848,7 +848,7 @@ void Mesh::beginElement(MeshXML *xml, const string &name, const AttributeList &a
break;
case MeshXML::LODFILE:
xml->lod
.push_back(Mesh::create((*iter).value.c_str(),
.push_back(Mesh::Create((*iter).value.c_str(),
xml->lodscale,
xml->faction,
xml->fg,
Expand Down Expand Up @@ -1376,7 +1376,7 @@ std::deque<std::shared_ptr<Mesh>> Mesh::LoadMeshes(const char *filename,
} else {
f.Close();
bool original = false;
std::shared_ptr<Mesh> m = Mesh::create(filename, scale, faction, fg, original, {}).get(); // FIXME: Stop using raw pointers
std::shared_ptr<Mesh> m = Mesh::Create(filename, scale, faction, fg, original, {}).get(); // FIXME: Stop using raw pointers
ret;
ret.push_back(m);
return ret;
Expand Down

0 comments on commit 7638e9c

Please sign in to comment.