-#define COMPILE_DATE_STRING "[2002-10-01 00:29]"
+#define COMPILE_DATE_STRING "[2002-10-04 19:34]"
}
else if (!(phase % delay) && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
{
+#if 0
int graphic = GFX_EXPLOSION;
if (game.emulation == EMU_SUPAPLEX)
GFX_SP_EXPLODE_INFOTRON :
GFX_SP_EXPLODE_EMPTY);
+ graphic += (phase / delay - 1);
+#else
+ int graphic = IMG_EXPLOSION;
+ int frame = (phase / delay - 1);
+
+ if (game.emulation == EMU_SUPAPLEX)
+ graphic = (Store[x][y] == EL_SP_INFOTRON ?
+ IMG_SP_EXPLOSION_INFOTRON :
+ IMG_SP_EXPLOSION);
+#endif
+
if (phase == delay)
ErdreichAnbroeckeln(SCREENX(x), SCREENY(y));
- graphic += (phase / delay - 1);
-
if (IS_PFORTE(Store[x][y]))
{
DrawNewLevelElement(x, y, Store[x][y]);
+#if 0
DrawGraphicThruMask(SCREENX(x), SCREENY(y), graphic);
+#else
+ DrawNewGraphicThruMask(SCREENX(x), SCREENY(y), graphic, frame);
+#endif
}
else
+#if 0
DrawGraphic(SCREENX(x), SCREENY(y), graphic);
+#else
+ DrawNewGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+#endif
}
}
}
else /* go on */
{
+#if 0
int graphic =
(element == EL_ACID_SPLASHING_LEFT ? GFX_BLURB_LEFT : GFX_BLURB_RIGHT);
+#else
+ int graphic = (element == EL_ACID_SPLASHING_LEFT ?
+ IMG_ACID_SPLASHING_LEFT :
+ IMG_ACID_SPLASHING_RIGHT);
+#endif
if (!MovDelay[x][y]) /* initialize animation counter */
MovDelay[x][y] = 9;
{
MovDelay[x][y]--;
if (MovDelay[x][y]/2 && IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+#if 0
DrawGraphic(SCREENX(x), SCREENY(y), graphic+4-MovDelay[x][y]/2);
+#else
+ {
+ int frame = getNewGraphicAnimationFrame(graphic, 8 - MovDelay[x][y]);
+
+ DrawNewGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+ }
+#endif
if (!MovDelay[x][y])
{
Feld[x][y] = EL_EMPTY;
- DrawLevelField(x, y);
+ DrawNewLevelField(x, y);
}
}
}
if (e_belt_nr == belt_nr)
{
Feld[xx][yy] = belt_base_switch_element[belt_nr] + belt_dir_nr;
- DrawLevelField(xx, yy);
+ DrawNewLevelField(xx, yy);
}
}
else if (IS_BELT(element) && belt_dir != MV_NO_MOVING)
int belt_part = Feld[xx][yy] - belt_base_element[belt_nr];
Feld[xx][yy] = belt_base_active_element[belt_nr] + belt_part;
- DrawLevelField(xx, yy);
+ DrawNewLevelField(xx, yy);
}
}
else if (IS_BELT_ACTIVE(element) && belt_dir == MV_NO_MOVING)
int belt_part = Feld[xx][yy] - belt_base_active_element[belt_nr];
Feld[xx][yy] = belt_base_element[belt_nr] + belt_part;
- DrawLevelField(xx, yy);
+ DrawNewLevelField(xx, yy);
}
}
}
element == EL_SWITCHGATE_SWITCH_DOWN)
{
Feld[xx][yy] = EL_SWITCHGATE_SWITCH_UP + game.switchgate_pos;
- DrawLevelField(xx, yy);
+ DrawNewLevelField(xx, yy);
}
else if (element == EL_SWITCHGATE_OPEN ||
element == EL_SWITCHGATE_OPENING)
game.light_time_left > 0)
{
Feld[x][y] = EL_LIGHT_SWITCH_ACTIVE;
- DrawLevelField(x, y);
+ DrawNewLevelField(x, y);
}
else if (element == EL_LIGHT_SWITCH_ACTIVE &&
game.light_time_left == 0)
{
Feld[x][y] = EL_LIGHT_SWITCH;
- DrawLevelField(x, y);
+ DrawNewLevelField(x, y);
}
else if (element == EL_INVISIBLE_STEELWALL ||
element == EL_INVISIBLE_WALL ||
if (game.light_time_left > 0)
Feld[x][y] = getInvisibleActiveFromInvisibleElement(element);
- DrawLevelField(x, y);
+ DrawNewLevelField(x, y);
}
else if (element == EL_INVISIBLE_STEELWALL_ACTIVE ||
element == EL_INVISIBLE_WALL_ACTIVE ||
if (game.light_time_left == 0)
Feld[x][y] = getInvisibleFromInvisibleActiveElement(element);
- DrawLevelField(x, y);
+ DrawNewLevelField(x, y);
}
}
}
phase = 7 - phase;
if (IN_SCR_FIELD(SCREENX(x), SCREENY(y)))
+#if 0
DrawGraphic(SCREENX(x), SCREENY(y), el2gfx(element) + phase);
+#else
+ {
+ int graphic = el2img(element);
+ int frame = getNewGraphicAnimationFrame(graphic, MovDelay[x][y] % 8);
+
+ DrawNewGraphic(SCREENX(x), SCREENY(y), graphic, frame);
+ }
+#endif
if (MovDelay[x][y] % 4 == 3)
{
}
}
else if (element == EL_SP_ELECTRON)
+#if 0
DrawGraphicAnimation(x, y, GFX2_SP_ELECTRON, 8, 2, ANIM_LOOP);
+#else
+ DrawNewGraphicAnimation(x, y, IMG_SP_ELECTRON);
+#endif
else if (element == EL_DRAGON)
{
int i;
int dir = MovDir[x][y];
int dx = (dir == MV_LEFT ? -1 : dir == MV_RIGHT ? +1 : 0);
int dy = (dir == MV_UP ? -1 : dir == MV_DOWN ? +1 : 0);
+#if 0
int graphic = (dir == MV_LEFT ? GFX_FLAMMEN_LEFT :
dir == MV_RIGHT ? GFX_FLAMMEN_RIGHT :
dir == MV_UP ? GFX_FLAMMEN_UP :
dir == MV_DOWN ? GFX_FLAMMEN_DOWN : GFX_LEERRAUM);
int phase = FrameCounter % 2;
+#else
+ int graphic = (dir == MV_LEFT ? IMG_FLAMES_LEFT1 :
+ dir == MV_RIGHT ? IMG_FLAMES_RIGHT1 :
+ dir == MV_UP ? IMG_FLAMES_UP1 :
+ dir == MV_DOWN ? IMG_FLAMES_DOWN1 : IMG_EMPTY);
+ int frame = getNewGraphicAnimationFrame(graphic, -1);
+#endif
for (i=1; i<=3; i++)
{
int xx = x + i*dx, yy = y + i*dy;
int sx = SCREENX(xx), sy = SCREENY(yy);
+ int flame_graphic = graphic + (i - 1);
if (!IN_LEV_FIELD(xx, yy) ||
IS_SOLID(Feld[xx][yy]) || Feld[xx][yy] == EL_EXPLOSION)
Feld[xx][yy] = EL_FLAMES;
if (IN_SCR_FIELD(sx, sy))
+#if 0
DrawGraphic(sx, sy, graphic + phase*3 + i-1);
+#else
+ DrawNewGraphic(sx, sy, flame_graphic, frame);
+#endif
}
else
{
if (Feld[xx][yy] == EL_FLAMES)
Feld[xx][yy] = EL_EMPTY;
- DrawLevelField(xx, yy);
+ DrawNewLevelField(xx, yy);
}
}
}
{
int *parameter = image_files[i].parameter;
- /* always start with reliable default values */
new_graphic_info[i].bitmap = getBitmapFromImageID(i);
+
new_graphic_info[i].src_x = parameter[GFX_ARG_XPOS] * TILEX;
new_graphic_info[i].src_y = parameter[GFX_ARG_YPOS] * TILEY;
+ new_graphic_info[i].offset_x = parameter[GFX_ARG_OFFSET];
+ new_graphic_info[i].offset_y = 0;
+
+ /* animation frames are ordered vertically instead of horizontally */
+ if (parameter[GFX_ARG_VERTICAL])
+ {
+ new_graphic_info[i].offset_x = 0;
+ new_graphic_info[i].offset_y = parameter[GFX_ARG_OFFSET];
+ }
new_graphic_info[i].anim_frames = parameter[GFX_ARG_FRAMES];
new_graphic_info[i].anim_delay = 1;
/* set mode for animation frame order */
- if (parameter[GFX_ARG_MODE_LINEAR])
+ if (parameter[GFX_ARG_MODE_LOOP])
+ new_graphic_info[i].anim_mode = ANIM_LOOP;
+ else if (parameter[GFX_ARG_MODE_LINEAR])
new_graphic_info[i].anim_mode = ANIM_LINEAR;
else if (parameter[GFX_ARG_MODE_PINGPONG])
new_graphic_info[i].anim_mode = ANIM_PINGPONG;
/* animation synchronized with global frame counter, not move position */
new_graphic_info[i].anim_global_sync = parameter[GFX_ARG_GLOBAL_SYNC];
-
- new_graphic_info[i].anim_vertical = parameter[GFX_ARG_VERTICAL];
}
#if 0
{
{ ".xpos", "0" },
{ ".ypos", "0" },
+ { ".offset", "32" },
+ { ".vertical", "0" },
{ ".frames", "1" },
#if 0
{ ".start_frame", "-1" },
#endif
{ ".delay", "1" },
+ { ".mode_loop", "0" },
{ ".mode_linear", "0" },
{ ".mode_pingpong", "0" },
{ ".mode_pingpong2", "0" },
{ ".mode_reverse", "0" },
{ ".global_sync", "0" },
- { ".vertical", "0" },
{ NULL, NULL }
};
{ "yamyam.xpos", "0" },
{ "yamyam.ypos", "5" },
{ "yamyam.frames", "4" },
- { "yamyam.mode_pingpong", "1" },
+ { "yamyam.mode_pingpong2", "1" },
{ "yamyam.moving", "RocksElements.pcx" },
{ "yamyam.moving.xpos", "0" },
{ "yamyam.moving.ypos", "5" },
{ "robot.xpos", "4" },
{ "robot.ypos", "5" },
{ "robot.frames", "4" },
- { "robot.mode_pingpong", "1" },
+ { "robot.mode_pingpong2", "1" },
{ "robot_wheel", "RocksElements.pcx" },
{ "robot_wheel.xpos", "0" },
{ "acid.splashing_left.xpos", "8" },
{ "acid.splashing_left.ypos", "10" },
{ "acid.splashing_left.frames", "4" },
+ { "acid.splashing_left.delay", "2" },
{ "acid.splashing_right", "RocksHeroes.pcx" },
{ "acid.splashing_right.xpos", "12" },
{ "acid.splashing_right.ypos", "10" },
{ "acid.splashing_right.frames", "4" },
+ { "acid.splashing_right.delay", "2" },
{ "amoeba_drop", "RocksElements.pcx" },
{ "amoeba_drop.xpos", "5" },
{ "dark_yamyam.xpos", "8" },
{ "dark_yamyam.ypos", "11" },
{ "dark_yamyam.frames", "4" },
- { "dark_yamyam.mode_pingpong", "1" },
+ { "dark_yamyam.mode_pingpong2", "1" },
{ "dynabomb.active", "RocksElements.pcx" },
{ "dynabomb.active.xpos", "12" },
{ "flames_left1.xpos", "8" },
{ "flames_left1.ypos", "12" },
{ "flames_left1.frames", "2" },
+ { "flames_left1.offset", "96" },
{ "flames_left2", "RocksHeroes.pcx" },
{ "flames_left2.xpos", "9" },
{ "flames_left2.ypos", "12" },
{ "flames_left2.frames", "2" },
+ { "flames_left2.offset", "96" },
{ "flames_left3", "RocksHeroes.pcx" },
{ "flames_left3.xpos", "10" },
{ "flames_left3.ypos", "12" },
{ "flames_left3.frames", "2" },
+ { "flames_left3.offset", "96" },
{ "flames_right1", "RocksHeroes.pcx" },
{ "flames_right1.xpos", "8" },
{ "flames_right1.ypos", "13" },
{ "flames_right1.frames", "2" },
+ { "flames_right1.offset", "96" },
{ "flames_right2", "RocksHeroes.pcx" },
{ "flames_right2.xpos", "9" },
{ "flames_right2.ypos", "13" },
{ "flames_right2.frames", "2" },
+ { "flames_right2.offset", "96" },
{ "flames_right3", "RocksHeroes.pcx" },
{ "flames_right3.xpos", "10" },
{ "flames_right3.ypos", "13" },
{ "flames_right3.frames", "2" },
+ { "flames_right3.offset", "96" },
{ "flames_up1", "RocksHeroes.pcx" },
{ "flames_up1.xpos", "8" },
{ "flames_up1.ypos", "14" },
{ "flames_up1.frames", "2" },
+ { "flames_up1.offset", "96" },
{ "flames_up2", "RocksHeroes.pcx" },
{ "flames_up2.xpos", "9" },
{ "flames_up2.ypos", "14" },
{ "flames_up2.frames", "2" },
+ { "flames_up2.offset", "96" },
{ "flames_up3", "RocksHeroes.pcx" },
{ "flames_up3.xpos", "10" },
{ "flames_up3.ypos", "14" },
{ "flames_up3.frames", "2" },
+ { "flames_up3.offset", "96" },
{ "flames_down1", "RocksHeroes.pcx" },
{ "flames_down1.xpos", "8" },
{ "flames_down1.ypos", "15" },
{ "flames_down1.frames", "2" },
+ { "flames_down1.offset", "96" },
{ "flames_down2", "RocksHeroes.pcx" },
{ "flames_down2.xpos", "9" },
{ "flames_down2.ypos", "15" },
{ "flames_down2.frames", "2" },
+ { "flames_down2.offset", "96" },
{ "flames_down3", "RocksHeroes.pcx" },
{ "flames_down3.xpos", "10" },
{ "flames_down3.ypos", "15" },
{ "flames_down3.frames", "2" },
+ { "flames_down3.offset", "96" },
{ "stoneblock", "RocksElements.pcx" },
{ "stoneblock.xpos", "10" },
#include "conf_gfx.h"
#include "conf_snd.h"
+#define IMG_EMPTY IMG_EMPTY_SPACE
+#define IMG_SP_EMPTY IMG_SP_EMPTY_SPACE
#define WIN_XSIZE 672
#define WIN_YSIZE 560
/* values for image configuration suffixes */
#define GFX_ARG_XPOS 0
#define GFX_ARG_YPOS 1
-#define GFX_ARG_FRAMES 2
-#define GFX_ARG_DELAY 3
-#define GFX_ARG_MODE_LINEAR 4
-#define GFX_ARG_MODE_PINGPONG 5
-#define GFX_ARG_MODE_PINGPONG2 6
-#define GFX_ARG_MODE_REVERSE 7
-#define GFX_ARG_GLOBAL_SYNC 8
-#define GFX_ARG_VERTICAL 9
+#define GFX_ARG_OFFSET 2
+#define GFX_ARG_VERTICAL 3
+#define GFX_ARG_FRAMES 4
+#define GFX_ARG_DELAY 5
+#define GFX_ARG_MODE_LOOP 6
+#define GFX_ARG_MODE_LINEAR 7
+#define GFX_ARG_MODE_PINGPONG 8
+#define GFX_ARG_MODE_PINGPONG2 9
+#define GFX_ARG_MODE_REVERSE 10
+#define GFX_ARG_GLOBAL_SYNC 11
/* values for sound configuration suffixes */
/* (currently none) */
struct NewGraphicInfo
{
Bitmap *bitmap;
- int src_x, src_y;
+ int src_x, src_y; /* derived from (tile sized) .xpos/.ypos */
+ int offset_x, offset_y; /* x/y offset to next animation frame */
int anim_frames;
- int anim_delay;
+ int anim_delay; /* important: delay of 1 means "no delay"! */
int anim_mode;
boolean anim_global_sync;
- boolean anim_vertical;
};
extern GC tile_clip_gc;
Bitmap *src_bitmap = new_graphic_info[graphic].bitmap;
int src_x = new_graphic_info[graphic].src_x;
int src_y = new_graphic_info[graphic].src_y;
+ int offset_x = new_graphic_info[graphic].offset_x;
+ int offset_y = new_graphic_info[graphic].offset_y;
- if (new_graphic_info[graphic].anim_vertical)
- src_y += frame * TILEY;
- else
- src_x += frame * TILEX;
+ src_x += frame * offset_x;
+ src_y += frame * offset_y;
BlitBitmap(src_bitmap, dst_bitmap, src_x, src_y, TILEX, TILEY, x, y);
}
GC drawing_gc = src_bitmap->stored_clip_gc;
int src_x = new_graphic_info[graphic].src_x;
int src_y = new_graphic_info[graphic].src_y;
+ int offset_x = new_graphic_info[graphic].offset_x;
+ int offset_y = new_graphic_info[graphic].offset_y;
- if (new_graphic_info[graphic].anim_vertical)
- src_y += frame * TILEY;
- else
- src_x += frame * TILEX;
+ src_x += frame * offset_x;
+ src_y += frame * offset_y;
SetClipOrigin(src_bitmap, drawing_gc, dest_x - src_x, dest_y - src_y);
BlitBitmapMasked(src_bitmap, d, src_x, src_y, TILEX, TILEY, dest_x, dest_y);
GC drawing_gc;
int src_x;
int src_y;
+ int offset_x;
+ int offset_y;
int width = TILEX, height = TILEY;
int cx = 0, cy = 0;
drawing_gc = src_bitmap->stored_clip_gc;
src_x = new_graphic_info[graphic].src_x;
src_y = new_graphic_info[graphic].src_y;
+ offset_x = new_graphic_info[graphic].offset_x;
+ offset_y = new_graphic_info[graphic].offset_y;
- if (new_graphic_info[graphic].anim_vertical)
- src_y += frame * TILEY;
- else
- src_x += frame * TILEX;
+ src_x += frame * offset_x;
+ src_y += frame * offset_y;
src_x += cx;
src_y += cy;
break;
}
- return IMG_EMPTY_SPACE;
+ return IMG_EMPTY;
#endif
}