mirror of
https://github.com/MadeOfJelly/MushMachine.git
synced 2025-12-06 21:36:35 +01:00
Compare commits
12 Commits
negative_b
...
2ea7a1529a
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
2ea7a1529a | ||
|
|
e6403f0582 | ||
|
|
e64354e824 | ||
| cd0b35b465 | |||
| c051d36a64 | |||
| 202ba31d79 | |||
| df949a5afc | |||
| 9b173c64a6 | |||
| 3a885ee250 | |||
| 00e48f9967 | |||
| c791f4c6a1 | |||
| 7a3823db78 |
17
.github/workflows/cmake.yml
vendored
17
.github/workflows/cmake.yml
vendored
@@ -14,7 +14,7 @@ env:
|
||||
|
||||
jobs:
|
||||
linux:
|
||||
timeout-minutes: 10
|
||||
timeout-minutes: 15
|
||||
|
||||
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
|
||||
# You can convert this to a matrix build if you need cross-platform coverage.
|
||||
@@ -98,14 +98,17 @@ jobs:
|
||||
with:
|
||||
submodules: recursive
|
||||
|
||||
- name: Setup emsdk
|
||||
uses: mymindstorm/setup-emsdk@v11
|
||||
- name: Setup em cache
|
||||
id: em-cache-system-libraries
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ${{env.EM_CACHE_FOLDER}}
|
||||
key: ${{env.EM_VERSION}}-${{ runner.os }}
|
||||
|
||||
- name: Setup emsdk
|
||||
uses: mymindstorm/setup-emsdk@v14
|
||||
with:
|
||||
# Make sure to set a version number!
|
||||
version: ${{env.EM_VERSION}}
|
||||
# This is the name of the cache folder.
|
||||
# The cache folder will be placed in the build directory,
|
||||
# so make sure it doesn't conflict with anything!
|
||||
actions-cache-folder: ${{env.EM_CACHE_FOLDER}}
|
||||
|
||||
- name: Verify
|
||||
|
||||
@@ -105,7 +105,7 @@
|
||||
|
||||
if(NOT EMSCRIPTEN)
|
||||
|
||||
FIND_PATH(SDL2_INCLUDE_DIR SDL.h
|
||||
FIND_PATH(SDL2_INCLUDE_DIR_TEMP SDL.h
|
||||
HINTS
|
||||
$ENV{SDL2}
|
||||
PATH_SUFFIXES include/SDL2 include SDL2
|
||||
@@ -153,7 +153,7 @@ ELSE(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
|
||||
IF(NOT SDL2_BUILDING_LIBRARY)
|
||||
IF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
|
||||
IF(NOT "${SDL2_INCLUDE_DIR_TEMP}" MATCHES ".framework")
|
||||
# Non-OS X framework versions expect you to also dynamically link to
|
||||
# SDL2main. This is mainly for Windows and OS X. Other (Unix) platforms
|
||||
# seem to provide SDL2main for compatibility even though they don't
|
||||
@@ -189,7 +189,7 @@ IF(NOT SDL2_BUILDING_LIBRARY)
|
||||
/opt
|
||||
)
|
||||
ENDIF(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
ENDIF(NOT ${SDL2_INCLUDE_DIR} MATCHES ".framework")
|
||||
ENDIF(NOT "${SDL2_INCLUDE_DIR_TEMP}" MATCHES ".framework")
|
||||
ENDIF(NOT SDL2_BUILDING_LIBRARY)
|
||||
|
||||
# SDL2 may require threads on your system.
|
||||
@@ -208,58 +208,67 @@ IF(MINGW)
|
||||
ENDIF(MINGW)
|
||||
|
||||
SET(SDL2_FOUND "NO")
|
||||
IF(SDL2_LIBRARY_TEMP)
|
||||
# For SDL2main
|
||||
IF(NOT SDL2_BUILDING_LIBRARY)
|
||||
IF(SDL2MAIN_LIBRARY)
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
|
||||
ENDIF(SDL2MAIN_LIBRARY)
|
||||
ENDIF(NOT SDL2_BUILDING_LIBRARY)
|
||||
IF(SDL2_LIBRARY_TEMP)
|
||||
# For SDL2main
|
||||
IF(NOT SDL2_BUILDING_LIBRARY)
|
||||
IF(SDL2MAIN_LIBRARY)
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2MAIN_LIBRARY} ${SDL2_LIBRARY_TEMP})
|
||||
ENDIF(SDL2MAIN_LIBRARY)
|
||||
ENDIF(NOT SDL2_BUILDING_LIBRARY)
|
||||
|
||||
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
|
||||
# CMake doesn't display the -framework Cocoa string in the UI even
|
||||
# though it actually is there if I modify a pre-used variable.
|
||||
# I think it has something to do with the CACHE STRING.
|
||||
# So I use a temporary variable until the end so I can set the
|
||||
# "real" variable in one-shot.
|
||||
IF(APPLE)
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
|
||||
ENDIF(APPLE)
|
||||
# For OS X, SDL2 uses Cocoa as a backend so it must link to Cocoa.
|
||||
# CMake doesn't display the -framework Cocoa string in the UI even
|
||||
# though it actually is there if I modify a pre-used variable.
|
||||
# I think it has something to do with the CACHE STRING.
|
||||
# So I use a temporary variable until the end so I can set the
|
||||
# "real" variable in one-shot.
|
||||
IF(APPLE)
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} "-framework Cocoa")
|
||||
ENDIF(APPLE)
|
||||
|
||||
# For threads, as mentioned Apple doesn't need this.
|
||||
# In fact, there seems to be a problem if I used the Threads package
|
||||
# and try using this line, so I'm just skipping it entirely for OS X.
|
||||
IF(NOT APPLE)
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
|
||||
ENDIF(NOT APPLE)
|
||||
# For threads, as mentioned Apple doesn't need this.
|
||||
# In fact, there seems to be a problem if I used the Threads package
|
||||
# and try using this line, so I'm just skipping it entirely for OS X.
|
||||
IF(NOT APPLE)
|
||||
SET(SDL2_LIBRARY_TEMP ${SDL2_LIBRARY_TEMP} ${CMAKE_THREAD_LIBS_INIT})
|
||||
ENDIF(NOT APPLE)
|
||||
|
||||
# For MinGW library
|
||||
IF(MINGW)
|
||||
SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
|
||||
ENDIF(MINGW)
|
||||
# For MinGW library
|
||||
IF(MINGW)
|
||||
SET(SDL2_LIBRARY_TEMP ${MINGW32_LIBRARY} ${SDL2_LIBRARY_TEMP})
|
||||
ENDIF(MINGW)
|
||||
|
||||
# Set the final string here so the GUI reflects the final state.
|
||||
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
|
||||
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
|
||||
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
|
||||
# Set the final string here so the GUI reflects the final state.
|
||||
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
|
||||
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
|
||||
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
|
||||
|
||||
############add_library(SDL UNKNOWN IMPORTED)
|
||||
#target_link_libraries(SDL INTERFACE ${SDL2_LIBRARY})
|
||||
#target_include_directories(SDL INTERFACE ${SDL2_INCLUDE_DIR})
|
||||
#set_target_properties(SDL PROPERTIES IMPORTED_LINK_INTERFACE_LIBRARIES "${SDL2_LIBRARY}")
|
||||
set(SDL2_INCLUDE_DIR ${SDL2_INCLUDE_DIR_TEMP} CACHE STRING "Where the SDL2 Headers can be found")
|
||||
SET(SDL2_INCLUDE_DIR_TEMP "${SDL2_INCLUDE_DIR_TEMP}" CACHE INTERNAL "")
|
||||
|
||||
#set_target_properties(SDL PROPERTIES
|
||||
#INTERFACE_INCLUDE_DIRECTORIES "${SDL2_INCLUDE_DIR}")
|
||||
SET(SDL2_FOUND "YES")
|
||||
else() # SDL2_LIBRARY_TEMP
|
||||
# try to pkg-config fallback
|
||||
find_package(PkgConfig)
|
||||
if (PKG_CONFIG_FOUND)
|
||||
pkg_check_modules(PKG_C_SDL2 QUIET sdl2)
|
||||
if (PKG_C_SDL2_FOUND)
|
||||
SET(SDL2_LIBRARY_TEMP ${PKG_C_SDL2_LIBRARIES})
|
||||
SET(SDL2_INCLUDE_DIR_TEMP ${PKG_C_SDL2_INCLUDE_DIRS})
|
||||
|
||||
#set_target_properties(SDL PROPERTIES
|
||||
#IMPORTED_LINK_INTERFACE_LANGUAGES "C"
|
||||
#IMPORTED_LINK_INTERFACE_LIBRARIES "${SDL2_LIBRARY}"
|
||||
#LINK_INTERFACE_LIBRARIES "${SDL2_LIBRARY}")
|
||||
# Set the final string here so the GUI reflects the final state.
|
||||
SET(SDL2_LIBRARY ${SDL2_LIBRARY_TEMP} CACHE STRING "Where the SDL2 Library can be found")
|
||||
# Set the temp variable to INTERNAL so it is not seen in the CMake GUI
|
||||
SET(SDL2_LIBRARY_TEMP "${SDL2_LIBRARY_TEMP}" CACHE INTERNAL "")
|
||||
|
||||
#IMPORTED_LOCATION "${SDL2_LIBRARY}")
|
||||
set(SDL2_INCLUDE_DIR ${SDL2_INCLUDE_DIR_TEMP} CACHE STRING "Where the SDL2 Headers can be found")
|
||||
SET(SDL2_INCLUDE_DIR_TEMP "${SDL2_INCLUDE_DIR_TEMP}" CACHE INTERNAL "")
|
||||
|
||||
#message("II set include dir to ${SDL2_INCLUDE_DIR}")
|
||||
|
||||
SET(SDL2_FOUND "YES")
|
||||
SET(SDL2_FOUND "YES")
|
||||
endif()
|
||||
endif()
|
||||
ENDIF(SDL2_LIBRARY_TEMP)
|
||||
|
||||
else() #emsripten
|
||||
@@ -288,4 +297,11 @@ INCLUDE(FindPackageHandleStandardArgs)
|
||||
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 REQUIRED_VARS SDL2_LIBRARY SDL2_INCLUDE_DIR)
|
||||
|
||||
if (SDL2_FOUND)
|
||||
if (NOT TARGET SDL2::SDL2)
|
||||
add_library(SDL2::SDL2 INTERFACE IMPORTED)
|
||||
target_include_directories(SDL2::SDL2 INTERFACE ${SDL2_INCLUDE_DIR})
|
||||
target_link_libraries(SDL2::SDL2 INTERFACE ${SDL2_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
1
external/CMakeLists.txt
vendored
1
external/CMakeLists.txt
vendored
@@ -21,7 +21,6 @@ set(JSON_BuildTests OFF CACHE INTERNAL "")
|
||||
set(JSON_MultipleHeaders ON CACHE INTERNAL "")
|
||||
add_subdirectory("json") # link with "nlohmann_json::nlohmann_json"
|
||||
|
||||
set(PHYSFS_BUILD_SHARED FALSE CACHE INTERNAL "")
|
||||
add_subdirectory("physfs")
|
||||
|
||||
if(NOT MM_HEADLESS)
|
||||
|
||||
2
external/entt
vendored
2
external/entt
vendored
Submodule external/entt updated: fef921132c...344e03ac64
2
external/glm
vendored
2
external/glm
vendored
Submodule external/glm updated: bf71a83494...0af55ccecd
2
external/imgui/CMakeLists.txt
vendored
2
external/imgui/CMakeLists.txt
vendored
@@ -41,7 +41,7 @@ target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}")
|
||||
#target_include_directories(imgui PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/imgui")
|
||||
target_include_directories(imgui PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/imgui") # im sad
|
||||
|
||||
target_compile_definitions(imgui PUBLIC IMGUI_DISABLE_OBSOLETE_FUNCTIONS=1)
|
||||
#target_compile_definitions(imgui PUBLIC IMGUI_DISABLE_OBSOLETE_FUNCTIONS=1) # more sad
|
||||
|
||||
if(EMSCRIPTEN)
|
||||
target_compile_options(imgui PUBLIC -sUSE_SDL=2)
|
||||
|
||||
2
external/imgui/imgui
vendored
2
external/imgui/imgui
vendored
Submodule external/imgui/imgui updated: 458a109031...c6e0284ac5
235
external/physfs/CMakeLists.txt
vendored
235
external/physfs/CMakeLists.txt
vendored
@@ -1,235 +1,6 @@
|
||||
# file taken from offical physfs repo and modified
|
||||
|
||||
|
||||
|
||||
# PhysicsFS; a portable, flexible file i/o abstraction.
|
||||
#
|
||||
# Please see the file LICENSE.txt in the source's root directory.
|
||||
|
||||
# The CMake project file is meant to get this compiling on all sorts of
|
||||
# platforms quickly, and serve as the way Unix platforms and Linux distros
|
||||
# package up official builds, but you don't _need_ to use this; we have
|
||||
# built PhysicsFS to (hopefully) be able to drop into your project and
|
||||
# compile, using preprocessor checks for platform-specific bits instead of
|
||||
# testing in here.
|
||||
|
||||
cmake_minimum_required(VERSION 3.9 FATAL_ERROR)
|
||||
|
||||
project(PhysicsFS)
|
||||
set(PHYSFS_VERSION 3.1.0)
|
||||
|
||||
# Increment this if/when we break backwards compatibility.
|
||||
set(PHYSFS_SOVERSION 1)
|
||||
|
||||
# I hate that they define "WIN32" ... we're about to move to Win64...I hope!
|
||||
if(WIN32 AND NOT WINDOWS)
|
||||
set(WINDOWS TRUE)
|
||||
endif()
|
||||
|
||||
if(APPLE)
|
||||
set(PHYSFS_M_SRCS physfs/src/physfs_platform_apple.m)
|
||||
endif()
|
||||
|
||||
if(CMAKE_COMPILER_IS_GNUCC)
|
||||
# Don't use -rpath.
|
||||
set(CMAKE_SKIP_RPATH ON CACHE BOOL "Skip RPATH" FORCE)
|
||||
endif()
|
||||
|
||||
if(CMAKE_C_COMPILER_ID STREQUAL "SunPro")
|
||||
add_definitions(-erroff=E_EMPTY_TRANSLATION_UNIT)
|
||||
add_definitions(-xldscope=hidden)
|
||||
endif()
|
||||
|
||||
if(HAIKU)
|
||||
# We add this explicitly, since we don't want CMake to think this
|
||||
# is a C++ project unless we're on Haiku.
|
||||
set(PHYSFS_CPP_SRCS physfs/src/physfs_platform_haiku.cpp)
|
||||
find_library(BE_LIBRARY be)
|
||||
find_library(ROOT_LIBRARY root)
|
||||
set(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${BE_LIBRARY} ${ROOT_LIBRARY})
|
||||
endif()
|
||||
|
||||
if(CMAKE_SYSTEM_NAME STREQUAL "WindowsPhone" OR CMAKE_SYSTEM_NAME STREQUAL "WindowsStore")
|
||||
set(WINRT TRUE)
|
||||
endif()
|
||||
|
||||
if(WINRT)
|
||||
set(PHYSFS_CPP_SRCS physfs/src/physfs_platform_winrt.cpp)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT WINDOWS AND NOT APPLE) # (MingW and such might be UNIX _and_ WINDOWS!)
|
||||
find_library(PTHREAD_LIBRARY pthread)
|
||||
if(PTHREAD_LIBRARY)
|
||||
set(OPTIONAL_LIBRARY_LIBS ${OPTIONAL_LIBRARY_LIBS} ${PTHREAD_LIBRARY})
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Almost everything is "compiled" here, but things that don't apply to the
|
||||
# build are #ifdef'd out. This is to make it easy to embed PhysicsFS into
|
||||
# another project or bring up a new build system: just compile all the source
|
||||
# code and #define the things you want.
|
||||
set(PHYSFS_SRCS
|
||||
physfs/src/physfs.c
|
||||
physfs/src/physfs_byteorder.c
|
||||
physfs/src/physfs_unicode.c
|
||||
physfs/src/physfs_platform_posix.c
|
||||
physfs/src/physfs_platform_unix.c
|
||||
physfs/src/physfs_platform_windows.c
|
||||
physfs/src/physfs_platform_os2.c
|
||||
physfs/src/physfs_platform_qnx.c
|
||||
physfs/src/physfs_platform_android.c
|
||||
physfs/src/physfs_archiver_dir.c
|
||||
physfs/src/physfs_archiver_unpacked.c
|
||||
physfs/src/physfs_archiver_grp.c
|
||||
physfs/src/physfs_archiver_hog.c
|
||||
physfs/src/physfs_archiver_7z.c
|
||||
physfs/src/physfs_archiver_mvl.c
|
||||
physfs/src/physfs_archiver_qpak.c
|
||||
physfs/src/physfs_archiver_wad.c
|
||||
physfs/src/physfs_archiver_zip.c
|
||||
physfs/src/physfs_archiver_slb.c
|
||||
physfs/src/physfs_archiver_iso9660.c
|
||||
physfs/src/physfs_archiver_vdf.c
|
||||
|
||||
physfs/src/physfs.h
|
||||
physfs/src/physfs_casefolding.h
|
||||
physfs/src/physfs_internal.h
|
||||
physfs/src/physfs_lzmasdk.h
|
||||
physfs/src/physfs_miniz.h
|
||||
physfs/src/physfs_platforms.h
|
||||
|
||||
${PHYSFS_CPP_SRCS}
|
||||
${PHYSFS_M_SRCS}
|
||||
)
|
||||
|
||||
|
||||
# Archivers ...
|
||||
# These are (mostly) on by default now, so these options are only useful for
|
||||
# disabling them.
|
||||
|
||||
option(PHYSFS_ARCHIVE_ZIP "Enable ZIP support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_ZIP)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_ZIP=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_7Z "Enable 7zip support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_7Z)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_7Z=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_GRP "Enable Build Engine GRP support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_GRP)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_GRP=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_WAD "Enable Doom WAD support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_WAD)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_WAD=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_HOG "Enable Descent I/II HOG support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_HOG)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_HOG=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_MVL "Enable Descent I/II MVL support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_MVL)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_MVL=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_QPAK "Enable Quake I/II QPAK support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_QPAK)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_QPAK=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_SLB "Enable I-War / Independence War SLB support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_SLB)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_SLB=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_ISO9660 "Enable ISO9660 support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_ISO9660)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_ISO9660=0)
|
||||
endif()
|
||||
|
||||
option(PHYSFS_ARCHIVE_VDF "Enable Gothic I/II VDF archive support" TRUE)
|
||||
if(NOT PHYSFS_ARCHIVE_VDF)
|
||||
add_definitions(-DPHYSFS_SUPPORTS_VDF=0)
|
||||
endif()
|
||||
|
||||
|
||||
option(PHYSFS_BUILD_STATIC "Build static library" TRUE)
|
||||
if(PHYSFS_BUILD_STATIC)
|
||||
add_library(physfs-static STATIC ${PHYSFS_SRCS})
|
||||
# Don't rename this on Windows, since DLLs will also produce an import
|
||||
# library named "physfs.lib" which would conflict; Unix tend to like the
|
||||
# same library name with a different extension for static libs, but
|
||||
# Windows can just have a separate name.
|
||||
if(NOT MSVC)
|
||||
set_target_properties(physfs-static PROPERTIES OUTPUT_NAME "physfs")
|
||||
endif()
|
||||
if(WINRT)
|
||||
# Ignore LNK4264 warnings; we don't author any WinRT components, just consume them, so we're okay in a static library.
|
||||
set_target_properties(physfs-static PROPERTIES VS_WINRT_COMPONENT True)
|
||||
set_target_properties(physfs-static PROPERTIES STATIC_LIBRARY_FLAGS "/ignore:4264")
|
||||
endif()
|
||||
if(APPLE)
|
||||
target_link_libraries(physfs-static PUBLIC "-framework IOKit")
|
||||
target_link_libraries(physfs-static PUBLIC "-framework Foundation") # do i need this?
|
||||
endif()
|
||||
|
||||
target_include_directories(physfs-static PUBLIC "physfs/src")
|
||||
|
||||
set(PHYSFS_LIB_TARGET physfs-static)
|
||||
set(PHYSFS_INSTALL_TARGETS ${PHYSFS_INSTALL_TARGETS} ";physfs-static")
|
||||
endif()
|
||||
|
||||
if(NOT PHYSFS_BUILD_STATIC)
|
||||
message(FATAL "static libraries are disabled!")
|
||||
endif()
|
||||
|
||||
# CMake FAQ says I need this...
|
||||
if(PHYSFS_BUILD_STATIC AND NOT WINDOWS)
|
||||
set_target_properties(physfs-static PROPERTIES CLEAN_DIRECT_OUTPUT 1)
|
||||
endif()
|
||||
|
||||
if(NOT MSVC)
|
||||
configure_file(
|
||||
"physfs/extras/physfs.pc.in"
|
||||
"physfs/extras/physfs.pc"
|
||||
@ONLY
|
||||
)
|
||||
install(
|
||||
FILES "${CMAKE_CURRENT_BINARY_DIR}/extras/physfs.pc"
|
||||
DESTINATION "lib${LIB_SUFFIX}/pkgconfig"
|
||||
)
|
||||
endif()
|
||||
|
||||
macro(message_bool_option _NAME _VALUE)
|
||||
if(${_VALUE})
|
||||
message(STATUS " ${_NAME}: enabled")
|
||||
else()
|
||||
message(STATUS " ${_NAME}: disabled")
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
message(STATUS "PhysicsFS will build with the following options:")
|
||||
message_bool_option("ZIP support" PHYSFS_ARCHIVE_ZIP)
|
||||
message_bool_option("7zip support" PHYSFS_ARCHIVE_7Z)
|
||||
message_bool_option("GRP support" PHYSFS_ARCHIVE_GRP)
|
||||
message_bool_option("WAD support" PHYSFS_ARCHIVE_WAD)
|
||||
message_bool_option("HOG support" PHYSFS_ARCHIVE_HOG)
|
||||
message_bool_option("MVL support" PHYSFS_ARCHIVE_MVL)
|
||||
message_bool_option("QPAK support" PHYSFS_ARCHIVE_QPAK)
|
||||
message_bool_option("SLB support" PHYSFS_ARCHIVE_SLB)
|
||||
message_bool_option("VDF support" PHYSFS_ARCHIVE_VDF)
|
||||
message_bool_option("ISO9660 support" PHYSFS_ARCHIVE_ISO9660)
|
||||
message_bool_option("Build static library" PHYSFS_BUILD_STATIC)
|
||||
message_bool_option("Build shared library" PHYSFS_BUILD_SHARED)
|
||||
message_bool_option("Build stdio test program" PHYSFS_BUILD_TEST)
|
||||
if(PHYSFS_BUILD_TEST)
|
||||
message_bool_option(" Use readline in test program" HAVE_SYSTEM_READLINE)
|
||||
endif()
|
||||
|
||||
# end of CMakeLists.txt ...
|
||||
set(PHYSFS_BUILD_SHARED FALSE CACHE INTERNAL "")
|
||||
set(PHYSFS_BUILD_TEST FALSE CACHE INTERNAL "")
|
||||
add_subdirectory("physfs")
|
||||
|
||||
|
||||
2
external/physfs/physfs
vendored
2
external/physfs/physfs
vendored
Submodule external/physfs/physfs updated: fdd38a3f8a...b1a2f1f18b
2
external/spdlog
vendored
2
external/spdlog
vendored
Submodule external/spdlog updated: ad0e89cbfb...7e635fca68
2
external/stb/stb
vendored
2
external/stb/stb
vendored
Submodule external/stb/stb updated: 5736b15f7e...802cd454f2
@@ -134,10 +134,10 @@ public:
|
||||
e = registry.create();
|
||||
|
||||
// create a copy of an entity component by component
|
||||
for (auto &&curr: registry.storage()) {
|
||||
if (auto &storage = curr.second; storage.contains(old_e)) {
|
||||
for(auto &&curr: registry.storage()) {
|
||||
if(auto &storage = curr.second; storage.contains(old_e)) {
|
||||
// TODO: do something with the return value. returns false on failure.
|
||||
storage.emplace(e, storage.get(old_e));
|
||||
storage.push(e, storage.value(old_e));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -237,11 +237,11 @@ public:
|
||||
|
||||
if (comp_list.empty()) {
|
||||
ImGui::Text("Orphans:");
|
||||
registry.each([®istry](auto e){
|
||||
for (EntityType e : registry.template storage<EntityType>()) {
|
||||
if (registry.orphan(e)) {
|
||||
MM_IEEE_ENTITY_WIDGET(e, registry, false);
|
||||
}
|
||||
});
|
||||
}
|
||||
} else {
|
||||
entt::runtime_view view{};
|
||||
for (const auto type : comp_list) {
|
||||
@@ -264,17 +264,6 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
[[deprecated("Use renderEditor() instead. And manage the window yourself.")]]
|
||||
void render(Registry& registry, EntityType& e)
|
||||
{
|
||||
if (show_window) {
|
||||
if (ImGui::Begin("Entity Editor", &show_window)) {
|
||||
renderEditor(registry, e);
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
}
|
||||
|
||||
// displays both, editor and list
|
||||
// uses static internally, use only as a quick way to get going!
|
||||
void renderSimpleCombo(Registry& registry, EntityType& e)
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <imgui.h>
|
||||
#include <nlohmann/json.hpp>
|
||||
#include <imgui/misc/cpp/imgui_stdlib.h>
|
||||
#include <cinttypes>
|
||||
|
||||
namespace MM::ImGuiWidgets {
|
||||
|
||||
@@ -55,16 +56,16 @@ void JsonViewerSimple(const char* name, const JsonObjectType& json) {
|
||||
}
|
||||
break;
|
||||
case JsonObjectType::value_t::number_integer:
|
||||
ImGui::TextColored(int_color, "%ld", json.template get<int64_t>());
|
||||
ImGui::TextColored(int_color, "%" PRId64, json.template get<int64_t>());
|
||||
break;
|
||||
case JsonObjectType::value_t::number_unsigned:
|
||||
ImGui::TextColored(unsigned_color, "%lu", json.template get<uint64_t>());
|
||||
ImGui::TextColored(unsigned_color, "%" PRIu64, json.template get<uint64_t>());
|
||||
break;
|
||||
case JsonObjectType::value_t::number_float:
|
||||
ImGui::TextColored(float_color, "%f", json.template get<float>());
|
||||
break;
|
||||
case JsonObjectType::value_t::object:
|
||||
ImGui::TextDisabled("{%d}", json.size());
|
||||
ImGui::TextDisabled("{%zu}", json.size());
|
||||
|
||||
ImGui::Indent();
|
||||
for (auto& [key, value] : json.items()) {
|
||||
@@ -74,7 +75,7 @@ void JsonViewerSimple(const char* name, const JsonObjectType& json) {
|
||||
|
||||
break;
|
||||
case JsonObjectType::value_t::array:
|
||||
ImGui::TextDisabled("[%d]", json.size());
|
||||
ImGui::TextDisabled("[%zu]", json.size());
|
||||
|
||||
ImGui::Indent();
|
||||
for (auto& [key, value] : json.items()) {
|
||||
@@ -103,9 +104,9 @@ void JsonViewerTree(const char* name, const JsonObjectType& json) {
|
||||
|
||||
ImGui::SameLine();
|
||||
if (json.is_object()) {
|
||||
ImGui::TextDisabled("{%d}", json.size());
|
||||
ImGui::TextDisabled("{%zu}", json.size());
|
||||
} else { // is_array()
|
||||
ImGui::TextDisabled("[%d]", json.size());
|
||||
ImGui::TextDisabled("[%zu]", json.size());
|
||||
}
|
||||
|
||||
if (tree_open) {
|
||||
@@ -143,10 +144,10 @@ void JsonViewerTree(const char* name, const JsonObjectType& json) {
|
||||
}
|
||||
break;
|
||||
case JsonObjectType::value_t::number_integer:
|
||||
ImGui::TextColored(int_color, "%ld", json.template get<int64_t>());
|
||||
ImGui::TextColored(int_color, "%" PRId64, json.template get<int64_t>());
|
||||
break;
|
||||
case JsonObjectType::value_t::number_unsigned:
|
||||
ImGui::TextColored(unsigned_color, "%lu", json.template get<uint64_t>());
|
||||
ImGui::TextColored(unsigned_color, "%" PRIu64, json.template get<uint64_t>());
|
||||
break;
|
||||
case JsonObjectType::value_t::number_float:
|
||||
ImGui::TextColored(float_color, "%f", json.template get<float>());
|
||||
@@ -200,9 +201,9 @@ void JsonEditor(const char* name, JsonObjectType& json) {
|
||||
|
||||
ImGui::SameLine();
|
||||
if (json.is_object()) {
|
||||
ImGui::TextDisabled("{%d}", json.size());
|
||||
ImGui::TextDisabled("{%zu}", json.size());
|
||||
} else { // is_array()
|
||||
ImGui::TextDisabled("[%d]", json.size());
|
||||
ImGui::TextDisabled("[%zu]", json.size());
|
||||
}
|
||||
|
||||
if (tree_open) {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#include "./scene_tools.hpp"
|
||||
#include "mm/engine_fwd.hpp"
|
||||
|
||||
#include <mm/engine.hpp>
|
||||
|
||||
@@ -109,16 +110,19 @@ namespace MM::Services {
|
||||
|
||||
if (_show_scene_metrics) {
|
||||
if (ImGui::Begin("Scene Metrics##ImGuiSceneToolsService", &_show_scene_metrics)) {
|
||||
ImGui::Text("capacity: %lu", scene.capacity());
|
||||
ImGui::Text("size: %lu", scene.size());
|
||||
ImGui::Text("alive: %lu", scene.alive());
|
||||
size_t orphans = 0;
|
||||
scene.each([&orphans, &scene](auto entity) {
|
||||
if (scene.orphan(entity)) {
|
||||
orphans++;
|
||||
ImGui::Text("capacity: %zu", scene.storage<::MM::Entity>().capacity());
|
||||
ImGui::Text("size: %zu", scene.storage<::MM::Entity>().size());
|
||||
ImGui::Text("alive: %zu", scene.storage<::MM::Entity>().in_use());
|
||||
if (ImGui::CollapsingHeader("orphans")) {
|
||||
// iterating all entities is expensive
|
||||
size_t orphans = 0;
|
||||
for (const auto it : scene.storage<MM::Entity>().each()) {
|
||||
if (scene.orphan(std::get<0>(it))) {
|
||||
orphans++;
|
||||
}
|
||||
}
|
||||
});
|
||||
ImGui::Text("orphans: %lu", orphans);
|
||||
ImGui::Text("orphans: %lu", orphans);
|
||||
}
|
||||
}
|
||||
ImGui::End();
|
||||
}
|
||||
|
||||
@@ -102,6 +102,9 @@ in vec2 _uv;
|
||||
|
||||
out vec3 _out_color;
|
||||
|
||||
// global config, keep it constant
|
||||
const float fake_halation_strenth = 1.0;
|
||||
|
||||
void main() {
|
||||
vec3 color = texture(color_tex, _uv).rgb;
|
||||
|
||||
@@ -114,7 +117,16 @@ void main() {
|
||||
//step(vec3(0.0), color)
|
||||
//);
|
||||
|
||||
_out_color = max(min(color, vec3(0.0)), color - vec3(1.0));
|
||||
const vec3 fake_halation_base = vec3(0.03, 0.01, 0.0) * vec3(fake_halation_strenth);
|
||||
const vec3 fake_halation_extraction_offset = vec3(1.0) - fake_halation_base;
|
||||
const vec3 fake_halation_bloom_fact = vec3(1.0) + fake_halation_base;
|
||||
|
||||
if (fake_halation_strenth <= 0.001) {
|
||||
_out_color = max(min(color, vec3(0.0)), color - vec3(1.0));
|
||||
} else {
|
||||
_out_color = max(min(color, vec3(0.0)), color - fake_halation_extraction_offset) * fake_halation_bloom_fact;
|
||||
//_out_color = max(min(color, vec3(0.0)), color - vec3(0.95, 0.97, 1.0)) * vec3(1.10, 1.05, 1.0);
|
||||
}
|
||||
})")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user