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

Humble edits #44

Open
wants to merge 16 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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 3.0)
cmake_minimum_required(VERSION 3.5)

cmake_policy(SET CMP0072 NEW)

Expand All @@ -17,11 +17,11 @@ INCLUDE(ExternalProject)

function(build_portaudio)
ExternalProject_Add(project_portaudio
GIT_REPOSITORY https://git.assembla.com/portaudio.git
GIT_REPOSITORY https://github.com/PortAudio/portaudio
SOURCE_DIR ${PROJECT_SOURCE_DIR}/deps/portaudio
BINARY_DIR ${PROJECT_BINARY_DIR}/deps/portaudio/build
CMAKE_ARGS -DPA_USE_JACK=0 -DPA_USE_ALSA=1 -DPA_USE_ASIO=0 -DPA_USE_WASAPI=1
GIT_TAG ticket_263_alsa_uninitialized_var_2
GIT_TAG v19.7.0
STEP_TARGETS build
INSTALL_COMMAND echo Skipping install step for portaudio
)
Expand Down Expand Up @@ -56,7 +56,7 @@ endfunction()

function(build_freetype2)
ExternalProject_Add(project_freetype2
GIT_REPOSITORY http://git.savannah.nongnu.org/r/freetype/freetype2.git/
GIT_REPOSITORY https://git.savannah.gnu.org/git/freetype/freetype2.git
SOURCE_DIR ${PROJECT_SOURCE_DIR}/deps/freetype2
BINARY_DIR ${PROJECT_BINARY_DIR}/deps/freetype2/build
INSTALL_COMMAND echo Skipping install step for freetype2
Expand Down Expand Up @@ -152,6 +152,7 @@ function(build_librocket)
ExternalProject_Get_Property(project_librocket BINARY_DIR)
SET(librocket_lib_dir "${BINARY_DIR}" PARENT_SCOPE)
SET(librocket_inc_dir "${SOURCE_DIR}/include" PARENT_SCOPE)

#ADD_LIBRARY(librocket STATIC IMPORTED)
endfunction()

Expand All @@ -168,15 +169,20 @@ function(build_libsgfcplusplus)
BINARY_DIR ${CMAKE_BINARY_DIR}/deps/libsgfcplusplus
STEP_TARGETS build
#UPDATE_COMMAND ""
#UPDATE_COMMAND git restore --source=HEAD --staged --worktree -- sgfc
#COMMAND git fetch
#COMMAND git checkout sgfc
UPDATE_COMMAND git restore --source=HEAD --staged --worktree -- sgfc
COMMAND git fetch
COMMAND git checkout sgfc
INSTALL_COMMAND echo Skipping install step for libsgfcplusplus
)

ExternalProject_Get_Property(project_libsgfcplusplus SOURCE_DIR)
ExternalProject_Get_Property(project_libsgfcplusplus BINARY_DIR)
set(libsgfcplusplus_inc_dir "${SOURCE_DIR}/include" "${BINARY_DIR}/src" PARENT_SCOPE)
set(libsgfcplusplus_lib_dir "${BINARY_DIR}/src" PARENT_SCOPE)
if (WIN32)
set(libsgfcplusplus_lib_dir "${BINARY_DIR}/src/${CMAKE_BUILD_TYPE}" PARENT_SCOPE)
else()
set(libsgfcplusplus_lib_dir "${BINARY_DIR}/src" PARENT_SCOPE)
endif()
endfunction()

function(find_libsgfcplusplus)
Expand All @@ -196,10 +202,11 @@ endfunction()
function(fetch_json)
include(FetchContent)

FetchContent_Declare(json
GIT_REPOSITORY https://github.com/ArthurSonzogni/nlohmann_json_cmake_fetchcontent.git
GIT_TAG v3.7.3)
FetchContent_Declare(json URL https://github.com/nlohmann/json/releases/download/v3.11.3/json.tar.xz
DOWNLOAD_EXTRACT_TIMESTAMP TRUE
)

