Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
chaoticgd committed Oct 28, 2024
1 parent 07fbe1f commit 5ada5e6
Show file tree
Hide file tree
Showing 21 changed files with 5,878 additions and 3,077 deletions.
10 changes: 7 additions & 3 deletions src/editor/gui/editor_gui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -364,17 +364,19 @@ static void tool_bar() {
}

for(s32 i = 0; i < g_tool_count; i++) {
ImGui::PushID(i);

bool active = i == g_active_tool;
if(!active) {
ImGui::PushStyleColor(ImGuiCol_Button, ImVec4(0, 0, 0, 0));
}

bool clicked = ImGui::ImageButton(
(void*) (intptr_t) icon_textures[i].id,
"##icon",
(ImTextureID) icon_textures[i].id,
ImVec2(32 * g_config.ui.scale, 32 * g_config.ui.scale),
ImVec2(0, 0),
ImVec2(1, 1),
-1);
ImVec2(1, 1));
if(!active) {
ImGui::PopStyleColor();
}
Expand All @@ -383,6 +385,8 @@ static void tool_bar() {
g_active_tool = i;
g_tools[g_active_tool]->funcs.activate();
}

ImGui::PopID();
}

if(g_app->last_frame) {
Expand Down
6 changes: 4 additions & 2 deletions src/editor/gui/inspector.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

#include "inspector.h"

#define IMGUI_DEFINE_MATH_OPERATORS

#include <functional>
#include <imgui.h>

Expand Down Expand Up @@ -472,7 +474,7 @@ static InspectorFieldFuncs camera_collision_funcs() {
changed |= ImGui::Checkbox("##cam_coll_enabled", &first_params.enabled);
ImGui::PushStyleColor(ImGuiCol_FrameBg, 0);
ImGui::SameLine();
ImGuiInputTextFlags flags = ImGuiInputTextFlags_EnterReturnsTrue;
ImGuiInputTextFlags flags = ImGuiInputTextFlags_None;
if(!first_params.enabled) {
flags |= ImGuiInputTextFlags_ReadOnly;
}
Expand Down Expand Up @@ -518,7 +520,7 @@ static InspectorFieldFuncs moby_rooted_funcs() {
changed |= ImGui::Checkbox("##is_rooted", &is_rooted);
ImGui::PushStyleColor(ImGuiCol_FrameBg, 0);
ImGui::SameLine();
ImGuiInputTextFlags flags = ImGuiInputTextFlags_EnterReturnsTrue;
ImGuiInputTextFlags flags = ImGuiInputTextFlags_None;
if(!is_rooted) {
flags |= ImGuiInputTextFlags_ReadOnly;
}
Expand Down
2 changes: 1 addition & 1 deletion src/editor/gui/model_preview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ void model_preview(GLuint* texture, const RenderMesh* mesh, const std::vector<Re
}
});

ImGui::Image((void*) (intptr_t) *texture, view_size);
ImGui::Image((ImTextureID) *texture, view_size);
bool image_hovered = ImGui::IsItemHovered();

static bool is_dragging = false;
Expand Down
2 changes: 1 addition & 1 deletion src/editor/gui/view_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ void view_3d() {
g_tools[g_active_tool]->funcs.draw();
});

ImGui::Image((void*) (intptr_t) frame_buffer_texture, *view_size);
ImGui::Image((ImTextureID) frame_buffer_texture, *view_size);

