Skip to content

Commit

Permalink
minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Redcrafter committed Aug 5, 2024
1 parent bebeebf commit eecb427
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/glm
2 changes: 1 addition & 1 deletion lib/imgui
Submodule imgui updated 61 files
+1 −1 .github/FUNDING.yml
+1 −0 .gitignore
+2 −2 backends/imgui_impl_allegro5.cpp
+1 −0 backends/imgui_impl_allegro5.h
+1 −0 backends/imgui_impl_android.h
+1 −0 backends/imgui_impl_dx10.h
+1 −0 backends/imgui_impl_dx11.h
+2 −0 backends/imgui_impl_dx12.h
+1 −0 backends/imgui_impl_dx9.h
+44 −18 backends/imgui_impl_glfw.cpp
+4 −2 backends/imgui_impl_glfw.h
+1 −0 backends/imgui_impl_glut.h
+2 −0 backends/imgui_impl_metal.h
+3 −0 backends/imgui_impl_opengl2.cpp
+1 −0 backends/imgui_impl_opengl2.h
+5 −1 backends/imgui_impl_opengl3.cpp
+1 −1 backends/imgui_impl_opengl3.h
+2 −0 backends/imgui_impl_osx.h
+3 −2 backends/imgui_impl_osx.mm
+20 −6 backends/imgui_impl_sdl2.cpp
+1 −0 backends/imgui_impl_sdl2.h
+100 −76 backends/imgui_impl_sdl3.cpp
+3 −2 backends/imgui_impl_sdl3.h
+1 −0 backends/imgui_impl_sdlrenderer2.h
+26 −3 backends/imgui_impl_sdlrenderer3.cpp
+1 −0 backends/imgui_impl_sdlrenderer3.h
+6 −2 backends/imgui_impl_vulkan.cpp
+2 −2 backends/imgui_impl_vulkan.h
+1 −0 backends/imgui_impl_wgpu.h
+23 −9 backends/imgui_impl_win32.cpp
+1 −0 backends/imgui_impl_win32.h
+19 −19 docs/BACKENDS.md
+387 −7 docs/CHANGELOG.txt
+6 −39 docs/EXAMPLES.md
+1 −1 docs/FAQ.md
+4 −4 docs/README.md
+8 −10 docs/TODO.txt
+1 −1 examples/example_android_opengl3/android/app/src/main/AndroidManifest.xml
+1 −1 examples/example_glfw_opengl3/main.cpp
+8 −11 examples/example_glfw_vulkan/main.cpp
+14 −1 examples/example_glfw_wgpu/CMakeLists.txt
+1 −1 examples/example_glfw_wgpu/main.cpp
+8 −11 examples/example_sdl2_vulkan/main.cpp
+3 −3 examples/example_sdl3_opengl3/Makefile
+1 −4 examples/example_sdl3_opengl3/main.cpp
+3 −3 examples/example_sdl3_sdlrenderer3/Makefile
+1 −4 examples/example_sdl3_sdlrenderer3/main.cpp
+14 −2 examples/example_win32_directx10/main.cpp
+13 −2 examples/example_win32_directx11/main.cpp
+15 −2 examples/example_win32_directx12/main.cpp
+18 −4 examples/example_win32_directx9/main.cpp
+20 −0 examples/imgui_examples.sln
+9 −4 imconfig.h
+828 −432 imgui.cpp
+436 −129 imgui.h
+2,119 −415 imgui_demo.cpp
+22 −13 imgui_draw.cpp
+333 −237 imgui_internal.h
+56 −37 imgui_tables.cpp
+1,424 −252 imgui_widgets.cpp
+1 −1 misc/freetype/imgui_freetype.cpp
2 changes: 1 addition & 1 deletion lib/stb
9 changes: 4 additions & 5 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1016,10 +1016,9 @@ static ImGuiID DockSpaceOverViewport(ShaderProgram& textured_shader) {
ImGuiID dockspace_id = ImGui::GetID("DockSpace");
ImGui::DockSpace(dockspace_id, ImVec2(0.0f, 0.0f), dockspace_flags, nullptr);

static auto first_time = true;
if(first_time) {
first_time = false;

static ImGuiID window_id = ImHashStr("Properties");
// only run if no settings for Properties window are found, meaning this is the first time the program is started
if(ImGui::FindWindowSettingsByID(window_id) == nullptr) {
ImGui::DockBuilderRemoveNode(dockspace_id); // clear any previous layout
ImGui::DockBuilderAddNode(dockspace_id, dockspace_flags | ImGuiDockNodeFlags_DockSpace);
ImGui::DockBuilderSetNodeSize(dockspace_id, viewport->Size);
Expand Down Expand Up @@ -1221,7 +1220,7 @@ static void DrawPreviewWindow() {
ImGui::SeparatorText("Room Data");
ImGui::Text("position %i %i", room->x, room->y);
ImGui::InputScalar("water level", ImGuiDataType_U8, &room->waterLevel);
const uint8_t bg_min = 0, bg_max = 18;
const uint8_t bg_min = 0, bg_max = 19;
if(ImGui::SliderScalar("background id", ImGuiDataType_U8, &room->bgId, &bg_min, &bg_max)) {
renderBgs(game_data.maps[selectedMap], *bg_text);
}
Expand Down
5 changes: 3 additions & 2 deletions src/structures/ambient.hpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#pragma once

#include <cstdint>
#include <cstring>
#include <span>
#include <stdexcept>
#include <vector>
Expand All @@ -27,9 +28,9 @@ struct LightingData {
auto count = *(uint64_t*)ptr;
ptr += 8;

return { (LightingData*)ptr, ((LightingData*)ptr) + count };
return {(LightingData*)ptr, ((LightingData*)ptr) + count};
}
static std::vector<uint8_t> save(std::span<LightingData> data) {
static std::vector<uint8_t> save(const std::span<LightingData>& data) {
std::vector<uint8_t> res(4 + 8 + data.size_bytes());

auto ptr = res.data();
Expand Down
2 changes: 1 addition & 1 deletion src/windows/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ void SearchWindow::draw(const GameData& game_data, std::function<void(int, glm::
if(ImGui::Begin("Search")) {
ImGui::InputInt("tile_id", &tile_id);

if(ImGui::IsItemDeactivated() && (ImGui::IsKeyPressed(ImGuiKey_Enter, ImGui::GetItemID()) || ImGui::IsKeyPressed(ImGuiKey_KeypadEnter, ImGui::GetItemID()))) {
if(ImGui::IsItemDeactivated() && (ImGui::IsKeyPressed(ImGuiKey_Enter, ImGuiInputFlags_None, ImGui::GetItemID()) || ImGui::IsKeyPressed(ImGuiKey_KeypadEnter, ImGuiInputFlags_None, ImGui::GetItemID()))) {
search(game_data);
}

Expand Down

0 comments on commit eecb427

Please sign in to comment.