SetDrawtoField(DRAW_DIRECT);
}
+ if (soft_scrolling_on && game_status==PLAYING)
+ XCopyArea(display,fieldbuffer,backbuffer,gc,
+ FX,FY, SXSIZE,SYSIZE,
+ SX,SY);
+
return;
break;
case ANIM_CONTINUE:
break;
case ANIM_STOP:
- redraw_mask |= REDRAW_FIELD;
+ redraw_mask |= (REDRAW_FIELD | REDRAW_FROM_BACKBUFFER);
/* Redraw background even when in direct drawing mode */
draw_mode = direct_draw_on;
SetDrawtoField(DRAW_DIRECT);
}
+ if (soft_scrolling_on && game_status==PLAYING)
+ XCopyArea(display,fieldbuffer,backbuffer,gc,
+ FX,FY, SXSIZE,SYSIZE,
+ SX,SY);
+
XCopyArea(display,drawto,window,gc, x,y, width,height, x,y);
XFlush(display);
XAutoRepeatOn(display);
old_joystick_status = joystick_status;
joystick_status = JOYSTICK_OFF;
+ key_joystick_mapping = 0;
}
else if (event->type == FocusIn)
{
#define SETUP_2ND_JOYSTICK (1<<7)
#define SETUP_QUICK_DOORS (1<<8)
#define SETUP_SCROLL_DELAY (1<<9)
+#define SETUP_SOFT_SCROLL (1<<10)
#define DEFAULT_SETUP (SETUP_TOONS | \
SETUP_SOUND | \
#define SETUP_2ND_JOYSTICK_ON(x) (((x) & SETUP_2ND_JOYSTICK) != 0)
#define SETUP_QUICK_DOORS_ON(x) (((x) & SETUP_QUICK_DOORS) != 0)
#define SETUP_SCROLL_DELAY_ON(x) (((x) & SETUP_SCROLL_DELAY) != 0)
+#define SETUP_SOFT_SCROLL_ON(x) (((x) & SETUP_SOFT_SCROLL) != 0)
BOOL CreateNewScoreFile(void);
BOOL CreateNewNamesFile(int);
joystick_nr = SETUP_2ND_JOYSTICK_ON(player.setup);
quick_doors = SETUP_QUICK_DOORS_ON(player.setup);
scroll_delay_on = SETUP_SCROLL_DELAY_ON(player.setup);
+ soft_scrolling_on = SETUP_SOFT_SCROLL_ON(player.setup);
if (joystick_nr != old_joystick_nr)
{
FrameCounter = 0;
TimeFrames = 0;
TimeLeft = level.time;
+ ScreenMovPos = 0;
PlayerMovDir = MV_NO_MOVING;
PlayerMovPos = 0;
PlayerFrame = 0;
*/
+ DrawPlayerField();
+
+
BackToFront();
}
BOOL MoveFigure(int dx, int dy)
{
static long move_delay = 0;
+ static int last_move_dir = MV_NO_MOVING;
int moved = MF_NO_ACTION;
int oldJX = JX, oldJY = JY;
return(FALSE);
}
+
+ if (last_move_dir & (MV_LEFT | MV_RIGHT))
+ {
+ if (!(moved |= MoveFigureOneStep(0,dy, dx,dy)))
+ moved |= MoveFigureOneStep(dx,0, dx,dy);
+ }
+ else
+ {
+ if (!(moved |= MoveFigureOneStep(dx,0, dx,dy)))
+ moved |= MoveFigureOneStep(0,dy, dx,dy);
+ }
+
+ last_move_dir = MV_NO_MOVING;
+
+
+ /*
if (moved |= MoveFigureOneStep(dx,0, dx,dy))
moved |= MoveFigureOneStep(0,dy, dx,dy);
else
moved |= MoveFigureOneStep(0,dy, dx,dy);
moved |= MoveFigureOneStep(dx,0, dx,dy);
}
+ */
if (moved & MF_MOVING)
{
PlayerMovDir = (oldJY < JY ? MV_DOWN : MV_UP);
DrawLevelField(JX,JY); /* für "ErdreichAnbroeckeln()" */
+
+ last_move_dir = PlayerMovDir;
}
TestIfHeroHitsBadThing();
{
if (PlayerMovPos && oldX != -1 && oldY != -1)
{
+ if (Feld[JX2][JY2] == EL_LEERRAUM)
+ Feld[JX2][JY2] = EL_UNSICHTBAR;
DrawLevelElement(oldX,oldY, Feld[oldX][oldY]);
DrawPlayerField();
}
oldY = JY2;
actual_frame_counter = FrameCounter;
+ /*
redraw[redraw_x1 + oldX][redraw_y1 + oldY] = 1;
redraw_tiles++;
+ */
/*
DrawLevelElement(oldX,oldY, Feld[oldX][oldY]);
redraw_mask |= REDRAW_FIELD;
}
+ if (Feld[oldX][oldY] == EL_UNSICHTBAR)
+ Feld[oldX][oldY] = EL_LEERRAUM;
+
DrawLevelElement(oldX,oldY, Feld[oldX][oldY]);
DrawPlayerField();
#define IN_SCR_FIELD(x,y) ((x)>=BX1 && (x)<=BX2 && (y)>=BY1 &&(y)<=BY2)
#define IN_LEV_FIELD(x,y) ((x)>=0 && (x)<lev_fieldx && (y)>=0 &&(y)<lev_fieldy)
-/*
+
#define IS_PLAYER(x,y) (JX==(x) && JY==(y))
-*/
+/*
#define IS_PLAYER(x,y) ((JX==(x) && JY==(y)) || (JX2==(x) && JY2==(y)))
+*/
#define IS_FREE(x,y) (Feld[x][y]==EL_LEERRAUM && !IS_PLAYER(x,y))
#define IS_FREE_OR_PLAYER(x,y) (Feld[x][y]==EL_LEERRAUM)
#define REDRAW_VIDEO_2 (1L<<5)
#define REDRAW_VIDEO_3 (1L<<6)
#define REDRAW_MICROLEV (1L<<7)
+#define REDRAW_FROM_BACKBUFFER (1L<<8)
#define REDRAW_DOOR_2 (REDRAW_VIDEO_1 | REDRAW_VIDEO_2 | REDRAW_VIDEO_3)
#define REDRAW_DOORS (REDRAW_DOOR_1 | REDRAW_DOOR_2)
#define REDRAW_MAIN (REDRAW_FIELD | REDRAW_TILES | REDRAW_MICROLEV)
{SETUP_TOONS, "Toons:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
{SETUP_DIRECT_DRAW, "Buffered gfx:",{"off","on" }, {FC_BLUE,FC_YELLOW}},
{SETUP_SCROLL_DELAY,"Scroll Delay:",{"on", "off"}, {FC_YELLOW,FC_BLUE}},
+ {SETUP_SOFT_SCROLL, "Soft Scroll.:",{"on", "off"}, {FC_YELLOW,FC_BLUE}},
{SETUP_FADING, "Fading:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
{SETUP_QUICK_DOORS, "Quick Doors:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
{SETUP_AUTO_RECORD, "Auto-Record:", {"on", "off"}, {FC_YELLOW,FC_BLUE}},
player.setup ^= SETUP_SCROLL_DELAY;
}
else if (y==9)
+ {
+ if (SETUP_SOFT_SCROLL_ON(player.setup))
+ DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
+ else
+ DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
+ player.setup ^= SETUP_SOFT_SCROLL;
+ }
+ else if (y==10)
{
if (SETUP_FADING_ON(player.setup))
DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
player.setup ^= SETUP_FADING;
}
- else if (y==10)
+ else if (y==11)
{
if (SETUP_QUICK_DOORS_ON(player.setup))
DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
player.setup ^= SETUP_QUICK_DOORS;
}
- else if (y==11)
+ else if (y==12)
{
if (SETUP_AUTO_RECORD_ON(player.setup))
DrawText(SX+14*32, SY+yy*32,"off",FS_BIG,FC_BLUE);
DrawText(SX+14*32, SY+yy*32,"on ",FS_BIG,FC_YELLOW);
player.setup ^= SETUP_AUTO_RECORD;
}
- else if (y==12)
+ else if (y==13)
{
if (SETUP_2ND_JOYSTICK_ON(player.setup))
DrawText(SX+14*32, SY+yy*32,"1st",FS_BIG,FC_YELLOW);
DrawText(SX+14*32, SY+yy*32,"2nd",FS_BIG,FC_YELLOW);
player.setup ^= SETUP_2ND_JOYSTICK;
}
- else if (y==13)
+ else if (y==14)
{
CalibrateJoystick();
redraw = TRUE;
#include "main.h"
#define SETUP_SCREEN_POS_START 2
-#define SETUP_SCREEN_POS_END 15
+#define SETUP_SCREEN_POS_END 16
#define SETUP_SCREEN_POS_EMPTY (SETUP_SCREEN_POS_END - 2)
void DrawHeadline(void);
int fx = FX + (PlayerMovDir & (MV_LEFT|MV_RIGHT) ? ScreenMovPos : 0);
int fy = FY + (PlayerMovDir & (MV_UP|MV_DOWN) ? ScreenMovPos : 0);
- if (game_status == PLAYING)
+ if (game_status == PLAYING && !(redraw_mask & REDRAW_FROM_BACKBUFFER))
{
XCopyArea(display,buffer,window,gc,
fx,fy, SXSIZE,SYSIZE,
if (PlayerGone)
return;
+ /*
+ printf("INFO: DrawPlayerField(): x = %d, y = %d\n",x,y);
+ */
+
+
#if DEBUG
if (!IN_LEV_FIELD(x,y) || !IN_SCR_FIELD(sx,sy))
{
printf("DrawPlayerField(): x = %d, y = %d\n",x,y);
+ printf("DrawPlayerField(): sx = %d, sy = %d\n",sx,sy);
printf("DrawPlayerField(): This should never happen!\n");
return;
}
for(y=BY1; y<=BY2; y++)
DrawScreenField(x,y);
- redraw_mask |= REDRAW_FIELD;
+ if (soft_scrolling_on)
+ XCopyArea(display,fieldbuffer,backbuffer,gc,
+ FX,FY, SXSIZE,SYSIZE,
+ SX,SY);
+
+ redraw_mask |= (REDRAW_FIELD | REDRAW_FROM_BACKBUFFER);
}
void DrawMiniLevel(int scroll_x, int scroll_y)