diff --git a/src/engine/StaticMeshActor.cpp b/src/engine/StaticMeshActor.cpp index 840286856..2e5fa1119 100644 --- a/src/engine/StaticMeshActor.cpp +++ b/src/engine/StaticMeshActor.cpp @@ -14,7 +14,6 @@ StaticMeshActor::StaticMeshActor(std::string name, FVector pos, IRotator rot, FV void StaticMeshActor::Draw() { Mat4 mtx; -printf("DRAWING \n"); gSPSetGeometryMode(gDisplayListHead++, G_SHADING_SMOOTH); gSPClearGeometryMode(gDisplayListHead++, G_LIGHTING); if (!Model.empty()) { @@ -23,10 +22,6 @@ printf("DRAWING \n"); gSPDisplayList(gDisplayListHead++, (Gfx*)Model.c_str()); } } - - FVector test = FVector(cameras[0].pos[0], cameras[0].pos[1], cameras[0].pos[2]); - FVector diff = test - Pos; - printf("Cam dist: %f", diff.Magnitude()); } void StaticMeshActor::Destroy() { diff --git a/src/port/ui/ContentBrowser.cpp b/src/port/ui/ContentBrowser.cpp index a43519524..24b1561d1 100644 --- a/src/port/ui/ContentBrowser.cpp +++ b/src/port/ui/ContentBrowser.cpp @@ -15,6 +15,7 @@ #include #include "CoreMath.h" #include "World.h" +#include "Crab.h" namespace Editor { @@ -39,18 +40,18 @@ namespace Editor { // Query content in o2r and add them to Content if (refresh) { refresh = false; + Content.clear(); FindContent(); return; } + AddStockContent(); // Display entries in Content for (const auto& file : Content) { if (ImGui::Button(file.c_str())) { int coll; //printf("ContentBrowser.cpp: name: %s\n", test.c_str()); - printf("TEST %s\n", file.c_str()); std::string name = file.substr(file.find_last_of('/') + 1); - printf("NAME %s\n", name.c_str()); auto actor = gWorldInstance.AddStaticMeshActor(name, FVector(50, 100, 0), IRotator(0, 90, 0), FVector(1, 1, 1), "__OTR__" + file, &coll); // This is required because ptr gets cleaned up. actor->Model = "__OTR__" + file; @@ -59,11 +60,16 @@ namespace Editor { } } + void ContentBrowserWindow::AddStockContent() { + if (ImGui::Button("Crab")) { + gWorldInstance.AddObject(new OCrab(FVector2D(0, 0), FVector2D(0, 100))); + } + } + void ContentBrowserWindow::FindContent() { std::list myList = {"tracks/*", "actors/*", "objects/*"}; std::list myList2 = {""}; - Content.clear(); auto ptr = GameEngine::Instance->context->GetResourceManager()->GetArchiveManager()->ListFiles(myList, myList2); if (ptr) { diff --git a/src/port/ui/ContentBrowser.h b/src/port/ui/ContentBrowser.h index bcae78b6c..d1b89559b 100644 --- a/src/port/ui/ContentBrowser.h +++ b/src/port/ui/ContentBrowser.h @@ -13,6 +13,7 @@ protected: void InitElement() override {}; void DrawElement() override; void UpdateElement() override {}; + void AddStockContent(); void FindContent(); }; -} \ No newline at end of file +}