Split the simulation from presentation into an SDL-free library
Sim holds one whole game (tick, snapshots, checksum) and talks to the screen only through Cues, which the client's Scene plays and the server ignores. All drawing moved to scene.cpp. Match takes this screen's wishes as request flags instead of reading the menu, input and settings. The sim library builds without SDL and the server links it, ready to run games itself. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2007fb7edc
commit
465f75f6d7
38 files changed
+2225
-1965
No files matched your search
+4
-1
@@ -37,6 +37,8 @@ add_library(simdjson STATIC external/simdjson/singleheader/simdjson.cpp)
|
||||
target_include_directories(simdjson SYSTEM PUBLIC external/simdjson/singleheader)
|
||||
target_compile_definitions(simdjson PUBLIC SIMDJSON_EXCEPTIONS=0)
|
||||
|
||||
include(src/sim.cmake)
|
||||
|
||||
# Networking: WebRTC data channels between players and a WebSocket to the server. On desktop it's
|
||||
# libdatachannel (static, data channels only, no media); in the browser, datachannel-wasm gives the same API over the
|
||||
# browser's own WebRTC.
|
||||
@@ -54,9 +56,10 @@ else()
|
||||
endif()
|
||||
|
||||
file(GLOB SOURCES CONFIGURE_DEPENDS src/*.cpp)
|
||||
list(REMOVE_ITEM SOURCES ${SIM_SOURCES})
|
||||
add_executable(smack_a_brother ${SOURCES})
|
||||
target_include_directories(smack_a_brother SYSTEM PRIVATE external/stb)
|
||||
target_link_libraries(smack_a_brother PRIVATE SDL3::SDL3-static simdjson ${NETWORK_LIBRARY})
|
||||
target_link_libraries(smack_a_brother PRIVATE sim SDL3::SDL3-static simdjson ${NETWORK_LIBRARY})
|
||||
set_target_properties(smack_a_brother PROPERTIES OUTPUT_NAME smack-a-brother)
|
||||
|
||||
file(CREATE_LINK ${CMAKE_SOURCE_DIR}/resources ${CMAKE_BINARY_DIR}/resources SYMBOLIC)
|
||||
|
||||
Reference in new issue
Block a user