Ignore:
Timestamp:
Sep 12, 2011, 10:17:23 PM (8 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/console.cpp

    r672 r682  
    4444        for (int i = 0, dx = wx(); i < w; i++, s++, dx += xa)
    4545            if (*s)
    46                 fnt->PutChar(con_win->m_surf, vec2i(dx, dy), *s);
    47     fnt->PutChar(con_win->m_surf, vec2i(wx() + cx * xa, wy() + cy * ya), '_');
     46                fnt->PutChar(con_win->m_surf, ivec2(dx, dy), *s);
     47    fnt->PutChar(con_win->m_surf, ivec2(wx() + cx * xa, wy() + cy * ya), '_');
    4848}
    4949
     
    5252  if (!con_win)
    5353  {
    54     con_win=wm->CreateWindow(vec2i(lastx, lasty),
    55                              vec2i(screen_w(), screen_h()), NULL, name);
     54    con_win=wm->CreateWindow(ivec2(lastx, lasty),
     55                             ivec2(screen_w(), screen_h()), NULL, name);
    5656    redraw();
    57     con_win->m_surf->SetClip(vec2i(con_win->x1(), con_win->y1()),
    58                              vec2i(con_win->x2() + 1, con_win->y2() + 1));
     57    con_win->m_surf->SetClip(ivec2(con_win->x1(), con_win->y1()),
     58                             ivec2(con_win->x2() + 1, con_win->y2() + 1));
    5959  }
    6060}
     
    9999
    100100    fnt->PutChar(con_win->m_surf,
    101                  vec2i(cx, cy) * fnt->Size() + vec2i(wx(), wy()), '_');
    102 }
    103 
    104 
    105 void console::DrawChar(vec2i pos, char ch)
     101                 ivec2(cx, cy) * fnt->Size() + ivec2(wx(), wy()), '_');
     102}
     103
     104
     105void console::DrawChar(ivec2 pos, char ch)
    106106{
    107107    if (!con_win)
    108108        return;
    109109
    110     vec2i fs = fnt->Size();
    111     pos = vec2i(wx(), wy()) + pos * fs;
    112     con_win->m_surf->Bar(pos, pos + fs - vec2i(1), wm->black());
     110    ivec2 fs = fnt->Size();
     111    pos = ivec2(wx(), wy()) + pos * fs;
     112    con_win->m_surf->Bar(pos, pos + fs - ivec2(1), wm->black());
    113113    fnt->PutChar(con_win->m_surf, pos, ch);
    114114}
     
    116116void console::do_cr()
    117117{
    118   if (cx<w && cy<h) DrawChar(vec2i(cx, cy), screen[cy*w+cx]);
     118  if (cx<w && cy<h) DrawChar(ivec2(cx, cy), screen[cy*w+cx]);
    119119  cx=0;
    120120  cy++;
     
    143143      {
    144144    if (con_win)
    145       DrawChar(vec2i(cx, cy), screen[cy*w+cx]);
     145      DrawChar(ivec2(cx, cy), screen[cy*w+cx]);
    146146    cx--;
    147147    if (con_win)
     
    158158      screen[cy*w+cx]=ch;
    159159      if (con_win)
    160         DrawChar(vec2i(cx, cy), ch);
     160        DrawChar(ivec2(cx, cy), ch);
    161161      cx++;
    162162      if (cx>=w) do_cr(); else
Note: See TracChangeset for help on using the changeset viewer.