From d6e99a696aa582b81018078b68f6600c8030d643 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 7 Nov 2023 02:51:42 +0000 Subject: WIP typedefing all the things - headers --- assetFactory/factoryMesh.h | 3 ++- assetFactory/mutation.h | 7 ++++--- assetFactory/shape.h | 3 ++- assetFactory/texturePacker.cpp | 4 +--- assetFactory/texturePacker.h | 7 ++++--- 5 files changed, 13 insertions(+), 11 deletions(-) (limited to 'assetFactory') 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 #include @@ -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 @@ -21,5 +22,5 @@ public: virtual CreatedFaces createMesh(ModelFactoryMesh &, float levelOfDetailFactor) const = 0; static std::vector addToMesh( - ModelFactoryMesh & mesh, const std::span vertices); + ModelFactoryMesh & mesh, const std::span 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 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(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 #include #include 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 inputImages; std::vector sortedIndexes; - unsigned int maxTextureSize; + GLsizei maxTextureSize; }; -- cgit v1.2.3