From f079cdd1d182d6a24bd705627a72fba638f4d8b1 Mon Sep 17 00:00:00 2001 From: realtradam Date: Tue, 25 Apr 2023 20:29:23 -0400 Subject: fix git submodule pull in cmake + rodeo bump --- CMakeLists.txt | 34 +++++++++++++++++----------------- external/RodeoKit | 2 +- src/main.c | 48 ++++++++++++++++++++++++------------------------ 3 files changed, 42 insertions(+), 42 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 15c5f56..68fc172 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -9,7 +9,23 @@ add_executable(${PROJECT_NAME} "src/input.c" ) -set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 11) +set_property(TARGET ${PROJECT_NAME} PROPERTY C_STANDARD 99) + +# pull all git submodules recursively +find_package(Git QUIET) +if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") + # Update submodules as needed + option(GIT_SUBMODULE "Check submodules during build" ON) + if(GIT_SUBMODULE) + message(STATUS "Submodule update") + execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE GIT_SUBMOD_RESULT) + if(NOT GIT_SUBMOD_RESULT EQUAL "0") + message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") + endif() + endif() +endif() add_subdirectory(external/RodeoKit) add_dependencies(${PROJECT_NAME} RodeoKit) @@ -53,19 +69,3 @@ if (NOT DEFINED EMSCRIPTEN) ) endif() -# pull all git submodules recursively -find_package(Git QUIET) -if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") - # Update submodules as needed - option(GIT_SUBMODULE "Check submodules during build" ON) - if(GIT_SUBMODULE) - message(STATUS "Submodule update") - execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - RESULT_VARIABLE GIT_SUBMOD_RESULT) - if(NOT GIT_SUBMOD_RESULT EQUAL "0") - message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") - endif() - endif() -endif() - diff --git a/external/RodeoKit b/external/RodeoKit index 6d58c7a..4b6ae78 160000 --- a/external/RodeoKit +++ b/external/RodeoKit @@ -1 +1 @@ -Subproject commit 6d58c7ab983e6c2345794ee7bde8dc698cf06f0e +Subproject commit 4b6ae783ce2c9f08d21d2a2969826412cc587de2 diff --git a/src/main.c b/src/main.c index cb4b66f..225ade7 100644 --- a/src/main.c +++ b/src/main.c @@ -25,44 +25,44 @@ uint16_t num_of_units = 0; const rodeo_color_RGBAFloat_t red = { - .red = 1.0f, .green = 0.0f, .blue = 0.0f, - .alpha = 1.0f + .colors.red = 1.0f, .colors.green = 0.0f, .colors.blue = 0.0f, + .colors.alpha = 1.0f }; const rodeo_color_RGBAFloat_t green = { - .red = 0.0f, .green = 1.0f, .blue = 0.0f, - .alpha = 1.0f + .colors.red = 0.0f, .colors.green = 1.0f, .colors.blue = 0.0f, + .colors.alpha = 1.0f }; const rodeo_color_RGBAFloat_t blue = { - .red = 0.0f, .green = 0.0f, .blue = 1.0f, - .alpha = 1.0f + .colors.red = 0.0f, .colors.green = 0.0f, .colors.blue = 1.0f, + .colors.alpha = 1.0f }; const rodeo_color_RGBAFloat_t pink = { - .red = 1.0f, .green = 0.0f, .blue = 1.0f, - .alpha = 1.0f + .colors.red = 1.0f, .colors.green = 0.0f, .colors.blue = 1.0f, + .colors.alpha = 1.0f }; const rodeo_color_RGBAFloat_t red_clear = { - .red = 1.0f, .green = 0.0f, .blue = 0.0f, - .alpha = 0.5f + .colors.red = 1.0f, .colors.green = 0.0f, .colors.blue = 0.0f, + .colors.alpha = 0.5f }; const rodeo_color_RGBAFloat_t green_clear = { - .red = 0.0f, .green = 1.0f, .blue = 0.0f, - .alpha = 0.5f + .colors.red = 0.0f, .colors.green = 1.0f, .colors.blue = 0.0f, + .colors.alpha = 0.5f }; const rodeo_color_RGBAFloat_t blue_clear = { - .red = 0.0f, .green = 0.0f, .blue = 1.0f, - .alpha = 0.5f + .colors.red = 0.0f, .colors.green = 0.0f, .colors.blue = 1.0f, + .colors.alpha = 0.5f }; const rodeo_color_RGBAFloat_t pink_clear = { - .red = 1.0f, .green = 0.0f, .blue = 1.0f, - .alpha = 0.5f + .colors.red = 1.0f, .colors.green = 0.0f, .colors.blue = 1.0f, + .colors.alpha = 0.5f }; void @@ -160,21 +160,21 @@ main_loop(void) for(uint64_t i = 0; i < num_of_units; ++i) { - units[i][0].x += units[i][1].x; - units[i][0].y += units[i][1].y; - if(units[i][0].x > rodeo_screen_width_get() - orc_size[0] || units[i][0].x < 0) + units[i][0].position.x += units[i][1].position.x; + units[i][0].position.y += units[i][1].position.y; + if(units[i][0].position.x > rodeo_screen_width_get() - orc_size[0] || units[i][0].position.x < 0) { - units[i][1].x = -units[i][1].x; + units[i][1].position.x = -units[i][1].position.x; } - if(units[i][0].y > rodeo_screen_height_get() - orc_size[1] || units[i][0].y < 0) + if(units[i][0].position.y > rodeo_screen_height_get() - orc_size[1] || units[i][0].position.y < 0) { - units[i][1].y = -units[i][1].y; + units[i][1].position.y = -units[i][1].position.y; } rodeo_texture_2d_draw( &(rodeo_rectangle_t){ - .x = units[i][0].x, - .y = units[i][0].y, + .x = units[i][0].position.x, + .y = units[i][0].position.y, .width = orc_size[0], .height = orc_size[1], }, -- cgit v1.2.3