Exemplo n.º 1
0
void
draw_arch_top_top (ALLEGRO_BITMAP *bitmap, struct pos *p,
                   enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *arch_top_top = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA: arch_top_top = dc_arch_top_top; break;
    case EGA: arch_top_top = de_arch_top_top; break;
    case VGA: arch_top_top = dv_arch_top_top; break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA: arch_top_top = pc_arch_top_top; break;
    case EGA: arch_top_top = pe_arch_top_top; break;
    case VGA: arch_top_top = pv_arch_top_top; break;
    }
    break;
  }

  if (vm == VGA) arch_top_top = apply_hue_palette (arch_top_top);
  if (hgc) arch_top_top = apply_palette (arch_top_top, hgc_palette);
  if (peq (p, &mouse_pos))
    arch_top_top = apply_palette (arch_top_top, selection_palette);

  struct coord c;
  draw_bitmapc (arch_top_top, bitmap, arch_top_top_coord (p, &c), 0);
}
Exemplo n.º 2
0
void
draw_unpressed_closer_floor_base (ALLEGRO_BITMAP *bitmap, struct pos *p,
                                  enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *unpressed_closer_floor_base = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA: unpressed_closer_floor_base = dc_unpressed_closer_floor_base; break;
    case EGA: unpressed_closer_floor_base = de_unpressed_closer_floor_base; break;
    case VGA: unpressed_closer_floor_base = dv_unpressed_closer_floor_base; break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA: unpressed_closer_floor_base = pc_unpressed_closer_floor_base; break;
    case EGA: unpressed_closer_floor_base = pe_unpressed_closer_floor_base; break;
    case VGA: unpressed_closer_floor_base = pv_unpressed_closer_floor_base; break;
    }
    break;
  }

  if (vm == VGA) unpressed_closer_floor_base = apply_hue_palette (unpressed_closer_floor_base);
  if (hgc) unpressed_closer_floor_base = apply_palette (unpressed_closer_floor_base, hgc_palette);
  if (peq (p, &mouse_pos)) unpressed_closer_floor_base = apply_palette (unpressed_closer_floor_base, selection_palette);

  struct coord c;
  draw_bitmapc (unpressed_closer_floor_base, bitmap,
                floor_base_coord (p, &c), 0);
}
Exemplo n.º 3
0
void
draw_unpressed_opener_floor_right (ALLEGRO_BITMAP *bitmap, struct pos *p,
                                   enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *unpressed_opener_floor_right = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA: unpressed_opener_floor_right = dc_unpressed_opener_floor_right; break;
    case EGA: unpressed_opener_floor_right = de_unpressed_opener_floor_right; break;
    case VGA: unpressed_opener_floor_right = dv_unpressed_opener_floor_right; break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA: unpressed_opener_floor_right = pc_unpressed_opener_floor_right; break;
    case EGA: unpressed_opener_floor_right = pe_unpressed_opener_floor_right; break;
    case VGA: unpressed_opener_floor_right = pv_unpressed_opener_floor_right; break;
    }
    break;
  }

  if (hgc) unpressed_opener_floor_right = apply_palette (unpressed_opener_floor_right, hgc_palette);

  struct coord c;
  draw_bitmapc (unpressed_opener_floor_right, bitmap,
                unpressed_opener_floor_right_coord (p, &c), 0);
}
Exemplo n.º 4
0
void
draw_floor_corner_02 (ALLEGRO_BITMAP *bitmap, struct pos *p,
                      enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *floor_corner_02 = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA: floor_corner_02 = dc_floor_corner_02; break;
    case EGA: floor_corner_02 = de_floor_corner_02; break;
    case VGA: floor_corner_02 = dv_floor_corner_02; break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA: floor_corner_02 = pc_floor_corner_02; break;
    case EGA: floor_corner_02 = pe_floor_corner_02; break;
    case VGA: floor_corner_02 = pv_floor_corner_02; break;
    }
    break;
  }

  if (vm == VGA) floor_corner_02 = apply_hue_palette (floor_corner_02);
  if (hgc) floor_corner_02 = apply_palette (floor_corner_02, hgc_palette);
  if (peq (p, &mouse_pos))
    floor_corner_02 = apply_palette (floor_corner_02, selection_palette);

  struct coord c; floor_corner_02_coord (p, &c);
  if (con (p)->fg == CLOSER_FLOOR) c.y += 1;
  draw_bitmapc (floor_corner_02, bitmap, &c, 0);
}
Exemplo n.º 5
0
void
draw_spikes_fg_04 (ALLEGRO_BITMAP *bitmap, struct pos *p,
                   enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *spikes_fg_04 = NULL;
  pos2coord_f spikes_fg_04_coord = NULL;

  switch (em) {
  case DUNGEON:
    spikes_fg_04_coord = d_spikes_fg_04_coord;
    switch (vm) {
    case CGA: spikes_fg_04 = dc_spikes_fg_04; break;
    case EGA: spikes_fg_04 = de_spikes_fg_04; break;
    case VGA: spikes_fg_04 = dv_spikes_fg_04; break;
    }
    break;
  case PALACE:
    spikes_fg_04_coord = p_spikes_fg_04_coord;
    switch (vm) {
    case CGA: spikes_fg_04 = pc_spikes_fg_04; break;
    case EGA: spikes_fg_04 = pe_spikes_fg_04; break;
    case VGA: spikes_fg_04 = pv_spikes_fg_04; break;
    }
    break;
  }

  if (vm == VGA) spikes_fg_04 = apply_hue_palette (spikes_fg_04);
  if (hgc) spikes_fg_04 = apply_palette (spikes_fg_04, hgc_palette);
  if (peq (p, &mouse_pos))
    spikes_fg_04 = apply_palette (spikes_fg_04, selection_palette);

  struct coord c;
  draw_bitmapc (spikes_fg_04, bitmap, spikes_fg_04_coord (p, &c), 0);
}
Exemplo n.º 6
0
void
draw_mirror_fg (ALLEGRO_BITMAP *bitmap, struct pos *p,
                enum em em, enum vm vm)
{
  struct coord c;

