├── .gitignore ├── LICENSE ├── PSAGameNodesEditor.sln ├── PSAGameNodesEditor ├── ExternalDepLibrary │ ├── ImGuiForOpenGL │ │ ├── imconfig.h │ │ ├── imgui.cpp │ │ ├── imgui.h │ │ ├── imgui_demo.cpp │ │ ├── imgui_draw.cpp │ │ ├── imgui_impl_glfw.cpp │ │ ├── imgui_impl_glfw.h │ │ ├── imgui_impl_opengl2.cpp │ │ ├── imgui_impl_opengl2.h │ │ ├── imgui_impl_opengl3.cpp │ │ ├── imgui_impl_opengl3.h │ │ ├── imgui_impl_opengl3_loader.h │ │ ├── imgui_internal.h │ │ ├── imgui_tables.cpp │ │ ├── imgui_widgets.cpp │ │ ├── imstb_rectpack.h │ │ ├── imstb_textedit.h │ │ ├── imstb_truetype.h │ │ └── misc │ │ │ ├── README.txt │ │ │ ├── cpp │ │ │ ├── README.txt │ │ │ ├── imgui_stdlib.cpp │ │ │ └── imgui_stdlib.h │ │ │ ├── debuggers │ │ │ ├── README.txt │ │ │ ├── imgui.gdb │ │ │ ├── imgui.natstepfilter │ │ │ └── imgui.natvis │ │ │ ├── fonts │ │ │ ├── Cousine-Regular.ttf │ │ │ ├── DroidSans.ttf │ │ │ ├── Karla-Regular.ttf │ │ │ ├── ProggyClean.ttf │ │ │ ├── ProggyTiny.ttf │ │ │ ├── Roboto-Medium.ttf │ │ │ └── binary_to_compressed_c.cpp │ │ │ ├── freetype │ │ │ ├── README.md │ │ │ ├── imgui_freetype.cpp │ │ │ └── imgui_freetype.h │ │ │ └── single_file │ │ │ └── imgui_single_file.h │ ├── ImNodes │ │ ├── imnodes.cpp │ │ ├── imnodes.h │ │ └── imnodes_internal.h │ ├── OpenGLglew │ │ ├── bin │ │ │ └── Release │ │ │ │ ├── Win32 │ │ │ │ └── glew32.dll │ │ │ │ └── x64 │ │ │ │ └── glew32.dll │ │ ├── include │ │ │ └── GL │ │ │ │ ├── eglew.h │ │ │ │ ├── glew.h │ │ │ │ ├── glxew.h │ │ │ │ └── wglew.h │ │ └── lib │ │ │ └── Release │ │ │ ├── Win32 │ │ │ ├── glew32.lib │ │ │ └── glew32s.lib │ │ │ └── x64 │ │ │ ├── glew32.lib │ │ │ └── glew32s.lib │ ├── OpenGLglfw │ │ ├── include │ │ │ └── GLFW │ │ │ │ ├── glext.h │ │ │ │ ├── glfw3.h │ │ │ │ └── glfw3native.h │ │ └── lib-vc2019 │ │ │ ├── glfw3.dll │ │ │ ├── glfw3.lib │ │ │ ├── glfw3_mt.lib │ │ │ └── glfw3dll.lib │ ├── RapidJSON │ │ └── include │ │ │ ├── allocators.h │ │ │ ├── cursorstreamwrapper.h │ │ │ ├── document.h │ │ │ ├── encodedstream.h │ │ │ ├── encodings.h │ │ │ ├── error │ │ │ ├── en.h │ │ │ └── error.h │ │ │ ├── filereadstream.h │ │ │ ├── filewritestream.h │ │ │ ├── fwd.h │ │ │ ├── internal │ │ │ ├── biginteger.h │ │ │ ├── clzll.h │ │ │ ├── diyfp.h │ │ │ ├── dtoa.h │ │ │ ├── ieee754.h │ │ │ ├── itoa.h │ │ │ ├── meta.h │ │ │ ├── pow10.h │ │ │ ├── regex.h │ │ │ ├── stack.h │ │ │ ├── strfunc.h │ │ │ ├── strtod.h │ │ │ └── swap.h │ │ │ ├── istreamwrapper.h │ │ │ ├── memorybuffer.h │ │ │ ├── memorystream.h │ │ │ ├── msinttypes │ │ │ ├── inttypes.h │ │ │ └── stdint.h │ │ │ ├── ostreamwrapper.h │ │ │ ├── pointer.h │ │ │ ├── prettywriter.h │ │ │ ├── rapidjson.h │ │ │ ├── reader.h │ │ │ ├── schema.h │ │ │ ├── stream.h │ │ │ ├── stringbuffer.h │ │ │ ├── uri.h │ │ │ └── writer.h │ ├── STBimageLoader │ │ ├── stb_image.h │ │ └── stb_image_write.h │ └── imgui_bloom_src │ │ ├── opengl_imgui_bloom.cpp │ │ ├── opengl_imgui_bloom.h │ │ └── opengl_imgui_bloom_script.cpp ├── NodesEditorCore │ ├── NodesSystemCore │ │ ├── psag_nodes_system.hpp │ │ ├── psag_nodes_system_data.hpp │ │ ├── psag_nodes_system_encode.cpp │ │ ├── psag_nodes_system_file.cpp │ │ ├── psag_nodes_system_loader.cpp │ │ ├── psag_nodes_system_operation.cpp │ │ └── psag_nodes_system_render.cpp │ ├── NodesSystemLogger │ │ ├── framework_logger.cpp │ │ └── framework_logger.hpp │ ├── psag_nodes_editor.cpp │ ├── psag_nodes_editor.h │ ├── psag_nodes_editor_blur.cpp │ └── psag_nodes_editor_init.cpp ├── NodesEditorResource │ ├── JetBrainsMonoBoldItalic.ttf │ ├── SystemConfig │ │ ├── nodes_config_attributes.json │ │ ├── nodes_config_types.json │ │ └── system_editor_config.json │ └── SystemProject │ │ └── SystemNodesTest.psanodes ├── PSAGameNodesEditor.cpp ├── PSAGameNodesEditor.vcxproj ├── PSAGameNodesEditor.vcxproj.filters ├── PSAGameNodesEditor.vcxproj.user └── imgui.ini ├── README.md ├── docs ├── editor_demo_v1.png ├── node_editor_config.md ├── node_editor_export.md ├── node_editor_usage.md └── usage_image_1.png └── x64 └── Debug ├── glew32.dll └── glfw3.dll /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Compiled Object files 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | 10 | # Precompiled Headers 11 | *.gch 12 | *.pch 13 | 14 | # Compiled Dynamic libraries 15 | *.so 16 | *.dylib 17 | # *.dll 18 | 19 | # Fortran module files 20 | *.mod 21 | *.smod 22 | 23 | # Compiled Static libraries 24 | *.lai 25 | *.la 26 | *.a 27 | # *.lib 28 | 29 | # Executables 30 | *.exe 31 | *.out 32 | *.app 33 | 34 | # PSAnodeEditor 35 | 36 | /.vs 37 | 38 | *.tlog 39 | *.obj 40 | *.iobj 41 | *.exp 42 | *.log 43 | *.bat 44 | *.vsidx 45 | *.gitattributes 46 | *.ilk 47 | *.pdb 48 | *.idb 49 | *.lastbuildstate -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024-2030 ཫཌཟRCSZཇདཀ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in all 14 | copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | SOFTWARE. 23 | -------------------------------------------------------------------------------- /PSAGameNodesEditor.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.10.34928.147 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PSAGameNodesEditor", "PSAGameNodesEditor\PSAGameNodesEditor.vcxproj", "{2DBF5F0E-A9BE-4F74-9891-5D5BF36E2703}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|x64 = Debug|x64 11 | Debug|x86 = Debug|x86 12 | Release|x64 = Release|x64 13 | Release|x86 = Release|x86 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {2DBF5F0E-A9BE-4F74-9891-5D5BF36E2703}.Debug|x64.ActiveCfg = Debug|x64 17 | {2DBF5F0E-A9BE-4F74-9891-5D5BF36E2703}.Debug|x64.Build.0 = Debug|x64 18 | {2DBF5F0E-A9BE-4F74-9891-5D5BF36E2703}.Debug|x86.ActiveCfg = Debug|Win32 19 | {2DBF5F0E-A9BE-4F74-9891-5D5BF36E2703}.Debug|x86.Build.0 = Debug|Win32 20 | {2DBF5F0E-A9BE-4F74-9891-5D5BF36E2703}.Release|x64.ActiveCfg = Release|x64 21 | {2DBF5F0E-A9BE-4F74-9891-5D5BF36E2703}.Release|x64.Build.0 = Release|x64 22 | {2DBF5F0E-A9BE-4F74-9891-5D5BF36E2703}.Release|x86.ActiveCfg = Release|Win32 23 | {2DBF5F0E-A9BE-4F74-9891-5D5BF36E2703}.Release|x86.Build.0 = Release|Win32 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {7D33DD68-E885-40DF-86EC-05B6ECE9543C} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/imconfig.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // COMPILE-TIME OPTIONS FOR DEAR IMGUI 3 | // Runtime options (clipboard callbacks, enabling various features, etc.) can generally be set via the ImGuiIO structure. 4 | // You can use ImGui::SetAllocatorFunctions() before calling ImGui::CreateContext() to rewire memory allocation functions. 5 | //----------------------------------------------------------------------------- 6 | // A) You may edit imconfig.h (and not overwrite it when updating Dear ImGui, or maintain a patch/rebased branch with your modifications to it) 7 | // B) or '#define IMGUI_USER_CONFIG "my_imgui_config.h"' in your project and then add directives in your own file without touching this template. 8 | //----------------------------------------------------------------------------- 9 | // You need to make sure that configuration settings are defined consistently _everywhere_ Dear ImGui is used, which include the imgui*.cpp 10 | // files but also _any_ of your code that uses Dear ImGui. This is because some compile-time options have an affect on data structures. 11 | // Defining those options in imconfig.h will ensure every compilation unit gets to see the same data structure layouts. 12 | // Call IMGUI_CHECKVERSION() from your .cpp files to verify that the data structures your files are using are matching the ones imgui.cpp is using. 13 | //----------------------------------------------------------------------------- 14 | 15 | #pragma once 16 | 17 | //---- Define assertion handler. Defaults to calling assert(). 18 | // If your macro uses multiple statements, make sure is enclosed in a 'do { .. } while (0)' block so it can be used as a single statement. 19 | //#define IM_ASSERT(_EXPR) MyAssert(_EXPR) 20 | //#define IM_ASSERT(_EXPR) ((void)(_EXPR)) // Disable asserts 21 | 22 | //---- Define attributes of all API symbols declarations, e.g. for DLL under Windows 23 | // Using Dear ImGui via a shared library is not recommended, because of function call overhead and because we don't guarantee backward nor forward ABI compatibility. 24 | // DLL users: heaps and globals are not shared across DLL boundaries! You will need to call SetCurrentContext() + SetAllocatorFunctions() 25 | // for each static/DLL boundary you are calling from. Read "Context and Memory Allocators" section of imgui.cpp for more details. 26 | //#define IMGUI_API __declspec( dllexport ) 27 | //#define IMGUI_API __declspec( dllimport ) 28 | 29 | //---- Don't define obsolete functions/enums/behaviors. Consider enabling from time to time after updating to avoid using soon-to-be obsolete function/names. 30 | //#define IMGUI_DISABLE_OBSOLETE_FUNCTIONS 31 | //#define IMGUI_DISABLE_OBSOLETE_KEYIO // 1.87: disable legacy io.KeyMap[]+io.KeysDown[] in favor io.AddKeyEvent(). This will be folded into IMGUI_DISABLE_OBSOLETE_FUNCTIONS in a few versions. 32 | 33 | //---- Disable all of Dear ImGui or don't implement standard windows/tools. 34 | // It is very strongly recommended to NOT disable the demo windows and debug tool during development. They are extremely useful in day to day work. Please read comments in imgui_demo.cpp. 35 | //#define IMGUI_DISABLE // Disable everything: all headers and source files will be empty. 36 | //#define IMGUI_DISABLE_DEMO_WINDOWS // Disable demo windows: ShowDemoWindow()/ShowStyleEditor() will be empty. 37 | //#define IMGUI_DISABLE_DEBUG_TOOLS // Disable metrics/debugger and other debug tools: ShowMetricsWindow(), ShowDebugLogWindow() and ShowStackToolWindow() will be empty (this was called IMGUI_DISABLE_METRICS_WINDOW before 1.88). 38 | 39 | //---- Don't implement some functions to reduce linkage requirements. 40 | //#define IMGUI_DISABLE_WIN32_DEFAULT_CLIPBOARD_FUNCTIONS // [Win32] Don't implement default clipboard handler. Won't use and link with OpenClipboard/GetClipboardData/CloseClipboard etc. (user32.lib/.a, kernel32.lib/.a) 41 | //#define IMGUI_ENABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with Visual Studio] Implement default IME handler (require imm32.lib/.a, auto-link for Visual Studio, -limm32 on command-line for MinGW) 42 | //#define IMGUI_DISABLE_WIN32_DEFAULT_IME_FUNCTIONS // [Win32] [Default with non-Visual Studio compilers] Don't implement default IME handler (won't require imm32.lib/.a) 43 | //#define IMGUI_DISABLE_WIN32_FUNCTIONS // [Win32] Won't use and link with any Win32 function (clipboard, ime). 44 | //#define IMGUI_ENABLE_OSX_DEFAULT_CLIPBOARD_FUNCTIONS // [OSX] Implement default OSX clipboard handler (need to link with '-framework ApplicationServices', this is why this is not the default). 45 | //#define IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS // Don't implement ImFormatString/ImFormatStringV so you can implement them yourself (e.g. if you don't want to link with vsnprintf) 46 | //#define IMGUI_DISABLE_DEFAULT_MATH_FUNCTIONS // Don't implement ImFabs/ImSqrt/ImPow/ImFmod/ImCos/ImSin/ImAcos/ImAtan2 so you can implement them yourself. 47 | //#define IMGUI_DISABLE_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle at all (replace them with dummies) 48 | //#define IMGUI_DISABLE_DEFAULT_FILE_FUNCTIONS // Don't implement ImFileOpen/ImFileClose/ImFileRead/ImFileWrite and ImFileHandle so you can implement them yourself if you don't want to link with fopen/fclose/fread/fwrite. This will also disable the LogToTTY() function. 49 | //#define IMGUI_DISABLE_DEFAULT_ALLOCATORS // Don't implement default allocators calling malloc()/free() to avoid linking with them. You will need to call ImGui::SetAllocatorFunctions(). 50 | //#define IMGUI_DISABLE_SSE // Disable use of SSE intrinsics even if available 51 | 52 | //---- Include imgui_user.h at the end of imgui.h as a convenience 53 | //#define IMGUI_INCLUDE_IMGUI_USER_H 54 | 55 | //---- Pack colors to BGRA8 instead of RGBA8 (to avoid converting from one to another) 56 | //#define IMGUI_USE_BGRA_PACKED_COLOR 57 | 58 | //---- Use 32-bit for ImWchar (default is 16-bit) to support unicode planes 1-16. (e.g. point beyond 0xFFFF like emoticons, dingbats, symbols, shapes, ancient languages, etc...) 59 | //#define IMGUI_USE_WCHAR32 60 | 61 | //---- Avoid multiple STB libraries implementations, or redefine path/filenames to prioritize another version 62 | // By default the embedded implementations are declared static and not available outside of Dear ImGui sources files. 63 | //#define IMGUI_STB_TRUETYPE_FILENAME "my_folder/stb_truetype.h" 64 | //#define IMGUI_STB_RECT_PACK_FILENAME "my_folder/stb_rect_pack.h" 65 | //#define IMGUI_STB_SPRINTF_FILENAME "my_folder/stb_sprintf.h" // only used if enabled 66 | //#define IMGUI_DISABLE_STB_TRUETYPE_IMPLEMENTATION 67 | //#define IMGUI_DISABLE_STB_RECT_PACK_IMPLEMENTATION 68 | 69 | //---- Use stb_sprintf.h for a faster implementation of vsnprintf instead of the one from libc (unless IMGUI_DISABLE_DEFAULT_FORMAT_FUNCTIONS is defined) 70 | // Compatibility checks of arguments and formats done by clang and GCC will be disabled in order to support the extra formats provided by stb_sprintf.h. 71 | //#define IMGUI_USE_STB_SPRINTF 72 | 73 | //---- Use FreeType to build and rasterize the font atlas (instead of stb_truetype which is embedded by default in Dear ImGui) 74 | // Requires FreeType headers to be available in the include path. Requires program to be compiled with 'misc/freetype/imgui_freetype.cpp' (in this repository) + the FreeType library (not provided). 75 | // On Windows you may use vcpkg with 'vcpkg install freetype --triplet=x64-windows' + 'vcpkg integrate install'. 76 | //#define IMGUI_ENABLE_FREETYPE 77 | 78 | //---- Use stb_truetype to build and rasterize the font atlas (default) 79 | // The only purpose of this define is if you want force compilation of the stb_truetype backend ALONG with the FreeType backend. 80 | //#define IMGUI_ENABLE_STB_TRUETYPE 81 | 82 | //---- Define constructor and implicit cast operators to convert back<>forth between your math types and ImVec2/ImVec4. 83 | // This will be inlined as part of ImVec2 and ImVec4 class declarations. 84 | /* 85 | #define IM_VEC2_CLASS_EXTRA \ 86 | constexpr ImVec2(const MyVec2& f) : x(f.x), y(f.y) {} \ 87 | operator MyVec2() const { return MyVec2(x,y); } 88 | 89 | #define IM_VEC4_CLASS_EXTRA \ 90 | constexpr ImVec4(const MyVec4& f) : x(f.x), y(f.y), z(f.z), w(f.w) {} \ 91 | operator MyVec4() const { return MyVec4(x,y,z,w); } 92 | */ 93 | 94 | //---- Use 32-bit vertex indices (default is 16-bit) is one way to allow large meshes with more than 64K vertices. 95 | // Your renderer backend will need to support it (most example renderer backends support both 16/32-bit indices). 96 | // Another way to allow large meshes while keeping 16-bit indices is to handle ImDrawCmd::VtxOffset in your renderer. 97 | // Read about ImGuiBackendFlags_RendererHasVtxOffset for details. 98 | //#define ImDrawIdx unsigned int 99 | 100 | //---- Override ImDrawCallback signature (will need to modify renderer backends accordingly) 101 | //struct ImDrawList; 102 | //struct ImDrawCmd; 103 | //typedef void (*MyImDrawCallback)(const ImDrawList* draw_list, const ImDrawCmd* cmd, void* my_renderer_user_data); 104 | //#define ImDrawCallback MyImDrawCallback 105 | 106 | //---- Debug Tools: Macro to break in Debugger 107 | // (use 'Metrics->Tools->Item Picker' to pick widgets with the mouse and break into them for easy debugging.) 108 | //#define IM_DEBUG_BREAK IM_ASSERT(0) 109 | //#define IM_DEBUG_BREAK __debugbreak() 110 | 111 | //---- Debug Tools: Have the Item Picker break in the ItemAdd() function instead of ItemHoverable(), 112 | // (which comes earlier in the code, will catch a few extra items, allow picking items other than Hovered one.) 113 | // This adds a small runtime cost which is why it is not enabled by default. 114 | //#define IMGUI_DEBUG_TOOL_ITEM_PICKER_EX 115 | 116 | //---- Debug Tools: Enable slower asserts 117 | //#define IMGUI_DEBUG_PARANOID 118 | 119 | //---- Tip: You can add extra functions within the ImGui:: namespace, here or in your own headers files. 120 | /* 121 | namespace ImGui 122 | { 123 | void MyFunction(const char* name, const MyMatrix44& v); 124 | } 125 | */ 126 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/imgui_impl_glfw.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Platform Backend for GLFW 2 | // This needs to be used along with a Renderer (e.g. OpenGL3, Vulkan, WebGPU..) 3 | // (Info: GLFW is a cross-platform general purpose library for handling windows, inputs, OpenGL/Vulkan graphics context creation, etc.) 4 | 5 | // Implemented features: 6 | // [X] Platform: Clipboard support. 7 | // [X] Platform: Keyboard support. Since 1.87 we are using the io.AddKeyEvent() function. Pass ImGuiKey values to all key functions e.g. ImGui::IsKeyPressed(ImGuiKey_Space). [Legacy GLFW_KEY_* values will also be supported unless IMGUI_DISABLE_OBSOLETE_KEYIO is set] 8 | // [X] Platform: Gamepad support. Enable with 'io.ConfigFlags |= ImGuiConfigFlags_NavEnableGamepad'. 9 | // [X] Platform: Mouse cursor shape and visibility. Disable with 'io.ConfigFlags |= ImGuiConfigFlags_NoMouseCursorChange' (note: the resizing cursors requires GLFW 3.4+). 10 | 11 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 12 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 13 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 14 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 15 | 16 | // About GLSL version: 17 | // The 'glsl_version' initialization parameter defaults to "#version 150" if NULL. 18 | // Only override if your GL version doesn't handle this GLSL version. Keep NULL if unsure! 19 | 20 | #pragma once 21 | #include "imgui.h" // IMGUI_IMPL_API 22 | 23 | struct GLFWwindow; 24 | struct GLFWmonitor; 25 | 26 | IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOpenGL(GLFWwindow* window, bool install_callbacks); 27 | IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForVulkan(GLFWwindow* window, bool install_callbacks); 28 | IMGUI_IMPL_API bool ImGui_ImplGlfw_InitForOther(GLFWwindow* window, bool install_callbacks); 29 | IMGUI_IMPL_API void ImGui_ImplGlfw_Shutdown(); 30 | IMGUI_IMPL_API void ImGui_ImplGlfw_NewFrame(); 31 | 32 | // GLFW callbacks (installer) 33 | // - When calling Init with 'install_callbacks=true': ImGui_ImplGlfw_InstallCallbacks() is called. GLFW callbacks will be installed for you. They will chain-call user's previously installed callbacks, if any. 34 | // - When calling Init with 'install_callbacks=false': GLFW callbacks won't be installed. You will need to call individual function yourself from your own GLFW callbacks. 35 | IMGUI_IMPL_API void ImGui_ImplGlfw_InstallCallbacks(GLFWwindow* window); 36 | IMGUI_IMPL_API void ImGui_ImplGlfw_RestoreCallbacks(GLFWwindow* window); 37 | 38 | // GLFW callbacks (individual callbacks to call if you didn't install callbacks) 39 | IMGUI_IMPL_API void ImGui_ImplGlfw_WindowFocusCallback(GLFWwindow* window, int focused); // Since 1.84 40 | IMGUI_IMPL_API void ImGui_ImplGlfw_CursorEnterCallback(GLFWwindow* window, int entered); // Since 1.84 41 | IMGUI_IMPL_API void ImGui_ImplGlfw_CursorPosCallback(GLFWwindow* window, double x, double y); // Since 1.87 42 | IMGUI_IMPL_API void ImGui_ImplGlfw_MouseButtonCallback(GLFWwindow* window, int button, int action, int mods); 43 | IMGUI_IMPL_API void ImGui_ImplGlfw_ScrollCallback(GLFWwindow* window, double xoffset, double yoffset); 44 | IMGUI_IMPL_API void ImGui_ImplGlfw_KeyCallback(GLFWwindow* window, int key, int scancode, int action, int mods); 45 | IMGUI_IMPL_API void ImGui_ImplGlfw_CharCallback(GLFWwindow* window, unsigned int c); 46 | IMGUI_IMPL_API void ImGui_ImplGlfw_MonitorCallback(GLFWmonitor* monitor, int event); 47 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/imgui_impl_opengl2.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for OpenGL2 (legacy OpenGL, fixed pipeline) 2 | // This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID! 6 | 7 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 8 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 9 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 10 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 11 | 12 | // **DO NOT USE THIS CODE IF YOUR CODE/ENGINE IS USING MODERN OPENGL (SHADERS, VBO, VAO, etc.)** 13 | // **Prefer using the code in imgui_impl_opengl3.cpp** 14 | // This code is mostly provided as a reference to learn how ImGui integration works, because it is shorter to read. 15 | // If your code is using GL3+ context or any semi modern OpenGL calls, using this is likely to make everything more 16 | // complicated, will require your code to reset every single OpenGL attributes to their initial state, and might 17 | // confuse your GPU driver. 18 | // The GL2 code is unable to reset attributes or even call e.g. "glUseProgram(0)" because they don't exist in that API. 19 | 20 | #pragma once 21 | #include "imgui.h" // IMGUI_IMPL_API 22 | 23 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_Init(); 24 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_Shutdown(); 25 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_NewFrame(); 26 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_RenderDrawData(ImDrawData* draw_data); 27 | 28 | // Called by Init/NewFrame/Shutdown 29 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateFontsTexture(); 30 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyFontsTexture(); 31 | IMGUI_IMPL_API bool ImGui_ImplOpenGL2_CreateDeviceObjects(); 32 | IMGUI_IMPL_API void ImGui_ImplOpenGL2_DestroyDeviceObjects(); 33 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/imgui_impl_opengl3.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for modern OpenGL with shaders / programmatic pipeline 2 | // - Desktop GL: 2.x 3.x 4.x 3 | // - Embedded GL: ES 2.0 (WebGL 1.0), ES 3.0 (WebGL 2.0) 4 | // This needs to be used along with a Platform Backend (e.g. GLFW, SDL, Win32, custom..) 5 | 6 | // Implemented features: 7 | // [X] Renderer: User texture binding. Use 'GLuint' OpenGL texture identifier as void*/ImTextureID. Read the FAQ about ImTextureID! 8 | // [x] Renderer: Desktop GL only: Support for large meshes (64k+ vertices) with 16-bit indices. 9 | 10 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 11 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 12 | // If you are new to Dear ImGui, read documentation from the docs/ folder + read the top of imgui.cpp. 13 | // Read online: https://github.com/ocornut/imgui/tree/master/docs 14 | 15 | // About GLSL version: 16 | // The 'glsl_version' initialization parameter should be NULL (default) or a "#version XXX" string. 17 | // On computer platform the GLSL version default to "#version 130". On OpenGL ES 3 platform it defaults to "#version 300 es" 18 | // Only override if your GL version doesn't handle this GLSL version. See GLSL version table at the top of imgui_impl_opengl3.cpp. 19 | 20 | #pragma once 21 | #include "imgui.h" // IMGUI_IMPL_API 22 | 23 | // Backend API 24 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_Init(const char* glsl_version = NULL); 25 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_Shutdown(); 26 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_NewFrame(); 27 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_RenderDrawData(ImDrawData* draw_data); 28 | 29 | // (Optional) Called by Init/NewFrame/Shutdown 30 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateFontsTexture(); 31 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyFontsTexture(); 32 | IMGUI_IMPL_API bool ImGui_ImplOpenGL3_CreateDeviceObjects(); 33 | IMGUI_IMPL_API void ImGui_ImplOpenGL3_DestroyDeviceObjects(); 34 | 35 | // Specific OpenGL ES versions 36 | //#define IMGUI_IMPL_OPENGL_ES2 // Auto-detected on Emscripten 37 | //#define IMGUI_IMPL_OPENGL_ES3 // Auto-detected on iOS/Android 38 | 39 | // You can explicitly select GLES2 or GLES3 API by using one of the '#define IMGUI_IMPL_OPENGL_LOADER_XXX' in imconfig.h or compiler command-line. 40 | #if !defined(IMGUI_IMPL_OPENGL_ES2) \ 41 | && !defined(IMGUI_IMPL_OPENGL_ES3) 42 | 43 | // Try to detect GLES on matching platforms 44 | #if defined(__APPLE__) 45 | #include 46 | #endif 47 | #if (defined(__APPLE__) && (TARGET_OS_IOS || TARGET_OS_TV)) || (defined(__ANDROID__)) 48 | #define IMGUI_IMPL_OPENGL_ES3 // iOS, Android -> GL ES 3, "#version 300 es" 49 | #elif defined(__EMSCRIPTEN__) || defined(__amigaos4__) 50 | #define IMGUI_IMPL_OPENGL_ES2 // Emscripten -> GL ES 2, "#version 100" 51 | #else 52 | // Otherwise imgui_impl_opengl3_loader.h will be used. 53 | #endif 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/README.txt: -------------------------------------------------------------------------------- 1 | 2 | misc/cpp/ 3 | InputText() wrappers for C++ standard library (STL) type: std::string. 4 | This is also an example of how you may wrap your own similar types. 5 | 6 | misc/debuggers/ 7 | Helper files for popular debuggers. 8 | With the .natvis file, types like ImVector<> will be displayed nicely in Visual Studio debugger. 9 | 10 | misc/fonts/ 11 | Fonts loading/merging instructions (e.g. How to handle glyph ranges, how to merge icons fonts). 12 | Command line tool "binary_to_compressed_c" to create compressed arrays to embed data in source code. 13 | Suggested fonts and links. 14 | 15 | misc/freetype/ 16 | Font atlas builder/rasterizer using FreeType instead of stb_truetype. 17 | Benefit from better FreeType rasterization, in particular for small fonts. 18 | 19 | misc/single_file/ 20 | Single-file header stub. 21 | We use this to validate compiling all *.cpp files in a same compilation unit. 22 | Users of that technique (also called "Unity builds") can generally provide this themselves, 23 | so we don't really recommend you use this in your projects. 24 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/cpp/README.txt: -------------------------------------------------------------------------------- 1 | 2 | imgui_stdlib.h + imgui_stdlib.cpp 3 | InputText() wrappers for C++ standard library (STL) type: std::string. 4 | This is also an example of how you may wrap your own similar types. 5 | 6 | imgui_scoped.h 7 | [Experimental, not currently in main repository] 8 | Additional header file with some RAII-style wrappers for common Dear ImGui functions. 9 | Try by merging: https://github.com/ocornut/imgui/pull/2197 10 | Discuss at: https://github.com/ocornut/imgui/issues/2096 11 | 12 | See more C++ related extension on Wiki 13 | https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness 14 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/cpp/imgui_stdlib.cpp: -------------------------------------------------------------------------------- 1 | // dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.) 2 | // This is also an example of how you may wrap your own similar types. 3 | 4 | // Changelog: 5 | // - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string 6 | 7 | #include "imgui.h" 8 | #include "imgui_stdlib.h" 9 | 10 | struct InputTextCallback_UserData 11 | { 12 | std::string* Str; 13 | ImGuiInputTextCallback ChainCallback; 14 | void* ChainCallbackUserData; 15 | }; 16 | 17 | static int InputTextCallback(ImGuiInputTextCallbackData* data) 18 | { 19 | InputTextCallback_UserData* user_data = (InputTextCallback_UserData*)data->UserData; 20 | if (data->EventFlag == ImGuiInputTextFlags_CallbackResize) 21 | { 22 | // Resize string callback 23 | // If for some reason we refuse the new length (BufTextLen) and/or capacity (BufSize) we need to set them back to what we want. 24 | std::string* str = user_data->Str; 25 | IM_ASSERT(data->Buf == str->c_str()); 26 | str->resize(data->BufTextLen); 27 | data->Buf = (char*)str->c_str(); 28 | } 29 | else if (user_data->ChainCallback) 30 | { 31 | // Forward to user callback, if any 32 | data->UserData = user_data->ChainCallbackUserData; 33 | return user_data->ChainCallback(data); 34 | } 35 | return 0; 36 | } 37 | 38 | bool ImGui::InputText(const char* label, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) 39 | { 40 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); 41 | flags |= ImGuiInputTextFlags_CallbackResize; 42 | 43 | InputTextCallback_UserData cb_user_data; 44 | cb_user_data.Str = str; 45 | cb_user_data.ChainCallback = callback; 46 | cb_user_data.ChainCallbackUserData = user_data; 47 | return InputText(label, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data); 48 | } 49 | 50 | bool ImGui::InputTextMultiline(const char* label, std::string* str, const ImVec2& size, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) 51 | { 52 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); 53 | flags |= ImGuiInputTextFlags_CallbackResize; 54 | 55 | InputTextCallback_UserData cb_user_data; 56 | cb_user_data.Str = str; 57 | cb_user_data.ChainCallback = callback; 58 | cb_user_data.ChainCallbackUserData = user_data; 59 | return InputTextMultiline(label, (char*)str->c_str(), str->capacity() + 1, size, flags, InputTextCallback, &cb_user_data); 60 | } 61 | 62 | bool ImGui::InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags, ImGuiInputTextCallback callback, void* user_data) 63 | { 64 | IM_ASSERT((flags & ImGuiInputTextFlags_CallbackResize) == 0); 65 | flags |= ImGuiInputTextFlags_CallbackResize; 66 | 67 | InputTextCallback_UserData cb_user_data; 68 | cb_user_data.Str = str; 69 | cb_user_data.ChainCallback = callback; 70 | cb_user_data.ChainCallbackUserData = user_data; 71 | return InputTextWithHint(label, hint, (char*)str->c_str(), str->capacity() + 1, flags, InputTextCallback, &cb_user_data); 72 | } 73 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/cpp/imgui_stdlib.h: -------------------------------------------------------------------------------- 1 | // dear imgui: wrappers for C++ standard library (STL) types (std::string, etc.) 2 | // This is also an example of how you may wrap your own similar types. 3 | 4 | // Changelog: 5 | // - v0.10: Initial version. Added InputText() / InputTextMultiline() calls with std::string 6 | 7 | #pragma once 8 | 9 | #include 10 | 11 | namespace ImGui 12 | { 13 | // ImGui::InputText() with std::string 14 | // Because text input needs dynamic resizing, we need to setup a callback to grow the capacity 15 | IMGUI_API bool InputText(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); 16 | IMGUI_API bool InputTextMultiline(const char* label, std::string* str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); 17 | IMGUI_API bool InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = NULL, void* user_data = NULL); 18 | } 19 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/debuggers/README.txt: -------------------------------------------------------------------------------- 1 | 2 | HELPER FILES FOR POPULAR DEBUGGERS 3 | 4 | imgui.gdb 5 | GDB: disable stepping into trivial functions. 6 | (read comments inside file for details) 7 | 8 | imgui.natstepfilter 9 | Visual Studio Debugger: disable stepping into trivial functions. 10 | (read comments inside file for details) 11 | 12 | imgui.natvis 13 | Visual Studio Debugger: describe Dear ImGui types for better display. 14 | With this, types like ImVector<> will be displayed nicely in the debugger. 15 | (read comments inside file for details) 16 | 17 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/debuggers/imgui.gdb: -------------------------------------------------------------------------------- 1 | # GDB configuration to aid debugging experience 2 | 3 | # To enable these customizations edit $HOME/.gdbinit (or ./.gdbinit if local gdbinit is enabled) and add: 4 | # add-auto-load-safe-path /path/to/imgui.gdb 5 | # source /path/to/imgui.gdb 6 | # 7 | # More Information at: 8 | # * https://sourceware.org/gdb/current/onlinedocs/gdb/gdbinit-man.html 9 | # * https://sourceware.org/gdb/current/onlinedocs/gdb/Init-File-in-the-Current-Directory.html#Init-File-in-the-Current-Directory 10 | 11 | # Disable stepping into trivial functions 12 | skip -rfunction Im(Vec2|Vec4|Strv|Vector|Span)::.+ 13 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/debuggers/imgui.natstepfilter: -------------------------------------------------------------------------------- 1 | 2 | 17 | 18 | 19 | 20 | 21 | 22 | (ImVec2|ImVec4|ImStrv)::.+ 23 | NoStepInto 24 | 25 | 26 | (ImVector|ImSpan).*::operator.+ 27 | NoStepInto 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/debuggers/imgui.natvis: -------------------------------------------------------------------------------- 1 | 2 | 13 | 14 | 15 | 16 | 17 | {{Size={Size} Capacity={Capacity}}} 18 | 19 | 20 | Size 21 | Data 22 | 23 | 24 | 25 | 26 | 27 | {{Size={DataEnd-Data} }} 28 | 29 | 30 | DataEnd-Data 31 | Data 32 | 33 | 34 | 35 | 36 | 37 | {{x={x,g} y={y,g}}} 38 | 39 | 40 | 41 | {{x={x,g} y={y,g} z={z,g} w={w,g}}} 42 | 43 | 44 | 45 | {{Min=({Min.x,g} {Min.y,g}) Max=({Max.x,g} {Max.y,g}) Size=({Max.x-Min.x,g} {Max.y-Min.y,g})}} 46 | 47 | Min 48 | Max 49 | Max.x - Min.x 50 | Max.y - Min.y 51 | 52 | 53 | 54 | 55 | {{Name {Name,s} Active {(Active||WasActive)?1:0,d} Child {(Flags & 0x01000000)?1:0,d} Popup {(Flags & 0x04000000)?1:0,d} Hidden {(Hidden)?1:0,d}} 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/fonts/Cousine-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/fonts/Cousine-Regular.ttf -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/fonts/DroidSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/fonts/DroidSans.ttf -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/fonts/Karla-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/fonts/Karla-Regular.ttf -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/fonts/ProggyClean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/fonts/ProggyClean.ttf -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/fonts/ProggyTiny.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/fonts/ProggyTiny.ttf -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/freetype/README.md: -------------------------------------------------------------------------------- 1 | # imgui_freetype 2 | 3 | Build font atlases using FreeType instead of stb_truetype (which is the default font rasterizer). 4 |
by @vuhdo, @mikesart, @ocornut. 5 | 6 | ### Usage 7 | 8 | 1. Get latest FreeType binaries or build yourself (under Windows you may use vcpkg with `vcpkg install freetype --triplet=x64-windows`, `vcpkg integrate install`). 9 | 2. Add imgui_freetype.h/cpp alongside your project files. 10 | 3. Add `#define IMGUI_ENABLE_FREETYPE` in your [imconfig.h](https://github.com/ocornut/imgui/blob/master/imconfig.h) file 11 | 12 | ### About Gamma Correct Blending 13 | 14 | FreeType assumes blending in linear space rather than gamma space. 15 | See FreeType note for [FT_Render_Glyph](https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_Render_Glyph). 16 | For correct results you need to be using sRGB and convert to linear space in the pixel shader output. 17 | The default Dear ImGui styles will be impacted by this change (alpha values will need tweaking). 18 | 19 | ### Testbed for toying with settings (for developers) 20 | 21 | See https://gist.github.com/ocornut/b3a9ecf13502fd818799a452969649ad 22 | 23 | ### Known issues 24 | 25 | - Oversampling settins are ignored but also not so much necessary with the higher quality rendering. 26 | 27 | ### Comparaison 28 | 29 | Small, thin anti-aliased fonts typically benefit a lot from FreeType's hinting: 30 | ![comparing_font_rasterizers](https://user-images.githubusercontent.com/8225057/107550178-fef87f00-6bd0-11eb-8d09-e2edb2f0ccfc.gif) 31 | 32 | ### Colorful glyphs/emojis 33 | 34 | You can use the `ImGuiFreeTypeBuilderFlags_LoadColor` flag to load certain colorful glyphs. See the 35 | ["Using Colorful Glyphs/Emojis"](https://github.com/ocornut/imgui/blob/master/docs/FONTS.md#using-colorful-glyphsemojis) section of FONTS.md. 36 | 37 | ![colored glyphs](https://user-images.githubusercontent.com/8225057/106171241-9dc4ba80-6191-11eb-8a69-ca1467b206d1.png) 38 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/freetype/imgui_freetype.h: -------------------------------------------------------------------------------- 1 | // dear imgui: FreeType font builder (used as a replacement for the stb_truetype builder) 2 | // (headers) 3 | 4 | #pragma once 5 | 6 | #include "imgui.h" // IMGUI_API 7 | 8 | // Forward declarations 9 | struct ImFontAtlas; 10 | struct ImFontBuilderIO; 11 | 12 | // Hinting greatly impacts visuals (and glyph sizes). 13 | // - By default, hinting is enabled and the font's native hinter is preferred over the auto-hinter. 14 | // - When disabled, FreeType generates blurrier glyphs, more or less matches the stb_truetype.h 15 | // - The Default hinting mode usually looks good, but may distort glyphs in an unusual way. 16 | // - The Light hinting mode generates fuzzier glyphs but better matches Microsoft's rasterizer. 17 | // You can set those flags globaly in ImFontAtlas::FontBuilderFlags 18 | // You can set those flags on a per font basis in ImFontConfig::FontBuilderFlags 19 | enum ImGuiFreeTypeBuilderFlags 20 | { 21 | ImGuiFreeTypeBuilderFlags_NoHinting = 1 << 0, // Disable hinting. This generally generates 'blurrier' bitmap glyphs when the glyph are rendered in any of the anti-aliased modes. 22 | ImGuiFreeTypeBuilderFlags_NoAutoHint = 1 << 1, // Disable auto-hinter. 23 | ImGuiFreeTypeBuilderFlags_ForceAutoHint = 1 << 2, // Indicates that the auto-hinter is preferred over the font's native hinter. 24 | ImGuiFreeTypeBuilderFlags_LightHinting = 1 << 3, // A lighter hinting algorithm for gray-level modes. Many generated glyphs are fuzzier but better resemble their original shape. This is achieved by snapping glyphs to the pixel grid only vertically (Y-axis), as is done by Microsoft's ClearType and Adobe's proprietary font renderer. This preserves inter-glyph spacing in horizontal text. 25 | ImGuiFreeTypeBuilderFlags_MonoHinting = 1 << 4, // Strong hinting algorithm that should only be used for monochrome output. 26 | ImGuiFreeTypeBuilderFlags_Bold = 1 << 5, // Styling: Should we artificially embolden the font? 27 | ImGuiFreeTypeBuilderFlags_Oblique = 1 << 6, // Styling: Should we slant the font, emulating italic style? 28 | ImGuiFreeTypeBuilderFlags_Monochrome = 1 << 7, // Disable anti-aliasing. Combine this with MonoHinting for best results! 29 | ImGuiFreeTypeBuilderFlags_LoadColor = 1 << 8, // Enable FreeType color-layered glyphs 30 | ImGuiFreeTypeBuilderFlags_Bitmap = 1 << 9 // Enable FreeType bitmap glyphs 31 | }; 32 | 33 | namespace ImGuiFreeType 34 | { 35 | // This is automatically assigned when using '#define IMGUI_ENABLE_FREETYPE'. 36 | // If you need to dynamically select between multiple builders: 37 | // - you can manually assign this builder with 'atlas->FontBuilderIO = ImGuiFreeType::GetBuilderForFreeType()' 38 | // - prefer deep-copying this into your own ImFontBuilderIO instance if you use hot-reloading that messes up static data. 39 | IMGUI_API const ImFontBuilderIO* GetBuilderForFreeType(); 40 | 41 | // Override allocators. By default ImGuiFreeType will use IM_ALLOC()/IM_FREE() 42 | // However, as FreeType does lots of allocations we provide a way for the user to redirect it to a separate memory heap if desired. 43 | IMGUI_API void SetAllocatorFunctions(void* (*alloc_func)(size_t sz, void* user_data), void (*free_func)(void* ptr, void* user_data), void* user_data = NULL); 44 | 45 | // Obsolete names (will be removed soon) 46 | // Prefer using '#define IMGUI_ENABLE_FREETYPE' 47 | #ifndef IMGUI_DISABLE_OBSOLETE_FUNCTIONS 48 | static inline bool BuildFontAtlas(ImFontAtlas* atlas, unsigned int flags = 0) { atlas->FontBuilderIO = GetBuilderForFreeType(); atlas->FontBuilderFlags = flags; return atlas->Build(); } 49 | #endif 50 | } 51 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/ImGuiForOpenGL/misc/single_file/imgui_single_file.h: -------------------------------------------------------------------------------- 1 | // dear imgui: single-file wrapper include 2 | // We use this to validate compiling all *.cpp files in a same compilation unit. 3 | // Users of that technique (also called "Unity builds") can generally provide this themselves, 4 | // so we don't really recommend you use this in your projects. 5 | 6 | // Do this: 7 | // #define IMGUI_IMPLEMENTATION 8 | // Before you include this file in *one* C++ file to create the implementation. 9 | // Using this in your project will leak the contents of imgui_internal.h and ImVec2 operators in this compilation unit. 10 | #include "../../imgui.h" 11 | 12 | #ifdef IMGUI_IMPLEMENTATION 13 | #include "../../imgui.cpp" 14 | #include "../../imgui_demo.cpp" 15 | #include "../../imgui_draw.cpp" 16 | #include "../../imgui_tables.cpp" 17 | #include "../../imgui_widgets.cpp" 18 | #endif 19 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/OpenGLglew/bin/Release/Win32/glew32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/OpenGLglew/bin/Release/Win32/glew32.dll -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/OpenGLglew/bin/Release/x64/glew32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/OpenGLglew/bin/Release/x64/glew32.dll -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/OpenGLglew/lib/Release/Win32/glew32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/OpenGLglew/lib/Release/Win32/glew32.lib -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/OpenGLglew/lib/Release/Win32/glew32s.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/OpenGLglew/lib/Release/Win32/glew32s.lib -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/OpenGLglew/lib/Release/x64/glew32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/OpenGLglew/lib/Release/x64/glew32.lib -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/OpenGLglew/lib/Release/x64/glew32s.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/OpenGLglew/lib/Release/x64/glew32s.lib -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/OpenGLglfw/lib-vc2019/glfw3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/OpenGLglfw/lib-vc2019/glfw3.dll -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/OpenGLglfw/lib-vc2019/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/OpenGLglfw/lib-vc2019/glfw3.lib -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/OpenGLglfw/lib-vc2019/glfw3_mt.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/OpenGLglfw/lib-vc2019/glfw3_mt.lib -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/OpenGLglfw/lib-vc2019/glfw3dll.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/OpenGLglfw/lib-vc2019/glfw3dll.lib -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/cursorstreamwrapper.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_CURSORSTREAMWRAPPER_H_ 16 | #define RAPIDJSON_CURSORSTREAMWRAPPER_H_ 17 | 18 | #include "stream.h" 19 | 20 | #if defined(__GNUC__) 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(effc++) 23 | #endif 24 | 25 | #if defined(_MSC_VER) && _MSC_VER <= 1800 26 | RAPIDJSON_DIAG_PUSH 27 | RAPIDJSON_DIAG_OFF(4702) // unreachable code 28 | RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated 29 | #endif 30 | 31 | RAPIDJSON_NAMESPACE_BEGIN 32 | 33 | 34 | //! Cursor stream wrapper for counting line and column number if error exists. 35 | /*! 36 | \tparam InputStream Any stream that implements Stream Concept 37 | */ 38 | template > 39 | class CursorStreamWrapper : public GenericStreamWrapper { 40 | public: 41 | typedef typename Encoding::Ch Ch; 42 | 43 | CursorStreamWrapper(InputStream& is): 44 | GenericStreamWrapper(is), line_(1), col_(0) {} 45 | 46 | // counting line and column number 47 | Ch Take() { 48 | Ch ch = this->is_.Take(); 49 | if(ch == '\n') { 50 | line_ ++; 51 | col_ = 0; 52 | } else { 53 | col_ ++; 54 | } 55 | return ch; 56 | } 57 | 58 | //! Get the error line number, if error exists. 59 | size_t GetLine() const { return line_; } 60 | //! Get the error column number, if error exists. 61 | size_t GetColumn() const { return col_; } 62 | 63 | private: 64 | size_t line_; //!< Current Line 65 | size_t col_; //!< Current Column 66 | }; 67 | 68 | #if defined(_MSC_VER) && _MSC_VER <= 1800 69 | RAPIDJSON_DIAG_POP 70 | #endif 71 | 72 | #if defined(__GNUC__) 73 | RAPIDJSON_DIAG_POP 74 | #endif 75 | 76 | RAPIDJSON_NAMESPACE_END 77 | 78 | #endif // RAPIDJSON_CURSORSTREAMWRAPPER_H_ 79 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/filereadstream.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_FILEREADSTREAM_H_ 16 | #define RAPIDJSON_FILEREADSTREAM_H_ 17 | 18 | #include "stream.h" 19 | #include 20 | 21 | #ifdef __clang__ 22 | RAPIDJSON_DIAG_PUSH 23 | RAPIDJSON_DIAG_OFF(padded) 24 | RAPIDJSON_DIAG_OFF(unreachable-code) 25 | RAPIDJSON_DIAG_OFF(missing-noreturn) 26 | #endif 27 | 28 | RAPIDJSON_NAMESPACE_BEGIN 29 | 30 | //! File byte stream for input using fread(). 31 | /*! 32 | \note implements Stream concept 33 | */ 34 | class FileReadStream { 35 | public: 36 | typedef char Ch; //!< Character type (byte). 37 | 38 | //! Constructor. 39 | /*! 40 | \param fp File pointer opened for read. 41 | \param buffer user-supplied buffer. 42 | \param bufferSize size of buffer in bytes. Must >=4 bytes. 43 | */ 44 | FileReadStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { 45 | RAPIDJSON_ASSERT(fp_ != 0); 46 | RAPIDJSON_ASSERT(bufferSize >= 4); 47 | Read(); 48 | } 49 | 50 | Ch Peek() const { return *current_; } 51 | Ch Take() { Ch c = *current_; Read(); return c; } 52 | size_t Tell() const { return count_ + static_cast(current_ - buffer_); } 53 | 54 | // Not implemented 55 | void Put(Ch) { RAPIDJSON_ASSERT(false); } 56 | void Flush() { RAPIDJSON_ASSERT(false); } 57 | Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } 58 | size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } 59 | 60 | // For encoding detection only. 61 | const Ch* Peek4() const { 62 | return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0; 63 | } 64 | 65 | private: 66 | void Read() { 67 | if (current_ < bufferLast_) 68 | ++current_; 69 | else if (!eof_) { 70 | count_ += readCount_; 71 | readCount_ = std::fread(buffer_, 1, bufferSize_, fp_); 72 | bufferLast_ = buffer_ + readCount_ - 1; 73 | current_ = buffer_; 74 | 75 | if (readCount_ < bufferSize_) { 76 | buffer_[readCount_] = '\0'; 77 | ++bufferLast_; 78 | eof_ = true; 79 | } 80 | } 81 | } 82 | 83 | std::FILE* fp_; 84 | Ch *buffer_; 85 | size_t bufferSize_; 86 | Ch *bufferLast_; 87 | Ch *current_; 88 | size_t readCount_; 89 | size_t count_; //!< Number of characters read 90 | bool eof_; 91 | }; 92 | 93 | RAPIDJSON_NAMESPACE_END 94 | 95 | #ifdef __clang__ 96 | RAPIDJSON_DIAG_POP 97 | #endif 98 | 99 | #endif // RAPIDJSON_FILESTREAM_H_ 100 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/filewritestream.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_FILEWRITESTREAM_H_ 16 | #define RAPIDJSON_FILEWRITESTREAM_H_ 17 | 18 | #include "stream.h" 19 | #include 20 | 21 | #ifdef __clang__ 22 | RAPIDJSON_DIAG_PUSH 23 | RAPIDJSON_DIAG_OFF(unreachable-code) 24 | #endif 25 | 26 | RAPIDJSON_NAMESPACE_BEGIN 27 | 28 | //! Wrapper of C file stream for output using fwrite(). 29 | /*! 30 | \note implements Stream concept 31 | */ 32 | class FileWriteStream { 33 | public: 34 | typedef char Ch; //!< Character type. Only support char. 35 | 36 | FileWriteStream(std::FILE* fp, char* buffer, size_t bufferSize) : fp_(fp), buffer_(buffer), bufferEnd_(buffer + bufferSize), current_(buffer_) { 37 | RAPIDJSON_ASSERT(fp_ != 0); 38 | } 39 | 40 | void Put(char c) { 41 | if (current_ >= bufferEnd_) 42 | Flush(); 43 | 44 | *current_++ = c; 45 | } 46 | 47 | void PutN(char c, size_t n) { 48 | size_t avail = static_cast(bufferEnd_ - current_); 49 | while (n > avail) { 50 | std::memset(current_, c, avail); 51 | current_ += avail; 52 | Flush(); 53 | n -= avail; 54 | avail = static_cast(bufferEnd_ - current_); 55 | } 56 | 57 | if (n > 0) { 58 | std::memset(current_, c, n); 59 | current_ += n; 60 | } 61 | } 62 | 63 | void Flush() { 64 | if (current_ != buffer_) { 65 | size_t result = std::fwrite(buffer_, 1, static_cast(current_ - buffer_), fp_); 66 | if (result < static_cast(current_ - buffer_)) { 67 | // failure deliberately ignored at this time 68 | // added to avoid warn_unused_result build errors 69 | } 70 | current_ = buffer_; 71 | } 72 | } 73 | 74 | // Not implemented 75 | char Peek() const { RAPIDJSON_ASSERT(false); return 0; } 76 | char Take() { RAPIDJSON_ASSERT(false); return 0; } 77 | size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } 78 | char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } 79 | size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; } 80 | 81 | private: 82 | // Prohibit copy constructor & assignment operator. 83 | FileWriteStream(const FileWriteStream&); 84 | FileWriteStream& operator=(const FileWriteStream&); 85 | 86 | std::FILE* fp_; 87 | char *buffer_; 88 | char *bufferEnd_; 89 | char *current_; 90 | }; 91 | 92 | //! Implement specialized version of PutN() with memset() for better performance. 93 | template<> 94 | inline void PutN(FileWriteStream& stream, char c, size_t n) { 95 | stream.PutN(c, n); 96 | } 97 | 98 | RAPIDJSON_NAMESPACE_END 99 | 100 | #ifdef __clang__ 101 | RAPIDJSON_DIAG_POP 102 | #endif 103 | 104 | #endif // RAPIDJSON_FILESTREAM_H_ 105 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/fwd.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_FWD_H_ 16 | #define RAPIDJSON_FWD_H_ 17 | 18 | #include "rapidjson.h" 19 | 20 | RAPIDJSON_NAMESPACE_BEGIN 21 | 22 | // encodings.h 23 | 24 | template struct UTF8; 25 | template struct UTF16; 26 | template struct UTF16BE; 27 | template struct UTF16LE; 28 | template struct UTF32; 29 | template struct UTF32BE; 30 | template struct UTF32LE; 31 | template struct ASCII; 32 | template struct AutoUTF; 33 | 34 | template 35 | struct Transcoder; 36 | 37 | // allocators.h 38 | 39 | class CrtAllocator; 40 | 41 | template 42 | class MemoryPoolAllocator; 43 | 44 | // stream.h 45 | 46 | template 47 | struct GenericStringStream; 48 | 49 | typedef GenericStringStream > StringStream; 50 | 51 | template 52 | struct GenericInsituStringStream; 53 | 54 | typedef GenericInsituStringStream > InsituStringStream; 55 | 56 | // stringbuffer.h 57 | 58 | template 59 | class GenericStringBuffer; 60 | 61 | typedef GenericStringBuffer, CrtAllocator> StringBuffer; 62 | 63 | // filereadstream.h 64 | 65 | class FileReadStream; 66 | 67 | // filewritestream.h 68 | 69 | class FileWriteStream; 70 | 71 | // memorybuffer.h 72 | 73 | template 74 | struct GenericMemoryBuffer; 75 | 76 | typedef GenericMemoryBuffer MemoryBuffer; 77 | 78 | // memorystream.h 79 | 80 | struct MemoryStream; 81 | 82 | // reader.h 83 | 84 | template 85 | struct BaseReaderHandler; 86 | 87 | template 88 | class GenericReader; 89 | 90 | typedef GenericReader, UTF8, CrtAllocator> Reader; 91 | 92 | // writer.h 93 | 94 | template 95 | class Writer; 96 | 97 | // prettywriter.h 98 | 99 | template 100 | class PrettyWriter; 101 | 102 | // document.h 103 | 104 | template 105 | class GenericMember; 106 | 107 | template 108 | class GenericMemberIterator; 109 | 110 | template 111 | struct GenericStringRef; 112 | 113 | template 114 | class GenericValue; 115 | 116 | typedef GenericValue, MemoryPoolAllocator > Value; 117 | 118 | template 119 | class GenericDocument; 120 | 121 | typedef GenericDocument, MemoryPoolAllocator, CrtAllocator> Document; 122 | 123 | // pointer.h 124 | 125 | template 126 | class GenericPointer; 127 | 128 | typedef GenericPointer Pointer; 129 | 130 | // schema.h 131 | 132 | template 133 | class IGenericRemoteSchemaDocumentProvider; 134 | 135 | template 136 | class GenericSchemaDocument; 137 | 138 | typedef GenericSchemaDocument SchemaDocument; 139 | typedef IGenericRemoteSchemaDocumentProvider IRemoteSchemaDocumentProvider; 140 | 141 | template < 142 | typename SchemaDocumentType, 143 | typename OutputHandler, 144 | typename StateAllocator> 145 | class GenericSchemaValidator; 146 | 147 | typedef GenericSchemaValidator, void>, CrtAllocator> SchemaValidator; 148 | 149 | RAPIDJSON_NAMESPACE_END 150 | 151 | #endif // RAPIDJSON_RAPIDJSONFWD_H_ 152 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/internal/biginteger.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_BIGINTEGER_H_ 16 | #define RAPIDJSON_BIGINTEGER_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && defined(_M_AMD64) 21 | #include // for _umul128 22 | #if !defined(_ARM64EC_) 23 | #pragma intrinsic(_umul128) 24 | #else 25 | #pragma comment(lib,"softintrin") 26 | #endif 27 | #endif 28 | 29 | RAPIDJSON_NAMESPACE_BEGIN 30 | namespace internal { 31 | 32 | class BigInteger { 33 | public: 34 | typedef uint64_t Type; 35 | 36 | BigInteger(const BigInteger& rhs) : count_(rhs.count_) { 37 | std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); 38 | } 39 | 40 | explicit BigInteger(uint64_t u) : count_(1) { 41 | digits_[0] = u; 42 | } 43 | 44 | template 45 | BigInteger(const Ch* decimals, size_t length) : count_(1) { 46 | RAPIDJSON_ASSERT(length > 0); 47 | digits_[0] = 0; 48 | size_t i = 0; 49 | const size_t kMaxDigitPerIteration = 19; // 2^64 = 18446744073709551616 > 10^19 50 | while (length >= kMaxDigitPerIteration) { 51 | AppendDecimal64(decimals + i, decimals + i + kMaxDigitPerIteration); 52 | length -= kMaxDigitPerIteration; 53 | i += kMaxDigitPerIteration; 54 | } 55 | 56 | if (length > 0) 57 | AppendDecimal64(decimals + i, decimals + i + length); 58 | } 59 | 60 | BigInteger& operator=(const BigInteger &rhs) 61 | { 62 | if (this != &rhs) { 63 | count_ = rhs.count_; 64 | std::memcpy(digits_, rhs.digits_, count_ * sizeof(Type)); 65 | } 66 | return *this; 67 | } 68 | 69 | BigInteger& operator=(uint64_t u) { 70 | digits_[0] = u; 71 | count_ = 1; 72 | return *this; 73 | } 74 | 75 | BigInteger& operator+=(uint64_t u) { 76 | Type backup = digits_[0]; 77 | digits_[0] += u; 78 | for (size_t i = 0; i < count_ - 1; i++) { 79 | if (digits_[i] >= backup) 80 | return *this; // no carry 81 | backup = digits_[i + 1]; 82 | digits_[i + 1] += 1; 83 | } 84 | 85 | // Last carry 86 | if (digits_[count_ - 1] < backup) 87 | PushBack(1); 88 | 89 | return *this; 90 | } 91 | 92 | BigInteger& operator*=(uint64_t u) { 93 | if (u == 0) return *this = 0; 94 | if (u == 1) return *this; 95 | if (*this == 1) return *this = u; 96 | 97 | uint64_t k = 0; 98 | for (size_t i = 0; i < count_; i++) { 99 | uint64_t hi; 100 | digits_[i] = MulAdd64(digits_[i], u, k, &hi); 101 | k = hi; 102 | } 103 | 104 | if (k > 0) 105 | PushBack(k); 106 | 107 | return *this; 108 | } 109 | 110 | BigInteger& operator*=(uint32_t u) { 111 | if (u == 0) return *this = 0; 112 | if (u == 1) return *this; 113 | if (*this == 1) return *this = u; 114 | 115 | uint64_t k = 0; 116 | for (size_t i = 0; i < count_; i++) { 117 | const uint64_t c = digits_[i] >> 32; 118 | const uint64_t d = digits_[i] & 0xFFFFFFFF; 119 | const uint64_t uc = u * c; 120 | const uint64_t ud = u * d; 121 | const uint64_t p0 = ud + k; 122 | const uint64_t p1 = uc + (p0 >> 32); 123 | digits_[i] = (p0 & 0xFFFFFFFF) | (p1 << 32); 124 | k = p1 >> 32; 125 | } 126 | 127 | if (k > 0) 128 | PushBack(k); 129 | 130 | return *this; 131 | } 132 | 133 | BigInteger& operator<<=(size_t shift) { 134 | if (IsZero() || shift == 0) return *this; 135 | 136 | size_t offset = shift / kTypeBit; 137 | size_t interShift = shift % kTypeBit; 138 | RAPIDJSON_ASSERT(count_ + offset <= kCapacity); 139 | 140 | if (interShift == 0) { 141 | std::memmove(digits_ + offset, digits_, count_ * sizeof(Type)); 142 | count_ += offset; 143 | } 144 | else { 145 | digits_[count_] = 0; 146 | for (size_t i = count_; i > 0; i--) 147 | digits_[i + offset] = (digits_[i] << interShift) | (digits_[i - 1] >> (kTypeBit - interShift)); 148 | digits_[offset] = digits_[0] << interShift; 149 | count_ += offset; 150 | if (digits_[count_]) 151 | count_++; 152 | } 153 | 154 | std::memset(digits_, 0, offset * sizeof(Type)); 155 | 156 | return *this; 157 | } 158 | 159 | bool operator==(const BigInteger& rhs) const { 160 | return count_ == rhs.count_ && std::memcmp(digits_, rhs.digits_, count_ * sizeof(Type)) == 0; 161 | } 162 | 163 | bool operator==(const Type rhs) const { 164 | return count_ == 1 && digits_[0] == rhs; 165 | } 166 | 167 | BigInteger& MultiplyPow5(unsigned exp) { 168 | static const uint32_t kPow5[12] = { 169 | 5, 170 | 5 * 5, 171 | 5 * 5 * 5, 172 | 5 * 5 * 5 * 5, 173 | 5 * 5 * 5 * 5 * 5, 174 | 5 * 5 * 5 * 5 * 5 * 5, 175 | 5 * 5 * 5 * 5 * 5 * 5 * 5, 176 | 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, 177 | 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, 178 | 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, 179 | 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5, 180 | 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 * 5 181 | }; 182 | if (exp == 0) return *this; 183 | for (; exp >= 27; exp -= 27) *this *= RAPIDJSON_UINT64_C2(0X6765C793, 0XFA10079D); // 5^27 184 | for (; exp >= 13; exp -= 13) *this *= static_cast(1220703125u); // 5^13 185 | if (exp > 0) *this *= kPow5[exp - 1]; 186 | return *this; 187 | } 188 | 189 | // Compute absolute difference of this and rhs. 190 | // Assume this != rhs 191 | bool Difference(const BigInteger& rhs, BigInteger* out) const { 192 | int cmp = Compare(rhs); 193 | RAPIDJSON_ASSERT(cmp != 0); 194 | const BigInteger *a, *b; // Makes a > b 195 | bool ret; 196 | if (cmp < 0) { a = &rhs; b = this; ret = true; } 197 | else { a = this; b = &rhs; ret = false; } 198 | 199 | Type borrow = 0; 200 | for (size_t i = 0; i < a->count_; i++) { 201 | Type d = a->digits_[i] - borrow; 202 | if (i < b->count_) 203 | d -= b->digits_[i]; 204 | borrow = (d > a->digits_[i]) ? 1 : 0; 205 | out->digits_[i] = d; 206 | if (d != 0) 207 | out->count_ = i + 1; 208 | } 209 | 210 | return ret; 211 | } 212 | 213 | int Compare(const BigInteger& rhs) const { 214 | if (count_ != rhs.count_) 215 | return count_ < rhs.count_ ? -1 : 1; 216 | 217 | for (size_t i = count_; i-- > 0;) 218 | if (digits_[i] != rhs.digits_[i]) 219 | return digits_[i] < rhs.digits_[i] ? -1 : 1; 220 | 221 | return 0; 222 | } 223 | 224 | size_t GetCount() const { return count_; } 225 | Type GetDigit(size_t index) const { RAPIDJSON_ASSERT(index < count_); return digits_[index]; } 226 | bool IsZero() const { return count_ == 1 && digits_[0] == 0; } 227 | 228 | private: 229 | template 230 | void AppendDecimal64(const Ch* begin, const Ch* end) { 231 | uint64_t u = ParseUint64(begin, end); 232 | if (IsZero()) 233 | *this = u; 234 | else { 235 | unsigned exp = static_cast(end - begin); 236 | (MultiplyPow5(exp) <<= exp) += u; // *this = *this * 10^exp + u 237 | } 238 | } 239 | 240 | void PushBack(Type digit) { 241 | RAPIDJSON_ASSERT(count_ < kCapacity); 242 | digits_[count_++] = digit; 243 | } 244 | 245 | template 246 | static uint64_t ParseUint64(const Ch* begin, const Ch* end) { 247 | uint64_t r = 0; 248 | for (const Ch* p = begin; p != end; ++p) { 249 | RAPIDJSON_ASSERT(*p >= Ch('0') && *p <= Ch('9')); 250 | r = r * 10u + static_cast(*p - Ch('0')); 251 | } 252 | return r; 253 | } 254 | 255 | // Assume a * b + k < 2^128 256 | static uint64_t MulAdd64(uint64_t a, uint64_t b, uint64_t k, uint64_t* outHigh) { 257 | #if defined(_MSC_VER) && defined(_M_AMD64) 258 | uint64_t low = _umul128(a, b, outHigh) + k; 259 | if (low < k) 260 | (*outHigh)++; 261 | return low; 262 | #elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)) && defined(__x86_64__) 263 | __extension__ typedef unsigned __int128 uint128; 264 | uint128 p = static_cast(a) * static_cast(b); 265 | p += k; 266 | *outHigh = static_cast(p >> 64); 267 | return static_cast(p); 268 | #else 269 | const uint64_t a0 = a & 0xFFFFFFFF, a1 = a >> 32, b0 = b & 0xFFFFFFFF, b1 = b >> 32; 270 | uint64_t x0 = a0 * b0, x1 = a0 * b1, x2 = a1 * b0, x3 = a1 * b1; 271 | x1 += (x0 >> 32); // can't give carry 272 | x1 += x2; 273 | if (x1 < x2) 274 | x3 += (static_cast(1) << 32); 275 | uint64_t lo = (x1 << 32) + (x0 & 0xFFFFFFFF); 276 | uint64_t hi = x3 + (x1 >> 32); 277 | 278 | lo += k; 279 | if (lo < k) 280 | hi++; 281 | *outHigh = hi; 282 | return lo; 283 | #endif 284 | } 285 | 286 | static const size_t kBitCount = 3328; // 64bit * 54 > 10^1000 287 | static const size_t kCapacity = kBitCount / sizeof(Type); 288 | static const size_t kTypeBit = sizeof(Type) * 8; 289 | 290 | Type digits_[kCapacity]; 291 | size_t count_; 292 | }; 293 | 294 | } // namespace internal 295 | RAPIDJSON_NAMESPACE_END 296 | 297 | #endif // RAPIDJSON_BIGINTEGER_H_ 298 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/internal/clzll.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_CLZLL_H_ 16 | #define RAPIDJSON_CLZLL_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(_MSC_VER) && !defined(UNDER_CE) 21 | #include 22 | #if defined(_WIN64) 23 | #pragma intrinsic(_BitScanReverse64) 24 | #else 25 | #pragma intrinsic(_BitScanReverse) 26 | #endif 27 | #endif 28 | 29 | RAPIDJSON_NAMESPACE_BEGIN 30 | namespace internal { 31 | 32 | inline uint32_t clzll(uint64_t x) { 33 | // Passing 0 to __builtin_clzll is UB in GCC and results in an 34 | // infinite loop in the software implementation. 35 | RAPIDJSON_ASSERT(x != 0); 36 | 37 | #if defined(_MSC_VER) && !defined(UNDER_CE) 38 | unsigned long r = 0; 39 | #if defined(_WIN64) 40 | _BitScanReverse64(&r, x); 41 | #else 42 | // Scan the high 32 bits. 43 | if (_BitScanReverse(&r, static_cast(x >> 32))) 44 | return 63 - (r + 32); 45 | 46 | // Scan the low 32 bits. 47 | _BitScanReverse(&r, static_cast(x & 0xFFFFFFFF)); 48 | #endif // _WIN64 49 | 50 | return 63 - r; 51 | #elif (defined(__GNUC__) && __GNUC__ >= 4) || RAPIDJSON_HAS_BUILTIN(__builtin_clzll) 52 | // __builtin_clzll wrapper 53 | return static_cast(__builtin_clzll(x)); 54 | #else 55 | // naive version 56 | uint32_t r = 0; 57 | while (!(x & (static_cast(1) << 63))) { 58 | x <<= 1; 59 | ++r; 60 | } 61 | 62 | return r; 63 | #endif // _MSC_VER 64 | } 65 | 66 | #define RAPIDJSON_CLZLL RAPIDJSON_NAMESPACE::internal::clzll 67 | 68 | } // namespace internal 69 | RAPIDJSON_NAMESPACE_END 70 | 71 | #endif // RAPIDJSON_CLZLL_H_ 72 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/internal/dtoa.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | // This is a C++ header-only implementation of Grisu2 algorithm from the publication: 16 | // Loitsch, Florian. "Printing floating-point numbers quickly and accurately with 17 | // integers." ACM Sigplan Notices 45.6 (2010): 233-243. 18 | 19 | #ifndef RAPIDJSON_DTOA_ 20 | #define RAPIDJSON_DTOA_ 21 | 22 | #include "itoa.h" // GetDigitsLut() 23 | #include "diyfp.h" 24 | #include "ieee754.h" 25 | 26 | RAPIDJSON_NAMESPACE_BEGIN 27 | namespace internal { 28 | 29 | #ifdef __GNUC__ 30 | RAPIDJSON_DIAG_PUSH 31 | RAPIDJSON_DIAG_OFF(effc++) 32 | RAPIDJSON_DIAG_OFF(array-bounds) // some gcc versions generate wrong warnings https://gcc.gnu.org/bugzilla/show_bug.cgi?id=59124 33 | #endif 34 | 35 | inline void GrisuRound(char* buffer, int len, uint64_t delta, uint64_t rest, uint64_t ten_kappa, uint64_t wp_w) { 36 | while (rest < wp_w && delta - rest >= ten_kappa && 37 | (rest + ten_kappa < wp_w || /// closer 38 | wp_w - rest > rest + ten_kappa - wp_w)) { 39 | buffer[len - 1]--; 40 | rest += ten_kappa; 41 | } 42 | } 43 | 44 | inline int CountDecimalDigit32(uint32_t n) { 45 | // Simple pure C++ implementation was faster than __builtin_clz version in this situation. 46 | if (n < 10) return 1; 47 | if (n < 100) return 2; 48 | if (n < 1000) return 3; 49 | if (n < 10000) return 4; 50 | if (n < 100000) return 5; 51 | if (n < 1000000) return 6; 52 | if (n < 10000000) return 7; 53 | if (n < 100000000) return 8; 54 | // Will not reach 10 digits in DigitGen() 55 | //if (n < 1000000000) return 9; 56 | //return 10; 57 | return 9; 58 | } 59 | 60 | inline void DigitGen(const DiyFp& W, const DiyFp& Mp, uint64_t delta, char* buffer, int* len, int* K) { 61 | static const uint64_t kPow10[] = { 1ULL, 10ULL, 100ULL, 1000ULL, 10000ULL, 100000ULL, 1000000ULL, 10000000ULL, 100000000ULL, 62 | 1000000000ULL, 10000000000ULL, 100000000000ULL, 1000000000000ULL, 63 | 10000000000000ULL, 100000000000000ULL, 1000000000000000ULL, 64 | 10000000000000000ULL, 100000000000000000ULL, 1000000000000000000ULL, 65 | 10000000000000000000ULL }; 66 | const DiyFp one(uint64_t(1) << -Mp.e, Mp.e); 67 | const DiyFp wp_w = Mp - W; 68 | uint32_t p1 = static_cast(Mp.f >> -one.e); 69 | uint64_t p2 = Mp.f & (one.f - 1); 70 | int kappa = CountDecimalDigit32(p1); // kappa in [0, 9] 71 | *len = 0; 72 | 73 | while (kappa > 0) { 74 | uint32_t d = 0; 75 | switch (kappa) { 76 | case 9: d = p1 / 100000000; p1 %= 100000000; break; 77 | case 8: d = p1 / 10000000; p1 %= 10000000; break; 78 | case 7: d = p1 / 1000000; p1 %= 1000000; break; 79 | case 6: d = p1 / 100000; p1 %= 100000; break; 80 | case 5: d = p1 / 10000; p1 %= 10000; break; 81 | case 4: d = p1 / 1000; p1 %= 1000; break; 82 | case 3: d = p1 / 100; p1 %= 100; break; 83 | case 2: d = p1 / 10; p1 %= 10; break; 84 | case 1: d = p1; p1 = 0; break; 85 | default:; 86 | } 87 | if (d || *len) 88 | buffer[(*len)++] = static_cast('0' + static_cast(d)); 89 | kappa--; 90 | uint64_t tmp = (static_cast(p1) << -one.e) + p2; 91 | if (tmp <= delta) { 92 | *K += kappa; 93 | GrisuRound(buffer, *len, delta, tmp, kPow10[kappa] << -one.e, wp_w.f); 94 | return; 95 | } 96 | } 97 | 98 | // kappa = 0 99 | for (;;) { 100 | p2 *= 10; 101 | delta *= 10; 102 | char d = static_cast(p2 >> -one.e); 103 | if (d || *len) 104 | buffer[(*len)++] = static_cast('0' + d); 105 | p2 &= one.f - 1; 106 | kappa--; 107 | if (p2 < delta) { 108 | *K += kappa; 109 | int index = -kappa; 110 | GrisuRound(buffer, *len, delta, p2, one.f, wp_w.f * (index < 20 ? kPow10[index] : 0)); 111 | return; 112 | } 113 | } 114 | } 115 | 116 | inline void Grisu2(double value, char* buffer, int* length, int* K) { 117 | const DiyFp v(value); 118 | DiyFp w_m, w_p; 119 | v.NormalizedBoundaries(&w_m, &w_p); 120 | 121 | const DiyFp c_mk = GetCachedPower(w_p.e, K); 122 | const DiyFp W = v.Normalize() * c_mk; 123 | DiyFp Wp = w_p * c_mk; 124 | DiyFp Wm = w_m * c_mk; 125 | Wm.f++; 126 | Wp.f--; 127 | DigitGen(W, Wp, Wp.f - Wm.f, buffer, length, K); 128 | } 129 | 130 | inline char* WriteExponent(int K, char* buffer) { 131 | if (K < 0) { 132 | *buffer++ = '-'; 133 | K = -K; 134 | } 135 | 136 | if (K >= 100) { 137 | *buffer++ = static_cast('0' + static_cast(K / 100)); 138 | K %= 100; 139 | const char* d = GetDigitsLut() + K * 2; 140 | *buffer++ = d[0]; 141 | *buffer++ = d[1]; 142 | } 143 | else if (K >= 10) { 144 | const char* d = GetDigitsLut() + K * 2; 145 | *buffer++ = d[0]; 146 | *buffer++ = d[1]; 147 | } 148 | else 149 | *buffer++ = static_cast('0' + static_cast(K)); 150 | 151 | return buffer; 152 | } 153 | 154 | inline char* Prettify(char* buffer, int length, int k, int maxDecimalPlaces) { 155 | const int kk = length + k; // 10^(kk-1) <= v < 10^kk 156 | 157 | if (0 <= k && kk <= 21) { 158 | // 1234e7 -> 12340000000 159 | for (int i = length; i < kk; i++) 160 | buffer[i] = '0'; 161 | buffer[kk] = '.'; 162 | buffer[kk + 1] = '0'; 163 | return &buffer[kk + 2]; 164 | } 165 | else if (0 < kk && kk <= 21) { 166 | // 1234e-2 -> 12.34 167 | std::memmove(&buffer[kk + 1], &buffer[kk], static_cast(length - kk)); 168 | buffer[kk] = '.'; 169 | if (0 > k + maxDecimalPlaces) { 170 | // When maxDecimalPlaces = 2, 1.2345 -> 1.23, 1.102 -> 1.1 171 | // Remove extra trailing zeros (at least one) after truncation. 172 | for (int i = kk + maxDecimalPlaces; i > kk + 1; i--) 173 | if (buffer[i] != '0') 174 | return &buffer[i + 1]; 175 | return &buffer[kk + 2]; // Reserve one zero 176 | } 177 | else 178 | return &buffer[length + 1]; 179 | } 180 | else if (-6 < kk && kk <= 0) { 181 | // 1234e-6 -> 0.001234 182 | const int offset = 2 - kk; 183 | std::memmove(&buffer[offset], &buffer[0], static_cast(length)); 184 | buffer[0] = '0'; 185 | buffer[1] = '.'; 186 | for (int i = 2; i < offset; i++) 187 | buffer[i] = '0'; 188 | if (length - kk > maxDecimalPlaces) { 189 | // When maxDecimalPlaces = 2, 0.123 -> 0.12, 0.102 -> 0.1 190 | // Remove extra trailing zeros (at least one) after truncation. 191 | for (int i = maxDecimalPlaces + 1; i > 2; i--) 192 | if (buffer[i] != '0') 193 | return &buffer[i + 1]; 194 | return &buffer[3]; // Reserve one zero 195 | } 196 | else 197 | return &buffer[length + offset]; 198 | } 199 | else if (kk < -maxDecimalPlaces) { 200 | // Truncate to zero 201 | buffer[0] = '0'; 202 | buffer[1] = '.'; 203 | buffer[2] = '0'; 204 | return &buffer[3]; 205 | } 206 | else if (length == 1) { 207 | // 1e30 208 | buffer[1] = 'e'; 209 | return WriteExponent(kk - 1, &buffer[2]); 210 | } 211 | else { 212 | // 1234e30 -> 1.234e33 213 | std::memmove(&buffer[2], &buffer[1], static_cast(length - 1)); 214 | buffer[1] = '.'; 215 | buffer[length + 1] = 'e'; 216 | return WriteExponent(kk - 1, &buffer[0 + length + 2]); 217 | } 218 | } 219 | 220 | inline char* dtoa(double value, char* buffer, int maxDecimalPlaces = 324) { 221 | RAPIDJSON_ASSERT(maxDecimalPlaces >= 1); 222 | Double d(value); 223 | if (d.IsZero()) { 224 | if (d.Sign()) 225 | *buffer++ = '-'; // -0.0, Issue #289 226 | buffer[0] = '0'; 227 | buffer[1] = '.'; 228 | buffer[2] = '0'; 229 | return &buffer[3]; 230 | } 231 | else { 232 | if (value < 0) { 233 | *buffer++ = '-'; 234 | value = -value; 235 | } 236 | int length, K; 237 | Grisu2(value, buffer, &length, &K); 238 | return Prettify(buffer, length, K, maxDecimalPlaces); 239 | } 240 | } 241 | 242 | #ifdef __GNUC__ 243 | RAPIDJSON_DIAG_POP 244 | #endif 245 | 246 | } // namespace internal 247 | RAPIDJSON_NAMESPACE_END 248 | 249 | #endif // RAPIDJSON_DTOA_ 250 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/internal/ieee754.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_IEEE754_ 16 | #define RAPIDJSON_IEEE754_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | RAPIDJSON_NAMESPACE_BEGIN 21 | namespace internal { 22 | 23 | class Double { 24 | public: 25 | Double() {} 26 | Double(double d) : d_(d) {} 27 | Double(uint64_t u) : u_(u) {} 28 | 29 | double Value() const { return d_; } 30 | uint64_t Uint64Value() const { return u_; } 31 | 32 | double NextPositiveDouble() const { 33 | RAPIDJSON_ASSERT(!Sign()); 34 | return Double(u_ + 1).Value(); 35 | } 36 | 37 | bool Sign() const { return (u_ & kSignMask) != 0; } 38 | uint64_t Significand() const { return u_ & kSignificandMask; } 39 | int Exponent() const { return static_cast(((u_ & kExponentMask) >> kSignificandSize) - kExponentBias); } 40 | 41 | bool IsNan() const { return (u_ & kExponentMask) == kExponentMask && Significand() != 0; } 42 | bool IsInf() const { return (u_ & kExponentMask) == kExponentMask && Significand() == 0; } 43 | bool IsNanOrInf() const { return (u_ & kExponentMask) == kExponentMask; } 44 | bool IsNormal() const { return (u_ & kExponentMask) != 0 || Significand() == 0; } 45 | bool IsZero() const { return (u_ & (kExponentMask | kSignificandMask)) == 0; } 46 | 47 | uint64_t IntegerSignificand() const { return IsNormal() ? Significand() | kHiddenBit : Significand(); } 48 | int IntegerExponent() const { return (IsNormal() ? Exponent() : kDenormalExponent) - kSignificandSize; } 49 | uint64_t ToBias() const { return (u_ & kSignMask) ? ~u_ + 1 : u_ | kSignMask; } 50 | 51 | static int EffectiveSignificandSize(int order) { 52 | if (order >= -1021) 53 | return 53; 54 | else if (order <= -1074) 55 | return 0; 56 | else 57 | return order + 1074; 58 | } 59 | 60 | private: 61 | static const int kSignificandSize = 52; 62 | static const int kExponentBias = 0x3FF; 63 | static const int kDenormalExponent = 1 - kExponentBias; 64 | static const uint64_t kSignMask = RAPIDJSON_UINT64_C2(0x80000000, 0x00000000); 65 | static const uint64_t kExponentMask = RAPIDJSON_UINT64_C2(0x7FF00000, 0x00000000); 66 | static const uint64_t kSignificandMask = RAPIDJSON_UINT64_C2(0x000FFFFF, 0xFFFFFFFF); 67 | static const uint64_t kHiddenBit = RAPIDJSON_UINT64_C2(0x00100000, 0x00000000); 68 | 69 | union { 70 | double d_; 71 | uint64_t u_; 72 | }; 73 | }; 74 | 75 | } // namespace internal 76 | RAPIDJSON_NAMESPACE_END 77 | 78 | #endif // RAPIDJSON_IEEE754_ 79 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/internal/meta.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_META_H_ 16 | #define RAPIDJSON_INTERNAL_META_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #ifdef __GNUC__ 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(effc++) 23 | #endif 24 | 25 | #if defined(_MSC_VER) && !defined(__clang__) 26 | RAPIDJSON_DIAG_PUSH 27 | RAPIDJSON_DIAG_OFF(6334) 28 | #endif 29 | 30 | #if RAPIDJSON_HAS_CXX11_TYPETRAITS 31 | #include 32 | #endif 33 | 34 | //@cond RAPIDJSON_INTERNAL 35 | RAPIDJSON_NAMESPACE_BEGIN 36 | namespace internal { 37 | 38 | // Helper to wrap/convert arbitrary types to void, useful for arbitrary type matching 39 | template struct Void { typedef void Type; }; 40 | 41 | /////////////////////////////////////////////////////////////////////////////// 42 | // BoolType, TrueType, FalseType 43 | // 44 | template struct BoolType { 45 | static const bool Value = Cond; 46 | typedef BoolType Type; 47 | }; 48 | typedef BoolType TrueType; 49 | typedef BoolType FalseType; 50 | 51 | 52 | /////////////////////////////////////////////////////////////////////////////// 53 | // SelectIf, BoolExpr, NotExpr, AndExpr, OrExpr 54 | // 55 | 56 | template struct SelectIfImpl { template struct Apply { typedef T1 Type; }; }; 57 | template <> struct SelectIfImpl { template struct Apply { typedef T2 Type; }; }; 58 | template struct SelectIfCond : SelectIfImpl::template Apply {}; 59 | template struct SelectIf : SelectIfCond {}; 60 | 61 | template struct AndExprCond : FalseType {}; 62 | template <> struct AndExprCond : TrueType {}; 63 | template struct OrExprCond : TrueType {}; 64 | template <> struct OrExprCond : FalseType {}; 65 | 66 | template struct BoolExpr : SelectIf::Type {}; 67 | template struct NotExpr : SelectIf::Type {}; 68 | template struct AndExpr : AndExprCond::Type {}; 69 | template struct OrExpr : OrExprCond::Type {}; 70 | 71 | 72 | /////////////////////////////////////////////////////////////////////////////// 73 | // AddConst, MaybeAddConst, RemoveConst 74 | template struct AddConst { typedef const T Type; }; 75 | template struct MaybeAddConst : SelectIfCond {}; 76 | template struct RemoveConst { typedef T Type; }; 77 | template struct RemoveConst { typedef T Type; }; 78 | 79 | 80 | /////////////////////////////////////////////////////////////////////////////// 81 | // IsSame, IsConst, IsMoreConst, IsPointer 82 | // 83 | template struct IsSame : FalseType {}; 84 | template struct IsSame : TrueType {}; 85 | 86 | template struct IsConst : FalseType {}; 87 | template struct IsConst : TrueType {}; 88 | 89 | template 90 | struct IsMoreConst 91 | : AndExpr::Type, typename RemoveConst::Type>, 92 | BoolType::Value >= IsConst::Value> >::Type {}; 93 | 94 | template struct IsPointer : FalseType {}; 95 | template struct IsPointer : TrueType {}; 96 | 97 | /////////////////////////////////////////////////////////////////////////////// 98 | // IsBaseOf 99 | // 100 | #if RAPIDJSON_HAS_CXX11_TYPETRAITS 101 | 102 | template struct IsBaseOf 103 | : BoolType< ::std::is_base_of::value> {}; 104 | 105 | #else // simplified version adopted from Boost 106 | 107 | template struct IsBaseOfImpl { 108 | RAPIDJSON_STATIC_ASSERT(sizeof(B) != 0); 109 | RAPIDJSON_STATIC_ASSERT(sizeof(D) != 0); 110 | 111 | typedef char (&Yes)[1]; 112 | typedef char (&No) [2]; 113 | 114 | template 115 | static Yes Check(const D*, T); 116 | static No Check(const B*, int); 117 | 118 | struct Host { 119 | operator const B*() const; 120 | operator const D*(); 121 | }; 122 | 123 | enum { Value = (sizeof(Check(Host(), 0)) == sizeof(Yes)) }; 124 | }; 125 | 126 | template struct IsBaseOf 127 | : OrExpr, BoolExpr > >::Type {}; 128 | 129 | #endif // RAPIDJSON_HAS_CXX11_TYPETRAITS 130 | 131 | 132 | ////////////////////////////////////////////////////////////////////////// 133 | // EnableIf / DisableIf 134 | // 135 | template struct EnableIfCond { typedef T Type; }; 136 | template struct EnableIfCond { /* empty */ }; 137 | 138 | template struct DisableIfCond { typedef T Type; }; 139 | template struct DisableIfCond { /* empty */ }; 140 | 141 | template 142 | struct EnableIf : EnableIfCond {}; 143 | 144 | template 145 | struct DisableIf : DisableIfCond {}; 146 | 147 | // SFINAE helpers 148 | struct SfinaeTag {}; 149 | template struct RemoveSfinaeTag; 150 | template struct RemoveSfinaeTag { typedef T Type; }; 151 | 152 | #define RAPIDJSON_REMOVEFPTR_(type) \ 153 | typename ::RAPIDJSON_NAMESPACE::internal::RemoveSfinaeTag \ 154 | < ::RAPIDJSON_NAMESPACE::internal::SfinaeTag&(*) type>::Type 155 | 156 | #define RAPIDJSON_ENABLEIF(cond) \ 157 | typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \ 158 | ::Type * = NULL 159 | 160 | #define RAPIDJSON_DISABLEIF(cond) \ 161 | typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \ 162 | ::Type * = NULL 163 | 164 | #define RAPIDJSON_ENABLEIF_RETURN(cond,returntype) \ 165 | typename ::RAPIDJSON_NAMESPACE::internal::EnableIf \ 166 | ::Type 168 | 169 | #define RAPIDJSON_DISABLEIF_RETURN(cond,returntype) \ 170 | typename ::RAPIDJSON_NAMESPACE::internal::DisableIf \ 171 | ::Type 173 | 174 | } // namespace internal 175 | RAPIDJSON_NAMESPACE_END 176 | //@endcond 177 | 178 | #if defined(_MSC_VER) && !defined(__clang__) 179 | RAPIDJSON_DIAG_POP 180 | #endif 181 | 182 | #ifdef __GNUC__ 183 | RAPIDJSON_DIAG_POP 184 | #endif 185 | 186 | #endif // RAPIDJSON_INTERNAL_META_H_ 187 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/internal/pow10.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_POW10_ 16 | #define RAPIDJSON_POW10_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | RAPIDJSON_NAMESPACE_BEGIN 21 | namespace internal { 22 | 23 | //! Computes integer powers of 10 in double (10.0^n). 24 | /*! This function uses lookup table for fast and accurate results. 25 | \param n non-negative exponent. Must <= 308. 26 | \return 10.0^n 27 | */ 28 | inline double Pow10(int n) { 29 | static const double e[] = { // 1e-0...1e308: 309 * 8 bytes = 2472 bytes 30 | 1e+0, 31 | 1e+1, 1e+2, 1e+3, 1e+4, 1e+5, 1e+6, 1e+7, 1e+8, 1e+9, 1e+10, 1e+11, 1e+12, 1e+13, 1e+14, 1e+15, 1e+16, 1e+17, 1e+18, 1e+19, 1e+20, 32 | 1e+21, 1e+22, 1e+23, 1e+24, 1e+25, 1e+26, 1e+27, 1e+28, 1e+29, 1e+30, 1e+31, 1e+32, 1e+33, 1e+34, 1e+35, 1e+36, 1e+37, 1e+38, 1e+39, 1e+40, 33 | 1e+41, 1e+42, 1e+43, 1e+44, 1e+45, 1e+46, 1e+47, 1e+48, 1e+49, 1e+50, 1e+51, 1e+52, 1e+53, 1e+54, 1e+55, 1e+56, 1e+57, 1e+58, 1e+59, 1e+60, 34 | 1e+61, 1e+62, 1e+63, 1e+64, 1e+65, 1e+66, 1e+67, 1e+68, 1e+69, 1e+70, 1e+71, 1e+72, 1e+73, 1e+74, 1e+75, 1e+76, 1e+77, 1e+78, 1e+79, 1e+80, 35 | 1e+81, 1e+82, 1e+83, 1e+84, 1e+85, 1e+86, 1e+87, 1e+88, 1e+89, 1e+90, 1e+91, 1e+92, 1e+93, 1e+94, 1e+95, 1e+96, 1e+97, 1e+98, 1e+99, 1e+100, 36 | 1e+101,1e+102,1e+103,1e+104,1e+105,1e+106,1e+107,1e+108,1e+109,1e+110,1e+111,1e+112,1e+113,1e+114,1e+115,1e+116,1e+117,1e+118,1e+119,1e+120, 37 | 1e+121,1e+122,1e+123,1e+124,1e+125,1e+126,1e+127,1e+128,1e+129,1e+130,1e+131,1e+132,1e+133,1e+134,1e+135,1e+136,1e+137,1e+138,1e+139,1e+140, 38 | 1e+141,1e+142,1e+143,1e+144,1e+145,1e+146,1e+147,1e+148,1e+149,1e+150,1e+151,1e+152,1e+153,1e+154,1e+155,1e+156,1e+157,1e+158,1e+159,1e+160, 39 | 1e+161,1e+162,1e+163,1e+164,1e+165,1e+166,1e+167,1e+168,1e+169,1e+170,1e+171,1e+172,1e+173,1e+174,1e+175,1e+176,1e+177,1e+178,1e+179,1e+180, 40 | 1e+181,1e+182,1e+183,1e+184,1e+185,1e+186,1e+187,1e+188,1e+189,1e+190,1e+191,1e+192,1e+193,1e+194,1e+195,1e+196,1e+197,1e+198,1e+199,1e+200, 41 | 1e+201,1e+202,1e+203,1e+204,1e+205,1e+206,1e+207,1e+208,1e+209,1e+210,1e+211,1e+212,1e+213,1e+214,1e+215,1e+216,1e+217,1e+218,1e+219,1e+220, 42 | 1e+221,1e+222,1e+223,1e+224,1e+225,1e+226,1e+227,1e+228,1e+229,1e+230,1e+231,1e+232,1e+233,1e+234,1e+235,1e+236,1e+237,1e+238,1e+239,1e+240, 43 | 1e+241,1e+242,1e+243,1e+244,1e+245,1e+246,1e+247,1e+248,1e+249,1e+250,1e+251,1e+252,1e+253,1e+254,1e+255,1e+256,1e+257,1e+258,1e+259,1e+260, 44 | 1e+261,1e+262,1e+263,1e+264,1e+265,1e+266,1e+267,1e+268,1e+269,1e+270,1e+271,1e+272,1e+273,1e+274,1e+275,1e+276,1e+277,1e+278,1e+279,1e+280, 45 | 1e+281,1e+282,1e+283,1e+284,1e+285,1e+286,1e+287,1e+288,1e+289,1e+290,1e+291,1e+292,1e+293,1e+294,1e+295,1e+296,1e+297,1e+298,1e+299,1e+300, 46 | 1e+301,1e+302,1e+303,1e+304,1e+305,1e+306,1e+307,1e+308 47 | }; 48 | RAPIDJSON_ASSERT(n >= 0 && n <= 308); 49 | return e[n]; 50 | } 51 | 52 | } // namespace internal 53 | RAPIDJSON_NAMESPACE_END 54 | 55 | #endif // RAPIDJSON_POW10_ 56 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/internal/stack.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_STACK_H_ 16 | #define RAPIDJSON_INTERNAL_STACK_H_ 17 | 18 | #include "../allocators.h" 19 | #include "swap.h" 20 | #include 21 | 22 | #if defined(__clang__) 23 | RAPIDJSON_DIAG_PUSH 24 | RAPIDJSON_DIAG_OFF(c++98-compat) 25 | #endif 26 | 27 | RAPIDJSON_NAMESPACE_BEGIN 28 | namespace internal { 29 | 30 | /////////////////////////////////////////////////////////////////////////////// 31 | // Stack 32 | 33 | //! A type-unsafe stack for storing different types of data. 34 | /*! \tparam Allocator Allocator for allocating stack memory. 35 | */ 36 | template 37 | class Stack { 38 | public: 39 | // Optimization note: Do not allocate memory for stack_ in constructor. 40 | // Do it lazily when first Push() -> Expand() -> Resize(). 41 | Stack(Allocator* allocator, size_t stackCapacity) : allocator_(allocator), ownAllocator_(0), stack_(0), stackTop_(0), stackEnd_(0), initialCapacity_(stackCapacity) { 42 | } 43 | 44 | #if RAPIDJSON_HAS_CXX11_RVALUE_REFS 45 | Stack(Stack&& rhs) 46 | : allocator_(rhs.allocator_), 47 | ownAllocator_(rhs.ownAllocator_), 48 | stack_(rhs.stack_), 49 | stackTop_(rhs.stackTop_), 50 | stackEnd_(rhs.stackEnd_), 51 | initialCapacity_(rhs.initialCapacity_) 52 | { 53 | rhs.allocator_ = 0; 54 | rhs.ownAllocator_ = 0; 55 | rhs.stack_ = 0; 56 | rhs.stackTop_ = 0; 57 | rhs.stackEnd_ = 0; 58 | rhs.initialCapacity_ = 0; 59 | } 60 | #endif 61 | 62 | ~Stack() { 63 | Destroy(); 64 | } 65 | 66 | #if RAPIDJSON_HAS_CXX11_RVALUE_REFS 67 | Stack& operator=(Stack&& rhs) { 68 | if (&rhs != this) 69 | { 70 | Destroy(); 71 | 72 | allocator_ = rhs.allocator_; 73 | ownAllocator_ = rhs.ownAllocator_; 74 | stack_ = rhs.stack_; 75 | stackTop_ = rhs.stackTop_; 76 | stackEnd_ = rhs.stackEnd_; 77 | initialCapacity_ = rhs.initialCapacity_; 78 | 79 | rhs.allocator_ = 0; 80 | rhs.ownAllocator_ = 0; 81 | rhs.stack_ = 0; 82 | rhs.stackTop_ = 0; 83 | rhs.stackEnd_ = 0; 84 | rhs.initialCapacity_ = 0; 85 | } 86 | return *this; 87 | } 88 | #endif 89 | 90 | void Swap(Stack& rhs) RAPIDJSON_NOEXCEPT { 91 | internal::Swap(allocator_, rhs.allocator_); 92 | internal::Swap(ownAllocator_, rhs.ownAllocator_); 93 | internal::Swap(stack_, rhs.stack_); 94 | internal::Swap(stackTop_, rhs.stackTop_); 95 | internal::Swap(stackEnd_, rhs.stackEnd_); 96 | internal::Swap(initialCapacity_, rhs.initialCapacity_); 97 | } 98 | 99 | void Clear() { stackTop_ = stack_; } 100 | 101 | void ShrinkToFit() { 102 | if (Empty()) { 103 | // If the stack is empty, completely deallocate the memory. 104 | Allocator::Free(stack_); // NOLINT (+clang-analyzer-unix.Malloc) 105 | stack_ = 0; 106 | stackTop_ = 0; 107 | stackEnd_ = 0; 108 | } 109 | else 110 | Resize(GetSize()); 111 | } 112 | 113 | // Optimization note: try to minimize the size of this function for force inline. 114 | // Expansion is run very infrequently, so it is moved to another (probably non-inline) function. 115 | template 116 | RAPIDJSON_FORCEINLINE void Reserve(size_t count = 1) { 117 | // Expand the stack if needed 118 | if (RAPIDJSON_UNLIKELY(static_cast(sizeof(T) * count) > (stackEnd_ - stackTop_))) 119 | Expand(count); 120 | } 121 | 122 | template 123 | RAPIDJSON_FORCEINLINE T* Push(size_t count = 1) { 124 | Reserve(count); 125 | return PushUnsafe(count); 126 | } 127 | 128 | template 129 | RAPIDJSON_FORCEINLINE T* PushUnsafe(size_t count = 1) { 130 | RAPIDJSON_ASSERT(stackTop_); 131 | RAPIDJSON_ASSERT(static_cast(sizeof(T) * count) <= (stackEnd_ - stackTop_)); 132 | T* ret = reinterpret_cast(stackTop_); 133 | stackTop_ += sizeof(T) * count; 134 | return ret; 135 | } 136 | 137 | template 138 | T* Pop(size_t count) { 139 | RAPIDJSON_ASSERT(GetSize() >= count * sizeof(T)); 140 | stackTop_ -= count * sizeof(T); 141 | return reinterpret_cast(stackTop_); 142 | } 143 | 144 | template 145 | T* Top() { 146 | RAPIDJSON_ASSERT(GetSize() >= sizeof(T)); 147 | return reinterpret_cast(stackTop_ - sizeof(T)); 148 | } 149 | 150 | template 151 | const T* Top() const { 152 | RAPIDJSON_ASSERT(GetSize() >= sizeof(T)); 153 | return reinterpret_cast(stackTop_ - sizeof(T)); 154 | } 155 | 156 | template 157 | T* End() { return reinterpret_cast(stackTop_); } 158 | 159 | template 160 | const T* End() const { return reinterpret_cast(stackTop_); } 161 | 162 | template 163 | T* Bottom() { return reinterpret_cast(stack_); } 164 | 165 | template 166 | const T* Bottom() const { return reinterpret_cast(stack_); } 167 | 168 | bool HasAllocator() const { 169 | return allocator_ != 0; 170 | } 171 | 172 | Allocator& GetAllocator() { 173 | RAPIDJSON_ASSERT(allocator_); 174 | return *allocator_; 175 | } 176 | 177 | bool Empty() const { return stackTop_ == stack_; } 178 | size_t GetSize() const { return static_cast(stackTop_ - stack_); } 179 | size_t GetCapacity() const { return static_cast(stackEnd_ - stack_); } 180 | 181 | private: 182 | template 183 | void Expand(size_t count) { 184 | // Only expand the capacity if the current stack exists. Otherwise just create a stack with initial capacity. 185 | size_t newCapacity; 186 | if (stack_ == 0) { 187 | if (!allocator_) 188 | ownAllocator_ = allocator_ = RAPIDJSON_NEW(Allocator)(); 189 | newCapacity = initialCapacity_; 190 | } else { 191 | newCapacity = GetCapacity(); 192 | newCapacity += (newCapacity + 1) / 2; 193 | } 194 | size_t newSize = GetSize() + sizeof(T) * count; 195 | if (newCapacity < newSize) 196 | newCapacity = newSize; 197 | 198 | Resize(newCapacity); 199 | } 200 | 201 | void Resize(size_t newCapacity) { 202 | const size_t size = GetSize(); // Backup the current size 203 | stack_ = static_cast(allocator_->Realloc(stack_, GetCapacity(), newCapacity)); 204 | stackTop_ = stack_ + size; 205 | stackEnd_ = stack_ + newCapacity; 206 | } 207 | 208 | void Destroy() { 209 | Allocator::Free(stack_); 210 | RAPIDJSON_DELETE(ownAllocator_); // Only delete if it is owned by the stack 211 | } 212 | 213 | // Prohibit copy constructor & assignment operator. 214 | Stack(const Stack&); 215 | Stack& operator=(const Stack&); 216 | 217 | Allocator* allocator_; 218 | Allocator* ownAllocator_; 219 | char *stack_; 220 | char *stackTop_; 221 | char *stackEnd_; 222 | size_t initialCapacity_; 223 | }; 224 | 225 | } // namespace internal 226 | RAPIDJSON_NAMESPACE_END 227 | 228 | #if defined(__clang__) 229 | RAPIDJSON_DIAG_POP 230 | #endif 231 | 232 | #endif // RAPIDJSON_STACK_H_ 233 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/internal/strfunc.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_STRFUNC_H_ 16 | #define RAPIDJSON_INTERNAL_STRFUNC_H_ 17 | 18 | #include "../stream.h" 19 | #include 20 | 21 | RAPIDJSON_NAMESPACE_BEGIN 22 | namespace internal { 23 | 24 | //! Custom strlen() which works on different character types. 25 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 26 | \param s Null-terminated input string. 27 | \return Number of characters in the string. 28 | \note This has the same semantics as strlen(), the return value is not number of Unicode codepoints. 29 | */ 30 | template 31 | inline SizeType StrLen(const Ch* s) { 32 | RAPIDJSON_ASSERT(s != 0); 33 | const Ch* p = s; 34 | while (*p) ++p; 35 | return SizeType(p - s); 36 | } 37 | 38 | template <> 39 | inline SizeType StrLen(const char* s) { 40 | return SizeType(std::strlen(s)); 41 | } 42 | 43 | template <> 44 | inline SizeType StrLen(const wchar_t* s) { 45 | return SizeType(std::wcslen(s)); 46 | } 47 | 48 | //! Custom strcmpn() which works on different character types. 49 | /*! \tparam Ch Character type (e.g. char, wchar_t, short) 50 | \param s1 Null-terminated input string. 51 | \param s2 Null-terminated input string. 52 | \return 0 if equal 53 | */ 54 | template 55 | inline int StrCmp(const Ch* s1, const Ch* s2) { 56 | RAPIDJSON_ASSERT(s1 != 0); 57 | RAPIDJSON_ASSERT(s2 != 0); 58 | while(*s1 && (*s1 == *s2)) { s1++; s2++; } 59 | return static_cast(*s1) < static_cast(*s2) ? -1 : static_cast(*s1) > static_cast(*s2); 60 | } 61 | 62 | //! Returns number of code points in a encoded string. 63 | template 64 | bool CountStringCodePoint(const typename Encoding::Ch* s, SizeType length, SizeType* outCount) { 65 | RAPIDJSON_ASSERT(s != 0); 66 | RAPIDJSON_ASSERT(outCount != 0); 67 | GenericStringStream is(s); 68 | const typename Encoding::Ch* end = s + length; 69 | SizeType count = 0; 70 | while (is.src_ < end) { 71 | unsigned codepoint; 72 | if (!Encoding::Decode(is, &codepoint)) 73 | return false; 74 | count++; 75 | } 76 | *outCount = count; 77 | return true; 78 | } 79 | 80 | } // namespace internal 81 | RAPIDJSON_NAMESPACE_END 82 | 83 | #endif // RAPIDJSON_INTERNAL_STRFUNC_H_ 84 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/internal/strtod.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_STRTOD_ 16 | #define RAPIDJSON_STRTOD_ 17 | 18 | #include "ieee754.h" 19 | #include "biginteger.h" 20 | #include "diyfp.h" 21 | #include "pow10.h" 22 | #include 23 | #include 24 | 25 | RAPIDJSON_NAMESPACE_BEGIN 26 | namespace internal { 27 | 28 | inline double FastPath(double significand, int exp) { 29 | if (exp < -308) 30 | return 0.0; 31 | else if (exp >= 0) 32 | return significand * internal::Pow10(exp); 33 | else 34 | return significand / internal::Pow10(-exp); 35 | } 36 | 37 | inline double StrtodNormalPrecision(double d, int p) { 38 | if (p < -308) { 39 | // Prevent expSum < -308, making Pow10(p) = 0 40 | d = FastPath(d, -308); 41 | d = FastPath(d, p + 308); 42 | } 43 | else 44 | d = FastPath(d, p); 45 | return d; 46 | } 47 | 48 | template 49 | inline T Min3(T a, T b, T c) { 50 | T m = a; 51 | if (m > b) m = b; 52 | if (m > c) m = c; 53 | return m; 54 | } 55 | 56 | inline int CheckWithinHalfULP(double b, const BigInteger& d, int dExp) { 57 | const Double db(b); 58 | const uint64_t bInt = db.IntegerSignificand(); 59 | const int bExp = db.IntegerExponent(); 60 | const int hExp = bExp - 1; 61 | 62 | int dS_Exp2 = 0, dS_Exp5 = 0, bS_Exp2 = 0, bS_Exp5 = 0, hS_Exp2 = 0, hS_Exp5 = 0; 63 | 64 | // Adjust for decimal exponent 65 | if (dExp >= 0) { 66 | dS_Exp2 += dExp; 67 | dS_Exp5 += dExp; 68 | } 69 | else { 70 | bS_Exp2 -= dExp; 71 | bS_Exp5 -= dExp; 72 | hS_Exp2 -= dExp; 73 | hS_Exp5 -= dExp; 74 | } 75 | 76 | // Adjust for binary exponent 77 | if (bExp >= 0) 78 | bS_Exp2 += bExp; 79 | else { 80 | dS_Exp2 -= bExp; 81 | hS_Exp2 -= bExp; 82 | } 83 | 84 | // Adjust for half ulp exponent 85 | if (hExp >= 0) 86 | hS_Exp2 += hExp; 87 | else { 88 | dS_Exp2 -= hExp; 89 | bS_Exp2 -= hExp; 90 | } 91 | 92 | // Remove common power of two factor from all three scaled values 93 | int common_Exp2 = Min3(dS_Exp2, bS_Exp2, hS_Exp2); 94 | dS_Exp2 -= common_Exp2; 95 | bS_Exp2 -= common_Exp2; 96 | hS_Exp2 -= common_Exp2; 97 | 98 | BigInteger dS = d; 99 | dS.MultiplyPow5(static_cast(dS_Exp5)) <<= static_cast(dS_Exp2); 100 | 101 | BigInteger bS(bInt); 102 | bS.MultiplyPow5(static_cast(bS_Exp5)) <<= static_cast(bS_Exp2); 103 | 104 | BigInteger hS(1); 105 | hS.MultiplyPow5(static_cast(hS_Exp5)) <<= static_cast(hS_Exp2); 106 | 107 | BigInteger delta(0); 108 | dS.Difference(bS, &delta); 109 | 110 | return delta.Compare(hS); 111 | } 112 | 113 | inline bool StrtodFast(double d, int p, double* result) { 114 | // Use fast path for string-to-double conversion if possible 115 | // see http://www.exploringbinary.com/fast-path-decimal-to-floating-point-conversion/ 116 | if (p > 22 && p < 22 + 16) { 117 | // Fast Path Cases In Disguise 118 | d *= internal::Pow10(p - 22); 119 | p = 22; 120 | } 121 | 122 | if (p >= -22 && p <= 22 && d <= 9007199254740991.0) { // 2^53 - 1 123 | *result = FastPath(d, p); 124 | return true; 125 | } 126 | else 127 | return false; 128 | } 129 | 130 | // Compute an approximation and see if it is within 1/2 ULP 131 | template 132 | inline bool StrtodDiyFp(const Ch* decimals, int dLen, int dExp, double* result) { 133 | uint64_t significand = 0; 134 | int i = 0; // 2^64 - 1 = 18446744073709551615, 1844674407370955161 = 0x1999999999999999 135 | for (; i < dLen; i++) { 136 | if (significand > RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) || 137 | (significand == RAPIDJSON_UINT64_C2(0x19999999, 0x99999999) && decimals[i] > Ch('5'))) 138 | break; 139 | significand = significand * 10u + static_cast(decimals[i] - Ch('0')); 140 | } 141 | 142 | if (i < dLen && decimals[i] >= Ch('5')) // Rounding 143 | significand++; 144 | 145 | int remaining = dLen - i; 146 | const int kUlpShift = 3; 147 | const int kUlp = 1 << kUlpShift; 148 | int64_t error = (remaining == 0) ? 0 : kUlp / 2; 149 | 150 | DiyFp v(significand, 0); 151 | v = v.Normalize(); 152 | error <<= -v.e; 153 | 154 | dExp += remaining; 155 | 156 | int actualExp; 157 | DiyFp cachedPower = GetCachedPower10(dExp, &actualExp); 158 | if (actualExp != dExp) { 159 | static const DiyFp kPow10[] = { 160 | DiyFp(RAPIDJSON_UINT64_C2(0xa0000000, 0x00000000), -60), // 10^1 161 | DiyFp(RAPIDJSON_UINT64_C2(0xc8000000, 0x00000000), -57), // 10^2 162 | DiyFp(RAPIDJSON_UINT64_C2(0xfa000000, 0x00000000), -54), // 10^3 163 | DiyFp(RAPIDJSON_UINT64_C2(0x9c400000, 0x00000000), -50), // 10^4 164 | DiyFp(RAPIDJSON_UINT64_C2(0xc3500000, 0x00000000), -47), // 10^5 165 | DiyFp(RAPIDJSON_UINT64_C2(0xf4240000, 0x00000000), -44), // 10^6 166 | DiyFp(RAPIDJSON_UINT64_C2(0x98968000, 0x00000000), -40) // 10^7 167 | }; 168 | int adjustment = dExp - actualExp; 169 | RAPIDJSON_ASSERT(adjustment >= 1 && adjustment < 8); 170 | v = v * kPow10[adjustment - 1]; 171 | if (dLen + adjustment > 19) // has more digits than decimal digits in 64-bit 172 | error += kUlp / 2; 173 | } 174 | 175 | v = v * cachedPower; 176 | 177 | error += kUlp + (error == 0 ? 0 : 1); 178 | 179 | const int oldExp = v.e; 180 | v = v.Normalize(); 181 | error <<= oldExp - v.e; 182 | 183 | const int effectiveSignificandSize = Double::EffectiveSignificandSize(64 + v.e); 184 | int precisionSize = 64 - effectiveSignificandSize; 185 | if (precisionSize + kUlpShift >= 64) { 186 | int scaleExp = (precisionSize + kUlpShift) - 63; 187 | v.f >>= scaleExp; 188 | v.e += scaleExp; 189 | error = (error >> scaleExp) + 1 + kUlp; 190 | precisionSize -= scaleExp; 191 | } 192 | 193 | DiyFp rounded(v.f >> precisionSize, v.e + precisionSize); 194 | const uint64_t precisionBits = (v.f & ((uint64_t(1) << precisionSize) - 1)) * kUlp; 195 | const uint64_t halfWay = (uint64_t(1) << (precisionSize - 1)) * kUlp; 196 | if (precisionBits >= halfWay + static_cast(error)) { 197 | rounded.f++; 198 | if (rounded.f & (DiyFp::kDpHiddenBit << 1)) { // rounding overflows mantissa (issue #340) 199 | rounded.f >>= 1; 200 | rounded.e++; 201 | } 202 | } 203 | 204 | *result = rounded.ToDouble(); 205 | 206 | return halfWay - static_cast(error) >= precisionBits || precisionBits >= halfWay + static_cast(error); 207 | } 208 | 209 | template 210 | inline double StrtodBigInteger(double approx, const Ch* decimals, int dLen, int dExp) { 211 | RAPIDJSON_ASSERT(dLen >= 0); 212 | const BigInteger dInt(decimals, static_cast(dLen)); 213 | Double a(approx); 214 | int cmp = CheckWithinHalfULP(a.Value(), dInt, dExp); 215 | if (cmp < 0) 216 | return a.Value(); // within half ULP 217 | else if (cmp == 0) { 218 | // Round towards even 219 | if (a.Significand() & 1) 220 | return a.NextPositiveDouble(); 221 | else 222 | return a.Value(); 223 | } 224 | else // adjustment 225 | return a.NextPositiveDouble(); 226 | } 227 | 228 | template 229 | inline double StrtodFullPrecision(double d, int p, const Ch* decimals, size_t length, size_t decimalPosition, int exp) { 230 | RAPIDJSON_ASSERT(d >= 0.0); 231 | RAPIDJSON_ASSERT(length >= 1); 232 | 233 | double result = 0.0; 234 | if (StrtodFast(d, p, &result)) 235 | return result; 236 | 237 | RAPIDJSON_ASSERT(length <= INT_MAX); 238 | int dLen = static_cast(length); 239 | 240 | RAPIDJSON_ASSERT(length >= decimalPosition); 241 | RAPIDJSON_ASSERT(length - decimalPosition <= INT_MAX); 242 | int dExpAdjust = static_cast(length - decimalPosition); 243 | 244 | RAPIDJSON_ASSERT(exp >= INT_MIN + dExpAdjust); 245 | int dExp = exp - dExpAdjust; 246 | 247 | // Make sure length+dExp does not overflow 248 | RAPIDJSON_ASSERT(dExp <= INT_MAX - dLen); 249 | 250 | // Trim leading zeros 251 | while (dLen > 0 && *decimals == '0') { 252 | dLen--; 253 | decimals++; 254 | } 255 | 256 | // Trim trailing zeros 257 | while (dLen > 0 && decimals[dLen - 1] == '0') { 258 | dLen--; 259 | dExp++; 260 | } 261 | 262 | if (dLen == 0) { // Buffer only contains zeros. 263 | return 0.0; 264 | } 265 | 266 | // Trim right-most digits 267 | const int kMaxDecimalDigit = 767 + 1; 268 | if (dLen > kMaxDecimalDigit) { 269 | dExp += dLen - kMaxDecimalDigit; 270 | dLen = kMaxDecimalDigit; 271 | } 272 | 273 | // If too small, underflow to zero. 274 | // Any x <= 10^-324 is interpreted as zero. 275 | if (dLen + dExp <= -324) 276 | return 0.0; 277 | 278 | // If too large, overflow to infinity. 279 | // Any x >= 10^309 is interpreted as +infinity. 280 | if (dLen + dExp > 309) 281 | return std::numeric_limits::infinity(); 282 | 283 | if (StrtodDiyFp(decimals, dLen, dExp, &result)) 284 | return result; 285 | 286 | // Use approximation from StrtodDiyFp and make adjustment with BigInteger comparison 287 | return StrtodBigInteger(result, decimals, dLen, dExp); 288 | } 289 | 290 | } // namespace internal 291 | RAPIDJSON_NAMESPACE_END 292 | 293 | #endif // RAPIDJSON_STRTOD_ 294 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/internal/swap.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_INTERNAL_SWAP_H_ 16 | #define RAPIDJSON_INTERNAL_SWAP_H_ 17 | 18 | #include "../rapidjson.h" 19 | 20 | #if defined(__clang__) 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(c++98-compat) 23 | #endif 24 | 25 | RAPIDJSON_NAMESPACE_BEGIN 26 | namespace internal { 27 | 28 | //! Custom swap() to avoid dependency on C++ header 29 | /*! \tparam T Type of the arguments to swap, should be instantiated with primitive C++ types only. 30 | \note This has the same semantics as std::swap(). 31 | */ 32 | template 33 | inline void Swap(T& a, T& b) RAPIDJSON_NOEXCEPT { 34 | T tmp = a; 35 | a = b; 36 | b = tmp; 37 | } 38 | 39 | } // namespace internal 40 | RAPIDJSON_NAMESPACE_END 41 | 42 | #if defined(__clang__) 43 | RAPIDJSON_DIAG_POP 44 | #endif 45 | 46 | #endif // RAPIDJSON_INTERNAL_SWAP_H_ 47 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/istreamwrapper.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_ISTREAMWRAPPER_H_ 16 | #define RAPIDJSON_ISTREAMWRAPPER_H_ 17 | 18 | #include "stream.h" 19 | #include 20 | #include 21 | 22 | #ifdef __clang__ 23 | RAPIDJSON_DIAG_PUSH 24 | RAPIDJSON_DIAG_OFF(padded) 25 | #elif defined(_MSC_VER) 26 | RAPIDJSON_DIAG_PUSH 27 | RAPIDJSON_DIAG_OFF(4351) // new behavior: elements of array 'array' will be default initialized 28 | #endif 29 | 30 | RAPIDJSON_NAMESPACE_BEGIN 31 | 32 | //! Wrapper of \c std::basic_istream into RapidJSON's Stream concept. 33 | /*! 34 | The classes can be wrapped including but not limited to: 35 | 36 | - \c std::istringstream 37 | - \c std::stringstream 38 | - \c std::wistringstream 39 | - \c std::wstringstream 40 | - \c std::ifstream 41 | - \c std::fstream 42 | - \c std::wifstream 43 | - \c std::wfstream 44 | 45 | \tparam StreamType Class derived from \c std::basic_istream. 46 | */ 47 | 48 | template 49 | class BasicIStreamWrapper { 50 | public: 51 | typedef typename StreamType::char_type Ch; 52 | 53 | //! Constructor. 54 | /*! 55 | \param stream stream opened for read. 56 | */ 57 | BasicIStreamWrapper(StreamType &stream) : stream_(stream), buffer_(peekBuffer_), bufferSize_(4), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { 58 | Read(); 59 | } 60 | 61 | //! Constructor. 62 | /*! 63 | \param stream stream opened for read. 64 | \param buffer user-supplied buffer. 65 | \param bufferSize size of buffer in bytes. Must >=4 bytes. 66 | */ 67 | BasicIStreamWrapper(StreamType &stream, char* buffer, size_t bufferSize) : stream_(stream), buffer_(buffer), bufferSize_(bufferSize), bufferLast_(0), current_(buffer_), readCount_(0), count_(0), eof_(false) { 68 | RAPIDJSON_ASSERT(bufferSize >= 4); 69 | Read(); 70 | } 71 | 72 | Ch Peek() const { return *current_; } 73 | Ch Take() { Ch c = *current_; Read(); return c; } 74 | size_t Tell() const { return count_ + static_cast(current_ - buffer_); } 75 | 76 | // Not implemented 77 | void Put(Ch) { RAPIDJSON_ASSERT(false); } 78 | void Flush() { RAPIDJSON_ASSERT(false); } 79 | Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } 80 | size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } 81 | 82 | // For encoding detection only. 83 | const Ch* Peek4() const { 84 | return (current_ + 4 - !eof_ <= bufferLast_) ? current_ : 0; 85 | } 86 | 87 | private: 88 | BasicIStreamWrapper(); 89 | BasicIStreamWrapper(const BasicIStreamWrapper&); 90 | BasicIStreamWrapper& operator=(const BasicIStreamWrapper&); 91 | 92 | void Read() { 93 | if (current_ < bufferLast_) 94 | ++current_; 95 | else if (!eof_) { 96 | count_ += readCount_; 97 | readCount_ = bufferSize_; 98 | bufferLast_ = buffer_ + readCount_ - 1; 99 | current_ = buffer_; 100 | 101 | if (!stream_.read(buffer_, static_cast(bufferSize_))) { 102 | readCount_ = static_cast(stream_.gcount()); 103 | *(bufferLast_ = buffer_ + readCount_) = '\0'; 104 | eof_ = true; 105 | } 106 | } 107 | } 108 | 109 | StreamType &stream_; 110 | Ch peekBuffer_[4], *buffer_; 111 | size_t bufferSize_; 112 | Ch *bufferLast_; 113 | Ch *current_; 114 | size_t readCount_; 115 | size_t count_; //!< Number of characters read 116 | bool eof_; 117 | }; 118 | 119 | typedef BasicIStreamWrapper IStreamWrapper; 120 | typedef BasicIStreamWrapper WIStreamWrapper; 121 | 122 | #if defined(__clang__) || defined(_MSC_VER) 123 | RAPIDJSON_DIAG_POP 124 | #endif 125 | 126 | RAPIDJSON_NAMESPACE_END 127 | 128 | #endif // RAPIDJSON_ISTREAMWRAPPER_H_ 129 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/memorybuffer.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_MEMORYBUFFER_H_ 16 | #define RAPIDJSON_MEMORYBUFFER_H_ 17 | 18 | #include "stream.h" 19 | #include "internal/stack.h" 20 | 21 | RAPIDJSON_NAMESPACE_BEGIN 22 | 23 | //! Represents an in-memory output byte stream. 24 | /*! 25 | This class is mainly for being wrapped by EncodedOutputStream or AutoUTFOutputStream. 26 | 27 | It is similar to FileWriteBuffer but the destination is an in-memory buffer instead of a file. 28 | 29 | Differences between MemoryBuffer and StringBuffer: 30 | 1. StringBuffer has Encoding but MemoryBuffer is only a byte buffer. 31 | 2. StringBuffer::GetString() returns a null-terminated string. MemoryBuffer::GetBuffer() returns a buffer without terminator. 32 | 33 | \tparam Allocator type for allocating memory buffer. 34 | \note implements Stream concept 35 | */ 36 | template 37 | struct GenericMemoryBuffer { 38 | typedef char Ch; // byte 39 | 40 | GenericMemoryBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} 41 | 42 | void Put(Ch c) { *stack_.template Push() = c; } 43 | void Flush() {} 44 | 45 | void Clear() { stack_.Clear(); } 46 | void ShrinkToFit() { stack_.ShrinkToFit(); } 47 | Ch* Push(size_t count) { return stack_.template Push(count); } 48 | void Pop(size_t count) { stack_.template Pop(count); } 49 | 50 | const Ch* GetBuffer() const { 51 | return stack_.template Bottom(); 52 | } 53 | 54 | size_t GetSize() const { return stack_.GetSize(); } 55 | 56 | static const size_t kDefaultCapacity = 256; 57 | mutable internal::Stack stack_; 58 | }; 59 | 60 | typedef GenericMemoryBuffer<> MemoryBuffer; 61 | 62 | //! Implement specialized version of PutN() with memset() for better performance. 63 | template<> 64 | inline void PutN(MemoryBuffer& memoryBuffer, char c, size_t n) { 65 | std::memset(memoryBuffer.stack_.Push(n), c, n * sizeof(c)); 66 | } 67 | 68 | RAPIDJSON_NAMESPACE_END 69 | 70 | #endif // RAPIDJSON_MEMORYBUFFER_H_ 71 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/memorystream.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_MEMORYSTREAM_H_ 16 | #define RAPIDJSON_MEMORYSTREAM_H_ 17 | 18 | #include "stream.h" 19 | 20 | #ifdef __clang__ 21 | RAPIDJSON_DIAG_PUSH 22 | RAPIDJSON_DIAG_OFF(unreachable-code) 23 | RAPIDJSON_DIAG_OFF(missing-noreturn) 24 | #endif 25 | 26 | RAPIDJSON_NAMESPACE_BEGIN 27 | 28 | //! Represents an in-memory input byte stream. 29 | /*! 30 | This class is mainly for being wrapped by EncodedInputStream or AutoUTFInputStream. 31 | 32 | It is similar to FileReadBuffer but the source is an in-memory buffer instead of a file. 33 | 34 | Differences between MemoryStream and StringStream: 35 | 1. StringStream has encoding but MemoryStream is a byte stream. 36 | 2. MemoryStream needs size of the source buffer and the buffer don't need to be null terminated. StringStream assume null-terminated string as source. 37 | 3. MemoryStream supports Peek4() for encoding detection. StringStream is specified with an encoding so it should not have Peek4(). 38 | \note implements Stream concept 39 | */ 40 | struct MemoryStream { 41 | typedef char Ch; // byte 42 | 43 | MemoryStream(const Ch *src, size_t size) : src_(src), begin_(src), end_(src + size), size_(size) {} 44 | 45 | Ch Peek() const { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_; } 46 | Ch Take() { return RAPIDJSON_UNLIKELY(src_ == end_) ? '\0' : *src_++; } 47 | size_t Tell() const { return static_cast(src_ - begin_); } 48 | 49 | Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } 50 | void Put(Ch) { RAPIDJSON_ASSERT(false); } 51 | void Flush() { RAPIDJSON_ASSERT(false); } 52 | size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } 53 | 54 | // For encoding detection only. 55 | const Ch* Peek4() const { 56 | return Tell() + 4 <= size_ ? src_ : 0; 57 | } 58 | 59 | const Ch* src_; //!< Current read position. 60 | const Ch* begin_; //!< Original head of the string. 61 | const Ch* end_; //!< End of stream. 62 | size_t size_; //!< Size of the stream. 63 | }; 64 | 65 | RAPIDJSON_NAMESPACE_END 66 | 67 | #ifdef __clang__ 68 | RAPIDJSON_DIAG_POP 69 | #endif 70 | 71 | #endif // RAPIDJSON_MEMORYBUFFER_H_ 72 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/msinttypes/inttypes.h: -------------------------------------------------------------------------------- 1 | // ISO C9x compliant inttypes.h for Microsoft Visual Studio 2 | // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 3 | // 4 | // Copyright (c) 2006-2013 Alexander Chemeris 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // 9 | // 1. Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // 2. Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // 16 | // 3. Neither the name of the product nor the names of its contributors may 17 | // be used to endorse or promote products derived from this software 18 | // without specific prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 21 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | // 31 | /////////////////////////////////////////////////////////////////////////////// 32 | 33 | // The above software in this distribution may have been modified by 34 | // THL A29 Limited ("Tencent Modifications"). 35 | // All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. 36 | 37 | #ifndef _MSC_VER // [ 38 | #error "Use this header only with Microsoft Visual C++ compilers!" 39 | #endif // _MSC_VER ] 40 | 41 | #ifndef _MSC_INTTYPES_H_ // [ 42 | #define _MSC_INTTYPES_H_ 43 | 44 | #if _MSC_VER > 1000 45 | #pragma once 46 | #endif 47 | 48 | #include "stdint.h" 49 | 50 | // miloyip: VC supports inttypes.h since VC2013 51 | #if _MSC_VER >= 1800 52 | #include 53 | #else 54 | 55 | // 7.8 Format conversion of integer types 56 | 57 | typedef struct { 58 | intmax_t quot; 59 | intmax_t rem; 60 | } imaxdiv_t; 61 | 62 | // 7.8.1 Macros for format specifiers 63 | 64 | #if !defined(__cplusplus) || defined(__STDC_FORMAT_MACROS) // [ See footnote 185 at page 198 65 | 66 | // The fprintf macros for signed integers are: 67 | #define PRId8 "d" 68 | #define PRIi8 "i" 69 | #define PRIdLEAST8 "d" 70 | #define PRIiLEAST8 "i" 71 | #define PRIdFAST8 "d" 72 | #define PRIiFAST8 "i" 73 | 74 | #define PRId16 "hd" 75 | #define PRIi16 "hi" 76 | #define PRIdLEAST16 "hd" 77 | #define PRIiLEAST16 "hi" 78 | #define PRIdFAST16 "hd" 79 | #define PRIiFAST16 "hi" 80 | 81 | #define PRId32 "I32d" 82 | #define PRIi32 "I32i" 83 | #define PRIdLEAST32 "I32d" 84 | #define PRIiLEAST32 "I32i" 85 | #define PRIdFAST32 "I32d" 86 | #define PRIiFAST32 "I32i" 87 | 88 | #define PRId64 "I64d" 89 | #define PRIi64 "I64i" 90 | #define PRIdLEAST64 "I64d" 91 | #define PRIiLEAST64 "I64i" 92 | #define PRIdFAST64 "I64d" 93 | #define PRIiFAST64 "I64i" 94 | 95 | #define PRIdMAX "I64d" 96 | #define PRIiMAX "I64i" 97 | 98 | #define PRIdPTR "Id" 99 | #define PRIiPTR "Ii" 100 | 101 | // The fprintf macros for unsigned integers are: 102 | #define PRIo8 "o" 103 | #define PRIu8 "u" 104 | #define PRIx8 "x" 105 | #define PRIX8 "X" 106 | #define PRIoLEAST8 "o" 107 | #define PRIuLEAST8 "u" 108 | #define PRIxLEAST8 "x" 109 | #define PRIXLEAST8 "X" 110 | #define PRIoFAST8 "o" 111 | #define PRIuFAST8 "u" 112 | #define PRIxFAST8 "x" 113 | #define PRIXFAST8 "X" 114 | 115 | #define PRIo16 "ho" 116 | #define PRIu16 "hu" 117 | #define PRIx16 "hx" 118 | #define PRIX16 "hX" 119 | #define PRIoLEAST16 "ho" 120 | #define PRIuLEAST16 "hu" 121 | #define PRIxLEAST16 "hx" 122 | #define PRIXLEAST16 "hX" 123 | #define PRIoFAST16 "ho" 124 | #define PRIuFAST16 "hu" 125 | #define PRIxFAST16 "hx" 126 | #define PRIXFAST16 "hX" 127 | 128 | #define PRIo32 "I32o" 129 | #define PRIu32 "I32u" 130 | #define PRIx32 "I32x" 131 | #define PRIX32 "I32X" 132 | #define PRIoLEAST32 "I32o" 133 | #define PRIuLEAST32 "I32u" 134 | #define PRIxLEAST32 "I32x" 135 | #define PRIXLEAST32 "I32X" 136 | #define PRIoFAST32 "I32o" 137 | #define PRIuFAST32 "I32u" 138 | #define PRIxFAST32 "I32x" 139 | #define PRIXFAST32 "I32X" 140 | 141 | #define PRIo64 "I64o" 142 | #define PRIu64 "I64u" 143 | #define PRIx64 "I64x" 144 | #define PRIX64 "I64X" 145 | #define PRIoLEAST64 "I64o" 146 | #define PRIuLEAST64 "I64u" 147 | #define PRIxLEAST64 "I64x" 148 | #define PRIXLEAST64 "I64X" 149 | #define PRIoFAST64 "I64o" 150 | #define PRIuFAST64 "I64u" 151 | #define PRIxFAST64 "I64x" 152 | #define PRIXFAST64 "I64X" 153 | 154 | #define PRIoMAX "I64o" 155 | #define PRIuMAX "I64u" 156 | #define PRIxMAX "I64x" 157 | #define PRIXMAX "I64X" 158 | 159 | #define PRIoPTR "Io" 160 | #define PRIuPTR "Iu" 161 | #define PRIxPTR "Ix" 162 | #define PRIXPTR "IX" 163 | 164 | // The fscanf macros for signed integers are: 165 | #define SCNd8 "d" 166 | #define SCNi8 "i" 167 | #define SCNdLEAST8 "d" 168 | #define SCNiLEAST8 "i" 169 | #define SCNdFAST8 "d" 170 | #define SCNiFAST8 "i" 171 | 172 | #define SCNd16 "hd" 173 | #define SCNi16 "hi" 174 | #define SCNdLEAST16 "hd" 175 | #define SCNiLEAST16 "hi" 176 | #define SCNdFAST16 "hd" 177 | #define SCNiFAST16 "hi" 178 | 179 | #define SCNd32 "ld" 180 | #define SCNi32 "li" 181 | #define SCNdLEAST32 "ld" 182 | #define SCNiLEAST32 "li" 183 | #define SCNdFAST32 "ld" 184 | #define SCNiFAST32 "li" 185 | 186 | #define SCNd64 "I64d" 187 | #define SCNi64 "I64i" 188 | #define SCNdLEAST64 "I64d" 189 | #define SCNiLEAST64 "I64i" 190 | #define SCNdFAST64 "I64d" 191 | #define SCNiFAST64 "I64i" 192 | 193 | #define SCNdMAX "I64d" 194 | #define SCNiMAX "I64i" 195 | 196 | #ifdef _WIN64 // [ 197 | # define SCNdPTR "I64d" 198 | # define SCNiPTR "I64i" 199 | #else // _WIN64 ][ 200 | # define SCNdPTR "ld" 201 | # define SCNiPTR "li" 202 | #endif // _WIN64 ] 203 | 204 | // The fscanf macros for unsigned integers are: 205 | #define SCNo8 "o" 206 | #define SCNu8 "u" 207 | #define SCNx8 "x" 208 | #define SCNX8 "X" 209 | #define SCNoLEAST8 "o" 210 | #define SCNuLEAST8 "u" 211 | #define SCNxLEAST8 "x" 212 | #define SCNXLEAST8 "X" 213 | #define SCNoFAST8 "o" 214 | #define SCNuFAST8 "u" 215 | #define SCNxFAST8 "x" 216 | #define SCNXFAST8 "X" 217 | 218 | #define SCNo16 "ho" 219 | #define SCNu16 "hu" 220 | #define SCNx16 "hx" 221 | #define SCNX16 "hX" 222 | #define SCNoLEAST16 "ho" 223 | #define SCNuLEAST16 "hu" 224 | #define SCNxLEAST16 "hx" 225 | #define SCNXLEAST16 "hX" 226 | #define SCNoFAST16 "ho" 227 | #define SCNuFAST16 "hu" 228 | #define SCNxFAST16 "hx" 229 | #define SCNXFAST16 "hX" 230 | 231 | #define SCNo32 "lo" 232 | #define SCNu32 "lu" 233 | #define SCNx32 "lx" 234 | #define SCNX32 "lX" 235 | #define SCNoLEAST32 "lo" 236 | #define SCNuLEAST32 "lu" 237 | #define SCNxLEAST32 "lx" 238 | #define SCNXLEAST32 "lX" 239 | #define SCNoFAST32 "lo" 240 | #define SCNuFAST32 "lu" 241 | #define SCNxFAST32 "lx" 242 | #define SCNXFAST32 "lX" 243 | 244 | #define SCNo64 "I64o" 245 | #define SCNu64 "I64u" 246 | #define SCNx64 "I64x" 247 | #define SCNX64 "I64X" 248 | #define SCNoLEAST64 "I64o" 249 | #define SCNuLEAST64 "I64u" 250 | #define SCNxLEAST64 "I64x" 251 | #define SCNXLEAST64 "I64X" 252 | #define SCNoFAST64 "I64o" 253 | #define SCNuFAST64 "I64u" 254 | #define SCNxFAST64 "I64x" 255 | #define SCNXFAST64 "I64X" 256 | 257 | #define SCNoMAX "I64o" 258 | #define SCNuMAX "I64u" 259 | #define SCNxMAX "I64x" 260 | #define SCNXMAX "I64X" 261 | 262 | #ifdef _WIN64 // [ 263 | # define SCNoPTR "I64o" 264 | # define SCNuPTR "I64u" 265 | # define SCNxPTR "I64x" 266 | # define SCNXPTR "I64X" 267 | #else // _WIN64 ][ 268 | # define SCNoPTR "lo" 269 | # define SCNuPTR "lu" 270 | # define SCNxPTR "lx" 271 | # define SCNXPTR "lX" 272 | #endif // _WIN64 ] 273 | 274 | #endif // __STDC_FORMAT_MACROS ] 275 | 276 | // 7.8.2 Functions for greatest-width integer types 277 | 278 | // 7.8.2.1 The imaxabs function 279 | #define imaxabs _abs64 280 | 281 | // 7.8.2.2 The imaxdiv function 282 | 283 | // This is modified version of div() function from Microsoft's div.c found 284 | // in %MSVC.NET%\crt\src\div.c 285 | #ifdef STATIC_IMAXDIV // [ 286 | static 287 | #else // STATIC_IMAXDIV ][ 288 | _inline 289 | #endif // STATIC_IMAXDIV ] 290 | imaxdiv_t __cdecl imaxdiv(intmax_t numer, intmax_t denom) 291 | { 292 | imaxdiv_t result; 293 | 294 | result.quot = numer / denom; 295 | result.rem = numer % denom; 296 | 297 | if (numer < 0 && result.rem > 0) { 298 | // did division wrong; must fix up 299 | ++result.quot; 300 | result.rem -= denom; 301 | } 302 | 303 | return result; 304 | } 305 | 306 | // 7.8.2.3 The strtoimax and strtoumax functions 307 | #define strtoimax _strtoi64 308 | #define strtoumax _strtoui64 309 | 310 | // 7.8.2.4 The wcstoimax and wcstoumax functions 311 | #define wcstoimax _wcstoi64 312 | #define wcstoumax _wcstoui64 313 | 314 | #endif // _MSC_VER >= 1800 315 | 316 | #endif // _MSC_INTTYPES_H_ ] 317 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/msinttypes/stdint.h: -------------------------------------------------------------------------------- 1 | // ISO C9x compliant stdint.h for Microsoft Visual Studio 2 | // Based on ISO/IEC 9899:TC2 Committee draft (May 6, 2005) WG14/N1124 3 | // 4 | // Copyright (c) 2006-2013 Alexander Chemeris 5 | // 6 | // Redistribution and use in source and binary forms, with or without 7 | // modification, are permitted provided that the following conditions are met: 8 | // 9 | // 1. Redistributions of source code must retain the above copyright notice, 10 | // this list of conditions and the following disclaimer. 11 | // 12 | // 2. Redistributions in binary form must reproduce the above copyright 13 | // notice, this list of conditions and the following disclaimer in the 14 | // documentation and/or other materials provided with the distribution. 15 | // 16 | // 3. Neither the name of the product nor the names of its contributors may 17 | // be used to endorse or promote products derived from this software 18 | // without specific prior written permission. 19 | // 20 | // THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED 21 | // WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 22 | // MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 23 | // EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 24 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 25 | // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 26 | // OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27 | // WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 28 | // OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 29 | // ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | // 31 | /////////////////////////////////////////////////////////////////////////////// 32 | 33 | // The above software in this distribution may have been modified by 34 | // THL A29 Limited ("Tencent Modifications"). 35 | // All Tencent Modifications are Copyright (C) 2015 THL A29 Limited. 36 | 37 | #ifndef _MSC_VER // [ 38 | #error "Use this header only with Microsoft Visual C++ compilers!" 39 | #endif // _MSC_VER ] 40 | 41 | #ifndef _MSC_STDINT_H_ // [ 42 | #define _MSC_STDINT_H_ 43 | 44 | #if _MSC_VER > 1000 45 | #pragma once 46 | #endif 47 | 48 | // miloyip: Originally Visual Studio 2010 uses its own stdint.h. However it generates warning with INT64_C(), so change to use this file for vs2010. 49 | #if _MSC_VER >= 1600 // [ 50 | #include 51 | 52 | #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 53 | 54 | #undef INT8_C 55 | #undef INT16_C 56 | #undef INT32_C 57 | #undef INT64_C 58 | #undef UINT8_C 59 | #undef UINT16_C 60 | #undef UINT32_C 61 | #undef UINT64_C 62 | 63 | // 7.18.4.1 Macros for minimum-width integer constants 64 | 65 | #define INT8_C(val) val##i8 66 | #define INT16_C(val) val##i16 67 | #define INT32_C(val) val##i32 68 | #define INT64_C(val) val##i64 69 | 70 | #define UINT8_C(val) val##ui8 71 | #define UINT16_C(val) val##ui16 72 | #define UINT32_C(val) val##ui32 73 | #define UINT64_C(val) val##ui64 74 | 75 | // 7.18.4.2 Macros for greatest-width integer constants 76 | // These #ifndef's are needed to prevent collisions with . 77 | // Check out Issue 9 for the details. 78 | #ifndef INTMAX_C // [ 79 | # define INTMAX_C INT64_C 80 | #endif // INTMAX_C ] 81 | #ifndef UINTMAX_C // [ 82 | # define UINTMAX_C UINT64_C 83 | #endif // UINTMAX_C ] 84 | 85 | #endif // __STDC_CONSTANT_MACROS ] 86 | 87 | #else // ] _MSC_VER >= 1700 [ 88 | 89 | #include 90 | 91 | // For Visual Studio 6 in C++ mode and for many Visual Studio versions when 92 | // compiling for ARM we have to wrap include with 'extern "C++" {}' 93 | // or compiler would give many errors like this: 94 | // error C2733: second C linkage of overloaded function 'wmemchr' not allowed 95 | #if defined(__cplusplus) && !defined(_M_ARM) 96 | extern "C" { 97 | #endif 98 | # include 99 | #if defined(__cplusplus) && !defined(_M_ARM) 100 | } 101 | #endif 102 | 103 | // Define _W64 macros to mark types changing their size, like intptr_t. 104 | #ifndef _W64 105 | # if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && _MSC_VER >= 1300 106 | # define _W64 __w64 107 | # else 108 | # define _W64 109 | # endif 110 | #endif 111 | 112 | 113 | // 7.18.1 Integer types 114 | 115 | // 7.18.1.1 Exact-width integer types 116 | 117 | // Visual Studio 6 and Embedded Visual C++ 4 doesn't 118 | // realize that, e.g. char has the same size as __int8 119 | // so we give up on __intX for them. 120 | #if (_MSC_VER < 1300) 121 | typedef signed char int8_t; 122 | typedef signed short int16_t; 123 | typedef signed int int32_t; 124 | typedef unsigned char uint8_t; 125 | typedef unsigned short uint16_t; 126 | typedef unsigned int uint32_t; 127 | #else 128 | typedef signed __int8 int8_t; 129 | typedef signed __int16 int16_t; 130 | typedef signed __int32 int32_t; 131 | typedef unsigned __int8 uint8_t; 132 | typedef unsigned __int16 uint16_t; 133 | typedef unsigned __int32 uint32_t; 134 | #endif 135 | typedef signed __int64 int64_t; 136 | typedef unsigned __int64 uint64_t; 137 | 138 | 139 | // 7.18.1.2 Minimum-width integer types 140 | typedef int8_t int_least8_t; 141 | typedef int16_t int_least16_t; 142 | typedef int32_t int_least32_t; 143 | typedef int64_t int_least64_t; 144 | typedef uint8_t uint_least8_t; 145 | typedef uint16_t uint_least16_t; 146 | typedef uint32_t uint_least32_t; 147 | typedef uint64_t uint_least64_t; 148 | 149 | // 7.18.1.3 Fastest minimum-width integer types 150 | typedef int8_t int_fast8_t; 151 | typedef int16_t int_fast16_t; 152 | typedef int32_t int_fast32_t; 153 | typedef int64_t int_fast64_t; 154 | typedef uint8_t uint_fast8_t; 155 | typedef uint16_t uint_fast16_t; 156 | typedef uint32_t uint_fast32_t; 157 | typedef uint64_t uint_fast64_t; 158 | 159 | // 7.18.1.4 Integer types capable of holding object pointers 160 | #ifdef _WIN64 // [ 161 | typedef signed __int64 intptr_t; 162 | typedef unsigned __int64 uintptr_t; 163 | #else // _WIN64 ][ 164 | typedef _W64 signed int intptr_t; 165 | typedef _W64 unsigned int uintptr_t; 166 | #endif // _WIN64 ] 167 | 168 | // 7.18.1.5 Greatest-width integer types 169 | typedef int64_t intmax_t; 170 | typedef uint64_t uintmax_t; 171 | 172 | 173 | // 7.18.2 Limits of specified-width integer types 174 | 175 | #if !defined(__cplusplus) || defined(__STDC_LIMIT_MACROS) // [ See footnote 220 at page 257 and footnote 221 at page 259 176 | 177 | // 7.18.2.1 Limits of exact-width integer types 178 | #define INT8_MIN ((int8_t)_I8_MIN) 179 | #define INT8_MAX _I8_MAX 180 | #define INT16_MIN ((int16_t)_I16_MIN) 181 | #define INT16_MAX _I16_MAX 182 | #define INT32_MIN ((int32_t)_I32_MIN) 183 | #define INT32_MAX _I32_MAX 184 | #define INT64_MIN ((int64_t)_I64_MIN) 185 | #define INT64_MAX _I64_MAX 186 | #define UINT8_MAX _UI8_MAX 187 | #define UINT16_MAX _UI16_MAX 188 | #define UINT32_MAX _UI32_MAX 189 | #define UINT64_MAX _UI64_MAX 190 | 191 | // 7.18.2.2 Limits of minimum-width integer types 192 | #define INT_LEAST8_MIN INT8_MIN 193 | #define INT_LEAST8_MAX INT8_MAX 194 | #define INT_LEAST16_MIN INT16_MIN 195 | #define INT_LEAST16_MAX INT16_MAX 196 | #define INT_LEAST32_MIN INT32_MIN 197 | #define INT_LEAST32_MAX INT32_MAX 198 | #define INT_LEAST64_MIN INT64_MIN 199 | #define INT_LEAST64_MAX INT64_MAX 200 | #define UINT_LEAST8_MAX UINT8_MAX 201 | #define UINT_LEAST16_MAX UINT16_MAX 202 | #define UINT_LEAST32_MAX UINT32_MAX 203 | #define UINT_LEAST64_MAX UINT64_MAX 204 | 205 | // 7.18.2.3 Limits of fastest minimum-width integer types 206 | #define INT_FAST8_MIN INT8_MIN 207 | #define INT_FAST8_MAX INT8_MAX 208 | #define INT_FAST16_MIN INT16_MIN 209 | #define INT_FAST16_MAX INT16_MAX 210 | #define INT_FAST32_MIN INT32_MIN 211 | #define INT_FAST32_MAX INT32_MAX 212 | #define INT_FAST64_MIN INT64_MIN 213 | #define INT_FAST64_MAX INT64_MAX 214 | #define UINT_FAST8_MAX UINT8_MAX 215 | #define UINT_FAST16_MAX UINT16_MAX 216 | #define UINT_FAST32_MAX UINT32_MAX 217 | #define UINT_FAST64_MAX UINT64_MAX 218 | 219 | // 7.18.2.4 Limits of integer types capable of holding object pointers 220 | #ifdef _WIN64 // [ 221 | # define INTPTR_MIN INT64_MIN 222 | # define INTPTR_MAX INT64_MAX 223 | # define UINTPTR_MAX UINT64_MAX 224 | #else // _WIN64 ][ 225 | # define INTPTR_MIN INT32_MIN 226 | # define INTPTR_MAX INT32_MAX 227 | # define UINTPTR_MAX UINT32_MAX 228 | #endif // _WIN64 ] 229 | 230 | // 7.18.2.5 Limits of greatest-width integer types 231 | #define INTMAX_MIN INT64_MIN 232 | #define INTMAX_MAX INT64_MAX 233 | #define UINTMAX_MAX UINT64_MAX 234 | 235 | // 7.18.3 Limits of other integer types 236 | 237 | #ifdef _WIN64 // [ 238 | # define PTRDIFF_MIN _I64_MIN 239 | # define PTRDIFF_MAX _I64_MAX 240 | #else // _WIN64 ][ 241 | # define PTRDIFF_MIN _I32_MIN 242 | # define PTRDIFF_MAX _I32_MAX 243 | #endif // _WIN64 ] 244 | 245 | #define SIG_ATOMIC_MIN INT_MIN 246 | #define SIG_ATOMIC_MAX INT_MAX 247 | 248 | #ifndef SIZE_MAX // [ 249 | # ifdef _WIN64 // [ 250 | # define SIZE_MAX _UI64_MAX 251 | # else // _WIN64 ][ 252 | # define SIZE_MAX _UI32_MAX 253 | # endif // _WIN64 ] 254 | #endif // SIZE_MAX ] 255 | 256 | // WCHAR_MIN and WCHAR_MAX are also defined in 257 | #ifndef WCHAR_MIN // [ 258 | # define WCHAR_MIN 0 259 | #endif // WCHAR_MIN ] 260 | #ifndef WCHAR_MAX // [ 261 | # define WCHAR_MAX _UI16_MAX 262 | #endif // WCHAR_MAX ] 263 | 264 | #define WINT_MIN 0 265 | #define WINT_MAX _UI16_MAX 266 | 267 | #endif // __STDC_LIMIT_MACROS ] 268 | 269 | 270 | // 7.18.4 Limits of other integer types 271 | 272 | #if !defined(__cplusplus) || defined(__STDC_CONSTANT_MACROS) // [ See footnote 224 at page 260 273 | 274 | // 7.18.4.1 Macros for minimum-width integer constants 275 | 276 | #define INT8_C(val) val##i8 277 | #define INT16_C(val) val##i16 278 | #define INT32_C(val) val##i32 279 | #define INT64_C(val) val##i64 280 | 281 | #define UINT8_C(val) val##ui8 282 | #define UINT16_C(val) val##ui16 283 | #define UINT32_C(val) val##ui32 284 | #define UINT64_C(val) val##ui64 285 | 286 | // 7.18.4.2 Macros for greatest-width integer constants 287 | // These #ifndef's are needed to prevent collisions with . 288 | // Check out Issue 9 for the details. 289 | #ifndef INTMAX_C // [ 290 | # define INTMAX_C INT64_C 291 | #endif // INTMAX_C ] 292 | #ifndef UINTMAX_C // [ 293 | # define UINTMAX_C UINT64_C 294 | #endif // UINTMAX_C ] 295 | 296 | #endif // __STDC_CONSTANT_MACROS ] 297 | 298 | #endif // _MSC_VER >= 1600 ] 299 | 300 | #endif // _MSC_STDINT_H_ ] 301 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/ostreamwrapper.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_OSTREAMWRAPPER_H_ 16 | #define RAPIDJSON_OSTREAMWRAPPER_H_ 17 | 18 | #include "stream.h" 19 | #include 20 | 21 | #ifdef __clang__ 22 | RAPIDJSON_DIAG_PUSH 23 | RAPIDJSON_DIAG_OFF(padded) 24 | #endif 25 | 26 | RAPIDJSON_NAMESPACE_BEGIN 27 | 28 | //! Wrapper of \c std::basic_ostream into RapidJSON's Stream concept. 29 | /*! 30 | The classes can be wrapped including but not limited to: 31 | 32 | - \c std::ostringstream 33 | - \c std::stringstream 34 | - \c std::wpstringstream 35 | - \c std::wstringstream 36 | - \c std::ifstream 37 | - \c std::fstream 38 | - \c std::wofstream 39 | - \c std::wfstream 40 | 41 | \tparam StreamType Class derived from \c std::basic_ostream. 42 | */ 43 | 44 | template 45 | class BasicOStreamWrapper { 46 | public: 47 | typedef typename StreamType::char_type Ch; 48 | BasicOStreamWrapper(StreamType& stream) : stream_(stream) {} 49 | 50 | void Put(Ch c) { 51 | stream_.put(c); 52 | } 53 | 54 | void Flush() { 55 | stream_.flush(); 56 | } 57 | 58 | // Not implemented 59 | char Peek() const { RAPIDJSON_ASSERT(false); return 0; } 60 | char Take() { RAPIDJSON_ASSERT(false); return 0; } 61 | size_t Tell() const { RAPIDJSON_ASSERT(false); return 0; } 62 | char* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } 63 | size_t PutEnd(char*) { RAPIDJSON_ASSERT(false); return 0; } 64 | 65 | private: 66 | BasicOStreamWrapper(const BasicOStreamWrapper&); 67 | BasicOStreamWrapper& operator=(const BasicOStreamWrapper&); 68 | 69 | StreamType& stream_; 70 | }; 71 | 72 | typedef BasicOStreamWrapper OStreamWrapper; 73 | typedef BasicOStreamWrapper WOStreamWrapper; 74 | 75 | #ifdef __clang__ 76 | RAPIDJSON_DIAG_POP 77 | #endif 78 | 79 | RAPIDJSON_NAMESPACE_END 80 | 81 | #endif // RAPIDJSON_OSTREAMWRAPPER_H_ 82 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/stream.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #include "rapidjson.h" 16 | 17 | #ifndef RAPIDJSON_STREAM_H_ 18 | #define RAPIDJSON_STREAM_H_ 19 | 20 | #include "encodings.h" 21 | 22 | RAPIDJSON_NAMESPACE_BEGIN 23 | 24 | /////////////////////////////////////////////////////////////////////////////// 25 | // Stream 26 | 27 | /*! \class rapidjson::Stream 28 | \brief Concept for reading and writing characters. 29 | 30 | For read-only stream, no need to implement PutBegin(), Put(), Flush() and PutEnd(). 31 | 32 | For write-only stream, only need to implement Put() and Flush(). 33 | 34 | \code 35 | concept Stream { 36 | typename Ch; //!< Character type of the stream. 37 | 38 | //! Read the current character from stream without moving the read cursor. 39 | Ch Peek() const; 40 | 41 | //! Read the current character from stream and moving the read cursor to next character. 42 | Ch Take(); 43 | 44 | //! Get the current read cursor. 45 | //! \return Number of characters read from start. 46 | size_t Tell(); 47 | 48 | //! Begin writing operation at the current read pointer. 49 | //! \return The begin writer pointer. 50 | Ch* PutBegin(); 51 | 52 | //! Write a character. 53 | void Put(Ch c); 54 | 55 | //! Flush the buffer. 56 | void Flush(); 57 | 58 | //! End the writing operation. 59 | //! \param begin The begin write pointer returned by PutBegin(). 60 | //! \return Number of characters written. 61 | size_t PutEnd(Ch* begin); 62 | } 63 | \endcode 64 | */ 65 | 66 | //! Provides additional information for stream. 67 | /*! 68 | By using traits pattern, this type provides a default configuration for stream. 69 | For custom stream, this type can be specialized for other configuration. 70 | See TEST(Reader, CustomStringStream) in readertest.cpp for example. 71 | */ 72 | template 73 | struct StreamTraits { 74 | //! Whether to make local copy of stream for optimization during parsing. 75 | /*! 76 | By default, for safety, streams do not use local copy optimization. 77 | Stream that can be copied fast should specialize this, like StreamTraits. 78 | */ 79 | enum { copyOptimization = 0 }; 80 | }; 81 | 82 | //! Reserve n characters for writing to a stream. 83 | template 84 | inline void PutReserve(Stream& stream, size_t count) { 85 | (void)stream; 86 | (void)count; 87 | } 88 | 89 | //! Write character to a stream, presuming buffer is reserved. 90 | template 91 | inline void PutUnsafe(Stream& stream, typename Stream::Ch c) { 92 | stream.Put(c); 93 | } 94 | 95 | //! Put N copies of a character to a stream. 96 | template 97 | inline void PutN(Stream& stream, Ch c, size_t n) { 98 | PutReserve(stream, n); 99 | for (size_t i = 0; i < n; i++) 100 | PutUnsafe(stream, c); 101 | } 102 | 103 | /////////////////////////////////////////////////////////////////////////////// 104 | // GenericStreamWrapper 105 | 106 | //! A Stream Wrapper 107 | /*! \tThis string stream is a wrapper for any stream by just forwarding any 108 | \treceived message to the origin stream. 109 | \note implements Stream concept 110 | */ 111 | 112 | #if defined(_MSC_VER) && _MSC_VER <= 1800 113 | RAPIDJSON_DIAG_PUSH 114 | RAPIDJSON_DIAG_OFF(4702) // unreachable code 115 | RAPIDJSON_DIAG_OFF(4512) // assignment operator could not be generated 116 | #endif 117 | 118 | template > 119 | class GenericStreamWrapper { 120 | public: 121 | typedef typename Encoding::Ch Ch; 122 | GenericStreamWrapper(InputStream& is): is_(is) {} 123 | 124 | Ch Peek() const { return is_.Peek(); } 125 | Ch Take() { return is_.Take(); } 126 | size_t Tell() { return is_.Tell(); } 127 | Ch* PutBegin() { return is_.PutBegin(); } 128 | void Put(Ch ch) { is_.Put(ch); } 129 | void Flush() { is_.Flush(); } 130 | size_t PutEnd(Ch* ch) { return is_.PutEnd(ch); } 131 | 132 | // wrapper for MemoryStream 133 | const Ch* Peek4() const { return is_.Peek4(); } 134 | 135 | // wrapper for AutoUTFInputStream 136 | UTFType GetType() const { return is_.GetType(); } 137 | bool HasBOM() const { return is_.HasBOM(); } 138 | 139 | protected: 140 | InputStream& is_; 141 | }; 142 | 143 | #if defined(_MSC_VER) && _MSC_VER <= 1800 144 | RAPIDJSON_DIAG_POP 145 | #endif 146 | 147 | /////////////////////////////////////////////////////////////////////////////// 148 | // StringStream 149 | 150 | //! Read-only string stream. 151 | /*! \note implements Stream concept 152 | */ 153 | template 154 | struct GenericStringStream { 155 | typedef typename Encoding::Ch Ch; 156 | 157 | GenericStringStream(const Ch *src) : src_(src), head_(src) {} 158 | 159 | Ch Peek() const { return *src_; } 160 | Ch Take() { return *src_++; } 161 | size_t Tell() const { return static_cast(src_ - head_); } 162 | 163 | Ch* PutBegin() { RAPIDJSON_ASSERT(false); return 0; } 164 | void Put(Ch) { RAPIDJSON_ASSERT(false); } 165 | void Flush() { RAPIDJSON_ASSERT(false); } 166 | size_t PutEnd(Ch*) { RAPIDJSON_ASSERT(false); return 0; } 167 | 168 | const Ch* src_; //!< Current read position. 169 | const Ch* head_; //!< Original head of the string. 170 | }; 171 | 172 | template 173 | struct StreamTraits > { 174 | enum { copyOptimization = 1 }; 175 | }; 176 | 177 | //! String stream with UTF8 encoding. 178 | typedef GenericStringStream > StringStream; 179 | 180 | /////////////////////////////////////////////////////////////////////////////// 181 | // InsituStringStream 182 | 183 | //! A read-write string stream. 184 | /*! This string stream is particularly designed for in-situ parsing. 185 | \note implements Stream concept 186 | */ 187 | template 188 | struct GenericInsituStringStream { 189 | typedef typename Encoding::Ch Ch; 190 | 191 | GenericInsituStringStream(Ch *src) : src_(src), dst_(0), head_(src) {} 192 | 193 | // Read 194 | Ch Peek() { return *src_; } 195 | Ch Take() { return *src_++; } 196 | size_t Tell() { return static_cast(src_ - head_); } 197 | 198 | // Write 199 | void Put(Ch c) { RAPIDJSON_ASSERT(dst_ != 0); *dst_++ = c; } 200 | 201 | Ch* PutBegin() { return dst_ = src_; } 202 | size_t PutEnd(Ch* begin) { return static_cast(dst_ - begin); } 203 | void Flush() {} 204 | 205 | Ch* Push(size_t count) { Ch* begin = dst_; dst_ += count; return begin; } 206 | void Pop(size_t count) { dst_ -= count; } 207 | 208 | Ch* src_; 209 | Ch* dst_; 210 | Ch* head_; 211 | }; 212 | 213 | template 214 | struct StreamTraits > { 215 | enum { copyOptimization = 1 }; 216 | }; 217 | 218 | //! Insitu string stream with UTF8 encoding. 219 | typedef GenericInsituStringStream > InsituStringStream; 220 | 221 | RAPIDJSON_NAMESPACE_END 222 | 223 | #endif // RAPIDJSON_STREAM_H_ 224 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/RapidJSON/include/stringbuffer.h: -------------------------------------------------------------------------------- 1 | // Tencent is pleased to support the open source community by making RapidJSON available. 2 | // 3 | // Copyright (C) 2015 THL A29 Limited, a Tencent company, and Milo Yip. 4 | // 5 | // Licensed under the MIT License (the "License"); you may not use this file except 6 | // in compliance with the License. You may obtain a copy of the License at 7 | // 8 | // http://opensource.org/licenses/MIT 9 | // 10 | // Unless required by applicable law or agreed to in writing, software distributed 11 | // under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR 12 | // CONDITIONS OF ANY KIND, either express or implied. See the License for the 13 | // specific language governing permissions and limitations under the License. 14 | 15 | #ifndef RAPIDJSON_STRINGBUFFER_H_ 16 | #define RAPIDJSON_STRINGBUFFER_H_ 17 | 18 | #include "stream.h" 19 | #include "internal/stack.h" 20 | 21 | #if RAPIDJSON_HAS_CXX11_RVALUE_REFS 22 | #include // std::move 23 | #endif 24 | 25 | #include "internal/stack.h" 26 | 27 | #if defined(__clang__) 28 | RAPIDJSON_DIAG_PUSH 29 | RAPIDJSON_DIAG_OFF(c++98-compat) 30 | #endif 31 | 32 | RAPIDJSON_NAMESPACE_BEGIN 33 | 34 | //! Represents an in-memory output stream. 35 | /*! 36 | \tparam Encoding Encoding of the stream. 37 | \tparam Allocator type for allocating memory buffer. 38 | \note implements Stream concept 39 | */ 40 | template 41 | class GenericStringBuffer { 42 | public: 43 | typedef typename Encoding::Ch Ch; 44 | 45 | GenericStringBuffer(Allocator* allocator = 0, size_t capacity = kDefaultCapacity) : stack_(allocator, capacity) {} 46 | 47 | #if RAPIDJSON_HAS_CXX11_RVALUE_REFS 48 | GenericStringBuffer(GenericStringBuffer&& rhs) : stack_(std::move(rhs.stack_)) {} 49 | GenericStringBuffer& operator=(GenericStringBuffer&& rhs) { 50 | if (&rhs != this) 51 | stack_ = std::move(rhs.stack_); 52 | return *this; 53 | } 54 | #endif 55 | 56 | void Put(Ch c) { *stack_.template Push() = c; } 57 | void PutUnsafe(Ch c) { *stack_.template PushUnsafe() = c; } 58 | void Flush() {} 59 | 60 | void Clear() { stack_.Clear(); } 61 | void ShrinkToFit() { 62 | // Push and pop a null terminator. This is safe. 63 | *stack_.template Push() = '\0'; 64 | stack_.ShrinkToFit(); 65 | stack_.template Pop(1); 66 | } 67 | 68 | void Reserve(size_t count) { stack_.template Reserve(count); } 69 | Ch* Push(size_t count) { return stack_.template Push(count); } 70 | Ch* PushUnsafe(size_t count) { return stack_.template PushUnsafe(count); } 71 | void Pop(size_t count) { stack_.template Pop(count); } 72 | 73 | const Ch* GetString() const { 74 | // Push and pop a null terminator. This is safe. 75 | *stack_.template Push() = '\0'; 76 | stack_.template Pop(1); 77 | 78 | return stack_.template Bottom(); 79 | } 80 | 81 | //! Get the size of string in bytes in the string buffer. 82 | size_t GetSize() const { return stack_.GetSize(); } 83 | 84 | //! Get the length of string in Ch in the string buffer. 85 | size_t GetLength() const { return stack_.GetSize() / sizeof(Ch); } 86 | 87 | static const size_t kDefaultCapacity = 256; 88 | mutable internal::Stack stack_; 89 | 90 | private: 91 | // Prohibit copy constructor & assignment operator. 92 | GenericStringBuffer(const GenericStringBuffer&); 93 | GenericStringBuffer& operator=(const GenericStringBuffer&); 94 | }; 95 | 96 | //! String buffer with UTF8 encoding 97 | typedef GenericStringBuffer > StringBuffer; 98 | 99 | template 100 | inline void PutReserve(GenericStringBuffer& stream, size_t count) { 101 | stream.Reserve(count); 102 | } 103 | 104 | template 105 | inline void PutUnsafe(GenericStringBuffer& stream, typename Encoding::Ch c) { 106 | stream.PutUnsafe(c); 107 | } 108 | 109 | //! Implement specialized version of PutN() with memset() for better performance. 110 | template<> 111 | inline void PutN(GenericStringBuffer >& stream, char c, size_t n) { 112 | std::memset(stream.stack_.Push(n), c, n * sizeof(c)); 113 | } 114 | 115 | RAPIDJSON_NAMESPACE_END 116 | 117 | #if defined(__clang__) 118 | RAPIDJSON_DIAG_POP 119 | #endif 120 | 121 | #endif // RAPIDJSON_STRINGBUFFER_H_ 122 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/imgui_bloom_src/opengl_imgui_bloom.h: -------------------------------------------------------------------------------- 1 | // opengl_imgui_bloom. 2 | // opengl_api glsl shader. By_RCSZ, 20240917. 3 | // imgui_for_opengl. processing: 4 | // filter => blur_h => blur_v => blend(out). 5 | 6 | #ifndef __OPENGL_IMGUI_BLOOM_H 7 | #define __OPENGL_IMGUI_BLOOM_H 8 | #include 9 | #include 10 | 11 | #include "imgui.h" 12 | #include "imgui_impl_opengl3.h" 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | 20 | // opengl preset shaders_script. 21 | namespace __SYSTEM_SCRIPT { 22 | extern const char* VertexShaderPublic; 23 | extern const char* FragmentShaderFilter; 24 | extern const char* FragmentShaderBlurXaxis; 25 | extern const char* FragmentShaderBlurYaxis; 26 | extern const char* FragmentShaderOut; 27 | } 28 | 29 | // imgui global_ui bloom fx. 30 | namespace BloomImGui { 31 | #define DEF_OPENGL_NULL_HANDLE 0 32 | 33 | void PRESET_ERR_PRINT(const std::string& err_info); 34 | 35 | struct RenderVertex { 36 | GLuint RenderVAO = DEF_OPENGL_NULL_HANDLE; 37 | GLuint RenderVBO = DEF_OPENGL_NULL_HANDLE; 38 | }; 39 | using OGL_INDEX_SHADER = GLuint; 40 | using OGL_INDEX_TXETURE = GLuint; 41 | using OGL_INDEX_FRAME = GLuint; 42 | 43 | class __ShaderCompileSystem { 44 | protected: 45 | std::string ContextErrorWhat = {}; 46 | bool ShaderCompilationStatus(const GLuint* shader, bool is_program_flag); 47 | }; 48 | 49 | struct FxFilterParams { 50 | float ColorRGBchannelsAvgFilter = 0.32f; 51 | 52 | std::array ColorMaxFilter = { 1.0f, 1.0f, 1.0f, 1.0f }; 53 | std::array ColorMinFilter = { 0.0f, 0.0f, 0.0f, 0.0f }; 54 | }; 55 | 56 | struct FxOutParams { 57 | float SourceFragmentBlend = 0.72f; 58 | float BlurFragmentBlend = 1.28f; 59 | 60 | std::array FragmentColorBlend = { 1.0f, 1.0f, 1.0f, 1.0f }; 61 | }; 62 | 63 | using ShaderCode = const std::string&; 64 | // texture_sampler res: "GL_TEXTURE31 0x84DF" { 31,30,29,28 } 65 | // version: 0.1A, vao&vbo: 1, shaders: 4, textures: 4, framebuffer: 4 66 | class FxBloomSystem :public __ShaderCompileSystem { 67 | private: 68 | std::function ERR_INFO_FUNC = {}; 69 | std::function IMGUI_API_NEWFRAME_FUNC = {}; 70 | protected: 71 | OGL_INDEX_SHADER FxProcessShaders[4] = {}; 72 | OGL_INDEX_FRAME FxProcessFrameBuffers[4] = {}; 73 | // texture mapping => texture_unit. 74 | // tex0: unit_31, tex1: unit_30, tex2: unit_29, tex3: uint_28. 75 | OGL_INDEX_TXETURE FxProcessTextures[4] = {}; 76 | 77 | RenderVertex FxRenderVertexRECT = {}; 78 | 79 | GLuint FXP_BloomBlurRadius = 8; 80 | FxFilterParams FXP_BloomSceneFilter = {}; 81 | FxOutParams FXP_BloomSceneOut = {}; 82 | 83 | bool CreateRenderVertex(RenderVertex* render_model); 84 | bool CreateRenderShaderProgram(OGL_INDEX_SHADER* render_shader, ShaderCode vert, ShaderCode frag); 85 | bool CreateRenderTexture(OGL_INDEX_TXETURE* render_texture, GLuint size_x, GLuint size_y); 86 | bool CreateRenderFrameBuffer(OGL_INDEX_FRAME* render_framebuffer, OGL_INDEX_FRAME bind_texture); 87 | 88 | void RenderDrawVertex(const RenderVertex& params); 89 | void RenderDrawTexture( 90 | const OGL_INDEX_SHADER& shader, const char* name, const OGL_INDEX_TXETURE& texture, GLuint sub_offset 91 | ); 92 | void RenderFrameBufferContextBegin(const OGL_INDEX_FRAME& frame_buffer); 93 | void RenderFrameBufferContextEnd(); 94 | 95 | void RenderUniformBlurRadius(const OGL_INDEX_SHADER& shader, GLuint radius); 96 | void RenderUniformFilterParams(const OGL_INDEX_SHADER& shader, const FxFilterParams& params); 97 | void RenderUniformOutParams(const OGL_INDEX_SHADER& shader, const FxOutParams& params); 98 | public: 99 | FxBloomSystem(GLuint win_x, GLuint win_y, std::function errinfo = PRESET_ERR_PRINT); 100 | ~FxBloomSystem(); 101 | 102 | // window api mapping function. 103 | void GetImGuiNewFrameFUNC(const std::function& function) { 104 | IMGUI_API_NEWFRAME_FUNC = function; 105 | } 106 | FxFilterParams* SettingFilterParams() { return &FXP_BloomSceneFilter; } 107 | FxOutParams* SettingBlendParams() { return &FXP_BloomSceneOut; } 108 | 109 | void SettingBloomRadius(uint32_t radius); 110 | 111 | void RenderContextCaptureBegin(); 112 | void RenderContextCaptureEnd(); 113 | }; 114 | } 115 | 116 | #endif 117 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/ExternalDepLibrary/imgui_bloom_src/opengl_imgui_bloom_script.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/ExternalDepLibrary/imgui_bloom_src/opengl_imgui_bloom_script.cpp -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorCore/NodesSystemCore/psag_nodes_system.hpp: -------------------------------------------------------------------------------- 1 | // psag_nodes_system. core define. RCSZ 2024_12_08. 2 | // update: 2024_12_08 [0042] 3 | 4 | #ifndef __PSAG_NODES_SYSTEM_HPP 5 | #define __PSAG_NODES_SYSTEM_HPP 6 | #include 7 | #include 8 | #include "psag_nodes_system_data.hpp" 9 | 10 | #include "imnodes.h" 11 | #include "imnodes_internal.h" 12 | 13 | // framework logger system. 14 | #include "../NodesSystemLogger/framework_logger.hpp" 15 | 16 | namespace PSAnodesSystem { 17 | StaticStrLABEL LABLogNodesSystem = "NODES_SYSTEM"; 18 | 19 | // nodes core template & entity dataset. 20 | class NodesDataComponentManager { 21 | protected: 22 | std::vector NodeTemplates = {}; 23 | std::vector NodeEntities = {}; 24 | 25 | std::unordered_map PointTypes = {}; 26 | std::unordered_map LinkLineEntities = {}; 27 | // node template vector index mapper, select temp. 28 | std::unordered_map NodeTempMapper = {}; 29 | 30 | std::string ProjectUniqueNAME = {}; 31 | }; 32 | 33 | using JsonConfig = rapidjson::Document; 34 | class SystemJsonConfigFileLoader { 35 | public: 36 | std::string SourceStringFileRead(const std::string& filepath, bool* status); 37 | JsonConfig SourceStringDecode(const std::string& config, bool* status); 38 | 39 | bool SourceStringFileWrite(const std::string& filepath, const std::string& str); 40 | }; 41 | 42 | using JsonConfigValue = const rapidjson::Value&; 43 | class SystemJsonConfigDEC { 44 | protected: 45 | // color channels rgba(array:4), rgba_integer. std: rgba8, hdr10. 46 | ImVec4 SelectArrayToColor(JsonConfigValue vaule); 47 | }; 48 | 49 | template 50 | struct UniqueGenerateCounter { 51 | T Counter = {}; 52 | T AllocUniqueID() { return ++Counter; } 53 | }; 54 | class NodesUniqueIDgenerate { 55 | protected: 56 | // points entity unique_id, points types unique_id. 57 | UniqueGenerateCounter PointsGenUid = {}; 58 | UniqueGenerateCounter PointTypesUid = {}; 59 | 60 | // nodes entity unique_id, nodes types unique_id. 61 | UniqueGenerateCounter NodesGenUid = {}; 62 | UniqueGenerateCounter NodeTypesUid = {}; 63 | 64 | UniqueGenerateCounter LinksUid = {}; 65 | }; 66 | 67 | using TEMP_CALLBACK = std::function; 68 | // nodes data operation: add, delete, find. 69 | class NodesDataOperation :public SystemJsonConfigDEC, 70 | public NodesDataComponentManager, public NodesUniqueIDgenerate { 71 | protected: 72 | // nodes templates oper: add, delete, find. 73 | bool NodeTemplateADD(const PSAnodesData::NodeAttributeTemplate& temp); 74 | bool NodeTemplateDEL(const NodeType& unique); 75 | PSAnodesData::NodeAttributeTemplate NodeTemplateFIND(const NodeType& unique); 76 | 77 | void TemplatesForEach(TEMP_CALLBACK function); 78 | 79 | // nodes entites oper: generate, delete, find. 80 | bool NodeEntityGEN( 81 | const PSAnodesData::NodeAttributeTemplate& temp, const ImVec2& position, 82 | NodeUid uid = PSAG_SYSTEM_ALLOC_UID 83 | ); 84 | bool NodeEntityDEL(const NodeUid& unique); 85 | PSAnodesData::NodeAttributeEntity* NodeEntityFIND(const NodeUid& unique); 86 | 87 | // 2-calls: add load point types. 88 | bool SystemInitPointTypesLoad(JsonConfig config); 89 | // 2-calls: refresh load node types. clear => reload. 90 | bool SystemInitNodeTypesLoad(JsonConfig config); 91 | 92 | void SaveDatasetToEntites( 93 | const std::vector& data_nodes, 94 | const std::vector& data_lines 95 | ); 96 | 97 | void PointsEntityLink(PointUid p_begin, PointUid p_end); 98 | void PointsEntityLinkMonitor(); 99 | // return flag: false: map empty. 100 | bool NodesPointsEntityDelete(); 101 | }; 102 | } 103 | 104 | namespace PSAnodesFiletool { 105 | StaticStrLABEL LABLogNodesFILETOOL = "NODES_FILESYS"; 106 | 107 | // directory(lv1) iterator(filter) files. 108 | bool ForEachDirectoryFile( 109 | const std::string& directory_path, const std::string& file_filter, 110 | const std::function& callback 111 | ); 112 | // safe filepath loader(assemble). 113 | std::string FilepathAssemble( 114 | const std::string& directory, 115 | const std::string& name, 116 | const std::string& extension 117 | ); 118 | bool DeleteFile(const std::string& filepath); 119 | } 120 | 121 | namespace PSAnodesConvert { 122 | StaticStrLABEL LABLogNodesPROJ = "NODES_PROJECT"; 123 | 124 | // return string data empty ? warning. 125 | std::string ExportProjectData( 126 | const PSAnodesData::ExportNodesSource& data, const std::string& u_name 127 | ); 128 | bool ProjectDataLoader( 129 | const std::string& sstr_data, 130 | const std::string& u_name, 131 | std::vector* ptr_nodes, 132 | std::vector* ptr_lines, 133 | // reset alloter counter value. 134 | PSAnodesSystem::UniqueGenerateCounter* n_alloter, 135 | PSAnodesSystem::UniqueGenerateCounter* p_alloter 136 | ); 137 | } 138 | 139 | namespace PSAnodesEncode { 140 | StaticStrLABEL LABLogNodesEncode = "NODES_ENCODE"; 141 | // pomelo_star_studio node_editor encoder pointer to function. 142 | typedef std::string(*PSAencoderPFN)(const PSAnodesData::ExportNodesSource&); 143 | 144 | std::string PSAN_ENCODE_V101A(const PSAnodesData::ExportNodesSource& data); 145 | } 146 | 147 | using NodeTempsPtr = std::vector*; 148 | using NodeEntisPtr = std::vector*; 149 | 150 | namespace PSAnodesRender { 151 | StaticStrLABEL LABLogNodesEditor = "NODES_EDITOR"; 152 | 153 | #define PROJECT_SAVE_FOLDER_LENGTH 1024 154 | class NodesEditorProject { 155 | protected: 156 | // params pair: f: file_path, s: project_name. 157 | std::vector> ProjectPaths = {}; 158 | 159 | std::string ProjectSaveFolder = {}; 160 | std::string ProjectSaveName = {}; 161 | 162 | char ProjectSaveFolderTemp[PROJECT_SAVE_FOLDER_LENGTH] = {}; 163 | char ProjectSaveNameTemp [PROJECT_SAVE_FOLDER_LENGTH] = {}; 164 | 165 | std::pair ProjectCurrentPath = {}; 166 | 167 | void RefashPathsData(); 168 | 169 | ImVec2 StatusScroMouseMenu = {}; 170 | ImVec2 StatusScroToolbar = {}; 171 | public: 172 | NodesEditorProject() { 173 | ProjectSaveName = "default"; 174 | memcpy(ProjectSaveNameTemp, ProjectSaveName.data(), ProjectSaveName.size()); 175 | } 176 | }; 177 | 178 | class NodesEditorStatus { 179 | protected: 180 | float GetFramerateTimeStep(); 181 | 182 | bool EditorStatusFlagMutexButton = false; 183 | bool EditorStatusFlagOperation = false; 184 | 185 | ImVec4 STATUS_FLAG_COLOR(bool flag); 186 | 187 | float RUN_CYCLES_COUNT = 0.0f; 188 | ImVec4 RUN_STATUS_CYCLES(); 189 | }; 190 | 191 | class NodesEditorRender : 192 | public NodesEditorProject, public NodesEditorStatus, 193 | public PSAnodesSystem::NodesDataOperation 194 | { 195 | protected: 196 | float WindowPropTitlebar = 0.04f; 197 | float WindowPropToolbar = 0.18f; 198 | 199 | std::string TitlebarLogMsg = {}; 200 | void SetTitlebarText(const std::string& text) { 201 | TitlebarLogMsg = text; 202 | } 203 | NodeUid ImNodesHoverUniqueNode = {}; 204 | LinkUid ImNnodeHoverUniqueLine = {}; 205 | 206 | bool MouseMenuOpenFlag = false; 207 | // mouse_menu: im_window, toolbar: non_window. 208 | void DrawEditorComponentMouseMenu(const ImVec2& size); 209 | void DrawEditorComponentToolbar(); 210 | 211 | void DrawCoreNodesLines(); 212 | public: 213 | NodesEditorRender(const std::string& f_aribs, const std::string& f_types); 214 | ~NodesEditorRender(); 215 | 216 | // set default search folder path. 217 | void NEP_SettingDefaultFolder(const std::string& path) { 218 | ProjectSaveFolder = path; 219 | memcpy(ProjectSaveFolderTemp, path.data(), path.size()); 220 | RefashPathsData(); 221 | } 222 | // set default save project name. 223 | void NEP_SettingDefaultName(const std::string& name) { 224 | ProjectSaveName = name; 225 | memcpy(ProjectSaveNameTemp, name.data(), name.size()); 226 | RefashPathsData(); 227 | } 228 | 229 | std::string NDC_GetProjectName() { return ProjectUniqueNAME; } 230 | NodeTempsPtr NDC_GetNodeTemplates() { return &NodeTemplates; } 231 | NodeEntisPtr NDC_GetNodeEntities() { return &NodeEntities; } 232 | 233 | std::string ENC_ExportCurrentData(PSAnodesEncode::PSAencoderPFN funcptr); 234 | 235 | // rendering loop: frame event. 236 | void DrawEditorWindowFrame( 237 | const ImVec2& size, 238 | bool fixed = true, 239 | ImGuiWindowFlags flags = NULL 240 | ); 241 | }; 242 | } 243 | 244 | #endif 245 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorCore/NodesSystemCore/psag_nodes_system_data.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/NodesEditorCore/NodesSystemCore/psag_nodes_system_data.hpp -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorCore/NodesSystemCore/psag_nodes_system_encode.cpp: -------------------------------------------------------------------------------- 1 | // psag_nodes_system_encode. 2 | #include 3 | #include "psag_nodes_system.hpp" 4 | 5 | using namespace std; 6 | using namespace PSAG_LOGGER; 7 | 8 | namespace PSAnodesEncode { 9 | #define V1PENC_LABLE_NODEENDFLAG "node_params_end" 10 | #define V1PENC_LABLE_NODELINK "node_link" 11 | 12 | #define V1PENC_LABLE_TYPE "tid" 13 | #define V1PENC_LABLE_EUID "uid" 14 | #define V1PENC_LABLE_NAME "name" 15 | 16 | #define V1PENC_LABLE_PIN "point_i" 17 | #define V1PENC_LABLE_POUT "point_o" 18 | 19 | string PSAN_ENCODE_V101A(const PSAnodesData::ExportNodesSource& data) { 20 | if (data.NodesData.empty() && data.LinesData.empty()) 21 | PushLogger(LogWarning, LABLogNodesEncode, "encode nodes data empty."); 22 | 23 | stringstream ISSdata = {}; 24 | 25 | // node entites data => stream. 26 | for (size_t i = 0; i < data.NodesData.size(); ++i) { 27 | 28 | ISSdata << V1PENC_LABLE_NAME << " " << data.NodesData[i].NodeTitle << endl; 29 | ISSdata << V1PENC_LABLE_TYPE << " " << data.NodesData[i].NodeType.NodeUniqueID << endl; 30 | ISSdata << V1PENC_LABLE_EUID << " " << data.NodesData[i].NodeUnique << endl; 31 | 32 | for (size_t j = 0; j < data.NodesData[i].InputPoints.size(); ++j) { 33 | ISSdata << V1PENC_LABLE_PIN << " " 34 | << data.NodesData[i].InputPoints[j].PointUnique << " " 35 | << data.NodesData[i].InputPoints[j].PointText 36 | << endl; 37 | } 38 | 39 | for (size_t j = 0; j < data.NodesData[i].OutputPoints.size(); ++j) { 40 | ISSdata << V1PENC_LABLE_POUT << " " 41 | << data.NodesData[i].OutputPoints[j].PointUnique << " " 42 | << data.NodesData[i].OutputPoints[j].PointText 43 | << endl; 44 | } 45 | ISSdata << V1PENC_LABLE_NODEENDFLAG << endl; 46 | } 47 | // line entities data => stream. 48 | for (const auto& Line : data.LinesData) 49 | ISSdata << V1PENC_LABLE_NODELINK << " " << Line.second.LinePointBegin << " " << Line.second.LinePointEnd << endl; 50 | 51 | PushLogger( 52 | LogInfo, LABLogNodesEncode, "encode nodes data stream_string: %u bytes", 53 | ISSdata.str().size() 54 | ); 55 | PushLogger(LogInfo, LABLogNodesEncode, "encoder version 1.01 ahpla."); 56 | return ISSdata.str(); 57 | } 58 | } 59 | 60 | namespace PSAnodesRender { 61 | string NodesEditorRender::ENC_ExportCurrentData(PSAnodesEncode::PSAencoderPFN funcptr) { 62 | PSAnodesData::ExportNodesSource DataTemp = {}; 63 | DataTemp.NodesData = NodeEntities; 64 | DataTemp.LinesData = LinkLineEntities; 65 | return funcptr(DataTemp); 66 | } 67 | } -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorCore/NodesSystemCore/psag_nodes_system_file.cpp: -------------------------------------------------------------------------------- 1 | // psag_nodes_system_file. 2 | #include 3 | #include "psag_nodes_system.hpp" 4 | 5 | using namespace std; 6 | using namespace PSAG_LOGGER; 7 | 8 | namespace PSAnodesFiletool { 9 | 10 | bool ForEachDirectoryFile( 11 | const string& directory_path, const string& file_filter, 12 | const function& callback 13 | ) { 14 | if (!filesystem::exists(directory_path) || !filesystem::is_directory(directory_path)) { 15 | PushLogger(LogError, LABLogNodesFILETOOL, "directory path invalid."); 16 | return PSAG_SYSTEM_FAILED; 17 | } 18 | for (const auto& Entry : filesystem::directory_iterator(directory_path)) { 19 | if (filesystem::is_regular_file(Entry.status())) { 20 | // filesystem path params. 21 | const string PathFull = Entry.path().string(); 22 | const string PathFileName = Entry.path().stem().string(); 23 | 24 | // check file extension filter. 25 | if (file_filter.empty() || Entry.path().extension() == file_filter) 26 | callback(PathFull, PathFileName); 27 | } 28 | } 29 | return PSAG_SYSTEM_SUCCESS; 30 | } 31 | 32 | string FilepathAssemble( 33 | const string& directory, const string& name, const string& extension 34 | ) { 35 | // check directory name empty ? 36 | if (directory.empty() || name.empty()) 37 | return string(); 38 | 39 | filesystem::path DirectoryPath(directory); 40 | filesystem::path FileName(name); 41 | filesystem::path ExtensionFile(extension); 42 | 43 | // normalize extension. 44 | if (!extension.empty() && extension.front() != '.') 45 | ExtensionFile = "." + ExtensionFile.string(); 46 | // path: folder + name + exten. 47 | return (DirectoryPath / (FileName += ExtensionFile)).string(); 48 | } 49 | 50 | bool DeleteFile(const string& filepath) { 51 | if (!filesystem::exists(filepath)) return PSAG_SYSTEM_FAILED; 52 | // delete file. 53 | filesystem::remove(filepath); 54 | return PSAG_SYSTEM_SUCCESS; 55 | } 56 | } -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorCore/NodesSystemCore/psag_nodes_system_loader.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/NodesEditorCore/NodesSystemCore/psag_nodes_system_loader.cpp -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorCore/NodesSystemCore/psag_nodes_system_operation.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/NodesEditorCore/NodesSystemCore/psag_nodes_system_operation.cpp -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorCore/NodesSystemCore/psag_nodes_system_render.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/NodesEditorCore/NodesSystemCore/psag_nodes_system_render.cpp -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorCore/NodesSystemLogger/framework_logger.cpp: -------------------------------------------------------------------------------- 1 | // framework_logger. 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | 9 | #include "framework_logger.hpp" 10 | 11 | using namespace std; 12 | namespace PRLC = PSAG_LOGGER::ReadLogCache; 13 | 14 | mutex LogMutex = {}; 15 | queue LogWriteQueue = {}; 16 | 17 | vector GLOBAL_LOG_CACHE = {}; 18 | size_t LogWarringLines = NULL, LogErrorLines = NULL; 19 | 20 | #include 21 | // time [xxxx.xx.xx.xx:xx:xx:xx ms]. 22 | string __get_timestamp(const chrono::system_clock::time_point& time_point) { 23 | auto timemillisecond = chrono::duration_cast(time_point.time_since_epoch()) % 1000; 24 | auto t = chrono::system_clock::to_time_t(time_point); 25 | tm _time = {}; 26 | #ifdef _WIN32 27 | localtime_s(&_time, &t); 28 | #else 29 | localtime_r(&t, &_time); 30 | #endif 31 | stringstream _sstream; 32 | _sstream << put_time(&_time, "[%Y.%m.%d %H:%M:%S") << " " << setfill('0') << setw(3) << timemillisecond.count() << " ms]"; 33 | // windows / linux time stamp. 34 | return _sstream.str(); 35 | } 36 | 37 | string FMT_TIME_STAMP(const chrono::system_clock::time_point& time_point) { 38 | return __get_timestamp(time_point); 39 | } 40 | 41 | // global const hashlable. 42 | const std::unordered_map HashLogLable = { 43 | {LogError, "\033[31m"}, 44 | {LogWarning, "\033[33m"}, 45 | {LogInfo, "\033[90m"}, 46 | {LogTrace, "\033[96m"}, 47 | {LogPerfmac, "\033[35m"} 48 | }; 49 | 50 | string FMT_NUMBER_FILLZERO(uint32_t number, int32_t digits) { 51 | // format: %xd. 52 | string ResultTemp = to_string(number); 53 | // fill_number zero. 54 | while (ResultTemp.length() < digits) { 55 | ResultTemp = "0" + ResultTemp; 56 | } 57 | return ResultTemp; 58 | } 59 | 60 | namespace PSAG_LOGGER { 61 | #include 62 | #include 63 | bool LOG_PRINT_SWITCH = true; 64 | 65 | void PushLogProcess(const LOGLABEL& label, const std::string& module_name, const std::string& logstr_text) { 66 | unique_lock LogThreadLock(LogMutex); 67 | 68 | if (label & LogWarning) { LogWarringLines++; }; 69 | if (label & LogError) { LogErrorLines++; }; 70 | 71 | const char* LogLabelTemp = "[NULL]"; 72 | switch (label) { 73 | case(LogError): { LogLabelTemp = "[ERROR]"; break; } 74 | case(LogWarning): { LogLabelTemp = "[WARNING]"; break; } 75 | case(LogInfo): { LogLabelTemp = "[INFO]"; break; } 76 | case(LogTrace): { LogLabelTemp = "[TRACE]"; break; } 77 | case(LogPerfmac): { LogLabelTemp = "[PERF]"; break; } 78 | } 79 | 80 | string FmtModuleName = "[" + module_name + "]: "; 81 | string FmtLog = __get_timestamp(chrono::system_clock::now()) + ":" + LogLabelTemp + ":" + FmtModuleName + logstr_text; 82 | 83 | // => read logger chache & logger process(print). 84 | GLOBAL_LOG_CACHE.push_back(PRLC::LogCache(FmtLog, module_name, label)); 85 | LogWriteQueue.push(PRLC::LogCache(FmtLog, module_name, label)); 86 | } 87 | 88 | #define LOGGER_BUFFER_LEN 2048 89 | void PushLogger(const LOGLABEL& label, const char* module_label, const char* log_text, ...) { 90 | #if PSAG_DEBUG_MODE 91 | char LoggerStrTemp[LOGGER_BUFFER_LEN] = {}; 92 | 93 | va_list ParamArgs; 94 | va_start(ParamArgs, log_text); 95 | vsnprintf(LoggerStrTemp, LOGGER_BUFFER_LEN, log_text, ParamArgs); 96 | va_end(ParamArgs); 97 | 98 | PushLogProcess(label, (string)module_label, LoggerStrTemp); 99 | #endif 100 | } 101 | 102 | void SET_PRINTLOG_STATE(bool status_flag) { 103 | unique_lock LogThreadLock(LogMutex); 104 | LOG_PRINT_SWITCH = status_flag; 105 | }; 106 | 107 | Vector3T LogLinesStatistics() { 108 | Vector3T ReturnValue = {}; 109 | { 110 | unique_lock LogThreadLock(LogMutex); 111 | 112 | ReturnValue.vector_x = GLOBAL_LOG_CACHE.size(); // total lines. 113 | ReturnValue.vector_y = LogWarringLines; // warning lines. 114 | ReturnValue.vector_z = LogErrorLines; // error lines. 115 | } 116 | return ReturnValue; 117 | } 118 | 119 | namespace ReadLogCache { 120 | vector ExtractLogSegment(const uint32_t& lines) { 121 | vector ReturnLogCache = {}; 122 | { 123 | size_t RetLinesCount = 124 | ((int64_t)GLOBAL_LOG_CACHE.size() - lines - 1) >= 0 ? 125 | ((int64_t)GLOBAL_LOG_CACHE.size() - lines - 1) : 0; 126 | 127 | unique_lock LogThreadLock(LogMutex); 128 | for (size_t i = RetLinesCount; i < GLOBAL_LOG_CACHE.size(); ++i) 129 | ReturnLogCache.push_back(GLOBAL_LOG_CACHE[i]); 130 | } 131 | return ReturnLogCache; 132 | } 133 | } 134 | 135 | size_t GetTimeCountNow() { 136 | return (size_t)chrono::duration_cast 137 | ( 138 | chrono::steady_clock::now().time_since_epoch() 139 | ).count(); 140 | } 141 | } 142 | 143 | #define LOGFILE_EXTENSION ".log" 144 | namespace PSAG_LOGGER_PROCESS { 145 | 146 | thread* LogProcessThread = {}; 147 | bool LogProcessFlag = true; 148 | 149 | void logprocess_write_file_eventloop(const char* folder) { 150 | // create name: folder + name(time) + ext. 151 | string LogFileName = 152 | folder + 153 | to_string(chrono::duration_cast(chrono::steady_clock::now().time_since_epoch()).count()) + 154 | LOGFILE_EXTENSION; 155 | 156 | fstream WriteLogFile(LogFileName, ios::out | ios::app); 157 | PSAG_LOGGER::PushLogger(LogInfo, PSAG_LOGGER_LABEL, "create log_file: %s", LogFileName.c_str()); 158 | 159 | while (LogProcessFlag) { 160 | unique_lock LogThreadLock(LogMutex); 161 | 162 | while (!LogWriteQueue.empty()) { 163 | const PRLC::LogCache& LogMsgTemp = LogWriteQueue.front(); 164 | 165 | WriteLogFile << LogMsgTemp.LogString << endl; 166 | // print. 167 | #if PSAG_DEBUG_MODE 168 | auto FindLevelColor = HashLogLable.find(LogMsgTemp.LogLabel); 169 | if (FindLevelColor != HashLogLable.end() && PSAG_LOGGER::LOG_PRINT_SWITCH) 170 | cout << FindLevelColor->second << LogMsgTemp.LogString << " \033[0m" << endl; 171 | #endif 172 | // delete logmsg_item. 173 | LogWriteQueue.pop(); 174 | } 175 | } 176 | WriteLogFile.close(); 177 | } 178 | 179 | bool StartLogProcessing(const char* folder) { 180 | // check folder_path valid ? 181 | if (!filesystem::exists(folder) || !filesystem::is_directory(folder)) { 182 | PSAG_LOGGER::PushLogger(LogError, PSAG_LOGGER_LABEL, "invalid folder: %s", folder); 183 | return false; 184 | } 185 | // init logger_thread. 186 | try { 187 | LogProcessThread = new thread(logprocess_write_file_eventloop, folder); 188 | PSAG_LOGGER::PushLogger(LogInfo, PSAG_LOGGER_LABEL, "start thread success."); 189 | } 190 | catch (const exception& err) { 191 | PSAG_LOGGER::PushLogger(LogError, PSAG_LOGGER_LABEL, "start thread error: %s", err.what()); 192 | return false; 193 | } 194 | return true; 195 | } 196 | 197 | bool FreeLogProcessing() { 198 | LogProcessFlag = false; 199 | try { 200 | // set_flag => join_thread. 201 | LogProcessThread->join(); 202 | PSAG_LOGGER::PushLogger(LogInfo, PSAG_LOGGER_LABEL, "free thread success."); 203 | } 204 | catch (const exception& err) { 205 | PSAG_LOGGER::PushLogger(LogError, PSAG_LOGGER_LABEL, "free thread error: %s", err.what()); 206 | return false; 207 | } 208 | return true; 209 | } 210 | } 211 | 212 | std::atomic PSAG_SYS_GENERATE_KEY::UniqueCodeCountTemp = NULL; 213 | 214 | size_t PSAG_SYS_GENERATE_KEY::TimeCountBuffer = {}; 215 | std::mutex PSAG_SYS_GENERATE_KEY::TimeCountBufferMutex = {}; -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorCore/NodesSystemLogger/framework_logger.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/NodesEditorCore/NodesSystemLogger/framework_logger.hpp -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorCore/psag_nodes_editor.cpp: -------------------------------------------------------------------------------- 1 | // psag_nodes_editor. 2 | #include "psag_nodes_editor.h" 3 | 4 | using namespace std; 5 | 6 | bool EditorRunDrawImpl::EditorCoreEventInit(const string& attrib_cfg, const string& types_cfg) { 7 | 8 | NodesEditor = new PSAnodesRender::NodesEditorRender(attrib_cfg, types_cfg); 9 | 10 | NodesEditor->NEP_SettingDefaultFolder("NodesEditorResource/SystemProject/"); 11 | 12 | return true; 13 | } 14 | 15 | void EditorRunDrawImpl::EditorCoreEventFrame() { 16 | 17 | NodesEditor->DrawEditorWindowFrame(ImGui::GetIO().DisplaySize, true); 18 | 19 | if (ImGui::IsKeyDown(ImGuiKey_E)) 20 | cout << NodesEditor->ENC_ExportCurrentData(PSAnodesEncode::PSAN_ENCODE_V101A) << endl; 21 | } 22 | 23 | void EditorRunDrawImpl::EditorCoreEventDestroy() { 24 | delete NodesEditor; 25 | } -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorCore/psag_nodes_editor.h: -------------------------------------------------------------------------------- 1 | // psag_nodes_editor. include: windows 'DWM' api. 2 | // warning: windows platform. 3 | 4 | #ifndef __PSAG_NODES_EDITOR_H 5 | #define __PSAG_NODES_EDITOR_H 6 | #include 7 | #include "NodesSystemLogger/framework_logger.hpp" 8 | 9 | #include 10 | #include 11 | #include 12 | #define GLFW_EXPOSE_NATIVE_WIN32 13 | #include 14 | 15 | #include "imgui.h" 16 | #include "imgui_impl_glfw.h" 17 | #include "imgui_impl_opengl3.h" 18 | 19 | #if defined(_MSV_VER) && (_MSC_VER >= 1900) && !defined(IMGUI_DISABLE_WIN32_FUNCTIONS) 20 | #pragma comment(lib,"legacy_stdio_definitons.lib") 21 | #endif 22 | 23 | #include 24 | 25 | #define PSAG_EDITOR_PATHNAME "system_editor_config.json" 26 | 27 | #define PSAG_NODES_PATHNAME_ATTRIB "nodes_config_attributes.json" 28 | #define PSAG_NODES_PATHNAME_TYPES "nodes_config_types.json" 29 | 30 | class EditorRunInterface { 31 | public: 32 | virtual bool EditorCoreEventInit(const std::string& attrib_cfg, const std::string& types_cfg) = 0; 33 | virtual void EditorCoreEventFrame() = 0; 34 | virtual void EditorCoreEventDestroy() = 0; 35 | }; 36 | 37 | namespace SystemResource { 38 | StaticStrLABEL LABLogSystemResource = "SYSTEM_RESOURCE"; 39 | 40 | #define PSAG_SHADER_VERSION "#version 330 core" 41 | class SystemRenderStarter { 42 | private: 43 | EditorRunInterface* RUN_OBJECT = nullptr; 44 | protected: 45 | std::filesystem::path SystemConfigFolder = {}; 46 | 47 | GLFWwindow* WindowObject = nullptr; 48 | ImVec2 WindowSize = {}; 49 | std::string WindowFontFile = {}; 50 | float WindowFontSize = 1.0f; 51 | 52 | rapidjson::Document JsonLoader(const std::string& filename); 53 | 54 | bool CreateGraphicsContext(); 55 | bool CreateImGuiContext(const char* version); 56 | 57 | std::string Filepaths[2] = {}; 58 | public: 59 | SystemRenderStarter(const std::string& folder); 60 | ~SystemRenderStarter(); 61 | 62 | // warning: alloc memory => heap. 63 | bool SettingRunEventEntity(EditorRunInterface* object); 64 | void RunRenderSystem(); 65 | }; 66 | } 67 | 68 | #include "NodesSystemCore/psag_nodes_system.hpp" 69 | 70 | class EditorRunDrawImpl :public EditorRunInterface { 71 | protected: 72 | PSAnodesRender::NodesEditorRender* NodesEditor = nullptr; 73 | public: 74 | bool EditorCoreEventInit(const std::string& attrib_cfg, const std::string& types_cfg); 75 | void EditorCoreEventFrame(); 76 | void EditorCoreEventDestroy(); 77 | }; 78 | 79 | #ifdef ENABLE_WINDOWS_BLUR_API 80 | bool EnableWindowsBlur(HWND hwnd); 81 | void EnableWindowsTransparency(HWND hwnd); 82 | #endif 83 | 84 | #endif -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorCore/psag_nodes_editor_blur.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/NodesEditorCore/psag_nodes_editor_blur.cpp -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorCore/psag_nodes_editor_init.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/NodesEditorCore/psag_nodes_editor_init.cpp -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorResource/JetBrainsMonoBoldItalic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/PSAGameNodesEditor/NodesEditorResource/JetBrainsMonoBoldItalic.ttf -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorResource/SystemConfig/nodes_config_attributes.json: -------------------------------------------------------------------------------- 1 | { 2 | "ProjectUniqueName": "PSA_SYSTEM_TEST_PORJ", 3 | "Test.A": { 4 | "Version": 10020241210, 5 | "Color": [ 100, 0, 168, 255 ], 6 | "Width": 180.0, 7 | "InputPoints": [ "Float32", "Int32", "Int32" ], 8 | "OutputPoints": [ "Int32", "Double" ] 9 | }, 10 | "Test.B": { 11 | "Version": 10020241210, 12 | "Color": [ 122, 140, 0, 255 ], 13 | "Width": 220.0, 14 | "InputPoints": [ "Float32", "Int32", "Byte", "Double" ], 15 | "OutputPoints": [ "Int32", "Double", "Matrix" ] 16 | }, 17 | "Test.C": { 18 | "Version": 10020241210, 19 | "Color": [ 0, 104, 156, 255 ], 20 | "Width": 220.0, 21 | "InputPoints": [ "Float32", "Float32", "Int32" ], 22 | "OutputPoints": [ "Int32", "Byte", "Matrix", "Matrix" ] 23 | }, 24 | "Test.D": { 25 | "Version": 10020241210, 26 | "Color": [ 0, 158, 96, 255 ], 27 | "Width": 180.0, 28 | "InputPoints": [ "String", "Matrix" ], 29 | "OutputPoints": [ "Float32", "Float32" ] 30 | }, 31 | "Test.E": { 32 | "Version": 10020241210, 33 | "Color": [ 138, 80, 0, 255 ], 34 | "Width": 180.0, 35 | "InputPoints": [ "Float32", "Int32" ], 36 | "OutputPoints": [ "Int32", "Float32" ] 37 | }, 38 | "Test.F": { 39 | "Version": 10020241210, 40 | "Color": [ 138, 80, 0, 255 ], 41 | "Width": 180.0, 42 | "InputPoints": [ "Int32", "Float32" ], 43 | "OutputPoints": [ "Float32", "Int32" ] 44 | }, 45 | "Test.Component.IN": { 46 | "Version": 10020241210, 47 | "Color": [ 160, 24, 0, 255 ], 48 | "Width": 200.0, 49 | "InputPoints": [], 50 | "OutputPoints": [ "Float32", "Float32", "String" ] 51 | }, 52 | "Test.Component.OUT": { 53 | "Version": 10020241210, 54 | "Color": [ 160, 24, 0, 255 ], 55 | "Width": 200.0, 56 | "InputPoints": [ "Matrix", "Matrix", "Float32" ], 57 | "OutputPoints": [] 58 | } 59 | } -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorResource/SystemConfig/nodes_config_types.json: -------------------------------------------------------------------------------- 1 | { 2 | "Float32": [ 122, 224, 0, 255 ], 3 | "Int32": [ 0, 168, 222, 255 ], 4 | "Double": [ 158, 196, 0, 255 ], 5 | "Byte": [ 204, 116, 0, 255 ], 6 | "String": [ 132, 0, 232, 255 ], 7 | "Matrix": [ 194, 0, 108, 255 ] 8 | } -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorResource/SystemConfig/system_editor_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "WindowSize": [ 1880, 990 ], 3 | "WindowBorder": true, 4 | "WindowTitle": "PSAGame NodesEditor Alpha", 5 | "WindowMSAA": 4, 6 | "WindowAsync": true, 7 | "ImGuiFont": "NodesEditorResource/JetBrainsMonoBoldItalic.ttf", 8 | "ImGuiFontSize": 28.0 9 | } -------------------------------------------------------------------------------- /PSAGameNodesEditor/NodesEditorResource/SystemProject/SystemNodesTest.psanodes: -------------------------------------------------------------------------------- 1 | proj_u_name PSA_SYSTEM_TEST_PORJ 2 | tid 1 3 | uid 1 4 | pos 406 71 5 | point_i 1 6 | point_i 2 7 | point_i 3 8 | point_o 4 9 | point_o 5 10 | node_params_end 11 | tid 7 12 | uid 2 13 | pos 93 146 14 | point_o 6 15 | point_o 7 16 | point_o 8 17 | node_params_end 18 | tid 2 19 | uid 3 20 | pos 673 260 21 | point_i 9 22 | point_i 10 23 | point_i 11 24 | point_i 12 25 | point_o 13 26 | point_o 14 27 | point_o 15 28 | node_params_end 29 | tid 3 30 | uid 4 31 | pos 676 450 32 | point_i 16 33 | point_i 17 34 | point_i 18 35 | point_o 19 36 | point_o 20 37 | point_o 21 38 | point_o 22 39 | node_params_end 40 | tid 4 41 | uid 7 42 | pos 395 367 43 | point_i 33 44 | point_i 34 45 | point_o 35 46 | point_o 36 47 | node_params_end 48 | tid 5 49 | uid 8 50 | pos 702 -8 51 | point_i 37 52 | point_i 38 53 | point_o 39 54 | point_o 40 55 | node_params_end 56 | tid 6 57 | uid 10 58 | pos 701 121 59 | point_i 45 60 | point_i 46 61 | point_o 47 62 | point_o 48 63 | node_params_end 64 | tid 2 65 | uid 11 66 | pos 1015 -10 67 | point_i 49 68 | point_i 50 69 | point_i 51 70 | point_i 52 71 | point_o 53 72 | point_o 54 73 | point_o 55 74 | node_params_end 75 | tid 8 76 | uid 14 77 | pos 1046 504 78 | point_i 65 79 | point_i 66 80 | point_i 67 81 | node_params_end 82 | tid 8 83 | uid 15 84 | pos 1359 42 85 | point_i 68 86 | point_i 69 87 | point_i 70 88 | node_params_end 89 | tid 3 90 | uid 16 91 | pos 1043 196 92 | point_i 71 93 | point_i 72 94 | point_i 73 95 | point_o 74 96 | point_o 75 97 | point_o 76 98 | point_o 77 99 | node_params_end 100 | tid 1 101 | uid 18 102 | pos 1364 203 103 | point_i 82 104 | point_i 83 105 | point_i 84 106 | point_o 85 107 | point_o 86 108 | node_params_end 109 | tid 6 110 | uid 19 111 | pos 1047 376 112 | point_i 87 113 | point_i 88 114 | point_o 89 115 | point_o 90 116 | node_params_end 117 | tid 7 118 | uid 20 119 | pos -174 354 120 | point_o 91 121 | point_o 92 122 | point_o 93 123 | node_params_end 124 | tid 5 125 | uid 21 126 | pos 105 301 127 | point_i 94 128 | point_i 95 129 | point_o 96 130 | point_o 97 131 | node_params_end 132 | tid 5 133 | uid 22 134 | pos 106 428 135 | point_i 98 136 | point_i 99 137 | point_o 100 138 | point_o 101 139 | node_params_end 140 | line 4 38 141 | line 6 1 142 | line 8 33 143 | line 35 9 144 | line 47 49 145 | line 36 17 146 | line 4 45 147 | line 48 50 148 | line 22 66 149 | line 15 65 150 | line 40 67 151 | line 55 68 152 | line 15 69 153 | line 39 73 154 | line 40 72 155 | line 47 71 156 | line 53 83 157 | line 74 84 158 | line 89 82 159 | line 13 87 160 | line 91 94 161 | line 96 2 162 | line 92 98 163 | line 100 3 164 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/PSAGameNodesEditor.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * PSAGameNodesEditor.RCSZ 2024_12_07. 3 | * @pomelo_star studio game(framework), nodes editor. 4 | * Ext.Library: OpenGL3, GLFW, GLEW, STB_IMAGE, ImGui, ImNodes, RapidJSON. 5 | * Editor: For Windows10-11, version: 0.1.2 alpha 20241207. 6 | * Dev: VisualStudio2022, MSVC Debug x64 C11/C++17. 7 | * 外部依赖自写模块: 8 | * Editor Bloom FX : https://github.com/rcszc/OGL-ImGui-BloomEXT.git 9 | * Editor Logger : https://github.com/rcszc/PSAGame2D/tree/master/PSAGameFramework/PSAGameFrameworkCore/LLLogger 10 | */ 11 | 12 | #include 13 | 14 | #pragma comment(lib, "opengl32.lib") 15 | #pragma comment(lib, "glfw3.lib" ) 16 | #pragma comment(lib, "glew32.lib" ) 17 | 18 | #include "NodesEditorCore/psag_nodes_editor.h" 19 | 20 | using namespace std; 21 | 22 | int main() { 23 | PSAG_LOGGER_PROCESS::StartLogProcessing("NodesEditorResource/SystemLogs/"); 24 | PSAG_LOGGER::PushLogger(LogTrace, "MAIN", "logger system start."); 25 | { 26 | SystemResource::SystemRenderStarter EditorFramework("NodesEditorResource/SystemConfig/"); 27 | EditorRunDrawImpl* EditorRunDraw = new EditorRunDrawImpl(); 28 | 29 | EditorFramework.SettingRunEventEntity(EditorRunDraw); 30 | EditorFramework.RunRenderSystem(); 31 | } 32 | PSAG_LOGGER_PROCESS::FreeLogProcessing(); 33 | return NULL; 34 | } -------------------------------------------------------------------------------- /PSAGameNodesEditor/PSAGameNodesEditor.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {ab76d33a-a56f-45c2-88ed-05e740690ab4} 18 | 19 | 20 | {d464a484-c5bd-4756-8bbe-80d68152d2a9} 21 | 22 | 23 | {301c31f7-9934-4959-8d18-98a7861a555c} 24 | 25 | 26 | {e81bf287-e27f-4ee0-9113-e0fca004f317} 27 | 28 | 29 | {b21a49d7-5c12-44fe-b739-994b0abe4430} 30 | 31 | 32 | {87ec9c9d-b885-4f40-ae70-b589bb3e9807} 33 | 34 | 35 | {83d01b5b-fffb-4ca4-8731-5e9227649193} 36 | 37 | 38 | {d3c22e31-75f1-42f7-bc04-fbd72f6307f4} 39 | 40 | 41 | {176eb2a4-e8a8-41ba-97e1-ec666d782e98} 42 | 43 | 44 | {44815d47-53e2-4f62-b7af-8b5769168716} 45 | 46 | 47 | 48 | 49 | 源文件 50 | 51 | 52 | 资源文件\external_library\imgui 53 | 54 | 55 | 资源文件\external_library\imgui 56 | 57 | 58 | 资源文件\external_library\imgui 59 | 60 | 61 | 资源文件\external_library\imgui 62 | 63 | 64 | 资源文件\external_library\imgui 65 | 66 | 67 | 资源文件\external_library\imgui 68 | 69 | 70 | 资源文件\external_library\imgui 71 | 72 | 73 | 资源文件\external_library\imgui 74 | 75 | 76 | 资源文件\external_library\imnodes 77 | 78 | 79 | 源文件\NodesEditorCore 80 | 81 | 82 | 源文件\NodesEditorCore 83 | 84 | 85 | 源文件\NodesEditorCore\NodesSystemLogger 86 | 87 | 88 | 资源文件\external_library\imbloom 89 | 90 | 91 | 资源文件\external_library\imbloom 92 | 93 | 94 | 源文件\NodesEditorCore\NodesSystemCore 95 | 96 | 97 | 源文件\NodesEditorCore\NodesSystemCore 98 | 99 | 100 | 源文件\NodesEditorCore\NodesSystemCore 101 | 102 | 103 | 源文件\NodesEditorCore\NodesSystemCore 104 | 105 | 106 | 源文件\NodesEditorCore 107 | 108 | 109 | 源文件\NodesEditorCore\NodesSystemCore 110 | 111 | 112 | 113 | 114 | 资源文件\external_library\imgui 115 | 116 | 117 | 资源文件\external_library\imgui 118 | 119 | 120 | 资源文件\external_library\imgui 121 | 122 | 123 | 资源文件\external_library\imgui 124 | 125 | 126 | 资源文件\external_library\imgui 127 | 128 | 129 | 资源文件\external_library\imgui 130 | 131 | 132 | 资源文件\external_library\imgui 133 | 134 | 135 | 资源文件\external_library\imgui 136 | 137 | 138 | 资源文件\external_library\imgui 139 | 140 | 141 | 资源文件\external_library\imgui 142 | 143 | 144 | 资源文件\external_library\imnodes 145 | 146 | 147 | 资源文件\external_library\imnodes 148 | 149 | 150 | 源文件\NodesEditorCore 151 | 152 | 153 | 源文件\NodesEditorCore\NodesSystemLogger 154 | 155 | 156 | 资源文件\external_library\imbloom 157 | 158 | 159 | 源文件\NodesEditorCore\NodesSystemCore 160 | 161 | 162 | 源文件\NodesEditorCore\NodesSystemCore 163 | 164 | 165 | 166 | 167 | 资源文件\system_resource\system_config 168 | 169 | 170 | 资源文件\system_resource\system_config 171 | 172 | 173 | 资源文件\system_resource\system_config 174 | 175 | 176 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/PSAGameNodesEditor.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /PSAGameNodesEditor/imgui.ini: -------------------------------------------------------------------------------- 1 | [Window][Debug##Default] 2 | Pos=60,60 3 | Size=400,400 4 | Collapsed=0 5 | 6 | [Window][##NODES_EDITOR] 7 | Pos=0,0 8 | Size=1880,990 9 | Collapsed=0 10 | 11 | [Window][##MOUSE_MENU] 12 | Pos=904,288 13 | Size=240,360 14 | Collapsed=0 15 | 16 | [Window][ Nodes Menu] 17 | Pos=504,315 18 | Size=240,360 19 | Collapsed=0 20 | 21 | [Window][ NodesMenu] 22 | Pos=1114,535 23 | Size=240,360 24 | Collapsed=0 25 | 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # PSA Node Editor 2 | 3 | > 数据驱动的 轻量级 通用 节点编辑器 4 | 5 | __version:__ `1.0.1.20241222 alpha` 6 | 7 | __library:__ `OpenGL3` `GLFW` `GLEW` `STB_IMAGE` `ImGui` `ImNodes` `RapidJSON` 8 | 9 | __update:__ `2024.12.22` `RCSZ` 10 | 11 | --- 12 | 13 | ### NodeEditorV1 14 | 15 | > 这是一个完整的科技风格的"节点编辑器", 界面以及节点基础构建基于ImGui与ImNodes. 编辑器包含节点项目的保存和加载, 节点数据导出以及基础的鼠标菜单和节点编辑功能. 16 | 17 | - [节点编辑器使用](docs/node_editor_usage.md) 18 | - [节点属性配置](docs/node_editor_config.md) 19 | - [节点数据导出](docs/node_editor_export.md) 20 | 21 | 22 | 23 | `MSVC` `C++17` `x64` `LoC:2472` 24 | 25 | - [ImGui](https://github.com/ocornut/imgui) 26 | - [ImNodes](https://github.com/Nelarius/imnodes) 27 | 28 | --- 29 | 30 | [前往BiliBili视频](https://www.bilibili.com/video/BV1BykhYaEmm/?share_source=copy_web&vd_source=13ed11b7c6628f0aef39803f8e802f5b) -------------------------------------------------------------------------------- /docs/editor_demo_v1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/docs/editor_demo_v1.png -------------------------------------------------------------------------------- /docs/node_editor_config.md: -------------------------------------------------------------------------------- 1 | # Node Attribute Config 2 | 3 | __Update:__ `2024.12.21` `V101` `RCSZ` 4 | 5 | --- 6 | 7 | ### 连接点类型属性 8 | - __V101:__ 每个节点可以拥有多个不同输入与输出连接点, 相同类型连接点可以相连, 自定义类型判定取决于"key", 颜色("value")为连接成功后绘制连接线的颜色. 9 | 10 | ```json5 11 | { 12 | // key: 自定义 类型名称, value: 自定义 连接颜色 (RGBA8888) 13 | "Float32": [ 122, 224, 0, 255 ], 14 | "Int32": [ 0, 168, 222, 255 ], 15 | "Double": [ 158, 196, 0, 255 ], 16 | "Byte": [ 204, 116, 0, 255 ], 17 | "String": [ 132, 0, 232, 255 ], 18 | // ... point types 19 | } 20 | ``` 21 | 22 | --- 23 | 24 | ### 节点类型属性 25 | - __V101:__ 节点属性(模板)全局项目标识名称规定了, 其他项目的节点数据不能加载到当前项目, 注意版本编号不能超过 uint64_t 范围, 输入和输出连接点组可以为0个属性. 26 | 27 | ```json5 28 | { 29 | // key: 全局项目标识名称, value: 自定义名称 30 | "ProjectUniqueName": "PSA_SYSTEM_TEST_PORJ", 31 | // 自定义 节点类型名称 32 | "Test.A": { 33 | // 节点版本号 (uint64) 34 | "Version": 10020241210, 35 | // 节点颜色 (RGBA8888) 36 | "Color": [ 100, 0, 168, 255 ], 37 | // 节点绘制宽度 38 | "Width": 180.0, 39 | // 节点输入 连接点组 (使用之前配置的连接点属性) 40 | "InputPoints": [ "Float32", "Int32", "Int32" ], 41 | // 节点输出 连接点组 (使用之前配置的连接点属性) 42 | "OutputPoints": [ "Int32", "Double" ] 43 | }, 44 | // ... node attributes 45 | } 46 | ``` -------------------------------------------------------------------------------- /docs/node_editor_export.md: -------------------------------------------------------------------------------- 1 | # Node Data Export 2 | 3 | __Update:__ `2024.12.21` `V101` `RCSZ` 4 | 5 | --- 6 | 7 | ### 调用编辑器数据导出 8 | - __V101:__ 目前只有 V101 一种默认的字符串流编码器. 9 | 10 | ```cpp 11 | // 例: 使用 "PSAnodesEncode::PSAN_ENCODE_V101A" 编码器进行导出. 12 | std::string Temp = NodesEditor->ENC_ExportCurrentData(PSAnodesEncode::PSAN_ENCODE_V101A); 13 | ``` 14 | 15 | --- 16 | 17 | ### 导出数据格式 18 | - __V101:__ 是的我们可以从格式看出与 .obj 模型文件的流编码方式有相似之处, 前半段描述了所有节点的必要属性以及连接的唯一标识(UID), 后半段描述了哪些点它们是相连的, 目前并没有循环依赖拓扑检查. 19 | 20 | ```cpp 21 | // 示例数据: 22 | 23 | name Test.A // 节点名称 24 | tid 1 // 节点类型 UID 25 | uid 1 // 节点实体 UID 26 | point_i 1 Float32 // 输入连接点 UID 类型名称 27 | point_i 2 Int32 28 | point_i 3 Int32 29 | point_o 4 Int32 // 输出连接点 UID 类型名称 30 | point_o 5 Double 31 | node_params_end // 节点参数组描述 结束标识 32 | name Test.Component.IN 33 | tid 7 34 | uid 2 35 | point_o 6 Float32 36 | point_o 7 Float32 37 | point_o 8 String 38 | node_params_end 39 | name Test.E 40 | tid 5 41 | uid 3 42 | point_i 9 Float32 43 | point_i 10 Int32 44 | point_o 11 Int32 45 | point_o 12 Float32 46 | node_params_end 47 | node_link 6 1 // 连接点描述 连接对 UID-UID 48 | node_link 7 9 49 | ``` -------------------------------------------------------------------------------- /docs/node_editor_usage.md: -------------------------------------------------------------------------------- 1 | # Node Editor Usage 2 | 3 | __Update:__ `2024.12.22` `V101` `RCSZ` 4 | 5 | --- 6 | 7 | ### 概述 8 | > __编辑器到底做了哪些工作?__ ImNodes只是提供了一套构建节点的方法, 但是它并不具备节点实体的数据管理, 例如UID分配 和 节点模板 到 节点实体的创建, 还包括节点项目的保存加载以及数据统一编码导出. 但是我们也并没有提供一套标准的 "后端" 的解析系统, 这取决于您的使用场景自行构建. 9 | 10 | - __V101:__ 整个项目其实分为两部分, 您可以剥离OpenGL的渲染部分, 只取编辑器的核心渲染逻辑, 但是需要和日志系统一起移植. 是的包括"发光"功能都是属于外部的渲染部分, 不包括在编辑器核心里. 如果您需要移植, 可以参考下图框选部分代码. 整个编辑器项目界面采用固定暗紫色配色, 目前不提供自定义颜色. 11 | 12 | 13 | 14 | --- 15 | ### 基础绘制调用 16 | - __V101:__ 如果您剥离移植了核心部分, 那么您需要更加注意以下的调用. 属性配置文件参考: [节点属性配置](node_editor_config.md) 17 | 18 | ```cpp 19 | // 定义 20 | PSAnodesRender::NodesEditorRender* NodesEditor = nullptr; 21 | 22 | /* 在您的初始化阶段创建它, ImGui上下文必须创建完成后才能进行 23 | * 24 | * param: "attrib_cfg" 节点属性配置文件(.json) 路径 25 | * param: "types_cfg" 连接点属性配置文件(.json) 路径 26 | */ 27 | NodesEditor = new PSAnodesRender::NodesEditorRender(attrib_cfg, types_cfg); 28 | 29 | /* 在您的渲染循环中调用帧绘制 30 | * 31 | * param: "size" 编辑器窗口大小 (注意: 调整时可能需要配合全局字体缩放) 32 | * param: "flag" true: 固定窗口位置为左上角 33 | * 34 | * 对于 "size" 我们建议最小不要小于 1280 x 720 35 | */ 36 | NodesEditor->DrawEditorWindowFrame(size, flag); 37 | 38 | // 完整方法 39 | void DrawEditorWindowFrame( 40 | const ImVec2& size, // 窗口大小 41 | bool fixed = true, // 固定为左上角 42 | ImGuiWindowFlags flags = NULL // 窗口标志 43 | ); 44 | 45 | // 是的到这里最基础的调用就完成了, 非常简单. 46 | ``` 47 | 48 | - 设置&数据操作, 具体的编辑器所有数据定义格式可以前往 "psag_nodes_system_data.hpp" 文件查看. 导出数据参考: [节点数据导出](node_editor_export.md) 49 | ```cpp 50 | // 设置 默认项目检索文件夹(目录) 51 | void NEP_SettingDefaultFolder(const std::string& path); 52 | // 设置 默认项目保存名称 53 | void NEP_SettingDefaultName(const std::string& name); 54 | 55 | // 获取 全局项目标识名称 56 | std::string NDC_GetProjectName(); 57 | // 获取 节点模板数据(配置源信息) 58 | NodeTempsPtr NDC_GetNodeTemplates(); 59 | // 获取 节点实体数据(已分配UID正在绘制的节点) 60 | NodeEntisPtr NDC_GetNodeEntities(); 61 | 62 | // 导出 当前正在绘制中的节点实体数据 63 | std::string ENC_ExportCurrentData(PSAnodesEncode::PSAencoderPFN funcptr); 64 | ``` 65 | 66 | --- 67 | 68 | ### 编辑器操作 69 | 70 | - __V101:__ 71 | * `1` 界面顶部显示栏, 三个模拟'LED'分别描述: 当前运行状态, 锁定清理删除项目按钮状态, 鼠标菜单打开状态. 72 | * `2` 鼠标右键打开节点菜单, 点击任意非菜单内或者进行一次操作后菜单自动关闭. 73 | * `3` 界面右半工具栏, 点击选择项目后下面按钮操作为当前项目, 再此点击可解除当前项目绑定, 可以通过顶部显示信息判断. 底部锁定选择框激活后, 清理所有节点和删除项目按钮都将被锁定(失效). 74 | 75 | --- 76 | 77 | Thank you for using ! -------------------------------------------------------------------------------- /docs/usage_image_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/docs/usage_image_1.png -------------------------------------------------------------------------------- /x64/Debug/glew32.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/x64/Debug/glew32.dll -------------------------------------------------------------------------------- /x64/Debug/glfw3.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/rcszc/PSAnodeEditor/8147ee942667f97950d5846f9c9bb398dcf03a7c/x64/Debug/glfw3.dll --------------------------------------------------------------------------------