#include <math.h>
+#ifdef MSDOS
+extern BOOL wait_for_vsync;
+#endif
+
void SetDrawtoField(int mode)
{
if (mode == DRAW_BUFFERED && soft_scrolling_on)
if (!redraw_mask)
return;
+ /* synchronize X11 graphics at this point; if we would synchronize the
+ display immediately after the buffer switching (after the XFlush),
+ this could mean that we have to wait for the graphics to complete,
+ although we could go on doing calculations for the next frame */
+
+ XSync(display,FALSE);
+
+#ifdef MSDOS
+ wait_for_vsync = TRUE;
+#endif
+
if (redraw_mask & REDRAW_ALL)
{
XCopyArea(display,backbuffer,window,gc,
XCopyArea(display,buffer,window,gc,
fx,fy, SXSIZE,SYSIZE,
SX,SY);
-
-
-
-#if 0
- printf("FULL SCREEN REDRAW [%d]\n", ScreenMovPos);
-#endif
-
-
-
}
redraw_mask &= ~REDRAW_MAIN;
}
break;
}
break;
+ case KeyRelease:
+ key_joystick_mapping = 0;
+ break;
case FocusIn:
case FocusOut:
HandleFocusEvent((XFocusChangeEvent *) &event);
break;
+ case ClientMessage:
+ HandleClientMessageEvent((XClientMessageEvent *) &event);
+ break;
default:
break;
}
new_door_state = MoveDoor(door_state);
-/*
- ClearEventQueue();
-*/
-
return(new_door_state);
}
new_door_state = MoveDoor(door_state);
-/*
- ClearEventQueue();
-*/
-
return(new_door_state);
}
{
static unsigned int door1 = DOOR_OPEN_1;
static unsigned int door2 = DOOR_CLOSE_2;
- int x, start, stepsize = 4, door_anim_delay = stepsize*5000;
+ static long door_delay = 0;
+ int x, start, stepsize = 2;
+ long door_delay_value = stepsize * 5000;
if (door_state == DOOR_GET_STATE)
return(door1 | door2);
if (quick_doors)
{
stepsize = 20;
- door_anim_delay = 0;
+ door_delay_value = 0;
StopSound(SND_OEFFNEN);
}
start = ((door_state & DOOR_NO_DELAY) ? DXSIZE : 0);
- for(x=start;x<=DXSIZE;x+=stepsize)
+ for(x=start; x<=DXSIZE; x+=stepsize)
{
+ while(!DelayReached(&door_delay, door_delay_value/10000))
+ Delay(1000);
+
if (door_state & DOOR_ACTION_1)
{
int i = (door_state & DOOR_OPEN_1 ? DXSIZE-x : x);
}
BackToFront();
- Delay(door_anim_delay);
if (game_status==MAINMENU)
DoAnimation();