jak-project/game/CMakeLists.txt
Tyler Wilding 8b7e0bde53
Some checks failed
Build / 🖥️ Windows (push) Has been cancelled
Build / 🐧 Linux (push) Has been cancelled
Build / 🍎 MacOS (push) Has been cancelled
Inform Pages Repo / Generate Documentation (push) Has been cancelled
Lint / 📝 Formatting (push) Has been cancelled
Lint / 📝 Required Checks (push) Has been cancelled
Lint / 📝 Optional Checks (push) Has been cancelled
game: ensure the default game-size is also valid when initializing the pc-settings.gc file (#3624)
Also saves out the default `pc-settings.gc` file so it's less confusing
_and_ so we can request it from users to actually see what it's doing.

The fix in the last release was only to fix bad `game-size` values when
_loading_ the file. But if you don't have a file, it picks a default.

Right now it picks that default by:
1. Your largest reported resolution
2. If that fails, the one that is currently set

In reality this scenario can never really happen (if you have a set
resolution, it will be one of the reported ones). However what can
happen is for SDL to be misinformed by bad display/monitor drivers/the
OS and be given "supported" resolutions that aren't actually supported.
For example some users have a 4K resolution as their highest, despite
them using a 1080p monitor.

The solution is to not blindly assume the largest resolution is valid,
instead use the one the user already has set.

I'm also now filtering out resolutions by refresh rate, as perhaps this
also caused a problem. ie. the monitor supports a resolution if the
refresh rate is lowered, but it's currently set high (at 144hz for
example).
2024-08-03 14:57:07 -04:00

328 lines
13 KiB
CMake

