void SetDrawtoField(int mode)
{
- if (mode == DRAW_BUFFERED && setup.soft_scrolling_on)
+ if (mode == DRAW_BUFFERED && setup.soft_scrolling)
{
FX = TILEX;
FY = TILEY;
void BackToFront()
{
int x,y;
- Drawable buffer = (drawto_field != window ? drawto_field : backbuffer);
+ Drawable buffer = (drawto_field == window ? backbuffer : drawto_field);
- if (setup.direct_draw_on && game_status == PLAYING)
+ if (setup.direct_draw && game_status == PLAYING)
redraw_mask &= ~REDRAW_MAIN;
if (redraw_mask & REDRAW_TILES && redraw_tiles > REDRAWTILES_THRESHOLD)
redraw_mask |= REDRAW_FIELD;
- if (redraw_mask & REDRAW_FIELD || ScreenGfxPos)
+ if (redraw_mask & REDRAW_FIELD)
redraw_mask &= ~REDRAW_TILES;
+ /*
+ if (redraw_mask & REDRAW_FIELD ||
+ (ScreenGfxPos && setup.soft_scrolling && game_status == PLAYING))
+ redraw_mask &= ~REDRAW_TILES;
+ */
+
if (!redraw_mask)
return;
{
int fx = FX, fy = FY;
- if (setup.soft_scrolling_on)
+ if (setup.soft_scrolling)
{
fx += (ScreenMovDir & (MV_LEFT|MV_RIGHT) ? ScreenGfxPos : 0);
fy += (ScreenMovDir & (MV_UP|MV_DOWN) ? ScreenGfxPos : 0);
/*
long fading_delay = 300;
- if (setup.fading_on && (redraw_mask & REDRAW_FIELD))
+ if (setup.fading && (redraw_mask & REDRAW_FIELD))
{
*/
XFillRectangle(display,backbuffer,gc,
REAL_SX,REAL_SY, FULL_SXSIZE,FULL_SYSIZE);
- if (setup.soft_scrolling_on && game_status==PLAYING)
+ if (setup.soft_scrolling && game_status==PLAYING)
{
XFillRectangle(display,fieldbuffer,gc,
0,0, FXSIZE,FYSIZE);
else
SetDrawtoField(DRAW_BACKBUFFER);
- if (setup.direct_draw_on && game_status==PLAYING)
+ if (setup.direct_draw && game_status==PLAYING)
{
XFillRectangle(display,window,gc,
REAL_SX,REAL_SY, FULL_SXSIZE,FULL_SYSIZE);
int element = Feld[jx][jy];
int graphic, phase;
- /*
- if (!player->active || player->gone || !IN_SCR_FIELD(sx,sy))
- return;
- */
-
if (!player->active || player->gone ||
!IN_SCR_FIELD(SCREENX(last_jx),SCREENY(last_jy)))
return;
if (!IN_SCR_FIELD(sx,sy))
return;
- if (setup.direct_draw_on)
+ if (setup.direct_draw)
SetDrawtoField(DRAW_BUFFERED);
/* draw things behind the player, if needed */
syy = player->GfxPos;
}
- if (!setup.soft_scrolling_on && ScreenMovPos)
+ if (!setup.soft_scrolling && ScreenMovPos)
sxx = syy = 0;
DrawGraphicShiftedThruMask(sx,sy, sxx,syy, graphic, NO_CUTTING);
GFX_EXPLOSION + ((phase-1)/delay-1));
}
- if (setup.direct_draw_on)
+ if (setup.direct_draw)
{
int dest_x = SX + SCREENX(MIN(jx,last_jx))*TILEX;
int dest_y = SY + SCREENY(MIN(jy,last_jy))*TILEY;
for(y=BY1; y<=BY2; y++)
DrawScreenField(x,y);
- if (setup.soft_scrolling_on)
+ if (setup.soft_scrolling)
XCopyArea(display,fieldbuffer,backbuffer,gc,
FX,FY, SXSIZE,SYSIZE,
SX,SY);
XEvent event;
XNextEvent(display, &event);
+
switch(event.type)
{
- case Expose:
- HandleExposeEvent((XExposeEvent *) &event);
- break;
- case UnmapNotify:
- SleepWhileUnmapped();
- break;
case ButtonPress:
case ButtonRelease:
case MotionNotify:
case BUTTON_CONFIRM:
result = TRUE | FALSE;
break;
+
case BUTTON_PLAYER_1:
result = 1;
break;
case BUTTON_PLAYER_4:
result = 4;
break;
+
default:
break;
}
break;
}
+
case KeyPress:
switch(XLookupKeysym((XKeyEvent *)&event,
((XKeyEvent *)&event)->state))
case XK_Return:
result = 1;
break;
+
case XK_Escape:
result = 0;
break;
+
+ default:
+ break;
}
if (req_state & REQ_PLAYER)
result = 0;
break;
+
case KeyRelease:
key_joystick_mapping = 0;
break;
- case FocusIn:
- case FocusOut:
- HandleFocusEvent((XFocusChangeEvent *) &event);
- break;
- case ClientMessage:
- HandleClientMessageEvent((XClientMessageEvent *) &event);
- break;
+
default:
+ HandleOtherEvents(&event);
break;
}
}
- else if (JoystickButton() == JOY_BUTTON_NEW_PRESSED)
+ else if (AnyJoystickButton() == JOY_BUTTON_NEW_PRESSED)
{
- int joy=Joystick();
+ int joy = AnyJoystick();
if (joy & JOY_BUTTON_1)
result = 1;
}
}
+ if (setup.quick_doors)
+ StopSound(SND_OEFFNEN);
+
if (door_state & DOOR_ACTION_1)
door1 = door_state & DOOR_ACTION_1;
if (door_state & DOOR_ACTION_2)