added using setup values for tile selection cursor for MM game engine
authorHolger Schemel <info@artsoft.org>
Sun, 13 Dec 2020 20:22:19 +0000 (21:22 +0100)
committerHolger Schemel <info@artsoft.org>
Sun, 13 Dec 2020 20:22:19 +0000 (21:22 +0100)
src/game_mm/mm_tools.c
src/screens.c

index d7f4326e19ed2fd6ed5f4351701ba83c042ce3f5..28fe9bfe5ed5b9af5c7fba99434a535547110973 100644 (file)
@@ -654,6 +654,11 @@ static byte xsn_bits_0[] = { 0x05, 0x02, 0x05 };
 static byte xsn_bits_1[] = { 0x22, 0x6b, 0x14, 0x2a, 0x14, 0x6b, 0x22 };
 static byte xsn_bits_2[] = { 0x14, 0x08, 0x49, 0x36, 0x49, 0x08, 0x14 };
 
+char debug_xsn_mode[] = { 76,101,116,32,105,116,32,115,110,111,119,33,0 };
+
+void setHideSetupEntry(void *);
+void removeHideSetupEntry(void *);
+
 static struct
 {
   int size;
@@ -913,7 +918,24 @@ static void DrawTileCursor_Xsn(int draw_target)
   if (DelayReached(&check_delay, check_delay_value))
   {
     percent = (debug ? debug_value * 100 / XSN_DEBUG_STEPS : xsn_percent());
+
+    if (debug)
+      setup.debug.xsn_percent = percent;
+
+    if (setup.debug.xsn_mode != AUTO)
+      percent = setup.debug.xsn_percent;
+
+    setup.debug.xsn_percent = percent;
+
     active = (percent > 0);
+
+    if ((active && !active_last) || setup.debug.xsn_mode != AUTO)
+      removeHideSetupEntry(&setup.debug.xsn_mode);
+    else if (!active && active_last)
+      setHideSetupEntry(&setup.debug.xsn_mode);
+
+    if (setup.debug.xsn_mode == FALSE)
+      active = FALSE;
   }
   else if (tile_cursor.xsn_debug)
   {
@@ -923,6 +945,7 @@ static void DrawTileCursor_Xsn(int draw_target)
 
     DelayReached(&check_delay, 0);
 
+    setup.debug.xsn_mode = (debug_value > 0);
     tile_cursor.xsn_debug = FALSE;
   }
 
@@ -931,7 +954,9 @@ static void DrawTileCursor_Xsn(int draw_target)
 
   if (!active_last)
   {
-    start_delay_value = (debug ? 0 : XSN_RND(XSN_START_DELAY * 2) * 1000);
+    boolean no_delay = (debug || setup.debug.xsn_mode == TRUE);
+
+    start_delay_value = (no_delay ? 0 : XSN_RND(XSN_START_DELAY * 2) * 1000);
     started = FALSE;
 
     DelayReached(&start_delay, 0);
index 29f4e5379ddbb66d80fdcad63ef6ee50acc55816..4d5c8b18cbf992b9fa4f516fffccb433c8628c83 100644 (file)
@@ -680,6 +680,8 @@ static char *main_text_title_1                      = NULL;
 static char *main_text_title_2                 = NULL;
 static char *main_text_title_3                 = NULL;
 
+extern char debug_xsn_mode[];
+
 struct MainControlInfo
 {
   int nr;
@@ -6391,6 +6393,7 @@ static struct TokenInfo setup_info_graphics[] =
   { TYPE_SWITCH,       &setup.show_titlescreen,"Show Title Screens:"   },
   { TYPE_SWITCH,       &setup.toons,           "Show Menu Animations:" },
   { TYPE_SWITCH,       &setup.small_game_graphics, "Small Game Graphics:" },
+  { TYPE_YES_NO_AUTO,  &setup.debug.xsn_mode,  debug_xsn_mode          },
   { TYPE_EMPTY,                NULL,                   ""                      },
   { TYPE_LEAVE_MENU,   execSetupMain,          "Back"                  },