This is an automated email from the ASF dual-hosted git repository.

acassis pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git

commit e9aea3fd02411334d5b7b04a0d0ab2e02a119778
Author: Matteo Golin <[email protected]>
AuthorDate: Sat Oct 17 06:09:56 2026 -0400

    games/NXDoom: allow wipe animation disable
    
    Allows disabling the wipe animation which has expensive `z_alloc` calls.
    Currently causes the player to be unable to move.
    
    Signed-off-by: Matteo Golin <[email protected]>
---
 games/NXDoom/Kconfig.optimizations | 7 +++++++
 games/NXDoom/Makefile              | 5 ++++-
 games/NXDoom/src/doom/f_wipe.h     | 9 +++++++++
 3 files changed, 20 insertions(+), 1 deletion(-)

diff --git a/games/NXDoom/Kconfig.optimizations 
b/games/NXDoom/Kconfig.optimizations
index 5f85c10cb..ccace20b5 100644
--- a/games/NXDoom/Kconfig.optimizations
+++ b/games/NXDoom/Kconfig.optimizations
@@ -137,4 +137,11 @@ config GAMES_NXDOOM_ALLOC_ZZONESTATIC
 
 endif # GAMES_NXDOOM_ALLOC_ZZONE
 
+config GAMES_NXDOOM_NOWIPE
+       bool "Disable wipe animation"
+       default n
+       ---help---
+               DOOM has a wipe animation between screens which requires costly
+               `z_malloc` allocations. Enabling this option disables that 
animation.
+
 endmenu # Optimizations
diff --git a/games/NXDoom/Makefile b/games/NXDoom/Makefile
index fa44b9166..e1745d80a 100644
--- a/games/NXDoom/Makefile
+++ b/games/NXDoom/Makefile
@@ -102,7 +102,6 @@ DOOMSRCS =     \
   doomstat.c   \
   dstrings.c   \
   f_finale.c   \
-  f_wipe.c     \
   g_game.c     \
   hu_lib.c     \
   hu_stuff.c   \
@@ -141,6 +140,10 @@ DOOMSRCS =     \
   st_stuff.c   \
   wi_stuff.c   
 
+ifeq ($(CONFIG_GAMES_NXDOOM_NOWIPE),)
+DOOMSRCS += f_wipe.c # Include wipe animation
+endif
+
 TXTSCREENSRCS =       \
   txt_conditional.c   \
   txt_checkbox.c      \
diff --git a/games/NXDoom/src/doom/f_wipe.h b/games/NXDoom/src/doom/f_wipe.h
index c421385a5..a09ec8964 100644
--- a/games/NXDoom/src/doom/f_wipe.h
+++ b/games/NXDoom/src/doom/f_wipe.h
@@ -43,11 +43,20 @@ enum
  * Public Function Prototypes
  ****************************************************************************/
 
+#ifndef CONFIG_GAMES_NXDOOM_NOWIPE
 int wipe_start_screen(int x, int y, int width, int height);
 
 int wipe_endscreen(int x, int y, int width, int height);
 
 int wipe_screen_wipe(int wipeno, int x, int y, int width, int height,
                      int ticks);
+#else
 
+/* Disable wipe animations with no-ops. */
+
+#define wipe_start_screen(x, y, width, height) ((void)(0))
+#define wipe_endscreen(x, y, width, height) ((void)(0))
+#define wipe_screen_wipe(wipeno, x, y, width, height, ticks) ((int)(1))
+
+#endif /* CONFIG_GAMES_NXDOOM_NOWIPE */
 #endif /* __F_WIPE_H__ */

Reply via email to