summaryrefslogtreecommitdiff
path: root/assetFactory
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2023-11-07 02:51:42 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2023-11-07 02:51:42 +0000
commitd6e99a696aa582b81018078b68f6600c8030d643 (patch)
tree5c1451bbc76c31f78ddd169fca7780a0943f5910 /assetFactory
parentReformat with new clang-format (diff)
downloadilt-d6e99a696aa582b81018078b68f6600c8030d643.tar.bz2
ilt-d6e99a696aa582b81018078b68f6600c8030d643.tar.xz
ilt-d6e99a696aa582b81018078b68f6600c8030d643.zip
WIP typedefing all the things - headers
Diffstat (limited to 'assetFactory')
-rw-r--r--assetFactory/factoryMesh.h3
-rw-r--r--assetFactory/mutation.h7
-rw-r--r--assetFactory/shape.h3
-rw-r--r--assetFactory/texturePacker.cpp4
-rw-r--r--assetFactory/texturePacker.h7
5 files changed, 13 insertions, 11 deletions
diff --git a/assetFactory/factoryMesh.h b/assetFactory/factoryMesh.h
index f71c737..b09b54f 100644
--- a/assetFactory/factoryMesh.h
+++ b/assetFactory/factoryMesh.h
@@ -1,5 +1,6 @@
#pragma once
+#include "config/types.h"
#include "gfx/models/mesh.h"
#include "stdTypeDefs.h"
#include "use.h"
@@ -9,7 +10,7 @@ public:
Mesh::Ptr createMesh() const;
std::string id;
- glm::vec3 size;
+ Size3D size;
Use::Collection uses;
private:
diff --git a/assetFactory/mutation.h b/assetFactory/mutation.h
index 2432174..b571dea 100644
--- a/assetFactory/mutation.h
+++ b/assetFactory/mutation.h
@@ -1,5 +1,6 @@
#pragma once
+#include "config/types.h"
#include "persistence.h"
#include <glm/mat4x4.hpp>
#include <glm/vec3.hpp>
@@ -13,9 +14,9 @@ struct Mutation {
float relativeLevelOfDetail() const;
- glm::vec3 position {};
- glm::vec3 rotation {};
- glm::vec3 scale {1};
+ Position3D position {};
+ Rotation3D rotation {};
+ Scale3D scale {1};
protected:
bool persist(Persistence::PersistenceStore & store);
diff --git a/assetFactory/shape.h b/assetFactory/shape.h
index ea3e4e7..136e24f 100644
--- a/assetFactory/shape.h
+++ b/assetFactory/shape.h
@@ -1,5 +1,6 @@
#pragma once
+#include "config/types.h"
#include "modelFactoryMesh_fwd.h"
#include "stdTypeDefs.h"
#include <OpenMesh/Core/Mesh/Handles.hh>
@@ -21,5 +22,5 @@ public:
virtual CreatedFaces createMesh(ModelFactoryMesh &, float levelOfDetailFactor) const = 0;
static std::vector<OpenMesh::VertexHandle> addToMesh(
- ModelFactoryMesh & mesh, const std::span<const glm::vec3> vertices);
+ ModelFactoryMesh & mesh, const std::span<const Position3D> vertices);
};
diff --git a/assetFactory/texturePacker.cpp b/assetFactory/texturePacker.cpp
index dbafc4b..0d0fdb6 100644
--- a/assetFactory/texturePacker.cpp
+++ b/assetFactory/texturePacker.cpp
@@ -14,9 +14,7 @@ TexturePacker::TexturePacker(std::span<const Image> in) :
std::sort(sortedIndexes.rbegin(), sortedIndexes.rend(), [this](const auto a, const auto b) {
return area(inputImages[a]) < area(inputImages[b]);
});
- int mts;
- glGetIntegerv(GL_MAX_TEXTURE_SIZE, &mts);
- maxTextureSize = static_cast<unsigned int>(mts);
+ glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxTextureSize);
}
TexturePacker::Result
diff --git a/assetFactory/texturePacker.h b/assetFactory/texturePacker.h
index 93413eb..05e3204 100644
--- a/assetFactory/texturePacker.h
+++ b/assetFactory/texturePacker.h
@@ -1,13 +1,14 @@
#pragma once
+#include "config/types.h"
#include <glm/vec2.hpp>
#include <span>
#include <vector>
class TexturePacker {
public:
- using Position = glm::uvec2;
- using Size = glm::uvec2;
+ using Position = TextureAbsCoord;
+ using Size = TextureAbsCoord;
struct Area {
#ifndef __cpp_aggregate_paren_init
@@ -40,5 +41,5 @@ public:
private:
std::span<const Image> inputImages;
std::vector<size_t> sortedIndexes;
- unsigned int maxTextureSize;
+ GLsizei maxTextureSize;
};