diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-11 23:22:04 +0200 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2022-06-11 23:42:27 +0200 |
| commit | 6f74cbd20b1fe0ef9f2a55057e9ac066bec0b575 (patch) | |
| tree | bd6e709305fa93c216915ad73662517b74754489 /src/game | |
| parent | 46fec13fcbee1385db0927f1162f60e1f328d63c (diff) | |
| download | jancity-6f74cbd20b1fe0ef9f2a55057e9ac066bec0b575.tar.gz | |
Implement button component
Diffstat (limited to 'src/game')
| -rw-r--r-- | src/game/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/game/src/res.c | 30 |
2 files changed, 30 insertions, 1 deletions
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 <game_private.h> #include <building.h> +#include <button.h> #include <container.h> #include <font.h> #include <gfx.h> @@ -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; |
