From a84a55aa2558b537aeb4adde1875683e88e11624 Mon Sep 17 00:00:00 2001 From: Xavier Del Campo Romero Date: Sat, 11 Jun 2022 23:22:04 +0200 Subject: Implement button component --- src/game/CMakeLists.txt | 1 + src/game/src/res.c | 30 +++++++++++++++++++++++++++++- 2 files changed, 30 insertions(+), 1 deletion(-) (limited to 'src/game') diff --git a/src/game/CMakeLists.txt b/src/game/CMakeLists.txt index 0c21b0c..3eeef87 100644 --- a/src/game/CMakeLists.txt +++ b/src/game/CMakeLists.txt @@ -2,6 +2,7 @@ add_library(game "src/game.c" "src/res.c") target_include_directories(game PUBLIC "inc" PRIVATE "privinc") target_link_libraries(game PRIVATE building + button container font gfx diff --git a/src/game/src/res.c b/src/game/src/res.c index 39b3b5e..093fc45 100644 --- a/src/game/src/res.c +++ b/src/game/src/res.c @@ -1,5 +1,6 @@ #include #include +#include #include #include #include @@ -216,7 +217,34 @@ static const struct container c[] = { .sound = &unit_sounds[UNIT_SOUND_SELECTED] } - } + }, + + { + .path = "btn_left", + .type = CONTAINER_TYPE_SPRITE, + .data = + { + .sprite = &button_sprites[BUTTON_LEFT] + } + }, + + { + .path = "btn_mid", + .type = CONTAINER_TYPE_SPRITE, + .data = + { + .sprite = &button_sprites[BUTTON_MID] + } + }, + + { + .path = "btn_right", + .type = CONTAINER_TYPE_SPRITE, + .data = + { + .sprite = &button_sprites[BUTTON_RIGHT] + } + }, }; static bool init; -- cgit v1.2.3