diff --git a/Editor/src/AssetManagement/Asset.h b/Editor/src/AssetManagement/Asset.h index b8c66f3..dd62cf4 100644 --- a/Editor/src/AssetManagement/Asset.h +++ b/Editor/src/AssetManagement/Asset.h @@ -47,7 +47,7 @@ protected: return ASSET_TYPE::File; } else { - std::cout << "unknown file!" << std::endl; + spdlog::warn("unknown file!"); return ASSET_TYPE::Unknown; } } diff --git a/Editor/src/AssetManagement/AssetLoaders/ModelLoader.cpp b/Editor/src/AssetManagement/AssetLoaders/ModelLoader.cpp index 112b37b..c6aa37d 100644 --- a/Editor/src/AssetManagement/AssetLoaders/ModelLoader.cpp +++ b/Editor/src/AssetManagement/AssetLoaders/ModelLoader.cpp @@ -94,11 +94,11 @@ Asset ModelLoader::LoadAsset(std::filesystem::path& path) { aiNode* currentNode = scene->mRootNode; - std::cout << "Loading meshes!" << std::endl; + spdlog::info("Loading meshes!" ); auto meshes = processNode(currentNode, scene); - std::cout << "Model file contained " << meshes.size() << " meshes" << std::endl; + spdlog::info("Model file contained {0} meshes", meshes.size() ); diff --git a/Editor/src/AssetManagement/AssetRegistry.cpp b/Editor/src/AssetManagement/AssetRegistry.cpp index da457b6..d49332c 100644 --- a/Editor/src/AssetManagement/AssetRegistry.cpp +++ b/Editor/src/AssetManagement/AssetRegistry.cpp @@ -45,10 +45,10 @@ YoggieEngine::Mesh* AssetRegistry::LoadFromAssetFile(const std::filesystem::path AssetFile.read((char*)&Enum, sizeof(uint32_t)); // print Header info - std::cout << "File has header: " << Header << std::endl; - std::cout << "Vertex size: " << Vsize << std::endl; - std::cout << "Number of Vertices: " << Vnum << std::endl; - std::cout << "Number of Elements: " << Enum << std::endl; + spdlog::info("File has header: {0}", Header); + spdlog::info ( "Vertex size: {0}", Vsize ); + spdlog::info("Number of Vertices: {0}" ,Vnum ); + spdlog::info ("Number of Elements: " , Enum ); free(Header); @@ -77,7 +77,7 @@ YoggieEngine::Mesh* AssetRegistry::LoadFromAssetFile(const std::filesystem::path } else { - std::cout << "Failed ot open mesh " << std::endl; + spdlog::error( "Failed ot open mesh " ); } return imported; @@ -92,7 +92,7 @@ YoggieEngine::Renderable* AssetRegistry::LoadFromSource(const std::filesystem::p * auto model = (YoggieEngine::ModelImporter()).Import(srcPath.string()); YoggieEngine::Mesh* exportMesh = model->renderable->mesh; std::filesystem::path MeshFileName = assetFolder / srcPath.filename().replace_extension(".mesh"); - std::cout << "Save path: " << MeshFileName << std::endl; + spdlog::info( "Save path: {0}" , MeshFileName ); std::ofstream meshAsset; meshAsset.open(MeshFileName, std::ios::binary); @@ -102,8 +102,8 @@ YoggieEngine::Renderable* AssetRegistry::LoadFromSource(const std::filesystem::p static const char* HEADER = "MESH"; meshAsset.write(HEADER, sizeof(HEADER)); auto Vsize = sizeof(YoggieEngine::Vertex); - std::cout << "size of vertex: " << Vsize << std::endl; - std::cout << "Addr of vSize: " << &Vsize << std::endl; + spdlog::info( "size of vertex: {0}" ,Vsize ); + spdlog::info("Addr of vSize: {0}" , &Vsize ); auto Vnum = exportMesh->vertices.size(); auto Enum = exportMesh->elements.size(); diff --git a/Editor/src/AssetManagement/SceneSerializer.cpp b/Editor/src/AssetManagement/SceneSerializer.cpp index d4c863e..c0b4531 100644 --- a/Editor/src/AssetManagement/SceneSerializer.cpp +++ b/Editor/src/AssetManagement/SceneSerializer.cpp @@ -6,7 +6,7 @@ void WriteFile(std::string& emitter, std::filesystem::path path) { - std::cout << "Writing Scene file to: " << path.u8string() << std::endl; + spdlog::info( "Writing Scene file to: {0}" , path.u8string()); std::ofstream sceneFile; sceneFile.open(path.u8string()); diff --git a/Editor/src/Dialog.h b/Editor/src/Dialog.h index e09566d..148571f 100644 --- a/Editor/src/Dialog.h +++ b/Editor/src/Dialog.h @@ -31,9 +31,9 @@ public: location = std::string(path); break; case(NFD_CANCEL): - std::cout << "NFD_CANCEL" << std::endl; + spdlog::info("NFD_CANCEL" ); case (NFD_ERROR): - std::cout << "NFD_Error: " << NFD_GetError() << std::endl; + spdlog::error("NFD_Error: {0}" , NFD_GetError() ); break; }; diff --git a/Editor/src/EditorLayer.h b/Editor/src/EditorLayer.h index 1fabb0e..9e2f207 100644 --- a/Editor/src/EditorLayer.h +++ b/Editor/src/EditorLayer.h @@ -40,10 +40,10 @@ public: AssetRegistry assetManager = AssetRegistry(); ModelLoader modelLoader = ModelLoader(); - std::cout << project.GetProjectDirectory() << std::endl; + spdlog::info( "{0}", project.GetProjectDirectory().string()); auto latern = modelLoader.LoadAsset(std::filesystem::path("build/debug/Models/Latern.gltf")); - std::cout << "Loaded mesh: " << latern.GetName() << std::endl; + spdlog::info( "Loaded mesh: {0}" , latern.GetName() ); //ProjectInfo projectInfo(project); //Settings settings = Settings(); @@ -61,7 +61,7 @@ public: if (sceneview.isFocused) { UpdateSceneCamera(sceneview); - std::cout << "Scene view in Focus!\r"; + spdlog::info( "Scene view in Focus!\r"); } } @@ -95,12 +95,12 @@ public: void OnCreate() override { - std::cout << " Layer Create!" << std::endl; + spdlog::info(" Layer Create!" ); } void OnDestroy() override { - std::cout << " Layer Destroy!" << std::endl; + spdlog::info( " Layer Destroy!" ); } diff --git a/Editor/src/MainMenuBar.cpp b/Editor/src/MainMenuBar.cpp index d78b539..11d2914 100644 --- a/Editor/src/MainMenuBar.cpp +++ b/Editor/src/MainMenuBar.cpp @@ -25,7 +25,7 @@ void MainMenuBar::ApplicationMenu(Project& project) { case(NFD_CANCEL): break; case(NFD_ERROR): - std::cout << "NFD_Error: " << NFD_GetError() << std::endl; + spdlog::error( "NFD_Error: {0}" , NFD_GetError() ); break; } @@ -35,13 +35,13 @@ void MainMenuBar::ApplicationMenu(Project& project) { nfdresult_t result = NFD_SaveDialog({ "yproj" }, NULL, &path); switch (result) { case(NFD_OKAY): - std::cout << "Save as: " << path << std::endl; + spdlog::info( "Save as: {0}" , path ); Project::SaveProject(path, project); break; case(NFD_CANCEL): break; case(NFD_ERROR): - std::cout << "NFD_Error: " << NFD_GetError() << std::endl; + spdlog::error( "NFD_Error: {0}" , NFD_GetError() ); break; } } diff --git a/Editor/src/Project/Project.h b/Editor/src/Project/Project.h index 35dff87..8ccac7a 100644 --- a/Editor/src/Project/Project.h +++ b/Editor/src/Project/Project.h @@ -9,7 +9,7 @@ class Project { public: Project() = default; Project(const std::string& name): Name(name){} - ~Project() { std::cout << "Unloading project..." << Name << std::endl; } + ~Project() { spdlog::info("Unloading project {0}...", Name);} void setName(std::string& name) { Name = name; } const std::string& GetName()const { return Name; } diff --git a/YoggieEngine/src/PerfCounter.cpp b/YoggieEngine/src/PerfCounter.cpp index e9e989f..04154c3 100644 --- a/YoggieEngine/src/PerfCounter.cpp +++ b/YoggieEngine/src/PerfCounter.cpp @@ -9,7 +9,7 @@ namespace YoggieEngine { void EngineInstrumentation::PerfomanceSamplerInit() { - std::cout << "Initialize perf sampler" << std::endl; + spdlog::info( "Initialize perf sampler" ); /*EngineInstrumentation::frames = 0; EngineInstrumentation::lastSampleTime = GetPrecisionTime();*/ }