  ALLEGRO_BITMAP *mirror = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA: mirror = dc_mirror; break;
    case EGA: mirror = de_mirror; break;
    case VGA: mirror = dv_mirror; break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA: mirror = pc_mirror; break;
    case EGA: mirror = pe_mirror; break;
    case VGA: mirror = pv_mirror; break;
    }
    break;
  }

  if (hgc) mirror = apply_palette (mirror, hgc_palette);

  ALLEGRO_BITMAP *b = mirror_bitmap[p->floor + 1][p->place + 1];
  if (b) draw_bitmapc (b, bitmap, mirror_reflex_coord (p, &c), 0);

  int h = al_get_bitmap_height (mirror);
  draw_bitmap_regionc (mirror, bitmap, 0, 0, 22, h, mirror_coord (p, &c), 0);
}
Exemplo n.º 7
0
void
draw_pressed_closer_floor_left (ALLEGRO_BITMAP *bitmap, struct pos *p,
                                enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *pressed_closer_floor_left = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA: pressed_closer_floor_left = dc_floor_left; break;
    case EGA: pressed_closer_floor_left = de_floor_left; break;
    case VGA: pressed_closer_floor_left = dv_floor_left; break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA: pressed_closer_floor_left = pc_floor_left; break;
    case EGA: pressed_closer_floor_left = pe_floor_left; break;
    case VGA: pressed_closer_floor_left = pv_floor_left; break;
    }
    break;
  }

  if (vm == VGA) pressed_closer_floor_left = apply_hue_palette (pressed_closer_floor_left);
  if (hgc) pressed_closer_floor_left = apply_palette (pressed_closer_floor_left, hgc_palette);
  if (peq (p, &mouse_pos))
    pressed_closer_floor_left = apply_palette (pressed_closer_floor_left, selection_palette);

  struct coord c;
  draw_bitmapc (pressed_closer_floor_left, bitmap,
                pressed_closer_floor_left_coord (p, &c), 0);
}
Exemplo n.º 8
0
void
draw_right_mark (ALLEGRO_BITMAP *bitmap, struct pos *p, int r,
                 enum vm vm)
{
  ALLEGRO_BITMAP *wall_mark_top_right = NULL,
    *wall_mark_bottom_right = NULL;

  if (vm == VGA) {
    wall_mark_top_right = apply_hue_palette (dv_wall_mark_top_right);
    wall_mark_bottom_right = apply_hue_palette (dv_wall_mark_bottom_right);
  } else {
    wall_mark_top_right = de_wall_mark_top_right;
    wall_mark_bottom_right = de_wall_mark_bottom_right;
  }

