Skip to content

Commit

Permalink
Merge pull request #13 from johnpayne-dev/dev
Browse files Browse the repository at this point in the history
v1.2
  • Loading branch information
johnpayne-dev authored Jul 31, 2022
2 parents 9e0e5f0 + 43314f6 commit 43928d4
Show file tree
Hide file tree
Showing 39 changed files with 2,697 additions and 8,798 deletions.
12 changes: 12 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
[submodule "External/SDL"]
path = External/SDL
url = https://github.com/libsdl-org/SDL.git
[submodule "External/OpenCL-Headers"]
path = External/OpenCL-Headers
url = https://github.com/KhronosGroup/OpenCL-Headers
[submodule "External/OpenCL-ICD-Loader"]
path = External/OpenCL-ICD-Loader
url = https://github.com/KhronosGroup/OpenCL-ICD-Loader
[submodule "External/stb"]
path = External/stb
url = https://github.com/nothings/stb.git
[submodule "External/cute_headers"]
path = External/cute_headers
url = https://github.com/johnpayne-dev/cute_headers.git
43 changes: 40 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ set(MINECRAFTC_SOURCES
MinecraftC/GUI/LevelNameScreen.h
MinecraftC/GUI/LoadLevelScreen.c
MinecraftC/GUI/LoadLevelScreen.h
MinecraftC/GUI/ModsScreen.c
MinecraftC/GUI/ModsScreen.h
MinecraftC/GUI/OptionsScreen.c
MinecraftC/GUI/OptionsScreen.h
MinecraftC/GUI/PauseScreen.c
Expand Down Expand Up @@ -83,8 +85,11 @@ set(MINECRAFTC_SOURCES
MinecraftC/Level/Level.c
MinecraftC/Level/Level.h
MinecraftC/Level/NextTickListEntry.h
MinecraftC/Particle/PrimedTNT.c
MinecraftC/Particle/PrimedTNT.h
MinecraftC/Mods/Matrix.h
MinecraftC/Mods/Raytracer.c
MinecraftC/Mods/Raytracer.h
MinecraftC/Mods/PrimedTNT.c
MinecraftC/Mods/PrimedTNT.h
MinecraftC/Particle/Particle.c
MinecraftC/Particle/Particle.h
MinecraftC/Particle/ParticleManager.c
Expand Down Expand Up @@ -131,6 +136,7 @@ set(MINECRAFTC_SOURCES
MinecraftC/Utilities/List.h
MinecraftC/Utilities/Log.c
MinecraftC/Utilities/Log.h
MinecraftC/Utilities/OpenCL.h
MinecraftC/Utilities/OpenGL.h
MinecraftC/Utilities/Random.c
MinecraftC/Utilities/Random.h
Expand All @@ -154,6 +160,8 @@ set(MINECRAFTC_SOURCES
MinecraftC/SessionData.h
MinecraftC/Timer.c
MinecraftC/Timer.h
Resources/Shaders/DistanceField.cl
Resources/Shaders/Raytracer.cl
)

if(MSVC)
Expand All @@ -172,6 +180,9 @@ add_definitions(
-DSDL_VIDEO_OPENGL_EGL=0
-DSDL_VIDEO_RENDER_OGL_ES2=0
)
if(MINECRAFTC_MODS)
add_definitions(-DMINECRAFTC_MODS)
endif()

if(APPLE)
set(SOURCES
Expand All @@ -195,12 +206,25 @@ if(APPLE)
"-framework Metal"
"-framework OpenGL"
)
if (MINECRAFTC_MODS)
set(LIBRARIES ${LIBRARIES} "-framework OpenCL")
endif()
elseif(WIN32)
set(SOURCES
${MINECRAFTC_SOURCES}
${SDL2_COMMON_SOURCES}
${SDL2_WINDOWS_SOURCES}
Resources/App/AppIcon.rc
External/OpenCL-ICD-Loader/loader/icd.c
External/OpenCL-ICD-Loader/loader/icd_dispatch.c
External/OpenCL-ICD-Loader/loader/icd_dispatch_generated.c
External/OpenCL-ICD-Loader/loader/windows/icd_windows.c
External/OpenCL-ICD-Loader/loader/windows/icd_windows_apppackage.cpp
External/OpenCL-ICD-Loader/loader/windows/icd_windows_dxgk.c
External/OpenCL-ICD-Loader/loader/windows/icd_windows_envvars.c
External/OpenCL-ICD-Loader/loader/windows/icd_windows_hkr.c
External/OpenCL-ICD-Loader/loader/windows/OpenCL.def
External/OpenCL-ICD-Loader/loader/windows/OpenCL.rc
)
set(LIBRARIES
opengl32
Expand All @@ -209,9 +233,19 @@ elseif(WIN32)
Winmm
Version
Imm32
RuntimeObject
Cfgmgr32
)
elseif(UNIX)
set(SOURCES ${MINECRAFTC_SOURCES})
set(SOURCES
${MINECRAFTC_SOURCES}
External/OpenCL-ICD-Loader/loader/icd.c
External/OpenCL-ICD-Loader/loader/icd_dispatch.c
External/OpenCL-ICD-Loader/loader/icd_dispatch_generated.c
External/OpenCL-ICD-Loader/loader/linux/icd_linux.c
External/OpenCL-ICD-Loader/loader/linux/icd_linux_envvars.c
External/OpenCL-ICD-Loader/loader/linux/icd_exports.map
)
set(FLAGS ${FLAGS} "-I/usr/include/SDL2" "-D_GNU_SOURCE=1" "-D_REENTRANT")
set(LIBRARIES
m
Expand All @@ -231,5 +265,8 @@ target_include_directories(MinecraftC PRIVATE
External/SDL/include
External/cute_headers
External/stb
External/OpenCL-Headers
External/OpenCL-ICD-Loader/loader
)

target_link_libraries(MinecraftC ${LIBRARIES})
1 change: 1 addition & 0 deletions External/OpenCL-Headers
Submodule OpenCL-Headers added at 7f216e
1 change: 1 addition & 0 deletions External/OpenCL-ICD-Loader
Submodule OpenCL-ICD-Loader added at 7072cf
1 change: 1 addition & 0 deletions External/cute_headers
Submodule cute_headers added at 07165d
Loading

0 comments on commit 43928d4

Please sign in to comment.