# Set a more convenient ARM flag
if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm64")
set(ARM64_ARCH TRUE)
message(STATUS "ARM64 architecture detected")
else()
set(ARM64_ARCH FALSE)
message(STATUS "Non-ARM64 architecture detected")
endif()
if(ARM64_ARCH)
# Add your ARM64-specific configuration or build options here
set(OG_ASM_FUNCS_FILE kernel/asm_funcs_arm64.s)
enable_language(ASM)
set(CMAKE_ASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_SOURCE_FILE_EXTENSIONS} s)
# set(CMAKE_ASM_COMPILE_OBJECT "${CMAKE_ASM_COMPILER} -o <OBJECT> <SOURCE>")
set_source_files_properties(${OG_ASM_FUNCS_FILE} PROPERTIES COMPILE_FLAGS "-g")
else()
set(OG_ASM_FUNCS_FILE kernel/asm_funcs_x86_64.asm)
enable_language(ASM_NASM)
set(CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS ${CMAKE_ASM_NASM_SOURCE_FILE_EXTENSIONS} asm)
set(CMAKE_ASM_NASM_COMPILE_OBJECT "<CMAKE_ASM_NASM_COMPILER> <INCLUDES> -f ${CMAKE_ASM_NASM_OBJECT_FORMAT} -o <OBJECT> <SOURCE>")
set_source_files_properties(${OG_ASM_FUNCS_FILE} PROPERTIES COMPILE_FLAGS "-g")
endif()
set(RUNTIME_SOURCE
external/discord_jak1.cpp
external/discord_jak2.cpp
external/discord_jak3.cpp
external/discord.cpp
graphics/display.cpp
graphics/gfx_test.cpp
graphics/gfx.cpp
graphics/jak2_texture_remap.cpp
graphics/jak3_texture_remap.cpp
graphics/screenshot.cpp
graphics/opengl_renderer/background/background_common.cpp
graphics/opengl_renderer/background/Hfrag.cpp
graphics/opengl_renderer/background/Shrub.cpp
graphics/opengl_renderer/background/TFragment.cpp
graphics/opengl_renderer/background/Tie3.cpp
graphics/opengl_renderer/BlitDisplays.cpp
graphics/opengl_renderer/BucketRenderer.cpp
graphics/opengl_renderer/CollideMeshRenderer.cpp
graphics/opengl_renderer/debug_gui.cpp
graphics/opengl_renderer/DepthCue.cpp
graphics/opengl_renderer/DirectRenderer.cpp
graphics/opengl_renderer/DirectRenderer2.cpp
graphics/opengl_renderer/dma_helpers.cpp
graphics/opengl_renderer/EyeRenderer.cpp
graphics/opengl_renderer/foreground/Generic2_Build.cpp
graphics/opengl_renderer/foreground/Generic2_DMA.cpp
graphics/opengl_renderer/foreground/Generic2_OpenGL.cpp
graphics/opengl_renderer/foreground/Generic2.cpp
graphics/opengl_renderer/foreground/Generic2BucketRenderer.cpp
graphics/opengl_renderer/foreground/Merc2.cpp
graphics/opengl_renderer/foreground/Merc2BucketRenderer.cpp
graphics/opengl_renderer/foreground/Shadow2.cpp
graphics/opengl_renderer/loader/Loader.cpp
graphics/opengl_renderer/loader/LoaderStages.cpp
graphics/opengl_renderer/ocean/CommonOceanRenderer.cpp
graphics/opengl_renderer/ocean/OceanMid_PS2.cpp
graphics/opengl_renderer/ocean/OceanMid.cpp
graphics/opengl_renderer/ocean/OceanMidAndFar.cpp
graphics/opengl_renderer/ocean/OceanNear_PS2.cpp
graphics/opengl_renderer/ocean/OceanNear.cpp
graphics/opengl_renderer/ocean/OceanTexture_PC.cpp
graphics/opengl_renderer/ocean/OceanTexture.cpp
graphics/opengl_renderer/opengl_utils.cpp
graphics/opengl_renderer/OpenGLRenderer.cpp
graphics/opengl_renderer/Profiler.cpp
graphics/opengl_renderer/ProgressRenderer.cpp
graphics/opengl_renderer/Shader.cpp
graphics/opengl_renderer/Shadow_PS2.cpp
graphics/opengl_renderer/ShadowRenderer.cpp
graphics/opengl_renderer/SkyBlendCPU.cpp
graphics/opengl_renderer/SkyBlendGPU.cpp
graphics/opengl_renderer/SkyRenderer.cpp
graphics/opengl_renderer/sprite/GlowRenderer.cpp
graphics/opengl_renderer/sprite/Sprite3_Distort.cpp
graphics/opengl_renderer/sprite/Sprite3_Glow.cpp
graphics/opengl_renderer/sprite/Sprite3.cpp
graphics/opengl_renderer/TextureAnimator.cpp
graphics/opengl_renderer/TextureAnimatorDefs.cpp
graphics/opengl_renderer/TextureUploadHandler.cpp
graphics/opengl_renderer/VisDataHandler.cpp
graphics/opengl_renderer/Warp.cpp
graphics/pipelines/opengl.cpp
graphics/sceGraphicsInterface.cpp
graphics/texture/jak1_tpage_dir.cpp
graphics/texture/jak2_tpage_dir.cpp
graphics/texture/jak3_tpage_dir.cpp
graphics/texture/TextureConverter.cpp
graphics/texture/TexturePool.cpp
${OG_ASM_FUNCS_FILE}
kernel/common/fileio.cpp
kernel/common/kboot.cpp
kernel/common/kdgo.cpp
kernel/common/kdsnetm.cpp
kernel/common/klink.cpp
kernel/common/klisten.cpp
kernel/common/kmachine.cpp
kernel/common/kmalloc.cpp
kernel/common/kmemcard.cpp
kernel/common/kprint.cpp
kernel/common/kscheme.cpp
kernel/common/ksocket.cpp
kernel/common/ksound.cpp
kernel/jak1/fileio.cpp
kernel/jak1/kboot.cpp
kernel/jak1/kdgo.cpp
kernel/jak1/klink.cpp
kernel/jak1/klisten.cpp
kernel/jak1/kmachine.cpp
kernel/jak1/kprint.cpp
kernel/jak1/kscheme.cpp
kernel/jak1/ksound.cpp
kernel/jak2/fileio.cpp
kernel/jak2/kboot.cpp
kernel/jak2/kdgo.cpp
kernel/jak2/klink.cpp
kernel/jak2/klisten.cpp
kernel/jak2/kmachine.cpp
kernel/jak2/kmachine_extras.cpp
kernel/jak2/kmalloc.cpp
kernel/jak2/kprint.cpp
kernel/jak2/kscheme.cpp
kernel/jak2/ksound.cpp
kernel/jak3/fileio.cpp
kernel/jak3/kboot.cpp
kernel/jak3/kdgo.cpp
kernel/jak3/kdsnetm.cpp
kernel/jak3/klink.cpp
kernel/jak3/klisten.cpp
kernel/jak3/kmachine.cpp
kernel/jak3/kmachine_extras.cpp
kernel/jak3/kmalloc.cpp
kernel/jak3/kmemcard.cpp
kernel/jak3/kprint.cpp
kernel/jak3/kscheme.cpp
kernel/jak3/ksocket.cpp
kernel/jak3/ksound.cpp
mips2c/jak1_functions/bones.cpp
mips2c/jak1_functions/collide_cache.cpp
mips2c/jak1_functions/collide_edge_grab.cpp
mips2c/jak1_functions/collide_func.cpp
mips2c/jak1_functions/collide_mesh.cpp
mips2c/jak1_functions/collide_probe.cpp
mips2c/jak1_functions/draw_string.cpp
mips2c/jak1_functions/generic_effect.cpp
mips2c/jak1_functions/generic_effect2.cpp
mips2c/jak1_functions/generic_merc.cpp
mips2c/jak1_functions/generic_tie.cpp
mips2c/jak1_functions/joint.cpp
mips2c/jak1_functions/merc_blend_shape.cpp
mips2c/jak1_functions/ocean_vu0.cpp
mips2c/jak1_functions/ocean.cpp
mips2c/jak1_functions/ripple.cpp
mips2c/jak1_functions/shadow.cpp
mips2c/jak1_functions/sky_tng.cpp
mips2c/jak1_functions/sparticle_launcher.cpp
mips2c/jak1_functions/sparticle.cpp
mips2c/jak1_functions/test_func.cpp
mips2c/jak1_functions/texture.cpp
mips2c/jak1_functions/tfrag.cpp
mips2c/jak1_functions/tie_methods.cpp
mips2c/jak1_functions/time_of_day.cpp
mips2c/jak2_functions/bones.cpp
mips2c/jak2_functions/collide_cache.cpp
mips2c/jak2_functions/collide_edge_grab.cpp
mips2c/jak2_functions/collide_func.cpp
mips2c/jak2_functions/collide_hash.cpp
mips2c/jak2_functions/collide_mesh.cpp
mips2c/jak2_functions/debug.cpp
mips2c/jak2_functions/font.cpp
mips2c/jak2_functions/foreground.cpp
mips2c/jak2_functions/generic_effect.cpp
mips2c/jak2_functions/generic_merc.cpp
mips2c/jak2_functions/joint.cpp
mips2c/jak2_functions/lights.cpp
mips2c/jak2_functions/merc_blend_shape.cpp
mips2c/jak2_functions/nav_control.cpp
mips2c/jak2_functions/nav_mesh.cpp
mips2c/jak2_functions/ocean_vu0.cpp
mips2c/jak2_functions/ocean.cpp
mips2c/jak2_functions/ripple.cpp
mips2c/jak2_functions/shadow.cpp
mips2c/jak2_functions/sky.cpp
mips2c/jak2_functions/sparticle_launcher.cpp
mips2c/jak2_functions/sparticle.cpp
mips2c/jak2_functions/spatial_hash.cpp
mips2c/jak2_functions/squid.cpp
mips2c/jak2_functions/texture.cpp
mips2c/jak2_functions/vortex.cpp
mips2c/jak3_functions/collide_func.cpp
mips2c/jak3_functions/debug.cpp
mips2c/jak3_functions/font.cpp
mips2c/jak3_functions/foreground.cpp
mips2c/jak3_functions/generic_effect.cpp
mips2c/jak3_functions/joint.cpp
mips2c/jak3_functions/lights.cpp
mips2c/jak3_functions/sky.cpp
mips2c/jak3_functions/texture.cpp
mips2c/jak3_functions/particle_curves.cpp
mips2c/jak3_functions/cloth.cpp
mips2c/jak3_functions/collide_cache.cpp
mips2c/jak3_functions/collide_hash.cpp
mips2c/jak3_functions/collide_edge_grab.cpp
mips2c/jak3_functions/collide_mesh.cpp
mips2c/jak3_functions/spatial_hash.cpp
mips2c/jak3_functions/sparticle.cpp
mips2c/jak3_functions/sparticle_launcher.cpp
mips2c/jak3_functions/nav_control.cpp
mips2c/jak3_functions/nav_engine.cpp
mips2c/jak3_functions/merc_blend_shape.cpp
mips2c/jak3_functions/wvehicle_part.cpp
mips2c/jak3_functions/ripple.cpp
mips2c/jak3_functions/shadow.cpp
mips2c/jak3_functions/ocean.cpp
mips2c/jak3_functions/ocean_vu0.cpp
mips2c/jak3_functions/generic_merc.cpp
mips2c/mips2c_table.cpp
overlord/common/dma.cpp
overlord/common/fake_iso.cpp
overlord/common/iso_api.cpp
overlord/common/iso.cpp
overlord/common/isocommon.cpp
overlord/common/overlord.cpp
overlord/common/sbank.cpp
overlord/common/soundcommon.cpp
overlord/common/srpc.cpp
overlord/common/ssound.cpp
overlord/jak1/dma.cpp
overlord/jak1/fake_iso.cpp
overlord/jak1/iso_api.cpp
overlord/jak1/iso_queue.cpp
overlord/jak1/iso.cpp
overlord/jak1/isocommon.cpp
overlord/jak1/overlord.cpp
overlord/jak1/ramdisk.cpp
overlord/jak1/srpc.cpp
overlord/jak1/ssound.cpp
overlord/jak1/stream.cpp
overlord/jak2/dma.cpp
overlord/jak2/iso_api.cpp
overlord/jak2/iso_cd.cpp
overlord/jak2/iso_queue.cpp
overlord/jak2/iso.cpp
overlord/jak2/list.cpp
overlord/jak2/overlord.cpp
overlord/jak2/pages.cpp
overlord/jak2/spustreams.cpp
overlord/jak2/srpc.cpp
overlord/jak2/ssound.cpp
overlord/jak2/stream.cpp
overlord/jak2/streamlfo.cpp
overlord/jak2/streamlist.cpp
overlord/jak2/vag.cpp
overlord/jak3/overlord.cpp
overlord/jak3/pagemanager.cpp
overlord/jak3/iso_cd.cpp
overlord/jak3/dma.cpp
overlord/jak3/iso.cpp
overlord/jak3/iso_queue.cpp
overlord/jak3/srpc.cpp
overlord/jak3/vag.cpp
overlord/jak3/ssound.cpp
overlord/jak3/iso_api.cpp
overlord/jak3/spustreams.cpp
overlord/jak3/list.cpp
overlord/jak3/vblank_handler.cpp
overlord/jak3/dvd_driver.cpp
overlord/jak3/basefile.cpp
overlord/jak3/basefilesystem.cpp
overlord/jak3/ramdisk.cpp
overlord/jak3/isocommon.cpp
overlord/jak3/init.cpp
overlord/jak3/stream.cpp
overlord/jak3/sbank.cpp
overlord/jak3/soundcommon.cpp
overlord/jak3/streamlist.cpp
runtime.cpp
sce/deci2.cpp
sce/iop.cpp
sce/libcdvd_ee.cpp
sce/libdma.cpp
sce/libgraph.cpp
sce/libpad.cpp
sce/libscf.cpp
sce/sif_ee_memcard.cpp
sce/sif_ee.cpp
sce/stubs.cpp
settings/settings.cpp
system/background_worker.cpp
system/Deci2Server.cpp
system/hid/devices/game_controller.cpp
system/hid/devices/keyboard.cpp
system/hid/devices/mouse.cpp
system/hid/display_manager.cpp
system/hid/input_bindings.cpp
system/hid/input_manager.cpp
system/hid/sdl_util.cpp
system/IOP_Kernel.cpp
system/iop_thread.cpp
system/SystemThread.cpp
tools/filter_menu/filter_menu.cpp
tools/subtitle_editor/subtitle_editor_db.cpp
tools/subtitle_editor/subtitle_editor_repl_client.cpp
tools/subtitle_editor/subtitle_editor.cpp
)
add_subdirectory(sound)
# we build the runtime as a static library.
add_library(runtime STATIC ${RUNTIME_SOURCE} "../third-party/glad/src/glad.c")
target_link_libraries(runtime common fmt SDL2::SDL2 imgui discord-rpc sound stb_image libco libcurl)
if(WIN32)
target_link_libraries(runtime mman)
else()
target_link_libraries(runtime pthread dl)
endif()
add_executable(gk main.cpp)
target_link_libraries(gk runtime)
if(WIN32)
set_target_properties(gk PROPERTIES VS_DPI_AWARE "PerMonitor")
endif()