From dfea0aad4826445a32c34d85c33458afef6aa8eb Mon Sep 17 00:00:00 2001 From: Alan Carvalho de Assis Date: Sun, 22 Oct 2023 17:24:03 -0300 Subject: [PATCH] apps/games: Rename Shift game to Brickmatch --- games/{shift => brickmatch}/Kconfig | 28 +++++++++---------- games/{shift => brickmatch}/Make.defs | 6 ++-- games/{shift => brickmatch}/Makefile | 16 +++++------ .../bm_input_console.h} | 4 +-- .../bm_input_gesture.h} | 4 +-- .../bm_input_joystick.h} | 4 +-- .../shift_inputs.h => brickmatch/bm_inputs.h} | 8 +++--- .../shift_main.c => brickmatch/bm_main.c} | 24 ++++++++-------- 8 files changed, 47 insertions(+), 47 deletions(-) rename games/{shift => brickmatch}/Kconfig (68%) rename games/{shift => brickmatch}/Make.defs (89%) rename games/{shift => brickmatch}/Makefile (77%) rename games/{shift/shift_input_console.h => brickmatch/bm_input_console.h} (98%) rename games/{shift/shift_input_gesture.h => brickmatch/bm_input_gesture.h} (97%) rename games/{shift/shift_input_joystick.h => brickmatch/bm_input_joystick.h} (98%) rename games/{shift/shift_inputs.h => brickmatch/bm_inputs.h} (91%) rename games/{shift/shift_main.c => brickmatch/bm_main.c} (98%) diff --git a/games/shift/Kconfig b/games/brickmatch/Kconfig similarity index 68% rename from games/shift/Kconfig rename to games/brickmatch/Kconfig index 8aec0d167..9d2d7d5c1 100644 --- a/games/shift/Kconfig +++ b/games/brickmatch/Kconfig @@ -3,11 +3,11 @@ # see the file kconfig-language.txt in the NuttX tools repository. # -config GAMES_SHIFT - bool "Shift Game" +config GAMES_BRICKMATCH + bool "Brickmatch Game" default n ---help--- - Enable Shift games. Shift is a brick game, like a mix + Enable Brickmatch games. Brickmatch is like a mix between Tetris and Crush Candy. The inspiration came from a Shift game that was available for Android in the F-Droid store. The original game source code still here: @@ -16,21 +16,21 @@ config GAMES_SHIFT NOTE: The source code here is not based on that code from above github. -if GAMES_SHIFT +if GAMES_BRICKMATCH -config GAMES_SHIFT_PROGNAME +config GAMES_BRICKMATCH_PROGNAME string "Program name" - default "shift" + default "brick" ---help--- This is the name of the program that will be used when the NSH ELF program is installed. -config GAMES_SHIFT_PRIORITY - int "Shift Game task priority" +config GAMES_BRICKMATCH_PRIORITY + int "Brickmatch Game task priority" default 100 -config GAMES_SHIFT_STACKSIZE - int "Shift Game stack size" +config GAMES_BRICKMATCH_STACKSIZE + int "Brickmatch Game stack size" default DEFAULT_TASK_STACKSIZE # @@ -39,17 +39,17 @@ config GAMES_SHIFT_STACKSIZE choice prompt "Input Device (Joystick, Gesture Sensor, etc)" - default GAMES_SHIFT_USE_CONSOLEKEY + default GAMES_BRICKMATCH_USE_CONSOLEKEY -config GAMES_SHIFT_USE_CONSOLEKEY +config GAMES_BRICKMATCH_USE_CONSOLEKEY bool "Serial Console as Input" depends on !INPUT_DJOYSTICK && !SENSORS_APDS9960 -config GAMES_SHIFT_USE_DJOYSTICK +config GAMES_BRICKMATCH_USE_DJOYSTICK bool "Discrete Joystick as Input" depends on INPUT_DJOYSTICK -config GAMES_SHIFT_USE_GESTURE +config GAMES_BRICKMATCH_USE_GESTURE bool "Gesture Sensor APDS-9960 as Input" depends on SENSORS_APDS9960 diff --git a/games/shift/Make.defs b/games/brickmatch/Make.defs similarity index 89% rename from games/shift/Make.defs rename to games/brickmatch/Make.defs index 65e059924..659bcf052 100644 --- a/games/shift/Make.defs +++ b/games/brickmatch/Make.defs @@ -1,5 +1,5 @@ ############################################################################ -# apps/games/shift/Make.defs +# apps/games/brickmatch/Make.defs # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -18,6 +18,6 @@ # ############################################################################ -ifneq ($(CONFIG_GAMES_SHIFT),) -CONFIGURED_APPS += $(APPDIR)/games/shift +ifneq ($(CONFIG_GAMES_BRICKMATCH),) +CONFIGURED_APPS += $(APPDIR)/games/brickmatch endif diff --git a/games/shift/Makefile b/games/brickmatch/Makefile similarity index 77% rename from games/shift/Makefile rename to games/brickmatch/Makefile index 6bda408e9..b327e1b36 100644 --- a/games/shift/Makefile +++ b/games/brickmatch/Makefile @@ -1,5 +1,5 @@ ############################################################################ -# apps/games/shift/Makefile +# apps/games/brickmatch/Makefile # # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with @@ -20,15 +20,15 @@ include $(APPDIR)/Make.defs -# Shift game info +# Brickmatch game info -PROGNAME = $(CONFIG_GAMES_SHIFT_PROGNAME) -PRIORITY = $(CONFIG_GAMES_SHIFT_PRIORITY) -STACKSIZE = $(CONFIG_GAMES_SHIFT_STACKSIZE) -MODULE = $(CONFIG_GAMES_SHIFT) +PROGNAME = $(CONFIG_GAMES_BRICKMATCH_PROGNAME) +PRIORITY = $(CONFIG_GAMES_BRICKMATCH_PRIORITY) +STACKSIZE = $(CONFIG_GAMES_BRICKMATCH_STACKSIZE) +MODULE = $(CONFIG_GAMES_BRICKMATCH) -# Shift game application +# Brickmatch game application -MAINSRC = shift_main.c +MAINSRC = bm_main.c include $(APPDIR)/Application.mk diff --git a/games/shift/shift_input_console.h b/games/brickmatch/bm_input_console.h similarity index 98% rename from games/shift/shift_input_console.h rename to games/brickmatch/bm_input_console.h index d2f974d25..cb5e45b0a 100644 --- a/games/shift/shift_input_console.h +++ b/games/brickmatch/bm_input_console.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/games/shift/shift_input_console.h + * apps/games/brickmatch/bm_input_console.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -25,7 +25,7 @@ #include #include -#include "shift_inputs.h" +#include "bm_inputs.h" /**************************************************************************** * Preprocessor Definitions diff --git a/games/shift/shift_input_gesture.h b/games/brickmatch/bm_input_gesture.h similarity index 97% rename from games/shift/shift_input_gesture.h rename to games/brickmatch/bm_input_gesture.h index 54feb71c1..eaf74ca3a 100644 --- a/games/shift/shift_input_gesture.h +++ b/games/brickmatch/bm_input_gesture.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/games/shift/shift_input_gesture.h + * apps/games/brickmatch/bm_input_gesture.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -26,7 +26,7 @@ #include -#include "shift_inputs.h" +#include "bm_inputs.h" /**************************************************************************** * Preprocessor Definitions diff --git a/games/shift/shift_input_joystick.h b/games/brickmatch/bm_input_joystick.h similarity index 98% rename from games/shift/shift_input_joystick.h rename to games/brickmatch/bm_input_joystick.h index 2bd3a625c..ef5146cac 100644 --- a/games/shift/shift_input_joystick.h +++ b/games/brickmatch/bm_input_joystick.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/games/shift/shift_input_joystick.h + * apps/games/brickmatch/bm_input_joystick.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -26,7 +26,7 @@ #include -#include "shift_inputs.h" +#include "bm_inputs.h" /**************************************************************************** * Preprocessor Definitions diff --git a/games/shift/shift_inputs.h b/games/brickmatch/bm_inputs.h similarity index 91% rename from games/shift/shift_inputs.h rename to games/brickmatch/bm_inputs.h index c2141d6d3..a78f03601 100644 --- a/games/shift/shift_inputs.h +++ b/games/brickmatch/bm_inputs.h @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/games/shift/shift_inputs.h + * apps/games/brickmatch/bm_inputs.h * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -50,13 +50,13 @@ struct input_state_s { -#ifdef CONFIG_GAMES_SHIFT_USE_CONSOLEKEY +#ifdef CONFIG_GAMES_BRICKMATCH_USE_CONSOLEKEY int fd_con; #endif -#ifdef CONFIG_GAMES_SHIFT_USE_DJOYSTICK +#ifdef CONFIG_GAMES_BRICKMATCH_USE_DJOYSTICK int fd_joy; #endif -#ifdef CONFIG_GAMES_SHIFT_USE_GESTURE +#ifdef CONFIG_GAMES_BRICKMATCH_USE_GESTURE int fd_gest; #endif int dir; /* Direction to move the blocks */ diff --git a/games/shift/shift_main.c b/games/brickmatch/bm_main.c similarity index 98% rename from games/shift/shift_main.c rename to games/brickmatch/bm_main.c index 0e60f56a1..187ce2683 100644 --- a/games/shift/shift_main.c +++ b/games/brickmatch/bm_main.c @@ -1,5 +1,5 @@ /**************************************************************************** - * apps/games/shift/shift_main.c + * apps/games/brickmatch/bm_main.c * * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with @@ -36,16 +36,16 @@ #include #include -#ifdef CONFIG_GAMES_SHIFT_USE_CONSOLEKEY -#include "shift_input_console.h" +#ifdef CONFIG_GAMES_BRICKMATCH_USE_CONSOLEKEY +#include "bm_input_console.h" #endif -#ifdef CONFIG_GAMES_SHIFT_USE_DJOYSTICK -#include "shift_input_joystick.h" +#ifdef CONFIG_GAMES_BRICKMATCH_USE_DJOYSTICK +#include "bm_input_joystick.h" #endif -#ifdef CONFIG_GAMES_SHIFT_USE_GESTURE -#include "shift_input_gesture.h" +#ifdef CONFIG_GAMES_BRICKMATCH_USE_GESTURE +#include "bm_input_gesture.h" #endif /**************************************************************************** @@ -302,7 +302,7 @@ void draw_board(FAR struct screen_state_s *state, * Draw the board including the user non-visible border for debugging. ****************************************************************************/ -#ifdef DEBUG_SHIFT_GAME +#ifdef DEBUG_BRICKMATCH_GAME void print_board(void) { int row; @@ -750,7 +750,7 @@ int check_board(void) ****************************************************************************/ /**************************************************************************** - * shift_main + * brick_main ****************************************************************************/ int main(int argc, FAR char *argv[]) @@ -854,7 +854,7 @@ int main(int argc, FAR char *argv[]) screen.dir = input.dir; -#ifdef DEBUG_SHIFT_GAME +#ifdef DEBUG_BRICKMATCH_GAME printf("Before moving:\n"); print_board(); usleep(2000000); @@ -868,7 +868,7 @@ int main(int argc, FAR char *argv[]) draw_board(&state, &area, &screen); -#ifdef DEBUG_SHIFT_GAME +#ifdef DEBUG_BRICKMATCH_GAME printf("After moving:\n"); print_board(); usleep(1000000); @@ -907,7 +907,7 @@ int main(int argc, FAR char *argv[]) usleep(500000); } -#ifdef DEBUG_SHIFT_GAME +#ifdef DEBUG_BRICKMATCH_GAME printf("After checking:\n"); print_board(); usleep(1000000);