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:
shweetandClaude Opus 5.5 committed 2026-11-08 01:46:07 -05:00
1 parent 2007fb7edc
commit 465f75f6d7
38 files changed
+2225 -1965

No files matched your search

+6 -2
View File
@@ -1,4 +1,5 @@
# The server. Built as part of the game's desktop build, or on its own (for the VPS, without SDL):
# The server, which runs games with the simulation library. Built as part of the game's desktop build, or on its own
# (for the VPS, without SDL):
# cmake -S server -B build-server -DCMAKE_BUILD_TYPE=Release && cmake --build build-server
cmake_minimum_required(VERSION 3.24)
project(smack_a_brother_server LANGUAGES C CXX)
@@ -13,6 +14,9 @@ if(NOT TARGET datachannel-static)
set(NO_TESTS ON CACHE BOOL "" FORCE)
add_subdirectory(${EXTERNAL}/libdatachannel ${CMAKE_BINARY_DIR}/libdatachannel EXCLUDE_FROM_ALL)
endif()
if(NOT TARGET sim)
include(${CMAKE_CURRENT_SOURCE_DIR}/../src/sim.cmake)
endif()
if(NOT TARGET simdjson)
add_library(simdjson STATIC ${EXTERNAL}/simdjson/singleheader/simdjson.cpp)
target_include_directories(simdjson SYSTEM PUBLIC ${EXTERNAL}/simdjson/singleheader)
@@ -21,5 +25,5 @@ endif()
add_executable(smack_a_brother_server server.cpp)
target_include_directories(smack_a_brother_server PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/../src)
target_link_libraries(smack_a_brother_server PRIVATE LibDataChannel::LibDataChannelStatic simdjson)
target_link_libraries(smack_a_brother_server PRIVATE sim LibDataChannel::LibDataChannelStatic simdjson)
set_target_properties(smack_a_brother_server PROPERTIES OUTPUT_NAME smack-a-brother-server)