projects
/
rocksndiamonds.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
rocksndiamonds-3.0.4
[rocksndiamonds.git]
/
src
/
tools.c
diff --git
a/src/tools.c
b/src/tools.c
index 1f0856dcc7b8c3949e8c9b737f9a08ab1602ec15..f8f37ea0c7d3e6e08d8098674b850950d9806610 100644
(file)
--- a/
src/tools.c
+++ b/
src/tools.c
@@
-35,6
+35,7
@@
static void UnmapToolButtons();
static void HandleToolButtons(struct GadgetInfo *);
static int el_act_dir2crm(int, int, int);
static void UnmapToolButtons();
static void HandleToolButtons(struct GadgetInfo *);
static int el_act_dir2crm(int, int, int);
+static int el_act2crm(int, int);
static struct GadgetInfo *tool_gadget[NUM_TOOL_BUTTONS];
static int request_gadget_id = -1;
static struct GadgetInfo *tool_gadget[NUM_TOOL_BUTTONS];
static int request_gadget_id = -1;
@@
-1217,6
+1218,12
@@
static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame)
{ 0, +1 }
};
{ 0, +1 }
};
+#if 0
+ if (x == 0 && y == 7)
+ printf("::: %d, %d [%d]\n", GfxElement[x][y], Feld[x][y],
+ crumbled_border_size);
+#endif
+
if (!IN_LEV_FIELD(x, y))
return;
if (!IN_LEV_FIELD(x, y))
return;
@@
-1272,7
+1279,9
@@
static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame)
}
else /* crumble neighbour fields */
{
}
else /* crumble neighbour fields */
{
+#if 0
getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y);
getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y);
+#endif
for(i=0; i<4; i++)
{
for(i=0; i<4; i++)
{
@@
-1287,6
+1296,12
@@
static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame)
IS_MOVING(xx, yy))
continue;
IS_MOVING(xx, yy))
continue;
+#if 1
+ graphic = el_act2crm(Feld[xx][yy], ACTION_DEFAULT);
+
+ getGraphicSource(graphic, frame, &src_bitmap, &src_x, &src_y);
+#endif
+
if (i == 1 || i == 2)
{
width = crumbled_border_size;
if (i == 1 || i == 2)
{
width = crumbled_border_size;
@@
-1312,7
+1327,18
@@
static void DrawLevelFieldCrumbledSandExt(int x, int y, int graphic, int frame)
void DrawLevelFieldCrumbledSand(int x, int y)
{
void DrawLevelFieldCrumbledSand(int x, int y)
{
+#if 1
+ int graphic;
+
+ if (!IN_LEV_FIELD(x, y))
+ return;
+
+ graphic = el_act2crm(Feld[x][y], ACTION_DEFAULT);
+
+ DrawLevelFieldCrumbledSandExt(x, y, graphic, 0);
+#else
DrawLevelFieldCrumbledSandExt(x, y, IMG_SAND_CRUMBLED, 0);
DrawLevelFieldCrumbledSandExt(x, y, IMG_SAND_CRUMBLED, 0);
+#endif
}
void DrawLevelFieldCrumbledSandDigging(int x, int y, int direction,
}
void DrawLevelFieldCrumbledSandDigging(int x, int y, int direction,
@@
-2780,6
+2806,13
@@
int el_act2img(int element, int action)
return element_info[element].graphic[action];
}
return element_info[element].graphic[action];
}
+int el_act2crm(int element, int action)
+{
+ element = GFX_ELEMENT(element);
+
+ return element_info[element].crumbled[action];
+}
+
int el_dir2img(int element, int direction)
{
element = GFX_ELEMENT(element);
int el_dir2img(int element, int direction)
{
element = GFX_ELEMENT(element);