  if (peq (p, &mouse_pos)) {
    wall_mark_top_right = apply_palette (wall_mark_top_right, selection_palette);
    wall_mark_bottom_right = apply_palette (wall_mark_bottom_right, selection_palette);
  }

  ALLEGRO_BITMAP *wall_mark;
  const int floor_offset[4] = {52, 42, 31, 21};

  if (r % 2) wall_mark = wall_mark_bottom_right;
  else wall_mark = wall_mark_top_right;

  struct coord c;
  c.room = p->room;
  c.x = 32 * p->place + 8 * ((r > 1) ? 1 : 0)
    + ((r < 2) ? 24 : r1 - 3);
  c.y = 63 * p->floor + 56 - floor_offset[r];
  draw_bitmapc (wall_mark, bitmap, &c, 0);
}
Exemplo n.º 9
0
void
draw_sword (ALLEGRO_BITMAP *bitmap, struct pos *p, enum vm vm, bool start_pos)
{
  ALLEGRO_BITMAP *normal_sword = sword_bitmap (vm),
    *shiny_sword = shiny_sword_bitmap (vm);

  if (hgc) {
    normal_sword = apply_palette (normal_sword, hgc_palette);
    shiny_sword = apply_palette (shiny_sword, hgc_palette);
  }

  if (start_pos) {
    normal_sword = apply_palette (normal_sword, start_anim_palette);
    shiny_sword = apply_palette (shiny_sword, start_anim_palette);
  }

  struct coord c;
  ALLEGRO_BITMAP *sword = anim_cycle % 60 ? normal_sword : shiny_sword;
  seedp (p);
  draw_bitmapc (sword, bitmap, sword_coord (p, &c),
                prandom (1) ? ALLEGRO_FLIP_HORIZONTAL : 0);
  unseedp ();

  if (! start_pos) {
    push_clipping_rectangle (bitmap, c.x, c.y,
                             al_get_bitmap_width (sword),
                             al_get_bitmap_height (sword));
    draw_confg_fg (bitmap, p, em, vm, NULL);
    pop_clipping_rectangle ();
  }
}
Exemplo n.º 10
0
void
draw_divider_01 (ALLEGRO_BITMAP *bitmap, struct pos *p,
                 enum em em, enum vm vm)
{
  struct coord c;
  draw_bitmapc (wall_divider_01, bitmap, wall_divider_01_coord (p, &c), 0);
}
Exemplo n.º 11
0
void
draw_spikes_floor_floor_right (ALLEGRO_BITMAP *bitmap, struct pos *p,
                               enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *spikes_floor_right = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA: spikes_floor_right = dc_spikes_floor_right; break;
    case EGA: spikes_floor_right = de_spikes_floor_right; break;
    case VGA: spikes_floor_right = dv_spikes_floor_right; break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA: spikes_floor_right = pc_spikes_floor_right; break;
    case EGA: spikes_floor_right = pe_spikes_floor_right; break;
    case VGA: spikes_floor_right = pv_spikes_floor_right; break;
    }
    break;
  }

  if (vm == VGA) spikes_floor_right = apply_hue_palette (spikes_floor_right);
  if (hgc) spikes_floor_right = apply_palette (spikes_floor_right, hgc_palette);
  if (peq (p, &mouse_pos))
    spikes_floor_right = apply_palette (spikes_floor_right, selection_palette);

  struct coord c;
  draw_bitmapc (spikes_floor_right, bitmap, floor_right_coord (p, &c), 0);
}
Exemplo n.º 12
0
void
draw_box (ALLEGRO_BITMAP* bitmap, struct pos *p, enum vm vm)
{
  struct coord c;
  if (! peq (&mouse_pos, p)) return;

  ALLEGRO_BITMAP *box = get_box_frame (anim_cycle % 3, vm);
  draw_bitmapc (box, bitmap, box_coord (p, &c), 0);
}
Exemplo n.º 13
0
void
draw_guard_lives (ALLEGRO_BITMAP *bitmap, struct anim *g, enum vm vm)
{
    if (g->dont_draw_lives) return;
    if (g->current_lives <= 0) return;

    int current_lives = (g->current_lives > 10)
                        ? 10 : g->current_lives;

    int i;
    struct coord c;
    struct rect r;
    new_rect (&r, room_view, ORIGINAL_WIDTH - 7 * current_lives,
              ORIGINAL_HEIGHT - 8, 7 * current_lives,
              ORIGINAL_HEIGHT - 1);

    ALLEGRO_COLOR bg_color;

    switch (vm) {
    case CGA:
        bg_color = C_LIVES_RECT_COLOR;
        break;
    case EGA:
        bg_color = E_LIVES_RECT_COLOR;
        break;
    case VGA:
        bg_color = V_LIVES_RECT_COLOR;
        break;
    }

    draw_filled_rect (bitmap, &r, bg_color);

    ALLEGRO_BITMAP *life = guard_life;
    palette pal = NULL;

    if ((g->type == SHADOW && g->style == 0)
            || g->type == KID) {
        pal = get_shadow_life_palette (vm);
        life = apply_palette (life, pal);
    } else if (g->type == SKELETON && g->style == 0)
        life = apply_palette (life, skeleton_life_palette);
    else if (is_guard (g)) {
        pal = get_guard_palette (g->style, vm);
        life = apply_palette (life, pal);
    }

    if (hgc) life = apply_palette (life, hgc_palette);

    for (i = 0; i < current_lives; i++)
        draw_bitmapc (life, bitmap, guard_life_coord (i, &c), 0);
}
Exemplo n.º 14
0
static void
draw_left_01 (ALLEGRO_BITMAP *bitmap, struct pos *p, struct chopper *ch,
              enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *chopper = NULL;
  palette blood_palette = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA: chopper = dc_chopper_00; break;
    case EGA: chopper = de_chopper_00; break;
    case VGA: chopper = dv_chopper_00; break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA: chopper = pc_chopper_00; break;
    case EGA: chopper = pe_chopper_00; break;
    case VGA: chopper = pv_chopper_00; break;
    }
    break;
  }

  if (vm == VGA) chopper = apply_hue_palette (chopper);
  if (hgc) chopper = apply_palette (chopper, hgc_palette);
  if (peq (p, &mouse_pos)) chopper = apply_palette (chopper, selection_palette);

  struct coord c;
  draw_bitmapc (chopper, bitmap, chopper_coord (p, &c), 0);
  if (ch->blood) {
    blood_palette = get_blood_palette (vm);
    ALLEGRO_BITMAP *blood = apply_palette (chopper_blood_00, blood_palette);
    if (hgc) blood = apply_palette (blood, hgc_palette);
    draw_bitmapc (blood, bitmap, blood_01_coord (p, &c), 0);
  }
}
Exemplo n.º 15
0
void
draw_www_base (ALLEGRO_BITMAP *bitmap, struct pos *p,
               enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *wall_center_base = NULL;

  if (vm == VGA) wall_center_base = apply_hue_palette (dv_wall_center_base);
  else if (em == DUNGEON) wall_center_base = de_wall_center_base;
  else wall_center_base = pe_wall_center_base;

  if (peq (p, &mouse_pos))
    wall_center_base = apply_palette (wall_center_base, selection_palette);

  struct coord c;
  draw_bitmapc (wall_center_base, bitmap, wall_base_coord (p, &c), 0);
}
Exemplo n.º 16
0
void
draw_random_block (ALLEGRO_BITMAP *bitmap, struct pos *p,
                   enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *wall_random_block = NULL;

  if (vm == VGA) wall_random_block = apply_hue_palette (dv_wall_random_block);
  else if (em == DUNGEON) wall_random_block = de_wall_random_block;
  else wall_random_block = pe_wall_random_block;

  if (peq (p, &mouse_pos))
    wall_random_block = apply_palette (wall_random_block, selection_palette);

  struct coord c;
  draw_bitmapc (wall_random_block, bitmap, wall_random_block_coord (p, &c), 0);
}
Exemplo n.º 17
0
void
draw_wws_left (ALLEGRO_BITMAP *bitmap, struct pos *p,
               enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *wall_right = NULL;

  if (vm == VGA) wall_right = apply_hue_palette (dv_wall_right);
  else if (em == DUNGEON) wall_right = de_wall_right;
  else wall_right = pe_wall_right;

  if (peq (p, &mouse_pos))
    wall_right = apply_palette (wall_right, selection_palette);

  struct coord c;
  draw_bitmapc (wall_right, bitmap, wall_coord (p, &c), 0);
}
Exemplo n.º 18
0
void
draw_mirror (ALLEGRO_BITMAP *bitmap, struct pos *p,
                 enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *mirror = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA: mirror = dc_mirror; break;
    case EGA: mirror = de_mirror; break;
    case VGA: mirror = dv_mirror; break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA: mirror = pc_mirror; break;
    case EGA: mirror = pe_mirror; break;
    case VGA: mirror = pv_mirror; break;
    }
    break;
  }

  /* make mirror black */
  struct rect r;
  new_rect (&r, p->room, PLACE_WIDTH * p->place + 2,
            PLACE_HEIGHT * p->floor + 3,
            PLACE_WIDTH - 10, PLACE_HEIGHT - 16);
  draw_filled_rect (bitmap, &r, BLACK);

  /* draw floor reflex */
  draw_floor_reflex (bitmap, p, em, vm);

  /* draw mirror properly */
  if (vm == VGA) mirror = apply_hue_palette (mirror);
  if (hgc) mirror = apply_palette (mirror, hgc_palette);
  if (peq (p, &mouse_pos))
    mirror = apply_palette (mirror, selection_palette);

  struct coord c;
  draw_bitmapc (mirror, bitmap, mirror_coord (p, &c), 0);
}
Exemplo n.º 19
0
void
draw_broken_floor_fg (ALLEGRO_BITMAP *bitmap, struct pos *p,
                      enum em em, enum vm vm)
{
  struct coord c;
  int i;
  for (i = 0; i < anima_nmemb; i++) {
    struct anim *a = &anima[i];
    struct pos pmt;
    survey (_mt, pos, &a->f, NULL, &pmt, NULL);
    if (peq (&pmt, p) && is_anim_dead (&a->f)) return;
  }

