Fixing a boatload of warnings

This commit is contained in:
Stefan Högler
2021-04-01 16:40:14 +02:00
parent f042480540
commit d5f0fe644f
84 changed files with 496 additions and 407 deletions
+3 -5
View File
@@ -1,7 +1,5 @@
#pragma once
#include "MinimalEngine.h"
#include <filesystem>
#include <fstream>
namespace Seele
{
@@ -43,15 +41,15 @@ protected:
std::ifstream& getReadStream();
std::ofstream& getWriteStream();
private:
Status status;
// Path relative to the project root
std::filesystem::path fullPath;
std::filesystem::path parentDir;
std::filesystem::path name;
std::filesystem::path parentDir;
std::filesystem::path extension;
Status status;
uint32 byteSize;
std::ifstream inStream;
std::ofstream outStream;
};
DEFINE_REF(Asset);
DEFINE_REF(Asset)
} // namespace Seele
+1
View File
@@ -7,6 +7,7 @@
#include "Material/Material.h"
#include "Graphics/Graphics.h"
#include "Window/WindowManager.h"
#include "MeshAsset.h"
#include <iostream>
using namespace Seele;
+11 -11
View File
@@ -5,13 +5,13 @@
namespace Seele
{
DECLARE_REF(TextureLoader);
DECLARE_REF(MeshLoader);
DECLARE_REF(MaterialLoader);
DECLARE_REF(TextureAsset);
DECLARE_REF(MeshAsset);
DECLARE_REF(MaterialAsset);
DECLARE_NAME_REF(Gfx, Graphics);
DECLARE_REF(TextureLoader)
DECLARE_REF(MeshLoader)
DECLARE_REF(MaterialLoader)
DECLARE_REF(TextureAsset)
DECLARE_REF(MeshAsset)
DECLARE_REF(MaterialAsset)
DECLARE_NAME_REF(Gfx, Graphics)
class AssetRegistry
{
public:
@@ -26,8 +26,8 @@ public:
static PTextureAsset findTexture(const std::string& filePath);
static PMaterialAsset findMaterial(const std::string& filePath);
static std::ofstream createWriteStream(const std::string& relativePath, std::ios_base::openmode openmode = 0);
static std::ifstream createReadStream(const std::string& relativePath, std::ios_base::openmode openmode = 0);
static std::ofstream createWriteStream(const std::string& relativePath, std::ios_base::openmode openmode = std::ios::out);
static std::ifstream createReadStream(const std::string& relativePath, std::ios_base::openmode openmode = std::ios::in);
private:
static AssetRegistry& get();
@@ -42,8 +42,8 @@ private:
void registerTexture(PTextureAsset texture);
void registerMaterial(PMaterialAsset material);
std::ofstream internalCreateWriteStream(const std::string& relativePath, std::ios_base::openmode openmode = 0);
std::ifstream internalCreateReadStream(const std::string& relaitvePath, std::ios_base::openmode openmode = 0);
std::ofstream internalCreateWriteStream(const std::string& relativePath, std::ios_base::openmode openmode = std::ios::out);
std::ifstream internalCreateReadStream(const std::string& relaitvePath, std::ios_base::openmode openmode = std::ios::in);
std::filesystem::path rootFolder;
Map<std::string, PTextureAsset> textures;
+2 -2
View File
@@ -8,7 +8,7 @@
namespace Seele
{
DECLARE_REF(Material)
DECLARE_NAME_REF(Gfx, Graphics);
DECLARE_NAME_REF(Gfx, Graphics)
class MaterialLoader
{
public:
@@ -21,5 +21,5 @@ private:
List<std::future<void>> futures;
PMaterial placeholderMaterial;
};
DEFINE_REF(MaterialLoader);
DEFINE_REF(MaterialLoader)
} // namespace Seele
+3 -3
View File
@@ -3,8 +3,8 @@
namespace Seele
{
DECLARE_REF(Mesh);
DECLARE_REF(MaterialAsset);
DECLARE_REF(Mesh)
DECLARE_REF(MaterialAsset)
class MeshAsset : public Asset
{
public:
@@ -20,5 +20,5 @@ private:
Array<PMesh> meshes;
Array<PMaterialAsset> referencedMaterials;
};
DEFINE_REF(MeshAsset);
DEFINE_REF(MeshAsset)
} // namespace Seele
+2 -2
View File
@@ -197,7 +197,7 @@ void MeshLoader::convertAssimpARGB(unsigned char* dst, aiTexel* src, uint32 numP
dst[i * 4 + 3] = src[i].a;
}
}
void MeshLoader::loadTextures(const aiScene* scene, Gfx::PGraphics graphics, const std::filesystem::path& meshDirectory)
void MeshLoader::loadTextures(const aiScene* scene, const std::filesystem::path& meshDirectory)
{
for (uint32 i = 0; i < scene->mNumTextures; ++i)
{
@@ -237,7 +237,7 @@ void MeshLoader::import(const std::filesystem::path &path)
const aiScene *scene = importer.ApplyPostProcessing(aiProcess_CalcTangentSpace);
Array<PMaterialAsset> globalMaterials(scene->mNumMaterials);
loadTextures(scene, graphics, path.parent_path());
loadTextures(scene, path.parent_path());
loadMaterials(scene, globalMaterials, graphics);
Array<PMesh> globalMeshes(scene->mNumMeshes);
+6 -6
View File
@@ -9,10 +9,10 @@ struct aiScene;
struct aiTexel;
namespace Seele
{
DECLARE_REF(Mesh);
DECLARE_REF(MeshAsset);
DECLARE_REF(MaterialAsset);
DECLARE_NAME_REF(Gfx, Graphics);
DECLARE_REF(Mesh)
DECLARE_REF(MeshAsset)
DECLARE_REF(MaterialAsset)
DECLARE_NAME_REF(Gfx, Graphics)
class MeshLoader
{
public:
@@ -21,7 +21,7 @@ public:
void importAsset(const std::filesystem::path& filePath);
private:
void loadMaterials(const aiScene* scene, Array<PMaterialAsset>& globalMaterials, Gfx::PGraphics graphics);
void loadTextures(const aiScene* scene, Gfx::PGraphics graphics, const std::filesystem::path& meshPath);
void loadTextures(const aiScene* scene, const std::filesystem::path& meshPath);
void loadGlobalMeshes(const aiScene* scene, Array<PMesh>& globalMeshes, const Array<PMaterialAsset>& materials, Gfx::PGraphics graphics);
void convertAssimpARGB(unsigned char* dst, aiTexel* src, uint32 numPixels);
@@ -29,5 +29,5 @@ private:
List<std::future<void>> futures;
Gfx::PGraphics graphics;
};
DEFINE_REF(MeshLoader);
DEFINE_REF(MeshLoader)
} // namespace Seele
+2 -2
View File
@@ -2,7 +2,7 @@
namespace Seele
{
DECLARE_NAME_REF(Gfx, Texture);
DECLARE_NAME_REF(Gfx, Texture)
class TextureAsset : public Asset
{
public:
@@ -25,5 +25,5 @@ private:
Gfx::PTexture texture;
friend class TextureLoader;
};
DEFINE_REF(TextureAsset);
DEFINE_REF(TextureAsset)
} // namespace Seele
+4 -4
View File
@@ -7,9 +7,9 @@
namespace Seele
{
DECLARE_REF(TextureAsset);
DECLARE_NAME_REF(Gfx, Graphics);
DECLARE_NAME_REF(Gfx, Texture2D);
DECLARE_REF(TextureAsset)
DECLARE_NAME_REF(Gfx, Graphics)
DECLARE_NAME_REF(Gfx, Texture2D)
class TextureLoader
{
public:
@@ -24,5 +24,5 @@ private:
Gfx::PTexture2D placeholderTexture;
PTextureAsset placeholderAsset;
};
DEFINE_REF(TextureLoader);
DEFINE_REF(TextureLoader)
} // namespace Seele