#define ED_COUNT_ELEM_SCORE_XPOS ED_SETTINGS_XPOS
#define ED_COUNT_ELEM_SCORE_YPOS (14 * MINI_TILEY)
#define ED_COUNT_ELEM_CONTENT_XPOS ED_SETTINGS_XPOS
-#define ED_COUNT_ELEM_CONTENT_YPOS (17 * MINI_TILEY)
+#define ED_COUNT_ELEM_CONTENT_YPOS (19 * MINI_TILEY)
#define ED_COUNTER_YSTART (ED_SETTINGS_YPOS + 2 * TILEY)
#define ED_COUNTER_YDISTANCE (3 * MINI_TILEY)
/* values for element content drawing areas */
#define ED_AREA_ELEM_CONTENT_XPOS ( 2 * MINI_TILEX)
-#define ED_AREA_ELEM_CONTENT_YPOS (20 * MINI_TILEY)
+#define ED_AREA_ELEM_CONTENT_YPOS (22 * MINI_TILEY)
/* values for random placement background drawing area */
#define ED_AREA_RANDOM_BACKGROUND_XPOS (29 * MINI_TILEX)
#define ED_CHECKBUTTON_XSIZE ED_BUTTON_COUNT_XSIZE
#define ED_CHECKBUTTON_YSIZE ED_BUTTON_COUNT_YSIZE
#define ED_CHECKBUTTON_UNCHECKED_XPOS ED_BUTTON_MINUS_XPOS
-#define ED_CHECKBUTTON_UNCHECKED_YPOS (ED_BUTTON_MINUS_YPOS + 22)
#define ED_CHECKBUTTON_CHECKED_XPOS ED_BUTTON_PLUS_XPOS
-#define ED_CHECKBUTTON_CHECKED_YPOS (ED_BUTTON_PLUS_YPOS + 22)
+#define ED_CHECKBUTTON_YPOS (ED_BUTTON_MINUS_YPOS + 22)
+#define ED_STICKYBUTTON_YPOS (ED_BUTTON_MINUS_YPOS + 88)
#define GADGET_ID_NONE -1
#define GADGET_ID_RANDOM_QUANTITY 107
#define GADGET_ID_RANDOM_RESTRICTED 108
#define GADGET_ID_DOUBLE_SPEED 109
+#define GADGET_ID_STICK_ELEMENT 110
/* another drawing area for random placement */
-#define GADGET_ID_RANDOM_BACKGROUND 110
+#define GADGET_ID_RANDOM_BACKGROUND 111
-#define NUM_EDITOR_GADGETS 111
+#define NUM_EDITOR_GADGETS 112
/* radio button numbers */
#define RADIO_NR_NONE 0
#define ED_COUNTER_ID_LEVEL_TIMESCORE 6
#define ED_COUNTER_ID_LEVEL_RANDOM 7
+#define ED_NUM_COUNTERBUTTONS 8
+
#define ED_COUNTER_ID_LEVEL_FIRST ED_COUNTER_ID_LEVEL_XSIZE
#define ED_COUNTER_ID_LEVEL_LAST ED_COUNTER_ID_LEVEL_RANDOM
-#define ED_NUM_COUNTERBUTTONS 8
-
/* values for scrollbutton gadgets */
-#define ED_SCROLLBUTTON_AREA_UP 0
-#define ED_SCROLLBUTTON_AREA_DOWN 1
-#define ED_SCROLLBUTTON_AREA_LEFT 2
-#define ED_SCROLLBUTTON_AREA_RIGHT 3
-#define ED_SCROLLBUTTON_LIST_UP 4
-#define ED_SCROLLBUTTON_LIST_DOWN 5
+#define ED_SCROLLBUTTON_ID_AREA_UP 0
+#define ED_SCROLLBUTTON_ID_AREA_DOWN 1
+#define ED_SCROLLBUTTON_ID_AREA_LEFT 2
+#define ED_SCROLLBUTTON_ID_AREA_RIGHT 3
+#define ED_SCROLLBUTTON_ID_LIST_UP 4
+#define ED_SCROLLBUTTON_ID_LIST_DOWN 5
#define ED_NUM_SCROLLBUTTONS 6
/* values for scrollbar gadgets */
-#define ED_SCROLLBAR_HORIZONTAL 0
-#define ED_SCROLLBAR_VERTICAL 1
+#define ED_SCROLLBAR_ID_HORIZONTAL 0
+#define ED_SCROLLBAR_ID_VERTICAL 1
#define ED_NUM_SCROLLBARS 2
#define ED_TEXTINPUT_ID_LEVEL_NAME 0
#define ED_TEXTINPUT_ID_LEVEL_AUTHOR 1
+#define ED_NUM_TEXTINPUT 2
+
#define ED_TEXTINPUT_ID_LEVEL_FIRST ED_TEXTINPUT_ID_LEVEL_NAME
#define ED_TEXTINPUT_ID_LEVEL_LAST ED_TEXTINPUT_ID_LEVEL_AUTHOR
-#define ED_NUM_TEXTINPUT 2
-
/* values for checkbutton gadgets */
-#define ED_CHECKBUTTON_DOUBLE_SPEED 0
-#define ED_CHECKBUTTON_RANDOM_RESTRICTED 1
+#define ED_CHECKBUTTON_ID_DOUBLE_SPEED 0
+#define ED_CHECKBUTTON_ID_RANDOM_RESTRICTED 1
+#define ED_CHECKBUTTON_ID_STICK_ELEMENT 2
+
+#define ED_NUM_CHECKBUTTONS 3
-#define ED_NUM_CHECKBUTTONS 2
+#define ED_CHECKBUTTON_ID_LEVEL_FIRST ED_CHECKBUTTON_ID_DOUBLE_SPEED
+#define ED_CHECKBUTTON_ID_LEVEL_LAST ED_CHECKBUTTON_ID_RANDOM_RESTRICTED
/* values for radiobutton gadgets */
-#define ED_RADIOBUTTON_PERCENTAGE 0
-#define ED_RADIOBUTTON_QUANTITY 1
+#define ED_RADIOBUTTON_ID_PERCENTAGE 0
+#define ED_RADIOBUTTON_ID_QUANTITY 1
#define ED_NUM_RADIOBUTTONS 2
+#define ED_RADIOBUTTON_ID_LEVEL_FIRST ED_RADIOBUTTON_ID_PERCENTAGE
+#define ED_RADIOBUTTON_ID_LEVEL_LAST ED_RADIOBUTTON_ID_QUANTITY
+
/* values for CopyLevelToUndoBuffer() */
#define UNDO_IMMEDIATE 0
#define UNDO_ACCUMULATE 1
static int random_placement_method = RANDOM_USE_QUANTITY;
static int random_placement_background_element = EL_ERDREICH;
static boolean random_placement_background_restricted = FALSE;
+static boolean stick_element_properties_window = FALSE;
static struct
{
GADGET_ID_RANDOM_RESTRICTED,
&random_placement_background_restricted,
"restrict random placement to", "set random placement restriction"
+ },
+ {
+ ED_SETTINGS_XPOS, ED_COUNTER_YPOS(4),
+ GADGET_ID_STICK_ELEMENT,
+ &stick_element_properties_window,
+ "stick window to edit content", "stick window to edit content"
}
};
Pixmap gd_pixmap = pix[PIX_DOOR];
struct GadgetInfo *gi;
unsigned long event_mask;
- int gd_x1, gd_x2, gd_x3, gd_x4, gd_y1, gd_y2;
+ int gd_x1, gd_x2, gd_x3, gd_x4, gd_y;
boolean checked;
int i;
gd_x2 = DOOR_GFX_PAGEX3 + ED_CHECKBUTTON_UNCHECKED_XPOS;
gd_x3 = DOOR_GFX_PAGEX4 + ED_CHECKBUTTON_CHECKED_XPOS;
gd_x4 = DOOR_GFX_PAGEX3 + ED_CHECKBUTTON_CHECKED_XPOS;
- gd_y1 = DOOR_GFX_PAGEY1 + ED_CHECKBUTTON_UNCHECKED_YPOS;
- gd_y2 = DOOR_GFX_PAGEY1 + ED_CHECKBUTTON_CHECKED_YPOS;
+ gd_y = DOOR_GFX_PAGEY1 + ED_CHECKBUTTON_YPOS;
for (i=0; i<ED_NUM_RADIOBUTTONS; i++)
{
GDI_TYPE, GD_TYPE_RADIO_BUTTON,
GDI_RADIO_NR, radiobutton_info[i].radio_button_nr,
GDI_CHECKED, checked,
- GDI_DESIGN_UNPRESSED, gd_pixmap, gd_x1, gd_y1,
- GDI_DESIGN_PRESSED, gd_pixmap, gd_x2, gd_y1,
- GDI_ALT_DESIGN_UNPRESSED, gd_pixmap, gd_x3, gd_y2,
- GDI_ALT_DESIGN_PRESSED, gd_pixmap, gd_x4, gd_y2,
+ GDI_DESIGN_UNPRESSED, gd_pixmap, gd_x1, gd_y,
+ GDI_DESIGN_PRESSED, gd_pixmap, gd_x2, gd_y,
+ GDI_ALT_DESIGN_UNPRESSED, gd_pixmap, gd_x3, gd_y,
+ GDI_ALT_DESIGN_PRESSED, gd_pixmap, gd_x4, gd_y,
GDI_EVENT_MASK, event_mask,
GDI_CALLBACK_ACTION, HandleControlButtons,
GDI_END);
{
int id = checkbutton_info[i].gadget_id;
+ if (id == GADGET_ID_STICK_ELEMENT)
+ gd_y = DOOR_GFX_PAGEY1 + ED_STICKYBUTTON_YPOS;
+ else
+ gd_y = DOOR_GFX_PAGEY1 + ED_CHECKBUTTON_YPOS;
+
gi = CreateGadget(GDI_CUSTOM_ID, id,
GDI_INFO_TEXT, checkbutton_info[i].infotext,
GDI_X, SX + checkbutton_info[i].x,
GDI_HEIGHT, ED_CHECKBUTTON_YSIZE,
GDI_TYPE, GD_TYPE_CHECK_BUTTON,
GDI_CHECKED, *checkbutton_info[i].value,
- GDI_DESIGN_UNPRESSED, gd_pixmap, gd_x1, gd_y1,
- GDI_DESIGN_PRESSED, gd_pixmap, gd_x2, gd_y1,
- GDI_ALT_DESIGN_UNPRESSED, gd_pixmap, gd_x3, gd_y2,
- GDI_ALT_DESIGN_PRESSED, gd_pixmap, gd_x4, gd_y2,
+ GDI_DESIGN_UNPRESSED, gd_pixmap, gd_x1, gd_y,
+ GDI_DESIGN_PRESSED, gd_pixmap, gd_x2, gd_y,
+ GDI_ALT_DESIGN_UNPRESSED, gd_pixmap, gd_x3, gd_y,
+ GDI_ALT_DESIGN_PRESSED, gd_pixmap, gd_x4, gd_y,
GDI_EVENT_MASK, event_mask,
GDI_CALLBACK_ACTION, HandleControlButtons,
GDI_END);
for (i=0; i<ED_NUM_SCROLLBUTTONS; i++)
{
- if (((i == ED_SCROLLBUTTON_AREA_LEFT || i == ED_SCROLLBUTTON_AREA_RIGHT) &&
+ if (((i == ED_SCROLLBUTTON_ID_AREA_LEFT ||
+ i == ED_SCROLLBUTTON_ID_AREA_RIGHT) &&
no_horizontal_scrollbar) ||
- ((i == ED_SCROLLBUTTON_AREA_UP || i == ED_SCROLLBUTTON_AREA_DOWN) &&
+ ((i == ED_SCROLLBUTTON_ID_AREA_UP ||
+ i == ED_SCROLLBUTTON_ID_AREA_DOWN) &&
no_vertical_scrollbar))
continue;
for (i=0; i<ED_NUM_SCROLLBARS; i++)
{
- if ((i == ED_SCROLLBAR_HORIZONTAL && no_horizontal_scrollbar) ||
- (i == ED_SCROLLBAR_VERTICAL && no_vertical_scrollbar))
+ if ((i == ED_SCROLLBAR_ID_HORIZONTAL && no_horizontal_scrollbar) ||
+ (i == ED_SCROLLBAR_ID_VERTICAL && no_vertical_scrollbar))
continue;
MapGadget(level_editor_gadget[scrollbar_info[i].gadget_id]);
xoffset = (ed_fieldx == MAX_ED_FIELDX ? ED_SCROLLBUTTON_XSIZE : 0);
yoffset = (ed_fieldy == MAX_ED_FIELDY ? ED_SCROLLBUTTON_YSIZE : 0);
- x = SX + scrollbutton_info[ED_SCROLLBUTTON_AREA_RIGHT].x + xoffset;
- y = SX + scrollbutton_info[ED_SCROLLBUTTON_AREA_DOWN].y + yoffset;
+ x = SX + scrollbutton_info[ED_SCROLLBUTTON_ID_AREA_RIGHT].x + xoffset;
+ y = SX + scrollbutton_info[ED_SCROLLBUTTON_ID_AREA_DOWN].y + yoffset;
ModifyGadget(level_editor_gadget[GADGET_ID_SCROLL_RIGHT], GDI_X, x, GDI_END);
ModifyGadget(level_editor_gadget[GADGET_ID_SCROLL_DOWN], GDI_Y, y, GDI_END);
- width = scrollbar_info[ED_SCROLLBAR_HORIZONTAL].width + xoffset;
- height = scrollbar_info[ED_SCROLLBAR_VERTICAL].height + yoffset;
+ width = scrollbar_info[ED_SCROLLBAR_ID_HORIZONTAL].width + xoffset;
+ height = scrollbar_info[ED_SCROLLBAR_ID_VERTICAL].height + yoffset;
ModifyGadget(level_editor_gadget[GADGET_ID_SCROLL_HORIZONTAL],
GDI_WIDTH, width,
}
/* draw radiobutton gadgets */
- for (i=0; i<ED_NUM_RADIOBUTTONS; i++)
+ for (i=ED_RADIOBUTTON_ID_LEVEL_FIRST; i<=ED_RADIOBUTTON_ID_LEVEL_LAST; i++)
{
boolean checked =
(*radiobutton_info[i].value == radiobutton_info[i].checked_value);
}
/* draw checkbutton gadgets */
- for (i=0; i<ED_NUM_CHECKBUTTONS; i++)
+ for (i=ED_CHECKBUTTON_ID_LEVEL_FIRST; i<=ED_CHECKBUTTON_ID_LEVEL_LAST; i++)
{
x = checkbutton_info[i].x + xoffset_right2;
y = checkbutton_info[i].y + yoffset_right2;
/* copy border to the right location */
XCopyArea(display, drawto, drawto, gc,
- area_sx, area_sy, (5 * 4 + 1) * MINI_TILEX, 12 * MINI_TILEY,
+ area_sx, area_sy, (5 * 4 + 1) * MINI_TILEX, 11 * MINI_TILEY,
area_sx - MINI_TILEX/2, area_sy - MINI_TILEY/2);
DrawText(area_sx + (5 * 4 - 1) * MINI_TILEX, area_sy + 0 * MINI_TILEY + 1,
float percentage;
int xoffset_right = counter_xsize;
int yoffset_right = ED_BORDER_SIZE;
+ int xoffset_right2 = ED_CHECKBUTTON_XSIZE + 2 * ED_GADGET_DISTANCE;
+ int yoffset_right2 = ED_BORDER_SIZE;
int xstart = 2;
int ystart = 4;
int font_color = FC_GREEN;
if (HAS_CONTENT(properties_element))
{
+
+#if 1
+ /* draw stickybutton gadget */
+ i = ED_CHECKBUTTON_ID_STICK_ELEMENT;
+ x = checkbutton_info[i].x + xoffset_right2;
+ y = checkbutton_info[i].y + yoffset_right2;
+
+ DrawTextF(x, y, font_color, checkbutton_info[i].text);
+ ModifyGadget(level_editor_gadget[checkbutton_info[i].gadget_id],
+ GDI_CHECKED, *checkbutton_info[i].value, GDI_END);
+ MapCheckbuttonGadget(i);
+#endif
+
+
if (IS_AMOEBOID(properties_element))
DrawAmoebaContentArea();
else
break;
case GADGET_ID_RANDOM_PERCENTAGE:
- *radiobutton_info[ED_RADIOBUTTON_PERCENTAGE].value =
- radiobutton_info[ED_RADIOBUTTON_PERCENTAGE].checked_value;
+ *radiobutton_info[ED_RADIOBUTTON_ID_PERCENTAGE].value =
+ radiobutton_info[ED_RADIOBUTTON_ID_PERCENTAGE].checked_value;
break;
case GADGET_ID_RANDOM_QUANTITY:
- *radiobutton_info[ED_RADIOBUTTON_QUANTITY].value =
- radiobutton_info[ED_RADIOBUTTON_QUANTITY].checked_value;
+ *radiobutton_info[ED_RADIOBUTTON_ID_QUANTITY].value =
+ radiobutton_info[ED_RADIOBUTTON_ID_QUANTITY].checked_value;
break;
case GADGET_ID_RANDOM_RESTRICTED:
- *checkbutton_info[ED_CHECKBUTTON_RANDOM_RESTRICTED].value ^= TRUE;
+ *checkbutton_info[ED_CHECKBUTTON_ID_RANDOM_RESTRICTED].value ^= TRUE;
break;
case GADGET_ID_DOUBLE_SPEED:
- *checkbutton_info[ED_CHECKBUTTON_DOUBLE_SPEED].value ^= TRUE;
+ *checkbutton_info[ED_CHECKBUTTON_ID_DOUBLE_SPEED].value ^= TRUE;
+ break;
+
+ case GADGET_ID_STICK_ELEMENT:
+ *checkbutton_info[ED_CHECKBUTTON_ID_STICK_ELEMENT].value ^= TRUE;
break;
default:
PickDrawingElement(button, new_element);
- if (!HAS_CONTENT(properties_element))
+ if (!HAS_CONTENT(properties_element) ||
+ !stick_element_properties_window)
{
properties_element = new_element;
if (edit_mode == ED_MODE_PROPERTIES)
int sy = gi->event.y;
int lx = sx + level_xpos;
int ly = sy + level_ypos;
+ int min_sx = 0, min_sy = 0;
+ int max_sx = gi->drawing.area_xsize - 1;
+ int max_sy = gi->drawing.area_ysize - 1;
ClearEditorGadgetInfoText();
+ /* make sure to stay inside drawing area boundaries */
+ sx = (sx < min_sx ? min_sx : sx > max_sx ? max_sx : sx);
+ sy = (sy < min_sy ? min_sy : sy > max_sy ? max_sy : sy);
+
if (id == GADGET_ID_DRAWING_LEVEL)
{
if (button_status)
{
- int min_sx = 0, min_sy = 0;
- int max_sx = gi->drawing.area_xsize - 1;
- int max_sy = gi->drawing.area_ysize - 1;
int min_lx = 0, min_ly = 0;
int max_lx = lev_fieldx - 1, max_ly = lev_fieldy - 1;
- /* make sure to stay inside drawing area boundaries */
- sx = (sx < min_sx ? min_sx : sx > max_sx ? max_sx : sx);
- sy = (sy < min_sy ? min_sy : sy > max_sy ? max_sy : sy);
-
/* get positions inside level field */
lx = sx + level_xpos;
ly = sy + level_ypos;
"Random placement background");
else
DrawTextF(INFOTEXT_XPOS - SX, INFOTEXT_YPOS - SY, FC_YELLOW,
- "Cruncher %d content: %d, %d",
+ "Content area %d position: %d, %d",
id - GADGET_ID_ELEM_CONTENT_0 + 1, sx, sy);
}
{ GFX_SPIELER4_RIGHT, 4 },
{ GFX_SPIELER4_PUSH_LEFT, 4 },
{ GFX_SPIELER4_PUSH_RIGHT, 4 },
+ { GFX_SP_MURPHY, 1 },
+ { GFX_MURPHY_GO_LEFT, 3 },
+ { GFX_MURPHY_GO_RIGHT, 3 },
+ { GFX_MURPHY_SNAP_UP, 1 },
+ { GFX_MURPHY_SNAP_DOWN, 1 },
+ { GFX_MURPHY_SNAP_RIGHT, 1 },
+ { GFX_MURPHY_SNAP_LEFT, 1 },
+ { GFX_MURPHY_PUSH_RIGHT, 1 },
+ { GFX_MURPHY_PUSH_LEFT, 1 },
{ GFX_GEBLUBBER, 4 },
{ GFX_DYNAMIT, 7 },
{ GFX_DYNABOMB, 4 },
int src_x, src_y;
Pixmap src_pixmap;
+#if 0
if (graphic >= GFX_START_ROCKSSCREEN &&
graphic <= GFX_END_ROCKSSCREEN)
{
}
else
break;
+#else
+
+ int pixmap_nr;
+
+ getGraphicSource(graphic, &pixmap_nr, &src_x, &src_y);
+ src_pixmap = clipmask[pixmap_nr];
+
+#endif
tile_clipmask[tile] = XCreatePixmap(display, window, TILEX,TILEY, 1);
#define GFX_FLAMMEN_DOWN (GFX_START_ROCKSHEROES +15*HEROES_PER_LINE + 8)
/* graphics from "RocksMore" */
-#define GFX_SP_EMPTY (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 0)
-#define GFX_SP_ZONK (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 1)
-#define GFX_SP_BASE (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 2)
-#define GFX_SP_MURPHY (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 3)
-#define GFX_SP_INFOTRON (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 4)
-#define GFX_SP_CHIP_SINGLE (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 5)
-#define GFX_SP_HARD_GRAY (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 6)
-#define GFX_SP_EXIT (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 7)
-#define GFX_SP_DISK_ORANGE (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 0)
-#define GFX_SP_PORT1_RIGHT (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 1)
-#define GFX_SP_PORT1_DOWN (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 2)
-#define GFX_SP_PORT1_LEFT (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 3)
-#define GFX_SP_PORT1_UP (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 4)
-#define GFX_SP_PORT2_RIGHT (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 5)
-#define GFX_SP_PORT2_DOWN (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 6)
-#define GFX_SP_PORT2_LEFT (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 7)
-#define GFX_SP_PORT2_UP (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 0)
-#define GFX_SP_SNIKSNAK (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 1)
-#define GFX_SP_DISK_YELLOW (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 2)
-#define GFX_SP_TERMINAL (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 3)
-#define GFX_SP_DISK_RED (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 4)
-#define GFX_SP_PORT_Y (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 5)
-#define GFX_SP_PORT_X (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 6)
-#define GFX_SP_PORT_XY (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 7)
-#define GFX_SP_ELECTRON (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 0)
-#define GFX_SP_BUG (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 1)
-#define GFX_SP_CHIP_LEFT (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 2)
-#define GFX_SP_CHIP_RIGHT (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 3)
-#define GFX_SP_HARD_BASE1 (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 4)
-#define GFX_SP_HARD_GREEN (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 5)
-#define GFX_SP_HARD_BLUE (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 6)
-#define GFX_SP_HARD_RED (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 7)
-#define GFX_SP_HARD_YELLOW (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 0)
-#define GFX_SP_HARD_BASE2 (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 1)
-#define GFX_SP_HARD_BASE3 (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 2)
-#define GFX_SP_HARD_BASE4 (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 3)
-#define GFX_SP_HARD_BASE5 (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 4)
-#define GFX_SP_HARD_BASE6 (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 5)
-#define GFX_SP_CHIP_UPPER (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 6)
-#define GFX_SP_CHIP_LOWER (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 7)
-
-#define GFX_INVISIBLE_STEEL (GFX_START_ROCKSMORE + 5 * MORE_PER_LINE + 3)
-#define GFX_UNSICHTBAR (GFX_START_ROCKSMORE + 5 * MORE_PER_LINE + 7)
-
-#define GFX_SP_BUG_WARNING (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE +15)
-#define GFX_SP_EXPLODE_EMPTY (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 8)
-#define GFX_SP_EXPLODE_INFOTRON (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 8)
-#define GFX_SP_BUG_ACTIVE (GFX_START_ROCKSMORE + 6 * MORE_PER_LINE + 8)
-#define GFX_SP_SNIKSNAK_LEFT (GFX_START_ROCKSMORE + 8 * MORE_PER_LINE + 8)
-#define GFX_SP_SNIKSNAK_RIGHT (GFX_START_ROCKSMORE + 8 * MORE_PER_LINE +12)
-#define GFX_SP_SNIKSNAK_UP (GFX_START_ROCKSMORE + 9 * MORE_PER_LINE + 8)
-#define GFX_SP_SNIKSNAK_DOWN (GFX_START_ROCKSMORE + 9 * MORE_PER_LINE +12)
-
-#define GFX2_SP_ELECTRON (GFX_START_ROCKSMORE + 10 * MORE_PER_LINE + 8)
-#define GFX2_SP_TERMINAL (GFX_START_ROCKSMORE + 11 * MORE_PER_LINE + 8)
-#define GFX2_SP_TERMINAL_ACTIVE (GFX_START_ROCKSMORE + 12 * MORE_PER_LINE + 8)
+#define GFX_SP_EMPTY (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 0)
+#define GFX_SP_ZONK (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 1)
+#define GFX_SP_BASE (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 2)
+#define GFX_SP_MURPHY (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 3)
+#define GFX_SP_INFOTRON (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 4)
+#define GFX_SP_CHIP_SINGLE (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 5)
+#define GFX_SP_HARD_GRAY (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 6)
+#define GFX_SP_EXIT (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 7)
+#define GFX_SP_DISK_ORANGE (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 0)
+#define GFX_SP_PORT1_RIGHT (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 1)
+#define GFX_SP_PORT1_DOWN (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 2)
+#define GFX_SP_PORT1_LEFT (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 3)
+#define GFX_SP_PORT1_UP (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 4)
+#define GFX_SP_PORT2_RIGHT (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 5)
+#define GFX_SP_PORT2_DOWN (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 6)
+#define GFX_SP_PORT2_LEFT (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 7)
+#define GFX_SP_PORT2_UP (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 0)
+#define GFX_SP_SNIKSNAK (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 1)
+#define GFX_SP_DISK_YELLOW (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 2)
+#define GFX_SP_TERMINAL (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 3)
+#define GFX_SP_DISK_RED (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 4)
+#define GFX_SP_PORT_Y (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 5)
+#define GFX_SP_PORT_X (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 6)
+#define GFX_SP_PORT_XY (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 7)
+#define GFX_SP_ELECTRON (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 0)
+#define GFX_SP_BUG (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 1)
+#define GFX_SP_CHIP_LEFT (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 2)
+#define GFX_SP_CHIP_RIGHT (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 3)
+#define GFX_SP_HARD_BASE1 (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 4)
+#define GFX_SP_HARD_GREEN (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 5)
+#define GFX_SP_HARD_BLUE (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 6)
+#define GFX_SP_HARD_RED (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 7)
+#define GFX_SP_HARD_YELLOW (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 0)
+#define GFX_SP_HARD_BASE2 (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 1)
+#define GFX_SP_HARD_BASE3 (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 2)
+#define GFX_SP_HARD_BASE4 (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 3)
+#define GFX_SP_HARD_BASE5 (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 4)
+#define GFX_SP_HARD_BASE6 (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 5)
+#define GFX_SP_CHIP_UPPER (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 6)
+#define GFX_SP_CHIP_LOWER (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 7)
+
+#define GFX_INVISIBLE_STEEL (GFX_START_ROCKSMORE + 5 * MORE_PER_LINE + 3)
+#define GFX_UNSICHTBAR (GFX_START_ROCKSMORE + 5 * MORE_PER_LINE + 7)
+
+#define GFX_MURPHY_GO_LEFT (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 8)
+#define GFX_MURPHY_ANY_LEFT (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 9)
+#define GFX_MURPHY_GO_RIGHT (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 11)
+#define GFX_MURPHY_ANY_RIGHT (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 12)
+#define GFX_MURPHY_SNAP_UP (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 14)
+#define GFX_MURPHY_SNAP_DOWN (GFX_START_ROCKSMORE + 0 * MORE_PER_LINE + 15)
+#define GFX_MURPHY_SNAP_RIGHT (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 8)
+#define GFX_MURPHY_SNAP_LEFT (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 9)
+#define GFX_MURPHY_PUSH_RIGHT (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 10)
+#define GFX_MURPHY_PUSH_LEFT (GFX_START_ROCKSMORE + 1 * MORE_PER_LINE + 11)
+
+#define GFX_SP_BUG_WARNING (GFX_START_ROCKSMORE + 2 * MORE_PER_LINE + 15)
+#define GFX_SP_EXPLODE_EMPTY (GFX_START_ROCKSMORE + 3 * MORE_PER_LINE + 8)
+#define GFX_SP_EXPLODE_INFOTRON (GFX_START_ROCKSMORE + 4 * MORE_PER_LINE + 8)
+#define GFX_SP_BUG_ACTIVE (GFX_START_ROCKSMORE + 6 * MORE_PER_LINE + 8)
+#define GFX_SP_SNIKSNAK_LEFT (GFX_START_ROCKSMORE + 8 * MORE_PER_LINE + 8)
+#define GFX_SP_SNIKSNAK_RIGHT (GFX_START_ROCKSMORE + 8 * MORE_PER_LINE + 12)
+#define GFX_SP_SNIKSNAK_UP (GFX_START_ROCKSMORE + 9 * MORE_PER_LINE + 8)
+#define GFX_SP_SNIKSNAK_DOWN (GFX_START_ROCKSMORE + 9 * MORE_PER_LINE + 12)
+
+#define GFX2_SP_ELECTRON (GFX_START_ROCKSMORE + 10 * MORE_PER_LINE + 8)
+#define GFX2_SP_TERMINAL (GFX_START_ROCKSMORE + 11 * MORE_PER_LINE + 8)
+#define GFX2_SP_TERMINAL_ACTIVE (GFX_START_ROCKSMORE + 12 * MORE_PER_LINE + 8)
/* graphics from "RocksFont" */
#define GFX_CHAR_START (GFX_START_ROCKSFONT)
if (redraw_mask & REDRAW_ALL)
{
- XCopyArea(display,backbuffer,window,gc,
- 0,0, WIN_XSIZE,WIN_YSIZE,
- 0,0);
+ XCopyArea(display, backbuffer, window, gc,
+ 0, 0, WIN_XSIZE, WIN_YSIZE,
+ 0, 0);
redraw_mask = 0;
}
{
if (game_status != PLAYING || redraw_mask & REDRAW_FROM_BACKBUFFER)
{
- XCopyArea(display,backbuffer,window,gc,
- REAL_SX,REAL_SY, FULL_SXSIZE,FULL_SYSIZE,
- REAL_SX,REAL_SY);
+ XCopyArea(display, backbuffer, window, gc,
+ REAL_SX, REAL_SY, FULL_SXSIZE, FULL_SYSIZE,
+ REAL_SX, REAL_SY);
}
else
{
if (redraw_mask & REDRAW_DOORS)
{
if (redraw_mask & REDRAW_DOOR_1)
- XCopyArea(display,backbuffer,window,gc,
- DX,DY, DXSIZE,DYSIZE,
- DX,DY);
+ XCopyArea(display, backbuffer, window, gc,
+ DX, DY, DXSIZE, DYSIZE,
+ DX, DY);
if (redraw_mask & REDRAW_DOOR_2)
{
if ((redraw_mask & REDRAW_DOOR_2) == REDRAW_DOOR_2)
XSetClipOrigin(display, clip_gc[font_pixmap],
dest_x - src_x, dest_y - src_y);
- XCopyArea(display, pix[font_pixmap], drawto, clip_gc[font_pixmap],
+ XCopyArea(display, pix[font_pixmap], d, clip_gc[font_pixmap],
0, 0, font_width, font_height, dest_x, dest_y);
}
else
/* draw player himself */
- if (player->MovDir == MV_LEFT)
- graphic = (player->Pushing ? GFX_SPIELER1_PUSH_LEFT : GFX_SPIELER1_LEFT);
- else if (player->MovDir == MV_RIGHT)
- graphic = (player->Pushing ? GFX_SPIELER1_PUSH_RIGHT : GFX_SPIELER1_RIGHT);
- else if (player->MovDir == MV_UP)
- graphic = GFX_SPIELER1_UP;
- else /* MV_DOWN || MV_NO_MOVING */
- graphic = GFX_SPIELER1_DOWN;
+ if (game_emulation == EMU_SUPAPLEX)
+ {
+#if 0
+ if (player->MovDir == MV_LEFT)
+ graphic =
+ (player->Pushing ? GFX_MURPHY_PUSH_LEFT : GFX_MURPHY_LEFT);
+ else if (player->MovDir == MV_RIGHT)
+ graphic =
+ (player->Pushing ? GFX_MURPHY_PUSH_RIGHT : GFX_MURPHY_RIGHT);
+ else if (player->MovDir == MV_UP)
+ graphic = GFX_MURPHY_UP;
+ else if (player->MovDir == MV_DOWN)
+ graphic = GFX_MURPHY_DOWN;
+ else /* MV_NO_MOVING */
+ graphic = GFX_SP_MURPHY;
+
+
+ /*
+ if (player->snapped)
+ graphic = GFX_SPIELER1_PUSH_LEFT;
+ else
+ graphic = GFX_SPIELER1_PUSH_RIGHT;
+ */
+#endif
+
+ static last_dir = MV_LEFT;
+
+ if (player->Pushing)
+ {
+ if (player->MovDir == MV_LEFT)
+ graphic = GFX_MURPHY_PUSH_LEFT;
+ else if (player->MovDir == MV_RIGHT)
+ graphic = GFX_MURPHY_PUSH_RIGHT;
+ else if (last_dir == MV_LEFT)
+ graphic = GFX_MURPHY_ANY_LEFT;
+ else if (last_dir == MV_RIGHT)
+ graphic = GFX_MURPHY_ANY_RIGHT;
+ else
+ graphic = GFX_SP_MURPHY;
+ }
+ else if (player->snapped)
+ {
+ if (player->MovDir == MV_LEFT)
+ graphic = GFX_MURPHY_SNAP_LEFT;
+ else if (player->MovDir == MV_RIGHT)
+ graphic = GFX_MURPHY_SNAP_RIGHT;
+ else if (player->MovDir == MV_UP)
+ graphic = GFX_MURPHY_SNAP_UP;
+ else if (player->MovDir == MV_DOWN)
+ graphic = GFX_MURPHY_SNAP_DOWN;
+ else
+ graphic = GFX_SP_MURPHY;
+ }
+ else
+ {
+ if (player->MovDir == MV_LEFT)
+ graphic = GFX_MURPHY_ANY_LEFT;
+ else if (player->MovDir == MV_RIGHT)
+ graphic = GFX_MURPHY_ANY_RIGHT;
+ else if (last_dir == MV_LEFT)
+ graphic = GFX_MURPHY_ANY_LEFT;
+ else if (last_dir == MV_RIGHT)
+ graphic = GFX_MURPHY_ANY_RIGHT;
+ else
+ graphic = GFX_SP_MURPHY;
+ }
- graphic += player->index_nr * 3*HEROES_PER_LINE;
- graphic += player->Frame;
+ if (player->MovDir == MV_LEFT || player->MovDir == MV_RIGHT)
+ last_dir = player->MovDir;
+
+ if (!player->Pushing && !player->snapped && player->MovDir != MV_NO_MOVING)
+ graphic -= player->Frame % 2;
+ }
+ else
+ {
+ if (player->MovDir == MV_LEFT)
+ graphic =
+ (player->Pushing ? GFX_SPIELER1_PUSH_LEFT : GFX_SPIELER1_LEFT);
+ else if (player->MovDir == MV_RIGHT)
+ graphic =
+ (player->Pushing ? GFX_SPIELER1_PUSH_RIGHT : GFX_SPIELER1_RIGHT);
+ else if (player->MovDir == MV_UP)
+ graphic = GFX_SPIELER1_UP;
+ else /* MV_DOWN || MV_NO_MOVING */
+ graphic = GFX_SPIELER1_DOWN;
+
+ graphic += player->index_nr * 3 * HEROES_PER_LINE;
+ graphic += player->Frame;
+ }
if (player->GfxPos)
{
DrawGraphicAnimationExt(x, y, graphic, frames, delay, mode, USE_MASKING);
}
+void getGraphicSource(int graphic, int *pixmap_nr, int *x, int *y)
+{
+ if (graphic >= GFX_START_ROCKSSCREEN && graphic <= GFX_END_ROCKSSCREEN)
+ {
+ graphic -= GFX_START_ROCKSSCREEN;
+ *pixmap_nr = PIX_BACK;
+ *x = SX + (graphic % GFX_PER_LINE) * TILEX;
+ *y = SY + (graphic / GFX_PER_LINE) * TILEY;
+ }
+ else if (graphic >= GFX_START_ROCKSMORE && graphic <= GFX_END_ROCKSMORE)
+ {
+ graphic -= GFX_START_ROCKSMORE;
+ *pixmap_nr = PIX_MORE;
+ *x = (graphic % MORE_PER_LINE) * TILEX;
+ *y = (graphic / MORE_PER_LINE) * TILEY;
+ }
+ else if (graphic >= GFX_START_ROCKSHEROES && graphic <= GFX_END_ROCKSHEROES)
+ {
+ graphic -= GFX_START_ROCKSHEROES;
+ *pixmap_nr = PIX_HEROES;
+ *x = (graphic % HEROES_PER_LINE) * TILEX;
+ *y = (graphic / HEROES_PER_LINE) * TILEY;
+ }
+ else if (graphic >= GFX_START_ROCKSFONT && graphic <= GFX_END_ROCKSFONT)
+ {
+ graphic -= GFX_START_ROCKSFONT;
+ *pixmap_nr = PIX_BIGFONT;
+ *x = (graphic % FONT_CHARS_PER_LINE) * TILEX;
+ *y = ((graphic / FONT_CHARS_PER_LINE) * TILEY +
+ FC_SPECIAL1 * FONT_LINES_PER_FONT * TILEY);
+ }
+ else
+ {
+ *pixmap_nr = PIX_MORE;
+ *x = 0;
+ *y = 0;
+ }
+}
+
void DrawGraphic(int x, int y, int graphic)
{
#if DEBUG
void DrawGraphicExt(Drawable d, GC gc, int x, int y, int graphic)
{
+
+#if 1
+
+ int pixmap_nr;
+ int src_x, src_y;
+
+ getGraphicSource(graphic, &pixmap_nr, &src_x, &src_y);
+ XCopyArea(display, pix[pixmap_nr], d, gc,
+ src_x, src_y, TILEX, TILEY, x, y);
+
+#else
+
if (graphic >= GFX_START_ROCKSSCREEN && graphic <= GFX_END_ROCKSSCREEN)
{
graphic -= GFX_START_ROCKSSCREEN;
}
else
XFillRectangle(display, d, gc, x, y, TILEX, TILEY);
+
+#endif
+
}
void DrawGraphicThruMask(int x, int y, int graphic)
void DrawGraphicThruMaskExt(Drawable d, int dest_x, int dest_y, int graphic)
{
+
+#if 1
+
+ int tile = graphic;
+ int pixmap_nr;
+ int src_x, src_y;
+ Pixmap src_pixmap;
+ GC drawing_gc;
+
+ getGraphicSource(graphic, &pixmap_nr, &src_x, &src_y);
+ src_pixmap = pix[pixmap_nr];
+ drawing_gc = clip_gc[pixmap_nr];
+
+#else
+
int src_x, src_y;
int tile = graphic;
Pixmap src_pixmap;
return;
}
+#endif
+
+
if (tile_clipmask[tile] != None)
{
XSetClipMask(display, tile_clip_gc, tile_clipmask[tile]);
XSetClipOrigin(display, tile_clip_gc, dest_x, dest_y);
- XCopyArea(display, src_pixmap, drawto_field, tile_clip_gc,
+ XCopyArea(display, src_pixmap, d, tile_clip_gc,
src_x, src_y, TILEX, TILEY, dest_x, dest_y);
}
else
#endif
XSetClipOrigin(display, drawing_gc, dest_x-src_x, dest_y-src_y);
- XCopyArea(display, src_pixmap, drawto_field, drawing_gc,
+ XCopyArea(display, src_pixmap, d, drawing_gc,
src_x, src_y, TILEX, TILEY, dest_x, dest_y);
}
}
*pixmap = pix[PIX_SMALLFONT];
*x = (graphic % FONT_CHARS_PER_LINE) * FONT4_XSIZE;
*y = ((graphic / FONT_CHARS_PER_LINE) * FONT4_YSIZE +
- FC_SPECIAL2 * FONT2_YSIZE * FONT_LINES_PER_FONT);
+ FC_SPECIAL2 * FONT2_YSIZE * FONT_LINES_PER_FONT);
}
else
{
void DrawMiniGraphicExt(Drawable d, GC gc, int x, int y, int graphic)
{
+
+#if 1
+
+ Pixmap pixmap;
+ int src_x, src_y;
+
+ getMiniGraphicSource(graphic, &pixmap, &src_x, &src_y);
+ XCopyArea(display, pixmap, d, gc,
+ src_x, src_y, MINI_TILEX, MINI_TILEY, x, y);
+
+#else
+
if (graphic >= GFX_START_ROCKSSCREEN && graphic <= GFX_END_ROCKSSCREEN)
{
graphic -= GFX_START_ROCKSSCREEN;
}
else
XFillRectangle(display, d, gc, x, y, MINI_TILEX, MINI_TILEY);
+
+#endif
+
}
void DrawGraphicShifted(int x,int y, int dx,int dy, int graphic,
void DrawGraphicAnimationExt(int, int, int, int, int, int, int);
void DrawGraphicAnimation(int, int, int, int, int, int);
void DrawGraphicAnimationThruMask(int, int, int, int, int, int);
+void getGraphicSource(int, int *, int *, int *);
void DrawGraphic(int, int, int);
void DrawGraphicExt(Drawable, GC, int, int, int);
void DrawGraphicThruMask(int, int, int);