  ALLEGRO_BITMAP *broken_floor_front = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA: broken_floor_front = dc_broken_floor_front; break;
    case EGA: broken_floor_front = de_broken_floor_front; break;
    case VGA: broken_floor_front = dv_broken_floor_front; break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA: broken_floor_front = pc_broken_floor_front; break;
    case EGA: broken_floor_front = pe_broken_floor_front; break;
    case VGA: broken_floor_front = pv_broken_floor_front; break;
    }
    break;
  }

  if (vm == VGA) broken_floor_front = apply_hue_palette (broken_floor_front);
  if (hgc) broken_floor_front = apply_palette (broken_floor_front, hgc_palette);
  if (peq (p, &mouse_pos))
    broken_floor_front = apply_palette (broken_floor_front, selection_palette);

  draw_bitmapc (broken_floor_front, bitmap,
                broken_floor_front_coord (p, &c), 0);
}
Exemplo n.º 20
0
static void
draw_fg_05 (ALLEGRO_BITMAP *bitmap, struct pos *p, struct chopper *ch,
                    enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *fg = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA: fg = dc_chopper_fg_04; break;
    case EGA: fg = de_chopper_fg_04; break;
    case VGA: fg = dv_chopper_fg_04; break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA: fg = pc_chopper_fg_04; break;
    case EGA: fg = pe_chopper_fg_04; break;
    case VGA: fg = pv_chopper_fg_04; break;
    }
    break;
  }

  if (vm == VGA) fg = apply_hue_palette (fg);
  if (hgc) fg = apply_palette (fg, hgc_palette);
  if (peq (p, &mouse_pos)) fg = apply_palette (fg, selection_palette);

  struct coord c;
  draw_bitmapc (fg, bitmap, chopper_coord (p, &c), 0);
  if (ch->blood) {
    int h = al_get_bitmap_height (chopper_blood_04);
    palette blood_palette = get_blood_palette (vm);
    ALLEGRO_BITMAP *blood = apply_palette (chopper_blood_04, blood_palette);
    if (hgc) blood = apply_palette (blood, hgc_palette);
    draw_bitmap_regionc (blood, bitmap, 0, 0, 2, h, blood_05_coord (p, &c), 0);
  }
}
Exemplo n.º 21
0
void
draw_left_mark (ALLEGRO_BITMAP *bitmap, struct pos *p, int r,
                enum vm vm)
{
  ALLEGRO_BITMAP *wall_mark_top_left = NULL,
    *wall_mark_bottom_left = NULL;

