Remove random prints, replaced with DEBUG_PRINT from gcml
This commit is contained in:
parent
4876a6c2dd
commit
9ecb3034a4
@ -2,11 +2,22 @@ Entities:
|
|||||||
- ID: 0
|
- ID: 0
|
||||||
Name: Default
|
Name: Default
|
||||||
Components:
|
Components:
|
||||||
Mesh:
|
|
||||||
vao: 1
|
|
||||||
indexCount: 36
|
|
||||||
textureID: 1
|
|
||||||
Transform:
|
Transform:
|
||||||
Position: [0, 0, 0]
|
Position: [0, 1.39999998, 0]
|
||||||
Rotation: [0, 0.5, 0]
|
Rotation: [-180, -115.599998, 0]
|
||||||
Scale: [1, 1, 1]
|
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
|
@ -1,6 +1,10 @@
|
|||||||
|
|
||||||
#include "Mesh.h"
|
#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";
|
const std::string MeshComponent::name = "Mesh";
|
||||||
|
|
||||||
MeshComponent::MeshComponent()
|
MeshComponent::MeshComponent()
|
||||||
|
@ -23,6 +23,7 @@ struct GenericAsset
|
|||||||
void* data = nullptr;
|
void* data = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
struct Vertex {
|
struct Vertex {
|
||||||
float position[3];
|
float position[3];
|
||||||
float texCoord[2];
|
float texCoord[2];
|
||||||
|
@ -74,7 +74,6 @@ void SceneWindow::Show()
|
|||||||
if (ImGui::IsItemClicked(ImGuiMouseButton_Left))
|
if (ImGui::IsItemClicked(ImGuiMouseButton_Left))
|
||||||
{
|
{
|
||||||
g_SelectedObject = obj;
|
g_SelectedObject = obj;
|
||||||
std::cout << "Selected GameObject: " << obj->name << " with ID: " << obj->id << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Right-click context menu for GameObject actions
|
// Right-click context menu for GameObject actions
|
||||||
@ -83,10 +82,8 @@ void SceneWindow::Show()
|
|||||||
// Delete GameObject Option
|
// Delete GameObject Option
|
||||||
if (ImGui::MenuItem("Remove"))
|
if (ImGui::MenuItem("Remove"))
|
||||||
{
|
{
|
||||||
std::cout << "Attempting to remove GameObject: " << obj->name << " with ID: " << obj->id << std::endl;
|
|
||||||
|
|
||||||
RemoveGameObject(static_cast<int>(i));
|
RemoveGameObject(static_cast<int>(i));
|
||||||
std::cout << "Removed GameObject: " << obj->name << std::endl;
|
|
||||||
|
|
||||||
ImGui::EndPopup();
|
ImGui::EndPopup();
|
||||||
// Since we've erased the current entity, adjust the loop accordingly
|
// Since we've erased the current entity, adjust the loop accordingly
|
||||||
@ -135,7 +132,6 @@ void SceneWindow::AddGameObject()
|
|||||||
// Modify the name to ensure uniqueness
|
// Modify the name to ensure uniqueness
|
||||||
newObj->name += " " + std::to_string(g_GameObjects.size());
|
newObj->name += " " + std::to_string(g_GameObjects.size());
|
||||||
g_GameObjects.push_back(newObj);
|
g_GameObjects.push_back(newObj);
|
||||||
std::cout << "Added GameObject: " << newObj->name << " with ID: " << newObj->id << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// RemoveGameObject: Removes a GameObject by index
|
// RemoveGameObject: Removes a GameObject by index
|
||||||
@ -147,15 +143,13 @@ void SceneWindow::RemoveGameObject(int index)
|
|||||||
if (g_SelectedObject == g_GameObjects[index])
|
if (g_SelectedObject == g_GameObjects[index])
|
||||||
{
|
{
|
||||||
g_SelectedObject = nullptr;
|
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);
|
g_GameObjects.erase(g_GameObjects.begin() + index);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
std::cerr << "Attempted to remove GameObject with invalid index: " << index << std::endl;
|
DEBUG_PRINT("Attempted to remove GameObject with invalid index: %d", index );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user