diff --git a/3rdparty/ocornut-imgui/imgui_node_graph_test.cpp b/3rdparty/ocornut-imgui/imgui_node_graph_test.cpp index e35602937..669137c27 100644 --- a/3rdparty/ocornut-imgui/imgui_node_graph_test.cpp +++ b/3rdparty/ocornut-imgui/imgui_node_graph_test.cpp @@ -12,6 +12,27 @@ static inline ImVec2 operator+(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x+rhs.x, lhs.y+rhs.y); } static inline ImVec2 operator-(const ImVec2& lhs, const ImVec2& rhs) { return ImVec2(lhs.x-rhs.x, lhs.y-rhs.y); } +struct Node +{ + int ID; + char Name[32]; + ImVec2 Pos, Size; + float Value; + int InputsCount, OutputsCount; + + Node(int id, const char* name, const ImVec2& pos, float value, int inputs_count, int outputs_count) { ID = id; strncpy(Name, name, 31); Name[31] = 0; Pos = pos; Value = value; InputsCount = inputs_count; OutputsCount = outputs_count; } + + ImVec2 GetInputSlotPos(int slot_no) const { return ImVec2(Pos.x, Pos.y + Size.y * ((float)slot_no+1) / ((float)InputsCount+1)); } + ImVec2 GetOutputSlotPos(int slot_no) const { return ImVec2(Pos.x + Size.x, Pos.y + Size.y * ((float)slot_no+1) / ((float)OutputsCount+1)); } +}; + +struct NodeLink +{ + int InputIdx, InputSlot, OutputIdx, OutputSlot; + + NodeLink(int input_idx, int input_slot, int output_idx, int output_slot) { InputIdx = input_idx; InputSlot = input_slot; OutputIdx = output_idx; OutputSlot = output_slot; } +}; + // Really dumb data structure provided for the example. // Note that we storing links are INDICES (not ID) to make example code shorter, obviously a bad idea for any general purpose code. void ShowExampleAppCustomNodeGraph(bool* opened) @@ -23,26 +44,6 @@ void ShowExampleAppCustomNodeGraph(bool* opened) return; } - struct Node - { - int ID; - char Name[32]; - ImVec2 Pos, Size; - float Value; - int InputsCount, OutputsCount; - - Node(int id, const char* name, const ImVec2& pos, float value, int inputs_count, int outputs_count) { ID = id; strncpy(Name, name, 31); Name[31] = 0; Pos = pos; Value = value; InputsCount = inputs_count; OutputsCount = outputs_count; } - - ImVec2 GetInputSlotPos(int slot_no) const { return ImVec2(Pos.x, Pos.y + Size.y * ((float)slot_no+1) / ((float)InputsCount+1)); } - ImVec2 GetOutputSlotPos(int slot_no) const { return ImVec2(Pos.x + Size.x, Pos.y + Size.y * ((float)slot_no+1) / ((float)OutputsCount+1)); } - }; - struct NodeLink - { - int InputIdx, InputSlot, OutputIdx, OutputSlot; - - NodeLink(int input_idx, int input_slot, int output_idx, int output_slot) { InputIdx = input_idx; InputSlot = input_slot; OutputIdx = output_idx; OutputSlot = output_slot; } - }; - static ImVector nodes; static ImVector links; static bool inited = false; diff --git a/3rdparty/stb/stb_truetype.h b/3rdparty/stb/stb_truetype.h index 3eba78646..2e90c2264 100644 --- a/3rdparty/stb/stb_truetype.h +++ b/3rdparty/stb/stb_truetype.h @@ -2048,7 +2048,7 @@ static void stbtt__fill_active_edges_new(float *scanline, float *scanline_fill, static void stbtt__rasterize_sorted_edges(stbtt__bitmap *result, stbtt__edge *e, int n, int vsubsample, int off_x, int off_y, void *userdata) { (void)vsubsample; - stbtt__hheap hh = { 0 }; + stbtt__hheap hh = {}; stbtt__active_edge *active = NULL; int y,j=0, i; float scanline_data[129], *scanline, *scanline2;