  if (vm == VGA) {
    wall_mark_top_left = apply_hue_palette (dv_wall_mark_top_left);
    wall_mark_bottom_left = apply_hue_palette (dv_wall_mark_bottom_left);
  } else {
    wall_mark_top_left = de_wall_mark_top_left;
    wall_mark_bottom_left = de_wall_mark_bottom_left;
  }

  if (peq (p, &mouse_pos)) {
    wall_mark_top_left = apply_palette (wall_mark_top_left, selection_palette);
    wall_mark_bottom_left = apply_palette (wall_mark_bottom_left, selection_palette);
  }

  ALLEGRO_BITMAP *wall_mark = wall_mark_top_left;
  const int floor_offset[5] = {58, 41, 37, 20, 16};
  int place_offset = 0;

  if (r % 2) wall_mark = wall_mark_bottom_left;
  if (r > 3) place_offset = r3 - r2 + 6;
  else if (r > 1) place_offset = r1 - r0 + 6;

  struct coord c;
  c.room = p->room;
  c.x = 32 * p->place + place_offset +
    8 * (((r == 2) || (r == 3)) ? 1 : 0);
  c.y = 63 * p->floor + 61 - floor_offset[r];

  draw_bitmapc (wall_mark, bitmap, &c, 0);
}
Exemplo n.º 22
0
void
draw_pressed_closer_floor_right (ALLEGRO_BITMAP *bitmap, struct pos *p,
                                 enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *floor_right = NULL,
    *pressed_closer_floor_right = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA:
      floor_right = dc_floor_right;
      pressed_closer_floor_right = dc_pressed_closer_floor_right;
      break;
    case EGA:
      floor_right = de_floor_right;
      pressed_closer_floor_right = de_pressed_closer_floor_right;
      break;
    case VGA:
      floor_right = dv_floor_right;
      pressed_closer_floor_right = dv_pressed_closer_floor_right;
      break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA:
      floor_right = pc_floor_right;
      pressed_closer_floor_right = pc_pressed_closer_floor_right;
      break;
    case EGA:
      floor_right = pe_floor_right;
      pressed_closer_floor_right = pe_pressed_closer_floor_right;
      break;
    case VGA:
      floor_right = pv_floor_right;
      pressed_closer_floor_right = pv_pressed_closer_floor_right;
      break;
    }
    break;
  }

  if (vm == VGA) {
    floor_right = apply_hue_palette (floor_right);
    pressed_closer_floor_right = apply_hue_palette (pressed_closer_floor_right);
  }

  if (hgc) {
    floor_right = apply_palette (floor_right, hgc_palette);
    pressed_closer_floor_right = apply_palette (pressed_closer_floor_right, hgc_palette);
  }

  if (peq (p, &mouse_pos)) {
    floor_right = apply_palette (floor_right, selection_palette);
    pressed_closer_floor_right = apply_palette (pressed_closer_floor_right, selection_palette);
  }

  struct coord c; struct pos np;
  draw_bitmapc (floor_right, bitmap,
                pressed_closer_floor_right_coord (p, &c), 0);
  if (! is_strictly_traversable (prel (p, &np, 0, +1)))
    draw_bitmapc (pressed_closer_floor_right, bitmap,
                  floor_right_coord (p, &c), 0);
}
Exemplo n.º 23
0
void
xdraw_door_grid (ALLEGRO_BITMAP *bitmap, struct pos *p, int i,
                 enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *door_grid = NULL,
    *door_grid_tip = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA:
      door_grid = dc_door_grid;
      door_grid_tip = dc_door_grid_tip;
      break;
    case EGA:
      door_grid = de_door_grid;
      door_grid_tip = de_door_grid_tip;
      break;
    case VGA:
      door_grid = dv_door_grid;
      door_grid_tip = dv_door_grid_tip;
      break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA:
      door_grid = pc_door_grid;
      door_grid_tip = pc_door_grid_tip;
      break;
    case EGA:
      door_grid = pe_door_grid;
      door_grid_tip = pe_door_grid_tip;
      break;
    case VGA:
      door_grid = pv_door_grid;
      door_grid_tip = pv_door_grid_tip;
      break;
    }
    break;
  }

  if (vm == VGA) {
    door_grid = apply_hue_palette (door_grid);
    door_grid_tip = apply_hue_palette (door_grid_tip);
  }

  if (hgc) {
    door_grid = apply_palette (door_grid, hgc_palette);
    door_grid_tip = apply_palette (door_grid_tip, hgc_palette);
  }

  if (peq (p, &mouse_pos)) {
    door_grid = apply_palette (door_grid, selection_palette);
    door_grid_tip = apply_palette (door_grid_tip, selection_palette);
  }

  int q = i / 8;
  int r = i % 8;
  int w = al_get_bitmap_width (door_grid);
  int j;

  struct coord c;
  draw_bitmap_regionc (door_grid, bitmap, 0, 7 - r, w, r + 1,
                       door_grid_coord_base (p, &c), 0);
  for (j = 0; j <= q; j++)
    draw_bitmapc (door_grid, bitmap, door_grid_coord (p, &c, j, i), 0);
  draw_bitmapc (door_grid_tip, bitmap, door_grid_tip_coord (p, &c, i), 0);
}
Exemplo n.º 24
0
void
draw_door_right (ALLEGRO_BITMAP *bitmap, struct pos *p,
                 enum em em, enum vm vm)
{
  struct coord c;
  struct door *d = door_at_pos (p);
  if (! d) return;

