Ignore:
Timestamp:
Sep 12, 2011, 10:17:23 PM (11 years ago)
Author:
Sam Hocevar
Message:

core: rename vec2i to ivec2 and update matrix.h from Lol Engine.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/automap.cpp

    r671 r682  
    3838  window_xend=automap_window->x2();
    3939  window_yend=automap_window->y2();
    40   vec2i center((window_xstart+window_xend)/2, (window_ystart+window_yend)/2);
     40  ivec2 center((window_xstart+window_xend)/2, (window_ystart+window_yend)/2);
    4141
    4242  sx=x/f_wid-w/2;                // start drawing with this foretile
     
    6464  {
    6565   automap_window->m_surf->Lock();
    66    automap_window->m_surf->AddDirty(center, center + vec2i(1));
     66   automap_window->m_surf->AddDirty(center, center + ivec2(1));
    6767    if ((tick++)&4)
    6868      automap_window->m_surf->PutPixel(center, 255);
     
    8383
    8484
    85   screen->Bar(vec2i(window_xstart, window_ystart),
    86               vec2i(draw_xstart, window_yend), 0);
    87   screen->Bar(vec2i(window_xstart, window_ystart),
    88               vec2i(window_xend, draw_ystart), 0);
     85  screen->Bar(ivec2(window_xstart, window_ystart),
     86              ivec2(draw_xstart, window_yend), 0);
     87  screen->Bar(ivec2(window_xstart, window_ystart),
     88              ivec2(window_xend, draw_ystart), 0);
    8989
    9090
     
    9696  // we are going to redraw the whole map, so make the dirty rect work
    9797  // easier by marking everything dirty
    98   screen->AddDirty(vec2i(window_xstart, window_ystart),
    99                    vec2i(window_xend + 1, window_yend + 1));
     98  screen->AddDirty(ivec2(window_xstart, window_ystart),
     99                   ivec2(window_xend + 1, window_yend + 1));
    100100
    101101  // draw the tiles that will be around the border of the automap with PutImage
     
    103103  // we will slam on as fast as possible
    104104
    105   screen->SetClip(vec2i(window_xstart, window_ystart),
    106                   vec2i(window_xend + 1, window_yend + 1));
     105  screen->SetClip(ivec2(window_xstart, window_ystart),
     106                  ivec2(window_xend + 1, window_yend + 1));
    107107#if 0
    108108  for (i=draw_xstart,j=draw_ystart,x=sx,y=sy; y<=ey; j+=AUTOTILE_HEIGHT,y++)
    109     screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, vec2i(i, j), 0);
     109    screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, ivec2(i, j), 0);
    110110
    111111  for (i=draw_xstart+ex*AUTOTILE_WIDTH,j=draw_ystart,y=sy,x=ex; y<=ey; j+=AUTOTILE_HEIGHT,y++)
    112     screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, vec2i(i, j), 0);
     112    screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, ivec2(i, j), 0);
    113113
    114114  for (i=draw_xstart,j=draw_ystart,x=sx,y=sy; x<=ex; i+=AUTOTILE_WIDTH,x++)
    115     screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, vec2i(i, j), 0);
     115    screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, ivec2(i, j), 0);
    116116
    117117  for (i=draw_xstart,j=draw_ystart+ey*AUTOTILE_HEIGHT,x=sx,y=ex; x<=ex; i+=AUTOTILE_WIDTH,x++)
    118     screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, vec2i(i, j), 0);
     118    screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, ivec2(i, j), 0);
    119119#endif
    120120
     
    129129    int id=foretiles[ (*fgline)&0x7fff];
    130130    if (id>=0)
    131           screen->PutImage(cache.foret(id)->micro_image, vec2i(i, j), 0);
     131          screen->PutImage(cache.foret(id)->micro_image, ivec2(i, j), 0);
    132132    else
    133           screen->PutImage(cache.foret(foretiles[0])->micro_image, vec2i(i, j), 0);
     133          screen->PutImage(cache.foret(foretiles[0])->micro_image, ivec2(i, j), 0);
    134134      }
    135135      else
    136         screen->Bar(vec2i(i, j),
    137                     vec2i(i + AUTOTILE_WIDTH - 1, j + AUTOTILE_HEIGHT - 1), 0);
     136        screen->Bar(ivec2(i, j),
     137                    ivec2(i + AUTOTILE_WIDTH - 1, j + AUTOTILE_HEIGHT - 1), 0);
    138138    }
    139139  }
     
    149149
    150150  // set the clip back to full window size because soemthing else could mess with the area
    151   automap_window->m_surf->SetClip(vec2i(0), screen->Size());
     151  automap_window->m_surf->SetClip(ivec2(0), screen->Size());
    152152}
    153153
     
    164164        old_dy = -1000;
    165165
    166         automap_window = wm->CreateWindow(vec2i(0), vec2i(w * AUTOTILE_WIDTH,
     166        automap_window = wm->CreateWindow(ivec2(0), ivec2(w * AUTOTILE_WIDTH,
    167167                                        h * AUTOTILE_HEIGHT), NULL, "Map");
    168         automap_window->m_surf->Bar(vec2i(17, 1), vec2i(17 + 8 * 6 + 3, 6),
     168        automap_window->m_surf->Bar(ivec2(17, 1), ivec2(17 + 8 * 6 + 3, 6),
    169169                                    wm->medium_color());
    170         wm->font()->PutString(automap_window->m_surf, vec2i(20, 2), "Automap",
     170        wm->font()->PutString(automap_window->m_surf, ivec2(20, 2), "Automap",
    171171                              wm->dark_color());
    172172        draw();
Note: See TracChangeset for help on using the changeset viewer.