Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add and use GameAPI submodule #301

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@
[submodule "dependencies/RSDKv5"]
path = dependencies/RSDKv5
url = https://github.com/Rubberduckycooly/RSDKv5-Decompilation
[submodule "dependencies/GameAPI"]
path = dependencies/GameAPI
url = https://github.com/RSDKModding/RSDKv5-GameAPI
22 changes: 18 additions & 4 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,22 @@ option(GAME_INCLUDE_EDITOR "Whether or not to include editor functions. Defaults

option(GAME_INCREMENTAL_BUILD "Whether or not to build all objects separately (for quicker dev-->build iterations). Defaults to false." OFF)

set(GAMEAPI_PATH dependencies/GameAPI CACHE STRING "The path to look for GameAPI.")

set(GAME_TYPE 1)
set(GAME_CUSTOMLINKLOGIC ON)

if(GAME_INCREMENTAL_BUILD)
include(${GAME_NAME}/Objects.cmake)
set(GAME_SOURCES
${GAME_NAME}/Game.c
${GAMEAPI_PATH}/C/GameAPI/Game.c
${GAME_NAME}/SonicMania.c
${GENERATED_SOURCES}
)
else()
set(GAME_SOURCES
${GAME_NAME}/Game.c
${GAMEAPI_PATH}/C/GameAPI/Game.c
${GAME_NAME}/SonicMania.c
${GAME_NAME}/Objects/All.c
)
endif()
Expand All @@ -56,6 +63,7 @@ else()
endif()

target_include_directories(${GAME_NAME} PRIVATE
${GAMEAPI_PATH}/C/GameAPI/
${GAME_NAME}/
${GAME_NAME}/Objects/
)
Expand All @@ -72,7 +80,10 @@ if(WITH_RSDK)
add_subdirectory(${RSDK_PATH})

if(GAME_STATIC)
target_include_directories(RetroEngine PRIVATE ${GAME_NAME}/)
target_include_directories(RetroEngine PRIVATE
${GAMEAPI_PATH}/C/GameAPI/
${GAME_NAME}/
)
target_link_libraries(RetroEngine ${GAME_NAME})
endif()
else()
Expand All @@ -88,9 +99,12 @@ else()
RETRO_MOD_LOADER_VER=${RETRO_MOD_LOADER_VER}

GAME_INCLUDE_EDITOR=$<BOOL:${GAME_INCLUDE_EDITOR}>
GAME_VERSION=${GAME_VERSION}

MANIA_PREPLUS=$<BOOL:${MANIA_PREPLUS}>
MANIA_FIRST_RELEASE=$<BOOL:${MANIA_FIRST_RELEASE}>
GAME_VERSION=${GAME_VERSION}

GAME_TYPE=${GAME_TYPE}
GAME_CUSTOMLINKLOGIC=$<BOOL:${GAME_CUSTOMLINKLOGIC}>
)
endif()
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ endif

DEFINES += -DRETRO_STANDALONE=1
DEFINES += -DRETRO_REVISION=$(RSDK_REVISION)
DEFINES += -DGAME_TYPE=1
DEFINES += -DGAME_CUSTOMLINKLOGIC=1

CFLAGS_ALL += $(CFLAGS) \
-fsigned-char
Expand All @@ -99,11 +101,13 @@ CXXFLAGS_ALL += $(CXXFLAGS) \
LDFLAGS_ALL = $(LDFLAGS)

GAME_INCLUDES = \
-I./$(GAME_NAME)/ \
-I../dependencies/GameAPI/C/GameAPI/ \
-I./$(GAME_NAME)/ \
-I./$(GAME_NAME)/Objects/

GAME_SOURCES = \
$(GAME_NAME)/Game
../dependencies/GameAPI/C/GameAPI/ \
$(GAME_NAME)/SonicMania \

ifeq ($(GAME_ALLC),1)
GAME_SOURCES += $(GAME_NAME)/Objects/All
Expand Down
94 changes: 0 additions & 94 deletions SonicMania/Game.h

This file was deleted.

Loading