  ALLEGRO_BITMAP *door_right = NULL,
    *door_top = NULL;

  switch (em) {
  case DUNGEON:
    switch (vm) {
    case CGA:
      door_right = dc_door_right;
      door_top = dc_door_top;
      break;
    case EGA:
      door_right = de_door_right;
      door_top = de_door_top;
      break;
    case VGA:
      door_right = dv_door_right;
      door_top = dv_door_top;
      break;
    }
    break;
  case PALACE:
    switch (vm) {
    case CGA:
      door_right = pc_door_right;
      door_top = pc_door_top;
      break;
    case EGA:
      door_right = pe_door_right;
      door_top = pe_door_top;
      break;
    case VGA:
      door_right = pv_door_right;
      door_top = pv_door_top;
      break;
    }
    break;
  }

  if (vm == VGA) {
    door_right = apply_hue_palette (door_right);
    door_top = apply_hue_palette (door_top);
  }

  if (hgc) {
    door_right = apply_palette (door_right, hgc_palette);
    door_top = apply_palette (door_top, hgc_palette);
  }

  if (peq (p, &mouse_pos)) {
    door_right = apply_palette (door_right, selection_palette);
    door_top = apply_palette (door_top, selection_palette);
  }

  draw_bitmapc (door_right, bitmap, door_right_coord (p, &c), 0);
  draw_bitmapc (door_top, bitmap, door_top_coord (p, &c), 0);
  draw_door_grid (bitmap, p, d->i, em, vm);
}
Exemplo n.º 25
0
void
draw_pillar_right (ALLEGRO_BITMAP *bitmap, struct pos *p,
                   enum em em, enum vm vm)
{
  ALLEGRO_BITMAP *pillar_right = NULL, *pillar_top = NULL;