FetchContent_MakeAvailable(json)
FetchContent_GetProperties(json)
if(NOT json_POPULATED)
FetchContent_Populate(json)
Expand Down Expand Up @@ -380,7 +387,7 @@ else()
cmake_language(CALL find_boost)

add_definitions(-DWIN32 -D_WINDOWS -D_WIN32_WINNT=0x0A00)
option(CMAKE_USE_WIN32_THREADS_INIT "using WIN32 threads" ON)
#option(CMAKE_USE_WIN32_THREADS_INIT "using WIN32 threads" ON)
set(Boost_USE_STATIC_LIBS ON)
add_definitions(-DROCKET_STATIC_LIB)
endif()
Expand Down Expand Up @@ -437,7 +444,6 @@ else()
set(GOBAN_HDR_FILES
src/Board.h
src/Camera.h
src/Complex.h
src/ElementGame.h
src/Event.h
src/EventHandler.h
Expand Down Expand Up @@ -467,7 +473,6 @@ else()
set(GOBAN_SRC_FILES
src/Board.cpp
src/Camera.cpp
src/Complex.cpp
src/ElementGame.cpp
src/Event.cpp
src/EventHandler.cpp
Expand All @@ -485,17 +490,16 @@ else()
src/GobanControl.cpp
src/GobanShader.cpp
src/Metrics.cpp
src/GameState.cpp
src/GobanOverlay.cpp
src/sound/AudioFile.cpp
src/sound/AudioPlayer.cpp
src/sound/FileHandler.cpp
src/sound/StreamHandler.cpp
src/sound/util.cpp src/Configuration.cpp
src/glad/src/glad.c
src/InputThread.cpp
src/GameRecord.cpp
)
target_compile_features(${PROJECT_NAME} PRIVATE cxx_std_17)

target_sources(${PROJECT_NAME} PRIVATE
${GOBAN_SRC_FILES}
Expand All @@ -521,7 +525,6 @@ else()
${PORTAUDIO_INCLUDE_DIRS}
${libsgfcplusplus_inc_dir}
)
target_compile_features(${PROJECT_NAME} INTERFACE cxx_std_17)

add_dependencies(${PROJECT_NAME}
project_librocket
Expand Down
2 changes: 1 addition & 1 deletion cmake/FindLibRocket.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
find_path(LIBROCKET_INCLUDE_DIR Rocket/Core.h
PATH_SUFFIXES Rocket HINTS ${PROJECT_SOURCE_DIR}/deps/libRocket/Include)

message(${PROJECT_BINARY_DIR}/deps/libRocket/build/${BUILD_TYPE})
message(${PROJECT_BINARY_DIR}/deps/libRocket/build/${CMAKE_BUILD_TYPE})
find_library(LIBROCKET_CORE_LIBRARY NAMES RocketCore
HINTS ${PROJECT_BINARY_DIR}/deps/libRocket/build ${PROJECT_BINARY_DIR}/deps/libRocket/build/${CMAKE_BUILD_TYPE})
find_library(LIBROCKET_CONTROLS_LIBRARY NAMES RocketControls
Expand Down
87 changes: 75 additions & 12 deletions data/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,39 @@
},
{
"name": "Pachi 12.60",
"path": "./engine/pachi",
"command": "pachi-12.60-amd64",
"path": "./engine/Pachi-12.60",
"command": "pachi.exe",
"parameters": "-r japanese --smart-pass",
"enabled": 0
},
{
"name": "Katago #kata1 b40",
"path": "./engine/katago",
"command": "katago",
"parameters": "gtp -model ./engine/katago/kata1-b40c256-s11101799168-d2715431527.bin.gz -config ./engine/katago/default_gtp.cfg",
"parameters": "gtp -model ./engine/katago/models/kata1-b40c256-s10359230464-d2525387336.bin.gz -config ./engine/katago/default_gtp.cfg",
"enabled": 0,
"kibitz": 0,
"messages": [
{
"regex": "^:\\s+T.*--\\s*([A-Z0-9]+)",
"output": "$1",
"var": "$primaryMove"
},
{
"regex": "^$primaryMove.*(W\\s+[^\\s]+).*\\(\\s*([^\\s]+\\s+L)",
"output": "$1 $2"
},
{
"regex": "Controller:",
"output": " "
}
]
},
{
"name": "Katago #kata9x9 b18",
"path": "./engine/katago",
"command": "katago",
"parameters": "gtp -model ./engine/katago/kata9x9-b18c384nbt-20231025.bin.gz -config ./engine/katago/default_gtp.cfg",
"enabled": 0,
"kibitz": 0,
"messages": [
Expand Down Expand Up @@ -79,7 +102,11 @@
{"key": 90, "command": "decrease gamma"},
{"key": 91, "command": "increase contrast"},
{"key": 93, "command": "decrease contrast"},
{"key": 89, "command": "reset contrast and gamma"}
{"key": 89, "command": "reset contrast and gamma"},
{"key": 19, "command": "increase eof"},
{"key": 23, "command": "decrease eof"},
{"key": 21, "command": "increase dof"},
{"key": 22, "command": "decrease dof"}
],
"sounds": {
"move": "./data/sound/stone.wav",
Expand All @@ -94,22 +121,58 @@
},
"shaders": [
{
"name": "Red Carpet Goban",
"vertex": "./data/shaders/common/vertex.glsl",
"fragment": "./data/shaders/legacy/fragment.glsl",
"name": "Red Carpet",
"vertex": "./data/shaders/vertex/mono.glsl",
"fragment": "./data/shaders/fragment/red_carpet.glsl",
"height": 0.85
},
{
"name": "Minimalistic Flat",
"vertex": "./data/shaders/common/vertex.glsl",
"fragment": "./data/shaders/legacy/fragment.2D.glsl",
"name": "Minimal Thin",
"vertex": "./data/shaders/vertex/mono.glsl",
"fragment": "./data/shaders/fragment/thin.glsl",
"height": 0.85
},
{
"name": "Minimal Flat",
"vertex": "./data/shaders/vertex/mono.glsl",
"fragment": "./data/shaders/fragment/flat.glsl",
"height": 0.85
},
{
"name": "Minimal 2D",
"vertex": "./data/shaders/vertex/mono.glsl",
"fragment": "./data/shaders/fragment/2d.glsl",
"height": 0.0
},
{
"name": "Minimalistic Thin",
"vertex": "./data/shaders/common/vertex.glsl",
"name": "[stereo] Red Carpet",
"vertex": "./data/shaders/vertex/stereo.glsl",
"fragment": "./data/shaders/fragment/red_carpet_stereo.glsl",
"height": 0.85
},
{
"name": "[stereo] Minimal Thin",
"vertex": "./data/shaders/vertex/stereo.glsl",
"fragment": "./data/shaders/fragment/thin_stereo.glsl",
"height": 0.85
},
{
"name": "(legacy) Red Carpet",
"vertex": "./data/shaders/vertex/mono.glsl",
"fragment": "./data/shaders/legacy/fragment.glsl",
"height": 0.85
},
{
"name": "(legacy) Minimal Thin",
"vertex": "./data/shaders/vertex/mono.glsl",
"fragment": "./data/shaders/legacy/fragment.25D.glsl",
"height": 0.85
},
{
"name": "(legacy) Minimal Flat",
"vertex": "./data/shaders/vertex/mono.glsl",
"fragment": "./data/shaders/legacy/fragment.2D.glsl",
"height": 0.0
}
],
"gui": "./data/gui"
Expand Down
5 changes: 4 additions & 1 deletion data/gui/goban.rml
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,11 @@
<div class="grp">
<div class="hr">Camera</div>
<!--<div class="cmd" onmouseup="free camera toggle">Toggle free</div>-->
<div class="cmd" onmouseup="reset camera">Reset camera</div>
<div class="cmd" onmouseup="reset camera">Reset</div>
<div class="cmd" onmouseup="animate">Animate</div>
<div class="hr">Camera Preset</div>
<div class="cmd" onmouseup="save camera">Save</div>
<div class="cmd" onmouseup="delete camera">Clear</div>
</div>
</div>
</div>
Expand Down
Loading