improved configurability of tape date and time display positions
[rocksndiamonds.git] / src / tape.c
index 526c6d1d2fee3b2ba393a3d3e42021af6917034b..9de9839b5f2608b77108f742418df5229e31f11d 100644 (file)
@@ -19,6 +19,8 @@
 #include "network.h"
 #include "cartoons.h"
 
+#define DEBUG_TAPE_WHEN_PLAYING                        FALSE
+
 /* tape button identifiers */
 #define TAPE_CTRL_ID_EJECT                     0
 #define TAPE_CTRL_ID_EXTRA                     1
@@ -292,12 +294,16 @@ void DrawVideoDisplay(unsigned int state, unsigned int value)
   {
     struct TextPosInfo *pos = &tape.text.date;
     int tag = value % 100;
-    int monat = (value/100) % 100;
-    int jahr = (value/10000);
-
-    DrawText(VX + pos->x,      VY + pos->y, int2str(tag, 2),   pos->font);
-    DrawText(VX + pos->x + 27, VY + pos->y, monatsname[monat], pos->font);
-    DrawText(VX + pos->x + 64, VY + pos->y, int2str(jahr, 2),  pos->font);
+    int monat = (value / 100) % 100;
+    int jahr = (value / 10000);
+    int xpos1 = VX + pos->x;
+    int xpos2 = VX + pos->x + pos->xoffset;
+    int xpos3 = VX + pos->x + pos->xoffset2;
+    int ypos  = VY + pos->y;
+
+    DrawText(xpos1, ypos, int2str(tag, 2),   pos->font);
+    DrawText(xpos2, ypos, monatsname[monat], pos->font);
+    DrawText(xpos3, ypos, int2str(jahr, 2),  pos->font);
   }
 
   if (state & VIDEO_STATE_TIME_ON)
@@ -305,9 +311,12 @@ void DrawVideoDisplay(unsigned int state, unsigned int value)
     struct TextPosInfo *pos = &tape.text.time;
     int min = value / 60;
     int sec = value % 60;
+    int xpos1 = VX + pos->x;
+    int xpos2 = VX + pos->x + pos->xoffset;
+    int ypos  = VY + pos->y;
 
-    DrawText(VX + pos->x,      VY + pos->y, int2str(min, 2), pos->font);
-    DrawText(VX + pos->x + 27, VY + pos->y, int2str(sec, 2), pos->font);
+    DrawText(xpos1, ypos, int2str(min, 2), pos->font);
+    DrawText(xpos2, ypos, int2str(sec, 2), pos->font);
   }
 
   redraw_mask |= REDRAW_DOOR_2;
@@ -733,6 +742,13 @@ byte *TapePlayAction()
   for (i = 0; i < MAX_PLAYERS; i++)
     action[i] = tape.pos[tape.counter].action[i];
 
+#if DEBUG_TAPE_WHEN_PLAYING
+  printf("%05d", FrameCounter);
+  for (i = 0; i < MAX_PLAYERS; i++)
+    printf("   %08x", action[i]);
+  printf("\n");
+#endif
+
   tape.set_centered_player = FALSE;
   tape.centered_player_nr_next = -999;