Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0b103b3
Use vcpkg submodule
tjrileywisc Mar 14, 2025
d467505
Add post-build task to copy game resources
tjrileywisc Mar 14, 2025
29b9d78
Change vcpkg commit and add cpp config
tjrileywisc Mar 14, 2025
db2c141
Change type
tjrileywisc Mar 14, 2025
5033339
Get stb from vcpkg
tjrileywisc Mar 14, 2025
4c055ef
Get sokol from vcpkg
tjrileywisc Mar 14, 2025
e0fa2a2
Update CMakePresets
tjrileywisc Mar 16, 2025
3906535
Remove copy step
tjrileywisc Mar 16, 2025
9632d3d
Fix many unsigned/signed comparisons
tjrileywisc Mar 19, 2025
36ec3c0
Merge branch 'fix-unsigned-comparisons' into myfork
tjrileywisc Apr 26, 2025
4dae018
Remove makefile (replaced with CMakeLists.txt)
tjrileywisc Apr 29, 2025
f0d4302
Add basic dedicated server and communication (#4)
tjrileywisc Apr 29, 2025
3683e30
Update vcpkg commit
tjrileywisc Apr 29, 2025
96ecb55
Fix protobuf gen
tjrileywisc May 21, 2025
692209b
Add pkgconfig
tjrileywisc May 21, 2025
6c39b31
Link with static libs
tjrileywisc May 22, 2025
506a385
Header changes for windows
tjrileywisc May 22, 2025
baddf61
Fix circuit selection
tjrileywisc May 24, 2025
8a8f6ac
Merge remote-tracking branch 'origin/master' into myfork
tjrileywisc May 24, 2025
23c655f
Change menu order to put race type first
tjrileywisc Jun 5, 2025
19de20a
Send-server-info (#10)
tjrileywisc Jun 14, 2025
cde6afd
Add controller vibration support
tjrileywisc Jun 18, 2025
bc03897
Connect client (#12)
tjrileywisc Jun 22, 2025
6a4feba
Merge branch 'myfork' into controller-vibration
tjrileywisc Jun 22, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

IndentWidth: 4
UseTab: Never

BraceWrapping:
AfterFunction: false
AfterControlStatement: false
AfterEnum: true
AfterStruct: true
BeforeElse: true
IndentBraces: false
12 changes: 10 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
/wipeout.sublime-project
/wipeout.sublime-workspace

# ide stuff
.vscode

# game data
/wipeout/
/save.dat
gamecontrollerdb.txt

# build artifacts
/build/
coverage-report/
*.info

/wipegame
/wipegame.exe
Expand Down
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "vcpkg"]
path = vcpkg
url = https://github.com/microsoft/vcpkg
94 changes: 56 additions & 38 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.13 FATAL_ERROR)
cmake_minimum_required(VERSION 3.28 FATAL_ERROR)
project(wipeout-rewrite)

if("${PROJECT_SOURCE_DIR}" STREQUAL "${PROJECT_BINARY_DIR}")
Expand All @@ -7,7 +7,6 @@ endif()

include(GNUInstallDirs)
include(CMakeDependentOption)
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")

if("${CMAKE_SYSTEM_NAME}" STREQUAL "Emscripten")
set(EMSCRIPTEN true)
Expand Down Expand Up @@ -38,88 +37,100 @@ cmake_dependent_option(MINIMAL_BUNDLE "Do not include music/movies for web build
option(PATH_ASSETS "Path to where the game assets should be located.")
option(PATH_USERDATA "Path to where user data (e.g. game saves) should be located.")
option(DEV_BUILD "Set asset/userdata paths to the source directory for testing" OFF)
option(USE_ASAN "Enable AddressSanitizer" OFF)

if (DEV_BUILD)
set(PATH_ASSETS "${CMAKE_SOURCE_DIR}/")
set(PATH_USERDATA "${CMAKE_SOURCE_DIR}/")
endif()

# 3RD PARTY LIBRARIES
find_package(PkgConfig REQUIRED)
find_package(OpenGL)
find_package(GLEW)
find_package(SDL2)
find_package(GLEW REQUIRED)
find_package(SDL2 CONFIG REQUIRED)
find_package(cmocka REQUIRED)
pkg_check_modules(libprotobuf-c REQUIRED IMPORTED_TARGET libprotobuf-c)

include_directories(${VCPKG_INSTALLED_DIR}/${VCPKG_TARGET_TRIPLET}/include)

# COMMON COMPLIER FLAGS, DEFINES
set(CMAKE_C_STANDARD 11)
add_compile_options(
$<$<CXX_COMPILER_ID:MSVC>:/W4>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wextra>
)

if(DEV_BUILD AND NOT WIN32)
add_compile_options(-g -Og)
if(NOT WIN32)
add_compile_options(--coverage)
add_link_options(--coverage)
endif()
endif()

if(USE_ASAN)
add_compile_options(-fsanitize=address)
add_link_options(-fsanitize=address)
endif()

# INTERNAL LIBRARIES
# PROTOBUF MSGS
add_subdirectory(gen)

# NETWORK LIBRARY TARGET
add_subdirectory(network)

# SERVER TARGET
add_subdirectory(server)

# MAIN GAME TARGET
set(common_src
src/wipeout/camera.c
src/wipeout/camera.h
src/wipeout/server_com.c
src/wipeout/droid.c
src/wipeout/droid.h
src/wipeout/game.c
src/wipeout/game.h
src/wipeout/hud.c
src/wipeout/hud.h
src/wipeout/image.c
src/wipeout/image.h
src/wipeout/ingame_menus.c
src/wipeout/ingame_menus.h
src/wipeout/intro.c
src/wipeout/intro.h
src/wipeout/main_menu.c
src/wipeout/main_menu.h
src/wipeout/menu.c
src/wipeout/menu.h
src/wipeout/object.c
src/wipeout/object.h
src/wipeout/particle.c
src/wipeout/particle.h
src/wipeout/race.c
src/wipeout/race.h
src/wipeout/scene.c
src/wipeout/scene.h
src/wipeout/sfx.c
src/wipeout/sfx.h
src/wipeout/ship.c
src/wipeout/ship.h
src/wipeout/ship_ai.c
src/wipeout/ship_ai.h
src/wipeout/ship_player.c
src/wipeout/ship_player.h
src/wipeout/title.c
src/wipeout/title.h
src/wipeout/track.c
src/wipeout/track.h
src/wipeout/ui.c
src/wipeout/ui.h
src/wipeout/weapon.c
src/wipeout/weapon.h
src/input.c
src/input.h
src/mem.c
src/mem.h
src/platform.h
src/render.h
src/system.c
src/system.h
src/types.c
src/types.h
src/utils.c
src/utils.h

packaging/windows/wipeout.exe.manifest
packaging/windows/wipeout.rc
)

add_executable(wipeout WIN32 ${common_src})
set_property(TARGET wipeout PROPERTY C_STANDARD 11)
target_include_directories(wipeout PRIVATE src)
target_include_directories(wipeout SYSTEM PRIVATE src/libs)
target_compile_options(wipeout PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:/W4>
$<$<NOT:$<CXX_COMPILER_ID:MSVC>>:-Wall -Wextra>
)

target_compile_definitions(wipeout PRIVATE
$<$<BOOL:${PATH_ASSETS}>:-DPATH_ASSETS=${PATH_ASSETS}>
$<$<BOOL:${PATH_USERDATA}>:-DPATH_USERDATA=${PATH_USERDATA}>
)

# COMMON LIBRARIES
target_link_libraries(wipeout PRIVATE network)

if(WIN32)
target_compile_definitions(wipeout PRIVATE
"NOMINMAX"
Expand Down Expand Up @@ -220,9 +231,16 @@ endif()

if("${PLATFORM}" STREQUAL SDL2)
target_sources(wipeout PRIVATE src/platform_sdl.c)
target_link_libraries(wipeout PUBLIC SDL2::Main)
target_link_libraries(wipeout
PRIVATE
$<TARGET_NAME_IF_EXISTS:SDL2::SDL2main>
$<IF:$<TARGET_EXISTS:SDL2::SDL2>,SDL2::SDL2,SDL2::SDL2-static>
)
elseif("${PLATFORM}" STREQUAL SOKOL)
target_sources(wipeout PRIVATE src/platform_sokol.c)
endif()

# UNIT TESTS TARGET
add_subdirectory(tests)

install(TARGETS wipeout)
37 changes: 37 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"version": 3,
"cmakeMinimumRequired": {
"major": 3,
"minor": 19,
"patch": 0
},
"configurePresets": [
{
"name": "default",
"generator": "Ninja",
"binaryDir": "${sourceDir}/build",
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_TOOLCHAIN_FILE": "vcpkg/scripts/buildsystems/vcpkg.cmake",
"DEV_BUILD": "ON"
}
},
{
"name": "windows-clang-cl",
"inherits": "default",
"description": "Configuration for clang-cl on Windows using vcpkg",
"cacheVariables": {
"CMAKE_C_COMPILER": "clang-cl",
"CMAKE_CXX_COMPILER": "clang-cl",
"VCPKG_TARGET_TRIPLET": "x64-windows-static-md"
}
}
],
"buildPresets": [
{
"name": "build",
"configurePreset": "windows-clang-cl",
"configuration": "Debug"
}
]
}
71 changes: 0 additions & 71 deletions CMakeSettings.json

This file was deleted.

Loading