-/***********************************************************
-* Rocks'n'Diamonds -- McDuffin Strikes Back! *
-*----------------------------------------------------------*
-* (c) 1995-2006 Artsoft Entertainment *
-* Holger Schemel *
-* Detmolder Strasse 189 *
-* 33604 Bielefeld *
-* Germany *
-* e-mail: info@artsoft.org *
-*----------------------------------------------------------*
-* main.h *
-***********************************************************/
+// ============================================================================
+// Rocks'n'Diamonds - McDuffin Strikes Back!
+// ----------------------------------------------------------------------------
+// (c) 1995-2014 by Artsoft Entertainment
+// Holger Schemel
+// info@artsoft.org
+// http://www.artsoft.org/
+// ----------------------------------------------------------------------------
+// main.h
+// ============================================================================
#ifndef MAIN_H
#define MAIN_H
#include "conf_mus.h" /* include auto-generated data structure definitions */
-#define NEW_TILESIZE 1
-#define NEW_SCROLL 1
-
#define IMG_UNDEFINED (-1)
#define IMG_EMPTY IMG_EMPTY_SPACE
#define IMG_SP_EMPTY IMG_EMPTY_SPACE
#define SND_UNDEFINED (-1)
#define MUS_UNDEFINED (-1)
-#if 0
-#define WIN_XSIZE 672
-#define WIN_YSIZE 560
-#endif
-
#define DEFAULT_FULLSCREEN_MODE "800x600"
-#if 0
-#define SCR_FIELDX 17
-#define SCR_FIELDY 17
-#endif
+#define WIN_XSIZE_DEFAULT 672
+#define WIN_YSIZE_DEFAULT 560
+
+#define SCR_FIELDX_DEFAULT 17
+#define SCR_FIELDY_DEFAULT 17
+
+#define SXSIZE_DEFAULT (SCR_FIELDX_DEFAULT * TILEX)
+#define SYSIZE_DEFAULT (SCR_FIELDY_DEFAULT * TILEY)
+
#define MAX_BUF_XSIZE (SCR_FIELDX + 2)
#define MAX_BUF_YSIZE (SCR_FIELDY + 2)
#define MIN_LEV_FIELDX 3
#define IS_DC_STEELWALL_2(e) ((e) >= EL_DC_STEELWALL_2_LEFT && \
(e) <= EL_DC_STEELWALL_2_SINGLE)
-#if 1
-
-#if 1
#define GFX_ELEMENT(e) (element_info[e].gfx_element)
-#else
-#define GFX_ELEMENT(e) (element_info[e].gfx_element == \
- (element_info[e].use_gfx_element ? \
- element_info[e].gfx_element : e) ? \
- element_info[e].gfx_element : \
- element_info[e].gfx_element + \
- 0 * printf("::: %d: %d <-> %d\n", \
- e, \
- element_info[e].gfx_element, \
- element_info[e].use_gfx_element ? \
- element_info[e].gfx_element : e))
-#endif
-
-#else
-#define GFX_ELEMENT(e) (element_info[e].use_gfx_element ? \
- element_info[e].gfx_element : e)
-#endif
/* !!! CHECK THIS !!! */
#if 1
#define MAX_INITIAL_INVENTORY_SIZE 8
/* often used screen positions */
-#if 0
-#define SX 8
-#define SY 8
-#define REAL_SX (SX - 2)
-#define REAL_SY (SY - 2)
-#define DX 566
-#define DY 60
-#define VX DX
-#define VY 400
-#define EX DX
-#define EY (VY - 44)
-#endif
#define TILESIZE 32
#define TILEX TILESIZE
#define TILEY TILESIZE
#define MICRO_TILEY MICRO_TILESIZE
#define MIDPOSX (SCR_FIELDX / 2)
#define MIDPOSY (SCR_FIELDY / 2)
-#if NEW_TILESIZE
-#if NEW_SCROLL
-#if 0
-#define SXSIZE (SCR_FIELDX * TILEX_VAR)
-#define SYSIZE (SCR_FIELDY * TILEY_VAR)
-#endif
#define FXSIZE ((2 + SCR_FIELDX + 2) * TILEX_VAR)
#define FYSIZE ((2 + SCR_FIELDY + 2) * TILEY_VAR)
-#else
-#if 0
-#define SXSIZE (SCR_FIELDX * TILEX_VAR)
-#define SYSIZE (SCR_FIELDY * TILEY_VAR)
-#endif
-#define FXSIZE ((SCR_FIELDX + 2) * TILEX_VAR)
-#define FYSIZE ((SCR_FIELDY + 2) * TILEY_VAR)
-#endif
-#else
-#if NEW_SCROLL
-#if 0
-#define SXSIZE (SCR_FIELDX * TILEX)
-#define SYSIZE (SCR_FIELDY * TILEY)
-#endif
-#define FXSIZE ((2 + SCR_FIELDX + 2) * TILEX)
-#define FYSIZE ((2 + SCR_FIELDY + 2) * TILEY)
-#else
-#if 0
-#define SXSIZE (SCR_FIELDX * TILEX)
-#define SYSIZE (SCR_FIELDY * TILEY)
-#endif
-#define FXSIZE ((SCR_FIELDX + 2) * TILEX)
-#define FYSIZE ((SCR_FIELDY + 2) * TILEY)
-#endif
-#endif
-#define DXSIZE 100
-#define DYSIZE 280
-#define VXSIZE DXSIZE
-#define VYSIZE 100
-#define EXSIZE DXSIZE
-#define EYSIZE (VYSIZE + 44)
-#if 0
-#define FULL_SXSIZE (2 + SXSIZE + 2)
-#define FULL_SYSIZE (2 + SYSIZE + 2)
-#endif
+
#define MICROLEVEL_XSIZE ((STD_LEV_FIELDX + 2) * MICRO_TILEX)
#define MICROLEVEL_YSIZE ((STD_LEV_FIELDY + 2) * MICRO_TILEY)
#define MICROLEVEL_XPOS (SX + (SXSIZE - MICROLEVEL_XSIZE) / 2)
#define NUM_SPECIAL_GFX_INFO_ARGS 8
/* these additional definitions are currently only used for draw offsets */
+/* (must match SETUP_MODE_* values as defined in src/screens.c) */
+/* (should also match corresponding entries in src/conf_gfx.c) */
#define GFX_SPECIAL_ARG_SETUP_MAIN 0
#define GFX_SPECIAL_ARG_SETUP_GAME 1
#define GFX_SPECIAL_ARG_SETUP_EDITOR 2
#define GFX_SPECIAL_ARG_SETUP_SOUND 4
#define GFX_SPECIAL_ARG_SETUP_ARTWORK 5
#define GFX_SPECIAL_ARG_SETUP_INPUT 6
-#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS 7
-#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_1 8
-#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_2 9
-#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_3 10
-#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_4 11
-#define GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK 12
-#define GFX_SPECIAL_ARG_SETUP_CHOOSE_OTHER 13
+#define GFX_SPECIAL_ARG_SETUP_TOUCH 7
+#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS 8
+#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_1 9
+#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_2 10
+#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_3 11
+#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_4 12
+#define GFX_SPECIAL_ARG_SETUP_SHORTCUTS_5 13
+#define GFX_SPECIAL_ARG_SETUP_CHOOSE_ARTWORK 14
+#define GFX_SPECIAL_ARG_SETUP_CHOOSE_OTHER 15
-#define NUM_SPECIAL_GFX_SETUP_ARGS 14
+#define NUM_SPECIAL_GFX_SETUP_ARGS 16
/* values for image configuration suffixes */
#define GFX_ARG_POST_DELAY_RANDOM 35
#define GFX_ARG_NAME 36
#define GFX_ARG_SCALE_UP_FACTOR 37
-#define GFX_ARG_CLONE_FROM 38
-#define GFX_ARG_FADE_MODE 39
-#define GFX_ARG_FADE_DELAY 40
-#define GFX_ARG_POST_DELAY 41
-#define GFX_ARG_AUTO_DELAY 42
-#define GFX_ARG_ALIGN 43
-#define GFX_ARG_VALIGN 44
-#define GFX_ARG_SORT_PRIORITY 45
-#define GFX_ARG_CLASS 46
-#define GFX_ARG_STYLE 47
-#define GFX_ARG_ACTIVE_XOFFSET 48
-#define GFX_ARG_ACTIVE_YOFFSET 49
-#define GFX_ARG_PRESSED_XOFFSET 50
-#define GFX_ARG_PRESSED_YOFFSET 51
-
-#define NUM_GFX_ARGS 52
+#define GFX_ARG_TILE_SIZE 38
+#define GFX_ARG_CLONE_FROM 39
+#define GFX_ARG_FADE_MODE 40
+#define GFX_ARG_FADE_DELAY 41
+#define GFX_ARG_POST_DELAY 42
+#define GFX_ARG_AUTO_DELAY 43
+#define GFX_ARG_ALIGN 44
+#define GFX_ARG_VALIGN 45
+#define GFX_ARG_SORT_PRIORITY 46
+#define GFX_ARG_CLASS 47
+#define GFX_ARG_STYLE 48
+#define GFX_ARG_ACTIVE_XOFFSET 49
+#define GFX_ARG_ACTIVE_YOFFSET 50
+#define GFX_ARG_PRESSED_XOFFSET 51
+#define GFX_ARG_PRESSED_YOFFSET 52
+
+#define NUM_GFX_ARGS 53
/* values for sound configuration suffixes */
#define FONT_ENVELOPE_2 19
#define FONT_ENVELOPE_3 20
#define FONT_ENVELOPE_4 21
-#define FONT_INPUT_1_ACTIVE 22
-#define FONT_INPUT_2_ACTIVE 23
-#define FONT_INPUT_1 24
-#define FONT_INPUT_2 25
-#define FONT_OPTION_OFF 26
-#define FONT_OPTION_ON 27
-#define FONT_VALUE_1 28
-#define FONT_VALUE_2 29
-#define FONT_VALUE_OLD 30
-#define FONT_LEVEL_NUMBER_ACTIVE 31
-#define FONT_LEVEL_NUMBER 32
-#define FONT_TAPE_RECORDER 33
-#define FONT_GAME_INFO 34
-#define FONT_INFO_ELEMENTS 35
-#define FONT_INFO_LEVELSET 36
-
-#define NUM_FONTS 37
+#define FONT_REQUEST 22
+#define FONT_INPUT_1_ACTIVE 23
+#define FONT_INPUT_2_ACTIVE 24
+#define FONT_INPUT_1 25
+#define FONT_INPUT_2 26
+#define FONT_OPTION_OFF 27
+#define FONT_OPTION_ON 28
+#define FONT_VALUE_1 29
+#define FONT_VALUE_2 30
+#define FONT_VALUE_OLD 31
+#define FONT_LEVEL_NUMBER_ACTIVE 32
+#define FONT_LEVEL_NUMBER 33
+#define FONT_TAPE_RECORDER 34
+#define FONT_GAME_INFO 35
+#define FONT_INFO_ELEMENTS 36
+#define FONT_INFO_LEVELSET 37
+
+#define NUM_FONTS 38
#define NUM_INITIAL_FONTS 4
-#if 0
-#define FONT_ACTIVE(f) \
- ((f) == FONT_MENU_1 ? FONT_MENU_1_ACTIVE : \
- (f) == FONT_MENU_2 ? FONT_MENU_2_ACTIVE : \
- (f) == FONT_TEXT_1 ? FONT_TEXT_1_ACTIVE : \
- (f) == FONT_TEXT_2 ? FONT_TEXT_2_ACTIVE : \
- (f) == FONT_TEXT_3 ? FONT_TEXT_3_ACTIVE : \
- (f) == FONT_TEXT_4 ? FONT_TEXT_4_ACTIVE : \
- (f) == FONT_INPUT_1 ? FONT_INPUT_1_ACTIVE : \
- (f) == FONT_INPUT_2 ? FONT_INPUT_2_ACTIVE : \
- (f) == FONT_LEVEL_NUMBER ? FONT_LEVEL_NUMBER_ACTIVE : \
- (f))
-#endif
-
/* values for game_status (must match special image configuration suffixes) */
#define GAME_MODE_DEFAULT 0
#define GAME_MODE_LOADING 1
/* program information and versioning definitions */
-#define PROGRAM_VERSION_MAJOR 3
-#define PROGRAM_VERSION_MINOR 3
-#define PROGRAM_VERSION_PATCH 1
-#define PROGRAM_VERSION_BUILD 1
+#define PROGRAM_VERSION_MAJOR 4
+#define PROGRAM_VERSION_MINOR 0
+#define PROGRAM_VERSION_PATCH 0
+#define PROGRAM_VERSION_BUILD 0
#define PROGRAM_TITLE_STRING "Rocks'n'Diamonds"
#define PROGRAM_AUTHOR_STRING "Holger Schemel"
-#define PROGRAM_COPYRIGHT_STRING "Copyright ©1995-2010 by Holger Schemel"
#define PROGRAM_EMAIL_STRING "info@artsoft.org"
#define PROGRAM_WEBSITE_STRING "http://www.artsoft.org/"
-#define PROGRAM_GAME_BY_STRING "A Game by Artsoft Entertainment"
-#define PROGRAM_UNIX_DATADIR_STRING ".rocksndiamonds"
-
-#if defined(CREATE_SPECIAL_EDITION_RND_JUE)
-#undef PROGRAM_TITLE_STRING
-#define PROGRAM_TITLE_STRING "R'n'D jue"
-#undef PROGRAM_UNIX_DATADIR_STRING
-#define PROGRAM_UNIX_DATADIR_STRING ".rnd_jue"
-#endif
+#define PROGRAM_COPYRIGHT_STRING "Copyright \xa9""1995-2015 by Holger Schemel"
+#define PROGRAM_COMPANY_STRING "A Game by Artsoft Entertainment"
+
+#define PROGRAM_ICON_FILENAME "RocksIcon32x32.png"
-#define ICON_TITLE_STRING PROGRAM_TITLE_STRING
#define COOKIE_PREFIX "ROCKSNDIAMONDS"
-#define FILENAME_PREFIX "Rocks"
-
-#define USERDATA_DIRECTORY_WIN32 PROGRAM_TITLE_STRING
-#define USERDATA_DIRECTORY_MACOSX PROGRAM_TITLE_STRING
-#define USERDATA_DIRECTORY_UNIX PROGRAM_UNIX_DATADIR_STRING
-#define USERDATA_DIRECTORY_DOS "userdata"
-
-#if defined(PLATFORM_WIN32)
-#define USERDATA_DIRECTORY USERDATA_DIRECTORY_WIN32
-#elif defined(PLATFORM_MACOSX)
-#define USERDATA_DIRECTORY USERDATA_DIRECTORY_MACOSX
-#elif defined(PLATFORM_UNIX)
-#define USERDATA_DIRECTORY USERDATA_DIRECTORY_UNIX
-#else
-#define USERDATA_DIRECTORY USERDATA_DIRECTORY_DOS
-#endif
-#define X11_ICON_FILENAME "rocks_icon.xbm"
-#define X11_ICONMASK_FILENAME "rocks_iconmask.xbm"
-#define SDL_ICON_FILENAME "rocks_icon_32x32.pcx"
-#define MSDOS_POINTER_FILENAME "mouse.pcx"
+#define USERDATA_DIRECTORY_OTHER "userdata"
/* file version numbers for resource files (levels, tapes, score, setup, etc.)
** currently supported/known file version numbers:
boolean draw_masked_when_fading;
};
+struct RequestButtonInfo
+{
+ struct TextPosInfo yes;
+ struct TextPosInfo no;
+ struct TextPosInfo confirm;
+ struct TextPosInfo player_1;
+ struct TextPosInfo player_2;
+ struct TextPosInfo player_3;
+ struct TextPosInfo player_4;
+};
+
struct MenuMainButtonInfo
{
struct MenuPosInfo name;
int scrollbar_xoffset;
int list_size[NUM_SPECIAL_GFX_ARGS];
+ int list_size_info[NUM_SPECIAL_GFX_INFO_ARGS];
struct TitleFadingInfo enter_menu;
struct TitleFadingInfo leave_menu;
struct DoorInfo
{
+ struct DoorPartPosInfo part_1;
+ struct DoorPartPosInfo part_2;
+ struct DoorPartPosInfo part_3;
+ struct DoorPartPosInfo part_4;
+ struct DoorPartPosInfo part_5;
+ struct DoorPartPosInfo part_6;
+ struct DoorPartPosInfo part_7;
+ struct DoorPartPosInfo part_8;
+
+ struct DoorPartPosInfo panel;
+
int width;
int height;
int step_offset;
int anim_mode;
};
+struct RequestInfo
+{
+ struct RequestButtonInfo button;
+ int x, y;
+ int width, height;
+ int border_size;
+ int line_spacing;
+ int step_offset;
+ int step_delay;
+ int anim_mode;
+ int align;
+ int valign;
+ boolean autowrap;
+ boolean centered;
+ boolean wrap_single_words;
+};
+
struct PreviewInfo
{
int x, y;
int anim_mode;
};
+struct EditorTabsInfo
+{
+ int x;
+ int y;
+ int yoffset2;
+ int width;
+ int height;
+ int draw_xoffset;
+ int draw_yoffset;
+};
+
+struct EditorSettingsInfo
+{
+ struct MenuPosInfo headline;
+
+ struct XY element_graphic;
+ struct XY element_name;
+
+ struct EditorTabsInfo tabs;
+};
+
+struct EditorGadgetInfo
+{
+ int normal_spacing;
+ int small_spacing;
+ int tiny_spacing;
+ int line_spacing;
+ int text_spacing;
+ int tab_spacing;
+
+ struct Rect separator_line;
+};
+
+struct EditorButtonInfo
+{
+ struct XY prev_level;
+ struct XY next_level;
+
+ struct XY properties;
+
+ struct XY draw_single;
+ struct XY draw_connected;
+ struct XY draw_line;
+ struct XY draw_arc;
+ struct XY draw_rectangle;
+ struct XY draw_filled_box;
+ struct XY rotate_up;
+ struct XY draw_text;
+ struct XY flood_fill;
+ struct XY rotate_left;
+ struct XY zoom_level;
+ struct XY rotate_right;
+ struct XY draw_random;
+ struct XY grab_brush;
+ struct XY rotate_down;
+ struct XY pick_element;
+
+ struct XY ce_copy_from;
+ struct XY ce_copy_to;
+ struct XY ce_swap;
+ struct XY ce_copy;
+ struct XY ce_paste;
+
+ struct XY undo;
+ struct XY conf;
+ struct XY save;
+ struct XY clear;
+ struct XY test;
+ struct XY exit;
+};
+
+struct EditorInputInfo
+{
+ struct XY level_number;
+};
+
+struct EditorPaletteElementInfo
+{
+ int x, y;
+ int tile_size;
+};
+
+struct EditorPaletteInfo
+{
+ int x, y;
+ int cols, rows;
+ int tile_size;
+
+ struct EditorPaletteElementInfo element_left;
+ struct EditorPaletteElementInfo element_middle;
+ struct EditorPaletteElementInfo element_right;
+};
+
+struct EditorInfo
+{
+ struct EditorSettingsInfo settings;
+ struct EditorGadgetInfo gadget;
+ struct EditorButtonInfo button;
+ struct EditorInputInfo input;
+ struct EditorPaletteInfo palette;
+};
+
struct ViewportInfo
{
struct RectWithBorder window;
int num_toons;
float frames_per_second;
- boolean fps_slowdown;
- int fps_slowdown_factor;
/* global values for fading screens and masking borders */
int border_status;
-#if 0
- int fading_status;
- int fading_type;
-#endif
boolean use_envelope_request;
};
struct GraphicInfo
{
- Bitmap *bitmap;
+ Bitmap **bitmaps; /* bitmaps in all required sizes */
+ Bitmap *bitmap; /* bitmap in default size */
+
int src_image_width; /* scaled bitmap size, but w/o small images */
int src_image_height; /* scaled bitmap size, but w/o small images */
int border_size; /* border size for "crumbled" graphics */
int scale_up_factor; /* optional factor for scaling image up */
+ int tile_size; /* optional explicitly defined tile size */
int clone_from; /* graphic for cloning *all* settings */
int pressed_yoffset;
boolean use_image_size; /* use image size as default width and height */
-
-#if defined(TARGET_X11_NATIVE_PERFORMANCE_WORKAROUND)
- Pixmap clip_mask; /* single-graphic-only clip mask for X11 */
- GC clip_gc; /* single-graphic-only clip gc for X11 */
-#endif
};
struct SoundInfo
extern Bitmap *bitmap_db_cross;
extern Bitmap *bitmap_db_field;
extern Bitmap *bitmap_db_panel;
-extern Bitmap *bitmap_db_door;
+extern Bitmap *bitmap_db_door_1;
+extern Bitmap *bitmap_db_door_2;
extern Bitmap *bitmap_db_toons;
-extern Pixmap tile_clipmask[];
extern DrawBuffer *fieldbuffer;
extern DrawBuffer *drawto_field;
extern int key_joystick_mapping;
-#if 1
-#if NEW_SCROLL
-extern boolean redraw[2 + MAX_LEV_FIELDX + 2][2 + MAX_LEV_FIELDY + 2];
-#else
-extern boolean redraw[MAX_LEV_FIELDX + 2][MAX_LEV_FIELDY + 2];
-#endif
-#else
-extern boolean redraw[MAX_BUF_XSIZE][MAX_BUF_YSIZE];
-#endif
-extern int redraw_x1, redraw_y1;
-
extern short Feld[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short MovPos[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern short MovDir[MAX_LEV_FIELDX][MAX_LEV_FIELDY];
extern int WIN_XSIZE, WIN_YSIZE;
extern int SCR_FIELDX, SCR_FIELDY;
-extern int SX, SY;
extern int REAL_SX, REAL_SY;
+extern int SX, SY;
extern int DX, DY;
extern int VX, VY;
extern int EX, EY;
extern int dDX, dDY;
-extern int SXSIZE, SYSIZE;
extern int FULL_SXSIZE, FULL_SYSIZE;
+extern int SXSIZE, SYSIZE;
+extern int DXSIZE, DYSIZE;
+extern int VXSIZE, VYSIZE;
+extern int EXSIZE, EYSIZE;
extern int TILESIZE_VAR;
+extern int FADE_SX, FADE_SY;
+extern int FADE_SXSIZE, FADE_SYSIZE;
+
extern int FX, FY;
extern int ScrollStepSize;
extern int ScreenMovDir, ScreenMovPos, ScreenGfxPos;
extern struct InitInfo init, init_last;
extern struct MenuInfo menu;
extern struct DoorInfo door_1, door_2;
+extern struct RequestInfo request;
extern struct PreviewInfo preview;
+extern struct EditorInfo editor;
extern struct ElementInfo element_info[];
extern struct ElementNameInfo element_name_info[];
extern struct ElementActionInfo element_action_info[];