/***********************************************************
* Rocks'n'Diamonds -- McDuffin Strikes Back! *
*----------------------------------------------------------*
-* ©1995 Artsoft Development *
-* Holger Schemel *
-* 33659 Bielefeld-Senne *
-* Telefon: (0521) 493245 *
-* eMail: aeglos@valinor.owl.de *
-* aeglos@uni-paderborn.de *
-* q99492@pbhrzx.uni-paderborn.de *
+* (c) 1995-98 Artsoft Entertainment *
+* Holger Schemel *
+* Oststrasse 11a *
+* 33604 Bielefeld *
+* phone: ++49 +521 290471 *
+* email: aeglos@valinor.owl.de *
*----------------------------------------------------------*
* buttons.h *
***********************************************************/
#include "main.h"
+/* tags to draw video display labels or symbols only */
+#define VIDEO_DISPLAY_DEFAULT 0
+#define VIDEO_DISPLAY_LABEL_ONLY 1
+#define VIDEO_DISPLAY_SYMBOL_ONLY 2
+
/* some positions in the video tape control window */
#define VIDEO_DISPLAY1_XPOS 5
#define VIDEO_DISPLAY1_YPOS 5
#define VIDEO_PLAY_LABEL_YPOS (VIDEO_DISPLAY2_YPOS)
#define VIDEO_PLAY_LABEL_XSIZE 22
#define VIDEO_PLAY_LABEL_YSIZE 12
-#define VIDEO_PLAY_SYMBOL_XPOS (VIDEO_DISPLAY2_XPOS+50)
+#define VIDEO_PLAY_SYMBOL_XPOS (VIDEO_DISPLAY2_XPOS+52)
#define VIDEO_PLAY_SYMBOL_YPOS (VIDEO_DISPLAY2_YPOS)
-#define VIDEO_PLAY_SYMBOL_XSIZE 13
+#define VIDEO_PLAY_SYMBOL_XSIZE 11
#define VIDEO_PLAY_SYMBOL_YSIZE 13
#define VIDEO_PAUSE_LABEL_XPOS (VIDEO_DISPLAY2_XPOS)
#define VIDEO_PAUSE_LABEL_YPOS (VIDEO_DISPLAY2_YPOS+20)
#define VIDEO_PAUSE_LABEL_YSIZE 8
#define VIDEO_PAUSE_SYMBOL_XPOS (VIDEO_DISPLAY2_XPOS+35)
#define VIDEO_PAUSE_SYMBOL_YPOS (VIDEO_DISPLAY2_YPOS)
-#define VIDEO_PAUSE_SYMBOL_XSIZE 13
+#define VIDEO_PAUSE_SYMBOL_XSIZE 17
#define VIDEO_PAUSE_SYMBOL_YSIZE 13
#define VIDEO_TIME_XPOS (VIDEO_DISPLAY2_XPOS+38)
#define VIDEO_TIME_YPOS (VIDEO_DISPLAY2_YPOS+14)
#define VIDEO_TIME_XSIZE 50
#define VIDEO_TIME_YSIZE 16
+/* special */
+#define VIDEO_PBEND_LABEL_XPOS 6
+#define VIDEO_PBEND_LABEL_YPOS 220
+#define VIDEO_PBEND_LABEL_XSIZE 35
+#define VIDEO_PBEND_LABEL_YSIZE 30
+
#define ON_VIDEO_BUTTON(x,y) ((x)>=(VX+VIDEO_CONTROL_XPOS) && \
(x)< (VX+VIDEO_CONTROL_XPOS + \
VIDEO_CONTROL_XSIZE) && \
#define VIDEO_PRESS_EJECT_OFF (1L<<19)
#define VIDEO_PRESS_EJECT (VIDEO_PRESS_EJECT_OFF | VIDEO_PRESS_EJECT_ON)
+/* special */
+#define VIDEO_STATE_FFWD_OFF ((1L<<20) | VIDEO_STATE_PAUSE_OFF)
+#define VIDEO_STATE_FFWD_ON (1L<<21)
+#define VIDEO_STATE_FFWD (VIDEO_STATE_FFWD_OFF | VIDEO_STATE_FFWD_ON)
+#define VIDEO_STATE_PBEND_OFF (1L<<22)
+#define VIDEO_STATE_PBEND_ON (1L<<23)
+#define VIDEO_STATE_PBEND (VIDEO_STATE_PBEND_OFF | VIDEO_STATE_PBEND_ON)
+
#define BUTTON_VIDEO_EJECT 1
#define BUTTON_VIDEO_STOP 2
#define BUTTON_VIDEO_PAUSE 3
#define VIDEO_STATE_OFF (VIDEO_STATE_PLAY_OFF | \
VIDEO_STATE_REC_OFF | \
VIDEO_STATE_PAUSE_OFF | \
+ VIDEO_STATE_FFWD_OFF | \
+ VIDEO_STATE_PBEND_OFF | \
VIDEO_STATE_DATE_OFF | \
VIDEO_STATE_TIME_OFF)
#define VIDEO_PRESS_OFF (VIDEO_PRESS_PLAY_OFF | \
#define VIDEO_STATE_ON (VIDEO_STATE_PLAY_ON | \
VIDEO_STATE_REC_ON | \
VIDEO_STATE_PAUSE_ON | \
+ VIDEO_STATE_FFWD_ON | \
+ VIDEO_STATE_PBEND_ON | \
VIDEO_STATE_DATE_ON | \
VIDEO_STATE_TIME_ON)
#define VIDEO_PRESS_ON (VIDEO_PRESS_PLAY_ON | \
#define SOUND_BUTTON_YSIZE 30
#define SOUND_CONTROL_XPOS 5
#define SOUND_CONTROL_YPOS 245
-#define SOUND_CONTROL_XSIZE 90
-#define SOUND_CONTROL_YSIZE (SOUND_BUTTON_YSIZE)
-#define SOUND_BUTTON_MUSIC_XPOS (SOUND_CONTROL_XPOS + 0 * SOUND_BUTTON_XSIZE)
-#define SOUND_BUTTON_LOOPS_XPOS (SOUND_CONTROL_XPOS + 1 * SOUND_BUTTON_XSIZE)
-#define SOUND_BUTTON_SOUND_XPOS (SOUND_CONTROL_XPOS + 2 * SOUND_BUTTON_XSIZE)
-#define SOUND_BUTTON_ANY_YPOS (SOUND_CONTROL_YPOS)
+#define SOUND_CONTROL_XSIZE (3*SOUND_BUTTON_XSIZE)
+#define SOUND_CONTROL_YSIZE (1*SOUND_BUTTON_YSIZE)
+#define SOUND_BUTTON_MUSIC_XPOS (SOUND_CONTROL_XPOS + 0 * SOUND_BUTTON_XSIZE)
+#define SOUND_BUTTON_LOOPS_XPOS (SOUND_CONTROL_XPOS + 1 * SOUND_BUTTON_XSIZE)
+#define SOUND_BUTTON_SIMPLE_XPOS (SOUND_CONTROL_XPOS + 2 * SOUND_BUTTON_XSIZE)
+#define SOUND_BUTTON_ANY_YPOS (SOUND_CONTROL_YPOS)
#define ON_SOUND_BUTTON(x,y) ((x)>=(DX+SOUND_CONTROL_XPOS) && \
(x)< (DX+SOUND_CONTROL_XPOS + \
/* values for sound control */
#define BUTTON_SOUND_MUSIC (1L<<0)
#define BUTTON_SOUND_LOOPS (1L<<1)
-#define BUTTON_SOUND_SOUND (1L<<2)
+#define BUTTON_SOUND_SIMPLE (1L<<2)
#define BUTTON_RELEASED 0
#define BUTTON_PRESSED (1L<<3)
#define BUTTON_OFF 0
#define BUTTON_ON (1L<<4)
-#define BUTTON_SOUND_MUSIC_OFF (BUTTON_SOUND_MUSIC | BUTTON_OFF)
-#define BUTTON_SOUND_LOOPS_OFF (BUTTON_SOUND_LOOPS | BUTTON_OFF)
-#define BUTTON_SOUND_SOUND_OFF (BUTTON_SOUND_SOUND | BUTTON_OFF)
-#define BUTTON_SOUND_MUSIC_ON (BUTTON_SOUND_MUSIC | BUTTON_ON)
-#define BUTTON_SOUND_LOOPS_ON (BUTTON_SOUND_LOOPS | BUTTON_ON)
-#define BUTTON_SOUND_SOUND_ON (BUTTON_SOUND_SOUND | BUTTON_ON)
+#define BUTTON_SOUND_MUSIC_OFF (BUTTON_SOUND_MUSIC | BUTTON_OFF)
+#define BUTTON_SOUND_LOOPS_OFF (BUTTON_SOUND_LOOPS | BUTTON_OFF)
+#define BUTTON_SOUND_SIMPLE_OFF (BUTTON_SOUND_SIMPLE | BUTTON_OFF)
+#define BUTTON_SOUND_MUSIC_ON (BUTTON_SOUND_MUSIC | BUTTON_ON)
+#define BUTTON_SOUND_LOOPS_ON (BUTTON_SOUND_LOOPS | BUTTON_ON)
+#define BUTTON_SOUND_SIMPLE_ON (BUTTON_SOUND_SIMPLE | BUTTON_ON)
/* some positions in the game control window */
#define GAME_BUTTON_YSIZE 30
#define GAME_CONTROL_XPOS 5
#define GAME_CONTROL_YPOS 215
-#define GAME_CONTROL_XSIZE 90
-#define GAME_CONTROL_YSIZE (GAME_BUTTON_YSIZE)
+#define GAME_CONTROL_XSIZE (3*GAME_BUTTON_XSIZE)
+#define GAME_CONTROL_YSIZE (1*GAME_BUTTON_YSIZE)
#define GAME_BUTTON_STOP_XPOS (GAME_CONTROL_XPOS + 0 * GAME_BUTTON_XSIZE)
#define GAME_BUTTON_PAUSE_XPOS (GAME_CONTROL_XPOS + 1 * GAME_BUTTON_XSIZE)
#define GAME_BUTTON_PLAY_XPOS (GAME_CONTROL_XPOS + 2 * GAME_BUTTON_XSIZE)
#define BUTTON_GAME_PAUSE (1L<<1)
#define BUTTON_GAME_PLAY (1L<<2)
-
/* some positions in the asking window */
#define OK_BUTTON_XPOS 2
#define OK_BUTTON_YPOS 250
#define CONFIRM_BUTTON_XSIZE 96
#define CONFIRM_BUTTON_YSIZE OK_BUTTON_YSIZE
-#define ON_CHOOSE_BUTTON(x,y) (((x)>=(DX+OK_BUTTON_XPOS) && \
+#define ON_YESNO_BUTTON(x,y) (((x)>=(DX+OK_BUTTON_XPOS) && \
(x)< (DX+OK_BUTTON_XPOS + \
OK_BUTTON_XSIZE) && \
(y)>=(DY+OK_BUTTON_YPOS) && \
(y)>=(DY+CONFIRM_BUTTON_YPOS) && \
(y)< (DY+CONFIRM_BUTTON_YPOS + \
CONFIRM_BUTTON_YSIZE)))
-#define CHOOSE_BUTTON(x) (((x)-(DX+OK_BUTTON_XPOS))/OK_BUTTON_XSIZE)
+#define YESNO_BUTTON(x) (((x)-(DX+OK_BUTTON_XPOS))/OK_BUTTON_XSIZE)
/* values for asking control */
#define BUTTON_OK (1L<<0)
#define BUTTON_NO (1L<<1)
#define BUTTON_CONFIRM (1L<<2)
+/* some positions in the choose player window */
+
+#define PLAYER_BUTTON_XSIZE 30
+#define PLAYER_BUTTON_YSIZE 30
+#define PLAYER_BUTTON_GFX_XPOS 5
+#define PLAYER_BUTTON_GFX_YPOS (215-30)
+#define PLAYER_CONTROL_XPOS (5 + PLAYER_BUTTON_XSIZE/2)
+#define PLAYER_CONTROL_YPOS (215 - PLAYER_BUTTON_YSIZE/2)
+#define PLAYER_CONTROL_XSIZE (2*PLAYER_BUTTON_XSIZE)
+#define PLAYER_CONTROL_YSIZE (2*PLAYER_BUTTON_YSIZE)
+#define PLAYER_BUTTON_1_XPOS (PLAYER_CONTROL_XPOS + 0 * PLAYER_BUTTON_XSIZE)
+#define PLAYER_BUTTON_2_XPOS (PLAYER_CONTROL_XPOS + 1 * PLAYER_BUTTON_XSIZE)
+#define PLAYER_BUTTON_3_XPOS (PLAYER_CONTROL_XPOS + 0 * PLAYER_BUTTON_XSIZE)
+#define PLAYER_BUTTON_4_XPOS (PLAYER_CONTROL_XPOS + 1 * PLAYER_BUTTON_XSIZE)
+#define PLAYER_BUTTON_1_YPOS (PLAYER_CONTROL_YPOS + 0 * PLAYER_BUTTON_YSIZE)
+#define PLAYER_BUTTON_2_YPOS (PLAYER_CONTROL_YPOS + 0 * PLAYER_BUTTON_YSIZE)
+#define PLAYER_BUTTON_3_YPOS (PLAYER_CONTROL_YPOS + 1 * PLAYER_BUTTON_YSIZE)
+#define PLAYER_BUTTON_4_YPOS (PLAYER_CONTROL_YPOS + 1 * PLAYER_BUTTON_YSIZE)
+
+#define ON_PLAYER_BUTTON(x,y) ((x)>=(DX+PLAYER_CONTROL_XPOS) && \
+ (x)< (DX+PLAYER_CONTROL_XPOS + \
+ PLAYER_CONTROL_XSIZE) && \
+ (y)>=(DY+PLAYER_CONTROL_YPOS) && \
+ (y)< (DY+PLAYER_CONTROL_YPOS + \
+ PLAYER_CONTROL_YSIZE))
+#define PLAYER_BUTTON(x,y) ((((x)-(DX+PLAYER_CONTROL_XPOS)) / \
+ PLAYER_BUTTON_XSIZE) + 2 * \
+ (((y)-(DY+PLAYER_CONTROL_YPOS)) / \
+ PLAYER_BUTTON_YSIZE))
+
+/* values for choose player control */
+#define BUTTON_PLAYER_1 (1L<<10)
+#define BUTTON_PLAYER_2 (1L<<11)
+#define BUTTON_PLAYER_3 (1L<<12)
+#define BUTTON_PLAYER_4 (1L<<13)
+
/* some positions in the editor control window */
#define ED_BUTTON_EUP_XPOS 35
#define ED_BUTTON_ELEM 2
+/* for DrawPlayerButton() */
+
+#define DB_INIT 0
+#define DB_NORMAL 1
+
void DrawVideoDisplay(unsigned long, unsigned long);
void DrawCompleteVideoDisplay(void);
void DrawSoundDisplay(unsigned long);
void DrawGameButton(unsigned long);
-void DrawChooseButton(unsigned long);
-void DrawConfirmButton(unsigned long);
+void DrawYesNoButton(unsigned long, int);
+void DrawConfirmButton(unsigned long, int);
+void DrawPlayerButton(unsigned long, int);
void DrawEditButton(unsigned long state);
void DrawCtrlButton(unsigned long state);
void DrawElemButton(int, int);
int CheckVideoButtons(int, int, int);
int CheckSoundButtons(int, int, int);
int CheckGameButtons(int, int, int);
-int CheckChooseButtons(int, int, int);
+int CheckYesNoButtons(int, int, int);
int CheckConfirmButton(int, int, int);
+int CheckPlayerButtons(int, int, int);
int CheckEditButtons(int, int, int);
int CheckCtrlButtons(int, int, int);
int CheckElemButtons(int, int, int);