  pos2coord_f pillar_top_coord = NULL;

  switch (em) {
  case DUNGEON:
    pillar_top_coord = d_pillar_top_coord;
    switch (vm) {
    case CGA:
      pillar_right = dc_pillar_right;
      pillar_top = dc_pillar_top;
      break;
    case EGA:
      pillar_right = de_pillar_right;
      pillar_top = de_pillar_top;
      break;
    case VGA:
      pillar_right = dv_pillar_right;
      pillar_top = dv_pillar_top;
      break;
    }
    break;
  case PALACE:
    pillar_top_coord = p_pillar_top_coord;
    switch (vm) {
    case CGA:
      pillar_right = pc_pillar_right;
      pillar_top = pc_pillar_top;
      break;
    case EGA:
      pillar_right = pe_pillar_right;
      pillar_top = pe_pillar_top;
      break;
    case VGA:
      pillar_right = pv_pillar_right;
      pillar_top = pv_pillar_top;
      break;
    }
    break;
  }

  if (vm == VGA) {
    pillar_right = apply_hue_palette (pillar_right);
    pillar_top = apply_hue_palette (pillar_top);
  }

  if (hgc) {
    pillar_right = apply_palette (pillar_right, hgc_palette);
    pillar_top = apply_palette (pillar_top, hgc_palette);
  }

  if (peq (p, &mouse_pos)) {
    pillar_right = apply_palette (pillar_right, selection_palette);
    pillar_top = apply_palette (pillar_top, selection_palette);
  }

  struct coord c;
  draw_bitmapc (pillar_right, bitmap, pillar_right_coord (p, &c), 0);
  draw_bitmapc (pillar_top, bitmap, pillar_top_coord (p, &c), 0);
}