diff options
| author | Jonathan Bradley <jcb@pikum.xyz> | 2025-01-14 18:17:54 -0500 |
|---|---|---|
| committer | Jonathan Bradley <jcb@pikum.xyz> | 2025-01-14 18:17:54 -0500 |
| commit | 5a7b4a65a1d93744e4a5e6cc6df4244f61b81f68 (patch) | |
| tree | 4b59cb1d6e513c1caefdc7e4c35955741bcfe206 /src/game.cpp | |
| parent | 80a67230fe192287503092a3d256aea3a494409c (diff) | |
chore: fix compiler warnings + extra includes
Diffstat (limited to 'src/game.cpp')
| -rw-r--r-- | src/game.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/src/game.cpp b/src/game.cpp index be4bb25..0fb2ccd 100644 --- a/src/game.cpp +++ b/src/game.cpp @@ -7,18 +7,18 @@ #include "dynamic-array.hpp" #include "ecs.hpp" #include "entities.hpp" +#include "event.hpp" #include "game-settings.hpp" +#include "game-type-defs.hpp" #include "helpers.hpp" #include "imgui.h" #include "level-types.hpp" #include "level.hpp" -#include "math-helpers.hpp" #include "physics.hpp" #include "player-input.hpp" #include "plugins.hpp" #include "project.hpp" #include "thread-pool.hpp" -#include "vendor-glm-include.hpp" #include "window.hpp" #include "pk.h" @@ -254,6 +254,7 @@ void ParseInstance(Entity_Base *parentEntity, std::ifstream &stream) { .newEntHandle = EntityHandle_MAX, .newInstHandle = InstanceHandle_MAX, .newInstance = { + .posRot = {}, .scale = btVector3(1.f, 1.f, 1.f), .mass = 1.f, }, @@ -413,11 +414,11 @@ void Game_SaveSceneFile(const char *sceneFilePath) { stream << PKE_FILE_VERSION << std::endl; stream << "" << std::endl; - int64_t instanceBucketCount = ECS_GetInstances_BucketCount(); - for (long b = 0; b < instanceBucketCount; ++b) { - uint64_t count; + pk_handle_bucket_index_T instanceBucketCount = ECS_GetInstances_BucketCount(); + for (pk_handle_bucket_index_T b = 0; b < instanceBucketCount; ++b) { + pk_handle_item_index_T count; auto *instances = ECS_GetInstances(b, count); - for (long i = 0; i < count; ++i) { + for (pk_handle_item_index_T i = 0; i < count; ++i) { const auto &instance = instances[i]; if (instance.entHandle == EntityHandle_MAX) continue; @@ -427,11 +428,11 @@ void Game_SaveSceneFile(const char *sceneFilePath) { } } - int64_t cameraBucketCount = PkeCamera_GetBucketCount(); - for (long b = 0; b < cameraBucketCount; ++b) { - int64_t count; + pk_handle_bucket_index_T cameraBucketCount = PkeCamera_GetBucketCount(); + for (pk_handle_bucket_index_T b = 0; b < cameraBucketCount; ++b) { + pk_handle_item_index_T count; auto *cameras = PkeCamera_GetCameras(b, count); - for (long i = 0; i < count; ++i) { + for (pk_handle_item_index_T i = 0; i < count; ++i) { const auto &cam = cameras[i]; if (cam.handle == CameraHandle_MAX) continue; @@ -498,10 +499,10 @@ void Game_LoadSceneFile(PkeLevel *level, const char *sceneFilePath) { PkeArray_SoftReset(&loadFileInstanceMappings); } -const uint64_t consoleBufferCount = 30; -const uint64_t consoleLineLength = 128; +const int64_t consoleBufferCount = 30; +const int64_t consoleLineLength = 128; char consoleBuffer[consoleBufferCount][consoleLineLength]; -long consoleBufferIndex = 0; +int64_t consoleBufferIndex = 0; void Game_RecordImGui() { static bool scrollToBottom = true; if (!ImGui::Begin("Console", &pkeSettings.editorSettings.isShowingConsole)) { @@ -511,10 +512,10 @@ void Game_RecordImGui() { ImVec2 region = ImGui::GetContentRegionAvail(); region.y -= 27; if (ImGui::BeginListBox("##ConsoleHistory", region)) { - for (long i = consoleBufferIndex + 1; i < consoleBufferCount; ++i) { + for (int64_t i = consoleBufferIndex + 1; i < consoleBufferCount; ++i) { ImGui::Text("%s", consoleBuffer[i]); } - for (long i = 0; i < consoleBufferIndex; ++i) { + for (int64_t i = 0; i < consoleBufferIndex; ++i) { ImGui::Text("%s", consoleBuffer[i]); } if (scrollToBottom) ImGui::SetScrollHereY(1); @@ -716,7 +717,7 @@ void Game_Main(PKEWindowProperties windowProps, const char *executablePath) { void Game_Init() { pkeSettings.mem.bkt = pk_bucket_create("game", 1UL << 26, true); - for (long i = 0; i < consoleBufferCount; ++i) { + for (uint64_t i = 0; i < consoleBufferCount; ++i) { memset(consoleBuffer[i], '\0', consoleLineLength); } } |
