Remove random prints, replaced with DEBUG_PRINT from gcml

This commit is contained in:
OusmBlueNinja 2024-12-26 23:42:36 -06:00
parent 4876a6c2dd
commit 9ecb3034a4
4 changed files with 24 additions and 14 deletions

View File

@ -2,11 +2,22 @@ Entities:
- ID: 0
Name: Default
Components:
Mesh:
vao: 1
indexCount: 36
textureID: 1
Transform:
Position: [0, 0, 0]
Rotation: [0, 0.5, 0]
Scale: [1, 1, 1]
Position: [0, 1.39999998, 0]
Rotation: [-180, -115.599998, 0]
Scale: [1, 1, 1]
Mesh:
vao: 2
indexCount: 15810
textureID: 1
- ID: 1
Name: Car
Components:
Transform:
Position: [0, 1.39999998, 0]
Rotation: [-180, -115.599998, 0]
Scale: [0.99000001, 0.99000001, 0.99000001]
Mesh:
vao: 2
indexCount: 15810
textureID: 3

View File

@ -1,6 +1,10 @@
#include "Mesh.h"
//TODO: Make this have a OBJ path, make indexCount derive from AssetManager
//TODO: and make texture id also get from AssetManager
//? Procastinate
const std::string MeshComponent::name = "Mesh";
MeshComponent::MeshComponent()

View File

@ -23,6 +23,7 @@ struct GenericAsset
void* data = nullptr;
};
struct Vertex {
float position[3];
float texCoord[2];

View File

@ -74,7 +74,6 @@ void SceneWindow::Show()
if (ImGui::IsItemClicked(ImGuiMouseButton_Left))
{
g_SelectedObject = obj;
std::cout << "Selected GameObject: " << obj->name << " with ID: " << obj->id << std::endl;
}
// Right-click context menu for GameObject actions
@ -83,10 +82,8 @@ void SceneWindow::Show()
// Delete GameObject Option
if (ImGui::MenuItem("Remove"))
{
std::cout << "Attempting to remove GameObject: " << obj->name << " with ID: " << obj->id << std::endl;
RemoveGameObject(static_cast<int>(i));
std::cout << "Removed GameObject: " << obj->name << std::endl;
ImGui::EndPopup();
// Since we've erased the current entity, adjust the loop accordingly
@ -135,7 +132,6 @@ void SceneWindow::AddGameObject()
// Modify the name to ensure uniqueness
newObj->name += " " + std::to_string(g_GameObjects.size());
g_GameObjects.push_back(newObj);
std::cout << "Added GameObject: " << newObj->name << " with ID: " << newObj->id << std::endl;
}
// RemoveGameObject: Removes a GameObject by index
@ -147,15 +143,13 @@ void SceneWindow::RemoveGameObject(int index)
if (g_SelectedObject == g_GameObjects[index])
{
g_SelectedObject = nullptr;
std::cout << "Cleared selection as the selected GameObject was removed." << std::endl;
}
std::cout << "Removing GameObject: " << g_GameObjects[index]->name << " with ID: " << g_GameObjects[index]->id << std::endl;
g_GameObjects.erase(g_GameObjects.begin() + index);
}
else
{
std::cerr << "Attempted to remove GameObject with invalid index: " << index << std::endl;
DEBUG_PRINT("Attempted to remove GameObject with invalid index: %d", index );
}
}