fixing stuff

This commit is contained in:
Asuro
2025-03-24 18:30:46 +01:00
parent fa93abe1ec
commit aafa5e966e
17 changed files with 174 additions and 90 deletions

View File

@@ -731,17 +731,17 @@ namespace Game
return mat;
}
uint16_t GameRendering::GetModelHandleFromPath(const char* path)
Generated::ModelHandle GameRendering::GetModelHandleFromPath(const char* path)
{
uint32_t AssetHandle = CrcPath(path);
for (int32_t i = 0; i < ModelCount; ++i)
{
if (Models[i].AssetHandle == AssetHandle)
if (Models[i].Handle.Asset.Idx == AssetHandle)
{
return i;
return Models[i].Handle;
}
}
return 0;
return {};
}
} // namespace Game

View File

@@ -1,11 +1,12 @@
#pragma once
#include "bgfx/defines.h"
#include "imgui.h"
#include <bgfx/bgfx.h>
#include <bx/string.h>
#include <cstdint>
#include "../Gen.h"
#include "../Global.h"
#include "imgui.h"
union SDL_Event;
@@ -36,7 +37,7 @@ namespace Game
bgfx::VertexBufferHandle VertexBuffer;
bgfx::IndexBufferHandle IndexBuffer;
bgfx::VertexLayout VertLayout;
uint32_t AssetHandle = UINT16_MAX;
Generated::ModelHandle Handle;
};
struct Material
@@ -118,6 +119,6 @@ namespace Game
void HandleEvents();
void RenderDebugUI();
void Shutdown();
uint16_t GetModelHandleFromPath(const char* path);
Generated::ModelHandle GetModelHandleFromPath(const char* path);
};
} // namespace Game