├── .gitattributes ├── .github ├── CODEOWNERS ├── FUNDING.yml └── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md ├── .gitignore ├── DraculaDominus.py ├── LICENSE ├── M2Debug.py ├── M2Install.py ├── M2Install.yml ├── M2Package.bat ├── M2Patch.py ├── M2Test.py ├── MGSM2Fix.ini ├── MGSM2Fix.rc ├── MGSM2Fix.sln ├── MGSM2Fix.vcxproj ├── MGSM2Fix.vcxproj.filters ├── README.md ├── game_actions_2131630.vdf ├── res ├── LICENSES.txt ├── d3d11-x64.SHA512 ├── d3d11.dll ├── dinput8-Win32.SHA512 └── dinput8.dll ├── resource.h └── src ├── FunctionTraits ├── CompilerVersions.cppm ├── CompilerVersions.h ├── Demo.cpp ├── LICENSE ├── README.md ├── TypeTraits.cppm └── TypeTraits.h ├── analog.cpp ├── analog.h ├── borderless.cpp ├── borderless.h ├── config.cpp ├── config.h ├── d3d11.cpp ├── d3d11.h ├── d3d11PixelUpscaler.hlsl ├── d3d11VertexUpscaler.hlsl ├── dllmain.cpp ├── epi.cpp ├── epi.h ├── imgui ├── .editorconfig ├── .gitattributes ├── .github │ ├── FUNDING.yml │ ├── ISSUE_TEMPLATE │ │ ├── config.yml │ │ └── issue_template.yml │ ├── pull_request_template.md │ └── workflows │ │ ├── build.yml │ │ ├── manual.yml │ │ ├── scheduled.yml │ │ └── static-analysis.yml ├── .gitignore ├── LICENSE.txt ├── backends │ ├── imgui_impl_allegro5.cpp │ ├── imgui_impl_allegro5.h │ ├── imgui_impl_android.cpp │ ├── imgui_impl_android.h │ ├── imgui_impl_dx10.cpp │ ├── imgui_impl_dx10.h │ ├── imgui_impl_dx11.cpp │ ├── imgui_impl_dx11.h │ ├── imgui_impl_dx12.cpp │ ├── imgui_impl_dx12.h │ ├── imgui_impl_dx9.cpp │ ├── imgui_impl_dx9.h │ ├── imgui_impl_glfw.cpp │ ├── imgui_impl_glfw.h │ ├── imgui_impl_glut.cpp │ ├── imgui_impl_glut.h │ ├── imgui_impl_metal.h │ ├── imgui_impl_metal.mm │ ├── imgui_impl_opengl2.cpp │ ├── imgui_impl_opengl2.h │ ├── imgui_impl_opengl3.cpp │ ├── imgui_impl_opengl3.h │ ├── imgui_impl_opengl3_loader.h │ ├── imgui_impl_osx.h │ ├── imgui_impl_osx.mm │ ├── imgui_impl_sdl2.cpp │ ├── imgui_impl_sdl2.h │ ├── imgui_impl_sdl3.cpp │ ├── imgui_impl_sdl3.h │ ├── imgui_impl_sdlgpu3.cpp │ ├── imgui_impl_sdlgpu3.h │ ├── imgui_impl_sdlgpu3_shaders.h │ ├── imgui_impl_sdlrenderer2.cpp │ ├── imgui_impl_sdlrenderer2.h │ ├── imgui_impl_sdlrenderer3.cpp │ ├── imgui_impl_sdlrenderer3.h │ ├── imgui_impl_vulkan.cpp │ ├── imgui_impl_vulkan.h │ ├── imgui_impl_wgpu.cpp │ ├── imgui_impl_wgpu.h │ ├── imgui_impl_win32.cpp │ ├── imgui_impl_win32.h │ ├── sdlgpu3 │ │ ├── build_instructions.txt │ │ ├── shader.frag │ │ └── shader.vert │ └── vulkan │ │ ├── build_instructions.txt │ │ ├── generate_spv.sh │ │ ├── glsl_shader.frag │ │ └── glsl_shader.vert ├── docs │ ├── BACKENDS.md │ ├── CHANGELOG.txt │ ├── CONTRIBUTING.md │ ├── EXAMPLES.md │ ├── FAQ.md │ ├── FONTS.md │ ├── README.md │ └── TODO.txt ├── examples │ ├── README.txt │ ├── example_allegro5 │ │ ├── README.md │ │ ├── example_allegro5.vcxproj │ │ ├── example_allegro5.vcxproj.filters │ │ ├── imconfig_allegro5.h │ │ └── main.cpp │ ├── example_android_opengl3 │ │ ├── CMakeLists.txt │ │ ├── android │ │ │ ├── .gitignore │ │ │ ├── app │ │ │ │ ├── build.gradle │ │ │ │ └── src │ │ │ │ │ └── main │ │ │ │ │ ├── AndroidManifest.xml │ │ │ │ │ └── java │ │ │ │ │ └── MainActivity.kt │ │ │ ├── build.gradle │ │ │ └── settings.gradle │ │ └── main.cpp │ ├── example_apple_metal │ │ ├── Makefile │ │ ├── README.md │ │ ├── example_apple_metal.xcodeproj │ │ │ └── project.pbxproj │ │ ├── iOS │ │ │ ├── Info-iOS.plist │ │ │ └── LaunchScreen.storyboard │ │ ├── macOS │ │ │ ├── Info-macOS.plist │ │ │ └── MainMenu.storyboard │ │ └── main.mm │ ├── example_apple_opengl2 │ │ ├── Makefile │ │ ├── example_apple_opengl2.xcodeproj │ │ │ └── project.pbxproj │ │ └── main.mm │ ├── example_glfw_metal │ │ ├── Makefile │ │ └── main.mm │ ├── example_glfw_opengl2 │ │ ├── Makefile │ │ ├── build_win32.bat │ │ ├── example_glfw_opengl2.vcxproj │ │ ├── example_glfw_opengl2.vcxproj.filters │ │ └── main.cpp │ ├── example_glfw_opengl3 │ │ ├── Makefile │ │ ├── Makefile.emscripten │ │ ├── build_win32.bat │ │ ├── example_glfw_opengl3.vcxproj │ │ ├── example_glfw_opengl3.vcxproj.filters │ │ └── main.cpp │ ├── example_glfw_vulkan │ │ ├── CMakeLists.txt │ │ ├── Makefile │ │ ├── build_win32.bat │ │ ├── build_win64.bat │ │ ├── example_glfw_vulkan.vcxproj │ │ ├── example_glfw_vulkan.vcxproj.filters │ │ └── main.cpp │ ├── example_glfw_wgpu │ │ ├── CMakeLists.txt │ │ ├── Makefile.emscripten │ │ ├── README.md │ │ └── main.cpp │ ├── example_glut_opengl2 │ │ ├── Makefile │ │ ├── example_glut_opengl2.vcxproj │ │ ├── example_glut_opengl2.vcxproj.filters │ │ └── main.cpp │ ├── example_null │ │ ├── Makefile │ │ ├── build_win32.bat │ │ └── main.cpp │ ├── example_sdl2_directx11 │ │ ├── build_win32.bat │ │ ├── example_sdl2_directx11.vcxproj │ │ ├── example_sdl2_directx11.vcxproj.filters │ │ └── main.cpp │ ├── example_sdl2_metal │ │ ├── Makefile │ │ └── main.mm │ ├── example_sdl2_opengl2 │ │ ├── Makefile │ │ ├── README.md │ │ ├── build_win32.bat │ │ ├── example_sdl2_opengl2.vcxproj │ │ ├── example_sdl2_opengl2.vcxproj.filters │ │ └── main.cpp │ ├── example_sdl2_opengl3 │ │ ├── Makefile │ │ ├── Makefile.emscripten │ │ ├── README.md │ │ ├── build_win32.bat │ │ ├── example_sdl2_opengl3.vcxproj │ │ ├── example_sdl2_opengl3.vcxproj.filters │ │ └── main.cpp │ ├── example_sdl2_sdlrenderer2 │ │ ├── Makefile │ │ ├── README.md │ │ ├── build_win32.bat │ │ ├── example_sdl2_sdlrenderer2.vcxproj │ │ ├── example_sdl2_sdlrenderer2.vcxproj.filters │ │ └── main.cpp │ ├── example_sdl2_vulkan │ │ ├── Makefile │ │ ├── build_win32.bat │ │ ├── build_win64.bat │ │ ├── example_sdl2_vulkan.vcxproj │ │ ├── example_sdl2_vulkan.vcxproj.filters │ │ └── main.cpp │ ├── example_sdl3_opengl3 │ │ ├── Makefile │ │ ├── Makefile.emscripten │ │ ├── README.md │ │ ├── build_win32.bat │ │ ├── build_win64.bat │ │ ├── example_sdl3_opengl3.vcxproj │ │ ├── example_sdl3_opengl3.vcxproj.filters │ │ └── main.cpp │ ├── example_sdl3_sdlgpu3 │ │ ├── Makefile │ │ ├── build_win64.bat │ │ ├── example_sdl3_sdlgpu3.vcxproj │ │ ├── example_sdl3_sdlgpu3.vcxproj.filters │ │ └── main.cpp │ ├── example_sdl3_sdlrenderer3 │ │ ├── Makefile │ │ ├── build_win32.bat │ │ ├── example_sdl3_sdlrenderer3.vcxproj │ │ ├── example_sdl3_sdlrenderer3.vcxproj.filters │ │ └── main.cpp │ ├── example_sdl3_vulkan │ │ ├── Makefile │ │ ├── build_win32.bat │ │ ├── build_win64.bat │ │ ├── example_sdl3_vulkan.vcxproj │ │ ├── example_sdl3_vulkan.vcxproj.filters │ │ └── main.cpp │ ├── example_win32_directx10 │ │ ├── build_win32.bat │ │ ├── example_win32_directx10.vcxproj │ │ ├── example_win32_directx10.vcxproj.filters │ │ └── main.cpp │ ├── example_win32_directx11 │ │ ├── build_win32.bat │ │ ├── example_win32_directx11.vcxproj │ │ ├── example_win32_directx11.vcxproj.filters │ │ └── main.cpp │ ├── example_win32_directx12 │ │ ├── build_win32.bat │ │ ├── example_win32_directx12.vcxproj │ │ ├── example_win32_directx12.vcxproj.filters │ │ └── main.cpp │ ├── example_win32_directx9 │ │ ├── build_win32.bat │ │ ├── example_win32_directx9.vcxproj │ │ ├── example_win32_directx9.vcxproj.filters │ │ └── main.cpp │ ├── example_win32_opengl3 │ │ ├── build_mingw.bat │ │ ├── build_win32.bat │ │ ├── example_win32_opengl3.vcxproj │ │ ├── example_win32_opengl3.vcxproj.filters │ │ └── main.cpp │ ├── example_win32_vulkan │ │ ├── build_win32.bat │ │ ├── build_win64.bat │ │ ├── example_win32_vulkan.vcxproj │ │ ├── example_win32_vulkan.vcxproj.filters │ │ └── main.cpp │ ├── imgui_examples.sln │ └── libs │ │ ├── emscripten │ │ ├── emscripten_mainloop_stub.h │ │ └── shell_minimal.html │ │ ├── glfw │ │ ├── COPYING.txt │ │ ├── include │ │ │ └── GLFW │ │ │ │ ├── glfw3.h │ │ │ │ └── glfw3native.h │ │ ├── lib-vc2010-32 │ │ │ └── glfw3.lib │ │ └── lib-vc2010-64 │ │ │ └── glfw3.lib │ │ └── usynergy │ │ ├── README.txt │ │ ├── uSynergy.c │ │ └── uSynergy.h ├── imconfig.h ├── imgui.cpp ├── imgui.h ├── imgui_demo.cpp ├── imgui_draw.cpp ├── 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 ├── inipp ├── .gitattributes ├── .gitignore ├── .travis.yml ├── CMakeLists.txt ├── LICENSE.txt ├── README.md ├── appveyor.yml ├── example │ ├── example.cpp │ ├── example.ini │ ├── example.vcxproj │ └── example.vcxproj.filters ├── inipp.sln ├── inipp │ ├── inipp.h │ ├── inipp.vcxproj │ └── inipp.vcxproj.filters ├── nuget │ ├── IniPP.nuspec │ └── IniPP.targets └── unittest │ ├── CMakeLists.txt │ ├── headertest.cpp │ ├── test.h │ ├── test1.ini │ ├── test1.output │ ├── test2.ini │ ├── test2.output │ ├── test3.ini │ ├── test3.output │ ├── test4.ini │ ├── test4.output │ ├── unittest.cpp │ ├── unittest.vcxproj │ └── unittest.vcxproj.filters ├── ketchup.cpp ├── ketchup.h ├── m2 ├── epi.h └── psx.h ├── m2config.cpp ├── m2config.h ├── m2fix.h ├── m2fixbase.h ├── m2game.h ├── m2hook.h ├── m2machine.h ├── m2utils.cpp ├── m2utils.h ├── mgs1.cpp ├── mgs1.h ├── psx.cpp ├── psx.h ├── safetyhook ├── Zydis.c ├── Zydis.h ├── safetyhook.cpp └── safetyhook.hpp ├── spdlog ├── .clang-format ├── .clang-tidy ├── .git-blame-ignore-revs ├── .gitattributes ├── .github │ └── workflows │ │ └── ci.yml ├── .gitignore ├── CMakeLists.txt ├── INSTALL ├── LICENSE ├── README.md ├── appveyor.yml ├── bench │ ├── CMakeLists.txt │ ├── async_bench.cpp │ ├── bench.cpp │ ├── formatter-bench.cpp │ ├── latency.cpp │ └── utils.h ├── cmake │ ├── ide.cmake │ ├── pch.h.in │ ├── spdlog.pc.in │ ├── spdlogCPack.cmake │ ├── spdlogConfig.cmake.in │ ├── utils.cmake │ └── version.rc.in ├── example │ ├── CMakeLists.txt │ └── example.cpp ├── include │ └── spdlog │ │ ├── async.h │ │ ├── async_logger-inl.h │ │ ├── async_logger.h │ │ ├── cfg │ │ ├── argv.h │ │ ├── env.h │ │ ├── helpers-inl.h │ │ └── helpers.h │ │ ├── common-inl.h │ │ ├── common.h │ │ ├── details │ │ ├── backtracer-inl.h │ │ ├── backtracer.h │ │ ├── circular_q.h │ │ ├── console_globals.h │ │ ├── file_helper-inl.h │ │ ├── file_helper.h │ │ ├── fmt_helper.h │ │ ├── log_msg-inl.h │ │ ├── log_msg.h │ │ ├── log_msg_buffer-inl.h │ │ ├── log_msg_buffer.h │ │ ├── mpmc_blocking_q.h │ │ ├── null_mutex.h │ │ ├── os-inl.h │ │ ├── os.h │ │ ├── periodic_worker-inl.h │ │ ├── periodic_worker.h │ │ ├── registry-inl.h │ │ ├── registry.h │ │ ├── synchronous_factory.h │ │ ├── tcp_client-windows.h │ │ ├── tcp_client.h │ │ ├── thread_pool-inl.h │ │ ├── thread_pool.h │ │ ├── udp_client-windows.h │ │ ├── udp_client.h │ │ └── windows_include.h │ │ ├── fmt │ │ ├── bin_to_hex.h │ │ ├── bundled │ │ │ ├── args.h │ │ │ ├── chrono.h │ │ │ ├── color.h │ │ │ ├── compile.h │ │ │ ├── core.h │ │ │ ├── fmt.license.rst │ │ │ ├── format-inl.h │ │ │ ├── format.h │ │ │ ├── locale.h │ │ │ ├── os.h │ │ │ ├── ostream.h │ │ │ ├── printf.h │ │ │ ├── ranges.h │ │ │ ├── std.h │ │ │ └── xchar.h │ │ ├── chrono.h │ │ ├── compile.h │ │ ├── fmt.h │ │ ├── ostr.h │ │ ├── ranges.h │ │ ├── std.h │ │ └── xchar.h │ │ ├── formatter.h │ │ ├── fwd.h │ │ ├── logger-inl.h │ │ ├── logger.h │ │ ├── mdc.h │ │ ├── pattern_formatter-inl.h │ │ ├── pattern_formatter.h │ │ ├── sinks │ │ ├── android_sink.h │ │ ├── ansicolor_sink-inl.h │ │ ├── ansicolor_sink.h │ │ ├── base_sink-inl.h │ │ ├── base_sink.h │ │ ├── basic_file_sink-inl.h │ │ ├── basic_file_sink.h │ │ ├── callback_sink.h │ │ ├── daily_file_sink.h │ │ ├── dist_sink.h │ │ ├── dup_filter_sink.h │ │ ├── hourly_file_sink.h │ │ ├── kafka_sink.h │ │ ├── mongo_sink.h │ │ ├── msvc_sink.h │ │ ├── null_sink.h │ │ ├── ostream_sink.h │ │ ├── qt_sinks.h │ │ ├── ringbuffer_sink.h │ │ ├── rotating_file_sink-inl.h │ │ ├── rotating_file_sink.h │ │ ├── sink-inl.h │ │ ├── sink.h │ │ ├── stdout_color_sinks-inl.h │ │ ├── stdout_color_sinks.h │ │ ├── stdout_sinks-inl.h │ │ ├── stdout_sinks.h │ │ ├── syslog_sink.h │ │ ├── systemd_sink.h │ │ ├── tcp_sink.h │ │ ├── udp_sink.h │ │ ├── win_eventlog_sink.h │ │ ├── wincolor_sink-inl.h │ │ └── wincolor_sink.h │ │ ├── spdlog-inl.h │ │ ├── spdlog.h │ │ ├── stopwatch.h │ │ ├── tweakme.h │ │ └── version.h ├── logos │ ├── jetbrains-variant-4.svg │ └── spdlog.png ├── scripts │ ├── ci_setup_clang.sh │ ├── extract_version.py │ └── format.sh ├── src │ ├── async.cpp │ ├── bundled_fmtlib_format.cpp │ ├── cfg.cpp │ ├── color_sinks.cpp │ ├── file_sinks.cpp │ ├── spdlog.cpp │ └── stdout_sinks.cpp └── tests │ ├── CMakeLists.txt │ ├── includes.h │ ├── main.cpp │ ├── test_async.cpp │ ├── test_backtrace.cpp │ ├── test_bin_to_hex.cpp │ ├── test_cfg.cpp │ ├── test_circular_q.cpp │ ├── test_create_dir.cpp │ ├── test_custom_callbacks.cpp │ ├── test_daily_logger.cpp │ ├── test_dup_filter.cpp │ ├── test_errors.cpp │ ├── test_eventlog.cpp │ ├── test_file_helper.cpp │ ├── test_file_logging.cpp │ ├── test_fmt_helper.cpp │ ├── test_macros.cpp │ ├── test_misc.cpp │ ├── test_mpmc_q.cpp │ ├── test_pattern_formatter.cpp │ ├── test_registry.cpp │ ├── test_sink.h │ ├── test_stdout_api.cpp │ ├── test_stopwatch.cpp │ ├── test_systemd.cpp │ ├── test_time_point.cpp │ ├── utils.cpp │ └── utils.h ├── sqbinary.h ├── sqemutask.h ├── sqglobals.h ├── sqhelper.h ├── sqhook.cpp ├── sqhook.h ├── sqinput.h ├── sqinputhub.h ├── sqinvoker.h ├── sqrat ├── Doxyfile ├── README.txt ├── gtest-1.3.0 │ ├── CHANGES │ ├── CONTRIBUTORS │ ├── COPYING │ ├── README │ ├── build_gtest.sh │ ├── include │ │ └── gtest │ │ │ ├── gtest-death-test.h │ │ │ ├── gtest-message.h │ │ │ ├── gtest-param-test.h │ │ │ ├── gtest-param-test.h.pump │ │ │ ├── gtest-spi.h │ │ │ ├── gtest-test-part.h │ │ │ ├── gtest-typed-test.h │ │ │ ├── gtest.h │ │ │ ├── gtest_pred_impl.h │ │ │ ├── gtest_prod.h │ │ │ └── internal │ │ │ ├── gtest-death-test-internal.h │ │ │ ├── gtest-filepath.h │ │ │ ├── gtest-internal.h │ │ │ ├── gtest-linked_ptr.h │ │ │ ├── gtest-param-util-generated.h │ │ │ ├── gtest-param-util-generated.h.pump │ │ │ ├── gtest-param-util.h │ │ │ ├── gtest-port.h │ │ │ ├── gtest-string.h │ │ │ ├── gtest-type-util.h │ │ │ └── gtest-type-util.h.pump │ ├── msvc │ │ └── gtest.vcproj │ └── src │ │ ├── gtest-all.cc │ │ ├── gtest-death-test.cc │ │ ├── gtest-filepath.cc │ │ ├── gtest-internal-inl.h │ │ ├── gtest-port.cc │ │ ├── gtest-test-part.cc │ │ ├── gtest-typed-test.cc │ │ ├── gtest.cc │ │ └── gtest_main.cc ├── include │ ├── sqmodule.h │ ├── sqrat.h │ ├── sqrat │ │ ├── sqratAllocator.h │ │ ├── sqratArray.h │ │ ├── sqratClass.h │ │ ├── sqratClassType.h │ │ ├── sqratConst.h │ │ ├── sqratFunction.h │ │ ├── sqratGlobalMethods.h │ │ ├── sqratMemberMethods.h │ │ ├── sqratObject.h │ │ ├── sqratOverloadMethods.h │ │ ├── sqratScript.h │ │ ├── sqratTable.h │ │ ├── sqratTypes.h │ │ ├── sqratUtil.h │ │ └── sqratVM.h │ └── sqratimport.h ├── running_tests.txt ├── sq │ ├── sq.c │ └── sq.vcproj ├── sqimport │ ├── sqratimport.cpp │ └── sqratimport.vcproj ├── sqrat.sln ├── sqrattest │ ├── ArrayBinding.cpp │ ├── ClassBinding.cpp │ ├── ClassInstances.cpp │ ├── ClassProperties.cpp │ ├── ConstBindings.cpp │ ├── Fixture.h │ ├── FuncInputArgumentType.cpp │ ├── FunctionOverload.cpp │ ├── FunctionParams.cpp │ ├── ImportTest.cpp │ ├── Main.cpp │ ├── NullPointerReturn.cpp │ ├── RunStackHandling.cpp │ ├── ScriptLoading.cpp │ ├── SqratVM.cpp │ ├── SqratVM2.cpp │ ├── SquirrelFunctions.cpp │ ├── SuspendVM.cpp │ ├── TableBinding.cpp │ ├── UniqueObject.cpp │ ├── Vector.cpp │ ├── Vector.h │ ├── build_tests.sh │ ├── build_tests_msys.sh │ ├── run_tests.sh │ ├── scripts │ │ ├── hello.nut │ │ └── samplemodule.nut │ └── sqrattest.vcproj └── sqratthread │ ├── sqratThread.cpp │ ├── sqratThread.h │ └── sqratthread.vcproj ├── sqsystemdata.h ├── sqsystemprof.h ├── sqtitleprof.h ├── sqtrace.cpp ├── squirk.h ├── squirrel ├── COPYRIGHT ├── include │ ├── sqstdaux.h │ ├── sqstdblob.h │ ├── sqstdio.h │ ├── sqstdmath.h │ ├── sqstdstring.h │ ├── sqstdsystem.h │ └── squirrel.h ├── sqdbg │ ├── serialize_state.nut │ ├── sqdbgserver.cpp │ ├── sqdbgserver.h │ ├── sqrdbg.cpp │ └── sqrdbg.h ├── sqstdlib │ ├── sqstdaux.cpp │ ├── sqstdblob.cpp │ ├── sqstdblobimpl.h │ ├── sqstdio.cpp │ ├── sqstdmath.cpp │ ├── sqstdrex.cpp │ ├── sqstdstream.cpp │ ├── sqstdstream.h │ ├── sqstdstring.cpp │ └── sqstdsystem.cpp └── squirrel │ ├── sqapi.cpp │ ├── sqarray.h │ ├── sqbaselib.cpp │ ├── sqclass.cpp │ ├── sqclass.h │ ├── sqclosure.h │ ├── sqcompiler.cpp │ ├── sqcompiler.h │ ├── sqdebug.cpp │ ├── sqfuncproto.h │ ├── sqfuncstate.cpp │ ├── sqfuncstate.h │ ├── sqlexer.cpp │ ├── sqlexer.h │ ├── sqmem.cpp │ ├── sqobject.cpp │ ├── sqobject.h │ ├── sqopcodes.h │ ├── sqpcheader.h │ ├── sqstate.cpp │ ├── sqstate.h │ ├── sqstring.h │ ├── sqtable.cpp │ ├── sqtable.h │ ├── squserdata.h │ ├── squtils.h │ ├── sqvm.cpp │ └── sqvm.h ├── stdafx.cpp └── stdafx.h /.github/CODEOWNERS: -------------------------------------------------------------------------------- 1 | * @nuggslet 2 | -------------------------------------------------------------------------------- /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | ko_fi: nuggs 2 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help reproduce and fix the issue 4 | title: '[Bug]: ' 5 | labels: ["bug"] 6 | --- 7 | 8 | 9 | ## Issue Summary: 10 | 11 | 12 | 13 | ## MGSM2Fix & Game Version Number: 14 | 15 | 16 | 17 | ## Log Files: 18 | 19 | 20 | 21 | ## Reproduction: 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '[Feature Request]: ' 5 | labels: ["enhancement"] 6 | --- 7 | 8 | 9 | ## Feature Summary: 10 | 11 | 12 | 13 | ### Is your proposal related to a problem? 14 | 15 | 16 | 17 | ### Describe the solution you'd like 18 | 19 | 20 | 21 | ### Describe alternatives you've considered 22 | 23 | -------------------------------------------------------------------------------- /DraculaDominus.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | '''DraculaDominus.py: ROM extraction utility for M2ENGAGE [Castlevania Dominus Collection].''' 4 | 5 | import os 6 | import json 7 | 8 | __author__ = 'nuggslet' 9 | __license__ = 'MIT' 10 | 11 | def dracula_unpack(src, dst): 12 | files = os.path.join(src, 'files.bin') 13 | files = open(files, 'rb') 14 | meta = os.path.join(src, 'files_info.psb.json') 15 | meta = open(meta, 'r') 16 | 17 | meta = json.load(meta) 18 | for info in meta['list']: 19 | files.seek(info['offset']) 20 | data = files.read(info['bytes']) 21 | path = info['path'].lstrip('/\\') 22 | path = os.path.join(dst, path) 23 | path = os.path.normpath(path) 24 | 25 | os.makedirs(os.path.dirname(path), exist_ok=True) 26 | file = open(path, 'wb') 27 | file.write(data) 28 | file.close() 29 | 30 | def main(): 31 | import argparse 32 | parser = argparse.ArgumentParser('DraculaDominus', description='ROM extraction utility for M2ENGAGE [Castlevania Dominus Collection]') 33 | 34 | parser.add_argument('src') 35 | parser.add_argument('dst') 36 | 37 | args = parser.parse_args() 38 | dracula_unpack(args.src, args.dst) 39 | 40 | if __name__ == '__main__': 41 | main() 42 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023-2025 nuggslet 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 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /M2Debug.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | '''M2Debug.py: Debugger for M2ENGAGE [Metal Gear Solid].''' 4 | 5 | import socket 6 | 7 | __author__ = 'nuggslet' 8 | __license__ = 'MIT' 9 | 10 | class M2Debug: 11 | def __init__(self, socket): 12 | self.s = socket 13 | 14 | def ready(self): 15 | msg = b'rd\n' 16 | self.s.send(msg) 17 | 18 | def evaluate(self, closure): 19 | closure = closure.replace('\r', '').replace('\n', '') 20 | msg = b'ev:%s\0\n' % closure.encode('ascii') 21 | r = self.s.makefile('r') 22 | self.s.send(msg) 23 | return r.readline() 24 | 25 | def main(): 26 | import argparse 27 | parser = argparse.ArgumentParser('M2Debug', description='Debugger for M2ENGAGE [Metal Gear Solid]') 28 | 29 | parser.add_argument('--host', default='127.0.0.1') 30 | parser.add_argument('--port', type=int, default=27615) 31 | args = parser.parse_args() 32 | 33 | s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) 34 | s.connect((args.host, args.port)) 35 | s = M2Debug(s) 36 | 37 | s.ready() 38 | while True: 39 | print(s.evaluate(input('> '))) 40 | 41 | if __name__ == "__main__": 42 | main() 43 | -------------------------------------------------------------------------------- /M2Install.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | '''M2Install.py: Installer utility for M2Fix.''' 4 | 5 | import os 6 | import yaml 7 | import shutil 8 | import zipfile 9 | 10 | __author__ = 'nuggslet' 11 | __license__ = 'MIT' 12 | 13 | def main(): 14 | import argparse 15 | parser = argparse.ArgumentParser('M2Install', description='Installer utility for M2Fix') 16 | 17 | parser.add_argument('file', nargs='?') 18 | parser.add_argument('arch', nargs='?') 19 | parser.add_argument('--package', action='store_true') 20 | args = parser.parse_args() 21 | 22 | rules = os.path.join(os.path.dirname(__file__), 'M2Install.yml') 23 | rules = open(rules, 'r', encoding='utf-8') 24 | rules = yaml.load(rules, Loader=yaml.Loader) 25 | 26 | if args.package: 27 | file = os.path.realpath(__file__) 28 | file = os.path.dirname(file) 29 | file = os.path.join(file, 'MGSM2Fix.zip') 30 | file = zipfile.ZipFile(file, 'r') 31 | for arch in rules: 32 | for rule in rules[arch]: 33 | if os.path.isfile(rule): os.remove(rule) 34 | rule = os.path.dirname(rule) 35 | file.extractall(rule) 36 | file.close() 37 | else: 38 | if args.arch not in rules: return 39 | for rule in rules[args.arch]: 40 | shutil.copy(args.file, rule) 41 | rule = os.path.dirname(rule) 42 | file = os.path.join(rule, 'MGSM2Fix32.asi') 43 | if os.path.isfile(file): os.remove(file) 44 | file = os.path.join(rule, 'MGSM2Fix64.asi') 45 | if os.path.isfile(file): os.remove(file) 46 | 47 | if __name__ == "__main__": 48 | main() 49 | -------------------------------------------------------------------------------- /M2Install.yml: -------------------------------------------------------------------------------- 1 | # M2Install.yaml: install manifest for M2Fix development. 2 | # This is nuggs's personal manifest, so it isn't immediately useful to anyone else, but it's here to serve as an example. 3 | x64: 4 | - F:\Steam\steamapps\common\MGS Master Collection Bonus Content\MGSM2Fix.asi 5 | - I:\Steam\steamapps\common\Castlevania Dominus Collection\MGSM2Fix.asi 6 | - F:\Steam\steamapps\common\Ray’z Arcade Chronology\MGSM2Fix.asi 7 | x86: 8 | - F:\Steam\steamapps\common\MGS1\MGSM2Fix.asi 9 | - I:\Steam\steamapps\common\Contra Anniversary Collection\MGSM2Fix.asi 10 | - I:\Steam\steamapps\common\Castlevania Advance Collection\MGSM2Fix.asi 11 | - I:\Steam\steamapps\common\Castlevania Anniversary Collection\MGSM2Fix.asi 12 | - F:\Steam\steamapps\common\Darius Cozmic Collection Arcade\MGSM2Fix.asi 13 | - F:\Steam\steamapps\common\G-Darius HD\MGSM2Fix.asi 14 | - E:\Epic Games\CastlevaniaAnniversaXJ2A3\MGSM2Fix.asi 15 | -------------------------------------------------------------------------------- /M2Package.bat: -------------------------------------------------------------------------------- 1 | REM M2Package.bat: Release archive packager for M2Fix. 2 | 3 | @echo off 4 | pushd "%~dp0" 5 | 6 | for /f "usebackq tokens=1* delims=: " %%i in (`"%ProgramFiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -products * -latest -requires Microsoft.Component.MSBuild`) do ( 7 | if /i "%%i"=="installationPath" ( 8 | set vsdir=%%j 9 | ) 10 | ) 11 | 12 | echo %vsdir% 13 | 14 | if exist "%vsdir%\Common7\Tools\VsMSBuildCmd.bat" ( 15 | call "%vsdir%\Common7\Tools\VsMSBuildCmd" 16 | cd "%~dp0" 17 | ) 18 | 19 | MSBuild MGSM2Fix.sln /p:Configuration=Release /p:Platform=x86 /t:Clean 20 | MSBuild MGSM2Fix.sln /p:Configuration=Release /p:Platform=x64 /t:Clean 21 | 22 | MSBuild MGSM2Fix.sln /p:Configuration=Release /p:Platform=x86 23 | MSBuild MGSM2Fix.sln /p:Configuration=Release /p:Platform=x64 24 | 25 | rd /S /Q dist\ 26 | md dist\ 27 | 28 | xcopy /I /Y res\ dist\ 29 | xcopy /-I /Y MGSM2Fix.ini dist\MGSM2Fix.ini 30 | xcopy /-I /Y Release\MGSM2Fix.asi dist\MGSM2Fix32.asi 31 | xcopy /-I /Y x64\Release\MGSM2Fix.asi dist\MGSM2Fix64.asi 32 | 33 | del /S /Q MGSM2Fix.zip 34 | 35 | powershell -command "Compress-Archive -Path 'dist\*' -DestinationPath 'MGSM2Fix.zip'" 36 | -------------------------------------------------------------------------------- /MGSM2Fix.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuggslet/MGSM2Fix/0a58fa5c5f191e80243df79bd66bac7e4ebb0857/MGSM2Fix.rc -------------------------------------------------------------------------------- /MGSM2Fix.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.3.32901.215 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MGSM2Fix", "MGSM2Fix.vcxproj", "{C6644269-B721-4F94-BE7F-77BFB2343BA5}" 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 | {C6644269-B721-4F94-BE7F-77BFB2343BA5}.Debug|x64.ActiveCfg = Debug|x64 17 | {C6644269-B721-4F94-BE7F-77BFB2343BA5}.Debug|x64.Build.0 = Debug|x64 18 | {C6644269-B721-4F94-BE7F-77BFB2343BA5}.Debug|x64.Deploy.0 = Debug|x64 19 | {C6644269-B721-4F94-BE7F-77BFB2343BA5}.Debug|x86.ActiveCfg = Debug|Win32 20 | {C6644269-B721-4F94-BE7F-77BFB2343BA5}.Debug|x86.Build.0 = Debug|Win32 21 | {C6644269-B721-4F94-BE7F-77BFB2343BA5}.Debug|x86.Deploy.0 = Debug|Win32 22 | {C6644269-B721-4F94-BE7F-77BFB2343BA5}.Release|x64.ActiveCfg = Release|x64 23 | {C6644269-B721-4F94-BE7F-77BFB2343BA5}.Release|x64.Build.0 = Release|x64 24 | {C6644269-B721-4F94-BE7F-77BFB2343BA5}.Release|x64.Deploy.0 = Release|x64 25 | {C6644269-B721-4F94-BE7F-77BFB2343BA5}.Release|x86.ActiveCfg = Release|Win32 26 | {C6644269-B721-4F94-BE7F-77BFB2343BA5}.Release|x86.Build.0 = Release|Win32 27 | {C6644269-B721-4F94-BE7F-77BFB2343BA5}.Release|x86.Deploy.0 = Release|Win32 28 | EndGlobalSection 29 | GlobalSection(SolutionProperties) = preSolution 30 | HideSolutionNode = FALSE 31 | EndGlobalSection 32 | GlobalSection(ExtensibilityGlobals) = postSolution 33 | SolutionGuid = {BD882CE7-25BA-4751-8EB4-4B14C55192CA} 34 | EndGlobalSection 35 | EndGlobal 36 | -------------------------------------------------------------------------------- /game_actions_2131630.vdf: -------------------------------------------------------------------------------- 1 | "In Game Actions" 2 | { 3 | "actions" 4 | { 5 | "InGameControls" 6 | { 7 | "title" "#Set_Ingame" 8 | "legacy_set" "0" 9 | "StickPadGyro" 10 | { 11 | "l_move" 12 | { 13 | "title" "#Action_LMove" 14 | "input_mode" "joystick_move" 15 | } 16 | "r_move" 17 | { 18 | "title" "#Action_RMove" 19 | "input_mode" "joystick_move" 20 | } 21 | } 22 | "Button" 23 | { 24 | "key_up" "#Action_Up" 25 | "key_down" "#Action_Down" 26 | "key_left" "#Action_Left" 27 | "key_right" "#Action_Right" 28 | "a_button" "#Action_A" 29 | "b_button" "#Action_B" 30 | "x_button" "#Action_X" 31 | "y_button" "#Action_Y" 32 | "start_button" "#Action_Start" 33 | "select_button" "#Action_Select" 34 | "l1_button" "#Action_L1" 35 | "l2_button" "#Action_L2" 36 | "l3_button" "#Action_L3" 37 | "r1_button" "#Action_R1" 38 | "r2_button" "#Action_R2" 39 | "r3_button" "#Action_R3" 40 | } 41 | } 42 | } 43 | "localization" 44 | { 45 | "english" 46 | { 47 | "Set_Ingame" "In-Game Controls" 48 | "Action_LMove" "LeftStick" 49 | "Action_RMove" "RightStick" 50 | "Action_Up" "Up" 51 | "Action_Down" "Down" 52 | "Action_Left" "Left" 53 | "Action_Right" "Right" 54 | "Action_A" "A Button" 55 | "Action_B" "B Button" 56 | "Action_X" "X Button" 57 | "Action_Y" "Y Button" 58 | "Action_Start" "Start Button" 59 | "Action_Select" "Select Button" 60 | "Action_L1" "L1 Button" 61 | "Action_L2" "L2 Button" 62 | "Action_L3" "L3 Button" 63 | "Action_R1" "R1 Button" 64 | "Action_R2" "R2 Button" 65 | "Action_R3" "R3 Button" 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /res/d3d11-x64.SHA512: -------------------------------------------------------------------------------- 1 | 2 | Algorithm : SHA512 3 | Hash : 1EA1D9856F9BB50B5FAFB5207B616A9D8D3BEBDC7C76217C1B23ED9EE2413FEF9DE429E80B4A0B1EC57707F7B4681CC096E4EFB0056723C513FA78415ABC5870 4 | Path : D:\a\Ultimate-ASI-Loader\Ultimate-ASI-Loader\bin\x64\Release\d3d11.dll 5 | 6 | -------------------------------------------------------------------------------- /res/d3d11.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuggslet/MGSM2Fix/0a58fa5c5f191e80243df79bd66bac7e4ebb0857/res/d3d11.dll -------------------------------------------------------------------------------- /res/dinput8-Win32.SHA512: -------------------------------------------------------------------------------- 1 | 2 | Algorithm : SHA512 3 | Hash : 7F95ABD6E0CA07E9AAED47C4D8A105A5B16BD6DF7D65EE654AC2AB3070E35CDC8E3A38ED4305C625493797BAA0C7BEC4070394116EBEE98CB0365A433F6A5C9D 4 | Path : D:\a\Ultimate-ASI-Loader\Ultimate-ASI-Loader\bin\Win32\Release\dinput8.dll 5 | 6 | -------------------------------------------------------------------------------- /res/dinput8.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuggslet/MGSM2Fix/0a58fa5c5f191e80243df79bd66bac7e4ebb0857/res/dinput8.dll -------------------------------------------------------------------------------- /resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Visual C++ generated include file. 3 | // Used by MGSM2Fix.rc 4 | // 5 | #define IDR_NUT1 105 6 | #define IDR_HLSL1 106 7 | #define IDR_HLSL2 107 8 | 9 | // Next default values for new objects 10 | // 11 | #ifdef APSTUDIO_INVOKED 12 | #ifndef APSTUDIO_READONLY_SYMBOLS 13 | #define _APS_NEXT_RESOURCE_VALUE 108 14 | #define _APS_NEXT_COMMAND_VALUE 40001 15 | #define _APS_NEXT_CONTROL_VALUE 1001 16 | #define _APS_NEXT_SYMED_VALUE 101 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /src/FunctionTraits/LICENSE: -------------------------------------------------------------------------------- 1 | See https://www.hexadigm.com/GenericLib/License.html -------------------------------------------------------------------------------- /src/analog.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "m2fixbase.h" 4 | 5 | class Analog : public M2FixBase 6 | { 7 | public: 8 | static auto & GetInstance() 9 | { 10 | static Analog instance; 11 | return instance; 12 | } 13 | 14 | static void LoadInstance() { 15 | GetInstance().Load(); 16 | } 17 | 18 | virtual void Load() override; 19 | }; 20 | -------------------------------------------------------------------------------- /src/borderless.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "m2fixbase.h" 4 | 5 | class Borderless : public M2FixBase 6 | { 7 | public: 8 | static auto & GetInstance() 9 | { 10 | static Borderless instance; 11 | return instance; 12 | } 13 | 14 | static void LoadInstance() { 15 | GetInstance().Load(); 16 | } 17 | 18 | virtual void Load() override; 19 | }; 20 | -------------------------------------------------------------------------------- /src/config.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "m2fixbase.h" 4 | 5 | template 6 | class M2InteropBasicString; 7 | using M2InteropString = M2InteropBasicString; 8 | 9 | class Config : public M2FixBase 10 | { 11 | public: 12 | static auto & GetInstance() 13 | { 14 | static Config instance; 15 | return instance; 16 | } 17 | 18 | static void LoadInstance() { 19 | GetInstance().Load(); 20 | } 21 | 22 | virtual void Load() override; 23 | 24 | private: 25 | #ifdef _WIN64 26 | static const char *GetCfgValue(uintptr_t *ctx, const M2InteropString id); 27 | static int GetCfgValueEx(uintptr_t *ctx, const M2InteropString *id); 28 | 29 | #else 30 | static const char * __fastcall GetCfgValue(uintptr_t *ctx, uintptr_t _EDX, const M2InteropString id, uintptr_t index); 31 | static int __fastcall GetCfgValueEx(uintptr_t *ctx, uintptr_t _EDX, const M2InteropString *id); 32 | #endif 33 | }; 34 | -------------------------------------------------------------------------------- /src/d3d11PixelUpscaler.hlsl: -------------------------------------------------------------------------------- 1 | Texture2D sourceTex : register(t0); 2 | SamplerState samLinear : register(s0); 3 | 4 | float4 main(float2 uv : TEXCOORD) : SV_Target 5 | { 6 | return sourceTex.Sample(samLinear, uv); 7 | } 8 | -------------------------------------------------------------------------------- /src/d3d11VertexUpscaler.hlsl: -------------------------------------------------------------------------------- 1 | struct VS_OUT { 2 | float2 uv : TEXCOORD0; 3 | float4 pos : SV_POSITION; 4 | }; 5 | 6 | VS_OUT main(uint vertexId : SV_VertexID) 7 | { 8 | float2 pos[3] = { 9 | float2(-1.0f, -1.0f), 10 | float2(-1.0f, 3.0f), 11 | float2( 3.0f, -1.0f) 12 | }; 13 | 14 | float2 uv[3] = { 15 | float2(0.0f, 0.0f), 16 | float2(0.0f, 2.0f), 17 | float2(2.0f, 0.0f) 18 | }; 19 | 20 | VS_OUT output; 21 | output.uv = uv[vertexId]; 22 | output.uv = float2(output.uv.x, 1.0f - output.uv.y); 23 | output.pos = float4(pos[vertexId], 0.0f, 1.0f); 24 | return output; 25 | } 26 | -------------------------------------------------------------------------------- /src/dllmain.cpp: -------------------------------------------------------------------------------- 1 | #include "m2fix.h" 2 | 3 | DWORD WINAPI ThreadProc(LPVOID lpThreadParameter) 4 | { 5 | HINSTANCE hinstDLL = reinterpret_cast(lpThreadParameter); 6 | M2Fix::Main(hinstDLL); 7 | 8 | M2Utils::memsetRelease(); 9 | return 1; 10 | } 11 | 12 | void Main(HINSTANCE hinstDLL) 13 | { 14 | M2Utils::memsetHook(); 15 | 16 | HANDLE handle = CreateThread(NULL, 0, ThreadProc, hinstDLL, NULL, 0); 17 | if (!handle) return; 18 | 19 | SetThreadPriority(handle, THREAD_PRIORITY_HIGHEST); 20 | CloseHandle(handle); 21 | 22 | // fixes the monitor going to sleep during cutscenes 23 | SetThreadExecutionState(ES_CONTINUOUS | ES_SYSTEM_REQUIRED | ES_DISPLAY_REQUIRED); 24 | } 25 | 26 | BOOL APIENTRY DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved) 27 | { 28 | switch (fdwReason) 29 | { 30 | case DLL_PROCESS_ATTACH: 31 | { 32 | Main(hinstDLL); 33 | break; 34 | } 35 | 36 | case DLL_THREAD_ATTACH: 37 | case DLL_THREAD_DETACH: 38 | case DLL_PROCESS_DETACH: 39 | break; 40 | } 41 | 42 | return TRUE; 43 | } 44 | -------------------------------------------------------------------------------- /src/epi.cpp: -------------------------------------------------------------------------------- 1 | #include "m2fix.h" 2 | #include "epi.h" 3 | 4 | void EPI::Print(const char *fmt, ...) 5 | { 6 | static std::string buffer; 7 | 8 | va_list va; 9 | va_start(va, fmt); 10 | std::vector buf(_vscprintf(fmt, va) + 1, 0); 11 | char *data = buf.data(); 12 | vsprintf(data, fmt, va); 13 | va_end(va); 14 | 15 | if (data[strcspn(data, "\r\n")] == 0) { 16 | buffer += std::string(data); 17 | return; 18 | } 19 | 20 | data[strcspn(data, "\r\n")] = 0; 21 | buffer += std::string(data); 22 | if (buffer.length() == 0) return; 23 | 24 | spdlog::info("[EPI] [printf] {}", buffer); 25 | buffer.clear(); 26 | } 27 | 28 | void EPI::Load() 29 | { 30 | std::string module; 31 | switch (M2Fix::Game()) 32 | { 33 | case M2FixGame::MGS1: 34 | case M2FixGame::Contra: 35 | case M2FixGame::Dracula: 36 | case M2FixGame::DraculaAdvance: 37 | case M2FixGame::Darius: 38 | case M2FixGame::Darius101: 39 | { 40 | M2Hook::GetInstance(module).Hook( 41 | "8B 4C 24 04 8D 54 24 08 E8 ?? ?? FF FF 85 C0 74", 42 | 0, Print, "[EPI-32] printf" 43 | ); 44 | 45 | break; 46 | } 47 | 48 | case M2FixGame::DraculaDominus: 49 | module = "emu_integration"; 50 | [[fallthrough]]; 51 | case M2FixGame::MGSR: 52 | case M2FixGame::Ray: 53 | { 54 | M2Hook::GetInstance(module).Hook( 55 | "48 89 4C 24 08 48 89 54 24 10 4C 89 44 24 18 4C " 56 | "89 4C 24 20 48 83 EC 28 48 8D 54 24 38 E8 ?? ?? " 57 | "?? ?? 48 85 C0 74 08 48 8B C8 E8 ?? ??", 58 | 0, Print, "[EPI-64] printf" 59 | ); 60 | 61 | break; 62 | } 63 | 64 | default: break; 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/epi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "m2fixbase.h" 4 | 5 | class EPI : public M2FixBase 6 | { 7 | public: 8 | static auto & GetInstance() 9 | { 10 | static EPI instance; 11 | return instance; 12 | } 13 | 14 | static void LoadInstance() { 15 | GetInstance().Load(); 16 | } 17 | 18 | virtual void Load() override; 19 | 20 | private: 21 | static void Print(const char *fmt, ...); 22 | }; 23 | -------------------------------------------------------------------------------- /src/imgui/.editorconfig: -------------------------------------------------------------------------------- 1 | # See http://editorconfig.org to read about the EditorConfig format. 2 | # - In theory automatically supported by VS2017+ and most common IDE or text editors. 3 | # - In practice VS2019-VS2022 stills don't trim trailing whitespaces correctly :( 4 | # - Suggest installing this to trim whitespaces: 5 | # GitHub https://github.com/madskristensen/TrailingWhitespace 6 | # VS2019 https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespaceVisualizer 7 | # VS2022 https://marketplace.visualstudio.com/items?itemName=MadsKristensen.TrailingWhitespace64 8 | # (in spite of its name doesn't only visualize but also trims) 9 | # - Alternative for older VS2010 to VS2015: https://marketplace.visualstudio.com/items?itemName=EditorConfigTeam.EditorConfig 10 | 11 | # top-most EditorConfig file 12 | root = true 13 | 14 | # Default settings: 15 | # Use 4 spaces as indentation 16 | [*] 17 | indent_style = space 18 | indent_size = 4 19 | insert_final_newline = true 20 | trim_trailing_whitespace = true 21 | 22 | [imstb_*] 23 | indent_size = 3 24 | trim_trailing_whitespace = false 25 | 26 | [Makefile] 27 | indent_style = tab 28 | indent_size = 4 29 | -------------------------------------------------------------------------------- /src/imgui/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=auto 2 | 3 | *.c text 4 | *.cpp text 5 | *.h text 6 | *.m text 7 | *.mm text 8 | *.md text 9 | *.txt text 10 | *.html text 11 | *.bat text 12 | *.frag text 13 | *.vert text 14 | *.mkb text 15 | *.icf text 16 | 17 | *.sln text eol=crlf 18 | *.vcxproj text eol=crlf 19 | *.vcxproj.filters text eol=crlf 20 | *.natvis text eol=crlf 21 | 22 | Makefile text eol=lf 23 | *.sh text eol=lf 24 | *.pbxproj text eol=lf 25 | *.storyboard text eol=lf 26 | *.plist text eol=lf 27 | 28 | *.png binary 29 | *.ttf binary 30 | *.lib binary 31 | -------------------------------------------------------------------------------- /src/imgui/.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | custom: ['https://github.com/ocornut/imgui/wiki/Funding'] 2 | -------------------------------------------------------------------------------- /src/imgui/.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | blank_issues_enabled: false 2 | -------------------------------------------------------------------------------- /src/imgui/.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | (Click "Preview" to turn any http URL into a clickable link) 2 | 3 | 1. PLEASE CAREFULLY READ: [Contributing Guidelines](https://github.com/ocornut/imgui/blob/master/docs/CONTRIBUTING.md) 4 | 5 | 2. Make sure you're using a special branch just for this pull request. (Sometimes people unknowingly use a default branch, then later update that branch, which updates the pull request with the other changes if it hasn't been merged yet.) 6 | 7 | 3. Clear this template before submitting your PR. 8 | 9 | -------------------------------------------------------------------------------- /src/imgui/.github/workflows/manual.yml: -------------------------------------------------------------------------------- 1 | # 2 | # This is a dummy workflow used to trigger full builds manually. 3 | # 4 | name: manual 5 | 6 | on: workflow_dispatch 7 | 8 | jobs: 9 | manual: 10 | runs-on: ubuntu-latest 11 | steps: 12 | - run: exit 0 13 | -------------------------------------------------------------------------------- /src/imgui/.github/workflows/scheduled.yml: -------------------------------------------------------------------------------- 1 | # 2 | # This is a dummy workflow used to trigger scheduled builds. Forked repositories most likely should disable this 3 | # workflow to avoid daily builds of inactive repositories. 4 | # 5 | name: scheduled 6 | 7 | on: 8 | schedule: 9 | - cron: '0 9 * * *' 10 | 11 | jobs: 12 | scheduled: 13 | runs-on: ubuntu-latest 14 | steps: 15 | - run: exit 0 16 | -------------------------------------------------------------------------------- /src/imgui/LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014-2025 Omar Cornut 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 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/imgui/backends/imgui_impl_dx9.h: -------------------------------------------------------------------------------- 1 | // dear imgui: Renderer Backend for DirectX9 2 | // This needs to be used along with a Platform Backend (e.g. Win32) 3 | 4 | // Implemented features: 5 | // [X] Renderer: User texture binding. Use 'LPDIRECT3DTEXTURE9' as ImTextureID. Read the FAQ about ImTextureID! 6 | // [X] Renderer: Large meshes support (64k+ vertices) even with 16-bit indices (ImGuiBackendFlags_RendererHasVtxOffset). 7 | // [X] Renderer: IMGUI_USE_BGRA_PACKED_COLOR support, as this is the optimal color encoding for DirectX9. 8 | 9 | // You can use unmodified imgui_impl_* files in your project. See examples/ folder for examples of using this. 10 | // Prefer including the entire imgui/ repository into your project (either as a copy or as a submodule), and only build the backends you need. 11 | // Learn about Dear ImGui: 12 | // - FAQ https://dearimgui.com/faq 13 | // - Getting Started https://dearimgui.com/getting-started 14 | // - Documentation https://dearimgui.com/docs (same as your local docs/ folder). 15 | // - Introduction, links and more at the top of imgui.cpp 16 | 17 | #pragma once 18 | #include "imgui.h" // IMGUI_IMPL_API 19 | #ifndef IMGUI_DISABLE 20 | 21 | struct IDirect3DDevice9; 22 | 23 | // Follow "Getting Started" link and check examples/ folder to learn about using backends! 24 | IMGUI_IMPL_API bool ImGui_ImplDX9_Init(IDirect3DDevice9* device); 25 | IMGUI_IMPL_API void ImGui_ImplDX9_Shutdown(); 26 | IMGUI_IMPL_API void ImGui_ImplDX9_NewFrame(); 27 | IMGUI_IMPL_API void ImGui_ImplDX9_RenderDrawData(ImDrawData* draw_data); 28 | 29 | // Use if you want to reset your rendering device without losing Dear ImGui state. 30 | IMGUI_IMPL_API bool ImGui_ImplDX9_CreateDeviceObjects(); 31 | IMGUI_IMPL_API void ImGui_ImplDX9_InvalidateDeviceObjects(); 32 | 33 | #endif // #ifndef IMGUI_DISABLE 34 | -------------------------------------------------------------------------------- /src/imgui/backends/sdlgpu3/build_instructions.txt: -------------------------------------------------------------------------------- 1 | 2 | Instructions to rebuild imgui_impl_sdlgpu3_shaders.h 3 | (You don't need to copy this folder if you are using the backend as-is) 4 | 5 | 1) Compile the raw shader files to SPIRV: 6 | 7 | glslc -o vertex.spv -c shader.vert 8 | glslc -o fragment.spv -c shader.frag 9 | 10 | 11 | 2) Build SDL_shadercross (https://github.com/libsdl-org/SDL_shadercross) 12 | 13 | 14 | 3-A) Compiling for the Vulkan Driver: 15 | 16 | Nothing to do, you just need the previous vertex.spv/fragment.spv, proceed to step 4 17 | 18 | 19 | 3-B) Compiling for the DirectX 12 Driver: 20 | 21 | ./shadercross vertex.spv -s SPIRV -d DXBC -t vertex -e main -o vertex.dxbc 22 | ./shadercross fragment.spv -s SPIRV -d DXBC -t fragment -e main -o fragment.dxbc 23 | 24 | Proceed to step 4 25 | 26 | 27 | 3-C) Compiling for Metal (On windows you'll need the Metal Developer Tools for Windows, on linux you might use wine, but I never tested it): 28 | 29 | ./shadercross vertex.spv -s SPIRV -d MSL -t vertex -e main -o vertex.metal 30 | ./shadercross fragment.spv -s SPIRV -d MSL -t fragment -e main -o fragment.metal 31 | 32 | xcrun -sdk macosx metal -o vertex.ir -c vertex.metal 33 | xcrun -sdk macosx metal -o fragment.ir -c fragment.metal 34 | xcrun -sdk macosx metallib -o vertex.metallib -c vertex.ir 35 | xcrun -sdk macosx metallib -o fragment.metallib -c fragment.ir 36 | 37 | Proceed to step 4 38 | 39 | 40 | 4) Use a tool like https://notisrac.github.io/FileToCArray/ or misc/fonts/binary_to_compressed_c.cpp in imgui repository to convert the file to a uint8_t array. 41 | -------------------------------------------------------------------------------- /src/imgui/backends/sdlgpu3/shader.frag: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | layout(location = 0) out vec4 fColor; 3 | 4 | layout(set=2, binding=0) uniform sampler2D sTexture; 5 | 6 | layout(location = 0) in struct 7 | { 8 | vec4 Color; 9 | vec2 UV; 10 | } In; 11 | 12 | void main() 13 | { 14 | fColor = In.Color * texture(sTexture, In.UV.st); 15 | } 16 | -------------------------------------------------------------------------------- /src/imgui/backends/sdlgpu3/shader.vert: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | layout(location = 0) in vec2 aPos; 3 | layout(location = 1) in vec2 aUV; 4 | layout(location = 2) in vec4 aColor; 5 | 6 | layout(set=1,binding=0) uniform UBO 7 | { 8 | vec2 uScale; 9 | vec2 uTranslate; 10 | } ubo; 11 | 12 | layout(location = 0) out struct 13 | { 14 | vec4 Color; 15 | vec2 UV; 16 | } Out; 17 | 18 | void main() 19 | { 20 | Out.Color = aColor; 21 | Out.UV = aUV; 22 | gl_Position = vec4(aPos * ubo.uScale + ubo.uTranslate, 0, 1); 23 | gl_Position.y *= -1.0f; 24 | } 25 | -------------------------------------------------------------------------------- /src/imgui/backends/vulkan/build_instructions.txt: -------------------------------------------------------------------------------- 1 | 2 | Script to rebuild shaders stored inside imgui_impl_vulkan.h 3 | (You don't need to copy this folder if you are using the backend as-is) 4 | 5 | -------------------------------------------------------------------------------- /src/imgui/backends/vulkan/generate_spv.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ## -V: create SPIR-V binary 3 | ## -x: save binary output as text-based 32-bit hexadecimal numbers 4 | ## -o: output file 5 | glslangValidator -V -x -o glsl_shader.frag.u32 glsl_shader.frag 6 | glslangValidator -V -x -o glsl_shader.vert.u32 glsl_shader.vert 7 | -------------------------------------------------------------------------------- /src/imgui/backends/vulkan/glsl_shader.frag: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | layout(location = 0) out vec4 fColor; 3 | 4 | layout(set=0, binding=0) uniform sampler2D sTexture; 5 | 6 | layout(location = 0) in struct { 7 | vec4 Color; 8 | vec2 UV; 9 | } In; 10 | 11 | void main() 12 | { 13 | fColor = In.Color * texture(sTexture, In.UV.st); 14 | } 15 | -------------------------------------------------------------------------------- /src/imgui/backends/vulkan/glsl_shader.vert: -------------------------------------------------------------------------------- 1 | #version 450 core 2 | layout(location = 0) in vec2 aPos; 3 | layout(location = 1) in vec2 aUV; 4 | layout(location = 2) in vec4 aColor; 5 | 6 | layout(push_constant) uniform uPushConstant { 7 | vec2 uScale; 8 | vec2 uTranslate; 9 | } pc; 10 | 11 | out gl_PerVertex { 12 | vec4 gl_Position; 13 | }; 14 | 15 | layout(location = 0) out struct { 16 | vec4 Color; 17 | vec2 UV; 18 | } Out; 19 | 20 | void main() 21 | { 22 | Out.Color = aColor; 23 | Out.UV = aUV; 24 | gl_Position = vec4(aPos * pc.uScale + pc.uTranslate, 0, 1); 25 | } 26 | -------------------------------------------------------------------------------- /src/imgui/examples/README.txt: -------------------------------------------------------------------------------- 1 | See BACKENDS and EXAMPLES files in the docs/ folder, or on the web at: https://github.com/ocornut/imgui/tree/master/docs 2 | 3 | Backends = Helper code to facilitate integration with platforms/graphics api (used by Examples + should be used by your app). 4 | Examples = Standalone applications showcasing integration with platforms/graphics api. 5 | 6 | Some Examples have extra README files in their respective directory, please check them too! 7 | 8 | Once Dear ImGui is running (in either examples or your own application/game/engine), 9 | run and refer to ImGui::ShowDemoWindow() in imgui_demo.cpp for the end-user API. 10 | -------------------------------------------------------------------------------- /src/imgui/examples/example_allegro5/README.md: -------------------------------------------------------------------------------- 1 | 2 | # Configuration 3 | 4 | Dear ImGui outputs 16-bit vertex indices by default. 5 | Allegro doesn't support them natively, so we have two solutions: convert the indices manually in imgui_impl_allegro5.cpp, or compile dear imgui with 32-bit indices. 6 | You can either modify imconfig.h that comes with Dear ImGui (easier), or set a C++ preprocessor option IMGUI_USER_CONFIG to find to a filename. 7 | We are providing `imconfig_allegro5.h` that enables 32-bit indices. 8 | Note that the backend supports _BOTH_ 16-bit and 32-bit indices, but 32-bit indices will be slightly faster as they won't require a manual conversion. 9 | 10 | # How to Build 11 | 12 | ### On Ubuntu 14.04+ and macOS 13 | 14 | ```bash 15 | g++ -DIMGUI_USER_CONFIG=\"examples/example_allegro5/imconfig_allegro5.h\" -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_allegro5.cpp ../../imgui*.cpp -lallegro -lallegro_main -lallegro_primitives -o allegro5_example 16 | ``` 17 | 18 | On macOS, install Allegro with homebrew: `brew install allegro`. 19 | 20 | ### On Windows with Visual Studio's CLI 21 | 22 | You may install Allegro using vcpkg: 23 | ``` 24 | git clone https://github.com/Microsoft/vcpkg 25 | cd vcpkg 26 | bootstrap-vcpkg.bat 27 | vcpkg install allegro5 --triplet=x86-windows ; for win32 28 | vcpkg install allegro5 --triplet=x64-windows ; for win64 29 | vcpkg integrate install ; register include / libs in Visual Studio 30 | ``` 31 | 32 | Build: 33 | ``` 34 | set ALLEGRODIR=path_to_your_allegro5_folder 35 | cl /Zi /MD /utf-8 /I %ALLEGRODIR%\include /DIMGUI_USER_CONFIG=\"examples/example_allegro5/imconfig_allegro5.h\" /I .. /I ..\.. /I ..\..\backends main.cpp ..\..\backends\imgui_impl_allegro5.cpp ..\..\imgui*.cpp /link /LIBPATH:%ALLEGRODIR%\lib allegro-5.0.10-monolith-md.lib user32.lib 36 | ``` 37 | -------------------------------------------------------------------------------- /src/imgui/examples/example_allegro5/imconfig_allegro5.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // COMPILE-TIME OPTIONS FOR DEAR IMGUI ALLEGRO 5 EXAMPLE 3 | // See imconfig.h for the full template 4 | // Because Allegro doesn't support 16-bit vertex indices, we enable the compile-time option of imgui to use 32-bit indices 5 | //----------------------------------------------------------------------------- 6 | 7 | #pragma once 8 | 9 | // Use 32-bit vertex indices because Allegro doesn't support 16-bit ones 10 | // This allows us to avoid converting vertices format at runtime 11 | #define ImDrawIdx int 12 | -------------------------------------------------------------------------------- /src/imgui/examples/example_android_opengl3/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.6) 2 | 3 | project(ImGuiExample) 4 | 5 | set(CMAKE_CXX_STANDARD 11) 6 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 7 | set(CMAKE_CXX_EXTENSIONS OFF) 8 | 9 | add_library(${CMAKE_PROJECT_NAME} SHARED 10 | ${CMAKE_CURRENT_SOURCE_DIR}/main.cpp 11 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui.cpp 12 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui_demo.cpp 13 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui_draw.cpp 14 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui_tables.cpp 15 | ${CMAKE_CURRENT_SOURCE_DIR}/../../imgui_widgets.cpp 16 | ${CMAKE_CURRENT_SOURCE_DIR}/../../backends/imgui_impl_android.cpp 17 | ${CMAKE_CURRENT_SOURCE_DIR}/../../backends/imgui_impl_opengl3.cpp 18 | ${ANDROID_NDK}/sources/android/native_app_glue/android_native_app_glue.c 19 | ) 20 | 21 | set(CMAKE_SHARED_LINKER_FLAGS 22 | "${CMAKE_SHARED_LINKER_FLAGS} -u ANativeActivity_onCreate" 23 | ) 24 | 25 | target_compile_definitions(${CMAKE_PROJECT_NAME} PRIVATE 26 | IMGUI_IMPL_OPENGL_ES3 27 | ) 28 | 29 | target_include_directories(${CMAKE_PROJECT_NAME} PRIVATE 30 | ${CMAKE_CURRENT_SOURCE_DIR}/../.. 31 | ${CMAKE_CURRENT_SOURCE_DIR}/../../backends 32 | ${ANDROID_NDK}/sources/android/native_app_glue 33 | ) 34 | 35 | target_link_libraries(${CMAKE_PROJECT_NAME} PRIVATE 36 | android 37 | EGL 38 | GLESv3 39 | log 40 | ) 41 | -------------------------------------------------------------------------------- /src/imgui/examples/example_android_opengl3/android/.gitignore: -------------------------------------------------------------------------------- 1 | .cxx 2 | .externalNativeBuild 3 | build/ 4 | *.iml 5 | 6 | .idea 7 | .gradle 8 | local.properties 9 | 10 | # Android Studio puts a Gradle wrapper here, that we don't want: 11 | gradle/ 12 | gradlew* 13 | -------------------------------------------------------------------------------- /src/imgui/examples/example_android_opengl3/android/app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | apply plugin: 'kotlin-android' 3 | 4 | android { 5 | compileSdkVersion 33 6 | buildToolsVersion "33.0.2" 7 | ndkVersion "25.2.9519653" 8 | 9 | defaultConfig { 10 | applicationId "imgui.example.android" 11 | namespace "imgui.example.android" 12 | minSdkVersion 24 13 | targetSdkVersion 33 14 | versionCode 1 15 | versionName "1.0" 16 | } 17 | 18 | buildTypes { 19 | release { 20 | minifyEnabled false 21 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt') 22 | } 23 | } 24 | 25 | compileOptions { 26 | sourceCompatibility JavaVersion.VERSION_11 27 | targetCompatibility JavaVersion.VERSION_11 28 | } 29 | 30 | kotlinOptions { 31 | jvmTarget="11" 32 | } 33 | 34 | externalNativeBuild { 35 | cmake { 36 | path "../../CMakeLists.txt" 37 | version '3.22.1' 38 | } 39 | } 40 | } 41 | repositories { 42 | mavenCentral() 43 | } 44 | dependencies { 45 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 46 | } 47 | -------------------------------------------------------------------------------- /src/imgui/examples/example_android_opengl3/android/app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 9 | 10 | 15 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /src/imgui/examples/example_android_opengl3/android/app/src/main/java/MainActivity.kt: -------------------------------------------------------------------------------- 1 | package imgui.example.android 2 | 3 | import android.app.NativeActivity 4 | import android.os.Bundle 5 | import android.content.Context 6 | import android.view.inputmethod.InputMethodManager 7 | import android.view.KeyEvent 8 | import java.util.concurrent.LinkedBlockingQueue 9 | 10 | class MainActivity : NativeActivity() { 11 | public override fun onCreate(savedInstanceState: Bundle?) { 12 | super.onCreate(savedInstanceState) 13 | } 14 | 15 | fun showSoftInput() { 16 | val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager 17 | inputMethodManager.showSoftInput(this.window.decorView, 0) 18 | } 19 | 20 | fun hideSoftInput() { 21 | val inputMethodManager = getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager 22 | inputMethodManager.hideSoftInputFromWindow(this.window.decorView.windowToken, 0) 23 | } 24 | 25 | // Queue for the Unicode characters to be polled from native code (via pollUnicodeChar()) 26 | private var unicodeCharacterQueue: LinkedBlockingQueue = LinkedBlockingQueue() 27 | 28 | // We assume dispatchKeyEvent() of the NativeActivity is actually called for every 29 | // KeyEvent and not consumed by any View before it reaches here 30 | override fun dispatchKeyEvent(event: KeyEvent): Boolean { 31 | if (event.action == KeyEvent.ACTION_DOWN) { 32 | unicodeCharacterQueue.offer(event.getUnicodeChar(event.metaState)) 33 | } 34 | return super.dispatchKeyEvent(event) 35 | } 36 | 37 | fun pollUnicodeChar(): Int { 38 | return unicodeCharacterQueue.poll() ?: 0 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/imgui/examples/example_android_opengl3/android/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | ext.kotlin_version = '1.8.0' 3 | repositories { 4 | google() 5 | mavenCentral() 6 | 7 | } 8 | dependencies { 9 | classpath 'com.android.tools.build:gradle:7.4.1' 10 | classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" 11 | 12 | } 13 | } 14 | 15 | allprojects { 16 | repositories { 17 | google() 18 | mavenCentral() 19 | } 20 | } 21 | 22 | task clean(type: Delete) { 23 | delete rootProject.buildDir 24 | } 25 | -------------------------------------------------------------------------------- /src/imgui/examples/example_android_opengl3/android/settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /src/imgui/examples/example_apple_metal/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for example_apple_metal, for macOS only (**not iOS**) 2 | CXX = clang++ 3 | EXE = example_apple_metal 4 | IMGUI_DIR = ../../ 5 | SOURCES = main.mm 6 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 7 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_osx.mm $(IMGUI_DIR)/backends/imgui_impl_metal.mm 8 | 9 | CXXFLAGS = -std=c++11 -ObjC++ -fobjc-arc -Wall -Wextra -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 10 | FRAMEWORKS = -framework AppKit -framework Metal -framework MetalKit -framework QuartzCore -framework GameController 11 | 12 | all: $(EXE) 13 | 14 | $(EXE): $(SOURCES) 15 | $(CXX) $(CXXFLAGS) $^ $(FRAMEWORKS) -o $@ 16 | 17 | run: all 18 | ./$(EXE) 19 | 20 | clean: 21 | rm -f $(EXE) *.o 22 | -------------------------------------------------------------------------------- /src/imgui/examples/example_apple_metal/README.md: -------------------------------------------------------------------------------- 1 | # iOS / OSX Metal example 2 | 3 | ## Introduction 4 | 5 | This example shows how to integrate Dear ImGui with Metal. It is based on the "cross-platform" game template provided with Xcode as of Xcode 9. 6 | 7 | Consider basing your work off the example_glfw_metal/ or example_sdl2_metal/ examples. They are better supported and will be portable unlike this one. 8 | 9 | 10 | 11 | -------------------------------------------------------------------------------- /src/imgui/examples/example_apple_metal/iOS/Info-iOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIdentifier 10 | $(PRODUCT_BUNDLE_IDENTIFIER) 11 | CFBundleInfoDictionaryVersion 12 | 6.0 13 | CFBundleName 14 | imgui 15 | CFBundlePackageType 16 | APPL 17 | CFBundleShortVersionString 18 | 1.0 19 | CFBundleVersion 20 | 1 21 | LSRequiresIPhoneOS 22 | 23 | UILaunchStoryboardName 24 | LaunchScreen 25 | UIRequiredDeviceCapabilities 26 | 27 | armv7 28 | metal 29 | 30 | UIRequiresFullScreen 31 | 32 | UIStatusBarHidden 33 | 34 | UISupportedInterfaceOrientations 35 | 36 | UIInterfaceOrientationPortrait 37 | UIInterfaceOrientationLandscapeLeft 38 | UIInterfaceOrientationLandscapeRight 39 | UIInterfaceOrientationPortraitUpsideDown 40 | 41 | UISupportedInterfaceOrientations~ipad 42 | 43 | UIInterfaceOrientationPortrait 44 | UIInterfaceOrientationPortraitUpsideDown 45 | UIInterfaceOrientationLandscapeLeft 46 | UIInterfaceOrientationLandscapeRight 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /src/imgui/examples/example_apple_metal/macOS/Info-macOS.plist: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | CFBundleDevelopmentRegion 6 | $(DEVELOPMENT_LANGUAGE) 7 | CFBundleExecutable 8 | $(EXECUTABLE_NAME) 9 | CFBundleIconFile 10 | 11 | CFBundleIdentifier 12 | $(PRODUCT_BUNDLE_IDENTIFIER) 13 | CFBundleInfoDictionaryVersion 14 | 6.0 15 | CFBundleName 16 | imgui 17 | CFBundlePackageType 18 | APPL 19 | CFBundleShortVersionString 20 | 1.0 21 | CFBundleVersion 22 | 1 23 | LSMinimumSystemVersion 24 | $(MACOSX_DEPLOYMENT_TARGET) 25 | NSMainStoryboardFile 26 | MainMenu 27 | NSPrincipalClass 28 | NSApplication 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/imgui/examples/example_apple_opengl2/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile for example_apple_metal, for macOS only (**not iOS**) 2 | CXX = clang++ 3 | EXE = example_apple_opengl2 4 | IMGUI_DIR = ../../ 5 | SOURCES = main.mm 6 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 7 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_osx.mm $(IMGUI_DIR)/backends/imgui_impl_opengl2.cpp 8 | 9 | CXXFLAGS = -std=c++11 -ObjC++ -fobjc-arc -Wall -Wextra -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends 10 | FRAMEWORKS = -framework Cocoa -framework OpenGL -framework GameController 11 | 12 | all: $(EXE) 13 | 14 | $(EXE): $(SOURCES) 15 | $(CXX) $(CXXFLAGS) $(SOURCES) -o $(EXE) $(FRAMEWORKS) 16 | 17 | run: all 18 | ./$(EXE) 19 | 20 | clean: 21 | rm -f $(EXE) *.o 22 | -------------------------------------------------------------------------------- /src/imgui/examples/example_glfw_metal/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # You will need GLFW (http://www.glfw.org): 3 | # brew install glfw 4 | # 5 | 6 | #CXX = g++ 7 | #CXX = clang++ 8 | 9 | EXE = example_glfw_metal 10 | IMGUI_DIR = ../.. 11 | SOURCES = main.mm 12 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 13 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_glfw.cpp $(IMGUI_DIR)/backends/imgui_impl_metal.mm 14 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 15 | 16 | LIBS = -framework Metal -framework MetalKit -framework Cocoa -framework IOKit -framework CoreVideo -framework QuartzCore 17 | LIBS += -L/usr/local/lib -L/opt/homebrew/lib -L/opt/local/lib 18 | LIBS += -lglfw 19 | 20 | CXXFLAGS = -std=c++11 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends -I/usr/local/include -I/opt/homebrew/include -I/opt/local/include 21 | CXXFLAGS += -Wall -Wformat 22 | CFLAGS = $(CXXFLAGS) 23 | 24 | %.o:%.cpp 25 | $(CXX) $(CXXFLAGS) -c -o $@ $< 26 | 27 | %.o:$(IMGUI_DIR)/%.cpp 28 | $(CXX) $(CXXFLAGS) -c -o $@ $< 29 | 30 | %.o:$(IMGUI_DIR)/backends/%.cpp 31 | $(CXX) $(CXXFLAGS) -c -o $@ $< 32 | 33 | %.o:%.mm 34 | $(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $< 35 | 36 | %.o:$(IMGUI_DIR)/backends/%.mm 37 | $(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $< 38 | 39 | all: $(EXE) 40 | @echo Build complete 41 | 42 | $(EXE): $(OBJS) 43 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 44 | 45 | clean: 46 | rm -f $(EXE) $(OBJS) 47 | -------------------------------------------------------------------------------- /src/imgui/examples/example_glfw_opengl2/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_glfw_opengl2 4 | @set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-32 glfw3.lib opengl32.lib gdi32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /src/imgui/examples/example_glfw_opengl3/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_glfw_opengl3 4 | @set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-32 glfw3.lib opengl32.lib gdi32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /src/imgui/examples/example_glfw_vulkan/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Example usage: 2 | # mkdir build 3 | # cd build 4 | # cmake -g "Visual Studio 14 2015" .. 5 | 6 | cmake_minimum_required(VERSION 2.8) 7 | project(imgui_example_glfw_vulkan C CXX) 8 | 9 | if(NOT CMAKE_BUILD_TYPE) 10 | set(CMAKE_BUILD_TYPE Debug CACHE STRING "" FORCE) 11 | endif() 12 | 13 | set(CMAKE_CXX_STANDARD 11) 14 | set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DVK_PROTOTYPES") 15 | set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DVK_PROTOTYPES") 16 | 17 | # GLFW 18 | if(NOT GLFW_DIR) 19 | set(GLFW_DIR ../../../glfw) # Set this to point to an up-to-date GLFW repo 20 | endif() 21 | option(GLFW_BUILD_EXAMPLES "Build the GLFW example programs" OFF) 22 | option(GLFW_BUILD_TESTS "Build the GLFW test programs" OFF) 23 | option(GLFW_BUILD_DOCS "Build the GLFW documentation" OFF) 24 | option(GLFW_INSTALL "Generate installation target" OFF) 25 | option(GLFW_DOCUMENT_INTERNALS "Include internals in documentation" OFF) 26 | add_subdirectory(${GLFW_DIR} binary_dir EXCLUDE_FROM_ALL) 27 | include_directories(${GLFW_DIR}/include) 28 | 29 | # Dear ImGui 30 | set(IMGUI_DIR ../../) 31 | include_directories(${IMGUI_DIR} ${IMGUI_DIR}/backends ..) 32 | 33 | # Libraries 34 | find_package(Vulkan REQUIRED) 35 | #find_library(VULKAN_LIBRARY 36 | #NAMES vulkan vulkan-1) 37 | #set(LIBRARIES "glfw;${VULKAN_LIBRARY}") 38 | set(LIBRARIES "glfw;Vulkan::Vulkan") 39 | 40 | # Use vulkan headers from glfw: 41 | include_directories(${GLFW_DIR}/deps) 42 | 43 | file(GLOB sources *.cpp) 44 | 45 | add_executable(example_glfw_vulkan ${sources} ${IMGUI_DIR}/backends/imgui_impl_glfw.cpp ${IMGUI_DIR}/backends/imgui_impl_vulkan.cpp ${IMGUI_DIR}/imgui.cpp ${IMGUI_DIR}/imgui_draw.cpp ${IMGUI_DIR}/imgui_demo.cpp ${IMGUI_DIR}/imgui_tables.cpp ${IMGUI_DIR}/imgui_widgets.cpp) 46 | target_link_libraries(example_glfw_vulkan ${LIBRARIES}) 47 | 48 | -------------------------------------------------------------------------------- /src/imgui/examples/example_glfw_vulkan/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | 3 | @set OUT_EXE=example_glfw_vulkan 4 | @set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include /I %VULKAN_SDK%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-32 /libpath:%VULKAN_SDK%\lib32 glfw3.lib opengl32.lib gdi32.lib shell32.lib vulkan-1.lib 7 | 8 | @set OUT_DIR=Debug 9 | mkdir %OUT_DIR% 10 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 11 | 12 | @set OUT_DIR=Release 13 | mkdir %OUT_DIR% 14 | cl /nologo /Zi /MD /utf-8 /Ox /Oi %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 15 | -------------------------------------------------------------------------------- /src/imgui/examples/example_glfw_vulkan/build_win64.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars64.bat or vcvarsall.bat to setup 64-bit command-line compiler. 2 | 3 | @set OUT_EXE=example_glfw_vulkan 4 | @set INCLUDES=/I..\.. /I..\..\backends /I..\libs\glfw\include /I %VULKAN_SDK%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\backends\imgui_impl_glfw.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:..\libs\glfw\lib-vc2010-64 /libpath:%VULKAN_SDK%\lib glfw3.lib opengl32.lib gdi32.lib shell32.lib vulkan-1.lib 7 | 8 | @set OUT_DIR=Debug 9 | mkdir %OUT_DIR% 10 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 11 | 12 | @set OUT_DIR=Release 13 | mkdir %OUT_DIR% 14 | cl /nologo /Zi /MD /utf-8 /Ox /Oi %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 15 | -------------------------------------------------------------------------------- /src/imgui/examples/example_null/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | mkdir Debug 3 | cl /nologo /Zi /MD /utf-8 /I ..\.. %* *.cpp ..\..\*.cpp /FeDebug/example_null.exe /FoDebug/ /link gdi32.lib shell32.lib imm32.lib 4 | -------------------------------------------------------------------------------- /src/imgui/examples/example_null/main.cpp: -------------------------------------------------------------------------------- 1 | // dear imgui: "null" example application 2 | // (compile and link imgui, create context, run headless with NO INPUTS, NO GRAPHICS OUTPUT) 3 | // This is useful to test building, but you cannot interact with anything here! 4 | #include "imgui.h" 5 | #include 6 | 7 | int main(int, char**) 8 | { 9 | IMGUI_CHECKVERSION(); 10 | ImGui::CreateContext(); 11 | ImGuiIO& io = ImGui::GetIO(); 12 | 13 | // Build atlas 14 | unsigned char* tex_pixels = nullptr; 15 | int tex_w, tex_h; 16 | io.Fonts->GetTexDataAsRGBA32(&tex_pixels, &tex_w, &tex_h); 17 | 18 | for (int n = 0; n < 20; n++) 19 | { 20 | printf("NewFrame() %d\n", n); 21 | io.DisplaySize = ImVec2(1920, 1080); 22 | io.DeltaTime = 1.0f / 60.0f; 23 | ImGui::NewFrame(); 24 | 25 | static float f = 0.0f; 26 | ImGui::Text("Hello, world!"); 27 | ImGui::SliderFloat("float", &f, 0.0f, 1.0f); 28 | ImGui::Text("Application average %.3f ms/frame (%.1f FPS)", 1000.0f / io.Framerate, io.Framerate); 29 | ImGui::ShowDemoWindow(nullptr); 30 | 31 | ImGui::Render(); 32 | } 33 | 34 | printf("DestroyContext()\n"); 35 | ImGui::DestroyContext(); 36 | return 0; 37 | } 38 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl2_directx11/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl2_directx11 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I "%DXSDK_DIR%Include" 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_dx11.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib /LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d11.lib d3dcompiler.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl2_metal/Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # You will need SDL2 (http://www.libsdl.org): 3 | # brew install sdl2 4 | # 5 | 6 | #CXX = g++ 7 | #CXX = clang++ 8 | 9 | EXE = example_sdl2_metal 10 | IMGUI_DIR = ../.. 11 | SOURCES = main.mm 12 | SOURCES += $(IMGUI_DIR)/imgui.cpp $(IMGUI_DIR)/imgui_demo.cpp $(IMGUI_DIR)/imgui_draw.cpp $(IMGUI_DIR)/imgui_tables.cpp $(IMGUI_DIR)/imgui_widgets.cpp 13 | SOURCES += $(IMGUI_DIR)/backends/imgui_impl_sdl2.cpp $(IMGUI_DIR)/backends/imgui_impl_metal.mm 14 | OBJS = $(addsuffix .o, $(basename $(notdir $(SOURCES)))) 15 | 16 | LIBS = -framework Metal -framework MetalKit -framework Cocoa -framework IOKit -framework CoreVideo -framework QuartzCore 17 | LIBS += `sdl2-config --libs` 18 | LIBS += -L/usr/local/lib 19 | 20 | CXXFLAGS = -std=c++11 -I$(IMGUI_DIR) -I$(IMGUI_DIR)/backends -I/usr/local/include 21 | CXXFLAGS += `sdl2-config --cflags` 22 | CXXFLAGS += -Wall -Wformat 23 | CFLAGS = $(CXXFLAGS) 24 | 25 | %.o:%.cpp 26 | $(CXX) $(CXXFLAGS) -c -o $@ $< 27 | 28 | %.o:$(IMGUI_DIR)/%.cpp 29 | $(CXX) $(CXXFLAGS) -c -o $@ $< 30 | 31 | %.o:$(IMGUI_DIR)/backends/%.cpp 32 | $(CXX) $(CXXFLAGS) -c -o $@ $< 33 | 34 | %.o:%.mm 35 | $(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $< 36 | 37 | %.o:$(IMGUI_DIR)/backends/%.mm 38 | $(CXX) $(CXXFLAGS) -ObjC++ -fobjc-weak -fobjc-arc -c -o $@ $< 39 | 40 | all: $(EXE) 41 | @echo Build complete 42 | 43 | $(EXE): $(OBJS) 44 | $(CXX) -o $@ $^ $(CXXFLAGS) $(LIBS) 45 | 46 | clean: 47 | rm -f $(EXE) $(OBJS) 48 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl2_opengl2/README.md: -------------------------------------------------------------------------------- 1 | 2 | # How to Build 3 | 4 | - On Windows with Visual Studio's IDE 5 | 6 | Use the provided project file (.vcxproj). Add to solution (imgui_examples.sln) if necessary. 7 | 8 | - On Windows with Visual Studio's CLI 9 | 10 | ``` 11 | set SDL2_DIR=path_to_your_sdl2_folder 12 | cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl2_opengl2.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console 13 | # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries 14 | # or for 64-bit: 15 | cl /Zi /MD /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl2_opengl2.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x64 SDL2.lib SDL2main.lib opengl32.lib /subsystem:console 16 | ``` 17 | 18 | - On Linux and similar Unixes 19 | 20 | ``` 21 | c++ `sdl2-config --cflags` -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_sdl2.cpp ../../backends/imgui_impl_opengl2.cpp ../../imgui*.cpp `sdl2-config --libs` -lGL 22 | ``` 23 | 24 | - On Mac OS X 25 | 26 | ``` 27 | brew install sdl2 28 | c++ `sdl2-config --cflags` -I .. -I ../.. -I ../../backends main.cpp ../../backends/imgui_impl_sdl2.cpp ../../backends/imgui_impl_opengl2.cpp ../../imgui*.cpp `sdl2-config --libs` -framework OpenGl 29 | ``` 30 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl2_opengl2/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl2_opengl2 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_opengl2.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl2_opengl3/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl2_opengl3 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib opengl32.lib shell32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl2_sdlrenderer2/README.md: -------------------------------------------------------------------------------- 1 | 2 | # How to Build 3 | 4 | - On Windows with Visual Studio's CLI 5 | 6 | ``` 7 | set SDL2_DIR=path_to_your_sdl2_folder 8 | cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_sdlrenderer2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl2_sdlrenderer.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib /subsystem:console 9 | # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries 10 | # or for 64-bit: 11 | cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL2_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_sdlrenderer2.cpp ..\..\imgui*.cpp /FeDebug/example_sdl2_sdlrenderer.exe /FoDebug/ /link /libpath:%SDL2_DIR%\lib\x64 SDL2.lib SDL2main.lib /subsystem:console 12 | ``` 13 | 14 | - On Linux and similar Unixes 15 | 16 | ``` 17 | c++ `sdl2-config --cflags` -I .. -I ../.. main.cpp ../../backends/imgui_impl_sdl2.cpp ../../backends/imgui_impl_sdlrenderer2.cpp ../../imgui*.cpp `sdl2-config --libs` -lGL 18 | ``` 19 | 20 | - On Mac OS X 21 | 22 | ``` 23 | brew install sdl2 24 | c++ `sdl2-config --cflags` -I .. -I ../.. main.cpp ../../backends/imgui_impl_sdl2.cpp ../../backends/imgui_impl_sdlrenderer2.cpp ../../imgui*.cpp `sdl2-config --libs` -framework OpenGl 25 | ``` 26 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl2_sdlrenderer2/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl2_sdlrenderer_ 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_sdlrenderer2.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 SDL2.lib SDL2main.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl2_vulkan/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | 3 | @set OUT_EXE=example_sdl2_vulkan 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include /I %VULKAN_SDK%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x86 /libpath:%VULKAN_SDK%\lib32 SDL2.lib SDL2main.lib shell32.lib vulkan-1.lib 7 | 8 | @set OUT_DIR=Debug 9 | mkdir %OUT_DIR% 10 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 11 | 12 | @set OUT_DIR=Release 13 | @REM mkdir %OUT_DIR% 14 | @REM cl /nologo /Zi /MD /utf-8 /Ox /Oi %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 15 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl2_vulkan/build_win64.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars64.bat or vcvarsall.bat to setup command-line compiler. 2 | 3 | @set OUT_EXE=example_sdl2_vulkan 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL2_DIR%\include /I %VULKAN_SDK%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl2.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL2_DIR%\lib\x64 /libpath:%VULKAN_SDK%\lib SDL2.lib SDL2main.lib shell32.lib vulkan-1.lib 7 | 8 | @set OUT_DIR=Debug 9 | mkdir %OUT_DIR% 10 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 11 | 12 | @set OUT_DIR=Release 13 | @REM mkdir %OUT_DIR% 14 | @REM cl /nologo /Zi /MD /utf-8 /Ox /Oi %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 15 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl3_opengl3/README.md: -------------------------------------------------------------------------------- 1 | 2 | # How to Build 3 | 4 | ## Windows with Visual Studio's IDE 5 | 6 | Use the provided project file (.vcxproj). Add to solution (imgui_examples.sln) if necessary. 7 | 8 | ## Windows with Visual Studio's CLI 9 | 10 | Use build_win32.bat or directly: 11 | ``` 12 | set SDL3_DIR=path_to_your_sdl3_folder 13 | cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL3_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl3_opengl3.exe /FoDebug/ /link /libpath:%SDL3_DIR%\lib\x86 SDL3.lib opengl32.lib /subsystem:console 14 | # ^^ include paths ^^ source files ^^ output exe ^^ output dir ^^ libraries 15 | # or for 64-bit: 16 | cl /Zi /MD /utf-8 /I.. /I..\.. /I%SDL3_DIR%\include main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp /FeDebug/example_sdl3_opengl3.exe /FoDebug/ /link /libpath:%SDL3_DIR%\lib\x64 SDL3.lib SDL2mainopengl32.lib /subsystem:console 17 | ``` 18 | 19 | ## Linux and similar Unixes 20 | 21 | Use our Makefile or directly: 22 | ``` 23 | c++ `sdl3-config --cflags` -I .. -I ../.. -I ../../backends 24 | main.cpp ../../backends/imgui_impl_sdl3.cpp ../../backends/imgui_impl_opengl3.cpp ../../imgui*.cpp 25 | `sdl3-config --libs` -lGL -ldl 26 | ``` 27 | 28 | ## macOS 29 | 30 | Use our Makefile or directly: 31 | ``` 32 | brew install sdl3 33 | c++ `sdl3-config --cflags` -I .. -I ../.. -I ../../backends 34 | main.cpp ../../backends/imgui_impl_sdl3.cpp ../../backends/imgui_impl_opengl3.cpp ../../imgui*.cpp 35 | `sdl3-config --libs` -framework OpenGl -framework CoreFoundation 36 | ``` 37 | 38 | ## Emscripten 39 | 40 | As of 2023-05-30 Emscripten doesn't support SDL3 yet. 41 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl3_opengl3/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | 3 | @set OUT_EXE=example_sdl3_opengl3 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL3_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL3_DIR%\lib\x86 SDL3.lib opengl32.lib shell32.lib 7 | 8 | @set OUT_DIR=Debug 9 | mkdir %OUT_DIR% 10 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 11 | 12 | @set OUT_DIR=Release 13 | @REM mkdir %OUT_DIR% 14 | @REM cl /nologo /Zi /MD /utf-8 /Ox /Oi %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 15 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl3_opengl3/build_win64.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars64.bat or vcvarsall.bat to setup command-line compiler. 2 | 3 | @set OUT_EXE=example_sdl3_opengl3 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL3_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL3_DIR%\lib\x64 SDL3.lib opengl32.lib shell32.lib 7 | 8 | @set OUT_DIR=Debug 9 | mkdir %OUT_DIR% 10 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 11 | 12 | @set OUT_DIR=Release 13 | @REM mkdir %OUT_DIR% 14 | @REM cl /nologo /Zi /MD /utf-8 /Ox /Oi %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 15 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl3_sdlgpu3/build_win64.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars64.bat or vcvarsall.bat to setup command-line compiler. 2 | 3 | @set OUT_EXE=example_sdl3_sdlgpu3 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL3_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_sdlgpu3.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL3_DIR%\lib\x64 SDL3.lib shell32.lib 7 | 8 | @set OUT_DIR=Debug 9 | mkdir %OUT_DIR% 10 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 11 | 12 | @set OUT_DIR=Release 13 | @REM mkdir %OUT_DIR% 14 | @REM cl /nologo /Zi /MD /utf-8 /Ox /Oi %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 15 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl3_sdlrenderer3/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_sdl3_sdlrenderer3 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL3_DIR%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_sdlrenderer3.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL3_DIR%\lib\x86 SDL3.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 9 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl3_vulkan/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | 3 | @set OUT_EXE=example_sdl3_vulkan 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL3_DIR%\include /I %VULKAN_SDK%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL3_DIR%\lib\x86 /libpath:%VULKAN_SDK%\lib32 SDL3.lib shell32.lib vulkan-1.lib 7 | 8 | @set OUT_DIR=Debug 9 | mkdir %OUT_DIR% 10 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 11 | 12 | @set OUT_DIR=Release 13 | @REM mkdir %OUT_DIR% 14 | @REM cl /nologo /Zi /MD /utf-8 /Ox /Oi %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 15 | -------------------------------------------------------------------------------- /src/imgui/examples/example_sdl3_vulkan/build_win64.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars64.bat or vcvarsall.bat to setup command-line compiler. 2 | 3 | @set OUT_EXE=example_sdl3_vulkan 4 | @set INCLUDES=/I..\.. /I..\..\backends /I%SDL3_DIR%\include /I %VULKAN_SDK%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_sdl3.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:%SDL3_DIR%\lib\x64 /libpath:%VULKAN_SDK%\lib SDL3.lib shell32.lib vulkan-1.lib 7 | 8 | @set OUT_DIR=Debug 9 | mkdir %OUT_DIR% 10 | cl /nologo /Zi /MD /utf-8 %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 11 | 12 | @set OUT_DIR=Release 13 | @REM mkdir %OUT_DIR% 14 | @REM cl /nologo /Zi /MD /utf-8 /Ox /Oi %INCLUDES% %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% /subsystem:console 15 | -------------------------------------------------------------------------------- /src/imgui/examples/example_win32_directx10/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_directx10 4 | @set INCLUDES=/I..\.. /I..\..\backends /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I "%DXSDK_DIR%Include" 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\backends\imgui_impl_dx10.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d10.lib d3dcompiler.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /src/imgui/examples/example_win32_directx11/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_directx11 4 | @set INCLUDES=/I..\.. /I..\..\backends /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I "%DXSDK_DIR%Include" 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_dx11.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d11.lib d3dcompiler.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | 10 | -------------------------------------------------------------------------------- /src/imgui/examples/example_win32_directx12/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_directx12 4 | @set INCLUDES=/I..\.. /I..\..\backends /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_dx12.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\imgui*.cpp 6 | @set LIBS=d3d12.lib d3dcompiler.lib dxgi.lib 7 | mkdir Debug 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /src/imgui/examples/example_win32_directx9/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_directx9 4 | @set INCLUDES=/I..\.. /I..\..\backends /I "%DXSDK_DIR%/Include" 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_dx9.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\imgui*.cpp 6 | @set LIBS=/LIBPATH:"%DXSDK_DIR%/Lib/x86" d3d9.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /src/imgui/examples/example_win32_opengl3/build_mingw.bat: -------------------------------------------------------------------------------- 1 | @REM Build for MINGW64 or 32 from MSYS2. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_opengl3 4 | @set INCLUDES=-I../.. -I../../backends 5 | @set SOURCES=main.cpp ../../backends/imgui_impl_opengl3.cpp ../../backends/imgui_impl_win32.cpp ../../imgui*.cpp 6 | @set LIBS=-lopengl32 -lgdi32 -ldwmapi 7 | mkdir %OUT_DIR% 8 | g++ -DUNICODE %INCLUDES% %SOURCES% -o %OUT_DIR%/%OUT_EXE%.exe --static -mwindows %LIBS% %LIBS% 9 | -------------------------------------------------------------------------------- /src/imgui/examples/example_win32_opengl3/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_opengl3 4 | @set INCLUDES=/I..\.. /I..\..\backends 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_opengl3.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\imgui*.cpp 6 | @set LIBS=opengl32.lib 7 | mkdir %OUT_DIR% 8 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 9 | -------------------------------------------------------------------------------- /src/imgui/examples/example_win32_vulkan/build_win32.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_vulkan 4 | @set INCLUDES=/I..\.. /I..\..\backends /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I %VULKAN_SDK%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\imgui*.cpp 6 | @set LIBS=/libpath:%VULKAN_SDK%\lib32 vulkan-1.lib 7 | 8 | mkdir %OUT_DIR% 9 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 10 | -------------------------------------------------------------------------------- /src/imgui/examples/example_win32_vulkan/build_win64.bat: -------------------------------------------------------------------------------- 1 | @REM Build for Visual Studio compiler. Run your copy of vcvars32.bat or vcvarsall.bat to setup command-line compiler. 2 | @set OUT_DIR=Debug 3 | @set OUT_EXE=example_win32_vulkan 4 | @set INCLUDES=/I..\.. /I..\..\backends /I "%WindowsSdkDir%Include\um" /I "%WindowsSdkDir%Include\shared" /I %VULKAN_SDK%\include 5 | @set SOURCES=main.cpp ..\..\backends\imgui_impl_vulkan.cpp ..\..\backends\imgui_impl_win32.cpp ..\..\imgui*.cpp 6 | @set LIBS=/libpath:%VULKAN_SDK%\lib vulkan-1.lib 7 | 8 | mkdir %OUT_DIR% 9 | cl /nologo /Zi /MD /utf-8 %INCLUDES% /D UNICODE /D _UNICODE %SOURCES% /Fe%OUT_DIR%/%OUT_EXE%.exe /Fo%OUT_DIR%/ /link %LIBS% 10 | -------------------------------------------------------------------------------- /src/imgui/examples/libs/glfw/COPYING.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2002-2006 Marcus Geelnard 2 | Copyright (c) 2006-2010 Camilla Berglund 3 | 4 | This software is provided 'as-is', without any express or implied 5 | warranty. In no event will the authors be held liable for any damages 6 | arising from the use of this software. 7 | 8 | Permission is granted to anyone to use this software for any purpose, 9 | including commercial applications, and to alter it and redistribute it 10 | freely, subject to the following restrictions: 11 | 12 | 1. The origin of this software must not be misrepresented; you must not 13 | claim that you wrote the original software. If you use this software 14 | in a product, an acknowledgment in the product documentation would 15 | be appreciated but is not required. 16 | 17 | 2. Altered source versions must be plainly marked as such, and must not 18 | be misrepresented as being the original software. 19 | 20 | 3. This notice may not be removed or altered from any source 21 | distribution. 22 | 23 | -------------------------------------------------------------------------------- /src/imgui/examples/libs/glfw/lib-vc2010-32/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuggslet/MGSM2Fix/0a58fa5c5f191e80243df79bd66bac7e4ebb0857/src/imgui/examples/libs/glfw/lib-vc2010-32/glfw3.lib -------------------------------------------------------------------------------- /src/imgui/examples/libs/glfw/lib-vc2010-64/glfw3.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuggslet/MGSM2Fix/0a58fa5c5f191e80243df79bd66bac7e4ebb0857/src/imgui/examples/libs/glfw/lib-vc2010-64/glfw3.lib -------------------------------------------------------------------------------- /src/imgui/examples/libs/usynergy/README.txt: -------------------------------------------------------------------------------- 1 | 2 | uSynergy client -- Implementation for the embedded Synergy client library 3 | version 1.0.0, July 7th, 2012 4 | Copyright (c) 2012 Alex Evans 5 | 6 | This is a copy of the files once found at: 7 | https://github.com/symless/synergy-core/tree/790d108a56ada9caad8e56ff777d444485a69da9/src/micro 8 | 9 | -------------------------------------------------------------------------------- /src/imgui/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 | -------------------------------------------------------------------------------- /src/imgui/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 (fmt, RAII, syntaxis sugar) on Wiki: 13 | https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness 14 | -------------------------------------------------------------------------------- /src/imgui/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 | // See more C++ related extension (fmt, RAII, syntaxis sugar) on Wiki: 8 | // https://github.com/ocornut/imgui/wiki/Useful-Extensions#cness 9 | 10 | #pragma once 11 | 12 | #ifndef IMGUI_DISABLE 13 | 14 | #include 15 | 16 | namespace ImGui 17 | { 18 | // ImGui::InputText() with std::string 19 | // Because text input needs dynamic resizing, we need to setup a callback to grow the capacity 20 | IMGUI_API bool InputText(const char* label, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr); 21 | IMGUI_API bool InputTextMultiline(const char* label, std::string* str, const ImVec2& size = ImVec2(0, 0), ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr); 22 | IMGUI_API bool InputTextWithHint(const char* label, const char* hint, std::string* str, ImGuiInputTextFlags flags = 0, ImGuiInputTextCallback callback = nullptr, void* user_data = nullptr); 23 | } 24 | 25 | #endif // #ifndef IMGUI_DISABLE 26 | -------------------------------------------------------------------------------- /src/imgui/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 | -------------------------------------------------------------------------------- /src/imgui/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 | -------------------------------------------------------------------------------- /src/imgui/misc/debuggers/imgui.natstepfilter: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 20 | 21 | 22 | 23 | (ImVec2|ImVec4|ImStrv)::.+ 24 | NoStepInto 25 | 26 | 27 | (ImVector|ImSpan).*::operator.+ 28 | NoStepInto 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/imgui/misc/fonts/Cousine-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuggslet/MGSM2Fix/0a58fa5c5f191e80243df79bd66bac7e4ebb0857/src/imgui/misc/fonts/Cousine-Regular.ttf -------------------------------------------------------------------------------- /src/imgui/misc/fonts/DroidSans.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuggslet/MGSM2Fix/0a58fa5c5f191e80243df79bd66bac7e4ebb0857/src/imgui/misc/fonts/DroidSans.ttf -------------------------------------------------------------------------------- /src/imgui/misc/fonts/Karla-Regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuggslet/MGSM2Fix/0a58fa5c5f191e80243df79bd66bac7e4ebb0857/src/imgui/misc/fonts/Karla-Regular.ttf -------------------------------------------------------------------------------- /src/imgui/misc/fonts/ProggyClean.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuggslet/MGSM2Fix/0a58fa5c5f191e80243df79bd66bac7e4ebb0857/src/imgui/misc/fonts/ProggyClean.ttf -------------------------------------------------------------------------------- /src/imgui/misc/fonts/ProggyTiny.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuggslet/MGSM2Fix/0a58fa5c5f191e80243df79bd66bac7e4ebb0857/src/imgui/misc/fonts/ProggyTiny.ttf -------------------------------------------------------------------------------- /src/imgui/misc/fonts/Roboto-Medium.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuggslet/MGSM2Fix/0a58fa5c5f191e80243df79bd66bac7e4ebb0857/src/imgui/misc/fonts/Roboto-Medium.ttf -------------------------------------------------------------------------------- /src/imgui/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 | 11 | #ifdef IMGUI_IMPLEMENTATION 12 | #define IMGUI_DEFINE_MATH_OPERATORS 13 | #endif 14 | 15 | #include "../../imgui.h" 16 | #ifdef IMGUI_ENABLE_FREETYPE 17 | #include "../../misc/freetype/imgui_freetype.h" 18 | #endif 19 | 20 | #ifdef IMGUI_IMPLEMENTATION 21 | #include "../../imgui.cpp" 22 | #include "../../imgui_demo.cpp" 23 | #include "../../imgui_draw.cpp" 24 | #include "../../imgui_tables.cpp" 25 | #include "../../imgui_widgets.cpp" 26 | #ifdef IMGUI_ENABLE_FREETYPE 27 | #include "../../misc/freetype/imgui_freetype.cpp" 28 | #endif 29 | #endif 30 | -------------------------------------------------------------------------------- /src/inipp/.travis.yml: -------------------------------------------------------------------------------- 1 | dist: focal 2 | language: cpp 3 | script: cmake . && make && make test 4 | -------------------------------------------------------------------------------- /src/inipp/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.0) 2 | 3 | project(inipp) 4 | 5 | add_library(inipp INTERFACE) 6 | add_library(inipp::inipp ALIAS inipp) 7 | 8 | target_include_directories(inipp SYSTEM INTERFACE inipp) 9 | 10 | target_compile_features(inipp INTERFACE cxx_std_11) 11 | 12 | if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) 13 | include(CTest) 14 | endif() 15 | 16 | if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME AND BUILD_TESTING) 17 | add_subdirectory(unittest) 18 | endif() 19 | -------------------------------------------------------------------------------- /src/inipp/LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Matthias C. M. Troffaes 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 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /src/inipp/appveyor.yml: -------------------------------------------------------------------------------- 1 | version: 1.0.{build} 2 | image: Visual Studio 2019 3 | build_script: 4 | - msbuild inipp.sln /logger:"C:\Program Files\AppVeyor\BuildAgent\Appveyor.MSBuildLogger.dll" 5 | - nuget pack nuget/IniPP.nuspec 6 | test_script: 7 | - vstest.console /logger:Appveyor /Platform:x64 x64\Debug\unittest.dll 8 | artifacts: 9 | - path: '*.nupkg' 10 | deploy: 11 | provider: NuGet 12 | api_key: 13 | secure: AcLNa0DwCGKnLLFXN23NHZHcl1Xten7fgacP//Cp+5CkwgDLUMN5res8TEx3kkbM 14 | artifact: /.*\.nupkg/ 15 | on: 16 | appveyor_repo_tag: true 17 | -------------------------------------------------------------------------------- /src/inipp/example/example.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include "inipp.h" 3 | 4 | int main() { 5 | inipp::Ini ini; 6 | std::ifstream is("example.ini"); 7 | ini.parse(is); 8 | std::cout << "raw ini file:" << std::endl; 9 | ini.generate(std::cout); 10 | ini.default_section(ini.sections["DEFAULT"]); 11 | ini.interpolate(); 12 | std::cout << "ini file after default section and interpolation:" << std::endl; 13 | ini.generate(std::cout); 14 | int compression_level = -1; 15 | inipp::get_value(ini.sections["bitbucket.org"], "CompressionLevel", compression_level); 16 | std::cout << "bitbucket.org compression level: " << compression_level << std::endl; 17 | return 0; 18 | } 19 | -------------------------------------------------------------------------------- /src/inipp/example/example.ini: -------------------------------------------------------------------------------- 1 | [DEFAULT] 2 | ServerAliveInterval = 45 3 | Compression = yes 4 | CompressionLevel = 9 5 | ForwardX11 = yes 6 | 7 | [bitbucket.org] 8 | User = hg 9 | 10 | [topsecret.server.com] 11 | Port = 50022 12 | ForwardX11 = no 13 | -------------------------------------------------------------------------------- /src/inipp/example/example.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;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 | 18 | 19 | Source Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/inipp/inipp/inipp.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;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 | 18 | 19 | Header Files 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/inipp/nuget/IniPP.nuspec: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | IniPP 5 | 1.0.13 6 | Matthias C. M. Troffaes 7 | Matthias C. M. Troffaes 8 | https://github.com/mcmtroffaes/inipp 9 | MIT 10 | false 11 | Simple header-only C++ ini parser, with support for default section and interpolation similar to Python's configparser. 12 | Simple C++ ini parser. 13 | 14 | Copyright 2017-2020 15 | ini parser native nativepackage 16 | 17 | 18 | 19 | 20 | 21 | 22 | -------------------------------------------------------------------------------- /src/inipp/nuget/IniPP.targets: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | $(MSBuildThisFileDirectory)include;%(AdditionalIncludeDirectories) 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /src/inipp/unittest/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | add_executable(headertest headertest.cpp) 2 | target_link_libraries(headertest PRIVATE inipp::inipp) 3 | 4 | add_executable(unittest unittest.cpp) 5 | target_link_libraries(unittest PRIVATE inipp::inipp) 6 | 7 | add_test(test0 headertest) 8 | add_test(test1 unittest) 9 | 10 | function(glob_copy src_wildcard dest) 11 | file(GLOB SRC ${CMAKE_CURRENT_SOURCE_DIR}/${src_wildcard}) 12 | file(COPY ${SRC} DESTINATION ${dest}) 13 | endfunction() 14 | 15 | # Copying ini files to build directory 16 | glob_copy(*.ini ${CMAKE_BINARY_DIR}/unittest) 17 | 18 | # Copying output files to build directory 19 | glob_copy(*.output ${CMAKE_BINARY_DIR}/unittest) 20 | -------------------------------------------------------------------------------- /src/inipp/unittest/headertest.cpp: -------------------------------------------------------------------------------- 1 | #include "test.h" 2 | 3 | int main() { 4 | return 0; 5 | } 6 | -------------------------------------------------------------------------------- /src/inipp/unittest/test.h: -------------------------------------------------------------------------------- 1 | #include "inipp.h" 2 | 3 | #include 4 | #include 5 | 6 | using namespace inipp; 7 | 8 | template 9 | static inline std::basic_string read_all(const std::string & filename) { 10 | std::basic_ifstream is(filename); 11 | std::basic_stringstream sstr; 12 | sstr << is.rdbuf(); 13 | return sstr.str(); 14 | } 15 | 16 | template 17 | static inline void parse(const std::string & filename, Ini & ini) { 18 | std::basic_ifstream is(filename); 19 | ini.parse(is); 20 | } 21 | 22 | template 23 | static inline void errors(std::basic_ostream & os, const Ini & ini) { 24 | for (auto const & err : ini.errors) { 25 | os << err << std::endl; 26 | } 27 | } 28 | 29 | template 30 | static inline std::basic_string test(const std::string & inifile, Ini & ini) { 31 | std::basic_ostringstream os; 32 | parse(inifile, ini); 33 | os << ">>> ERRORS <<<" << std::endl; 34 | errors(os, ini); 35 | os << ">>> GENERATE <<<" << std::endl; 36 | ini.generate(os); 37 | os << ">>> INTERPOLATE <<<" << std::endl; 38 | ini.interpolate(); 39 | ini.generate(os); 40 | return os.str(); 41 | } 42 | 43 | template 44 | static inline bool runtest(const char *inifile, const char *expectedfile, std::basic_ostream & os) { 45 | Ini ini; 46 | auto actual = test(inifile, ini); 47 | auto expected = read_all(expectedfile); 48 | os << actual; 49 | return (actual == expected); 50 | } 51 | -------------------------------------------------------------------------------- /src/inipp/unittest/test1.ini: -------------------------------------------------------------------------------- 1 | [section] 2 | variable=value 3 | -------------------------------------------------------------------------------- /src/inipp/unittest/test1.output: -------------------------------------------------------------------------------- 1 | >>> ERRORS <<< 2 | >>> GENERATE <<< 3 | [section] 4 | variable=value 5 | 6 | >>> INTERPOLATE <<< 7 | [section] 8 | variable=value 9 | 10 | -------------------------------------------------------------------------------- /src/inipp/unittest/test2.ini: -------------------------------------------------------------------------------- 1 | ; comment 2 | ; comment 3 | 4 | [section1] 5 | var1=val1 6 | var2 = val2 7 | var3= val3 8 | var4 =val4 9 | var5 = val5 10 | 11 | [section2] 12 | x = ${section0:test} 13 | y = ${var1} 14 | z = ${x} + ${y} + ${section0:a} + ${b} 15 | b = monkey 16 | 17 | [section0] 18 | test = ${a} ${b} ${c} 19 | a = hello 20 | b = world 21 | 22 | [section3] 23 | a = wot 24 | b = yz 25 | c = tis 26 | d = ${section0:test} -------------------------------------------------------------------------------- /src/inipp/unittest/test2.output: -------------------------------------------------------------------------------- 1 | >>> ERRORS <<< 2 | >>> GENERATE <<< 3 | [section0] 4 | a=hello 5 | b=world 6 | test=${a} ${b} ${c} 7 | 8 | [section1] 9 | var1=val1 10 | var2=val2 11 | var3=val3 12 | var4=val4 13 | var5=val5 14 | 15 | [section2] 16 | b=monkey 17 | x=${section0:test} 18 | y=${var1} 19 | z=${x} + ${y} + ${section0:a} + ${b} 20 | 21 | [section3] 22 | a=wot 23 | b=yz 24 | c=tis 25 | d=${section0:test} 26 | 27 | >>> INTERPOLATE <<< 28 | [section0] 29 | a=hello 30 | b=world 31 | test=hello world ${c} 32 | 33 | [section1] 34 | var1=val1 35 | var2=val2 36 | var3=val3 37 | var4=val4 38 | var5=val5 39 | 40 | [section2] 41 | b=monkey 42 | x=hello world ${c} 43 | y=${var1} 44 | z=hello world ${c} + ${var1} + hello + monkey 45 | 46 | [section3] 47 | a=wot 48 | b=yz 49 | c=tis 50 | d=hello world ${c} 51 | 52 | -------------------------------------------------------------------------------- /src/inipp/unittest/test4.ini: -------------------------------------------------------------------------------- 1 | a=1 2 | [badsec 3 | badsec] 4 | =badvar 5 | = 6 | bla 7 | [] 8 | b=2 9 | c=${:a} 10 | d=${:e} 11 | b=3 12 | -------------------------------------------------------------------------------- /src/inipp/unittest/test4.output: -------------------------------------------------------------------------------- 1 | >>> ERRORS <<< 2 | [badsec 3 | badsec] 4 | =badvar 5 | = 6 | bla 7 | b=3 8 | >>> GENERATE <<< 9 | [] 10 | a=1 11 | b=2 12 | c=${:a} 13 | d=${:e} 14 | 15 | >>> INTERPOLATE <<< 16 | [] 17 | a=1 18 | b=2 19 | c=1 20 | d=${:e} 21 | 22 | -------------------------------------------------------------------------------- /src/inipp/unittest/unittest.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;hm;inl;inc;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 | 18 | 19 | Source Files 20 | 21 | 22 | 23 | 24 | Header Files 25 | 26 | 27 | -------------------------------------------------------------------------------- /src/m2/epi.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | typedef enum { 4 | PAD_BUTTON_A = 0x1, 5 | PAD_BUTTON_B = 0x2, 6 | PAD_BUTTON_C = 0x4, 7 | PAD_BUTTON_X = 0x8, 8 | PAD_BUTTON_Y = 0x10, 9 | PAD_BUTTON_L = 0x10, 10 | PAD_BUTTON_Z = 0x20, 11 | PAD_BUTTON_R = 0x20, 12 | PAD_DOWN = 0x40, 13 | PAD_LEFT = 0x80, 14 | PAD_RIGHT = 0x100, 15 | PAD_COIN = 0x200, 16 | PAD_SELECT = 0x200, 17 | PAD_START = 0x400, 18 | PAD_UP = 0x800, 19 | PAD_DISCONNECTED = 0x1000, 20 | PAD_BUTTON_L2 = 0x4000, 21 | PAD_BUTTON_R2 = 0x8000, 22 | PAD_RPD_GC_POS = 0x2000000, 23 | PAD_RPD_GC_NEG = 0x4000000, 24 | PAD_SHORTCUT = 0x20000000, 25 | PAD_MENU = 0x40000000, 26 | PAD_RPD = 0x80000000, 27 | } M2EpiPadFlag; 28 | 29 | typedef enum { 30 | MD_6B_DISABLE = 0x1, 31 | MD_MULTITAP_0 = 0x2, 32 | MD_MULTITAP_1 = 0x4, 33 | USE_ANALOG = 0x8, 34 | DIRECTION_4 = 0x10, 35 | } M2EpiArchSubInfo; 36 | 37 | typedef enum { 38 | BUTTON_CIRCLE = 0, 39 | BUTTON_CROSS = 1, 40 | BUTTON_TRIANGLE = 2, 41 | BUTTON_SQUARE = 3, 42 | BUTTON_R1 = 4, 43 | BUTTON_R2 = 5, 44 | BUTTON_R3 = 6, 45 | BUTTON_L1 = 7, 46 | BUTTON_L2 = 8, 47 | BUTTON_L3 = 9, 48 | BUTTON_SELECT = 10, 49 | BUTTON_START = 11, 50 | BUTTON_TOUCH = 12, 51 | } PlatformButtonId; 52 | -------------------------------------------------------------------------------- /src/m2fixbase.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | class M2FixBase 6 | { 7 | public: 8 | M2FixBase() {} 9 | 10 | virtual void Load() {}; 11 | }; 12 | -------------------------------------------------------------------------------- /src/m2game.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "stdafx.h" 4 | 5 | #include "m2fixbase.h" 6 | #include "m2machine.h" 7 | #include "ketchup.h" 8 | 9 | class M2Game : public M2FixBase 10 | { 11 | public: 12 | M2Game() {} 13 | 14 | static auto & GetInstance() 15 | { 16 | static M2Game instance; 17 | return instance; 18 | } 19 | 20 | virtual std::vector> MachineInstances() 21 | { 22 | return { M2Machine::GetInstance() }; 23 | } 24 | 25 | virtual std::vector *SQKetchupHook() { return nullptr; } 26 | 27 | virtual void SQOnMemoryDefine() {} 28 | virtual void SQOnUpdateGadgets() {} 29 | 30 | virtual std::pair EPIModuleHook() { return {}; } 31 | 32 | virtual void EPIOnLoadImage(void *image, size_t size) {} 33 | virtual bool EPIOnMachineCommand(std::any machine, int cmd, unsigned int **args) { return true; } 34 | virtual bool EPIOnCommandCPU(std::any cpu, int cmd, unsigned int **args) { return true; } 35 | 36 | virtual void GWRenderGeometry(int & gw_width, int & gw_height, int & fb_width, int & fb_height, int & img_width, int & img_height) {} 37 | virtual bool GWBlank() { return false; } 38 | }; 39 | 40 | #include "mgs1.h" 41 | -------------------------------------------------------------------------------- /src/m2machine.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "m2fixbase.h" 4 | #include "stdafx.h" 5 | 6 | class M2Machine: public M2FixBase 7 | { 8 | public: 9 | M2Machine() {} 10 | 11 | static auto & GetInstance() 12 | { 13 | static M2Machine instance; 14 | return instance; 15 | } 16 | 17 | virtual void Load() {} 18 | virtual void BindModules() {} 19 | virtual void UpdateScreenGeometry(unsigned int, unsigned int, unsigned int, unsigned int, unsigned int) {} 20 | }; 21 | -------------------------------------------------------------------------------- /src/m2utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "m2hook.h" 4 | #include "stdafx.h" 5 | 6 | class M2Utils 7 | { 8 | public: 9 | M2Utils() {} 10 | 11 | static void LogSystemInfo(); 12 | 13 | static void memsetHook(); 14 | static void *memsetWait(void *str, int c, size_t n); 15 | static void memsetRelease(); 16 | 17 | static std::mutex memsetHookMutex; 18 | static bool memsetHookCalled; 19 | 20 | static std::mutex mainThreadFinishedMutex; 21 | static std::condition_variable mainThreadFinishedVar; 22 | static bool mainThreadFinished; 23 | 24 | }; 25 | -------------------------------------------------------------------------------- /src/spdlog/.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | BasedOnStyle: Google 4 | AccessModifierOffset: -4 5 | Standard: c++17 6 | IndentWidth: 4 7 | TabWidth: 4 8 | UseTab: Never 9 | ColumnLimit: 100 10 | AlignAfterOpenBracket: Align 11 | BinPackParameters: false 12 | AlignEscapedNewlines: Left 13 | AlwaysBreakTemplateDeclarations: Yes 14 | PackConstructorInitializers: Never 15 | BreakConstructorInitializersBeforeComma: false 16 | IndentPPDirectives: BeforeHash 17 | SortIncludes: Never 18 | ... 19 | 20 | -------------------------------------------------------------------------------- /src/spdlog/.git-blame-ignore-revs: -------------------------------------------------------------------------------- 1 | # clang-format 2 | 1a0bfc7a89f2d58e22605a4dc7e18a9a555b65aa 3 | 95c226e9c92928e20ccdac0d060e7241859e282b 4 | 9d52261185b5f2c454c381d626ec5c84d7b195f4 5 | 4b2a8219d5d1b40062d030441adde7d1fb0d4f84 6 | 0a53eafe18d983c7c8ba4cadd02d0cc7f7308f28 7 | -------------------------------------------------------------------------------- /src/spdlog/.gitattributes: -------------------------------------------------------------------------------- 1 | * text=false 2 | -------------------------------------------------------------------------------- /src/spdlog/.gitignore: -------------------------------------------------------------------------------- 1 | # Auto generated files 2 | [Dd]ebug/ 3 | [Rr]elease/ 4 | build/* 5 | *.slo 6 | *.lo 7 | *.o 8 | *.obj 9 | *.suo 10 | *.tlog 11 | *.ilk 12 | *.log 13 | *.pdb 14 | *.idb 15 | *.iobj 16 | *.ipdb 17 | *.opensdf 18 | *.sdf 19 | 20 | # Compiled Dynamic libraries 21 | *.so 22 | *.dylib 23 | *.dll 24 | 25 | # Compiled Static libraries 26 | *.lai 27 | *.la 28 | *.a 29 | *.lib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | 36 | # Codelite 37 | .codelite 38 | 39 | # KDevelop 40 | *.kdev4 41 | 42 | # .orig files 43 | *.orig 44 | 45 | # example files 46 | example/* 47 | !example/example.cpp 48 | !example/bench.cpp 49 | !example/utils.h 50 | !example/Makefile* 51 | !example/example.sln 52 | !example/example.vcxproj 53 | !example/CMakeLists.txt 54 | !example/meson.build 55 | !example/multisink.cpp 56 | !example/jni 57 | 58 | # generated files 59 | generated 60 | version.rc 61 | 62 | # Cmake 63 | CMakeCache.txt 64 | CMakeFiles 65 | CMakeScripts 66 | Makefile 67 | cmake_install.cmake 68 | install_manifest.txt 69 | /tests/tests.VC.VC.opendb 70 | /tests/tests.VC.db 71 | /tests/tests 72 | /tests/logs/* 73 | spdlogConfig.cmake 74 | spdlogConfigVersion.cmake 75 | compile_commands.json 76 | 77 | # idea 78 | .idea/ 79 | .cache/ 80 | .vscode/ 81 | cmake-build-*/ 82 | *.db 83 | *.ipch 84 | *.filters 85 | *.db-wal 86 | *.opendb 87 | *.db-shm 88 | *.vcxproj 89 | *.tcl 90 | *.user 91 | *.sln 92 | 93 | # macos 94 | *.DS_store 95 | *.xcodeproj/ 96 | /.vs 97 | /out/build 98 | /CMakeSettings.json 99 | -------------------------------------------------------------------------------- /src/spdlog/INSTALL: -------------------------------------------------------------------------------- 1 | Header Only Version 2 | ================================================================== 3 | Just copy the files to your build tree and use a C++11 compiler. 4 | Or use CMake: 5 | ``` 6 | add_executable(example_header_only example.cpp) 7 | target_link_libraries(example_header_only spdlog::spdlog_header_only) 8 | ``` 9 | 10 | Compiled Library Version 11 | ================================================================== 12 | CMake: 13 | ``` 14 | add_executable(example example.cpp) 15 | target_link_libraries(example spdlog::spdlog) 16 | ``` 17 | 18 | Or copy files src/*.cpp to your build tree and pass the -DSPDLOG_COMPILED_LIB to the compiler. 19 | 20 | Important Information for Compilation: 21 | ================================================================== 22 | * If you encounter compilation errors with gcc 4.8.x, please note that gcc 4.8.x does not fully support C++11. In such cases, consider upgrading your compiler or using a different version that fully supports C++11 standards 23 | 24 | Tested on: 25 | gcc 4.8.1 and above 26 | clang 3.5 27 | Visual Studio 2013 -------------------------------------------------------------------------------- /src/spdlog/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Gabi Melman. 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 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | 23 | -- NOTE: Third party dependency used by this software -- 24 | This software depends on the fmt lib (MIT License), 25 | and users must comply to its license: https://raw.githubusercontent.com/fmtlib/fmt/master/LICENSE 26 | 27 | -------------------------------------------------------------------------------- /src/spdlog/bench/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright(c) 2019 spdlog authors Distributed under the MIT License (http://opensource.org/licenses/MIT) 2 | 3 | cmake_minimum_required(VERSION 3.11) 4 | project(spdlog_bench CXX) 5 | 6 | if(NOT TARGET spdlog) 7 | # Stand-alone build 8 | find_package(spdlog CONFIG REQUIRED) 9 | endif() 10 | 11 | find_package(Threads REQUIRED) 12 | find_package(benchmark CONFIG) 13 | if(NOT benchmark_FOUND) 14 | message(STATUS "Using CMake Version ${CMAKE_VERSION}") 15 | # User can fetch googlebenchmark 16 | message(STATUS "Downloading GoogleBenchmark") 17 | include(FetchContent) 18 | 19 | # disable tests 20 | set(BENCHMARK_ENABLE_TESTING OFF CACHE INTERNAL "") 21 | # Do not build and run googlebenchmark tests 22 | FetchContent_Declare(googlebenchmark GIT_REPOSITORY https://github.com/google/benchmark.git GIT_TAG v1.6.0) 23 | FetchContent_MakeAvailable(googlebenchmark) 24 | endif() 25 | 26 | add_executable(bench bench.cpp) 27 | spdlog_enable_warnings(bench) 28 | target_link_libraries(bench PRIVATE spdlog::spdlog) 29 | 30 | add_executable(async_bench async_bench.cpp) 31 | target_link_libraries(async_bench PRIVATE spdlog::spdlog) 32 | 33 | add_executable(latency latency.cpp) 34 | target_link_libraries(latency PRIVATE benchmark::benchmark spdlog::spdlog) 35 | 36 | add_executable(formatter-bench formatter-bench.cpp) 37 | target_link_libraries(formatter-bench PRIVATE benchmark::benchmark spdlog::spdlog) 38 | -------------------------------------------------------------------------------- /src/spdlog/bench/utils.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2015 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | #include 9 | #include 10 | #include 11 | 12 | namespace utils { 13 | 14 | template 15 | inline std::string format(const T &value) { 16 | static std::locale loc(""); 17 | std::stringstream ss; 18 | ss.imbue(loc); 19 | ss << value; 20 | return ss.str(); 21 | } 22 | 23 | template <> 24 | inline std::string format(const double &value) { 25 | static std::locale loc(""); 26 | std::stringstream ss; 27 | ss.imbue(loc); 28 | ss << std::fixed << std::setprecision(1) << value; 29 | return ss.str(); 30 | } 31 | 32 | } // namespace utils 33 | -------------------------------------------------------------------------------- /src/spdlog/cmake/ide.cmake: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------------------------- 2 | # IDE support for headers 3 | # --------------------------------------------------------------------------------------- 4 | set(SPDLOG_HEADERS_DIR "${CMAKE_CURRENT_LIST_DIR}/../include") 5 | 6 | file(GLOB SPDLOG_TOP_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/*.h") 7 | file(GLOB SPDLOG_DETAILS_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/details/*.h") 8 | file(GLOB SPDLOG_SINKS_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/sinks/*.h") 9 | file(GLOB SPDLOG_FMT_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/fmt/*.h") 10 | file(GLOB SPDLOG_FMT_BUNDELED_HEADERS "${SPDLOG_HEADERS_DIR}/spdlog/fmt/bundled/*.h") 11 | set(SPDLOG_ALL_HEADERS ${SPDLOG_TOP_HEADERS} ${SPDLOG_DETAILS_HEADERS} ${SPDLOG_SINKS_HEADERS} ${SPDLOG_FMT_HEADERS} 12 | ${SPDLOG_FMT_BUNDELED_HEADERS}) 13 | 14 | source_group("Header Files\\spdlog" FILES ${SPDLOG_TOP_HEADERS}) 15 | source_group("Header Files\\spdlog\\details" FILES ${SPDLOG_DETAILS_HEADERS}) 16 | source_group("Header Files\\spdlog\\sinks" FILES ${SPDLOG_SINKS_HEADERS}) 17 | source_group("Header Files\\spdlog\\fmt" FILES ${SPDLOG_FMT_HEADERS}) 18 | source_group("Header Files\\spdlog\\fmt\\bundled\\" FILES ${SPDLOG_FMT_BUNDELED_HEADERS}) 19 | -------------------------------------------------------------------------------- /src/spdlog/cmake/spdlog.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@CMAKE_INSTALL_PREFIX@ 2 | exec_prefix=${prefix} 3 | includedir=@PKG_CONFIG_INCLUDEDIR@ 4 | libdir=@PKG_CONFIG_LIBDIR@ 5 | 6 | Name: lib@PROJECT_NAME@ 7 | Description: Fast C++ logging library. 8 | URL: https://github.com/gabime/@PROJECT_NAME@ 9 | Version: @SPDLOG_VERSION@ 10 | CFlags: -I${includedir} @PKG_CONFIG_DEFINES@ 11 | Libs: -L${libdir} -lspdlog -pthread 12 | Requires: @PKG_CONFIG_REQUIRES@ 13 | 14 | -------------------------------------------------------------------------------- /src/spdlog/cmake/spdlogConfig.cmake.in: -------------------------------------------------------------------------------- 1 | # Copyright(c) 2019 spdlog authors 2 | # Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | @PACKAGE_INIT@ 5 | 6 | find_package(Threads REQUIRED) 7 | 8 | set(SPDLOG_FMT_EXTERNAL @SPDLOG_FMT_EXTERNAL@) 9 | set(SPDLOG_FMT_EXTERNAL_HO @SPDLOG_FMT_EXTERNAL_HO@) 10 | set(config_targets_file @config_targets_file@) 11 | 12 | if(SPDLOG_FMT_EXTERNAL OR SPDLOG_FMT_EXTERNAL_HO) 13 | include(CMakeFindDependencyMacro) 14 | find_dependency(fmt CONFIG) 15 | endif() 16 | 17 | 18 | include("${CMAKE_CURRENT_LIST_DIR}/${config_targets_file}") 19 | 20 | check_required_components(spdlog) 21 | -------------------------------------------------------------------------------- /src/spdlog/cmake/version.rc.in: -------------------------------------------------------------------------------- 1 | #define APSTUDIO_READONLY_SYMBOLS 2 | #include 3 | #undef APSTUDIO_READONLY_SYMBOLS 4 | 5 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 6 | 7 | 8 | VS_VERSION_INFO VERSIONINFO 9 | FILEVERSION @SPDLOG_VERSION_MAJOR@,@SPDLOG_VERSION_MINOR@,@SPDLOG_VERSION_PATCH@,0 10 | PRODUCTVERSION @SPDLOG_VERSION_MAJOR@,@SPDLOG_VERSION_MINOR@,@SPDLOG_VERSION_PATCH@,0 11 | FILEFLAGSMASK 0x3fL 12 | #ifdef _DEBUG 13 | FILEFLAGS 0x1L 14 | #else 15 | FILEFLAGS 0x0L 16 | #endif 17 | FILEOS 0x40004L 18 | FILETYPE 0x2L 19 | FILESUBTYPE 0x0L 20 | BEGIN 21 | BLOCK "StringFileInfo" 22 | BEGIN 23 | BLOCK "040904b0" 24 | BEGIN 25 | VALUE "FileDescription", "spdlog dll\0" 26 | VALUE "FileVersion", "@SPDLOG_VERSION@.0\0" 27 | VALUE "InternalName", "spdlog.dll\0" 28 | VALUE "LegalCopyright", "Copyright (C) spdlog\0" 29 | VALUE "ProductName", "spdlog\0" 30 | VALUE "ProductVersion", "@SPDLOG_VERSION@.0\0" 31 | END 32 | END 33 | BLOCK "VarFileInfo" 34 | BEGIN 35 | VALUE "Translation", 0x409, 1200 36 | END 37 | END 38 | 39 | 40 | 41 | 42 | 43 | -------------------------------------------------------------------------------- /src/spdlog/example/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | # Copyright(c) 2019 spdlog authors Distributed under the MIT License (http://opensource.org/licenses/MIT) 2 | 3 | cmake_minimum_required(VERSION 3.11) 4 | project(spdlog_examples CXX) 5 | 6 | if(NOT TARGET spdlog) 7 | # Stand-alone build 8 | find_package(spdlog REQUIRED) 9 | endif() 10 | 11 | # --------------------------------------------------------------------------------------- 12 | # Example of using pre-compiled library 13 | # --------------------------------------------------------------------------------------- 14 | add_executable(example example.cpp) 15 | target_link_libraries(example PRIVATE spdlog::spdlog $<$:ws2_32>) 16 | 17 | # --------------------------------------------------------------------------------------- 18 | # Example of using header-only library 19 | # --------------------------------------------------------------------------------------- 20 | if(SPDLOG_BUILD_EXAMPLE_HO) 21 | add_executable(example_header_only example.cpp) 22 | target_link_libraries(example_header_only PRIVATE spdlog::spdlog_header_only) 23 | endif() 24 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/cfg/argv.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | #include 6 | #include 7 | 8 | // 9 | // Init log levels using each argv entry that starts with "SPDLOG_LEVEL=" 10 | // 11 | // set all loggers to debug level: 12 | // example.exe "SPDLOG_LEVEL=debug" 13 | 14 | // set logger1 to trace level 15 | // example.exe "SPDLOG_LEVEL=logger1=trace" 16 | 17 | // turn off all logging except for logger1 and logger2: 18 | // example.exe "SPDLOG_LEVEL=off,logger1=debug,logger2=info" 19 | 20 | namespace spdlog { 21 | namespace cfg { 22 | 23 | // search for SPDLOG_LEVEL= in the args and use it to init the levels 24 | inline void load_argv_levels(int argc, const char **argv) { 25 | const std::string spdlog_level_prefix = "SPDLOG_LEVEL="; 26 | for (int i = 1; i < argc; i++) { 27 | std::string arg = argv[i]; 28 | if (arg.find(spdlog_level_prefix) == 0) { 29 | auto levels_string = arg.substr(spdlog_level_prefix.size()); 30 | helpers::load_levels(levels_string); 31 | } 32 | } 33 | } 34 | 35 | inline void load_argv_levels(int argc, char **argv) { 36 | load_argv_levels(argc, const_cast(argv)); 37 | } 38 | 39 | } // namespace cfg 40 | } // namespace spdlog 41 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/cfg/env.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | #include 6 | #include 7 | #include 8 | 9 | // 10 | // Init levels and patterns from env variables SPDLOG_LEVEL 11 | // Inspired from Rust's "env_logger" crate (https://crates.io/crates/env_logger). 12 | // Note - fallback to "info" level on unrecognized levels 13 | // 14 | // Examples: 15 | // 16 | // set global level to debug: 17 | // export SPDLOG_LEVEL=debug 18 | // 19 | // turn off all logging except for logger1: 20 | // export SPDLOG_LEVEL="*=off,logger1=debug" 21 | // 22 | 23 | // turn off all logging except for logger1 and logger2: 24 | // export SPDLOG_LEVEL="off,logger1=debug,logger2=info" 25 | 26 | namespace spdlog { 27 | namespace cfg { 28 | inline void load_env_levels() { 29 | auto env_val = details::os::getenv("SPDLOG_LEVEL"); 30 | if (!env_val.empty()) { 31 | helpers::load_levels(env_val); 32 | } 33 | } 34 | 35 | } // namespace cfg 36 | } // namespace spdlog 37 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/cfg/helpers.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace cfg { 11 | namespace helpers { 12 | // 13 | // Init levels from given string 14 | // 15 | // Examples: 16 | // 17 | // set global level to debug: "debug" 18 | // turn off all logging except for logger1: "off,logger1=debug" 19 | // turn off all logging except for logger1 and logger2: "off,logger1=debug,logger2=info" 20 | // 21 | SPDLOG_API void load_levels(const std::string &txt); 22 | } // namespace helpers 23 | 24 | } // namespace cfg 25 | } // namespace spdlog 26 | 27 | #ifdef SPDLOG_HEADER_ONLY 28 | #include "helpers-inl.h" 29 | #endif // SPDLOG_HEADER_ONLY 30 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/details/backtracer.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | 13 | // Store log messages in circular buffer. 14 | // Useful for storing debug data in case of error/warning happens. 15 | 16 | namespace spdlog { 17 | namespace details { 18 | class SPDLOG_API backtracer { 19 | mutable std::mutex mutex_; 20 | std::atomic enabled_{false}; 21 | circular_q messages_; 22 | 23 | public: 24 | backtracer() = default; 25 | backtracer(const backtracer &other); 26 | 27 | backtracer(backtracer &&other) SPDLOG_NOEXCEPT; 28 | backtracer &operator=(backtracer other); 29 | 30 | void enable(size_t size); 31 | void disable(); 32 | bool enabled() const; 33 | void push_back(const log_msg &msg); 34 | bool empty() const; 35 | 36 | // pop all items in the q and apply the given fun on each of them. 37 | void foreach_pop(std::function fun); 38 | }; 39 | 40 | } // namespace details 41 | } // namespace spdlog 42 | 43 | #ifdef SPDLOG_HEADER_ONLY 44 | #include "backtracer-inl.h" 45 | #endif 46 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/details/console_globals.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace details { 11 | 12 | struct console_mutex { 13 | using mutex_t = std::mutex; 14 | static mutex_t &mutex() { 15 | static mutex_t s_mutex; 16 | return s_mutex; 17 | } 18 | }; 19 | 20 | struct console_nullmutex { 21 | using mutex_t = null_mutex; 22 | static mutex_t &mutex() { 23 | static mutex_t s_mutex; 24 | return s_mutex; 25 | } 26 | }; 27 | } // namespace details 28 | } // namespace spdlog 29 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/details/log_msg-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | namespace spdlog { 13 | namespace details { 14 | 15 | SPDLOG_INLINE log_msg::log_msg(spdlog::log_clock::time_point log_time, 16 | spdlog::source_loc loc, 17 | string_view_t a_logger_name, 18 | spdlog::level::level_enum lvl, 19 | spdlog::string_view_t msg) 20 | : logger_name(a_logger_name), 21 | level(lvl), 22 | time(log_time) 23 | #ifndef SPDLOG_NO_THREAD_ID 24 | , 25 | thread_id(os::thread_id()) 26 | #endif 27 | , 28 | source(loc), 29 | payload(msg) { 30 | } 31 | 32 | SPDLOG_INLINE log_msg::log_msg(spdlog::source_loc loc, 33 | string_view_t a_logger_name, 34 | spdlog::level::level_enum lvl, 35 | spdlog::string_view_t msg) 36 | : log_msg(os::now(), loc, a_logger_name, lvl, msg) {} 37 | 38 | SPDLOG_INLINE log_msg::log_msg(string_view_t a_logger_name, 39 | spdlog::level::level_enum lvl, 40 | spdlog::string_view_t msg) 41 | : log_msg(os::now(), source_loc{}, a_logger_name, lvl, msg) {} 42 | 43 | } // namespace details 44 | } // namespace spdlog 45 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/details/log_msg.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | namespace details { 11 | struct SPDLOG_API log_msg { 12 | log_msg() = default; 13 | log_msg(log_clock::time_point log_time, 14 | source_loc loc, 15 | string_view_t logger_name, 16 | level::level_enum lvl, 17 | string_view_t msg); 18 | log_msg(source_loc loc, string_view_t logger_name, level::level_enum lvl, string_view_t msg); 19 | log_msg(string_view_t logger_name, level::level_enum lvl, string_view_t msg); 20 | log_msg(const log_msg &other) = default; 21 | log_msg &operator=(const log_msg &other) = default; 22 | 23 | string_view_t logger_name; 24 | level::level_enum level{level::off}; 25 | log_clock::time_point time; 26 | size_t thread_id{0}; 27 | 28 | // wrapping the formatted text with color (updated by pattern_formatter). 29 | mutable size_t color_range_start{0}; 30 | mutable size_t color_range_end{0}; 31 | 32 | source_loc source; 33 | string_view_t payload; 34 | }; 35 | } // namespace details 36 | } // namespace spdlog 37 | 38 | #ifdef SPDLOG_HEADER_ONLY 39 | #include "log_msg-inl.h" 40 | #endif 41 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/details/log_msg_buffer-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | namespace spdlog { 11 | namespace details { 12 | 13 | SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg &orig_msg) 14 | : log_msg{orig_msg} { 15 | buffer.append(logger_name.begin(), logger_name.end()); 16 | buffer.append(payload.begin(), payload.end()); 17 | update_string_views(); 18 | } 19 | 20 | SPDLOG_INLINE log_msg_buffer::log_msg_buffer(const log_msg_buffer &other) 21 | : log_msg{other} { 22 | buffer.append(logger_name.begin(), logger_name.end()); 23 | buffer.append(payload.begin(), payload.end()); 24 | update_string_views(); 25 | } 26 | 27 | SPDLOG_INLINE log_msg_buffer::log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT 28 | : log_msg{other}, 29 | buffer{std::move(other.buffer)} { 30 | update_string_views(); 31 | } 32 | 33 | SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(const log_msg_buffer &other) { 34 | log_msg::operator=(other); 35 | buffer.clear(); 36 | buffer.append(other.buffer.data(), other.buffer.data() + other.buffer.size()); 37 | update_string_views(); 38 | return *this; 39 | } 40 | 41 | SPDLOG_INLINE log_msg_buffer &log_msg_buffer::operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT { 42 | log_msg::operator=(other); 43 | buffer = std::move(other.buffer); 44 | update_string_views(); 45 | return *this; 46 | } 47 | 48 | SPDLOG_INLINE void log_msg_buffer::update_string_views() { 49 | logger_name = string_view_t{buffer.data(), logger_name.size()}; 50 | payload = string_view_t{buffer.data() + logger_name.size(), payload.size()}; 51 | } 52 | 53 | } // namespace details 54 | } // namespace spdlog 55 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/details/log_msg_buffer.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | 8 | namespace spdlog { 9 | namespace details { 10 | 11 | // Extend log_msg with internal buffer to store its payload. 12 | // This is needed since log_msg holds string_views that points to stack data. 13 | 14 | class SPDLOG_API log_msg_buffer : public log_msg { 15 | memory_buf_t buffer; 16 | void update_string_views(); 17 | 18 | public: 19 | log_msg_buffer() = default; 20 | explicit log_msg_buffer(const log_msg &orig_msg); 21 | log_msg_buffer(const log_msg_buffer &other); 22 | log_msg_buffer(log_msg_buffer &&other) SPDLOG_NOEXCEPT; 23 | log_msg_buffer &operator=(const log_msg_buffer &other); 24 | log_msg_buffer &operator=(log_msg_buffer &&other) SPDLOG_NOEXCEPT; 25 | }; 26 | 27 | } // namespace details 28 | } // namespace spdlog 29 | 30 | #ifdef SPDLOG_HEADER_ONLY 31 | #include "log_msg_buffer-inl.h" 32 | #endif 33 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/details/null_mutex.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | // null, no cost dummy "mutex" and dummy "atomic" int 9 | 10 | namespace spdlog { 11 | namespace details { 12 | struct null_mutex { 13 | void lock() const {} 14 | void unlock() const {} 15 | }; 16 | 17 | struct null_atomic_int { 18 | int value; 19 | null_atomic_int() = default; 20 | 21 | explicit null_atomic_int(int new_value) 22 | : value(new_value) {} 23 | 24 | int load(std::memory_order = std::memory_order_relaxed) const { return value; } 25 | 26 | void store(int new_value, std::memory_order = std::memory_order_relaxed) { value = new_value; } 27 | 28 | int exchange(int new_value, std::memory_order = std::memory_order_relaxed) { 29 | std::swap(new_value, value); 30 | return new_value; // return value before the call 31 | } 32 | }; 33 | 34 | } // namespace details 35 | } // namespace spdlog 36 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/details/periodic_worker-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | namespace spdlog { 11 | namespace details { 12 | 13 | // stop the worker thread and join it 14 | SPDLOG_INLINE periodic_worker::~periodic_worker() { 15 | if (worker_thread_.joinable()) { 16 | { 17 | std::lock_guard lock(mutex_); 18 | active_ = false; 19 | } 20 | cv_.notify_one(); 21 | worker_thread_.join(); 22 | } 23 | } 24 | 25 | } // namespace details 26 | } // namespace spdlog 27 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/details/synchronous_factory.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include "registry.h" 7 | 8 | namespace spdlog { 9 | 10 | // Default logger factory- creates synchronous loggers 11 | class logger; 12 | 13 | struct synchronous_factory { 14 | template 15 | static std::shared_ptr create(std::string logger_name, SinkArgs &&...args) { 16 | auto sink = std::make_shared(std::forward(args)...); 17 | auto new_logger = std::make_shared(std::move(logger_name), std::move(sink)); 18 | details::registry::instance().initialize_logger(new_logger); 19 | return new_logger; 20 | } 21 | }; 22 | } // namespace spdlog 23 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/details/windows_include.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #ifndef NOMINMAX 4 | #define NOMINMAX // prevent windows redefining min/max 5 | #endif 6 | 7 | #ifndef WIN32_LEAN_AND_MEAN 8 | #define WIN32_LEAN_AND_MEAN 9 | #endif 10 | 11 | #include 12 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/fmt/bundled/fmt.license.rst: -------------------------------------------------------------------------------- 1 | Copyright (c) 2012 - present, Victor Zverovich 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining 4 | a copy of this software and associated documentation files (the 5 | "Software"), to deal in the Software without restriction, including 6 | without limitation the rights to use, copy, modify, merge, publish, 7 | distribute, sublicense, and/or sell copies of the Software, and to 8 | permit persons to whom the Software is furnished to do so, subject to 9 | the following conditions: 10 | 11 | The above copyright notice and this permission notice shall be 12 | included in all copies or substantial portions of the Software. 13 | 14 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 15 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 16 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 17 | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE 18 | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 19 | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 20 | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 21 | 22 | --- Optional exception to the license --- 23 | 24 | As an exception, if, as a result of your compiling your source code, portions 25 | of this Software are embedded into a machine-executable object form of such 26 | source code, you may redistribute such embedded portions in such object form 27 | without including the above copyright and permission notices. 28 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/fmt/bundled/locale.h: -------------------------------------------------------------------------------- 1 | #include "xchar.h" 2 | #warning fmt/locale.h is deprecated, include fmt/format.h or fmt/xchar.h instead 3 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/fmt/chrono.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's chrono support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/fmt/compile.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's compile-time support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/fmt/fmt.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016-2018 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | 8 | // 9 | // Include a bundled header-only copy of fmtlib or an external one. 10 | // By default spdlog include its own copy. 11 | // 12 | #include 13 | 14 | #if defined(SPDLOG_USE_STD_FORMAT) // SPDLOG_USE_STD_FORMAT is defined - use std::format 15 | #include 16 | #elif !defined(SPDLOG_FMT_EXTERNAL) 17 | #if !defined(SPDLOG_COMPILED_LIB) && !defined(FMT_HEADER_ONLY) 18 | #define FMT_HEADER_ONLY 19 | #endif 20 | #ifndef FMT_USE_WINDOWS_H 21 | #define FMT_USE_WINDOWS_H 0 22 | #endif 23 | 24 | #include 25 | #include 26 | 27 | #else // SPDLOG_FMT_EXTERNAL is defined - use external fmtlib 28 | #include 29 | #include 30 | #endif 31 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/fmt/ostr.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's ostream support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/fmt/ranges.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's ranges support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/fmt/std.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's std support (for formatting e.g. 9 | // std::filesystem::path, std::thread::id, std::monostate, std::variant, ...) 10 | // 11 | #include 12 | 13 | #if !defined(SPDLOG_USE_STD_FORMAT) 14 | #if !defined(SPDLOG_FMT_EXTERNAL) 15 | #ifdef SPDLOG_HEADER_ONLY 16 | #ifndef FMT_HEADER_ONLY 17 | #define FMT_HEADER_ONLY 18 | #endif 19 | #endif 20 | #include 21 | #else 22 | #include 23 | #endif 24 | #endif 25 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/fmt/xchar.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(c) 2016 Gabi Melman. 3 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 4 | // 5 | 6 | #pragma once 7 | // 8 | // include bundled or external copy of fmtlib's xchar support 9 | // 10 | #include 11 | 12 | #if !defined(SPDLOG_USE_STD_FORMAT) 13 | #if !defined(SPDLOG_FMT_EXTERNAL) 14 | #ifdef SPDLOG_HEADER_ONLY 15 | #ifndef FMT_HEADER_ONLY 16 | #define FMT_HEADER_ONLY 17 | #endif 18 | #endif 19 | #include 20 | #else 21 | #include 22 | #endif 23 | #endif 24 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/formatter.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | 11 | class formatter { 12 | public: 13 | virtual ~formatter() = default; 14 | virtual void format(const details::log_msg &msg, memory_buf_t &dest) = 0; 15 | virtual std::unique_ptr clone() const = 0; 16 | }; 17 | } // namespace spdlog 18 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/fwd.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | namespace spdlog { 7 | class logger; 8 | class formatter; 9 | 10 | namespace sinks { 11 | class sink; 12 | } 13 | 14 | namespace level { 15 | enum level_enum : int; 16 | } 17 | 18 | } // namespace spdlog 19 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/mdc.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | 11 | // MDC is a simple map of key->string values stored in thread local storage whose content will be printed by the loggers. 12 | // Note: Not supported in async mode (thread local storage - so the async thread pool have different copy). 13 | // 14 | // Usage example: 15 | // spdlog::mdc::put("mdc_key_1", "mdc_value_1"); 16 | // spdlog::info("Hello, {}", "World!"); // => [2024-04-26 02:08:05.040] [info] [mdc_key_1:mdc_value_1] Hello, World! 17 | 18 | namespace spdlog { 19 | class SPDLOG_API mdc { 20 | public: 21 | using mdc_map_t = std::map; 22 | 23 | static void put(const std::string &key, const std::string &value) { 24 | get_context()[key] = value; 25 | } 26 | 27 | static std::string get(const std::string &key) { 28 | auto &context = get_context(); 29 | auto it = context.find(key); 30 | if (it != context.end()) { 31 | return it->second; 32 | } 33 | return ""; 34 | } 35 | 36 | static void remove(const std::string &key) { get_context().erase(key); } 37 | 38 | static void clear() { get_context().clear(); } 39 | 40 | static mdc_map_t &get_context() { 41 | static thread_local mdc_map_t context; 42 | return context; 43 | } 44 | }; 45 | 46 | } // namespace spdlog 47 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/sinks/base_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | // 6 | // base sink templated over a mutex (either dummy or real) 7 | // concrete implementation should override the sink_it_() and flush_() methods. 8 | // locking is taken care of in this class - no locking needed by the 9 | // implementers.. 10 | // 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | namespace spdlog { 17 | namespace sinks { 18 | template 19 | class SPDLOG_API base_sink : public sink { 20 | public: 21 | base_sink(); 22 | explicit base_sink(std::unique_ptr formatter); 23 | ~base_sink() override = default; 24 | 25 | base_sink(const base_sink &) = delete; 26 | base_sink(base_sink &&) = delete; 27 | 28 | base_sink &operator=(const base_sink &) = delete; 29 | base_sink &operator=(base_sink &&) = delete; 30 | 31 | void log(const details::log_msg &msg) final; 32 | void flush() final; 33 | void set_pattern(const std::string &pattern) final; 34 | void set_formatter(std::unique_ptr sink_formatter) final; 35 | 36 | protected: 37 | // sink formatter 38 | std::unique_ptr formatter_; 39 | Mutex mutex_; 40 | 41 | virtual void sink_it_(const details::log_msg &msg) = 0; 42 | virtual void flush_() = 0; 43 | virtual void set_pattern_(const std::string &pattern); 44 | virtual void set_formatter_(std::unique_ptr sink_formatter); 45 | }; 46 | } // namespace sinks 47 | } // namespace spdlog 48 | 49 | #ifdef SPDLOG_HEADER_ONLY 50 | #include "base_sink-inl.h" 51 | #endif 52 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/sinks/basic_file_sink-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | namespace sinks { 15 | 16 | template 17 | SPDLOG_INLINE basic_file_sink::basic_file_sink(const filename_t &filename, 18 | bool truncate, 19 | const file_event_handlers &event_handlers) 20 | : file_helper_{event_handlers} { 21 | file_helper_.open(filename, truncate); 22 | } 23 | 24 | template 25 | SPDLOG_INLINE const filename_t &basic_file_sink::filename() const { 26 | return file_helper_.filename(); 27 | } 28 | 29 | template 30 | SPDLOG_INLINE void basic_file_sink::sink_it_(const details::log_msg &msg) { 31 | memory_buf_t formatted; 32 | base_sink::formatter_->format(msg, formatted); 33 | file_helper_.write(formatted); 34 | } 35 | 36 | template 37 | SPDLOG_INLINE void basic_file_sink::flush_() { 38 | file_helper_.flush(); 39 | } 40 | 41 | } // namespace sinks 42 | } // namespace spdlog 43 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/sinks/null_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | #include 9 | 10 | #include 11 | 12 | namespace spdlog { 13 | namespace sinks { 14 | 15 | template 16 | class null_sink : public base_sink { 17 | protected: 18 | void sink_it_(const details::log_msg &) override {} 19 | void flush_() override {} 20 | }; 21 | 22 | using null_sink_mt = null_sink; 23 | using null_sink_st = null_sink; 24 | 25 | } // namespace sinks 26 | 27 | template 28 | inline std::shared_ptr null_logger_mt(const std::string &logger_name) { 29 | auto null_logger = Factory::template create(logger_name); 30 | null_logger->set_level(level::off); 31 | return null_logger; 32 | } 33 | 34 | template 35 | inline std::shared_ptr null_logger_st(const std::string &logger_name) { 36 | auto null_logger = Factory::template create(logger_name); 37 | null_logger->set_level(level::off); 38 | return null_logger; 39 | } 40 | 41 | } // namespace spdlog 42 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/sinks/ostream_sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | 12 | namespace spdlog { 13 | namespace sinks { 14 | template 15 | class ostream_sink final : public base_sink { 16 | public: 17 | explicit ostream_sink(std::ostream &os, bool force_flush = false) 18 | : ostream_(os), 19 | force_flush_(force_flush) {} 20 | ostream_sink(const ostream_sink &) = delete; 21 | ostream_sink &operator=(const ostream_sink &) = delete; 22 | 23 | protected: 24 | void sink_it_(const details::log_msg &msg) override { 25 | memory_buf_t formatted; 26 | base_sink::formatter_->format(msg, formatted); 27 | ostream_.write(formatted.data(), static_cast(formatted.size())); 28 | if (force_flush_) { 29 | ostream_.flush(); 30 | } 31 | } 32 | 33 | void flush_() override { ostream_.flush(); } 34 | 35 | std::ostream &ostream_; 36 | bool force_flush_; 37 | }; 38 | 39 | using ostream_sink_mt = ostream_sink; 40 | using ostream_sink_st = ostream_sink; 41 | 42 | } // namespace sinks 43 | } // namespace spdlog 44 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/sinks/sink-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | 12 | SPDLOG_INLINE bool spdlog::sinks::sink::should_log(spdlog::level::level_enum msg_level) const { 13 | return msg_level >= level_.load(std::memory_order_relaxed); 14 | } 15 | 16 | SPDLOG_INLINE void spdlog::sinks::sink::set_level(level::level_enum log_level) { 17 | level_.store(log_level, std::memory_order_relaxed); 18 | } 19 | 20 | SPDLOG_INLINE spdlog::level::level_enum spdlog::sinks::sink::level() const { 21 | return static_cast(level_.load(std::memory_order_relaxed)); 22 | } 23 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/sinks/sink.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #include 7 | #include 8 | 9 | namespace spdlog { 10 | 11 | namespace sinks { 12 | class SPDLOG_API sink { 13 | public: 14 | virtual ~sink() = default; 15 | virtual void log(const details::log_msg &msg) = 0; 16 | virtual void flush() = 0; 17 | virtual void set_pattern(const std::string &pattern) = 0; 18 | virtual void set_formatter(std::unique_ptr sink_formatter) = 0; 19 | 20 | void set_level(level::level_enum log_level); 21 | level::level_enum level() const; 22 | bool should_log(level::level_enum msg_level) const; 23 | 24 | protected: 25 | // sink log level - default is all 26 | level_t level_{level::trace}; 27 | }; 28 | 29 | } // namespace sinks 30 | } // namespace spdlog 31 | 32 | #ifdef SPDLOG_HEADER_ONLY 33 | #include "sink-inl.h" 34 | #endif 35 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/sinks/stdout_color_sinks-inl.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #ifndef SPDLOG_HEADER_ONLY 7 | #include 8 | #endif 9 | 10 | #include 11 | #include 12 | 13 | namespace spdlog { 14 | 15 | template 16 | SPDLOG_INLINE std::shared_ptr stdout_color_mt(const std::string &logger_name, 17 | color_mode mode) { 18 | return Factory::template create(logger_name, mode); 19 | } 20 | 21 | template 22 | SPDLOG_INLINE std::shared_ptr stdout_color_st(const std::string &logger_name, 23 | color_mode mode) { 24 | return Factory::template create(logger_name, mode); 25 | } 26 | 27 | template 28 | SPDLOG_INLINE std::shared_ptr stderr_color_mt(const std::string &logger_name, 29 | color_mode mode) { 30 | return Factory::template create(logger_name, mode); 31 | } 32 | 33 | template 34 | SPDLOG_INLINE std::shared_ptr stderr_color_st(const std::string &logger_name, 35 | color_mode mode) { 36 | return Factory::template create(logger_name, mode); 37 | } 38 | } // namespace spdlog 39 | -------------------------------------------------------------------------------- /src/spdlog/include/spdlog/version.h: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #pragma once 5 | 6 | #define SPDLOG_VER_MAJOR 1 7 | #define SPDLOG_VER_MINOR 14 8 | #define SPDLOG_VER_PATCH 1 9 | 10 | #define SPDLOG_TO_VERSION(major, minor, patch) (major * 10000 + minor * 100 + patch) 11 | #define SPDLOG_VERSION SPDLOG_TO_VERSION(SPDLOG_VER_MAJOR, SPDLOG_VER_MINOR, SPDLOG_VER_PATCH) 12 | -------------------------------------------------------------------------------- /src/spdlog/logos/spdlog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/nuggslet/MGSM2Fix/0a58fa5c5f191e80243df79bd66bac7e4ebb0857/src/spdlog/logos/spdlog.png -------------------------------------------------------------------------------- /src/spdlog/scripts/ci_setup_clang.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | set -ex 4 | 5 | VERSION=$1 6 | 7 | apt-get update 8 | apt-get install -y libc++-${VERSION}-dev libc++abi-${VERSION}-dev 9 | 10 | if [[ "${VERSION}" -ge 12 ]]; then 11 | apt-get install -y --no-install-recommends libunwind-${VERSION}-dev 12 | fi 13 | -------------------------------------------------------------------------------- /src/spdlog/scripts/extract_version.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | 3 | import os 4 | import re 5 | 6 | base_path = os.path.abspath(os.path.join(os.path.dirname(__file__), '..')) 7 | config_h = os.path.join(base_path, 'include', 'spdlog', 'version.h') 8 | data = {'MAJOR': 0, 'MINOR': 0, 'PATCH': 0} 9 | reg = re.compile(r'^\s*#define\s+SPDLOG_VER_([A-Z]+)\s+([0-9]+).*$') 10 | 11 | with open(config_h, 'r') as fp: 12 | for l in fp: 13 | m = reg.match(l) 14 | if m: 15 | data[m.group(1)] = int(m.group(2)) 16 | 17 | print(f"{data['MAJOR']}.{data['MINOR']}.{data['PATCH']}") 18 | -------------------------------------------------------------------------------- /src/spdlog/scripts/format.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd "$(dirname "$0")"/.. 4 | pwd 5 | find_sources="find include src tests example bench -not ( -path include/spdlog/fmt/bundled -prune ) -type f -name *\.h -o -name *\.cpp" 6 | echo -n "Running dos2unix " 7 | $find_sources | xargs -I {} sh -c "dos2unix '{}' 2>/dev/null; echo -n '.'" 8 | echo 9 | echo -n "Running clang-format " 10 | 11 | $find_sources | xargs -I {} sh -c "clang-format -i {}; echo -n '.'" 12 | 13 | echo 14 | echo -n "Running cmake-format " 15 | find . -type f -name "CMakeLists.txt" -o -name "*\.cmake"|grep -v bundled|grep -v build|xargs -I {} sh -c "cmake-format --line-width 120 --tab-size 4 --max-subgroups-hwrap 4 -i {}; echo -n '.'" 16 | echo 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/spdlog/src/async.cpp: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #ifndef SPDLOG_COMPILED_LIB 5 | #error Please define SPDLOG_COMPILED_LIB to compile this file. 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | -------------------------------------------------------------------------------- /src/spdlog/src/bundled_fmtlib_format.cpp: -------------------------------------------------------------------------------- 1 | // Slightly modified version of fmt lib's format.cc source file. 2 | // Copyright (c) 2012 - 2016, Victor Zverovich 3 | // All rights reserved. 4 | 5 | #ifndef SPDLOG_COMPILED_LIB 6 | #error Please define SPDLOG_COMPILED_LIB to compile this file. 7 | #endif 8 | 9 | #if !defined(SPDLOG_FMT_EXTERNAL) && !defined(SPDLOG_USE_STD_FORMAT) 10 | 11 | #include 12 | 13 | FMT_BEGIN_NAMESPACE 14 | namespace detail { 15 | 16 | template FMT_API auto dragonbox::to_decimal(float x) noexcept -> dragonbox::decimal_fp; 17 | template FMT_API auto dragonbox::to_decimal(double x) noexcept -> dragonbox::decimal_fp; 18 | 19 | #ifndef FMT_STATIC_THOUSANDS_SEPARATOR 20 | template FMT_API locale_ref::locale_ref(const std::locale& loc); 21 | template FMT_API auto locale_ref::get() const -> std::locale; 22 | #endif 23 | 24 | // Explicit instantiations for char. 25 | 26 | template FMT_API auto thousands_sep_impl(locale_ref) -> thousands_sep_result; 27 | template FMT_API auto decimal_point_impl(locale_ref) -> char; 28 | 29 | template FMT_API void buffer::append(const char*, const char*); 30 | 31 | template FMT_API void vformat_to(buffer&, 32 | string_view, 33 | typename vformat_args<>::type, 34 | locale_ref); 35 | 36 | // Explicit instantiations for wchar_t. 37 | 38 | template FMT_API auto thousands_sep_impl(locale_ref) -> thousands_sep_result; 39 | template FMT_API auto decimal_point_impl(locale_ref) -> wchar_t; 40 | 41 | template FMT_API void buffer::append(const wchar_t*, const wchar_t*); 42 | 43 | } // namespace detail 44 | FMT_END_NAMESPACE 45 | 46 | #endif // !SPDLOG_FMT_EXTERNAL 47 | -------------------------------------------------------------------------------- /src/spdlog/src/cfg.cpp: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #ifndef SPDLOG_COMPILED_LIB 5 | #error Please define SPDLOG_COMPILED_LIB to compile this file. 6 | #endif 7 | 8 | #include 9 | -------------------------------------------------------------------------------- /src/spdlog/src/file_sinks.cpp: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #ifndef SPDLOG_COMPILED_LIB 5 | #error Please define SPDLOG_COMPILED_LIB to compile this file. 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | #include 14 | 15 | template class SPDLOG_API spdlog::sinks::basic_file_sink; 16 | template class SPDLOG_API spdlog::sinks::basic_file_sink; 17 | 18 | #include 19 | template class SPDLOG_API spdlog::sinks::rotating_file_sink; 20 | template class SPDLOG_API spdlog::sinks::rotating_file_sink; 21 | -------------------------------------------------------------------------------- /src/spdlog/src/spdlog.cpp: -------------------------------------------------------------------------------- 1 | // Copyright(c) 2015-present, Gabi Melman & spdlog contributors. 2 | // Distributed under the MIT License (http://opensource.org/licenses/MIT) 3 | 4 | #ifndef SPDLOG_COMPILED_LIB 5 | #error Please define SPDLOG_COMPILED_LIB to compile this file. 6 | #endif 7 | 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | #include 22 | 23 | // template instantiate logger constructor with sinks init list 24 | template SPDLOG_API spdlog::logger::logger(std::string name, 25 | sinks_init_list::iterator begin, 26 | sinks_init_list::iterator end); 27 | template class SPDLOG_API spdlog::sinks::base_sink; 28 | template class SPDLOG_API spdlog::sinks::base_sink; 29 | -------------------------------------------------------------------------------- /src/spdlog/tests/includes.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #if defined(__GNUC__) && __GNUC__ == 12 4 | #pragma GCC diagnostic push 5 | #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // Workaround for GCC 12 6 | #endif 7 | #include 8 | #if defined(__GNUC__) && __GNUC__ == 12 9 | #pragma GCC diagnostic pop 10 | #endif 11 | 12 | #include "utils.h" 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #define SPDLOG_ACTIVE_LEVEL SPDLOG_LEVEL_DEBUG 25 | 26 | #include "spdlog/spdlog.h" 27 | #include "spdlog/async.h" 28 | #include "spdlog/details/fmt_helper.h" 29 | #include "spdlog/mdc.h" 30 | #include "spdlog/sinks/basic_file_sink.h" 31 | #include "spdlog/sinks/daily_file_sink.h" 32 | #include "spdlog/sinks/null_sink.h" 33 | #include "spdlog/sinks/ostream_sink.h" 34 | #include "spdlog/sinks/rotating_file_sink.h" 35 | #include "spdlog/sinks/stdout_color_sinks.h" 36 | #include "spdlog/sinks/msvc_sink.h" 37 | #include "spdlog/pattern_formatter.h" 38 | -------------------------------------------------------------------------------- /src/spdlog/tests/main.cpp: -------------------------------------------------------------------------------- 1 | #if defined(__GNUC__) && __GNUC__ == 12 2 | #pragma GCC diagnostic push 3 | #pragma GCC diagnostic ignored "-Wmaybe-uninitialized" // Workaround for GCC 12 4 | #endif 5 | 6 | #include 7 | 8 | #if defined(__GNUC__) && __GNUC__ == 12 9 | #pragma GCC diagnostic pop 10 | #endif 11 | -------------------------------------------------------------------------------- /src/spdlog/tests/test_circular_q.cpp: -------------------------------------------------------------------------------- 1 | #include "includes.h" 2 | #include "spdlog/details/circular_q.h" 3 | 4 | using q_type = spdlog::details::circular_q; 5 | TEST_CASE("test_size", "[circular_q]") { 6 | const size_t q_size = 4; 7 | q_type q(q_size); 8 | REQUIRE(q.size() == 0); 9 | REQUIRE(q.empty() == true); 10 | for (size_t i = 0; i < q_size; i++) { 11 | q.push_back(std::move(i)); 12 | } 13 | REQUIRE(q.size() == q_size); 14 | q.push_back(999); 15 | REQUIRE(q.size() == q_size); 16 | } 17 | 18 | TEST_CASE("test_rolling", "[circular_q]") { 19 | const size_t q_size = 4; 20 | q_type q(q_size); 21 | 22 | for (size_t i = 0; i < q_size + 2; i++) { 23 | q.push_back(std::move(i)); 24 | } 25 | 26 | REQUIRE(q.size() == q_size); 27 | 28 | REQUIRE(q.front() == 2); 29 | q.pop_front(); 30 | 31 | REQUIRE(q.front() == 3); 32 | q.pop_front(); 33 | 34 | REQUIRE(q.front() == 4); 35 | q.pop_front(); 36 | 37 | REQUIRE(q.front() == 5); 38 | q.pop_front(); 39 | 40 | REQUIRE(q.empty()); 41 | 42 | q.push_back(6); 43 | REQUIRE(q.front() == 6); 44 | } 45 | 46 | TEST_CASE("test_empty", "[circular_q]") { 47 | q_type q(0); 48 | q.push_back(1); 49 | REQUIRE(q.empty()); 50 | } -------------------------------------------------------------------------------- /src/spdlog/tests/test_custom_callbacks.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * This content is released under the MIT License as specified in 3 | * https://raw.githubusercontent.com/gabime/spdlog/master/LICENSE 4 | */ 5 | #include "includes.h" 6 | #include "test_sink.h" 7 | #include "spdlog/sinks/callback_sink.h" 8 | #include "spdlog/async.h" 9 | #include "spdlog/common.h" 10 | 11 | TEST_CASE("custom_callback_logger", "[custom_callback_logger]") { 12 | std::vector lines; 13 | spdlog::pattern_formatter formatter; 14 | auto callback_logger = 15 | std::make_shared([&](const spdlog::details::log_msg &msg) { 16 | spdlog::memory_buf_t formatted; 17 | formatter.format(msg, formatted); 18 | auto eol_len = strlen(spdlog::details::os::default_eol); 19 | lines.emplace_back(formatted.begin(), formatted.end() - eol_len); 20 | }); 21 | std::shared_ptr test_sink(new spdlog::sinks::test_sink_st); 22 | 23 | spdlog::logger logger("test-callback", {callback_logger, test_sink}); 24 | 25 | logger.info("test message 1"); 26 | logger.info("test message 2"); 27 | logger.info("test message 3"); 28 | 29 | std::vector ref_lines = test_sink->lines(); 30 | 31 | REQUIRE(lines[0] == ref_lines[0]); 32 | REQUIRE(lines[1] == ref_lines[1]); 33 | REQUIRE(lines[2] == ref_lines[2]); 34 | spdlog::drop_all(); 35 | } 36 | -------------------------------------------------------------------------------- /src/spdlog/tests/test_stopwatch.cpp: -------------------------------------------------------------------------------- 1 | #include "includes.h" 2 | #include "test_sink.h" 3 | #include "spdlog/stopwatch.h" 4 | 5 | TEST_CASE("stopwatch1", "[stopwatch]") { 6 | using std::chrono::milliseconds; 7 | using clock = std::chrono::steady_clock; 8 | milliseconds wait_ms(200); 9 | milliseconds tolerance_ms(250); 10 | auto start = clock::now(); 11 | spdlog::stopwatch sw; 12 | std::this_thread::sleep_for(wait_ms); 13 | auto stop = clock::now(); 14 | auto diff_ms = std::chrono::duration_cast(stop - start); 15 | REQUIRE(sw.elapsed() >= diff_ms); 16 | REQUIRE(sw.elapsed() <= diff_ms + tolerance_ms); 17 | } 18 | 19 | TEST_CASE("stopwatch2", "[stopwatch]") { 20 | using spdlog::sinks::test_sink_st; 21 | using std::chrono::duration_cast; 22 | using std::chrono::milliseconds; 23 | using clock = std::chrono::steady_clock; 24 | 25 | clock::duration wait_duration(milliseconds(200)); 26 | clock::duration tolerance_duration(milliseconds(250)); 27 | 28 | auto test_sink = std::make_shared(); 29 | 30 | auto start = clock::now(); 31 | spdlog::stopwatch sw; 32 | spdlog::logger logger("test-stopwatch", test_sink); 33 | logger.set_pattern("%v"); 34 | std::this_thread::sleep_for(wait_duration); 35 | auto stop = clock::now(); 36 | logger.info("{}", sw); 37 | auto val = std::stod(test_sink->lines()[0]); 38 | auto diff_duration = duration_cast>(stop - start); 39 | 40 | REQUIRE(val >= (diff_duration).count() - 0.001); 41 | REQUIRE(val <= (diff_duration + tolerance_duration).count()); 42 | } 43 | -------------------------------------------------------------------------------- /src/spdlog/tests/test_systemd.cpp: -------------------------------------------------------------------------------- 1 | #include "includes.h" 2 | #include "spdlog/sinks/systemd_sink.h" 3 | 4 | TEST_CASE("systemd", "[all]") { 5 | auto systemd_sink = std::make_shared(); 6 | spdlog::logger logger("spdlog_systemd_test", systemd_sink); 7 | logger.set_level(spdlog::level::trace); 8 | logger.trace("test spdlog trace"); 9 | logger.debug("test spdlog debug"); 10 | SPDLOG_LOGGER_INFO((&logger), "test spdlog info"); 11 | SPDLOG_LOGGER_WARN((&logger), "test spdlog warn"); 12 | SPDLOG_LOGGER_ERROR((&logger), "test spdlog error"); 13 | SPDLOG_LOGGER_CRITICAL((&logger), "test spdlog critical"); 14 | } 15 | -------------------------------------------------------------------------------- /src/spdlog/tests/test_time_point.cpp: -------------------------------------------------------------------------------- 1 | #include "includes.h" 2 | #include "test_sink.h" 3 | #include "spdlog/async.h" 4 | 5 | TEST_CASE("time_point1", "[time_point log_msg]") { 6 | std::shared_ptr test_sink(new spdlog::sinks::test_sink_st); 7 | spdlog::logger logger("test-time_point", test_sink); 8 | 9 | spdlog::source_loc source{}; 10 | std::chrono::system_clock::time_point tp{std::chrono::system_clock::now()}; 11 | test_sink->set_pattern("%T.%F"); // interested in the time_point 12 | 13 | // all the following should have the same time 14 | test_sink->set_delay(std::chrono::milliseconds(10)); 15 | for (int i = 0; i < 5; i++) { 16 | spdlog::details::log_msg msg{tp, source, "test_logger", spdlog::level::info, "message"}; 17 | test_sink->log(msg); 18 | } 19 | 20 | logger.log(tp, source, spdlog::level::info, "formatted message"); 21 | logger.log(tp, source, spdlog::level::info, "formatted message"); 22 | logger.log(tp, source, spdlog::level::info, "formatted message"); 23 | logger.log(tp, source, spdlog::level::info, "formatted message"); 24 | logger.log(source, spdlog::level::info, 25 | "formatted message"); // last line has different time_point 26 | 27 | // now the real test... that the times are the same. 28 | std::vector lines = test_sink->lines(); 29 | REQUIRE(lines[0] == lines[1]); 30 | REQUIRE(lines[2] == lines[3]); 31 | REQUIRE(lines[4] == lines[5]); 32 | REQUIRE(lines[6] == lines[7]); 33 | REQUIRE(lines[8] != lines[9]); 34 | spdlog::drop_all(); 35 | } 36 | -------------------------------------------------------------------------------- /src/spdlog/tests/utils.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include 4 | #include 5 | 6 | std::size_t count_files(const std::string &folder); 7 | 8 | void prepare_logdir(); 9 | 10 | std::string file_contents(const std::string &filename); 11 | 12 | std::size_t count_lines(const std::string &filename); 13 | 14 | void require_message_count(const std::string &filename, const std::size_t messages); 15 | 16 | std::size_t get_filesize(const std::string &filename); 17 | 18 | bool ends_with(std::string const &value, std::string const &ending); -------------------------------------------------------------------------------- /src/sqbinary.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sqinvoker.h" 4 | 5 | template 6 | class SQBinary : public SQInvoker 7 | { 8 | public: 9 | SQBinary(HSQOBJECT binary) : SQInvoker(binary) {} 10 | 11 | SQInteger At(SQInteger offset) { 12 | return this->Invoke(__func__, offset); 13 | } 14 | 15 | SQInteger Size() { 16 | return this->Invoke(__func__); 17 | } 18 | 19 | }; 20 | 21 | template SQBinary; 22 | template SQBinary; 23 | template SQBinary; 24 | template SQBinary; 25 | -------------------------------------------------------------------------------- /src/sqglobals.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sqrat.h" 4 | 5 | template 6 | class SQGlobals : public Sqrat::Object 7 | { 8 | public: 9 | SQGlobals() : Sqrat::Object(Sqrat::RootTable()) {} 10 | 11 | static int GetTitle() 12 | { 13 | return SQGlobals().GetSlot(_SC("s_current_title_dev_id")).Cast(); 14 | } 15 | 16 | static std::string GetExecutable() 17 | { 18 | auto rom = SQGlobals().GetSlot(_SC("s_rom_fileparse")); 19 | return 20 | rom.GetSlot("path").Cast() + 21 | rom.GetSlot("name").Cast() + 22 | rom.GetSlot("ext").Cast(); 23 | } 24 | 25 | static int GetDisk() 26 | { 27 | return SQGlobals().GetSlot(_SC("s_now_disk_no")).Cast(); 28 | } 29 | }; 30 | 31 | template SQGlobals; 32 | template SQGlobals; 33 | template SQGlobals; 34 | template SQGlobals; 35 | -------------------------------------------------------------------------------- /src/sqhelper.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sqrat.h" 4 | 5 | template 6 | class SQHelper 7 | { 8 | public: 9 | SQHelper() {} 10 | 11 | template 12 | static std::vector MakeVector(Sqrat::Array &array) 13 | { 14 | std::vector vector(array.Length()); 15 | array.GetArray(vector.data(), vector.size()); 16 | return vector; 17 | } 18 | 19 | template 20 | static std::vector MakeVector(Sqrat::Object &object) 21 | { 22 | if (object.GetType() != OT_ARRAY) return {}; 23 | auto & array = static_cast &>(object); 24 | return MakeVector(array); 25 | } 26 | 27 | template 28 | static Sqrat::Array MakeArray(const std::vector &vector) 29 | { 30 | Sqrat::Array array; 31 | for (auto & item : vector) array.Append(item); 32 | return array; 33 | } 34 | 35 | // DO NOT USE e,g. `char` / `unsigned char` here. Use `int` / `unsigned int`. 36 | static Sqrat::Object GetObject(SQInteger idx, HSQUIRRELVM v = Sqrat::DefaultVM::Get()) 37 | { 38 | HSQOBJECT object; 39 | sq_getstackobj(v, idx, &object); 40 | return Sqrat::Object(object); 41 | } 42 | 43 | template 44 | static T *AcquireForeignObject(HSQUIRRELVM v = Sqrat::DefaultVM::Get()) 45 | { 46 | if (!sq_getforeignptr(v)) { 47 | sq_setforeignptr(v, new T {}); 48 | } 49 | return reinterpret_cast(sq_getforeignptr(v)); 50 | } 51 | }; 52 | 53 | template SQHelper; 54 | template SQHelper; 55 | template SQHelper; 56 | template SQHelper; 57 | -------------------------------------------------------------------------------- /src/sqinput.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sqinvoker.h" 4 | 5 | template 6 | class SQInput : public SQInvoker 7 | { 8 | public: 9 | SQInput() : SQInvoker(_SC("g_input")) {} 10 | 11 | static SQFloat GetAnalogStickX() { 12 | return SQInput().Invoke(__func__); 13 | } 14 | 15 | static SQFloat GetAnalogStickY() { 16 | return SQInput().Invoke(__func__); 17 | } 18 | 19 | static SQFloat GetRightAnalogStickX() { 20 | return SQInput().Invoke(__func__); 21 | } 22 | 23 | static SQFloat GetRightAnalogStickY() { 24 | return SQInput().Invoke(__func__); 25 | } 26 | 27 | }; 28 | 29 | template SQInput; 30 | template SQInput; 31 | template SQInput; 32 | template SQInput; 33 | -------------------------------------------------------------------------------- /src/sqinputhub.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sqinvoker.h" 4 | 5 | template 6 | class SQInputHub : public SQInvoker 7 | { 8 | public: 9 | SQInputHub() : SQInvoker(_SC("g_inputHub")) {} 10 | 11 | static void SetDirectionMerge(SQInteger mode) { 12 | return SQInputHub().Invoke(__func__, mode); 13 | } 14 | 15 | static void SetDeadzone(SQFloat value) { 16 | return SQInputHub().Invoke(__func__, value); 17 | } 18 | 19 | }; 20 | 21 | template SQInputHub; 22 | template SQInputHub; 23 | template SQInputHub; 24 | template SQInputHub; 25 | -------------------------------------------------------------------------------- /src/sqinvoker.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sqpcheader.h" 4 | #include "sqvm.h" 5 | #include "sqrat.h" 6 | 7 | #include 8 | #include 9 | 10 | template 11 | class SQInvoker 12 | { 13 | public: 14 | SQInvoker(const SQChar *name) 15 | { 16 | Sqrat::RootTable root = Sqrat::RootTable(); 17 | m_instance = root.GetSlot(name); 18 | } 19 | 20 | SQInvoker(const HSQOBJECT &obj) 21 | { 22 | m_instance = obj; 23 | } 24 | 25 | protected: 26 | inline Sqrat::Function Function(const char *function) 27 | { 28 | std::string name(function); 29 | name[0] = tolower(name[0]); 30 | return m_instance.GetFunction(name.c_str()); 31 | } 32 | 33 | template 34 | inline Return Invoke(Sqrat::Function function, Args ... args) 35 | { 36 | constexpr std::size_t count = sizeof...(Args); 37 | if constexpr (std::is_void_v) { 38 | if (function.IsNull()) return; 39 | if constexpr (count == 0) return function.Execute(); 40 | else return function.Execute(args ...); 41 | } else { 42 | if (function.IsNull()) return {}; 43 | Sqrat::SharedPtr ret; 44 | if constexpr (count == 0) ret = function.Evaluate(); 45 | else ret = function.Evaluate(args ...); 46 | if (!ret) return {}; 47 | return *ret; 48 | } 49 | } 50 | 51 | template 52 | inline Return Invoke(const char *function, Args ... args) 53 | { 54 | return Invoke(Function(function), args ...); 55 | } 56 | 57 | protected: 58 | Sqrat::Table m_instance; 59 | }; 60 | 61 | template SQInvoker; 62 | template SQInvoker; 63 | template SQInvoker; 64 | template SQInvoker; 65 | -------------------------------------------------------------------------------- /src/sqrat/README.txt: -------------------------------------------------------------------------------- 1 | Sqrat - Squirrel Binding Utility 2 | 3 | © 2009 Brandon Jones 4 | © 2011-2014 Li-Cheng (Andy) Tai 5 | © 2013-2015 Brandon Haffen AKA Wizzard 6 | 7 | 8 | Sqrat is a C++ binding utility for the Squirrel language. 9 | Up-to-date documentation can be created using Doxygen. 10 | Slightly outdated documentation can be found at 11 | http://scrat.sourceforge.net/0.9/ 12 | 13 | Sqrat only contains C++ headers so for installation you just 14 | need to copy the files in the include directory to 15 | some common header path, such as /usr/local/include. 16 | 17 | However, an autotool based build system can be checked out from 18 | the code repository (not in the relase tar file to reduce file size) 19 | which allows you to install, on POSIX systems, with 20 | the familiar commands of 21 | 22 | autotool/configure --prefix= 23 | make && make install 24 | 25 | You can then run 26 | 27 | make check 28 | 29 | to run the unit tests. 30 | 31 | Alternatively you can follow the steps in 32 | running_tests.txt 33 | 34 | to directly run unit tests. 35 | 36 | For more information, see index.html in the docs subdirectory 37 | 38 | Discussion and User Support 39 | 40 | Discussion about Sqrat happens at the Squirrel language forum, 41 | the Bindings section 42 | http://squirrel-lang.org/forums/default.aspx?g=topics&f=4 43 | 44 | Bug Reporting 45 | 46 | Bug reports or feature enhancement requests and patches can 47 | be submitted at the SourceForge Sqrat site 48 | https://sourceforge.net/tracker/?group_id=261661&atid=2349886 49 | -------------------------------------------------------------------------------- /src/sqrat/gtest-1.3.0/CONTRIBUTORS: -------------------------------------------------------------------------------- 1 | # This file contains a list of people who've made non-trivial 2 | # contribution to the Google C++ Testing Framework project. People 3 | # who commit code to the project are encouraged to add their names 4 | # here. Please keep the list sorted by first names. 5 | 6 | Ajay Joshi 7 | Balázs Dán 8 | Bharat Mediratta 9 | Chandler Carruth 10 | Chris Prince 11 | Chris Taylor 12 | Dan Egnor 13 | Eric Roman 14 | Jeffrey Yasskin 15 | Jói Sigurðsson 16 | Keir Mierle 17 | Keith Ray 18 | Kenton Varda 19 | Markus Heule 20 | Mika Raento 21 | Patrick Hanna 22 | Patrick Riley 23 | Peter Kaminski 24 | Preston Jackson 25 | Rainer Klaffenboeck 26 | Russ Cox 27 | Russ Rufer 28 | Sean Mcafee 29 | Sigurður Ásgeirsson 30 | Tracy Bialik 31 | Vadim Berman 32 | Vlad Losev 33 | Zhanyong Wan 34 | -------------------------------------------------------------------------------- /src/sqrat/gtest-1.3.0/COPYING: -------------------------------------------------------------------------------- 1 | Copyright 2008, Google Inc. 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are 6 | met: 7 | 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above 11 | copyright notice, this list of conditions and the following disclaimer 12 | in the documentation and/or other materials provided with the 13 | distribution. 14 | * Neither the name of Google Inc. nor the names of its 15 | contributors may be used to endorse or promote products derived from 16 | this software without specific prior written permission. 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | -------------------------------------------------------------------------------- /src/sqrat/gtest-1.3.0/build_gtest.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | g++ -fpermissive -I. -I./include -c src/gtest-all.cc && \ 3 | ar -rv libgtest.a gtest-all.o -------------------------------------------------------------------------------- /src/sqrat/gtest-1.3.0/src/gtest_main.cc: -------------------------------------------------------------------------------- 1 | // Copyright 2006, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | #include 31 | 32 | #include 33 | 34 | int main(int argc, char **argv) { 35 | std::cout << "Running main() from gtest_main.cc\n"; 36 | 37 | testing::InitGoogleTest(&argc, argv); 38 | return RUN_ALL_TESTS(); 39 | } 40 | -------------------------------------------------------------------------------- /src/sqrat/running_tests.txt: -------------------------------------------------------------------------------- 1 | currently there are shell scripts to facilitate running the built in unit tests 2 | on GNU/Linux and Unix like systems. 3 | 4 | Steps: 5 | (cd gtest-1.3.0 && ./build_gtest.sh) 6 | (cd sqrattest && ./build_tests.sh && ./run_tests.sh) 7 | 8 | You can edit build_tests.sh to point to the location of your squirrel include 9 | and library directory paths, if they are not in /usr/local/. 10 | 11 | Batch files to do the same on Microsoft Windows: contributions welcome! -------------------------------------------------------------------------------- /src/sqrat/sqrattest/Main.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int main(int argc, char* argv[]) { 4 | ::testing::InitGoogleTest(&argc, argv); 5 | return RUN_ALL_TESTS(); 6 | } -------------------------------------------------------------------------------- /src/sqrat/sqrattest/SqratVM.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2012 Li-Cheng (Andy) Tai, atai@atai.org 3 | // 4 | // This software is provided 'as-is', without any express or implied 5 | // warranty. In no event will the authors be held liable for any damages 6 | // arising from the use of this software. 7 | // 8 | // Permission is granted to anyone to use this software for any purpose, 9 | // including commercial applications, and to alter it and redistribute it 10 | // freely, subject to the following restrictions: 11 | // 12 | // 1. The origin of this software must not be misrepresented; you must not 13 | // claim that you wrote the original software. If you use this software 14 | // in a product, an acknowledgment in the product documentation would be 15 | // appreciated but is not required. 16 | // 17 | // 2. Altered source versions must be plainly marked as such, and must not be 18 | // misrepresented as being the original software. 19 | // 20 | // 3. This notice may not be removed or altered from any source 21 | // distribution. 22 | // 23 | 24 | 25 | #include 26 | #include 27 | #include 28 | #include "Fixture.h" 29 | /* test demonstrating Sourceforge bug 3507590 */ 30 | 31 | using namespace Sqrat; 32 | 33 | class simpleclass 34 | { 35 | public: 36 | simpleclass() {} 37 | void memfun() {} 38 | }; 39 | 40 | void bind(HSQUIRRELVM vm) 41 | { 42 | Sqrat::Class sqClass(vm, _SC("simpleclass")); 43 | sqClass 44 | .Func(_SC("memfun"), &simpleclass::memfun); 45 | Sqrat::RootTable(vm).Bind(_SC("simpleclass"), sqClass); 46 | 47 | } 48 | 49 | TEST_F(SqratTest, SqratVM) 50 | { 51 | SqratVM vm1; 52 | SqratVM vm2; 53 | 54 | bind(vm1.GetVM()); 55 | bind(vm2.GetVM()); 56 | 57 | } -------------------------------------------------------------------------------- /src/sqrat/sqrattest/SqratVM2.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2012 Li-Cheng (Andy) Tai, atai@atai.org 3 | // 4 | // This software is provided 'as-is', without any express or implied 5 | // warranty. In no event will the authors be held liable for any damages 6 | // arising from the use of this software. 7 | // 8 | // Permission is granted to anyone to use this software for any purpose, 9 | // including commercial applications, and to alter it and redistribute it 10 | // freely, subject to the following restrictions: 11 | // 12 | // 1. The origin of this software must not be misrepresented; you must not 13 | // claim that you wrote the original software. If you use this software 14 | // in a product, an acknowledgment in the product documentation would be 15 | // appreciated but is not required. 16 | // 17 | // 2. Altered source versions must be plainly marked as such, and must not be 18 | // misrepresented as being the original software. 19 | // 20 | // 3. This notice may not be removed or altered from any source 21 | // distribution. 22 | // 23 | 24 | 25 | #include 26 | #include 27 | #include 28 | #include "Fixture.h" 29 | /* test demonstrating Sourceforge bug 3507590 */ 30 | 31 | using namespace Sqrat; 32 | 33 | -------------------------------------------------------------------------------- /src/sqrat/sqrattest/UniqueObject.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include "Fixture.h" 4 | 5 | struct CxxObject { 6 | CxxObject& cxx_ptr() { 7 | return *this; 8 | } 9 | }; 10 | 11 | char const script_code[] = "\ 12 | v <- CxxObject();\ 13 | gTest.EXPECT_STR_EQ(v.tostring, v.cxx_ptr().tostring);\ 14 | \ 15 | target <- null;\ 16 | function set_target(v) {\ 17 | ::target = v;\ 18 | }\ 19 | function test_target(v) {\ 20 | gTest.EXPECT_STR_EQ(::target.tostring, v.tostring);\ 21 | }\ 22 | "; 23 | 24 | using namespace Sqrat; 25 | 26 | TEST_F(SqratTest, UniqueObject) { 27 | DefaultVM::Set(vm); 28 | 29 | Class cls(vm, _SC("CxxObject")); 30 | cls.Func(_SC("cxx_ptr"), &CxxObject::cxx_ptr); 31 | RootTable(vm).Bind(_SC("CxxObject"), cls); 32 | 33 | Script script; 34 | std::string err; 35 | if (!script.CompileString(script_code, err)) { 36 | FAIL() << _SC("Compile failed: ") << err; 37 | } 38 | if (!script.Run(err)) { 39 | FAIL() << _SC("Script failed: ") << err; 40 | } 41 | 42 | Function set_target(RootTable(vm), "set_target"), test_target(RootTable(vm), "test_target"); 43 | CxxObject* obj = new CxxObject; 44 | set_target(obj); 45 | test_target(obj); 46 | delete obj; 47 | } 48 | -------------------------------------------------------------------------------- /src/sqrat/sqrattest/Vector.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) 2009 Brandon Jones 3 | // 4 | // This software is provided 'as-is', without any express or implied 5 | // warranty. In no event will the authors be held liable for any damages 6 | // arising from the use of this software. 7 | // 8 | // Permission is granted to anyone to use this software for any purpose, 9 | // including commercial applications, and to alter it and redistribute it 10 | // freely, subject to the following restrictions: 11 | // 12 | // 1. The origin of this software must not be misrepresented; you must not 13 | // claim that you wrote the original software. If you use this software 14 | // in a product, an acknowledgment in the product documentation would be 15 | // appreciated but is not required. 16 | // 17 | // 2. Altered source versions must be plainly marked as such, and must not be 18 | // misrepresented as being the original software. 19 | // 20 | // 3. This notice may not be removed or altered from any source 21 | // distribution. 22 | // 23 | 24 | #if !defined(SQRAT_TEST_VECTOR_H) 25 | #define SQRAT_TEST_VECTOR_H 26 | 27 | #include 28 | 29 | namespace Sqrat { 30 | // A simple Vector class used to demonstrate binding 31 | class Vec2 { 32 | public: 33 | float x, y; 34 | 35 | Vec2( void ); 36 | Vec2( const Vec2 &v ); 37 | Vec2( const float vx, const float vy ); 38 | 39 | bool operator ==( const Vec2 &v ) const; 40 | Vec2 operator -( void ) const; 41 | Vec2 operator +( const Vec2& v ) const; 42 | Vec2 operator -( const Vec2& v ) const; 43 | Vec2 operator *( const float f ) const; 44 | Vec2 operator /( const float f ) const; 45 | Vec2& operator =( const Vec2& v ); 46 | 47 | float Length( void ) const; 48 | float Distance( const Vec2 &v ) const; 49 | Vec2& Normalize( void ); 50 | float Dot( const Vec2 &v ) const; 51 | }; 52 | } 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /src/sqrat/sqrattest/build_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | 3 | #shopt -s nullglob 4 | 5 | SQUIRREL_INCLUDE=/usr/local/include/squirrel 6 | SQUIRREL_LIB=/usr/local/lib 7 | CFLAGS="-g -O0 -I. -I../include -I../gtest-1.3.0/include -I${SQUIRREL_INCLUDE}" 8 | LDFLAGS=-L${SQUIRREL_LIB} 9 | LIBS="../gtest-1.3.0/libgtest.a -lsqstdlib -lsquirrel -lstdc++ -lm " 10 | 11 | mkdir -p bin 12 | 13 | gcc $CFLAGS \ 14 | ../sqimport/sqratimport.cpp ImportTest.cpp Main.cpp \ 15 | -o bin/ImportTest ${LDFLAGS} ${LIBS} -ldl 16 | 17 | TEST_CPPS="ClassBinding.cpp\ 18 | ClassInstances.cpp\ 19 | ClassProperties.cpp\ 20 | ConstBindings.cpp\ 21 | FunctionOverload.cpp\ 22 | ScriptLoading.cpp\ 23 | SquirrelFunctions.cpp\ 24 | TableBinding.cpp\ 25 | FunctionParams.cpp \ 26 | RunStackHandling.cpp \ 27 | SuspendVM.cpp \ 28 | NullPointerReturn.cpp\ 29 | FuncInputArgumentType.cpp \ 30 | ArrayBinding.cpp \ 31 | UniqueObject.cpp " 32 | 33 | for f in $TEST_CPPS; do 34 | gcc $CFLAGS \ 35 | ${f} Vector.cpp Main.cpp \ 36 | -o bin/${f%.cpp} ${LDFLAGS} ${LIBS} 37 | done 38 | -------------------------------------------------------------------------------- /src/sqrat/sqrattest/build_tests_msys.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -ex 2 | 3 | #shopt -s nullglob 4 | 5 | SQUIRREL_INCLUDE=C:/SQUIRREL3/include 6 | SQUIRREL_LIB=C:/SQUIRREL3/lib 7 | CFLAGS="-g -O0 -I. -I../include -IC:/gtest-1.7.0/include -I${SQUIRREL_INCLUDE}" 8 | LDFLAGS=-L${SQUIRREL_LIB} 9 | LIBS="C:/gtest-1.7.0/build/libgtest.a -lsqstdlib -lsquirrel -lstdc++ -lm" 10 | 11 | mkdir -p bin 12 | 13 | gcc $CFLAGS \ 14 | ../sqimport/sqratimport.cpp ImportTest.cpp Main.cpp \ 15 | -o bin/ImportTest ${LDFLAGS} ${LIBS} 16 | 17 | TEST_CPPS="ClassBinding.cpp\ 18 | ClassInstances.cpp\ 19 | ClassProperties.cpp\ 20 | ConstBindings.cpp\ 21 | FunctionOverload.cpp\ 22 | ScriptLoading.cpp\ 23 | SquirrelFunctions.cpp\ 24 | TableBinding.cpp\ 25 | FunctionParams.cpp \ 26 | RunStackHandling.cpp \ 27 | SuspendVM.cpp \ 28 | NullPointerReturn.cpp\ 29 | FuncInputArgumentType.cpp \ 30 | ArrayBinding.cpp \ 31 | UniqueObject.cpp " 32 | 33 | for f in $TEST_CPPS; do 34 | gcc $CFLAGS \ 35 | ${f} Vector.cpp Main.cpp \ 36 | -o bin/${f%.cpp} ${LDFLAGS} ${LIBS} 37 | done 38 | -------------------------------------------------------------------------------- /src/sqrat/sqrattest/run_tests.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh -x 2 | 3 | for f in bin/*; do 4 | ${f} 5 | done -------------------------------------------------------------------------------- /src/sqrat/sqrattest/scripts/hello.nut: -------------------------------------------------------------------------------- 1 | x <- 1 + 2; 2 | gTest.EXPECT_STR_EQ(x, 3); -------------------------------------------------------------------------------- /src/sqrat/sqrattest/scripts/samplemodule.nut: -------------------------------------------------------------------------------- 1 | PI <- 3.1415; 2 | 3 | function RectArea(w, h) { 4 | return w * h; 5 | } 6 | 7 | function CircleArea(radius) { 8 | return PI * (radius * radius); 9 | } -------------------------------------------------------------------------------- /src/sqrat/sqratthread/sqratThread.h: -------------------------------------------------------------------------------- 1 | // 2 | // SqratThread: Sqrat threading module 3 | // 4 | 5 | // 6 | // Copyright (c) 2009 Brandon Jones 7 | // 8 | // This software is provided 'as-is', without any express or implied 9 | // warranty. In no event will the authors be held liable for any damages 10 | // arising from the use of this software. 11 | // 12 | // Permission is granted to anyone to use this software for any purpose, 13 | // including commercial applications, and to alter it and redistribute it 14 | // freely, subject to the following restrictions: 15 | // 16 | // 1. The origin of this software must not be misrepresented; you must not 17 | // claim that you wrote the original software. If you use this software 18 | // in a product, an acknowledgment in the product documentation would be 19 | // appreciated but is not required. 20 | // 21 | // 2. Altered source versions must be plainly marked as such, and must not be 22 | // misrepresented as being the original software. 23 | // 24 | // 3. This notice may not be removed or altered from any source 25 | // distribution. 26 | // 27 | 28 | #if !defined(_SQRAT_THREAD_H_) 29 | #define _SQRAT_THREAD_H_ 30 | 31 | #include "sqmodule.h" 32 | 33 | template 34 | __declspec(dllexport) SQRESULT sqmodule_load(HSQUIRRELVM v, HSQAPI api); 35 | 36 | 37 | #endif /*_SQRAT_THREAD_H_*/ 38 | -------------------------------------------------------------------------------- /src/sqsystemdata.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sqinvoker.h" 4 | #include "sqhelper.h" 5 | 6 | class SystemDataSettingEtc { 7 | 8 | }; 9 | 10 | template 11 | class SQSystemData : public SQInvoker 12 | { 13 | public: 14 | enum class Index { 15 | SETTING_PAD, 16 | SETTING_SCREEN, 17 | SETTING_SOUND, 18 | SETTING_SAVEDATA, 19 | SETTING_ETC, 20 | SETTING_NETWORK, 21 | SETTING_GAME, 22 | BACKUP_FLAGS, 23 | WINDOW_INFO, 24 | PURCHASE_RECORD, 25 | WORK_MEDAL, 26 | WORK_TRIAL, 27 | SRAM_DATA, 28 | WORK_TITLE, 29 | }; 30 | 31 | class SettingPad : public SQInvoker 32 | { 33 | public: 34 | SettingPad() : SQInvoker(_SC("g_systemdata")) { 35 | auto obj = this->Invoke>("get_value", static_cast(Index::SETTING_PAD)); 36 | this->m_instance = obj.GetObject(); 37 | } 38 | 39 | static int GetPlaySide_MGS1() { 40 | return SettingPad().Invoke("get_playside_mgs"); 41 | } 42 | 43 | static void SetPlaySide_MGS1(int side) { 44 | return SettingPad().Invoke("set_playside_mgs", side); 45 | } 46 | }; 47 | 48 | class SettingETC : public SQInvoker 49 | { 50 | public: 51 | SettingETC() : SQInvoker(_SC("g_systemdata")) { 52 | auto obj = this->Invoke>("get_value", static_cast(Index::SETTING_ETC)); 53 | this->m_instance = obj.GetObject(); 54 | } 55 | 56 | static std::string GetVersion() { 57 | return SettingETC().Invoke("get_game_regionTag"); 58 | } 59 | }; 60 | 61 | SQSystemData() : SQInvoker(_SC("g_systemdata")) {} 62 | }; 63 | 64 | template SQSystemData; 65 | template SQSystemData; 66 | template SQSystemData; 67 | template SQSystemData; 68 | -------------------------------------------------------------------------------- /src/sqsystemprof.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "sqrat.h" 4 | 5 | template 6 | class SQSystemProf : public Sqrat::Object 7 | { 8 | public: 9 | SQSystemProf() : Sqrat::Object(Sqrat::RootTable()[_SC("s_root_systemprof")][_SC("root")]) 10 | {} 11 | 12 | static std::string GetName() 13 | { 14 | return SQSystemProf()["dev_name"].Cast(); 15 | } 16 | }; 17 | 18 | template SQSystemProf; 19 | template SQSystemProf; 20 | template SQSystemProf; 21 | template SQSystemProf; 22 | -------------------------------------------------------------------------------- /src/squirk.h: -------------------------------------------------------------------------------- 1 | enum class Squirk { 2 | Standard, 3 | AlignObject, 4 | StandardShared, 5 | AlignObjectShared, 6 | }; 7 | -------------------------------------------------------------------------------- /src/squirrel/COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (c) 2003-2009 Alberto Demichelis 2 | 3 | This software is provided 'as-is', without any 4 | express or implied warranty. In no event will the 5 | authors be held liable for any damages arising from 6 | the use of this software. 7 | 8 | Permission is granted to anyone to use this software 9 | for any purpose, including commercial applications, 10 | and to alter it and redistribute it freely, subject 11 | to the following restrictions: 12 | 13 | 1. The origin of this software must not be 14 | misrepresented; you must not claim that 15 | you wrote the original software. If you 16 | use this software in a product, an 17 | acknowledgment in the product 18 | documentation would be appreciated but is 19 | not required. 20 | 21 | 2. Altered source versions must be plainly 22 | marked as such, and must not be 23 | misrepresented as being the original 24 | software. 25 | 26 | 3. This notice may not be removed or 27 | altered from any source distribution. 28 | ----------------------------------------------------- 29 | END OF COPYRIGHT -------------------------------------------------------------------------------- /src/squirrel/include/sqstdaux.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTD_AUXLIB_H_ 3 | #define _SQSTD_AUXLIB_H_ 4 | 5 | template 6 | SQUIRREL_API void sqstd_seterrorhandlers(HSQUIRRELVM v); 7 | template 8 | SQUIRREL_API void sqstd_printcallstack(HSQUIRRELVM v); 9 | 10 | #endif /* _SQSTD_AUXLIB_H_ */ 11 | -------------------------------------------------------------------------------- /src/squirrel/include/sqstdblob.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTDBLOB_H_ 3 | #define _SQSTDBLOB_H_ 4 | 5 | template 6 | SQUIRREL_API SQUserPointer sqstd_createblob(HSQUIRRELVM v, SQInteger size); 7 | template 8 | SQUIRREL_API SQRESULT sqstd_getblob(HSQUIRRELVM v,SQInteger idx,SQUserPointer *ptr); 9 | template 10 | SQUIRREL_API SQInteger sqstd_getblobsize(HSQUIRRELVM v,SQInteger idx); 11 | 12 | template 13 | SQUIRREL_API SQRESULT sqstd_register_bloblib(HSQUIRRELVM v); 14 | 15 | #endif /*_SQSTDBLOB_H_*/ 16 | 17 | -------------------------------------------------------------------------------- /src/squirrel/include/sqstdmath.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTD_MATH_H_ 3 | #define _SQSTD_MATH_H_ 4 | 5 | template 6 | SQUIRREL_API SQRESULT sqstd_register_mathlib(HSQUIRRELVM v); 7 | 8 | #endif /*_SQSTD_MATH_H_*/ 9 | -------------------------------------------------------------------------------- /src/squirrel/include/sqstdstring.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTD_STRING_H_ 3 | #define _SQSTD_STRING_H_ 4 | 5 | typedef unsigned int SQRexBool; 6 | typedef struct SQRex SQRex; 7 | 8 | typedef struct { 9 | const SQChar *begin; 10 | SQInteger len; 11 | } SQRexMatch; 12 | 13 | SQUIRREL_API SQRex *sqstd_rex_compile(const SQChar *pattern,const SQChar **error); 14 | SQUIRREL_API void sqstd_rex_free(SQRex *exp); 15 | SQUIRREL_API SQBool sqstd_rex_match(SQRex* exp,const SQChar* text); 16 | SQUIRREL_API SQBool sqstd_rex_search(SQRex* exp,const SQChar* text, const SQChar** out_begin, const SQChar** out_end); 17 | SQUIRREL_API SQBool sqstd_rex_searchrange(SQRex* exp,const SQChar* text_begin,const SQChar* text_end,const SQChar** out_begin, const SQChar** out_end); 18 | SQUIRREL_API SQInteger sqstd_rex_getsubexpcount(SQRex* exp); 19 | SQUIRREL_API SQBool sqstd_rex_getsubexp(SQRex* exp, SQInteger n, SQRexMatch *subexp); 20 | 21 | template 22 | SQUIRREL_API SQRESULT sqstd_format(HSQUIRRELVM v,SQInteger nformatstringidx,SQInteger *outlen,SQChar **output); 23 | 24 | template 25 | SQUIRREL_API SQRESULT sqstd_register_stringlib(HSQUIRRELVM v); 26 | 27 | #endif /*_SQSTD_STRING_H_*/ 28 | -------------------------------------------------------------------------------- /src/squirrel/include/sqstdsystem.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTD_SYSTEMLIB_H_ 3 | #define _SQSTD_SYSTEMLIB_H_ 4 | 5 | template 6 | SQUIRREL_API SQInteger sqstd_register_systemlib(HSQUIRRELVM v); 7 | 8 | #endif /* _SQSTD_SYSTEMLIB_H_ */ 9 | -------------------------------------------------------------------------------- /src/squirrel/sqdbg/sqrdbg.h: -------------------------------------------------------------------------------- 1 | #ifndef _SQ_RDBG_H_ 2 | #define _SQ_RDBG_H_ 3 | 4 | #ifdef _WIN32 5 | #pragma comment(lib, "WSOCK32.LIB") 6 | #endif 7 | 8 | template 9 | struct SQDbgServer; 10 | template 11 | using HSQREMOTEDBG = SQDbgServer*; 12 | 13 | template 14 | HSQREMOTEDBG sq_rdbg_init(HSQUIRRELVM v,unsigned short port,SQBool autoupdate,SQBool exclusive); 15 | template 16 | SQRESULT sq_rdbg_waitforconnections(HSQREMOTEDBG rdbg); 17 | template 18 | SQRESULT sq_rdbg_shutdown(HSQREMOTEDBG rdbg); 19 | template 20 | SQRESULT sq_rdbg_update(HSQREMOTEDBG rdbg); 21 | 22 | #endif //_SQ_RDBG_H_ 23 | -------------------------------------------------------------------------------- /src/squirrel/sqstdlib/sqstdstream.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTD_STREAM_H_ 3 | #define _SQSTD_STREAM_H_ 4 | 5 | template 6 | SQInteger _stream_readblob(HSQUIRRELVM v); 7 | template 8 | SQInteger _stream_readline(HSQUIRRELVM v); 9 | template 10 | SQInteger _stream_readn(HSQUIRRELVM v); 11 | template 12 | SQInteger _stream_writeblob(HSQUIRRELVM v); 13 | template 14 | SQInteger _stream_writen(HSQUIRRELVM v); 15 | template 16 | SQInteger _stream_seek(HSQUIRRELVM v); 17 | template 18 | SQInteger _stream_tell(HSQUIRRELVM v); 19 | template 20 | SQInteger _stream_len(HSQUIRRELVM v); 21 | template 22 | SQInteger _stream_eos(HSQUIRRELVM v); 23 | template 24 | SQInteger _stream_flush(HSQUIRRELVM v); 25 | 26 | #define _DECL_STREAM_FUNC(name,nparams,typecheck) {_SC(#name),_stream_##name,nparams,typecheck} 27 | template 28 | SQRESULT declare_stream(HSQUIRRELVM v, const SQChar* name,SQUserPointer typetag,const SQChar* reg_name,SQRegFunction *methods,SQRegFunction *globals); 29 | #endif /*_SQSTD_STREAM_H_*/ 30 | -------------------------------------------------------------------------------- /src/squirrel/squirrel/sqlexer.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQLEXER_H_ 3 | #define _SQLEXER_H_ 4 | 5 | #ifdef SQUNICODE 6 | typedef SQChar LexChar; 7 | #else 8 | typedef unsigned char LexChar; 9 | #endif 10 | 11 | template 12 | struct SQLexer 13 | { 14 | SQLexer(); 15 | ~SQLexer(); 16 | void Init(SQSharedState *ss,SQLEXREADFUNC rg,SQUserPointer up,CompilerErrorFunc efunc,void *ed); 17 | void Error(const SQChar *err); 18 | SQInteger Lex(); 19 | const SQChar *Tok2Str(SQInteger tok); 20 | private: 21 | SQInteger GetIDType(SQChar *s); 22 | SQInteger ReadString(SQInteger ndelim,bool verbatim); 23 | SQInteger ReadNumber(); 24 | void LexBlockComment(); 25 | SQInteger ReadID(); 26 | void Next(); 27 | SQInteger _curtoken; 28 | SQTable *_keywords; 29 | public: 30 | SQInteger _prevtoken; 31 | SQInteger _currentline; 32 | SQInteger _lasttokenline; 33 | SQInteger _currentcolumn; 34 | const SQChar *_svalue; 35 | SQInteger _nvalue; 36 | SQFloat _fvalue; 37 | SQLEXREADFUNC _readf; 38 | SQUserPointer _up; 39 | LexChar _currdata; 40 | SQSharedState *_sharedstate; 41 | sqvector _longstr; 42 | CompilerErrorFunc _errfunc; 43 | void *_errtarget; 44 | }; 45 | 46 | template SQLexer; 47 | template SQLexer; 48 | template SQLexer; 49 | template SQLexer; 50 | 51 | #endif 52 | -------------------------------------------------------------------------------- /src/squirrel/squirrel/sqmem.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | see copyright notice in squirrel.h 3 | */ 4 | #include "sqpcheader.h" 5 | 6 | #include 7 | 8 | #pragma runtime_checks("", off) 9 | 10 | void * (__fastcall *_sq_vm_realloc)(void *, SQUnsignedInteger, SQUnsignedInteger); 11 | 12 | void *sq_vm_malloc(SQUnsignedInteger size) 13 | { 14 | if (_sq_vm_realloc) { 15 | void *p = _sq_vm_realloc(nullptr, 0, size); 16 | #ifndef _WIN64 17 | __asm { add esp, 4 } // "fastcall" but with caller cleanup of the stack argument - LTO?! 18 | #endif 19 | return p; 20 | } 21 | 22 | return nullptr; 23 | } 24 | 25 | void *sq_vm_realloc(void *p, SQUnsignedInteger oldsize, SQUnsignedInteger size) 26 | { 27 | if (_sq_vm_realloc) { 28 | p = _sq_vm_realloc(p, oldsize, size); 29 | #ifndef _WIN64 30 | __asm { add esp, 4 } // "fastcall" but with caller cleanup of the stack argument - LTO?! 31 | #endif 32 | return p; 33 | } 34 | 35 | return nullptr; 36 | } 37 | 38 | void sq_vm_free(void *p, SQUnsignedInteger size) 39 | { 40 | if (_sq_vm_realloc) { 41 | _sq_vm_realloc(p, size, 0); 42 | #ifndef _WIN64 43 | __asm { add esp, 4 } // "fastcall" but with caller cleanup of the stack argument - LTO?! 44 | #endif 45 | } 46 | } 47 | 48 | #pragma runtime_checks("", restore) 49 | -------------------------------------------------------------------------------- /src/squirrel/squirrel/sqpcheader.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQPCHEADER_H_ 3 | #define _SQPCHEADER_H_ 4 | 5 | #if defined(_MSC_VER) && defined(_DEBUG) 6 | #include 7 | #endif 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | //squirrel stuff 15 | #include "squirrel.h" 16 | #include "sqobject.h" 17 | #include "sqstate.h" 18 | 19 | #endif //_SQPCHEADER_H_ 20 | -------------------------------------------------------------------------------- /src/squirrel/squirrel/sqstring.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQSTRING_H_ 3 | #define _SQSTRING_H_ 4 | 5 | inline SQHash _hashstr (const SQChar *s, size_t l) 6 | { 7 | SQHash h = (SQHash)l; /* seed */ 8 | size_t step = (l>>5)|1; /* if string is too long, don't hash all its chars */ 9 | for (; l>=step; l-=step) 10 | h = h ^ ((h<<5)+(h>>2)+(unsigned short)*(s++)); 11 | return h; 12 | } 13 | 14 | template 15 | struct SQString : public SQRefCounted 16 | { 17 | SQString(){} 18 | ~SQString(){} 19 | public: 20 | static SQString *Create(SQSharedState *ss, const SQChar *, SQInteger len = -1 ); 21 | SQInteger Next(const SQObjectPtr &refpos, SQObjectPtr &outkey, SQObjectPtr &outval); 22 | void Release(); 23 | SQSharedState *_sharedstate; 24 | SQString *_next; //chain for the string table 25 | SQInteger _len; 26 | 27 | #if defined(_SQ_M2) && defined(_WIN64) 28 | SQInteger _m2_unknown; 29 | #endif 30 | 31 | SQHash _hash; 32 | SQChar _val[1]; 33 | }; 34 | 35 | template SQString; 36 | template SQString; 37 | template SQString; 38 | template SQString; 39 | 40 | #endif //_SQSTRING_H_ 41 | -------------------------------------------------------------------------------- /src/squirrel/squirrel/squserdata.h: -------------------------------------------------------------------------------- 1 | /* see copyright notice in squirrel.h */ 2 | #ifndef _SQUSERDATA_H_ 3 | #define _SQUSERDATA_H_ 4 | 5 | template 6 | struct SQUserData : SQDelegable 7 | { 8 | SQUserData(SQSharedState *ss){ SQDelegable::_delegate = 0; _hook = NULL; INIT_CHAIN(); ADD_TO_CHAIN(&_ss(this)->_gc_chain, this); } 9 | ~SQUserData() 10 | { 11 | REMOVE_FROM_CHAIN(&_ss(this)->_gc_chain, this); 12 | SQDelegable::SetDelegate(NULL); 13 | } 14 | static SQUserData* Create(SQSharedState *ss, SQInteger size) 15 | { 16 | SQUserData* ud = (SQUserData*)SQ_MALLOC(sizeof(SQUserData)+(size-1)); 17 | new (ud) SQUserData(ss); 18 | ud->_size = size; 19 | ud->_typetag = 0; 20 | return ud; 21 | } 22 | #ifndef NO_GARBAGE_COLLECTOR 23 | void Mark(SQCollectable **chain); 24 | void Finalize(){SQDelegable::SetDelegate(NULL);} 25 | #endif 26 | void Release() { 27 | if (_hook) _hook(_val,_size); 28 | SQInteger tsize = _size - 1; 29 | this->~SQUserData(); 30 | SQ_FREE(this, sizeof(SQUserData) + tsize); 31 | } 32 | 33 | SQInteger _size; 34 | SQRELEASEHOOK _hook; 35 | SQUserPointer _typetag; 36 | SQChar _val[1]; 37 | }; 38 | 39 | template SQUserData; 40 | template SQUserData; 41 | template SQUserData; 42 | template SQUserData; 43 | 44 | #endif //_SQUSERDATA_H_ 45 | -------------------------------------------------------------------------------- /src/stdafx.cpp: -------------------------------------------------------------------------------- 1 | #include "stdafx.h" 2 | -------------------------------------------------------------------------------- /src/stdafx.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #include "safetyhook.hpp" 4 | #include "TypeTraits.h" 5 | using namespace StdExt; 6 | #include "Zydis.h" 7 | 8 | #define WIN32_LEAN_AND_MEAN 9 | #define NOMINMAX 10 | #include 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | #include 31 | #include 32 | #include 33 | #include 34 | #include 35 | 36 | #undef Yield 37 | #undef GetObject 38 | #undef LoadImage 39 | 40 | #include "resource.h" 41 | 42 | #include "sqpcheader.h" 43 | #include "sqcompiler.h" 44 | #include "sqvm.h" 45 | #include "sqarray.h" 46 | #include "sqtable.h" 47 | #include "sqclass.h" 48 | #include "sqclosure.h" 49 | #include "sqfuncproto.h" 50 | #include "squserdata.h" 51 | #include "sqstring.h" 52 | #include "sqstdstring.h" 53 | 54 | #include "sqrat.h" 55 | 56 | #include "inipp.h" 57 | #include "spdlog.h" 58 | #include "spdlog/sinks/basic_file_sink.h" 59 | #include "spdlog/sinks/stdout_sinks.h" 60 | #include "spdlog/sinks/wincolor_sink.h" 61 | --------------------------------------------------------------------------------