static puzzle data!

This commit is contained in:
Asuro
2025-03-13 00:41:32 +01:00
parent f3f994fd8b
commit 155339917d
18 changed files with 264 additions and 143 deletions

39
src/game/Tools.cpp Normal file
View File

@@ -0,0 +1,39 @@
#include "Global.h"
#include "Instance.h"
#include "Tools.h"
#include "rendering/Rendering.h"
#include <imgui.h>
namespace Tools
{
const char* GetAssetPath(uint32_t assetHandle)
{
const auto& inst = Game::GetInstance();
for (int32_t j = 0; j < inst.DebugData.AssetCount; ++j)
{
if (inst.DebugData.AssetHandles[j] == assetHandle)
{
return inst.DebugData.AssetHandlePaths[j];
}
}
return "---";
}
void ModelDropdown(uint16_t& modelHandle)
{
auto& R = Game::GameRendering::Get();
const char* name = GetAssetPath(R.Models[modelHandle].AssetHandle);
if (ImGui::BeginCombo("Models", name))
{
for (int32_t i = 0; i < R.ModelCount; ++i)
{
if (ImGui::Selectable(GetAssetPath(R.Models[i].AssetHandle), i == modelHandle))
{
modelHandle = i;
}
}
ImGui::EndCombo();
}
}
} // namespace Tools