summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorrealtradam <[email protected]>2023-04-25 20:29:23 -0400
committerrealtradam <[email protected]>2023-04-25 20:29:23 -0400
commitf079cdd1d182d6a24bd705627a72fba638f4d8b1 (patch)
treef147980328c3430c3ccd3133a547107970b0a5ff
parentd65df2fc98436742860d98fac6a21a3a4036ec0c (diff)
downloadTOJam2023-f079cdd1d182d6a24bd705627a72fba638f4d8b1.tar.gz
TOJam2023-f079cdd1d182d6a24bd705627a72fba638f4d8b1.zip
fix git submodule pull in cmake + rodeo bump
-rw-r--r--CMakeLists.txt34
m---------external/RodeoKit0
-rw-r--r--src/main.c48
3 files changed, 41 insertions, 41 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
-Subproject 6d58c7ab983e6c2345794ee7bde8dc698cf06f0
+Subproject 4b6ae783ce2c9f08d21d2a2969826412cc587de
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],
},