Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions engine/3rdparty/JoltPhysics/Jolt/Core/Core.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ JPH_SUPPRESS_WARNINGS_STD_BEGIN
#include <cmath>
#include <sstream>
#include <functional>
#include <cstdint>
JPH_SUPPRESS_WARNINGS_STD_END
#if defined(JPH_USE_SSE)
#include <immintrin.h>
Expand Down
10 changes: 5 additions & 5 deletions engine/3rdparty/imgui/imgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3035,7 +3035,7 @@ void ImGui::RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end

// Default clip_rect uses (pos_min,pos_max)
// Handle clipping on CPU immediately (vs typically let the GPU clip the triangles that are overlapping the clipping rectangle edges)
void ImGui::RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_display_end, const ImVec2* text_size_if_known, const ImVec2& align, const ImRect* clip_rect)
void ImGui::RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_display_end, const ImVec2* text_size_if_known, const ImVec2& align, const ImRect* clip_rect, const ImGuiCol_ gui_col)
{
// Perform CPU side clipping for single clipped element to avoid using scissor state
ImVec2 pos = pos_min;
Expand All @@ -3055,15 +3055,15 @@ void ImGui::RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, co
if (need_clipping)
{
ImVec4 fine_clip_rect(clip_min->x, clip_min->y, clip_max->x, clip_max->y);
draw_list->AddText(NULL, 0.0f, pos, GetColorU32(ImGuiCol_Text), text, text_display_end, 0.0f, &fine_clip_rect);
draw_list->AddText(NULL, 0.0f, pos, GetColorU32(gui_col), text, text_display_end, 0.0f, &fine_clip_rect);
}
else
{
draw_list->AddText(NULL, 0.0f, pos, GetColorU32(ImGuiCol_Text), text, text_display_end, 0.0f, NULL);
draw_list->AddText(NULL, 0.0f, pos, GetColorU32(gui_col), text, text_display_end, 0.0f, NULL);
}
}

void ImGui::RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align, const ImRect* clip_rect)
void ImGui::RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align, const ImRect* clip_rect, const ImGuiCol_ gui_col)
{
// Hide anything after a '##' string
const char* text_display_end = FindRenderedTextEnd(text, text_end);
Expand All @@ -3073,7 +3073,7 @@ void ImGui::RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, cons

ImGuiContext& g = *GImGui;
ImGuiWindow* window = g.CurrentWindow;
RenderTextClippedEx(window->DrawList, pos_min, pos_max, text, text_display_end, text_size_if_known, align, clip_rect);
RenderTextClippedEx(window->DrawList, pos_min, pos_max, text, text_display_end, text_size_if_known, align, clip_rect, gui_col);
if (g.LogEnabled)
LogRenderedText(&pos_min, text, text_display_end);
}
Expand Down
2 changes: 1 addition & 1 deletion engine/3rdparty/imgui/imgui.h
Original file line number Diff line number Diff line change
Expand Up @@ -618,7 +618,7 @@ namespace ImGui
// Widgets: Selectables
// - A selectable highlights when hovered, and can display another color when selected.
// - Neighbors selectable extend their highlight bounds in order to leave no gap between them. This is so a series of selected Selectable appear contiguous.
IMGUI_API bool Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0, 0)); // "bool selected" carry the selection state (read-only). Selectable() is clicked is returns true so you can modify your selection state. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height
IMGUI_API bool Selectable(const char* label, bool selected = false, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0, 0), const bool is_disable = false); // "bool selected" carry the selection state (read-only). Selectable() is clicked is returns true so you can modify your selection state. size.x==0.0: use remaining width, size.x>0.0: specify width. size.y==0.0: use label height, size.y>0.0: specify height
IMGUI_API bool Selectable(const char* label, bool* p_selected, ImGuiSelectableFlags flags = 0, const ImVec2& size = ImVec2(0, 0)); // "bool* p_selected" point to the selection state (read-write), as a convenient helper.