g_tools[g_active_tool]->funcs.update();
}
Expand Down
9 changes: 9 additions & 0 deletions src/editor/tools/transform_tool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,15 @@ static void update() {
ImGuizmo::AllowAxisFlip(false);
ImGuizmo::SetGizmoSizeClipSpace(0.2f);

ImGuizmo::Style& style = ImGuizmo::GetStyle();
style.TranslationLineThickness = 4.f;
style.TranslationLineArrowSize = 11.f;
style.RotationLineThickness = 4.f;
style.Colors[ImGuizmo::DIRECTION_X] = ImColor(0xff, 0x33, 0x52, 0xff);
style.Colors[ImGuizmo::DIRECTION_Y] = ImColor(0x8b, 0xdc, 0x00, 0xff);
style.Colors[ImGuizmo::DIRECTION_Z] = ImColor(0x28, 0x90, 0xff, 0xff);
style.Colors[ImGuizmo::SELECTION] = ImColor(0xff, 0xff, 0xff, 0xff);

Level& lvl = *g_app->get_level();

static glm::mat4 RATCHET_TO_IMGUIZMO = {
Expand Down
2 changes: 2 additions & 0 deletions src/gui/command_output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ void gui::command_output_screen(const char* id, CommandThread& command, void (*c
if(ImGui::BeginPopupModal(id)) {
ImGui::SetNextItemWidth(-1);
ImGui::InputTextMultiline("output", &command.get_last_output_lines(), size, ImGuiInputTextFlags_Multiline | ImGuiInputTextFlags_ReadOnly);
ImGui::GetCurrentContext()->InputTextState.ReloadUserBufAndKeepSelection();

if(command.is_running()) {
if(ImGui::Button("Cancel")) {
close_callback();
Expand Down
2 changes: 1 addition & 1 deletion src/launcher/image_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ void image_viewer(const std::vector<ModImage>& images) {
ImVec2 image_size(image.width, image.height);

ImGui::SetCursorPos(image_pos);
ImGui::Image((void*) (intptr_t) image.texture.id, image_size);
ImGui::Image((ImTextureID) image.texture.id, image_size);

ImGui::SetCursorPos(ImVec2(0, viewport.y));
ImGui::NewLine();
Expand Down
4 changes: 3 additions & 1 deletion src/launcher/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

#define IMGUI_DEFINE_MATH_OPERATORS

#include "imgui.h"
#include <nfd.h>
#include <core/png.h>
Expand Down Expand Up @@ -188,7 +190,7 @@ static void details_window(Mod* mod) {
ImVec2 display_size(320.f * image.width / (f32) image.height, 320.f);

ImGui::SetCursorPosX(ImGui::GetWindowWidth() / 2 - display_size.x / 2);
if(ImGui::ImageButton((void*) (intptr_t) image.texture.id, display_size, ImVec2(0, 0), ImVec2(1, 1), 0)) {
if(ImGui::ImageButton("##imageviewer", (ImTextureID) image.texture.id, display_size, ImVec2(0, 0), ImVec2(1, 1))) {
ImGui::OpenPopup("Image Viewer");
}

Expand Down
2 changes: 1 addition & 1 deletion src/launcher/oobe.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ static void oobe(f32 delta_time) {
ImDrawList& background = *ImGui::GetBackgroundDrawList();
background.AddRectFilledMultiColor(ImVec2(0, 0), ImGui::GetMainViewport()->Size,
0xffff0000, 0xffff0000, 0xff000000, 0xff000000);
background.AddImage((void*) (intptr_t) welcome.id, ImVec2(0, 0), ImVec2(512, 128));
background.AddImage((ImTextureID) welcome.id, ImVec2(0, 0), ImVec2(512, 128));

ImVec2 centre = ImGui::GetMainViewport()->GetCenter();
ImGui::SetNextWindowPos(centre, ImGuiCond_Always, ImVec2(0.5f, 0.5f));
Expand Down
1 change: 1 addition & 0 deletions thirdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ set(ZLIB_FOUND TRUE)
set(ZLIB_INCLUDE_DIR ${CMAKE_SOURCE_DIR}/thirdparty/zlib ${CMAKE_BINARY_DIR}/thirdparty/zlib)
# ZLIB_INCLUDE_DIRS is used by genout.cmake.in from libpng.
set(ZLIB_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/thirdparty/zlib ${CMAKE_BINARY_DIR}/thirdparty/zlib)
add_library(ZLIB::ZLIB ALIAS zlib)
if(WIN32)
# ZLIB_LIBRARY is used by libzip and must be set at configuration time hence
# we copy the library file into a fixed location.
Expand Down
Loading

0 comments on commit 5ada5e6

Please sign in to comment.