Exemplo n.º 1
0
void
draw_animated_foreground (ALLEGRO_BITMAP *bitmap, int room)
{
  int room_view_bkp = room_view;
  room_view = room;

  struct pos p;
  p.room = room_view;

  for (p.floor = FLOORS; p.floor >= -1; p.floor--)
    for (p.place = -1; p.place < PLACES; p.place++) {
      if (con (&p)->fg != MIRROR) continue;
      update_mirror_bitmap (bitmap, &p);
      draw_mirror (bitmap, &p, em, vm);
    }

  /* loose_floor_fall_debug (); */

  for (p.floor = FLOORS; p.floor >= -1; p.floor--)
    for (p.place = -1; p.place < PLACES; p.place++) {
      draw_falling_loose_floor (bitmap, &p, em, vm);
    }

  draw_anims (bitmap, em, vm);

  for (p.floor = FLOORS; p.floor >= -1; p.floor--)
    for (p.place = -1; p.place < PLACES; p.place++) {
      draw_potion (bitmap, &p, em, vm);
      if (is_sword (&p)) draw_sword (bitmap, &p, vm);
    }

  room_view = room_view_bkp;
}
Exemplo n.º 2
0
void
draw_animated_foreground (ALLEGRO_BITMAP *bitmap, int room)
{
  room_view = room;

  struct pos p; new_pos (&p, &global_level, room, -1, -1);

  /* loose_floor_fall_debug (); */

  for (p.floor = FLOORS; p.floor >= -1; p.floor--)
    for (p.place = -1; p.place < PLACES; p.place++) {
      draw_falling_loose_floor (bitmap, &p, em, vm);
    }

  draw_anims (bitmap, em, vm);

  for (p.floor = FLOORS; p.floor >= -1; p.floor--)
    for (p.place = -1; p.place < PLACES; p.place++) {
      draw_potion (bitmap, &p, em, vm);
      if (is_sword (&p)) draw_sword (bitmap, &p, vm);
    }

  /* editor graphics */
  switch (edit) {
  case EDIT_GUARD:
  case EDIT_GUARD_SELECT:
  case EDIT_GUARD_SKILL:
  case EDIT_SKILL_LEGACY_TEMPLATES:
  case EDIT_GUARD_TYPE:
  case EDIT_GUARD_STYLE:
  case EDIT_GUARD_SKILL_ATTACK:
  case EDIT_GUARD_SKILL_COUNTER_ATTACK:
  case EDIT_GUARD_SKILL_DEFENSE:
  case EDIT_GUARD_SKILL_COUNTER_DEFENSE:
  case EDIT_GUARD_SKILL_ADVANCE:
  case EDIT_GUARD_SKILL_RETURN:
  case EDIT_GUARD_SKILL_REFRACTION:
  case EDIT_GUARD_SKILL_EXTRA_LIFE:
  case EDIT_GUARD_LIVES:
    draw_start_guards (bitmap, vm);
    break;
  case EDIT_KID:
    draw_start_kid (bitmap, vm);
    break;
  default: break;
  }

  for (p.floor = FLOORS; p.floor >= -1; p.floor--)
    for (p.place = -1; p.place < PLACES; p.place++)
      draw_box (bitmap, &p, vm);
}
Exemplo n.º 3
0
void
loose_floor_fall_debug (void)
{
  int i;
  for (i = 0; i < loose_floor_nmemb; i++) {
    struct loose_floor *l = &loose_floor[i];
    if (l->action != FALL_LOOSE_FLOOR) continue;
    struct pos pv; pos2room (&l->p, room_view, &pv);
    struct coord cv; coord2room (&l->f.c, room_view, &cv);
    printf ("(%i,%i,%i) == (%i,%i,%i) <%i,%i,%i> <%i,%i,%i> ? %i ? %i\n",
            l->p.room, l->p.floor, l->p.place,
            pv.room, pv.floor, pv.place,
            l->f.c.room, l->f.c.x, l->f.c.y,
            cv.room, cv.x, cv.y,
            peq (&l->p, &pv),
            cpos (&l->p, &pv));
    draw_falling_loose_floor (screen, &loose_floor[i].p, em, vm);
  }
}
Exemplo n.º 4
0
void
draw_room_frame_fg (ALLEGRO_BITMAP *bitmap, enum em em, enum vm vm,
                    struct frame *f)
{
  struct pos ptl, pbr, ptl2, pbr2;