// Widgets: List Boxes
Expand Down
4 changes: 2 additions & 2 deletions engine/3rdparty/imgui/imgui_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -3028,8 +3028,8 @@ namespace ImGui
// NB: All position are in absolute pixels coordinates (we are never using window coordinates internally)
IMGUI_API void RenderText(ImVec2 pos, const char* text, const char* text_end = NULL, bool hide_text_after_hash = true);
IMGUI_API void RenderTextWrapped(ImVec2 pos, const char* text, const char* text_end, float wrap_width);
IMGUI_API void RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL);
IMGUI_API void RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL);
IMGUI_API void RenderTextClipped(const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL, const ImGuiCol_ gui_col = ImGuiCol_Text);
IMGUI_API void RenderTextClippedEx(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, const char* text, const char* text_end, const ImVec2* text_size_if_known, const ImVec2& align = ImVec2(0, 0), const ImRect* clip_rect = NULL, const ImGuiCol_ gui_col = ImGuiCol_Text);
IMGUI_API void RenderTextEllipsis(ImDrawList* draw_list, const ImVec2& pos_min, const ImVec2& pos_max, float clip_max_x, float ellipsis_max_x, const char* text, const char* text_end, const ImVec2* text_size_if_known);
IMGUI_API void RenderFrame(ImVec2 p_min, ImVec2 p_max, ImU32 fill_col, bool border = true, float rounding = 0.0f);
IMGUI_API void RenderFrameBorder(ImVec2 p_min, ImVec2 p_max, float rounding = 0.0f);
Expand Down
4 changes: 2 additions & 2 deletions engine/3rdparty/imgui/imgui_widgets.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6200,7 +6200,7 @@ bool ImGui::CollapsingHeader(const char* label, bool* p_visible, ImGuiTreeNodeFl
// But you need to make sure the ID is unique, e.g. enclose calls in PushID/PopID or use ##unique_id.
// With this scheme, ImGuiSelectableFlags_SpanAllColumns and ImGuiSelectableFlags_AllowItemOverlap are also frequently used flags.
// FIXME: Selectable() with (size.x == 0.0f) and (SelectableTextAlign.x > 0.0f) followed by SameLine() is currently not supported.
bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags flags, const ImVec2& size_arg)
bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags flags, const ImVec2& size_arg, const bool is_disable)
{
ImGuiWindow* window = GetCurrentWindow();
if (window->SkipItems)
Expand Down Expand Up @@ -6332,7 +6332,7 @@ bool ImGui::Selectable(const char* label, bool selected, ImGuiSelectableFlags fl
else if (span_all_columns && g.CurrentTable)
TablePopBackgroundChannel();

RenderTextClipped(text_min, text_max, label, NULL, &label_size, style.SelectableTextAlign, &bb);
RenderTextClipped(text_min, text_max, label, NULL, &label_size, style.SelectableTextAlign, &bb, is_disable ? ImGuiCol_TextDisabled : ImGuiCol_Text);

// Automatically close popups
if (pressed && (window->Flags & ImGuiWindowFlags_Popup) && !(flags & ImGuiSelectableFlags_DontClosePopups) && !(g.LastItemData.InFlags & ImGuiItemFlags_SelectableDontClosePopup))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2566,6 +2566,7 @@ VMA_CALL_PRE void VMA_CALL_POST vmaFreeStatsString(
#undef VMA_IMPLEMENTATION

#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <utility>
Expand Down
31 changes: 31 additions & 0 deletions engine/asset/level/1-1.level.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
}
}
],
"active": true,
"definition": "asset/objects/environment/particle/particle.object.json"
},
{
Expand Down Expand Up @@ -62,6 +63,7 @@
}
}
],
"active": true,
"definition": "asset/objects/character/player/player.object.json"
},
{
Expand Down Expand Up @@ -91,6 +93,7 @@
"$typeName": "TransformComponent"
}
],
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json"
},
{
Expand Down Expand Up @@ -120,6 +123,7 @@
"$typeName": "TransformComponent"
}
],
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json"
},
{
Expand Down Expand Up @@ -149,10 +153,12 @@
"$typeName": "TransformComponent"
}
],
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json"
},
{
"name": "Wall_4",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -182,6 +188,7 @@
},
{
"name": "Wall_5",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -211,6 +218,7 @@
},
{
"name": "Wall_6",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -240,6 +248,7 @@
},
{
"name": "Wall_7",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -269,6 +278,7 @@
},
{
"name": "Wall_8",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -298,6 +308,7 @@
},
{
"name": "Wall_9",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -327,6 +338,7 @@
},
{
"name": "Wall_10",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -356,6 +368,7 @@
},
{
"name": "Wall_11",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -385,6 +398,7 @@
},
{
"name": "Wall_12",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -414,6 +428,7 @@
},
{
"name": "Wall_13",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -443,6 +458,7 @@
},
{
"name": "Wall_14",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -472,6 +488,7 @@
},
{
"name": "Wall_15",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -501,6 +518,7 @@
},
{
"name": "Wall_16",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -530,6 +548,7 @@
},
{
"name": "Wall_17",
"active": true,
"definition": "asset/objects/environment/wall/wall.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -559,6 +578,7 @@
},
{
"name": "WallWithDoor_1",
"active": true,
"definition": "asset/objects/environment/wall/wall_with_door.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -588,6 +608,7 @@
},
{
"name": "WallWithDoor_2",
"active": true,
"definition": "asset/objects/environment/wall/wall_with_door.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -617,6 +638,7 @@
},
{
"name": "WallWithDoor_3",
"active": true,
"definition": "asset/objects/environment/wall/wall_with_door.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -646,6 +668,7 @@
},
{
"name": "WallWithDoor_4",
"active": true,
"definition": "asset/objects/environment/wall/wall_with_door.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -675,6 +698,7 @@
},
{
"name": "WallWithDoor_5",
"active": true,
"definition": "asset/objects/environment/wall/wall_with_door.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -704,6 +728,7 @@
},
{
"name": "WallWithWindow_1",
"active": true,
"definition": "asset/objects/environment/wall/wall_with_window.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -733,6 +758,7 @@
},
{
"name": "WallWithWindow_2",
"active": true,
"definition": "asset/objects/environment/wall/wall_with_window.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -762,6 +788,7 @@
},
{
"name": "WallBlock_1",
"active": true,
"definition": "asset/objects/environment/wall/wall_block.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -791,6 +818,7 @@
},
{
"name": "WallBlock_2",
"active": true,
"definition": "asset/objects/environment/wall/wall_block.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -820,6 +848,7 @@
},
{
"name": "Stairs",
"active": true,
"definition": "asset/objects/environment/stairs/stairs.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -849,6 +878,7 @@
},
{
"name": "Ground",
"active": true,
"definition": "asset/objects/environment/floor/floor.object.json",
"instanced_components": [
{
Expand Down Expand Up @@ -886,6 +916,7 @@
"z": 0
}
},
"active": true,
"definition": "asset/objects/environment/fence/fence.object.json",
"instanced_components": [
{
Expand Down
26 changes: 24 additions & 2 deletions engine/source/editor/source/editor_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -416,10 +416,12 @@ namespace Piccolo
const GObjectID object_id = id_object_pair.first;
std::shared_ptr<GObject> object = id_object_pair.second;
const std::string name = object->getName();
const bool is_active = object->isActive();
if (name.size() > 0)
{
if (ImGui::Selectable(name.c_str(),
g_editor_global_context.m_scene_manager->getSelectedObjectID() == object_id))
g_editor_global_context.m_scene_manager->getSelectedObjectID() == object_id,
0, ImVec2(0, 0), !is_active))
{
if (g_editor_global_context.m_scene_manager->getSelectedObjectID() != object_id)
{
Expand Down Expand Up @@ -557,6 +559,26 @@ namespace Piccolo
ImGui::SameLine();
ImGui::InputText("##Name", cname, IM_ARRAYSIZE(cname), ImGuiInputTextFlags_ReadOnly);

// active state
bool is_active = selected_object->isActive();
if (is_active)
{
if (ImGui::Button("Active"))
{
is_active = !is_active;
selected_object->setActive(is_active);
}
}
else
{
if (ImGui::Button("Inactive"))
{
is_active = !is_active;
selected_object->setActive(is_active);
}
}


static ImGuiTableFlags flags = ImGuiTableFlags_Resizable | ImGuiTableFlags_NoSavedSettings;
auto&& selected_object_components = selected_object->getComponents();
for (auto component_ptr : selected_object_components)
Expand Down Expand Up @@ -919,7 +941,7 @@ namespace Piccolo
ImVec4* colors = style->Colors;

colors[ImGuiCol_Text] = ImVec4(0.4745f, 0.4745f, 0.4745f, 1.00f);
colors[ImGuiCol_TextDisabled] = ImVec4(0.50f, 0.50f, 0.50f, 1.00f);
colors[ImGuiCol_TextDisabled] = ImVec4(0.20f, 0.20f, 0.20f, 1.00f);
colors[ImGuiCol_WindowBg] = ImVec4(0.0078f, 0.0078f, 0.0078f, 1.00f);
colors[ImGuiCol_ChildBg] = ImVec4(0.00f, 0.00f, 0.00f, 0.00f);
colors[ImGuiCol_PopupBg] = ImVec4(0.08f, 0.08f, 0.08f, 0.94f);
Expand Down
1 change: 1 addition & 0 deletions engine/source/runtime/core/meta/reflection/reflection.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include "reflection.h"
#include <algorithm>
#include <cstring>
#include <map>

Expand Down
Loading