}
else if (IS_PACMAN(element))
{
-#if 0
- int phase = element - EL_PACMAN_RIGHT;
-
- game_mm.pacman[game_mm.num_pacman].x = x;
- game_mm.pacman[game_mm.num_pacman].y = y;
- game_mm.pacman[game_mm.num_pacman].dir = phase + ((phase + 1) % 2) * 2;
- game_mm.num_pacman++;
-#else
InitMovDir_MM(x, y);
-#endif
}
else if (IS_MCDUFFIN(element) || IS_LASER(element))
{
#endif
UnmapGameButtons();
- /*
- game_gadget[SOUND_CTRL_ID_MUSIC]->checked = setup.sound_music;
- game_gadget[SOUND_CTRL_ID_LOOPS]->checked = setup.sound_loops;
- game_gadget[SOUND_CTRL_ID_SIMPLE]->checked = setup.sound_simple;
- */
MapGameButtons();
#if 0
int i;
#if 0
- /* for security */
+ /* for safety */
if (SX + LX < REAL_SX || SX + LX >= REAL_SX + FULL_SXSIZE ||
SY + LY < REAL_SY || SY + LY >= REAL_SY + FULL_SYSIZE)
{
{
int element;
int end = 0, rf = laser.num_edges;
-#if 0
- unsigned short color_scale = 0xFFFF / 15;
-#endif
-#if 0
- int testx, testy;
-#endif
laser.overloaded = FALSE;
laser.stops_inside_element = FALSE;
-#if 0
- if (laser.overload_value < MAX_LASER_OVERLOAD - 8)
- SetRGB(pen_ray,
- (laser.overload_value / 6) * color_scale, 0x0000,
- (15 - (laser.overload_value / 6)) * color_scale);
-#endif
-
DrawLaser(0, DL_LASER_ENABLED);
#if 0
ELY = (LY - 2) / TILEY;
}
-
#if 0
printf("hit_mask (2) == '%x' (%d, %d) (%d, %d)\n",
hit_mask, LX, LY, ELX, ELY);
printf("WARNING! (1) %d, %d (%d)\n", ELX, ELY, element);
#endif
-#if 0
- testx = ELX;
- testy = ELY;
-#endif
-
if (element == EL_EMPTY)
{
if (!HitOnlyAnEdge(element, hit_mask))
rf = laser.num_edges;
}
- /*
- element = Feld[ELX][ELY];
- laser.dest_element = element;
- */
-
-
-
-
#if 0
if (laser.dest_element != Feld[ELX][ELY])
{
}
#endif
-
if (!end && !laser.stops_inside_element && !StepBehind())
{
#if 0
Ct = CT = Counter();
-
#if 0
if (!IN_LEV_FIELD(ELX, ELY))
printf("WARNING! (2) %d, %d\n", ELX, ELY);
#endif
-
-
-#if 0
- printf("(%d, %d) == %d [(%d, %d) == %d]\n",
- testx, testy, laser.dest_element,
- ELX, ELY, (IN_SCR_FIELD(ELX,ELY) ? Feld[ELX][ELY] : -1));
-#endif
-
}
void DrawLaserExt(int start_edge, int num_edges, int mode)
ely = laser.damage[damage_start].y;
element = Feld[elx][ely];
-
#if 0
if (IS_BEAMER(element))
{
AddDamagedField(ELX, ELY);
-#if 0
- if (ELX != (LX + 5 * XS) / TILEX ||
- ELY != (LY + 5 * YS) / TILEY)
- {
- LX += 2 * XS;
- LY += 2 * YS;
-
- return FALSE;
- }
-
-#else
-
/* this is more precise: check if laser would go through the center */
if ((ELX * TILEX + 14 - LX) * YS != (ELY * TILEY + 14 - LY) * XS)
{
return FALSE;
}
-#endif
#if 0
printf("HitElement (2): element == %d\n", element);
if (element == EL_KETTLE || element == EL_CELL)
{
-#if 0
- if (game_mm.kettles_still_needed)
- DrawText(DX_KETTLES, DY_KETTLES,
- int2str(--game_mm.kettles_still_needed, 3), FONT_TEXT_2);
-#endif
RaiseScore_MM(10);
if (game_mm.kettles_still_needed == 0)
if (laser.current_angle == grid_angle ||
laser.current_angle == get_opposite_angle(grid_angle))
{
-#if 0
- int step_size;
-
- if (!IS_22_5_ANGLE(laser.current_angle)) /* 90° or 45° angle */
- step_size = 8;
- else
- step_size = 4;
-
- LX += step_size * XS;
- LY += step_size * YS;
-#else
-
/* skip the whole element before continuing the scan */
do
{
LX -= XS;
LY -= YS;
}
-#endif
AddLaserEdge(LX, LY);
if (MovDelay[x][y]) /* wait some time before next frame */
{
-#if 0
- int phase;
-#endif
-
MovDelay[x][y]--;
-#if 0
- phase = MovDelay[x][y] / delay;
-#endif
if (!(MovDelay[x][y] % delay) && IN_SCR_FIELD(x, y))
{
Bitmap *bitmap;
int num_phase = 9, delay = 2;
int last_phase = num_phase * delay;
int half_phase = (num_phase / 2) * delay;
-#if 0
- int first_phase_after_start = EX_PHASE_START + 1;
-#endif
laser.redraw = TRUE;
if (phase == last_phase)
{
-#if 0
- int element;
-#endif
-
if (Store[x][y] == EL_BOMB)
{
laser.num_damages--;
Store[x][y] = EL_EMPTY;
}
-#if 0
- element = Feld[x][y] = Store[x][y];
-#endif
Store[x][y] = Store2[x][y] = 0;
MovDir[x][y] = MovPos[x][y] = MovDelay[x][y] = 0;
InitField(x, y, FALSE);
int element = Feld[x][y];
int old_move_dir = MovDir[x][y];
-#if 0
- int left_dir = turn[old_move_dir].left;
-#endif
int right_dir = turn[old_move_dir].right;
int back_dir = turn[old_move_dir].back;
-
-#if 0
- int left_dx = move_xy[left_dir].x, left_dy = move_xy[left_dir].y;
-#endif
int right_dx = move_xy[right_dir].x, right_dy = move_xy[right_dir].y;
-
-#if 0
- int left_x = x+left_dx, left_y = y+left_dy;
-#endif
int right_x = x+right_dx, right_y = y+right_dy;
if (element == EL_PACMAN)
{
-#if 0
- boolean can_turn_left = FALSE;
-#endif
boolean can_turn_right = FALSE;
-#if 0
- if (IN_LEV_FIELD(left_x, left_y) &&
- IS_EATABLE4PACMAN(Feld[left_x][left_y]))
- can_turn_left = TRUE;
-#endif
if (IN_LEV_FIELD(right_x, right_y) &&
IS_EATABLE4PACMAN(Feld[right_x][right_y]))
can_turn_right = TRUE;
static unsigned int pacman_delay = 0;
static unsigned int energy_delay = 0;
static unsigned int overload_delay = 0;
-#if 0
- unsigned short color_scale = 0xFFFF / 15;
-#endif
int element;
int x, y, i;
int r, d;
-#if 1
WaitUntilDelayReached(&action_delay, GameFrameDelay);
-#else
- if (!DelayReached(&action_delay, GameFrameDelay))
- {
- if (!PendingEvent()) /* delay only if no pending events */
- Delay(10);
- return;
- }
-#endif
for (y=0; y<lev_fieldy; y++) for (x=0; x<lev_fieldx; x++)
Stop[x][y] = FALSE;
SX + g * TILEX, SY + 4 * TILEY, TILEX, TILEY,
ox + i * mx, oy + i * my);
#endif
-
-#if 0
- FlushDisplay();
- Delay(1);
-#endif
}
Ct = Ct + Counter() - CT;
}
printf("DrawGraphic_MM(): x = %d, y = %d, graphic = %d\n",x,y,graphic);
printf("DrawGraphic_MM(): This should never happen!\n");
-#if 1
- {
- int i=0;
- i=i/i;
- }
-#endif
-
return;
}
#endif
MarkTileDirty(x,y);
}
-void DrawGraphicThruMaskExt_MM(DrawBuffer *d, int dest_x, int dest_y, int graphic)
+void DrawGraphicThruMaskExt_MM(DrawBuffer *d, int dest_x, int dest_y,
+ int graphic)
{
int src_x, src_y;
Bitmap *src_bitmap;
Pixel ReadPixel(DrawBuffer *bitmap, int x, int y)
{
-#if defined(TARGET_SDL) || defined(TARGET_ALLEGRO)
return GetPixel(bitmap, x, y);
-#else
- /* GetPixel() does also work for X11, but we use some optimization here */
- unsigned int pixel_value;
-
- if (bitmap == pix[PIX_BACK])
- {
- /* when reading pixel values from images, it is much faster to use
- client side images (XImage) than server side images (Pixmap) */
- static XImage *client_image = NULL;
-
- if (client_image == NULL) /* init image cache, if not existing */
- client_image = XGetImage(display, bitmap->drawable,
- 0,0, WIN_XSIZE,WIN_YSIZE, AllPlanes, ZPixmap);
-
- pixel_value = XGetPixel(client_image, x, y);
- }
- else
- {
- XImage *pixel_image;
-
- pixel_image = XGetImage(display, bitmap->drawable, x, y, 1, 1,
- AllPlanes, ZPixmap);
- pixel_value = XGetPixel(pixel_image, 0, 0);
-
- XDestroyImage(pixel_image);
- }
-
- return pixel_value;
-#endif
}
void SetRGB(unsigned int pixel,
unsigned short red, unsigned short green, unsigned short blue)
{
- return;
-
-#if 0
- XColor color;
-
- if (color_status==STATIC_COLORS)
- return;
-
- color.pixel = pixel;
- color.red = red;
- color.green = green;
- color.blue = blue;
- color.flags = DoRed | DoGreen | DoBlue;
- XStoreColor(display, cmap, &color);
- XFlush(display);
-#endif
}
int get_base_element(int element)