  survey (_tl, posf, f, NULL, &ptl, NULL);
  survey (_br, posf, f, NULL, &pbr, NULL);
  pos2room (&ptl, room_view, &ptl);
  pos2room (&pbr, room_view, &pbr);

  survey (_tl, pos, f, NULL, &ptl2, NULL);
  survey (_br, pos, f, NULL, &pbr2, NULL);
  pos2room (&ptl2, room_view, &ptl2);
  pos2room (&pbr2, room_view, &pbr2);

  struct coord c; frame2room (f, room_view, &c);

  int w = al_get_bitmap_width (f->b);
  int h = al_get_bitmap_height (f->b);

  push_clipping_rectangle (bitmap, c.x, c.y, w, h);

  /* FALLING LOOSE FLOOR */
  struct pos ptr, ptra;
  survey (_tr, posf, f, NULL, &ptr, NULL);
  prel (&ptr, &ptra, -1, +0);
  draw_falling_loose_floor (bitmap, &ptr, em, vm);
  draw_falling_loose_floor (bitmap, &ptra, em, vm);

  struct pos p = ptl;
  for (p.floor = pbr.floor; p.floor >= ptl.floor; p.floor--)
    for (p.place = ptl.place; p.place <= pbr.place; p.place++)
      switch (fake (&p)) {
      case SPIKES_FLOOR: draw_spikes_fg (bitmap, &p, em, vm); break;
      case BROKEN_FLOOR: draw_broken_floor_fg (bitmap, &p, em, vm); break;
      case OPENER_FLOOR: draw_opener_floor_fg (bitmap, &p, em, vm); break;
      case CLOSER_FLOOR: draw_closer_floor_fg (bitmap, &p, em, vm); break;
      case PILLAR: draw_pillar_fg (bitmap, &p, em, vm); break;
      case BIG_PILLAR_BOTTOM:
        draw_big_pillar_bottom_fg (bitmap, &p, em, vm); break;
      case BIG_PILLAR_TOP:
        draw_big_pillar_top_left (bitmap, &p, em, vm); break;
      case ARCH_BOTTOM: draw_arch_bottom_fg (bitmap, &p, em, vm); break;
      case WALL: draw_wall_fg (bitmap, &p, f, em, vm); break;
      case CHOPPER: draw_chopper_fg (bitmap, &p, em, vm); break;
      case MIRROR: draw_mirror_fg (bitmap, &p, f, em, vm); break;
      case ARCH_TOP_MID: draw_arch_top_mid (bitmap, &p, em, vm); break;
      case ARCH_TOP_SMALL: draw_arch_top_small (bitmap, &p, em, vm); break;
      case ARCH_TOP_LEFT: draw_arch_top_left (bitmap, &p, em, vm); break;
      case ARCH_TOP_RIGHT: draw_arch_top_right (bitmap, &p, em, vm); break;
      default: break;
      }

  p = ptl2;
  for (p.floor = pbr2.floor; p.floor >= ptl2.floor; p.floor--)
    for (p.place = ptl2.place; p.place <= pbr2.place; p.place++)
      switch (fake (&p)) {
      case WALL: draw_wall_fg (bitmap, &p, f, em, vm); break;
      case DOOR: draw_door_fg (bitmap, &p, f, em, vm); break;
      case CARPET: draw_carpet_fg (bitmap, &p, f, em, vm); break;
      case TCARPET: draw_carpet_fg (bitmap, &p, f, em, vm); break;
      default: break;
      }

  pop_clipping_rectangle ();
}