Changeset 682


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

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

Location:
abuse/trunk
Files:
69 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/TODO

    r681 r682  
    5656REFACTOR
    5757--------
    58 - move to vec2i:
     58- move to ivec2:
    5959  - scale_put, scale_put_trans
    6060  - fg_width, etc.
  • abuse/trunk/src/ant.cpp

    r676 r682  
    448448  {
    449449    fade_out(8);
    450     wm->SetMousePos(vec2i(0, 0));
     450    wm->SetMousePos(ivec2(0, 0));
    451451    main_screen->clear();
    452452    image *im=cache.img(cache.reg("art/frame.spe","end_level_screen",SPEC_IMAGE,1));
    453     main_screen->PutImage(im, vec2i(0, 0));
     453    main_screen->PutImage(im, ivec2(0, 0));
    454454
    455455
     
    476476        h = wm->font()->Size().y;
    477477    int x=(x1+x2)/2-w/2,y=(y1+y2)/2-h/2;
    478     main_screen->Bar(vec2i(x - 10, y - 10), vec2i(x + w + 10, y + h + 10),
     478    main_screen->Bar(ivec2(x - 10, y - 10), ivec2(x + w + 10, y + h + 10),
    479479                     wm->bright_color());
    480     main_screen->Bar(vec2i(x - 9, y - 9), vec2i(x + w + 9, y + h + 9),
     480    main_screen->Bar(ivec2(x - 9, y - 9), ivec2(x + w + 9, y + h + 9),
    481481                     wm->medium_color());
    482482
    483     wm->font()->PutString(main_screen, vec2i(x + 1, y + 1), msg, wm->dark_color());
    484     wm->font()->PutString(main_screen, vec2i(x, y), msg, wm->bright_color());
     483    wm->font()->PutString(main_screen, ivec2(x + 1, y + 1), msg, wm->dark_color());
     484    wm->font()->PutString(main_screen, ivec2(x, y), msg, wm->bright_color());
    485485    wm->flush_screen();
    486486    Timer now; now.WaitMs(500);
  • 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();
  • abuse/trunk/src/clisp.cpp

    r676 r682  
    907907      int y = lnumber_value(CAR(args)->Eval()); args = CDR(args);
    908908
    909       vec2i pos = the_game->MouseToGame(vec2i(x, y));
     909      ivec2 pos = the_game->MouseToGame(ivec2(x, y));
    910910      void *ret = NULL;
    911911      {
     
    921921      int y = lnumber_value(CAR(args)->Eval()); args=CDR(args);
    922922
    923       vec2i pos = the_game->GameToMouse(vec2i(x, y), current_view);
     923      ivec2 pos = the_game->GameToMouse(ivec2(x, y), current_view);
    924924      void *ret = NULL;
    925925      {
     
    12861286      int32_t y2 = lnumber_value(CAR(args)); args = lcdr(args);
    12871287      int32_t c = lnumber_value(CAR(args));
    1288       vec2i pos1 = the_game->GameToMouse(vec2i(x1, y1), current_view);
    1289       vec2i pos2 = the_game->GameToMouse(vec2i(x2, y2), current_view);
     1288      ivec2 pos1 = the_game->GameToMouse(ivec2(x1, y1), current_view);
     1289      ivec2 pos2 = the_game->GameToMouse(ivec2(x2, y2), current_view);
    12901290      main_screen->Line(pos1, pos2, c);
    12911291      return 1;
     
    16641664        lbreak("%d %d is out of range of fg map",x,y);
    16651665      else
    1666         current_level->PutFg(vec2i(x, y), type);
     1666        current_level->PutFg(ivec2(x, y), type);
    16671667    } break;
    16681668    case 193 :
     
    16721672      if (x<0 || y<0 || x>=current_level->foreground_width() || y>=current_level->foreground_width())
    16731673        lbreak("%d %d is out of range of fg map",x,y);
    1674       else return current_level->GetFg(vec2i(x, y));
     1674      else return current_level->GetFg(ivec2(x, y));
    16751675    } break;
    16761676    case 194 :
     
    16821682        lbreak("%d %d is out of range of fg map",x,y);
    16831683      else
    1684         current_level->PutBg(vec2i(x, y), type);
     1684        current_level->PutBg(ivec2(x, y), type);
    16851685    } break;
    16861686    case 195 :
     
    16901690      if (x<0 || y<0 || x>=current_level->background_width() || y>=current_level->background_width())
    16911691        lbreak("%d %d is out of range of fg map",x,y);
    1692       else return current_level->GetBg(vec2i(x, y));
     1692      else return current_level->GetBg(ivec2(x, y));
    16931693    } break;
    16941694    case 196 : load_tiles(args); break;
     
    18381838      int32_t y1=lnumber_value(CAR(args)); args=lcdr(args);
    18391839      int32_t id=lnumber_value(CAR(args));
    1840       main_screen->PutImage(cache.img(id), vec2i(x1, y1), 1);
     1840      main_screen->PutImage(cache.img(id), ivec2(x1, y1), 1);
    18411841    } break;
    18421842    case 217 :
     
    19641964      int32_t c = lnumber_value(CAR(args)); args = lcdr(args);
    19651965      int32_t s = lnumber_value(CAR(args));
    1966       vec2i pos1 = the_game->GameToMouse(vec2i(x1, y1), current_view);
    1967       vec2i pos2 = the_game->GameToMouse(vec2i(x2, y2), current_view);
     1966      ivec2 pos1 = the_game->GameToMouse(ivec2(x1, y1), current_view);
     1967      ivec2 pos2 = the_game->GameToMouse(ivec2(x2, y2), current_view);
    19681968      ScatterLine(pos1, pos2, c, s);
    19691969      return 1;
     
    20172017      int32_t c2 = lnumber_value(CAR(args)); args = lcdr(args);
    20182018      int32_t s = lnumber_value(CAR(args));
    2019       vec2i pos1 = the_game->GameToMouse(vec2i(x1, y1), current_view);
    2020       vec2i pos2 = the_game->GameToMouse(vec2i(x2, y2), current_view);
     2019      ivec2 pos1 = the_game->GameToMouse(ivec2(x1, y1), current_view);
     2020      ivec2 pos2 = the_game->GameToMouse(ivec2(x2, y2), current_view);
    20212021      AScatterLine(pos1, pos2, c1, c2, s);
    20222022      return 1;
     
    20382038      int32_t cy2=lnumber_value(CAR(args)); args=lcdr(args);
    20392039      int32_t c1=lnumber_value(CAR(args)); args=lcdr(args);
    2040       main_screen->Bar(vec2i(cx1, cy1), vec2i(cx2, cy2), c1);
     2040      main_screen->Bar(ivec2(cx1, cy1), ivec2(cx2, cy2), c1);
    20412041    } break;
    20422042    case 248 :
     
    21782178      c_target=id;
    21792179      if (main_screen)
    2180         wm->SetMouseShape(cache.img(c_target)->copy(), vec2i(x, y));
     2180        wm->SetMouseShape(cache.img(c_target)->copy(), ivec2(x, y));
    21812181    } break;
    21822182    case 276 :
     
    21942194      if (args)
    21952195        color=lnumber_value(CAR(args));
    2196       fnt->PutString(main_screen, vec2i(x, y), st, color);
     2196      fnt->PutString(main_screen, ivec2(x, y), st, color);
    21972197    } break;
    21982198    case 278 : return ((JCFont *)lpointer_value(CAR(args)))->Size().x; break;
     
    22122212      int32_t y2=lnumber_value(CAR(args));   args=CDR(args);
    22132213      int32_t c=lnumber_value(CAR(args));
    2214       main_screen->Bar(vec2i(x1, y1), vec2i(x2, y2), c);
     2214      main_screen->Bar(ivec2(x1, y1), ivec2(x2, y2), c);
    22152215    } break;
    22162216    case 283 :
     
    22212221      int32_t y2=lnumber_value(CAR(args));   args=CDR(args);
    22222222      int32_t c=lnumber_value(CAR(args));
    2223       main_screen->Rectangle(vec2i(x1, y1), vec2i(x2, y2), c);
     2223      main_screen->Rectangle(ivec2(x1, y1), ivec2(x2, y2), c);
    22242224    } break;
    22252225    case 284 :
  • abuse/trunk/src/common.h

    r661 r682  
    3939static inline float Max(float a, float b) { return a > b ? a : b; }
    4040
    41 static inline vec2i Min(vec2i a, vec2i b) { return vec2i(Min(a.x, b.x), Min(a.y, b.y)); }
    42 static inline vec2i Max(vec2i a, vec2i b) { return vec2i(Max(a.x, b.x), Max(a.y, b.y)); }
     41static inline ivec2 Min(ivec2 a, ivec2 b) { return ivec2(Min(a.x, b.x), Min(a.y, b.y)); }
     42static inline ivec2 Max(ivec2 a, ivec2 b) { return ivec2(Max(a.x, b.x), Max(a.y, b.y)); }
    4343
    4444//
  • 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
  • abuse/trunk/src/console.h

    r672 r682  
    3636  void draw_cursor();
    3737  void put_string(char const *st);
    38   void DrawChar(vec2i pos, char ch);
     38  void DrawChar(ivec2 pos, char ch);
    3939  void toggle() { if (con_win) hide(); else show(); }
    4040  void print_f(char const *format, ...);
  • abuse/trunk/src/cop.cpp

    r676 r682  
    830830    if (o->controller() && o->controller()->local_player())
    831831      main_screen->PutImage(cache.img(S_health_image),
    832                             vec2i(o->controller()->m_bb.x - 20,
     832                            ivec2(o->controller()->m_bb.x - 20,
    833833                                  o->controller()->m_aa.y + 5), 1);
    834834      } break;
     
    852852    if (o->controller() && o->controller()->local_player())
    853853      main_screen->PutImage(cache.img(S_fast_image),
    854                             vec2i(o->controller()->m_bb.x - 20,
     854                            ivec2(o->controller()->m_bb.x - 20,
    855855                                  o->controller()->m_aa.y + 5), 1);
    856856      } break;
     
    874874    if (o->controller() && o->controller()->local_player())
    875875      main_screen->PutImage(cache.img(S_fly_image),
    876                             vec2i(o->controller()->m_bb.x - 20,
     876                            ivec2(o->controller()->m_bb.x - 20,
    877877                                  o->controller()->m_aa.y + 5), 1);
    878878      } break;
     
    888888    if (o->controller() && o->controller()->local_player())
    889889      main_screen->PutImage(cache.img(S_sneaky_image),
    890                             vec2i(o->controller()->m_bb.x - 20,
     890                            ivec2(o->controller()->m_bb.x - 20,
    891891                                  o->controller()->m_aa.y + 5), 1);
    892892      } break;
     
    10231023    qsort(sorted_players,tp,sizeof(view *),compare_players);
    10241024
    1025     vec2i pos = local->m_aa;
     1025    ivec2 pos = local->m_aa;
    10261026    char msg[100];
    10271027
     
    10481048{
    10491049  fade_out(8);
    1050   wm->SetMousePos(vec2i(0, 0));
     1050  wm->SetMousePos(ivec2(0, 0));
    10511051  main_screen->clear();
    10521052  image *im=cache.img(cache.reg("art/frame.spe","end_level_screen",SPEC_IMAGE,1));
    1053   main_screen->PutImage(im, vec2i(0, 0));
     1053  main_screen->PutImage(im, ivec2(0, 0));
    10541054  int x1=im->Size().x+1,y1=0,y2=main_screen->Size().y;
    10551055  JCFont *fnt=wm->font();
     
    10601060  int y=(y1+y2)/2-(tp+2)*fnt->Size().y/2,x=x1+10;
    10611061  char const *header_str = symbol_str("score_header");
    1062   fnt->PutString(main_screen, vec2i(x, y), header_str, wm->bright_color());
     1062  fnt->PutString(main_screen, ivec2(x, y), header_str, wm->bright_color());
    10631063  y += fnt->Size().y;
    10641064
    1065   main_screen->WidgetBar(vec2i(x, y + 2),
    1066                          vec2i(x + strlen(header_str) * fnt->Size().x,
     1065  main_screen->WidgetBar(ivec2(x, y + 2),
     1066                         ivec2(x + strlen(header_str) * fnt->Size().x,
    10671067                               y + fnt->Size().y - 3),
    10681068                         wm->bright_color(), wm->medium_color(),
     
    10811081
    10821082    sprintf(msg,"%-17s %3ld  %3ld",max_name,(long)v->kills,(long)(v->tkills+v->kills));
    1083     fnt->PutString(main_screen, vec2i(x, y), msg, color);
     1083    fnt->PutString(main_screen, ivec2(x, y), msg, color);
    10841084
    10851085    y += fnt->Size().y;
  • abuse/trunk/src/demo.cpp

    r676 r682  
    2929
    3030demo_manager demo_man;
    31 vec2i last_demo_mpos;
     31ivec2 last_demo_mpos;
    3232int last_demo_mbut;
    3333extern base_memory_struct *base;   // points to shm_addr
     
    121121      {
    122122        process_packet_commands(buf, size);
    123         vec2i mouse = the_game->GameToMouse(vec2i(player_list->pointer_x,
     123        ivec2 mouse = the_game->GameToMouse(ivec2(player_list->pointer_x,
    124124                                                  player_list->pointer_y),
    125125                                            player_list);
     
    146146  for (; v; v=v->next) { if (v->m_focus) v->reset_player(); }
    147147
    148   last_demo_mpos = vec2i(0, 0);
     148  last_demo_mpos = ivec2(0, 0);
    149149  last_demo_mbut = 0;
    150150  current_level->set_tick_counter(0);
  • abuse/trunk/src/demo.h

    r658 r682  
    4343extern int event_waiting();
    4444
    45 extern vec2i last_demo_mpos;
     45extern ivec2 last_demo_mpos;
    4646extern int last_demo_mbut;
    4747
  • abuse/trunk/src/dev.cpp

    r676 r682  
    9595image *small_render=NULL;
    9696
    97 vec2i dlast;
     97ivec2 dlast;
    9898int scale_mult,scale_div;
    9999int last_created_type=-1;
     
    109109  {
    110110    if (f)
    111       f->PutImage(screen, cache.img(id), vec2i(x, y));
     111      f->PutImage(screen, cache.img(id), ivec2(x, y));
    112112    else
    113       screen->PutImage(cache.img(id), vec2i(x, y));
     113      screen->PutImage(cache.img(id), ivec2(x, y));
    114114  }
    115115  virtual int width() { return cache.img(id)->Size().x; }
     
    148148  virtual void scroll_event(int newx, image *screen)
    149149  {
    150     screen->Bar(m_pos, m_pos + vec2i(l - 1, h - 1), wm->dark_color());
     150    screen->Bar(m_pos, m_pos + ivec2(l - 1, h - 1), wm->dark_color());
    151151    char st[100];
    152152    sprintf(st,"%d",newx);
    153     wm->font()->PutString(screen, m_pos + vec2i(30, 1), st, wm->bright_color());
     153    wm->font()->PutString(screen, m_pos + ivec2(30, 1), st, wm->bright_color());
    154154    if (player_list)
    155155      player_list->ambient=newx;
     
    169169                                     SPEC_IMAGE, 1))->copy();
    170170
    171     quitw = wm->CreateWindow(vec2i(xres / 2 + 40, yres / 2), vec2i(80, -1),
     171    quitw = wm->CreateWindow(ivec2(xres / 2 + 40, yres / 2), ivec2(80, -1),
    172172              new button(10, wm->font()->Size().y + 4, ID_QUIT_OK, ok_image,
    173173              new button(38, wm->font()->Size().y + 4, ID_CANCEL, cancel_image,
     
    232232    // enlarge clip area
    233233    view *v = the_game->first_view;
    234     v->m_bb = v->m_aa + 2 * (v->m_bb - v->m_aa + vec2i(1));
     234    v->m_bb = v->m_aa + 2 * (v->m_bb - v->m_aa + ivec2(1));
    235235    delete small_render;
    236236    small_render = NULL;
     
    242242    // reduce clip area
    243243    view *v = the_game->first_view;
    244     v->m_bb = v->m_aa + (v->m_bb - v->m_aa + vec2i(1)) / 2;
    245     small_render = new image(v->m_bb - v->m_aa + vec2i(1), NULL, 2);
     244    v->m_bb = v->m_aa + (v->m_bb - v->m_aa + ivec2(1)) / 2;
     245    small_render = new image(v->m_bb - v->m_aa + ivec2(1), NULL, 2);
    246246    small_render_on = 1;
    247247}
     
    320320        return;
    321321
    322     ambw = wm->CreateWindow(vec2i(prop->getd("ambient x", -1),
     322    ambw = wm->CreateWindow(ivec2(prop->getd("ambient x", -1),
    323323                                  prop->getd("ambient y", -1)),
    324                             vec2i(-1), new amb_cont(0, 0, NULL), "ambient");
     324                            ivec2(-1), new amb_cont(0, 0, NULL), "ambient");
    325325}
    326326
     
    366366  int32_t xstep=(im->Size().x<<16)/new_width,
    367367       ystep=(im->Size().y<<16)/new_height,iy,ix,sx,ix_start,iy_start;
    368   screen->AddDirty(vec2i(x, y), vec2i(x + new_width, y + new_height));
    369 
    370   vec2i caa, cbb;
     368  screen->AddDirty(ivec2(x, y), ivec2(x + new_width, y + new_height));
     369
     370  ivec2 caa, cbb;
    371371  screen->GetClip(caa, cbb);
    372372  if (caa.x > cbb.x || caa.y > cbb.y || x>=cbb.x || y>=cbb.y || x+new_width<=caa.x || y+new_height<=caa.y) return ;
     
    407407  int32_t xstep=(im->Size().x<<16)/new_width,
    408408       ystep=(im->Size().y<<16)/new_height,iy,ix,sx,ix_start,iy_start;
    409   screen->AddDirty(vec2i(x, y), vec2i(x + new_width, y + new_height));
    410 
    411   vec2i caa, cbb;
     409  screen->AddDirty(ivec2(x, y), ivec2(x + new_width, y + new_height));
     410
     411  ivec2 caa, cbb;
    412412  screen->GetClip(caa, cbb);
    413413  if (caa.x > cbb.x || caa.y > cbb.y || x >= cbb.x || y >= cbb.y || x+new_width<=caa.x || y+new_height<=caa.y) return ;
     
    476476    {
    477477      image *im = cache.img(light_buttons[f->type]);
    478       main_screen->PutImage(im, vec2i(f->x - vx, f->y - vy)
     478      main_screen->PutImage(im, ivec2(f->x - vx, f->y - vy)
    479479                                  + v->m_aa - im->Size() / 2);
    480       main_screen->Rectangle(vec2i(f->x1 - vx, f->y1 - vy) + v->m_aa,
    481                              vec2i(f->x2 - vx, f->y2 - vy) + v->m_aa,
     480      main_screen->Rectangle(ivec2(f->x1 - vx, f->y1 - vy) + v->m_aa,
     481                             ivec2(f->x2 - vx, f->y2 - vy) + v->m_aa,
    482482                             wm->medium_color());
    483483    }
     
    487487    if (link_object)
    488488    {
    489       vec2i pos = the_game->GameToMouse(vec2i(link_object->x, link_object->y), v);
     489      ivec2 pos = the_game->GameToMouse(ivec2(link_object->x, link_object->y), v);
    490490      main_screen->Line(pos, dlast, yellow);
    491491    }
     
    494494    {
    495495      image *im = cache.img(light_buttons[0]);
    496       vec2i pos = the_game->GameToMouse(vec2i(selected_light->x, selected_light->y), v);
     496      ivec2 pos = the_game->GameToMouse(ivec2(selected_light->x, selected_light->y), v);
    497497      main_screen->Rectangle(pos - im->Size() / 2, pos + im->Size() / 2,
    498498                             wm->bright_color());
     
    503503      for (o=current_level->first_object(); o; o=o->next)
    504504      {
    505     vec2i pos = the_game->GameToMouse(vec2i(o->x, o->y), current_view);
     505    ivec2 pos = the_game->GameToMouse(ivec2(o->x, o->y), current_view);
    506506    char *nm=object_names[o->otype];
    507     console_font->PutString(main_screen, pos + vec2i(- strlen(nm) * console_font->Size().x / 2, 2), nm);
     507    console_font->PutString(main_screen, pos + ivec2(- strlen(nm) * console_font->Size().x / 2, 2), nm);
    508508      }
    509509
     
    513513      for (o=current_level->first_object(); o; o=o->next)
    514514      {
    515     vec2i pos1 = the_game->GameToMouse(vec2i(o->x, o->y), current_view);
     515    ivec2 pos1 = the_game->GameToMouse(ivec2(o->x, o->y), current_view);
    516516
    517517    int i=0;
     
    519519    {
    520520      game_object *other=o->get_object(i);
    521       vec2i pos2 = the_game->GameToMouse(vec2i(other->x, other->y), current_view);
     521      ivec2 pos2 = the_game->GameToMouse(ivec2(other->x, other->y), current_view);
    522522      main_screen->Line(pos1, pos2, wm->bright_color());
    523523    }
     
    526526    {
    527527      light_source *l=o->get_light(i);
    528       vec2i pos2 = the_game->GameToMouse(vec2i(l->x, l->y), current_view);
     528      ivec2 pos2 = the_game->GameToMouse(ivec2(l->x, l->y), current_view);
    529529      main_screen->Line(pos1, pos2, light_connection_color);
    530530    }
     
    536536    {
    537537      selected_object->picture_space(x1,y1,x2,y2);
    538       vec2i pos1 = the_game->GameToMouse(vec2i(x1, y1), v);
    539       vec2i pos2 = the_game->GameToMouse(vec2i(x2, y2), v);
     538      ivec2 pos1 = the_game->GameToMouse(ivec2(x1, y1), v);
     539      ivec2 pos2 = the_game->GameToMouse(ivec2(x2, y2), v);
    540540      main_screen->Rectangle(pos1, pos2, wm->bright_color());
    541541
    542       pos1 = the_game->GameToMouse(vec2i(selected_object->x, selected_object->y), current_view);
     542      pos1 = the_game->GameToMouse(ivec2(selected_object->x, selected_object->y), current_view);
    543543      for (int i=0; i<selected_object->total_objects(); i++)
    544544      {
    545545        game_object *other = selected_object->get_object(i);
    546         pos2 = the_game->GameToMouse(vec2i(other->x, other->y), current_view);
     546        pos2 = the_game->GameToMouse(ivec2(other->x, other->y), current_view);
    547547        main_screen->Line(pos1, pos2, light_connection_color);
    548548      }
     
    588588                         5,(visual_object **)dev_mode_pict,dev_mode_ids,DEV_MODES,
    589589                        pal,pal,NULL);
    590     tbw=wm->CreateWindow(vec2i(prop->getd("toolbar x", -1),
    591                                prop->getd("toolbar y", -1)), vec2i(-1), tp);
     590    tbw=wm->CreateWindow(ivec2(prop->getd("toolbar x", -1),
     591                               prop->getd("toolbar y", -1)), ivec2(-1), tp);
    592592    tp->set_x(setx,tbw->m_surf);
    593593  }
     
    629629        fb->push();
    630630
    631     show_menu = wm->CreateWindow(vec2i(prop->getd("layer x", -1),
    632                                        prop->getd("layer y", -1)), vec2i(-1),
     631    show_menu = wm->CreateWindow(ivec2(prop->getd("layer x", -1),
     632                                       prop->getd("layer y", -1)), ivec2(-1),
    633633                                 fb, symbol_str(symbol_str("SHOW?")));
    634634}
     
    668668        }
    669669
    670     omenu = wm->CreateWindow(vec2i(prop->getd("objects x", 0),
    671                                    prop->getd("objects y", 0)), vec2i(-1),
     670    omenu = wm->CreateWindow(ivec2(prop->getd("objects x", 0),
     671                                   prop->getd("objects y", 0)), ivec2(-1),
    672672                             new pick_list(0, 0, DEV_CREATE,
    673673                                           yres / wm->font()->Size().y / 2,
     
    709709        pwin_list[i] = pal_wins[i]->name;
    710710
    711     pmenu = wm->CreateWindow(vec2i(prop->getd("pal x", 0),
    712                                    prop->getd("pal y", -1)), vec2i(-1),
     711    pmenu = wm->CreateWindow(ivec2(prop->getd("pal x", 0),
     712                                   prop->getd("pal y", -1)), ivec2(-1),
    713713                             new pick_list(0, 0, DEV_PALETTE,
    714714                                           yres / wm->font()->Size().y / 2,
     
    739739    f_tp->reverse();
    740740
    741     forew = wm->CreateWindow(vec2i(prop->getd("fore x", -30),
     741    forew = wm->CreateWindow(ivec2(prop->getd("fore x", -30),
    742742                                   prop->getd("fore y", 0)),
    743                              vec2i(-1), f_tp,symbol_str("l_fg"));
     743                             ivec2(-1), f_tp,symbol_str("l_fg"));
    744744}
    745745
     
    748748/*  if (!music_window)
    749749  {
    750     music_window=wm->CreateWindow(vec2i(-1, 30), vec2i(0, 0),
     750    music_window=wm->CreateWindow(ivec2(-1, 30), ivec2(0, 0),
    751751             new pick_list(0,0,DEV_MUSIC_PICKLIST,10,song_list,total_songs,0,NULL));
    752752    wm->fnt->put_string(music_window->m_surf,0,1,"songs");
     
    777777    tile_picker *f_tp = new tile_picker(0, 0, DEV_BG_PICKER, SPEC_BACKTILE,
    778778                                        bg_scale, maxh, bg_w, NULL);
    779     forew = wm->CreateWindow(vec2i(prop->getd("back x", -30),
     779    forew = wm->CreateWindow(ivec2(prop->getd("back x", -30),
    780780                                   prop->getd("back y", 0)),
    781                              vec2i(-1), f_tp,symbol_str("l_bg"));
     781                             ivec2(-1), f_tp,symbol_str("l_bg"));
    782782}
    783783
     
    798798    int bw = cache.img(dev_forward)->Size().x;
    799799    /* FIXME: previous code had 1,1 instead of 0,0 -- investigate */
    800     search_window = wm->CreateWindow(vec2i(prop->getd("searchw x", -30),
     800    search_window = wm->CreateWindow(ivec2(prop->getd("searchw x", -30),
    801801                                           prop->getd("searchw y", 0)),
    802                                      vec2i(-1),
     802                                     ivec2(-1),
    803803        new text_field(0, 0, ID_SEARCH_TEXT, "object name>",
    804804                       "***************************",
     
    10451045  if (!strcmp(fword,"unchop"))
    10461046  {
    1047     vec2i tile = the_game->GetBgTile(dlast);
     1047    ivec2 tile = the_game->GetBgTile(dlast);
    10481048    if (tile.x>=0 && tile.y>=0)
    10491049    {
     
    10551055    for (y=0,i=cur_bg; y<h; y++)
    10561056          for (x=0; x<l; x++)
    1057             the_game->PutBg(tile + vec2i(x, y), i++);
     1057            the_game->PutBg(tile + ivec2(x, y), i++);
    10581058    dprintf("%dx%d\n",l,h);
    10591059      } else dprintf(symbol_str("unchop1"));
     
    11661166    if (t>=0)                                 // did we find it?
    11671167    {
    1168       vec2i pos = the_game->MouseToGame(dlast);
     1168      ivec2 pos = the_game->MouseToGame(dlast);
    11691169      edit_object=create(t, pos.x, pos.y);
    11701170      current_level->add_object(edit_object);
     
    12101210  if (!strcmp(fword,"fg_select"))
    12111211  {
    1212     vec2i tile = the_game->GetFgTile(dlast);
     1212    ivec2 tile = the_game->GetFgTile(dlast);
    12131213    if (tile.x >= 0 && tile.y >= 0 &&
    12141214        tile.x < current_level->foreground_width() &&
     
    12241224  if (!strcmp(fword,"toggle_fg_raise"))
    12251225  {
    1226     vec2i tile = the_game->GetFgTile(dlast);
     1226    ivec2 tile = the_game->GetFgTile(dlast);
    12271227    if (tile.x >= 0 && tile.y >= 0 &&
    12281228        tile.x < current_level->foreground_width() &&
     
    13311331    int bh = 16 + 6, bw = 20 + 6, th = wm->font()->Size().y + 4;
    13321332
    1333     lightw = wm->CreateWindow(vec2i(prop->getd("light create x", 0),
    1334                                     prop->getd("light create y", 0)), vec2i(-1),
     1333    lightw = wm->CreateWindow(ivec2(prop->getd("light create x", 0),
     1334                                    prop->getd("light create y", 0)), ivec2(-1),
    13351335        new button_box(0, 0, DEV_LIGHT_BUTTON_BOX, 1,
    13361336            new button(bw * 0, bh * 0, DEV_LIGHT0, cache.img(light_buttons[0]),
     
    13881388      wh+=th;
    13891389    }
    1390     aiw=wm->CreateWindow(vec2i(prop->getd("ai x",0), prop->getd("ai y",0)),
    1391                          vec2i(-1),
     1390    aiw=wm->CreateWindow(ivec2(prop->getd("ai x",0), prop->getd("ai y",0)),
     1391                         ivec2(-1),
    13921392       new button(wl,owh-20,DEV_AI_OK,cache.img(dev_ok),first),"ai");
    13931393
     
    13951395  else
    13961396  {
    1397     aiw=wm->CreateWindow(vec2i(prop->getd("ai x", 0), prop->getd("ai y", 0)),
    1398                          vec2i(-1),
     1397    aiw=wm->CreateWindow(ivec2(prop->getd("ai x", 0), prop->getd("ai y", 0)),
     1398                         ivec2(-1),
    13991399       new button(wl,wh-20,DEV_AI_OK,cache.img(dev_ok),
    14001400       new text_field(wl,wh+th*0, DEV_AI_XVEL,    symbol_str("ai_xvel"),"#####",(double)o->xvel(),
     
    15111511  if (ev.type==EV_MOUSE_BUTTON && ev.mouse_button)
    15121512  {
    1513     vec2i pos = the_game->MouseToGame(last_demo_mpos);
     1513    ivec2 pos = the_game->MouseToGame(last_demo_mpos);
    15141514    if (!current_level) return ;
    15151515    current_area=current_level->area_list=new area_controller(pos.x, pos.y,
     
    15501550  if (ev.type==EV_MOUSE_BUTTON && ev.mouse_button)
    15511551  {
    1552     vec2i m = last_demo_mpos;
     1552    ivec2 m = last_demo_mpos;
    15531553    view *v = the_game->GetView(m);
    15541554    for (area_controller *a=current_level->area_list; a; a=a->next)
    15551555    {
    1556       vec2i pos1 = the_game->GameToMouse(vec2i(a->x, a->y), v);
    1557       vec2i pos2 = the_game->GameToMouse(vec2i(a->x + a->w, a->y + a->h), v);
     1556      ivec2 pos1 = the_game->GameToMouse(ivec2(a->x, a->y), v);
     1557      ivec2 pos2 = the_game->GameToMouse(ivec2(a->x + a->w, a->y + a->h), v);
    15581558      if (abs(pos1.x - m.x) < 2 && abs(pos1.y - m.y) < 2)
    15591559      { find = a; find_top = 1; }
     
    15691569      if (area_win) close_area_win(0);
    15701570      int wl=0,wh=0,th=wm->font()->Size().y+12,bw=cache.img(dev_ok)->Size().x+10;
    1571       area_win=wm->CreateWindow(vec2i(prop->getd("area_box x", 0),
    1572                                       prop->getd("area_box y", 0)), vec2i(-1),
     1571      area_win=wm->CreateWindow(ivec2(prop->getd("area_box x", 0),
     1572                                      prop->getd("area_box y", 0)), ivec2(-1),
    15731573                  new button(wl+bw*0,wh-8,DEV_AREA_OK,cache.img(dev_ok),
    15741574                  new button(wl+bw*1,wh-8,DEV_AREA_DELETE,cache.img(dev_del),
     
    16781678    if (ev.type==EV_MOUSE_MOVE)
    16791679    {
    1680       vec2i pos = the_game->MouseToGame(last_demo_mpos);
     1680      ivec2 pos = the_game->MouseToGame(last_demo_mpos);
    16811681      edit_object->x = snap_x(pos.x);
    16821682      edit_object->y = snap_y(pos.y);
     
    17061706    if (ev.type==EV_MOUSE_MOVE)
    17071707    {
    1708       vec2i pos = the_game->MouseToGame(last_demo_mpos);
     1708      ivec2 pos = the_game->MouseToGame(last_demo_mpos);
    17091709      edit_light->x = snap_x(pos.x);
    17101710      edit_light->y = snap_y(pos.y);
     
    17881788      if (current_area)
    17891789      {
    1790     vec2i pos = the_game->MouseToGame(last_demo_mpos);
     1790    ivec2 pos = the_game->MouseToGame(last_demo_mpos);
    17911791    if (pos.x>current_area->x && pos.y>current_area->y)
    17921792    {
     
    18101810      if (current_area)
    18111811      {
    1812     vec2i pos = the_game->MouseToGame(last_demo_mpos);
     1812    ivec2 pos = the_game->MouseToGame(last_demo_mpos);
    18131813    if (pos.x<current_area->x+current_area->w && pos.y<current_area->y+current_area->h)
    18141814    {
     
    18361836    if (ev.window==NULL)
    18371837    {
    1838       vec2i pos = the_game->MouseToGame(last_demo_mpos);
     1838      ivec2 pos = the_game->MouseToGame(last_demo_mpos);
    18391839
    18401840      if (!(dev & MAP_MODE))
     
    18531853        if (ev.mouse_button==1 && !selected_object && !selected_light)
    18541854        {
    1855           vec2i tile = the_game->GetFgTile(last_demo_mpos);
     1855          ivec2 tile = the_game->GetFgTile(last_demo_mpos);
    18561856          if (tile.x>=0 && tile.y>=0 && tile.x<current_level->foreground_width() &&
    18571857          tile.y<current_level->foreground_height())
     
    18601860        } else if (ev.mouse_button==1 && !selected_object && !selected_light)
    18611861        {
    1862           vec2i tile = the_game->GetBgTile(last_demo_mpos);
     1862          ivec2 tile = the_game->GetBgTile(last_demo_mpos);
    18631863          if (tile.x>=0 && tile.y>=0 && tile.x<current_level->background_width() &&
    18641864          tile.y<current_level->background_height())
     
    18881888        int bw=20+6,bh=16+6;
    18891889
    1890         oedit=wm->CreateWindow(vec2i(prop->getd("oedit x", 0),
    1891                                      prop->getd("oedit y", 0)), vec2i(-1),
     1890        oedit=wm->CreateWindow(ivec2(prop->getd("oedit x", 0),
     1891                                     prop->getd("oedit y", 0)), ivec2(-1),
    18921892            new button_box(0,0,ID_NULL,1,
    18931893                new button(bw*0,0,DEV_OEDIT_OK,cache.img(dev_ok),
     
    19241924          edit_light->known=1;
    19251925        }
    1926         ledit=wm->CreateWindow(vec2i(prop->getd("ledit x", 0),
    1927                                      prop->getd("ledit y", 0)), vec2i(-1),
     1926        ledit=wm->CreateWindow(ivec2(prop->getd("ledit x", 0),
     1927                                     prop->getd("ledit y", 0)), ivec2(-1),
    19281928              new button_box(0,0,ID_NULL,1,
    19291929                   new button(bw*0,0,DEV_LEDIT_OK,cache.img(dev_ok),
     
    19431943          if ((dev & DRAW_FG_LAYER) && ev.mouse_button==1)
    19441944          {
    1945         vec2i tile = the_game->GetFgTile(last_demo_mpos);
     1945        ivec2 tile = the_game->GetFgTile(last_demo_mpos);
    19461946        if (tile.x>=0 && tile.y>=0 && tile.x<current_level->foreground_width() &&
    19471947            tile.y<current_level->foreground_height())
     
    19501950          if ((dev & DRAW_BG_LAYER) && ev.mouse_button==2)
    19511951          {
    1952         vec2i tile = the_game->GetBgTile(last_demo_mpos);
     1952        ivec2 tile = the_game->GetBgTile(last_demo_mpos);
    19531953        if (tile.x>=0 && tile.y>=0 && tile.x<current_level->background_width() &&
    19541954            tile.y<current_level->background_height())
     
    20922092      if (!mess_win)
    20932093      {
    2094         mess_win=wm->CreateWindow(vec2i(xres / 2, yres / 2), vec2i(-1),
     2094        mess_win=wm->CreateWindow(ivec2(xres / 2, yres / 2), ivec2(-1),
    20952095               new button(10,20,ID_LEVEL_NEW_OK,symbol_str("YES"),
    20962096                        new button(40,20,ID_CANCEL,symbol_str("NO"),
     
    21112111      {
    21122112        int h=wm->font()->Size().y+8;
    2113         mess_win=wm->CreateWindow(vec2i(xres / 2, yres / 2), vec2i(-1),
     2113        mess_win=wm->CreateWindow(ivec2(xres / 2, yres / 2), ivec2(-1),
    21142114            new text_field(0,h*0,ID_MESS_STR1,symbol_str("width_"),"****",
    21152115                   current_level ? current_level->foreground_width() : 100,
     
    21632163      {
    21642164        int h=wm->font()->Size().y+8;
    2165         mess_win=wm->CreateWindow(vec2i(xres / 2, yres / 2), vec2i(-1),
     2165        mess_win=wm->CreateWindow(ivec2(xres / 2, yres / 2), ivec2(-1),
    21662166            new text_field(0,h*0,ID_RECORD_DEMO_FILENAME,
    21672167                   "demo filename","*******************",
     
    21832183      {
    21842184        int h=wm->font()->Size().y+8;
    2185         mess_win=wm->CreateWindow(vec2i(xres / 2, yres / 2), vec2i(-1),
     2185        mess_win=wm->CreateWindow(ivec2(xres / 2, yres / 2), ivec2(-1),
    21862186            new text_field(0,h*0,ID_PLAY_DEMO_FILENAME,
    21872187                   "demo filename","*******************",
     
    22042204      {
    22052205        int h=wm->font()->Size().y+8;
    2206         mess_win=wm->CreateWindow(vec2i(xres / 2, yres / 2), vec2i(-1),
     2206        mess_win=wm->CreateWindow(ivec2(xres / 2, yres / 2), ivec2(-1),
    22072207            new text_field(0,h*0,ID_MESS_STR1,symbol_str("x_mul"),"****",bg_xmul,
    22082208            new text_field(0,h*1,ID_MESS_STR2,symbol_str("x_div"),"****",bg_xdiv,
     
    22252225        int h=wm->font()->Size().y+8;
    22262226
    2227         warn_win=wm->CreateWindow(vec2i(xres / 2 - 40, yres / 2 - 40),
    2228                                   vec2i(-1),
     2227        warn_win=wm->CreateWindow(ivec2(xres / 2 - 40, yres / 2 - 40),
     2228                                  ivec2(-1),
    22292229                  new info_field(0,0,ID_NULL,
    22302230                      symbol_str("back_loss"),
     
    22702270      {
    22712271        int h=wm->font()->Size().y+8;
    2272         mess_win=wm->CreateWindow(vec2i(xres / 2, yres / 2), vec2i(-1),
     2272        mess_win=wm->CreateWindow(ivec2(xres / 2, yres / 2), ivec2(-1),
    22732273            new text_field(0,h*0,ID_MESS_STR1,symbol_str("ap_width"),"****",2,
    22742274            new text_field(0,h*1,ID_MESS_STR2,symbol_str("ap_height"),"****",2,
     
    24762476    case DEV_LIGHT9 :
    24772477    {
    2478       vec2i pos = the_game->MouseToGame(last_demo_mpos);
     2478      ivec2 pos = the_game->MouseToGame(last_demo_mpos);
    24792479      edit_light = add_light_source(ev.message.id - DEV_LIGHT0,
    24802480                                    snap_x(pos.x), snap_y(pos.y),
     
    27232723        if (ev.window==NULL || ev.window==forew)
    27242724        {
    2725           vec2i tile = the_game->GetFgTile(last_demo_mpos);
     2725          ivec2 tile = the_game->GetFgTile(last_demo_mpos);
    27262726          fg_fill(cur_fg, tile.x, tile.y, NULL);
    27272727        }
     
    28092809      case 'w' :
    28102810      {
    2811         vec2i pos = the_game->MouseToGame(dlast);
     2811        ivec2 pos = the_game->MouseToGame(dlast);
    28122812        char msg[100]; sprintf(msg, symbol_str("mouse_at"), pos.x, pos.y);
    28132813        the_game->show_help(msg);
     
    28302830        if (current_level && player_list && player_list->m_focus)
    28312831        {
    2832           vec2i pos = the_game->MouseToGame(dlast);
     2832          ivec2 pos = the_game->MouseToGame(dlast);
    28332833          player_list->m_focus->x = pos.x;
    28342834          player_list->m_focus->y = pos.y;
     
    29512951{
    29522952  if (me) close_window();
    2953   me=wm->CreateWindow(vec2i(x, y), vec2i(w * f_wid / scale,
     2953  me=wm->CreateWindow(ivec2(x, y), ivec2(w * f_wid / scale,
    29542954                                         h * f_hi / scale), NULL, name);
    29552955  draw();
     
    29752975  {
    29762976    me->clear();
    2977     image *im=new image(vec2i(the_game->ftile_width(),the_game->ftile_height()));
     2977    image *im=new image(ivec2(the_game->ftile_width(),the_game->ftile_height()));
    29782978    int th=the_game->ftile_height()/scale,tw=the_game->ftile_width()/scale;
    29792979
     
    29812981    {
    29822982      im->clear();
    2983       the_game->get_fg(pat[i])->im->PutImage(im, vec2i(0,0));
     2983      the_game->get_fg(pat[i])->im->PutImage(im, ivec2(0,0));
    29842984      scale_put(im,me->m_surf,me->x1()+(i%w)*tw,
    29852985        me->y1()+(i/w)*th,tw,th);
    29862986      if (d==pat[i])
    29872987      {
    2988     me->m_surf->Rectangle(vec2i(me->x1() + (i % w) * tw,
     2988    me->m_surf->Rectangle(ivec2(me->x1() + (i % w) * tw,
    29892989                                me->y1() + (i / w) * th),
    2990                           vec2i(me->x1() + (i % w) * tw + tw - 1,
     2990                          ivec2(me->x1() + (i % w) * tw + tw - 1,
    29912991                                me->y1() + (i / w) * th + th - 1),
    29922992                          wm->bright_color());
     
    30953095      {
    30963096        int32_t xx, yy;
    3097         vec2i tile = the_game->GetFgTile(me->m_pos);
     3097        ivec2 tile = the_game->GetFgTile(me->m_pos);
    30983098
    30993099        for (xx=tile.x; xx<tile.x+w; xx++)
     
    31033103        if (xx>=0 && yy>=0 && xx<current_level->foreground_width() &&
    31043104            yy<current_level->foreground_height())
    3105           the_game->PutFg(vec2i(xx, yy), raise_all ? make_above_tile(pat[xx-tile.x+(yy-tile.y)*w]) : pat[xx-tile.x+(yy-tile.y)*w] );
     3105          the_game->PutFg(ivec2(xx, yy), raise_all ? make_above_tile(pat[xx-tile.x+(yy-tile.y)*w]) : pat[xx-tile.x+(yy-tile.y)*w] );
    31063106          }
    31073107        }
     
    31093109      case 't' :
    31103110      {
    3111         vec2i tile = the_game->GetFgTile(me->m_pos);
     3111        ivec2 tile = the_game->GetFgTile(me->m_pos);
    31123112        dev_cont->fg_fill(-1, tile.x, tile.y, this);
    31133113      } break;
     
    35543554  if (dev&EDIT_MODE)
    35553555  {
    3556     wm->SetMouseShape(cache.img(c_normal)->copy(), vec2i(1, 1));
     3556    wm->SetMouseShape(cache.img(c_normal)->copy(), ivec2(1, 1));
    35573557    pal->load();
    35583558  }
     
    35603560  {
    35613561    if (dev&MAP_MODE) dev-=MAP_MODE;                        // no map mode while playing!
    3562     wm->SetMouseShape(cache.img(c_target)->copy(), vec2i(8, 8));
     3562    wm->SetMouseShape(cache.img(c_target)->copy(), ivec2(8, 8));
    35633563  }
    35643564  if ((dev&EDIT_MODE) && !dev_menu)
  • abuse/trunk/src/devsel.cpp

    r659 r682  
    9494{
    9595  int ya = pich(), xw = picw(), c = get_current();
    96   image im(vec2i(xw, ya));
     96  image im(ivec2(xw, ya));
    9797  last_sel=newx;
    9898
    99   screen->Bar(m_pos, m_pos + vec2i(l - 1, h - 1), wm->black());
     99  screen->Bar(m_pos, m_pos + ivec2(l - 1, h - 1), wm->black());
    100100  for (int i=newx; i<newx+th*wid; i++)
    101101  {
    102     vec2i xyo = m_pos + vec2i(((i - newx) % wid) * xw, ((i - newx) / wid) * ya);
     102    ivec2 xyo = m_pos + ivec2(((i - newx) % wid) * xw, ((i - newx) / wid) * ya);
    103103
    104104      int blank=0;
     
    113113        {
    114114          im.clear();
    115           the_game->get_fg(i)->im->PutImage(&im,vec2i(0,0));
     115          the_game->get_fg(i)->im->PutImage(&im,ivec2(0,0));
    116116
    117117          if (rev)
    118118          {
    119         screen->Bar(xyo, xyo + vec2i(xw - 1, ya - 1), wm->bright_color());
     119        screen->Bar(xyo, xyo + ivec2(xw - 1, ya - 1), wm->bright_color());
    120120        scale_put_trans(&im,screen,xyo.x,xyo.y,xw,ya);
    121121          }
     
    132132      case SPEC_CHARACTER :
    133133      {
    134         figures[i]->get_sequence(stopped)->get_figure(0)->forward->PutImage(&im,vec2i(0,0));
     134        figures[i]->get_sequence(stopped)->get_figure(0)->forward->PutImage(&im,ivec2(0,0));
    135135        scale_put(&im,screen,m_pos.x,m_pos.y,xw,ya);
    136136      } break;
     
    139139
    140140      if (i==c)
    141         screen->Rectangle(m_pos, m_pos + vec2i(xw - 1, ya - 1),
     141        screen->Rectangle(m_pos, m_pos + ivec2(xw - 1, ya - 1),
    142142                          wm->bright_color());
    143143
  • abuse/trunk/src/director.cpp

    r674 r682  
    4343int text_draw(int y, int x1, int y1, int x2, int y2, char const *buf, JCFont *font, uint8_t *cmap, char color)
    4444{
    45     vec2i caa, cbb;
     45    ivec2 caa, cbb;
    4646    main_screen->GetClip(caa, cbb);
    47     main_screen->InClip(vec2i(x1, y1), vec2i(x2 + 1, y2 + 1));
     47    main_screen->InClip(ivec2(x1, y1), ivec2(x2 + 1, y2 + 1));
    4848
    4949  int h=font->Size().y+2,w=font->Size().x,x=x1,dist;
     
    109109      while (word_len--)
    110110      {
    111     font->PutChar(main_screen, vec2i(x + 1, y + 1), *word_start, 0);
    112     font->PutChar(main_screen, vec2i(x, y), *word_start, c);
     111    font->PutChar(main_screen, ivec2(x + 1, y + 1), *word_start, 0);
     112    font->PutChar(main_screen, ivec2(x, y), *word_start, c);
    113113    word_start++;
    114114    x+=w;
  • abuse/trunk/src/endgame.cpp

    r670 r682  
    129129
    130130  }
    131   screen->AddDirty(vec2i(x1, sy), vec2i(x2 + 1, sy + mask_height));
     131  screen->AddDirty(ivec2(x1, sy), ivec2(x2 + 1, sy + mask_height));
    132132}
    133133
     
    181181  fade_out(16);
    182182
    183   image blank(vec2i(2)); blank.clear();
    184   wm->SetMouseShape(blank.copy(), vec2i(0, 0));      // don't show mouse
     183  image blank(ivec2(2)); blank.clear();
     184  wm->SetMouseShape(blank.copy(), ivec2(0, 0));      // don't show mouse
    185185
    186186
     
    197197    *(si++)=jrand()%200;
    198198    *(si++)=c[jrand()%4];
    199     main_screen->PutPixel(vec2i(si[-3],si[-2]),si[-1]);
     199    main_screen->PutPixel(ivec2(si[-3],si[-2]),si[-1]);
    200200  }
    201201  int32_t paddr[256];
     
    234234      int j;
    235235      for (si=sinfo,j=0; j<800; j++,si+=3)
    236         main_screen->PutPixel(vec2i(dx+si[0],dy+si[1]),si[2]);
     236        main_screen->PutPixel(ivec2(dx+si[0],dy+si[1]),si[2]);
    237237
    238238      if (i>=30 && i<=37)
    239239      {
    240     tcopy->PutImage(cache.img(planet), vec2i(0, 0));
    241     cache.fig(explo_frames1[i-30])->forward->PutImage(tcopy,vec2i(100,50));
     240    tcopy->PutImage(cache.img(planet), ivec2(0, 0));
     241    cache.fig(explo_frames1[i-30])->forward->PutImage(tcopy,ivec2(100,50));
    242242        scan_map(main_screen,ex,ey,tcopy,
    243243           cache.img(planet2),
     
    286286      int j;
    287287      for (si=sinfo,j=0; j<800; j++,si+=3)
    288         main_screen->PutPixel(vec2i(dx+si[0],dy+si[1]),si[2]);
     288        main_screen->PutPixel(ivec2(dx+si[0],dy+si[1]),si[2]);
    289289
    290290
     
    322322      last=c;
    323323      if (c->char_num)
    324         cache.fig(explo_frames2[c->frame])->forward->PutImage(main_screen,vec2i(c->x,c->y));
     324        cache.fig(explo_frames2[c->frame])->forward->PutImage(main_screen,ivec2(c->x,c->y));
    325325
    326326      c->x-=3;
     
    340340  int j;
    341341  for (si=sinfo,j=0; j<800; j++,si+=3)
    342     main_screen->PutPixel(vec2i(si[0],si[1]),si[2]);
     342    main_screen->PutPixel(ivec2(si[0],si[1]),si[2]);
    343343
    344344  Event ev;
     
    384384    int j;
    385385    for (si=sinfo,j=0; j<800; j++,si+=3)
    386       main_screen->PutPixel(vec2i(dx+si[0],dy+si[1]),si[2]);
     386      main_screen->PutPixel(ivec2(dx+si[0],dy+si[1]),si[2]);
    387387
    388388    scan_map(main_screen,ex,ey,cache.img(planet),
     
    414414  main_screen->clear();
    415415
    416   wm->SetMouseShape(cache.img(c_normal)->copy(), vec2i(1, 1));
     416  wm->SetMouseShape(cache.img(c_normal)->copy(), ivec2(1, 1));
    417417  the_game->set_state(MENU_STATE);
    418418}
     
    423423{
    424424  fade_out(16);
    425   image blank(vec2i(2, 2)); blank.clear();
    426   wm->SetMouseShape(blank.copy(), vec2i(0, 0)); // don't show mouse
     425  image blank(ivec2(2, 2)); blank.clear();
     426  wm->SetMouseShape(blank.copy(), ivec2(0, 0)); // don't show mouse
    427427  main_screen->clear();
    428428
     
    436436
    437437  int dx=(xres+1)/2-im->Size().x/2,dy=(yres+1)/2-im->Size().y/2;
    438   main_screen->PutImage(im, vec2i(dx, dy));
    439   console_font->PutString(main_screen, vec2i(xres / 2 + 35, yres / 2 + 100 - console_font->Size().y - 2),
     438  main_screen->PutImage(im, ivec2(dx, dy));
     439  console_font->PutString(main_screen, ivec2(xres / 2 + 35, yres / 2 + 100 - console_font->Size().y - 2),
    440440               lstring_value(to_be));
    441441  fade_in(NULL,32);
     
    450450  for (i=0; i<320 && ev.type!=EV_KEY; i++)
    451451  {
    452     main_screen->PutImage(im, vec2i(dx, dy));
    453     console_font->PutString(main_screen, vec2i(xres / 2 + 35, yres / 2 + 100 - console_font->Size().y - 2),
     452    main_screen->PutImage(im, ivec2(dx, dy));
     453    console_font->PutString(main_screen, ivec2(xres / 2 + 35, yres / 2 + 100 - console_font->Size().y - 2),
    454454               lstring_value(to_be));
    455455
     
    470470
    471471  fade_out(16);
    472   wm->SetMouseShape(blank.copy(), vec2i(0, 0)); // don't show mouse
     472  wm->SetMouseShape(blank.copy(), ivec2(0, 0)); // don't show mouse
    473473  show_sell(1);
    474474  wm->Push(new Event(ID_SHOW_SELL,NULL));
     
    479479{
    480480  fade_out(16);
    481   image blank(vec2i(2, 2)); blank.clear();
    482   wm->SetMouseShape(blank.copy(), vec2i(0, 0));      // don't show mouse
     481  image blank(ivec2(2, 2)); blank.clear();
     482  wm->SetMouseShape(blank.copy(), ivec2(0, 0));      // don't show mouse
    483483  main_screen->clear();
    484484
     
    502502  for (i=0; i<320 && ev.type!=EV_KEY; i++)
    503503  {
    504     main_screen->PutImage(im, vec2i(dx, dy));
     504    main_screen->PutImage(im, ivec2(dx, dy));
    505505
    506506    text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot),wm->font(),cmap,wm->bright_color());
     
    527527  show_sell(1);
    528528
    529   wm->SetMouseShape(cache.img(c_normal)->copy(), vec2i(1, 1));
     529  wm->SetMouseShape(cache.img(c_normal)->copy(), ivec2(1, 1));
    530530  the_game->set_state(MENU_STATE);
    531531}
  • abuse/trunk/src/game.cpp

    r678 r682  
    118118                                     no_space_msg, NULL);
    119119    button *b = new button(0, 0, ID_QUIT_OK, "Quit", inf);
    120     Jwindow *no_space = wm->CreateWindow(vec2i(0), vec2i(-1), b, "ERROR");
     120    Jwindow *no_space = wm->CreateWindow(ivec2(0), ivec2(-1), b, "ERROR");
    121121
    122122    Event ev;
     
    258258}
    259259
    260 view *Game::GetView(vec2i pos)
     260view *Game::GetView(ivec2 pos)
    261261{
    262262    for(view *f = first_view; f; f = f->next)
     
    271271}
    272272
    273 vec2i Game::GetFgTile(vec2i pos)
    274 {
    275     return MouseToGame(pos) / vec2i(ftile_width(), ftile_height());
    276 }
    277 
    278 vec2i Game::GetBgTile(vec2i pos)
     273ivec2 Game::GetFgTile(ivec2 pos)
     274{
     275    return MouseToGame(pos) / ivec2(ftile_width(), ftile_height());
     276}
     277
     278ivec2 Game::GetBgTile(ivec2 pos)
    279279{
    280280    view *f = GetView(pos);
    281281    if(!f)
    282         return vec2i(-1, -1);
    283 
    284     return vec2i((pos.x - f->m_aa.x + f->xoff() * bg_xmul / bg_xdiv) / b_wid,
     282        return ivec2(-1, -1);
     283
     284    return ivec2((pos.x - f->m_aa.x + f->xoff() * bg_xmul / bg_xdiv) / b_wid,
    285285                 (pos.y - f->m_aa.y + f->yoff() * bg_ymul / bg_ydiv) / b_hi);
    286286}
    287287
    288 vec2i Game::MouseToGame(vec2i pos, view *v)
     288ivec2 Game::MouseToGame(ivec2 pos, view *v)
    289289{
    290290    if (!v)
     
    293293        v = player_list;  // if not in a view use the first one
    294294    if (!v)
    295         return vec2i(-1, -1);
     295        return ivec2(-1, -1);
    296296
    297297    if(dev & MAP_MODE)
    298         return vec2i((pos.x - v->m_aa.x) * ftile_width()
     298        return ivec2((pos.x - v->m_aa.x) * ftile_width()
    299299                           / AUTOTILE_WIDTH + map_xoff * ftile_width(),
    300300                     (pos.y - v->m_aa.y) * ftile_height()
    301301                           / AUTOTILE_HEIGHT + map_yoff * ftile_height());
    302302
    303     return pos - v->m_aa + vec2i(v->xoff(), v->yoff());
    304 }
    305 
    306 vec2i Game::GameToMouse(vec2i pos, view *v)
     303    return pos - v->m_aa + ivec2(v->xoff(), v->yoff());
     304}
     305
     306ivec2 Game::GameToMouse(ivec2 pos, view *v)
    307307{
    308308    if (!(dev & MAP_MODE))
    309         return pos + v->m_aa - vec2i(v->xoff(), v->yoff());
    310 
    311     vec2i tmp;
     309        return pos + v->m_aa - ivec2(v->xoff(), v->yoff());
     310
     311    ivec2 tmp;
    312312
    313313    if (dev & EDIT_MODE)
    314         tmp = vec2i(map_xoff, map_yoff);
     314        tmp = ivec2(map_xoff, map_yoff);
    315315    else if(v->m_focus)
    316         tmp = vec2i(v->m_focus->x / ftile_width()
     316        tmp = ivec2(v->m_focus->x / ftile_width()
    317317                       - (v->m_bb.x - v->m_aa.x) / AUTOTILE_WIDTH / 2,
    318318                    v->m_focus->y / ftile_height()
    319319                       - (v->m_bb.y - v->m_aa.y) / AUTOTILE_HEIGHT / 2);
    320320    else
    321         tmp = vec2i(0, 0);
     321        tmp = ivec2(0, 0);
    322322
    323323    tmp.x = Max(tmp.x, 0);
    324324    tmp.y = Max(tmp.y, 0);
    325325
    326     vec2i ret(pos.x * AUTOTILE_WIDTH / ftile_width()
     326    ivec2 ret(pos.x * AUTOTILE_WIDTH / ftile_width()
    327327                 - tmp.x * AUTOTILE_WIDTH + v->m_aa.x,
    328328              pos.y * AUTOTILE_HEIGHT / ftile_height()
     
    409409
    410410    if(playing_state(state) &&  !(dev & EDIT_MODE))
    411         wm->SetMouseShape(cache.img(c_target)->copy(), vec2i(8));
     411        wm->SetMouseShape(cache.img(c_target)->copy(), ivec2(8));
    412412    else
    413         wm->SetMouseShape(cache.img(c_normal)->copy(), vec2i(1));
     413        wm->SetMouseShape(cache.img(c_normal)->copy(), ivec2(1));
    414414
    415415    if(old_state == SCENE_STATE && new_state != SCENE_STATE)
     
    442442        int dx = 20, dy = 5;
    443443        image *jim = cache.img(joy_picts[but * 9+(y + 1)*3 + x + 1]);
    444         joy_win->m_surf->Bar(vec2i(dx, dy), vec2i(dx + jim->Size().x + 6,
     444        joy_win->m_surf->Bar(ivec2(dx, dy), ivec2(dx + jim->Size().x + 6,
    445445                                                  dy + jim->Size().y + 6),
    446446                             wm->black());
    447         joy_win->m_surf->PutImage(jim, vec2i(dx + 3, dy + 3));
     447        joy_win->m_surf->PutImage(jim, ivec2(dx + 3, dy + 3));
    448448
    449449        if(but)
     
    482482                      int val, int max)
    483483{
    484     screen->Bar(vec2i(x, y), vec2i(x + w - 1, y + h), wm->dark_color());
    485     screen->Bar(vec2i(x, y + 1), vec2i(x + w * val / max, y + h - 1),
     484    screen->Bar(ivec2(x, y), ivec2(x + w - 1, y + h), wm->dark_color());
     485    screen->Bar(ivec2(x, y + 1), ivec2(x + w * val / max, y + h - 1),
    486486                wm->bright_color());
    487487}
     
    636636  backtile *bt;
    637637  int x1, y1, x2, y2, x, y, xo, yo, nxoff, nyoff;
    638   vec2i caa, cbb;
     638  ivec2 caa, cbb;
    639639  main_screen->GetClip(caa, cbb);
    640640
     
    644644    {
    645645      if(state == SCENE_STATE)
    646         main_screen->SetClip(v->m_aa, v->m_bb + vec2i(1));
     646        main_screen->SetClip(v->m_aa, v->m_bb + ivec2(1));
    647647      image *tit = cache.img(title_screen);
    648648      main_screen->PutImage(tit, main_screen->Size() / 2 - tit->Size() / 2);
     
    661661
    662662  if(small_render)
    663     main_screen->AddDirty(v->m_aa, (v->m_bb - v->m_aa + vec2i(1)) * 2 + vec2i(v->m_aa.x, 0) + vec2i(1));
     663    main_screen->AddDirty(v->m_aa, (v->m_bb - v->m_aa + ivec2(1)) * 2 + ivec2(v->m_aa.x, 0) + ivec2(1));
    664664  else
    665     main_screen->AddDirty(v->m_aa, v->m_bb + vec2i(1));
     665    main_screen->AddDirty(v->m_aa, v->m_bb + ivec2(1));
    666666
    667667  if(v->draw_solid != -1)      // fill the screen and exit..
     
    677677
    678678    // if we do a small render, we need to restore these
    679     vec2i old_aa(0), old_bb(0);
     679    ivec2 old_aa(0), old_bb(0);
    680680    image *old_screen = NULL;
    681681
     
    685685    old_bb = v->m_bb;
    686686
    687     v->m_aa = vec2i(0);
    688     v->m_bb = small_render->Size() - vec2i(1);
     687    v->m_aa = ivec2(0);
     688    v->m_bb = small_render->Size() - ivec2(1);
    689689
    690690    old_screen = main_screen;
     
    711711  current_vyadd = yoff - v->m_aa.y;
    712712
    713   main_screen->SetClip(v->m_aa, v->m_bb + vec2i(1));
     713  main_screen->SetClip(v->m_aa, v->m_bb + ivec2(1));
    714714
    715715  nxoff = xoff * bg_xmul / bg_xdiv;
     
    751751    else bt = get_bg(0);
    752752
    753         main_screen->PutImage(bt->im, vec2i(draw_x, draw_y));
     753        main_screen->PutImage(bt->im, ivec2(draw_x, draw_y));
    754754//        if(!(dev & EDIT_MODE) && bt->next)
    755755//      current_level->put_bg(x, y, bt->next);
     
    810810  if(dev & DRAW_FG_LAYER)
    811811  {
    812     vec2i ncaa, ncbb;
     812    ivec2 ncaa, ncbb;
    813813    main_screen->GetClip(ncaa, ncbb);
    814814
     
    873873          if(fort_num != BLACK)
    874874          {
    875             get_fg(fort_num)->im->PutImage(main_screen, vec2i(draw_x, draw_y));
     875            get_fg(fort_num)->im->PutImage(main_screen, ivec2(draw_x, draw_y));
    876876
    877877        if(!(dev & EDIT_MODE))
     
    915915        {
    916916          if(dev & DRAW_BG_LAYER)
    917           get_fg(fort_num)->im->PutImage(main_screen, vec2i(draw_x, draw_y));
     917          get_fg(fort_num)->im->PutImage(main_screen, ivec2(draw_x, draw_y));
    918918          else
    919           get_fg(fort_num)->im->PutFilled(main_screen, vec2i(draw_x, draw_y), 0);
     919          get_fg(fort_num)->im->PutFilled(main_screen, ivec2(draw_x, draw_y), 0);
    920920
    921921          if(!(dev & EDIT_MODE))
     
    923923          else
    924924          {
    925         main_screen->Line(vec2i(draw_x, draw_y), vec2i(draw_x + xinc, draw_y + yinc), wm->bright_color());
    926         main_screen->Line(vec2i(draw_x + xinc, draw_y), vec2i(draw_x, draw_y + yinc), wm->bright_color());
     925        main_screen->Line(ivec2(draw_x, draw_y), ivec2(draw_x + xinc, draw_y + yinc), wm->bright_color());
     926        main_screen->Line(ivec2(draw_x + xinc, draw_y), ivec2(draw_x, draw_y + yinc), wm->bright_color());
    927927          }
    928928        }
     
    958958        {
    959959          d += 2;
    960           main_screen->Line(vec2i(draw_x + *(d - 2), draw_y + *(d - 1)),
    961                             vec2i(draw_x + *d, draw_y + *(d + 1)), b);
     960          main_screen->Line(ivec2(draw_x + *(d - 2), draw_y + *(d - 1)),
     961                            ivec2(draw_x + *d, draw_y + *(d + 1)), b);
    962962        }
    963         main_screen->Line(vec2i(draw_x + *d, draw_y + *(d - 1)),
    964                           vec2i(draw_x + p->data[0], draw_y + p->data[1]), b);
     963        main_screen->Line(ivec2(draw_x + *d, draw_y + *(d - 1)),
     964                          ivec2(draw_x + p->data[0], draw_y + p->data[1]), b);
    965965          }
    966966        }
     
    979979    int color = 2 + Max(0, help_text_frames - 10);
    980980
    981     vec2i aa = v->m_aa;
    982     vec2i bb(v->m_bb.x, v->m_aa.y + wm->font()->Size().y + 10);
     981    ivec2 aa = v->m_aa;
     982    ivec2 bb(v->m_bb.x, v->m_aa.y + wm->font()->Size().y + 10);
    983983
    984984    remap_area(main_screen, aa.x, aa.y, bb.x, bb.y, white_light + 40 * 256);
    985     main_screen->Bar(aa, vec2i(bb.x, aa.y), color);
    986     main_screen->Bar(vec2i(aa.x, bb.y), bb, color);
    987 
    988     wm->font()->PutString(main_screen, aa + vec2i(5), help_text, color);
     985    main_screen->Bar(aa, ivec2(bb.x, aa.y), color);
     986    main_screen->Bar(ivec2(aa.x, bb.y), bb, color);
     987
     988    wm->font()->PutString(main_screen, aa + ivec2(5), help_text, color);
    989989    if(color > 30)
    990990        help_text_frames = -1;
     
    997997    dev_cont->dev_draw(v);
    998998    if(cache.in_use())
    999     main_screen->PutImage(cache.img(vmm_image), vec2i(v->m_aa.x, v->m_bb.y - cache.img(vmm_image)->Size().y+1));
     999    main_screen->PutImage(cache.img(vmm_image), ivec2(v->m_aa.x, v->m_bb.y - cache.img(vmm_image)->Size().y+1));
    10001000
    10011001    if(dev & DRAW_LIGHTS)
     
    10411041}
    10421042
    1043 void Game::PutFg(vec2i pos, int type)
     1043void Game::PutFg(ivec2 pos, int type)
    10441044{
    10451045    if (current_level->GetFg(pos) == type)
     
    10521052}
    10531053
    1054 void Game::PutBg(vec2i pos, int type)
     1054void Game::PutBg(ivec2 pos, int type)
    10551055{
    10561056    if (current_level->GetBg(pos) == type)
     
    10861086    {
    10871087        main_screen->clear();
    1088         main_screen->PutImage(im, vec2i(xres + 1, yres + 1) / 2
     1088        main_screen->PutImage(im, ivec2(xres + 1, yres + 1) / 2
    10891089                                   - im->Size() / 2);
    10901090    }
     
    11531153    // exit() will try to delete (through the desctructor of
    11541154    // image_list in image.cpp) the image on the stack -> boom.
    1155     image *blank = new image(vec2i(2, 2));
     1155    image *blank = new image(ivec2(2, 2));
    11561156    blank->clear();
    1157     wm->SetMouseShape(blank->copy(), vec2i(0, 0)); // hide mouse
     1157    wm->SetMouseShape(blank->copy(), ivec2(0, 0)); // hide mouse
    11581158    delete blank;
    11591159    fade_in(cache.img(cdc_logo), 32);
     
    11861186
    11871187        int dx = (xres + 1) / 2 - gray->Size().x / 2, dy = (yres + 1) / 2 - gray->Size().y / 2;
    1188         main_screen->PutImage(gray, vec2i(dx, dy));
    1189         main_screen->PutImage(smoke[0], vec2i(dx + 24, dy + 5));
     1188        main_screen->PutImage(gray, ivec2(dx, dy));
     1189        main_screen->PutImage(smoke[0], ivec2(dx + 24, dy + 5));
    11901190
    11911191        fade_in(NULL, 16);
     
    12071207                break;
    12081208
    1209             main_screen->PutImage(gray, vec2i(dx, dy));
    1210             main_screen->PutImage(smoke[i % 5], vec2i(dx + 24, dy + 5));
     1209            main_screen->PutImage(gray, ivec2(dx, dy));
     1210            main_screen->PutImage(smoke[i % 5], ivec2(dx + 24, dy + 5));
    12111211            text_draw(205 - i, dx + 15, dy, dx + 320 - 15, dy + 199, str, wm->font(), cmap, wm->bright_color());
    12121212            wm->flush_screen();
     
    13251325  recalc_local_view_space();   // now that we know what size the screen is...
    13261326
    1327   dark_color = get_color(cache.img(window_colors)->Pixel(vec2i(2, 0)));
    1328   bright_color = get_color(cache.img(window_colors)->Pixel(vec2i(0, 0)));
    1329   med_color = get_color(cache.img(window_colors)->Pixel(vec2i(1, 0)));
    1330 
    1331   morph_dark_color = get_color(cache.img(window_colors)->Pixel(vec2i(2, 1)));
    1332   morph_bright_color = get_color(cache.img(window_colors)->Pixel(vec2i(0, 1)));
    1333   morph_med_color = get_color(cache.img(window_colors)->Pixel(vec2i(1, 1)));
     1327  dark_color = get_color(cache.img(window_colors)->Pixel(ivec2(2, 0)));
     1328  bright_color = get_color(cache.img(window_colors)->Pixel(ivec2(0, 0)));
     1329  med_color = get_color(cache.img(window_colors)->Pixel(ivec2(1, 0)));
     1330
     1331  morph_dark_color = get_color(cache.img(window_colors)->Pixel(ivec2(2, 1)));
     1332  morph_bright_color = get_color(cache.img(window_colors)->Pixel(ivec2(0, 1)));
     1333  morph_med_color = get_color(cache.img(window_colors)->Pixel(ivec2(1, 1)));
    13341334  morph_sel_frame_color = pal->find_closest(255, 255, 0);
    13351335  light_connection_color = morph_sel_frame_color;
     
    14331433
    14341434    sprintf(str, "%d", total_active);
    1435     console_font->PutString(main_screen, first_view->m_aa + vec2i(0, 10), str);
     1435    console_font->PutString(main_screen, first_view->m_aa + ivec2(0, 10), str);
    14361436}
    14371437
     
    14791479    {
    14801480      for(view *f = first_view; f; f = f->next)
    1481         main_screen->PutImage(cache.img(pause_image), vec2i((f->m_aa.x + f->m_bb.x) / 2 - cache.img(pause_image)->Size().x/2, f->m_aa.y + 5), 1);
     1481        main_screen->PutImage(cache.img(pause_image), ivec2((f->m_aa.x + f->m_bb.x) / 2 - cache.img(pause_image)->Size().x/2, f->m_aa.y + 5), 1);
    14821482    }
    14831483
     
    16361636                        if(!joy_win)
    16371637                        {
    1638                             joy_win = wm->CreateWindow(vec2i(80, 50), vec2i(-1),
     1638                            joy_win = wm->CreateWindow(ivec2(80, 50), ivec2(-1),
    16391639                                    new button(70, 9, JOY_OK, "OK",
    16401640                                    new info_field(0, 30, DEV_NULL,
     
    20252025void Game::draw(int scene_mode)
    20262026{
    2027     main_screen->AddDirty(vec2i(0), vec2i(xres, yres));
     2027    main_screen->AddDirty(ivec2(0), ivec2(xres, yres));
    20282028
    20292029    main_screen->clear();
     
    20322032    {
    20332033        char const *helpstr = "ARROW KEYS CHANGE TEXT SPEED";
    2034         vec2i span = wm->font()->Size() * vec2i(strlen(helpstr), 1);
    2035         vec2i pos = (main_screen->Size() - span) / vec2i(2, 1);
    2036         wm->font()->PutString(main_screen, pos + vec2i(1),
     2034        ivec2 span = wm->font()->Size() * ivec2(strlen(helpstr), 1);
     2035        ivec2 pos = (main_screen->Size() - span) / ivec2(2, 1);
     2036        wm->font()->PutString(main_screen, pos + ivec2(1),
    20372037                              helpstr, wm->dark_color());
    20382038        wm->font()->PutString(main_screen, pos, helpstr, wm->bright_color());
  • abuse/trunk/src/game.h

    r666 r682  
    107107               return cache.foret(foretiles[x]); }
    108108
    109     vec2i GetFgTile(vec2i pos);
    110     vec2i GetBgTile(vec2i pos);
     109    ivec2 GetFgTile(ivec2 pos);
     110    ivec2 GetBgTile(ivec2 pos);
    111111  void toggle_delay();
    112112  void set_delay(int on) { no_delay=!on; }
    113113  void pan(int xv, int yv);
    114114
    115     vec2i MouseToGame(vec2i pos, view *v = NULL);
    116     vec2i GameToMouse(vec2i pos, view *v);
    117     view *GetView(vec2i pos);
     115    ivec2 MouseToGame(ivec2 pos, view *v = NULL);
     116    ivec2 GameToMouse(ivec2 pos, view *v);
     117    view *GetView(ivec2 pos);
    118118
    119119  int calc_speed();
     
    125125
    126126
    127     void PutFg(vec2i pos, int type);
    128     void PutBg(vec2i pos, int type);
     127    void PutFg(ivec2 pos, int type);
     128    void PutBg(ivec2 pos, int type);
    129129  void draw_map(view *v, int interpolate=0);
    130130  void dev_scroll();
     
    134134  void set_level(level *nl);
    135135  void show_time();
    136     tile_type GetMapBg(vec2i pos) { return current_level->GetBg(pos); }
    137     tile_type GetMapFg(vec2i pos) { return current_level->GetFg(pos); }
     136    tile_type GetMapBg(ivec2 pos) { return current_level->GetBg(pos); }
     137    tile_type GetMapFg(ivec2 pos) { return current_level->GetFg(pos); }
    138138  void end_session();
    139139  void need_refresh() { refresh=1; }       // for development mode only
  • abuse/trunk/src/gamma.cpp

    r677 r682  
    3838        long x2 = x + item_width() - 1;
    3939        long y2 = y + item_height() - 1;
    40         screen->Bar(vec2i(x, y), vec2i(x2, y2), 0);
    41         screen->Bar(vec2i(x, y), vec2i(x2 - 3, y2), sc + num);
     40        screen->Bar(ivec2(x, y), ivec2(x2, y2), 0);
     41        screen->Bar(ivec2(x, y), ivec2(x2 - 3, y2), sc + num);
    4242        if(active)
    4343        {
    44             screen->Rectangle(vec2i(x, y), vec2i(x2, y2), 255);
     44            screen->Rectangle(ivec2(x, y), ivec2(x2, y2), 255);
    4545        }
    4646    }
     
    148148        gp->set_pos(dg / 4);
    149149
    150         Jwindow *gw = wm->CreateWindow(vec2i(xres / 2 - 190,
    151                                              yres / 2 - 90), vec2i(-1), gp);
     150        Jwindow *gw = wm->CreateWindow(ivec2(xres / 2 - 190,
     151                                             yres / 2 - 90), ivec2(-1), gp);
    152152
    153153        Event ev;
  • abuse/trunk/src/gui.cpp

    r668 r682  
    2727ico_switch_button::ico_switch_button(int X, int Y, int ID, int start_on, ifield *butts, ifield *Next)
    2828{
    29   m_pos = vec2i(X, Y); id=ID;
     29  m_pos = ivec2(X, Y); id=ID;
    3030  next=Next;
    3131  blist=cur_but=butts;
     
    9797    screen->PutImage(cache.img((up && !active) ? u :
    9898                               (up && active) ? ua :
    99                                (!up && !active) ? d : da), vec2i(x1, y1));
     99                               (!up && !active) ? d : da), ivec2(x1, y1));
    100100
    101101    if (act != active && active && activate_id != -1)
     
    106106    {
    107107        int g=80;
    108         screen->Bar(vec2i(0, 0), vec2i(144, 20), 0);
    109         wm->font()->PutString(screen, vec2i(0), symbol_str(key),
     108        screen->Bar(ivec2(0, 0), ivec2(144, 20), 0);
     109        wm->font()->PutString(screen, ivec2(0), symbol_str(key),
    110110                              color_table->Lookup(g>>3, g>>3, g>>3));
    111111    }
    112112    else if (!active && key[0])
    113113    {
    114         screen->Bar(vec2i(0, 0), vec2i(144, 20), 0);
     114        screen->Bar(ivec2(0, 0), ivec2(144, 20), 0);
    115115    }
    116116}
     
    151151
    152152  up=1;
    153   m_pos = vec2i(X, Y); id=ID;
     153  m_pos = ivec2(X, Y); id=ID;
    154154  u=Up; d=down;
    155155  ua=upa; da=downa;
  • abuse/trunk/src/help.cpp

    r655 r682  
    3131  int x1=xres/2-im->Size().x/2,y1=yres/2-im->Size().y/2;
    3232  int x2=x1+im->Size().x,y2=y1+im->Size().y;
    33   main_screen->PutImage(im, vec2i(x1, y1));
    34   main_screen->Bar(vec2i(0, 0), vec2i(x1 - 1, yres), 0);
    35   main_screen->Bar(vec2i(0, 0), vec2i(xres, y1 - 1), 0);
    36   main_screen->Bar(vec2i(x2, y1), vec2i(xres, yres), 0);
    37   main_screen->Bar(vec2i(x1, y2), vec2i(x2, yres), 0);
     33  main_screen->PutImage(im, ivec2(x1, y1));
     34  main_screen->Bar(ivec2(0, 0), ivec2(x1 - 1, yres), 0);
     35  main_screen->Bar(ivec2(0, 0), ivec2(xres, y1 - 1), 0);
     36  main_screen->Bar(ivec2(x2, y1), ivec2(xres, yres), 0);
     37  main_screen->Bar(ivec2(x1, y2), ivec2(x2, yres), 0);
    3838}
    3939
  • abuse/trunk/src/imlib/event.cpp

    r673 r682  
    5757    f.Set(1, pal->brightest(1));
    5858    f.Set(2, pal->darkest(1));
    59     image *im = new image(vec2i(8, 10), mouse_sprite);
     59    image *im = new image(ivec2(8, 10), mouse_sprite);
    6060    f.Apply(im);
    6161
    62     m_sprite = new Sprite(screen, im, vec2i(100, 100));
     62    m_sprite = new Sprite(screen, im, ivec2(100, 100));
    6363    m_pos = screen->Size() / 2;
    64     m_center = vec2i(0, 0);
     64    m_center = ivec2(0, 0);
    6565    m_button = 0;
    6666
  • abuse/trunk/src/imlib/event.h

    r673 r682  
    4848
    4949    int type;
    50     vec2i mouse_move;
     50    ivec2 mouse_move;
    5151    int mouse_button, key;
    5252
     
    5454
    5555    Jwindow *window;      // NULL is root
    56     vec2i window_position;
     56    ivec2 window_position;
    5757    struct { int id; char *data; } message;
    5858};
     
    7070
    7171    void SysInit();
    72     void SysWarpMouse(vec2i pos);
     72    void SysWarpMouse(ivec2 pos);
    7373    void SysEvent(Event &ev);
    7474
     
    7878
    7979  int has_mouse() { return 1; }
    80     void SetMouseShape(image *im, vec2i center)
     80    void SetMouseShape(image *im, ivec2 center)
    8181    {
    8282        m_sprite->SetVisual(im, 1);
    8383        m_center = center;
    8484    }
    85     void SetMousePos(vec2i pos)
     85    void SetMousePos(ivec2 pos)
    8686    {
    87         m_pos = vec2i(Min(Max(pos.x, 0), m_screen->Size().x - 1),
     87        m_pos = ivec2(Min(Max(pos.x, 0), m_screen->Size().x - 1),
    8888                      Min(Max(pos.y, 0), m_screen->Size().y - 1));
    8989        SysWarpMouse(m_pos);
     
    9999    /* Mouse information */
    100100    Sprite *m_sprite;
    101     vec2i m_pos, m_center;
     101    ivec2 m_pos, m_center;
    102102    int m_button;
    103103};
  • abuse/trunk/src/imlib/filesel.cpp

    r671 r682  
    5858      int x1,y1,x2,y2;
    5959      area(x1,y1,x2,y2);
    60       screen->Bar(vec2i(x1, y1), vec2i(x2, y2), wm->medium_color());
     60      screen->Bar(ivec2(x1, y1), ivec2(x2, y2), wm->medium_color());
    6161
    6262      char st[200],curdir[200];
     
    9696{
    9797    if (active)
    98         screen->Bar(vec2i(x, y),
    99                     vec2i(x + item_width() - 1, y + item_height() - 1),
     98        screen->Bar(ivec2(x, y),
     99                    ivec2(x + item_width() - 1, y + item_height() - 1),
    100100                    wm->black());
    101101
     
    106106        sprintf(dest = st, "<%s>", d[num]);
    107107
    108     wm->font()->PutString(screen, vec2i(x, y), dest, wm->bright_color());
     108    wm->font()->PutString(screen, ivec2(x, y), dest, wm->bright_color());
    109109}
    110110
     
    134134  int wh2 = 5 + wm->font()->Size().y + 5;
    135135  int wh3 = wh2 + wm->font()->Size().y + 12;
    136   Jwindow *j=wm->CreateWindow(vec2i(0), vec2i(-1),
     136  Jwindow *j=wm->CreateWindow(ivec2(0), ivec2(-1),
    137137                new info_field(5, 5, 0, prompt,
    138138                            new text_field(0, wh2, filename_id,
  • abuse/trunk/src/imlib/filter.cpp

    r670 r682  
    7979/* This is only ever used in the editor, when showing the toolbar. It
    8080 * does not look like it's very useful. */
    81 void Filter::PutImage(image *screen, image *im, vec2i pos)
     81void Filter::PutImage(image *screen, image *im, ivec2 pos)
    8282{
    83     vec2i aa = vec2i(0), bb = im->Size(), caa, cbb;
     83    ivec2 aa = ivec2(0), bb = im->Size(), caa, cbb;
    8484    screen->GetClip(caa, cbb);
    8585
     
    9595        return;
    9696
    97     vec2i span = bb - aa;
     97    ivec2 span = bb - aa;
    9898
    9999    screen->AddDirty(pos, pos + span);
  • abuse/trunk/src/imlib/filter.h

    r579 r682  
    2626    int GetMapping(int color_num) { return m_table[color_num]; }
    2727    void Apply(image *im);
    28     void PutImage(image *screen, image *im, vec2i pos);
     28    void PutImage(image *screen, image *im, ivec2 pos);
    2929
    3030private:
  • abuse/trunk/src/imlib/fonts.cpp

    r668 r682  
    1919#include "fonts.h"
    2020
    21 void JCFont::PutString(image *screen, vec2i pos, char const *st, int color)
     21void JCFont::PutString(image *screen, ivec2 pos, char const *st, int color)
    2222{
    2323    for ( ; *st; st++, pos.x += m_size.x)
     
    2525}
    2626
    27 void JCFont::PutChar(image *screen, vec2i pos, char ch, int color)
     27void JCFont::PutChar(image *screen, ivec2 pos, char ch, int color)
    2828{
    2929    if (!m_data[(int)ch])
     
    3838JCFont::JCFont(image *letters)
    3939{
    40     m_size = (letters->Size() + vec2i(1)) / vec2i(32, 8);
     40    m_size = (letters->Size() + ivec2(1)) / ivec2(32, 8);
    4141
    4242    image tmp(m_size);
     
    4545    {
    4646        tmp.clear();
    47         tmp.PutPart(letters, vec2i(0),
    48                     vec2i(ch % 32, ch / 32) * m_size,
    49                     vec2i(ch % 32 + 1, ch / 32 + 1) * m_size, 1);
     47        tmp.PutPart(letters, ivec2(0),
     48                    ivec2(ch % 32, ch / 32) * m_size,
     49                    ivec2(ch % 32 + 1, ch / 32 + 1) * m_size, 1);
    5050        m_data[ch] = new TransImage(&tmp, "JCfont");
    5151    }
  • abuse/trunk/src/imlib/fonts.h

    r668 r682  
    2121    ~JCFont();
    2222
    23     void PutChar(image *screen, vec2i pos, char ch, int color = -1);
    24     void PutString(image *screen, vec2i pos, char const *st, int color = -1);
    25     vec2i Size() const { return m_size; }
     23    void PutChar(image *screen, ivec2 pos, char ch, int color = -1);
     24    void PutString(image *screen, ivec2 pos, char const *st, int color = -1);
     25    ivec2 Size() const { return m_size; }
    2626
    2727private:
    28     vec2i m_size;
     28    ivec2 m_size;
    2929    TransImage *m_data[256];
    3030};
  • abuse/trunk/src/imlib/guistat.cpp

    r671 r682  
    5959    long h = wm->font()->Size().y;
    6060
    61     whom->stat_win->m_surf->Bar(vec2i(whom->stat_win->x1() + 1,
     61    whom->stat_win->m_surf->Bar(ivec2(whom->stat_win->x1() + 1,
    6262                                      whom->stat_win->y2() - h - 1),
    63                                 vec2i(whom->stat_win->x2() - 1,
     63                                ivec2(whom->stat_win->x2() - 1,
    6464                                      whom->stat_win->y2() - 1),
    6565                                wm->black());
    66     whom->stat_win->m_surf->Bar(vec2i(whom->stat_win->x1() + 2,
     66    whom->stat_win->m_surf->Bar(ivec2(whom->stat_win->x1() + 2,
    6767                                      whom->stat_win->y2() - h),
    68                                 vec2i(whom->stat_win->x2() - 2,
     68                                ivec2(whom->stat_win->x2() - 2,
    6969                                      whom->stat_win->y2() - 2),
    7070                                wm->dark_color());
    7171    if (perc)
    72         whom->stat_win->m_surf->Bar(vec2i(whom->stat_win->x1() + 3,
     72        whom->stat_win->m_surf->Bar(ivec2(whom->stat_win->x1() + 3,
    7373                                          whom->stat_win->y2() - h + 1),
    74                                     vec2i(whom->stat_win->x1() + l * perc / 100,
     74                                    ivec2(whom->stat_win->x1() + l * perc / 100,
    7575                                          whom->stat_win->y2() - 3),
    7676                                    wm->bright_color());
     
    113113    int mx = first->stat_win->x1() + 1;
    114114    int my = first->stat_win->y1() + wm->font()->Size().y / 2;
    115     first->stat_win=wm->CreateWindow(vec2i(wx, wy), vec2i(len3, h1*2+h2), NULL, "status");
    116     wm->font()->PutString(first->stat_win->m_surf, vec2i(mx, my), first->name, wm->black());
    117     wm->font()->PutString(first->stat_win->m_surf, vec2i(mx, my), first->name, wm->bright_color());
     115    first->stat_win=wm->CreateWindow(ivec2(wx, wy), ivec2(len3, h1*2+h2), NULL, "status");
     116    wm->font()->PutString(first->stat_win->m_surf, ivec2(mx, my), first->name, wm->black());
     117    wm->font()->PutString(first->stat_win->m_surf, ivec2(mx, my), first->name, wm->bright_color());
    118118    if (first->show)
    119119      first->show->draw(first->stat_win->m_surf, (first->stat_win->x2()-first->stat_win->x1())/2-
  • abuse/trunk/src/imlib/image.cpp

    r681 r682  
    2222linked_list image_list; // FIXME: only jwindow.cpp needs this
    2323
    24 image_descriptor::image_descriptor(vec2i size,
     24image_descriptor::image_descriptor(ivec2 size,
    2525                                   int keep_dirties, int static_memory)
    2626{
    27     m_aa = vec2i(0);
     27    m_aa = ivec2(0);
    2828    m_bb = size;
    2929    m_size = size;
     
    3333}
    3434
    35 void image::SetSize(vec2i new_size, uint8_t *page)
     35void image::SetSize(ivec2 new_size, uint8_t *page)
    3636{
    3737    DeletePage();
     
    4040}
    4141
    42 void image::MakePage(vec2i size, uint8_t *page_buffer)
     42void image::MakePage(ivec2 size, uint8_t *page_buffer)
    4343{
    4444    m_data = page_buffer ? page_buffer : (uint8_t *)malloc(size.x * size.y);
     
    6464}
    6565
    66 uint8_t image::Pixel(vec2i pos)
     66uint8_t image::Pixel(ivec2 pos)
    6767{
    6868    CONDITION(pos.x >= 0 && pos.x < m_size.x && pos.y >= 0 && pos.y < m_size.y,
     
    7171}
    7272
    73 void image::PutPixel(vec2i pos, uint8_t color)
     73void image::PutPixel(ivec2 pos, uint8_t color)
    7474{
    7575    CONDITION(pos.x >= 0 && pos.x < m_size.x && pos.y >= 0 && pos.y < m_size.y,
     
    8585
    8686
    87 image::image(vec2i size, uint8_t *page_buffer, int create_descriptor)
     87image::image(ivec2 size, uint8_t *page_buffer, int create_descriptor)
    8888{
    8989    m_size = size;
     
    160160        for(int j = 0; j < m_size.y; j++)
    161161            memset(scan_line(j), color, m_size.x);
    162     AddDirty(vec2i(0), m_size);
     162    AddDirty(ivec2(0), m_size);
    163163    Unlock();
    164164}
     
    179179// Draw a line of the given colour on the image. Both endpoints are set.
    180180//
    181 void image::Line(vec2i p1, vec2i p2, uint8_t color)
     181void image::Line(ivec2 p1, ivec2 p2, uint8_t color)
    182182{
    183183    // check to see if the line is completly clipped off
    184     vec2i caa, cbb;
     184    ivec2 caa, cbb;
    185185    GetClip(caa, cbb);
    186186
    187187    if (p1.x > p2.x) // make sure that p1.x is to the left
    188188    {
    189         vec2i tmp = p1; p1 = p2; p2 = tmp; // if not swap points
     189        ivec2 tmp = p1; p1 = p2; p2 = tmp; // if not swap points
    190190    }
    191191
     
    200200    if (p1.y > p2.y) // make sure that p1.y is on top
    201201    {
    202         vec2i tmp = p1; p1 = p2; p2 = tmp; // if not swap points
     202        ivec2 tmp = p1; p1 = p2; p2 = tmp; // if not swap points
    203203    }
    204204
     
    216216
    217217    // We can now assume p1.y <= p2.y
    218     AddDirty(vec2i(Min(p1.x, p2.x), p1.y),
    219              vec2i(Max(p1.x, p2.x), p2.y) + vec2i(1));
    220 
    221     vec2i span = p2 - p1;
     218    AddDirty(ivec2(Min(p1.x, p2.x), p1.y),
     219             ivec2(Max(p1.x, p2.x), p2.y) + ivec2(1));
     220
     221    ivec2 span = p2 - p1;
    222222    int xi = (span.x < 0) ? -1 : 1;
    223223    int yi = (span.y < 0) ? -1 : 1;
     
    248248
    249249
    250 void image::PutImage(image *im, vec2i pos, int transparent)
    251 {
    252     PutPart(im, pos, vec2i(0), im->m_size, transparent);
    253 }
    254 
    255 void image::PutPart(image *im, vec2i pos, vec2i aa, vec2i bb, int transparent)
     250void image::PutImage(image *im, ivec2 pos, int transparent)
     251{
     252    PutPart(im, pos, ivec2(0), im->m_size, transparent);
     253}
     254
     255void image::PutPart(image *im, ivec2 pos, ivec2 aa, ivec2 bb, int transparent)
    256256{
    257257    CHECK(aa < bb);
    258258
    259     vec2i caa, cbb;
     259    ivec2 caa, cbb;
    260260    GetClip(caa, cbb);
    261261
    262262    // see if the are to be put is outside of actual image, if so adjust
    263263    // to fit in the image
    264     pos += Min(aa, vec2i(0));
    265     aa += Min(aa, vec2i(0));
     264    pos += Min(aa, ivec2(0));
     265    aa += Min(aa, ivec2(0));
    266266    bb = Min(bb, im->m_size);
    267267    // return if it was adjusted so that nothing will be put
     
    273273        return;
    274274
    275     aa += Max(caa - pos, vec2i(0));
    276     pos += Max(caa - pos, vec2i(0));
     275    aa += Max(caa - pos, ivec2(0));
     276    pos += Max(caa - pos, ivec2(0));
    277277    bb = Min(bb, cbb - pos + aa);
    278278    if (!(aa < bb))
    279279        return;
    280280
    281     vec2i span = bb - aa;
     281    ivec2 span = bb - aa;
    282282
    283283    AddDirty(pos, pos + span);
     
    304304}
    305305
    306 void image::Rectangle(vec2i p1, vec2i p2, uint8_t color)
    307 {
    308     Line(p1, vec2i(p2.x, p1.y), color);
    309     Line(vec2i(p2.x, p1.y), p2, color);
    310     Line(vec2i(p1.x, p2.y), p2, color);
    311     Line(p1, vec2i(p1.x, p2.y), color);
    312 }
    313 
    314 void image::SetClip(vec2i aa, vec2i bb)
     306void image::Rectangle(ivec2 p1, ivec2 p2, uint8_t color)
     307{
     308    Line(p1, ivec2(p2.x, p1.y), color);
     309    Line(ivec2(p2.x, p1.y), p2, color);
     310    Line(ivec2(p1.x, p2.y), p2, color);
     311    Line(p1, ivec2(p1.x, p2.y), color);
     312}
     313
     314void image::SetClip(ivec2 aa, ivec2 bb)
    315315{
    316316    // If the image does not already have an Image descriptor, allocate one
     
    324324}
    325325
    326 void image::GetClip(vec2i &aa, vec2i &bb)
     326void image::GetClip(ivec2 &aa, ivec2 &bb)
    327327{
    328328    if (m_special)
     
    330330    else
    331331    {
    332         aa = vec2i(0);
     332        aa = ivec2(0);
    333333        bb = m_size;
    334334    }
    335335}
    336336
    337 void image::InClip(vec2i aa, vec2i bb)
     337void image::InClip(ivec2 aa, ivec2 bb)
    338338{
    339339    if (m_special)
    340340    {
    341         aa = Min(aa, vec2i(m_special->x1_clip(), m_special->y1_clip()));
    342         bb = Max(bb, vec2i(m_special->x2_clip(), m_special->y2_clip()));
     341        aa = Min(aa, ivec2(m_special->x1_clip(), m_special->y1_clip()));
     342        bb = Max(bb, ivec2(m_special->x2_clip(), m_special->y2_clip()));
    343343    }
    344344
     
    387387void image_descriptor::ReduceDirties()
    388388{
    389     vec2i aa(6000), bb(-1);
     389    ivec2 aa(6000), bb(-1);
    390390
    391391    for (dirty_rect *p = (dirty_rect *)dirties.first(); p; )
     
    401401}
    402402
    403 void image_descriptor::DeleteDirty(vec2i aa, vec2i bb)
     403void image_descriptor::DeleteDirty(ivec2 aa, ivec2 bb)
    404404{
    405405    int ax1, ay1, ax2, ay2;
     
    409409        return;
    410410
    411     aa = Max(aa, vec2i(0));
     411    aa = Max(aa, ivec2(0));
    412412    bb = Min(bb, m_size);
    413413
     
    441441            else
    442442            {
    443                 dirties.add_front(new dirty_rect(p->m_aa, vec2i(p->m_bb.x, aa.y - 1)));
     443                dirties.add_front(new dirty_rect(p->m_aa, ivec2(p->m_bb.x, aa.y - 1)));
    444444                p->m_aa.y = bb.y;
    445445            }
     
    454454            else
    455455            {
    456                 dirties.add_front(new dirty_rect(p->m_aa, vec2i(aa.x - 1, p->m_bb.y)));
     456                dirties.add_front(new dirty_rect(p->m_aa, ivec2(aa.x - 1, p->m_bb.y)));
    457457                p->m_aa.x = bb.x;
    458458            }
     
    469469            else { ay1=aa.y; ay2=bb.y; }
    470470
    471             dirties.add_front(new dirty_rect(vec2i(ax1, ay1), vec2i(ax2 - 1, ay2 - 1)));
     471            dirties.add_front(new dirty_rect(ivec2(ax1, ay1), ivec2(ax2 - 1, ay2 - 1)));
    472472
    473473            if (bb.x - 1>=p->m_bb.x || aa.x<=p->m_aa.x)  { ax1=p->m_aa.x; ax2=p->m_bb.x+1; }
     
    481481            else { if (ax1==p->m_aa.x) { ay1=p->m_aa.y; ay2=aa.y; }
    482482                   else { ay1=aa.y; ay2=bb.y; } }
    483             dirties.add_front(new dirty_rect(vec2i(ax1, ay1), vec2i(ax2 - 1, ay2 - 1)));
     483            dirties.add_front(new dirty_rect(ivec2(ax1, ay1), ivec2(ax2 - 1, ay2 - 1)));
    484484
    485485            if (aa.x > p->m_aa.x && bb.x - 1 < p->m_bb.x)
     
    487487                if (aa.y > p->m_aa.y && bb.y - 1 < p->m_bb.y)
    488488                {
    489                     dirties.add_front(new dirty_rect(p->m_aa, vec2i(p->m_bb.x, aa.y - 1)));
    490                     dirties.add_front(new dirty_rect(vec2i(p->m_aa.x, bb.y), p->m_bb));
     489                    dirties.add_front(new dirty_rect(p->m_aa, ivec2(p->m_bb.x, aa.y - 1)));
     490                    dirties.add_front(new dirty_rect(ivec2(p->m_aa.x, bb.y), p->m_bb));
    491491                }
    492492                else if (aa.y <= p->m_aa.y)
    493                     dirties.add_front(new dirty_rect(vec2i(p->m_aa.x, bb.y), p->m_bb));
     493                    dirties.add_front(new dirty_rect(ivec2(p->m_aa.x, bb.y), p->m_bb));
    494494                else
    495                     dirties.add_front(new dirty_rect(p->m_aa, vec2i(p->m_bb.x, aa.y - 1)));
     495                    dirties.add_front(new dirty_rect(p->m_aa, ivec2(p->m_bb.x, aa.y - 1)));
    496496            }
    497497            else if (aa.y > p->m_aa.y && bb.y - 1 < p->m_bb.y)
    498                 dirties.add_front(new dirty_rect(vec2i(p->m_aa.x, bb.y), p->m_bb));
     498                dirties.add_front(new dirty_rect(ivec2(p->m_aa.x, bb.y), p->m_bb));
    499499            dirties.unlink(p);
    500500            delete p;
     
    504504
    505505// specifies that an area is a dirty
    506 void image_descriptor::AddDirty(vec2i aa, vec2i bb)
     506void image_descriptor::AddDirty(ivec2 aa, ivec2 bb)
    507507{
    508508    dirty_rect *p;
     
    510510        return;
    511511
    512     aa = Max(aa, vec2i(0));
     512    aa = Max(aa, ivec2(0));
    513513    bb = Min(bb, m_size);
    514514
     
    518518    int i = dirties.Count();
    519519    if (!i)
    520         dirties.add_front(new dirty_rect(aa, bb - vec2i(1)));
     520        dirties.add_front(new dirty_rect(aa, bb - ivec2(1)));
    521521    else if (i >= MAX_DIRTY)
    522522    {
    523         dirties.add_front(new dirty_rect(aa, bb - vec2i(1)));
     523        dirties.add_front(new dirty_rect(aa, bb - ivec2(1)));
    524524        ReduceDirties();  // reduce to one dirty rectangle, we have to many
    525525    }
     
    559559            {
    560560              if (aa.x < p->m_aa.x)
    561                 AddDirty(vec2i(aa.x, Max(aa.y, p->m_aa.y)),
    562                          vec2i(p->m_aa.x, Min(bb.y, p->m_bb.y + 1)));
     561                AddDirty(ivec2(aa.x, Max(aa.y, p->m_aa.y)),
     562                         ivec2(p->m_aa.x, Min(bb.y, p->m_bb.y + 1)));
    563563              if (bb.x > p->m_bb.x + 1)
    564                 AddDirty(vec2i(p->m_bb.x + 1, Max(aa.y, p->m_aa.y)),
    565                          vec2i(bb.x, Min(bb.y, p->m_bb.y + 1)));
     564                AddDirty(ivec2(p->m_bb.x + 1, Max(aa.y, p->m_aa.y)),
     565                         ivec2(bb.x, Min(bb.y, p->m_bb.y + 1)));
    566566              if (aa.y < p->m_aa.y)
    567                 AddDirty(aa, vec2i(bb.x, p->m_aa.y));
     567                AddDirty(aa, ivec2(bb.x, p->m_aa.y));
    568568              if (bb.y - 1 > p->m_bb.y)
    569                 AddDirty(vec2i(aa.x, p->m_bb.y + 1), bb);
     569                AddDirty(ivec2(aa.x, p->m_bb.y + 1), bb);
    570570              return ;
    571571            }
     
    575575      }
    576576      CHECK(aa < bb);
    577       dirties.add_end(new dirty_rect(aa, bb - vec2i(1)));
    578     }
    579 }
    580 
    581 void image::Bar(vec2i p1, vec2i p2, uint8_t color)
     577      dirties.add_end(new dirty_rect(aa, bb - ivec2(1)));
     578    }
     579}
     580
     581void image::Bar(ivec2 p1, ivec2 p2, uint8_t color)
    582582{
    583583    if (p1.x > p2.x || p1.y > p2.y)
     
    605605        memset(scan_line(y) + p1.x, color, (p2.x - p1.x + 1));
    606606    Unlock();
    607     AddDirty(p1, p2 + vec2i(1));
     607    AddDirty(p1, p2 + ivec2(1));
    608608}
    609609
     
    638638  Unlock();
    639639
    640   AddDirty(vec2i(x1, y1), vec2i(x2 + 1, y2 + 1));
     640  AddDirty(ivec2(x1, y1), ivec2(x2 + 1, y2 + 1));
    641641}
    642642
     
    695695}
    696696
    697 void image::Scale(vec2i new_size)
    698 {
    699     vec2i old_size = m_size;
     697void image::Scale(ivec2 new_size)
     698{
     699    ivec2 old_size = m_size;
    700700    uint8_t *im = (uint8_t *)malloc(old_size.x * old_size.y);
    701701    Lock();
     
    731731  if (m_special)
    732732  {
    733     vec2i caa, cbb;
     733    ivec2 caa, cbb;
    734734    m_special->GetClip(caa, cbb);
    735735    x1=Max(x1, caa.x); y1=Max(caa.y, y1); x2=Min(x2, cbb.x - 1); y2=Min(y2, cbb.y - 1);
     
    749749    if (yd<0) { ysrc++; ydst++; } else { ysrc--; ydst--; }
    750750  }
    751   AddDirty(vec2i(x1, y1), vec2i(x2 + 1, y2 + 1));
     751  AddDirty(ivec2(x1, y1), ivec2(x2 + 1, y2 + 1));
    752752}
    753753
     
    768768    for (l=-smoothness; l<=smoothness; l++)
    769769      if (i+k>smoothness && i+k<m_size.x-smoothness && j+l<m_size.y-smoothness && j+l>smoothness)
    770         t+=Pixel(vec2i(i+k, j+l));
    771       else t+=Pixel(vec2i(i, j));
    772       im->PutPixel(vec2i(i, j), t/d);
     770        t+=Pixel(ivec2(i+k, j+l));
     771      else t+=Pixel(ivec2(i, j));
     772      im->PutPixel(ivec2(i, j), t/d);
    773773    }
    774774  return im;
    775775}
    776776
    777 void image::WidgetBar(vec2i p1, vec2i p2,
     777void image::WidgetBar(ivec2 p1, ivec2 p2,
    778778                      uint8_t light, uint8_t med, uint8_t dark)
    779779{
    780     Line(p1, vec2i(p2.x, p1.y), light);
    781     Line(p1, vec2i(p1.x, p2.y), light);
    782     Line(vec2i(p2.x, p1.y + 1), p2, dark);
    783     Line(vec2i(p1.x + 1, p2.y), vec2i(p2.x - 1, p2.y - 1), dark);
    784     Bar(p1 + vec2i(1, 1), p2 - vec2i(1, 1), med);
     780    Line(p1, ivec2(p2.x, p1.y), light);
     781    Line(p1, ivec2(p1.x, p2.y), light);
     782    Line(ivec2(p2.x, p1.y + 1), p2, dark);
     783    Line(ivec2(p1.x + 1, p2.y), ivec2(p2.x - 1, p2.y - 1), dark);
     784    Bar(p1 + ivec2(1, 1), p2 - ivec2(1, 1), med);
    785785}
    786786
     
    899899      for (yy=0; yy<7; yy++)
    900900    if ((1<<yy)&dig[zz])
    901       Line(vec2i(x+ledx[yy*2]*scale, y+ledy[yy*2]*scale),
    902            vec2i(x+ledx[yy*2+1]*scale, y+ledy[yy*2+1]*scale), color);
     901      Line(ivec2(x+ledx[yy*2]*scale, y+ledy[yy*2]*scale),
     902           ivec2(x+ledx[yy*2+1]*scale, y+ledy[yy*2+1]*scale), color);
    903903    }
    904904    x+=6*scale;
     
    916916  image *ret;
    917917  uint8_t *sl1, *sl2;
    918   vec2i caa, cbb;
     918  ivec2 caa, cbb;
    919919  GetClip(caa, cbb);
    920920  if (y1<caa.y) y1=caa.y;
     
    924924  CHECK(x2>=x1 && y2>=y1);
    925925  if (x2<x1 || y2<y1) return NULL;
    926   ret=new image(vec2i((x2-x1+8)/8, (y2-y1+1)));
     926  ret=new image(ivec2((x2-x1+8)/8, (y2-y1+1)));
    927927  if (!last_loaded())
    928928    ret->clear();
  • abuse/trunk/src/imlib/image.h

    r670 r682  
    2525{
    2626public :
    27     dirty_rect(vec2i aa, vec2i bb)
     27    dirty_rect(ivec2 aa, ivec2 bb)
    2828    {
    2929        m_aa = aa;
     
    3737    }
    3838
    39     vec2i m_aa, m_bb;
     39    ivec2 m_aa, m_bb;
    4040};
    4141
     
    4949    void *extended_descriptor;
    5050
    51     image_descriptor(vec2i size, int keep_dirties = 1, int static_memory = 0);
     51    image_descriptor(ivec2 size, int keep_dirties = 1, int static_memory = 0);
    5252    int bound_x1(int x1) { return Max(x1, m_aa.x); }
    5353    int bound_y1(int y1) { return Max(y1, m_aa.y); }
     
    5959    inline int y2_clip() { return m_bb.y; }
    6060    void ClearDirties();
    61     void GetClip(vec2i &aa, vec2i &bb)
     61    void GetClip(ivec2 &aa, ivec2 &bb)
    6262    {
    6363        aa = m_aa; bb = m_bb;
    6464    }
    65     void SetClip(vec2i aa, vec2i bb)
     65    void SetClip(ivec2 aa, ivec2 bb)
    6666    {
    67         m_aa = Max(aa, vec2i(0));
    68         m_bb = Min(Max(bb, m_aa + vec2i(1)), m_size);
     67        m_aa = Max(aa, ivec2(0));
     68        m_bb = Min(Max(bb, m_aa + ivec2(1)), m_size);
    6969    }
    7070    void GetClip(int &x1, int &y1, int &x2, int &y2)
     
    8080    }
    8181    void ReduceDirties();
    82     void AddDirty(vec2i aa, vec2i bb);
    83     void DeleteDirty(vec2i aa, vec2i bb);
    84     void Resize(vec2i size)
     82    void AddDirty(ivec2 aa, ivec2 bb);
     83    void DeleteDirty(ivec2 aa, ivec2 bb);
     84    void Resize(ivec2 size)
    8585    {
    8686        m_size = size;
    87         m_aa = vec2i(0);
     87        m_aa = ivec2(0);
    8888        m_bb = size;
    8989    }
    9090
    9191private:
    92     vec2i m_size, m_aa, m_bb;
     92    ivec2 m_size, m_aa, m_bb;
    9393};
    9494
     
    9797private:
    9898    uint8_t *m_data;
    99     vec2i m_size;
     99    ivec2 m_size;
    100100    bool m_locked;
    101101
    102     void MakePage(vec2i size, uint8_t *page_buffer);
     102    void MakePage(ivec2 size, uint8_t *page_buffer);
    103103    void DeletePage();
    104104
     
    107107
    108108    image(bFILE *fp, spec_entry *e = NULL);
    109     image(vec2i size, uint8_t *page_buffer = NULL, int create_descriptor = 0);
     109    image(ivec2 size, uint8_t *page_buffer = NULL, int create_descriptor = 0);
    110110    ~image();
    111111
     
    113113    void Unlock();
    114114
    115     uint8_t Pixel(vec2i pos);
    116     void PutPixel(vec2i pos, uint8_t color);
     115    uint8_t Pixel(ivec2 pos);
     116    void PutPixel(ivec2 pos, uint8_t color);
    117117
    118118    inline uint8_t *scan_line(int16_t y)
     
    123123    void clear(int16_t color = -1); // -1 is background color
    124124
    125     vec2i Size() const { return m_size; }
     125    ivec2 Size() const { return m_size; }
    126126
    127127    void scroll(int16_t x1, int16_t y1, int16_t x2, int16_t y2,
    128128                int16_t xd, int16_t yd);
    129     void PutImage(image *screen, vec2i pos, int transparent = 0);
    130     void PutPart(image *screen, vec2i pos, vec2i aa, vec2i bb,
     129    void PutImage(image *screen, ivec2 pos, int transparent = 0);
     130    void PutPart(image *screen, ivec2 pos, ivec2 aa, ivec2 bb,
    131131                 int transparent = 0);
    132132    image *copy_part_dithered(int16_t x1, int16_t y1, int16_t x2, int16_t y2);
    133     void Bar(vec2i p1, vec2i p2, uint8_t color);
     133    void Bar(ivec2 p1, ivec2 p2, uint8_t color);
    134134    void xor_bar(int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color);
    135     void WidgetBar(vec2i p1, vec2i p2,
     135    void WidgetBar(ivec2 p1, ivec2 p2,
    136136                   uint8_t light, uint8_t med, uint8_t dark);
    137     void Line(vec2i p1, vec2i p2, uint8_t color);
    138     void Rectangle(vec2i p1, vec2i p2, uint8_t color);
     137    void Line(ivec2 p1, ivec2 p2, uint8_t color);
     138    void Rectangle(ivec2 p1, ivec2 p2, uint8_t color);
    139139    void burn_led(int16_t x, int16_t y, int32_t num, int16_t color,
    140140                  int16_t scale = 1);
    141     void SetClip(vec2i aa, vec2i bb);
    142     void GetClip(vec2i &aa, vec2i &bb);
    143     void InClip(vec2i aa, vec2i bb);
     141    void SetClip(ivec2 aa, ivec2 bb);
     142    void GetClip(ivec2 &aa, ivec2 &bb);
     143    void InClip(ivec2 aa, ivec2 bb);
    144144    void SetClip(int x1, int y1, int x2, int y2);
    145145    void GetClip(int &x1, int &y1, int &x2, int &y2);
     
    155155    }
    156156
    157     void AddDirty(vec2i aa, vec2i bb)
     157    void AddDirty(ivec2 aa, ivec2 bb)
    158158    {
    159159        if (m_special) m_special->AddDirty(aa, bb);
    160160    }
    161     void DeleteDirty(vec2i aa, vec2i bb)
     161    void DeleteDirty(ivec2 aa, ivec2 bb)
    162162    {
    163163        if(m_special) m_special->DeleteDirty(aa, bb);
     
    168168    }
    169169    void dither(palette *pal); // use a b&w palette!
    170     void Scale(vec2i size);
    171     void SetSize(vec2i size, uint8_t *page = NULL);
     170    void Scale(ivec2 size);
     171    void SetSize(ivec2 size, uint8_t *page = NULL);
    172172    void flood_fill(int16_t x, int16_t y, uint8_t color);
    173173    image *create_smooth(int16_t smoothness = 1); // 0 no smoothness
  • abuse/trunk/src/imlib/include.cpp

    r643 r682  
    5555      }
    5656    }
    57     vec2i size = im->Size();
     57    ivec2 size = im->Size();
    5858    fprintf(fp,"unsigned char %s[%d*%d]={\n    ",tmp_name, size.x, size.y);
    5959    int x,y,max=size.x*size.y-1;
     
    6161      for (x=0; x<size.x; x++,i++)
    6262      {
    63         fprintf(fp,"%d",(int)im->Pixel(vec2i(x,y)));
     63        fprintf(fp,"%d",(int)im->Pixel(ivec2(x,y)));
    6464        if (i==max)
    6565          fprintf(fp,"};\n\n");
  • abuse/trunk/src/imlib/input.cpp

    r668 r682  
    4949button_box::button_box(int X, int Y, int ID, int MaxDown, button *Buttons, ifield *Next)
    5050{
    51   m_pos = vec2i(X, Y); id=ID; next=Next;
     51  m_pos = ivec2(X, Y); id=ID; next=Next;
    5252  buttons=Buttons;
    5353  maxdown=MaxDown;
     
    9595}
    9696
    97 void button_box::Move(vec2i pos)
     97void button_box::Move(ivec2 pos)
    9898{
    9999    for(button * b = buttons; b; b = (button *)b->next)
     
    168168void button_box::arrange_left_right()
    169169{
    170     vec2i on = m_pos;
     170    ivec2 on = m_pos;
    171171    for (button *b = buttons; b; b = (button *)b->next)
    172172    {
     
    180180void button_box::arrange_up_down()
    181181{
    182     vec2i on = m_pos;
     182    ivec2 on = m_pos;
    183183    for (button *b = buttons; b; b = (button *)b->next)
    184184    {
     
    198198void button::area(int &x1, int &y1, int &x2, int &y2)
    199199{
    200     vec2i pos1 = m_pos;
    201     vec2i pos2 = m_pos;
     200    ivec2 pos1 = m_pos;
     201    ivec2 pos2 = m_pos;
    202202
    203203    if (pressed)
    204         pos2 += pressed->Size() - vec2i(1);
     204        pos2 += pressed->Size() - ivec2(1);
    205205    else if (text)
    206         pos2 += wm->font()->Size() * vec2i(strlen(text), 1) + vec2i(6);
     206        pos2 += wm->font()->Size() * ivec2(strlen(text), 1) + ivec2(6);
    207207    else
    208         pos2 += visual->Size() + vec2i(6);
     208        pos2 += visual->Size() + ivec2(6);
    209209
    210210    x1 = pos1.x; y1 = pos1.y;
     
    215215button::button(int X, int Y, int ID, char const *Text, ifield *Next)
    216216{
    217     m_pos = vec2i(X, Y);
     217    m_pos = ivec2(X, Y);
    218218    id = ID;
    219219    act_id=-1;
     
    227227button::button(int X, int Y, int ID, image *vis, ifield *Next)
    228228{
    229     m_pos = vec2i(X, Y);
     229    m_pos = ivec2(X, Y);
    230230    id=ID; text=NULL;
    231231    act_id=-1;
     
    236236button::button(int X, int Y, int ID, image *Depressed, image *Pressed, image *active, ifield *Next)
    237237{
    238     m_pos = vec2i(X, Y);
     238    m_pos = ivec2(X, Y);
    239239    id=ID; text=NULL;
    240240    act_id=-1;
     
    312312  if (active)
    313313  {
    314     screen->Rectangle(vec2i(xstart(), m_pos.y), vec2i(xend(), yend()),
     314    screen->Rectangle(ivec2(xstart(), m_pos.y), ivec2(xend(), yend()),
    315315                      wm->bright_color());
    316316    draw_cur(wm->bright_color(),screen);
     
    318318  else
    319319  {
    320     screen->Rectangle(vec2i(xstart(), m_pos.y), vec2i(xend(), yend()),
     320    screen->Rectangle(ivec2(xstart(), m_pos.y), ivec2(xend(), yend()),
    321321                      wm->dark_color());
    322322    draw_cur(wm->dark_color(),screen);
     
    335335    int slen=(strlen(Format)>strlen(Data) ? strlen(Format) : strlen(Data));
    336336
    337     m_pos = vec2i(X, Y);
     337    m_pos = ivec2(X, Y);
    338338    id=ID;
    339339    prompt = strdup(Prompt);
     
    351351  sprintf(num,"%g",Data);
    352352  int slen=(strlen(Format)>strlen(num) ? strlen(Format) : strlen(num));
    353   m_pos = vec2i(X, Y); id=ID;
     353  m_pos = ivec2(X, Y); id=ID;
    354354  prompt = strdup(Prompt);
    355355  format=strcpy((char *)malloc(slen+1),Format);
     
    397397  else
    398398  {
    399     screen->Rectangle(vec2i(x1 + 2, y1 + 2), vec2i(x2 - 2, y2 - 2), color);
     399    screen->Rectangle(ivec2(x1 + 2, y1 + 2), ivec2(x2 - 2, y2 - 2), color);
    400400    act = active;
    401401  }
     
    415415    if (up)
    416416    {
    417       screen->Rectangle(vec2i(x1, y1), vec2i(x2, y2), wm->black());
     417      screen->Rectangle(ivec2(x1, y1), ivec2(x2, y2), wm->black());
    418418//      screen->widget_bar(,wm->bright_color(),wm->medium_color(),wm->dark_color());
    419       screen->WidgetBar(vec2i(x1 + 1, y1 + 1), vec2i(x2 - 1, y2 - 1),
     419      screen->WidgetBar(ivec2(x1 + 1, y1 + 1), ivec2(x2 - 1, y2 - 1),
    420420                        wm->bright_color(),wm->medium_color(),wm->dark_color());
    421421    }
    422422    else
    423423    {
    424       screen->Line(vec2i(x1, y1), vec2i(x2, y1), wm->dark_color());
    425       screen->Line(vec2i(x1, y1), vec2i(x1, y2), wm->dark_color());
    426       screen->Line(vec2i(x2, y1 + 1), vec2i(x2, y2), wm->bright_color());
    427       screen->Line(vec2i(x1 + 1, y2), vec2i(x2, y2), wm->bright_color());
    428       screen->Bar(vec2i(x1 + 1, y1 + 1), vec2i(x2 - 1, y2 - 1),
     424      screen->Line(ivec2(x1, y1), ivec2(x2, y1), wm->dark_color());
     425      screen->Line(ivec2(x1, y1), ivec2(x1, y2), wm->dark_color());
     426      screen->Line(ivec2(x2, y1 + 1), ivec2(x2, y2), wm->bright_color());
     427      screen->Line(ivec2(x1 + 1, y2), ivec2(x2, y2), wm->bright_color());
     428      screen->Bar(ivec2(x1 + 1, y1 + 1), ivec2(x2 - 1, y2 - 1),
    429429                  wm->medium_color());
    430430    }
     
    432432    if ((up && text) || (!up && !visual))
    433433    {
    434         wm->font()->PutString(screen, m_pos + vec2i(4, 5), text, wm->black());
    435         wm->font()->PutString(screen, m_pos + vec2i(3, 4), text);
     434        wm->font()->PutString(screen, m_pos + ivec2(4, 5), text, wm->black());
     435        wm->font()->PutString(screen, m_pos + ivec2(3, 4), text);
    436436    }
    437437    else if (up)
    438         screen->PutImage(visual, m_pos + vec2i(3, 3), 1);
     438        screen->PutImage(visual, m_pos + ivec2(3, 3), 1);
    439439    else
    440         screen->PutImage(visual, vec2i(x1 + 3, y1 + 3), 1);
     440        screen->PutImage(visual, ivec2(x1 + 3, y1 + 3), 1);
    441441}
    442442
    443443void text_field::draw_first(image *screen)
    444444{
    445   wm->font()->PutString(screen, m_pos + vec2i(0, 3), prompt);
    446   screen->Bar(vec2i(xstart(), m_pos.y), vec2i(xend(), yend()), wm->dark_color());
    447   wm->font()->PutString(screen, vec2i(xstart() + 1, m_pos.y + 3), data);
     445  wm->font()->PutString(screen, m_pos + ivec2(0, 3), prompt);
     446  screen->Bar(ivec2(xstart(), m_pos.y), ivec2(xend(), yend()), wm->dark_color());
     447  wm->font()->PutString(screen, ivec2(xstart() + 1, m_pos.y + 3), data);
    448448}
    449449
     
    451451void text_field::draw_cur(int color, image *screen)
    452452{
    453   screen->Bar(vec2i(xstart() + cur * wm->font()->Size().x + 1, yend() - 2),
    454               vec2i(xstart() + (cur + 1) * wm->font()->Size().x, yend() - 1),
     453  screen->Bar(ivec2(xstart() + cur * wm->font()->Size().x + 1, yend() - 2),
     454              ivec2(xstart() + (cur + 1) * wm->font()->Size().x, yend() - 1),
    455455              color);
    456456}
     
    460460info_field::info_field(int X, int Y, int ID, char const *info, ifield *Next)
    461461{
    462   m_pos = vec2i(X, Y); id = ID; next = Next;
     462  m_pos = ivec2(X, Y); id = ID; next = Next;
    463463  text = strdup(info);
    464464  w = -1;
     
    503503    else
    504504    {
    505       font->PutChar(screen, vec2i(dx, dy), *st, color);
     505      font->PutChar(screen, ivec2(dx, dy), *st, color);
    506506      dx+=xspace;
    507507    }
  • abuse/trunk/src/imlib/input.h

    r668 r682  
    4949  void press_button(int id);      // if button box doesn't contain id, nothing happens
    5050  virtual void remap(Filter *f);
    51   virtual void Move(vec2i pos);
     51  virtual void Move(ivec2 pos);
    5252  virtual void area(int &x1, int &y1, int &x2, int &y2);
    5353  virtual void draw_first(image *screen);
     
    7272  void draw_text(image *screen)
    7373  {
    74     screen->Bar(vec2i(xstart() + 1, m_pos.y + 1), vec2i(xend() - 1, yend() - 1),
     74    screen->Bar(ivec2(xstart() + 1, m_pos.y + 1), ivec2(xend() - 1, yend() - 1),
    7575                wm->dark_color());
    76     wm->font()->PutString(screen, vec2i(xstart() + 1, m_pos.y + 3), data);
     76    wm->font()->PutString(screen, ivec2(xstart() + 1, m_pos.y + 3), data);
    7777  }
    7878public :
  • abuse/trunk/src/imlib/jwindow.cpp

    r673 r682  
    9999    {
    100100        j->show();
    101         j->m_surf->AddDirty(vec2i(0), j->m_size);
     101        j->m_surf->AddDirty(ivec2(0), j->m_size);
    102102    }
    103103}
     
    128128      if ((ev.type==EV_MOUSE_BUTTON && ev.mouse_button==1 && ev.window &&
    129129       ev.mouse_move >= ev.window->m_pos &&
    130        ev.mouse_move < ev.window->m_pos + vec2i(ev.window->m_size.x, ev.window->y1())))
     130       ev.mouse_move < ev.window->m_pos + ivec2(ev.window->m_size.x, ev.window->y1())))
    131131      {
    132132    if (ev.mouse_move.x-ev.window->m_pos.x < 11) closew=1;
     
    174174      for (p=m_first; p!=j; p=p->next)
    175175        p->m_surf->AddDirty(j->x-p->x,j->y-p->y,j->x+j->l-p->x,j->y+j->h-p->y); */
    176       j->m_surf->AddDirty(vec2i(0), j->m_size);
     176      j->m_surf->AddDirty(ivec2(0), j->m_size);
    177177      flush_screen();
    178178    }
     
    204204}
    205205
    206 void Jwindow::Resize(vec2i size)
     206void Jwindow::Resize(ivec2 size)
    207207{
    208208    m_surf->SetSize(size);
     
    217217    p->m_surf->AddDirty(j->m_pos - p->m_pos,
    218218                        j->m_pos - p->m_pos + j->m_size);
    219   j->Resize(vec2i(l,h));
     219  j->Resize(ivec2(l,h));
    220220  if (!frame_suppress)
    221221  j->redraw();
     
    230230    j->m_pos.x = x;
    231231    j->m_pos.y = y;
    232     j->m_surf->AddDirty(vec2i(0), j->m_size);
     232    j->m_surf->AddDirty(ivec2(0), j->m_size);
    233233}
    234234
     
    292292}
    293293
    294 Jwindow * WindowManager::CreateWindow(vec2i pos, vec2i size,
     294Jwindow * WindowManager::CreateWindow(ivec2 pos, ivec2 size,
    295295                                      ifield * fields, char const *name)
    296296{
     
    308308void WindowManager::flush_screen()
    309309{
    310     vec2i m1(0, 0);
     310    ivec2 m1(0, 0);
    311311
    312312    if (has_mouse())
    313313    {
    314314        m1 = m_pos - m_center;
    315         vec2i m2 = m1 + m_sprite->m_visual->Size();
    316 
    317         m_sprite->m_save->PutPart(m_surf, vec2i(0, 0), m1, m2);
     315        ivec2 m2 = m1 + m_sprite->m_visual->Size();
     316
     317        m_sprite->m_save->PutPart(m_surf, ivec2(0, 0), m1, m2);
    318318        m_surf->PutImage(m_sprite->m_visual, m1, 1);
    319319    }
     
    334334        if (has_mouse())
    335335        {
    336             m_sprite->m_save->PutPart(p->m_surf, vec2i(0, 0), m1 - p->m_pos,
     336            m_sprite->m_save->PutPart(p->m_surf, ivec2(0, 0), m1 - p->m_pos,
    337337                                      m1 - p->m_pos + m_sprite->m_visual->Size());
    338338            p->m_surf->PutImage(m_sprite->m_visual, m1 - p->m_pos, 1);
     
    372372}
    373373
    374 Jwindow::Jwindow(vec2i pos, vec2i size, ifield *f, char const *name)
     374Jwindow::Jwindow(ivec2 pos, ivec2 size, ifield *f, char const *name)
    375375{
    376376    m_size = 0;
     
    394394    _x2 = m_size.x - 1;
    395395    _y2 = m_size.y - 1;
    396     m_size += vec2i(right_border(), bottom_border());
     396    m_size += ivec2(right_border(), bottom_border());
    397397
    398398    if(size.x == -1)
     
    431431    int x1, y1, x2, y2;
    432432    ifield *i;
    433     m_size = vec2i(2);
     433    m_size = ivec2(2);
    434434    for(i = inm->m_first; i; i = i->next)
    435435    {
    436436        i->set_owner(this);
    437437        i->area(x1, y1, x2, y2);
    438         m_size = Max(m_size, vec2i(x2, y2));
     438        m_size = Max(m_size, ivec2(x2, y2));
    439439    }
    440440}
     
    456456        if (right_border() >= 1)
    457457        {
    458             m_surf->WidgetBar(vec2i(0, 0), m_size - vec2i(1), hi, med, low);
     458            m_surf->WidgetBar(ivec2(0, 0), m_size - ivec2(1), hi, med, low);
    459459            if (right_border() >= 3)
    460                 m_surf->WidgetBar(vec2i(right_border() - 1, top_border() - 1),
    461                                   m_size - vec2i(left_border(), bottom_border()),
     460                m_surf->WidgetBar(ivec2(right_border() - 1, top_border() - 1),
     461                                  m_size - ivec2(left_border(), bottom_border()),
    462462                                  low, med, hi);
    463463
    464464          else
    465             m_surf->Line(vec2i(left_border() - 1, top_border() - 1),
    466                          vec2i(right_border() - 1, top_border() - 1), low);
     465            m_surf->Line(ivec2(left_border() - 1, top_border() - 1),
     466                         ivec2(right_border() - 1, top_border() - 1), low);
    467467        }
    468       m_surf->Rectangle(vec2i(2, 2), vec2i(top_border() - 2, top_border() - 3),
     468      m_surf->Rectangle(ivec2(2, 2), ivec2(top_border() - 2, top_border() - 3),
    469469                        wm->black());
    470       m_surf->WidgetBar(vec2i(3, 3), vec2i(top_border() - 3, top_border() - 4),
     470      m_surf->WidgetBar(ivec2(3, 3), ivec2(top_border() - 3, top_border() - 4),
    471471                        hi, med, low); // draws the 'close' button
    472472    }
     
    476476      if (right_border() >= 1)
    477477        {
    478           m_surf->WidgetBar(vec2i(0, 0), m_size - vec2i(1), hi, med, low);
     478          m_surf->WidgetBar(ivec2(0, 0), m_size - ivec2(1), hi, med, low);
    479479          if (right_border() >= 3)
    480             m_surf->WidgetBar(vec2i(right_border() - 1, jw_top + 4),
    481                               m_size - vec2i(left_border(), bottom_border()),
     480            m_surf->WidgetBar(ivec2(right_border() - 1, jw_top + 4),
     481                              m_size - ivec2(left_border(), bottom_border()),
    482482                              low, med, hi);
    483483          else
    484             m_surf->Line(vec2i(left_border() - 1, jw_top + 4),
    485                          vec2i(right_border() - 1, jw_top + 4), low);
     484            m_surf->Line(ivec2(left_border() - 1, jw_top + 4),
     485                         ivec2(right_border() - 1, jw_top + 4), low);
    486486        }
    487487      // Draw the 'close' button
    488       m_surf->Rectangle(vec2i(1, 1), vec2i(4, 4), wm->black ());
    489       m_surf->WidgetBar(vec2i(2, 2), vec2i(3, 3), hi, med, low);
     488      m_surf->Rectangle(ivec2(1, 1), ivec2(4, 4), wm->black ());
     489      m_surf->WidgetBar(ivec2(2, 2), ivec2(3, 3), hi, med, low);
    490490    }
    491491  if (_name && _name[0])
    492492    {
    493       m_surf->Bar(vec2i(top_border(), 1),
    494                   vec2i(top_border() + fnt->Size().x * strlen (_name) + 1,
     493      m_surf->Bar(ivec2(top_border(), 1),
     494                  ivec2(top_border() + fnt->Size().x * strlen (_name) + 1,
    495495                        top_border() - 2),
    496496                  med);
    497       fnt->PutString(m_surf, vec2i(top_border() + 1, 1), _name, low);
     497      fnt->PutString(m_surf, ivec2(top_border() + 1, 1), _name, low);
    498498    }
    499499  // clear 'client' region
    500   m_surf->Bar(vec2i(x1(), y1()), vec2i(x2(), y2()), backg);
     500  m_surf->Bar(ivec2(x1(), y1()), ivec2(x2(), y2()), backg);
    501501  inm->redraw ();
    502502}
     
    722722{
    723723    owner = NULL;
    724     m_pos = vec2i(0, 0);
     724    m_pos = ivec2(0, 0);
    725725    next = NULL;
    726726    id = 0;
     
    736736{
    737737    if(owner)
    738         Move(m_pos - vec2i(owner->x1(), owner->y1()));
     738        Move(m_pos - ivec2(owner->x1(), owner->y1()));
    739739    owner = newowner;
    740740    if(owner)
    741         Move(m_pos + vec2i(owner->x1(), owner->y1()));
    742 }
    743 
     741        Move(m_pos + ivec2(owner->x1(), owner->y1()));
     742}
     743
  • abuse/trunk/src/imlib/jwindow.h

    r671 r682  
    6666
    6767    virtual void set_owner(Jwindow *owner);
    68     virtual void Move(vec2i pos) { m_pos = pos; }
     68    virtual void Move(ivec2 pos) { m_pos = pos; }
    6969    virtual void area(int &x1, int &y1, int &x2, int &y2) = 0;
    7070    virtual void draw_first(image *screen) = 0;
     
    7777    virtual ifield *unlink(int id) { (void)id; return NULL; }
    7878
    79     vec2i m_pos;
     79    ivec2 m_pos;
    8080    int id;
    8181    ifield *next;
     
    9696
    9797    Jwindow(char const *name = NULL);
    98     Jwindow(vec2i pos, vec2i size, ifield *f, char const *name = NULL);
     98    Jwindow(ivec2 pos, ivec2 size, ifield *f, char const *name = NULL);
    9999    ~Jwindow();
    100100
    101101    virtual void redraw();
    102     void Resize(vec2i size);
    103     void clear(int color = 0) { m_surf->Bar(vec2i(x1(), y1()),
    104                                             vec2i(x2(), y2()), color); }
     102    void Resize(ivec2 size);
     103    void clear(int color = 0) { m_surf->Bar(ivec2(x1(), y1()),
     104                                            ivec2(x2(), y2()), color); }
    105105    void show() { _hidden = false; }
    106106    void hide() { _hidden = true; }
     
    113113    int x2() { return _x2; }
    114114    int y2() { return _y2; }
    115     void clip_in() { m_surf->SetClip(vec2i(x1(), y1()), vec2i(x2() + 1, y2() + 1)); }
    116     void clip_out() { m_surf->SetClip(vec2i(0), m_size); }
     115    void clip_in() { m_surf->SetClip(ivec2(x1(), y1()), ivec2(x2() + 1, y2() + 1)); }
     116    void clip_out() { m_surf->SetClip(ivec2(0), m_size); }
    117117    char *read(int id) { return inm->get(id)->read(); }
    118118    void local_close();
     
    123123    static int bottom_border();
    124124
    125     vec2i m_pos, m_size;
     125    ivec2 m_pos, m_size;
    126126    image *m_surf;
    127127
     
    159159    JCFont *fnt, *wframe_fnt;
    160160
    161     Jwindow *CreateWindow(vec2i pos, vec2i size,
     161    Jwindow *CreateWindow(ivec2 pos, ivec2 size,
    162162                          ifield *fields = NULL, char const *Name = NULL);
    163163
  • abuse/trunk/src/imlib/pcxread.cpp

    r555 r682  
    126126  read_PCX_header(fp);
    127127
    128   image *im=new image(vec2i(PCX_header.xmax-PCX_header.xmin+1,
     128  image *im=new image(ivec2(PCX_header.xmax-PCX_header.xmin+1,
    129129                            PCX_header.ymax-PCX_header.ymin+1));
    130130  int y;
  • abuse/trunk/src/imlib/pmenu.cpp

    r671 r682  
    2929  active=NULL;
    3030
    31   vec2i caa, cbb;
     31  ivec2 caa, cbb;
    3232  screen->GetClip(caa, cbb);
    3333  if (caa.x<X) caa.x=X;
     
    3535  int h = Jwindow::top_border() + Jwindow::bottom_border();
    3636
    37   bar = wm->CreateWindow(vec2i(X, Y), vec2i(w, 0), NULL);
     37  bar = wm->CreateWindow(ivec2(X, Y), ivec2(w, 0), NULL);
    3838  bar->freeze();  // can't drag this window
    39   bar->m_surf->WidgetBar(vec2i(0, 0), vec2i(w - 1, h - 1),
     39  bar->m_surf->WidgetBar(ivec2(0, 0), ivec2(w - 1, h - 1),
    4040                         wm->bright_color(), wm->medium_color(),
    4141                         wm->dark_color());
     
    146146  int w,h;
    147147  calc_size(w,h);
    148   vec2i caa, cbb;
     148  ivec2 caa, cbb;
    149149  main_screen->GetClip(caa, cbb);
    150150  // FIXME: is this correct? it looks like it used to be incorrect
     
    168168void psub_menu::calc_size(int &w, int &h)
    169169{
    170     vec2i ts = wm->font()->Size();
     170    ivec2 ts = wm->font()->Size();
    171171  w=h=0;
    172172  for (pmenu_item *p=first; p; p=p->next)
     
    189189  int w,h,i=0;
    190190  calc_size(w,h);
    191   vec2i caa, cbb;
     191  ivec2 caa, cbb;
    192192  main_screen->GetClip(caa, cbb);
    193193  if (parent->m_pos.x + w + x >= cbb.x)
     
    201201
    202202
    203   win=wm->CreateWindow(parent->m_pos + vec2i(x, y),
    204              vec2i(w - Jwindow::left_border() - Jwindow::right_border(),
     203  win=wm->CreateWindow(parent->m_pos + ivec2(x, y),
     204             ivec2(w - Jwindow::left_border() - Jwindow::right_border(),
    205205                   h - Jwindow::top_border() - Jwindow::bottom_border()),
    206206             NULL);
    207207  win->freeze();
    208   win->m_surf->WidgetBar(vec2i(0, 0), vec2i(w - 1, h - 1),
     208  win->m_surf->WidgetBar(ivec2(0, 0), ivec2(w - 1, h - 1),
    209209                         wm->bright_color(), wm->medium_color(),
    210210                         wm->dark_color());
     
    229229  {
    230230    int h=wm->font()->Size().y;
    231     parent->m_surf->WidgetBar(vec2i(x, y + h / 2 - 1),
    232                               vec2i(x + w - 1, y + h / 2), wm->dark_color(),
     231    parent->m_surf->WidgetBar(ivec2(x, y + h / 2 - 1),
     232                              ivec2(x + w - 1, y + h / 2), wm->dark_color(),
    233233                              wm->medium_color(), wm->bright_color());
    234234  } else
     
    240240      else
    241241      {
    242     parent->m_surf->Bar(vec2i(bx, y),
    243                         vec2i(x + w - 1, y + wm->font()->Size().y + 1),
     242    parent->m_surf->Bar(ivec2(bx, y),
     243                        ivec2(x + w - 1, y + wm->font()->Size().y + 1),
    244244                        wm->dark_color());
    245     wm->font()->PutString(parent->m_surf, vec2i(x+1, y+1), n, wm->medium_color());
    246     if (on_off && *on_off) wm->font()->PutString(parent->m_surf, vec2i(bx+1, y+1), "*", wm->medium_color());
     245    wm->font()->PutString(parent->m_surf, ivec2(x+1, y+1), n, wm->medium_color());
     246    if (on_off && *on_off) wm->font()->PutString(parent->m_surf, ivec2(bx+1, y+1), "*", wm->medium_color());
    247247      }
    248248    } else
     
    252252      else
    253253      {
    254     parent->m_surf->Bar(vec2i(bx, y),
    255                         vec2i(x + w - 1, y + wm->font()->Size().y + 1),
     254    parent->m_surf->Bar(ivec2(bx, y),
     255                        ivec2(x + w - 1, y + wm->font()->Size().y + 1),
    256256                        wm->medium_color());
    257     wm->font()->PutString(parent->m_surf, vec2i(x + 1, y + 1), n, wm->bright_color());
    258     if (on_off && *on_off) wm->font()->PutString(parent->m_surf, vec2i(bx + 1, y + 1), "*", wm->bright_color());
     257    wm->font()->PutString(parent->m_surf, ivec2(x + 1, y + 1), n, wm->bright_color());
     258    if (on_off && *on_off) wm->font()->PutString(parent->m_surf, ivec2(bx + 1, y + 1), "*", wm->bright_color());
    259259      }
    260260    }
  • abuse/trunk/src/imlib/scroller.cpp

    r670 r682  
    5757void show_icon(image *screen, int x, int y, int icw, int ich, uint8_t *buf)
    5858{
    59   vec2i caa, cbb;
     59  ivec2 caa, cbb;
    6060  screen->GetClip(caa, cbb);
    6161
     
    7878    }
    7979  }
    80   screen->AddDirty(vec2i(x, y), vec2i(x + icw, y + ich));
     80  screen->AddDirty(ivec2(x, y), ivec2(x + icw, y + ich));
    8181  screen->Unlock();
    8282}
    8383
    8484scroller::scroller(int X, int Y, int ID, int L, int H, int Vert, int Total_items, ifield *Next)
    85 {  m_pos = vec2i(X, Y); id=ID; next=Next;  l=L; h=H;  sx=0;  t=Total_items;  drag=-1; vert=Vert;
     85{  m_pos = ivec2(X, Y); id=ID; next=Next;  l=L; h=H;  sx=0;  t=Total_items;  drag=-1; vert=Vert;
    8686}
    8787
     
    124124  if (sx>=t) sx=t-1;
    125125  draw(0,screen);
    126   screen->WidgetBar(vec2i(b1x(), b1y()),
    127                     vec2i(b1x() + bw() - 1, b1y() + bh() - 1),
     126  screen->WidgetBar(ivec2(b1x(), b1y()),
     127                    ivec2(b1x() + bw() - 1, b1y() + bh() - 1),
    128128                    wm->bright_color(), wm->medium_color(), wm->dark_color());
    129   screen->WidgetBar(vec2i(b2x(), b2y()),
    130                     vec2i(b2x() + bw() - 1, b2y() + bh() - 1),
     129  screen->WidgetBar(ivec2(b2x(), b2y()),
     130                    ivec2(b2x() + bw() - 1, b2y() + bh() - 1),
    131131                    wm->bright_color(), wm->medium_color(), wm->dark_color());
    132132  show_icon(screen,b1x()+2,b1y()+2,bw()-4,bh()-4,b1());
     
    135135  int x1,y1,x2,y2;
    136136  dragger_area(x1,y1,x2,y2);
    137   screen->Bar(vec2i(x1, y1), vec2i(x2, y2), wm->black());
    138   screen->Bar(vec2i(x1 + 1, y1 + 1), vec2i(x2 - 1, y2 - 1), wm->medium_color());
     137  screen->Bar(ivec2(x1, y1), ivec2(x2, y2), wm->black());
     138  screen->Bar(ivec2(x1 + 1, y1 + 1), ivec2(x2 - 1, y2 - 1), wm->medium_color());
    139139  draw_widget(screen,0);
    140140  scroll_event(sx,screen);
     
    168168  wig_area(x1,y1,x2,y2);
    169169  if (erase)
    170     screen->Bar(vec2i(x1, y1), vec2i(x2, y2), wm->medium_color());
     170    screen->Bar(ivec2(x1, y1), ivec2(x2, y2), wm->medium_color());
    171171  else
    172     screen->WidgetBar(vec2i(x1, y1), vec2i(x2, y2), wm->bright_color(),
     172    screen->WidgetBar(ivec2(x1, y1), ivec2(x2, y2), wm->bright_color(),
    173173                      wm->medium_color(), wm->dark_color());
    174174}
     
    178178  int x1,y1,x2,y2;
    179179  area(x1,y1,x2,y2);
    180   screen->Rectangle(vec2i(x1, y1), vec2i(x2, y2),
     180  screen->Rectangle(ivec2(x1, y1), ivec2(x2, y2),
    181181                    active ? wm->bright_color() : wm->dark_color());
    182182}
     
    367367void scroller::scroll_event(int newx, image *screen)
    368368{
    369   screen->Bar(m_pos, m_pos + vec2i(l - 1, h - 1), wm->black());
     369  screen->Bar(m_pos, m_pos + ivec2(l - 1, h - 1), wm->black());
    370370  int xa,ya,xo=0,yo;
    371371  if (vert) { xa=0; ya=30; yo=m_pos.x+5; yo=m_pos.y+5; } else { xa=30; ya=0; xo=m_pos.x+5; yo=m_pos.y+5; }
     
    374374    char st[10];
    375375    sprintf(st,"%d",i);
    376     wm->font()->PutString(screen, vec2i(xo, yo), st, wm->bright_color());
     376    wm->font()->PutString(screen, ivec2(xo, yo), st, wm->bright_color());
    377377    xo+=xa; yo+=ya;
    378378  }
     
    495495  if (tex)
    496496  {
    497     vec2i caa, cbb;
     497    ivec2 caa, cbb;
    498498    screen->GetClip(caa, cbb);
    499     screen->SetClip(m_pos, m_pos + vec2i(l, h));
     499    screen->SetClip(m_pos, m_pos + ivec2(l, h));
    500500    int tw=(l+tex->Size().x-1)/tex->Size().x;
    501501    int th=(h+tex->Size().y-1)/tex->Size().y;
     
    503503    for (int j=0; j<th; j++,dy+=tex->Size().y)
    504504      for (int i=0,dx=m_pos.x; i<tw; i++,dx+=tex->Size().x)
    505         screen->PutImage(tex, vec2i(dx, dy));
     505        screen->PutImage(tex, ivec2(dx, dy));
    506506
    507507    screen->SetClip(caa, cbb);
    508   } else screen->Bar(m_pos, m_pos + vec2i(l - 1, h - 1), wm->black());
     508  } else screen->Bar(m_pos, m_pos + ivec2(l - 1, h - 1), wm->black());
    509509
    510510  int dy=m_pos.y;
     
    512512  {
    513513    if (i+newx==cur_sel)
    514       screen->Bar(vec2i(m_pos.x, dy), vec2i(m_pos.x + wid * wm->font()->Size().x - 1,
     514      screen->Bar(ivec2(m_pos.x, dy), ivec2(m_pos.x + wid * wm->font()->Size().x - 1,
    515515                                      dy + wm->font()->Size().y),
    516516                  wm->dark_color());
    517517    if (i+newx<t)
    518       wm->font()->PutString(screen, vec2i(m_pos.x, dy), lis[i+newx].name,
     518      wm->font()->PutString(screen, ivec2(m_pos.x, dy), lis[i+newx].name,
    519519                            wm->bright_color());
    520520  }
     
    583583void spicker::draw_background(image *screen)
    584584{
    585     screen->Bar(m_pos, m_pos + vec2i(l - 1, h - 1), wm->dark_color());
     585    screen->Bar(m_pos, m_pos + ivec2(l - 1, h - 1), wm->dark_color());
    586586}
    587587
  • abuse/trunk/src/imlib/sprite.cpp

    r669 r682  
    2323#include "sprite.h"
    2424
    25 Sprite::Sprite(image *screen, image *visual, vec2i pos)
     25Sprite::Sprite(image *screen, image *visual, ivec2 pos)
    2626{
    2727    CHECK(visual && screen);
     
    3131    m_save = new image(visual->Size());
    3232
    33     if (m_pos + visual->Size() >= 0 && m_pos < vec2i(xres, yres))
    34         m_save->PutPart(m_screen, vec2i(0,0), m_pos, m_pos + m_save->Size());
     33    if (m_pos + visual->Size() >= 0 && m_pos < ivec2(xres, yres))
     34        m_save->PutPart(m_screen, ivec2(0,0), m_pos, m_pos + m_save->Size());
    3535}
    3636
     
    5151    }
    5252
    53     if (m_pos + visual->Size() >= 0 && m_pos < vec2i(xres, yres))
    54         m_save->PutPart(m_screen, vec2i(0,0), m_pos, m_pos + m_save->Size());
     53    if (m_pos + visual->Size() >= 0 && m_pos < ivec2(xres, yres))
     54        m_save->PutPart(m_screen, ivec2(0,0), m_pos, m_pos + m_save->Size());
    5555}
    5656
  • abuse/trunk/src/imlib/sprite.h

    r669 r682  
    1818{
    1919public:
    20     Sprite(image *screen, image *visual, vec2i pos);
     20    Sprite(image *screen, image *visual, ivec2 pos);
    2121    ~Sprite();
    2222
     
    2626
    2727private:
    28     vec2i m_pos;
     28    ivec2 m_pos;
    2929};
    3030
  • abuse/trunk/src/imlib/supmorph.cpp

    r670 r682  
    266266
    267267    int i,px,py,ix,iy;
    268     vec2i caa, cbb;
     268    ivec2 caa, cbb;
    269269    screen->GetClip(caa, cbb);
    270     screen->AddDirty(vec2i(x, y), vec2i(x + w, y + h));
     270    screen->AddDirty(ivec2(x, y), ivec2(x + w, y + h));
    271271    stepper *ss;
    272272    memset(hole,0,w*h);
  • abuse/trunk/src/imlib/tools.cpp

    r655 r682  
    5454void tool_picker::draw_item(image *screen, int x, int y, int num, int active)
    5555{
    56     screen->Bar(vec2i(x, y), vec2i(x + iw - 1, y + ih - 1),
     56    screen->Bar(ivec2(x, y), ivec2(x + iw - 1, y + ih - 1),
    5757                active ? wm->bright_color() : wm->black());
    5858    icons[num]->draw(screen, x, y, map);
  • abuse/trunk/src/imlib/transimage.cpp

    r670 r682  
    107107    im->Unlock();
    108108
    109     PutImage(im, vec2i(0));
     109    PutImage(im, ivec2(0));
    110110    return im;
    111111}
    112112
    113 uint8_t *TransImage::ClipToLine(image *screen, vec2i pos1, vec2i pos2,
    114                                 vec2i &pos, int &ysteps)
     113uint8_t *TransImage::ClipToLine(image *screen, ivec2 pos1, ivec2 pos2,
     114                                ivec2 &pos, int &ysteps)
    115115{
    116116    // check to see if it is totally clipped out first
     
    140140    }
    141141
    142     screen->AddDirty(vec2i(Max(pos.x, pos1.x), pos.y),
    143                      vec2i(Min(pos.x + m_size.x, pos2.x), pos.y + m_size.y));
     142    screen->AddDirty(ivec2(Max(pos.x, pos1.x), pos.y),
     143                     ivec2(Min(pos.x + m_size.x, pos2.x), pos.y + m_size.y));
    144144    return parser;
    145145}
    146146
    147147template<int N>
    148 void TransImage::PutImageGeneric(image *screen, vec2i pos, uint8_t color,
    149                                  image *blend, vec2i bpos, uint8_t *map,
     148void TransImage::PutImageGeneric(image *screen, ivec2 pos, uint8_t color,
     149                                 image *blend, ivec2 bpos, uint8_t *map,
    150150                                 uint8_t *map2, int amount, int nframes,
    151151                                 uint8_t *tint, ColorFilter *f, palette *pal)
    152152{
    153     vec2i pos1, pos2;
     153    ivec2 pos1, pos2;
    154154    int ysteps, mul = 0;
    155155
     
    275275}
    276276
    277 void TransImage::PutImage(image *screen, vec2i pos)
     277void TransImage::PutImage(image *screen, ivec2 pos)
    278278{
    279279    PutImageGeneric<NORMAL>(screen, pos, 0, NULL, 0, NULL, NULL,
     
    281281}
    282282
    283 void TransImage::PutRemap(image *screen, vec2i pos, uint8_t *map)
     283void TransImage::PutRemap(image *screen, ivec2 pos, uint8_t *map)
    284284{
    285285    PutImageGeneric<REMAP>(screen, pos, 0, NULL, 0, map, NULL,
     
    287287}
    288288
    289 void TransImage::PutDoubleRemap(image *screen, vec2i pos,
     289void TransImage::PutDoubleRemap(image *screen, ivec2 pos,
    290290                            uint8_t *map, uint8_t *map2)
    291291{
     
    295295
    296296// Used when eg. the player teleports, or in rocket trails
    297 void TransImage::PutFade(image *screen, vec2i pos, int amount, int nframes,
     297void TransImage::PutFade(image *screen, ivec2 pos, int amount, int nframes,
    298298                         ColorFilter *f, palette *pal)
    299299{
     
    302302}
    303303
    304 void TransImage::PutFadeTint(image *screen, vec2i pos, int amount, int nframes,
     304void TransImage::PutFadeTint(image *screen, ivec2 pos, int amount, int nframes,
    305305                             uint8_t *tint, ColorFilter *f, palette *pal)
    306306{
     
    309309}
    310310
    311 void TransImage::PutColor(image *screen, vec2i pos, uint8_t color)
     311void TransImage::PutColor(image *screen, ivec2 pos, uint8_t color)
    312312{
    313313    PutImageGeneric<COLOR>(screen, pos, color, NULL, 0, NULL, NULL,
     
    317317// This method is unused but is believed to work.
    318318// Assumes that the blend image completely covers the transparent image.
    319 void TransImage::PutBlend(image *screen, vec2i pos, image *blend, vec2i bpos,
     319void TransImage::PutBlend(image *screen, ivec2 pos, image *blend, ivec2 bpos,
    320320                          int amount, ColorFilter *f, palette *pal)
    321321{
     
    324324}
    325325
    326 void TransImage::PutFilled(image *screen, vec2i pos, uint8_t color)
     326void TransImage::PutFilled(image *screen, ivec2 pos, uint8_t color)
    327327{
    328328    PutImageGeneric<FILLED>(screen, pos, color, NULL, 0, NULL, NULL,
     
    330330}
    331331
    332 void TransImage::PutPredator(image *screen, vec2i pos)
     332void TransImage::PutPredator(image *screen, ivec2 pos)
    333333{
    334334    PutImageGeneric<PREDATOR>(screen, pos, 0, NULL, 0, NULL, NULL,
     
    336336}
    337337
    338 void TransImage::PutScanLine(image *screen, vec2i pos, int line)
     338void TransImage::PutScanLine(image *screen, ivec2 pos, int line)
    339339{
    340340    PutImageGeneric<SCANLINE>(screen, pos, 0, NULL, 0, NULL, NULL,
     
    359359        }
    360360    }
    361     return ret + sizeof(void *) + sizeof(vec2i);
    362 }
    363 
     361    return ret + sizeof(void *) + sizeof(ivec2);
     362}
     363
  • abuse/trunk/src/imlib/transimage.h

    r579 r682  
    3131    ~TransImage();
    3232
    33     inline vec2i Size() { return m_size; }
     33    inline ivec2 Size() { return m_size; }
    3434    inline uint8_t *Data() { return m_data; }
    3535
    3636    image *ToImage();
    3737
    38     void PutImage(image *screen, vec2i pos);
    39     void PutRemap(image *screen, vec2i pos, uint8_t *map);
    40     void PutDoubleRemap(image *screen, vec2i pos, uint8_t *map, uint8_t *map2);
    41     void PutFade(image *screen, vec2i pos, int amount, int nframes,
     38    void PutImage(image *screen, ivec2 pos);
     39    void PutRemap(image *screen, ivec2 pos, uint8_t *map);
     40    void PutDoubleRemap(image *screen, ivec2 pos, uint8_t *map, uint8_t *map2);
     41    void PutFade(image *screen, ivec2 pos, int amount, int nframes,
    4242                 ColorFilter *f, palette *pal);
    43     void PutFadeTint(image *screen, vec2i pos, int amount, int nframes,
     43    void PutFadeTint(image *screen, ivec2 pos, int amount, int nframes,
    4444                     uint8_t *tint, ColorFilter *f, palette *pal);
    45     void PutColor(image *screen, vec2i pos, uint8_t color);
    46     void PutFilled(image *screen, vec2i pos, uint8_t color);
    47     void PutPredator(image *screen, vec2i pos);
    48     void PutBlend(image *screen, vec2i pos, image *blend, vec2i bpos,
     45    void PutColor(image *screen, ivec2 pos, uint8_t color);
     46    void PutFilled(image *screen, ivec2 pos, uint8_t color);
     47    void PutPredator(image *screen, ivec2 pos);
     48    void PutBlend(image *screen, ivec2 pos, image *blend, ivec2 bpos,
    4949                  int blend_amount, ColorFilter *f, palette *pal);
    50     void PutScanLine(image *screen, vec2i pos, int line);
     50    void PutScanLine(image *screen, ivec2 pos, int line);
    5151
    5252    size_t DiskUsage();
    5353
    5454private:
    55     uint8_t *ClipToLine(image *screen, vec2i pos1, vec2i pos2,
    56                         vec2i &posy, int &ysteps);
     55    uint8_t *ClipToLine(image *screen, ivec2 pos1, ivec2 pos2,
     56                        ivec2 &posy, int &ysteps);
    5757
    5858    enum PutMode { NORMAL, REMAP, REMAP2, FADE, FADE_TINT, COLOR,
    5959                   FILLED, PREDATOR, BLEND, SCANLINE };
    6060    template<int N>
    61     void PutImageGeneric(image *dest, vec2i pos, uint8_t color,
    62                          image *blend, vec2i bpos,
     61    void PutImageGeneric(image *dest, ivec2 pos, uint8_t color,
     62                         image *blend, ivec2 bpos,
    6363                         uint8_t *map1, uint8_t *map2, int amount,
    6464                         int nframes, uint8_t *tint,
    6565                         ColorFilter *f, palette *pal);
    6666
    67     vec2i m_size;
     67    ivec2 m_size;
    6868    uint8_t *m_data;
    6969};
  • abuse/trunk/src/innet.cpp

    r674 r682  
    550550
    551551                view *v = f->next;
    552                 v->m_aa = vec2i(5);
    553                 v->m_bb = vec2i(319, 199) - vec2i(5);
     552                v->m_aa = ivec2(5);
     553                v->m_bb = ivec2(319, 199) - ivec2(5);
    554554                join_list = join_list->next;
    555555      }
     
    559559
    560560
    561       Jwindow *j=wm->CreateWindow(vec2i(0, yres / 2), vec2i(-1), new info_field(0, 0, 0, symbol_str("resync"),
     561      Jwindow *j=wm->CreateWindow(ivec2(0, yres / 2), ivec2(-1), new info_field(0, 0, 0, symbol_str("resync"),
    562562                          new button(0, wm->font()->Size().y + 5, ID_NET_DISCONNECT,
    563563                             symbol_str("slack"),NULL)),symbol_str("hold!"))
     
    664664    if (total_retry==12000)    // 2 minutes and nothing
    665665    {
    666       abort=wm->CreateWindow(vec2i(0, yres / 2), vec2i(-1, wm->font()->Size().y*4),
     666      abort=wm->CreateWindow(ivec2(0, yres / 2), ivec2(-1, wm->font()->Size().y*4),
    667667                   new info_field(0, 0, 0, symbol_str("waiting"),
    668668                          new button(0, wm->font()->Size().y + 5, ID_NET_DISCONNECT,
  • abuse/trunk/src/items.cpp

    r579 r682  
    254254    }
    255255  }
    256   micro_image = new image(vec2i(AUTOTILE_WIDTH, AUTOTILE_HEIGHT));
     256  micro_image = new image(ivec2(AUTOTILE_WIDTH, AUTOTILE_HEIGHT));
    257257
    258258  for (l=0; l<AUTOTILE_WIDTH*AUTOTILE_HEIGHT; l++)
    259     micro_image->PutPixel(vec2i(l % AUTOTILE_WIDTH, l / AUTOTILE_WIDTH),
     259    micro_image->PutPixel(ivec2(l % AUTOTILE_WIDTH, l / AUTOTILE_WIDTH),
    260260       color_table->Lookup((r[l]/(t[l]*4/5))>>3,
    261261                 (g[l]/(t[l]*4/5))>>3,
  • abuse/trunk/src/items.h

    r555 r682  
    3737  backtile(spec_entry *e, bFILE *fp);
    3838  backtile(bFILE *fp);
    39   int32_t size() { vec2i s = im->Size(); return 2 + 4 + s.x * s.y; }
     39  int32_t size() { ivec2 s = im->Size(); return 2 + 4 + s.x * s.y; }
    4040  ~backtile() { delete im; }
    4141} ;
  • abuse/trunk/src/level.cpp

    r676 r682  
    790790        int c2 = a->active ? wm->bright_color() : morph_sel_frame_color;
    791791
    792         vec2i pos1 = the_game->GameToMouse(vec2i(a->x, a->y), v);
    793         vec2i pos2 = the_game->GameToMouse(vec2i(a->x + a->w, a->y + a->h), v);
     792        ivec2 pos1 = the_game->GameToMouse(ivec2(a->x, a->y), v);
     793        ivec2 pos2 = the_game->GameToMouse(ivec2(a->x + a->w, a->y + a->h), v);
    794794        main_screen->Rectangle(pos1, pos2, c1);
    795         main_screen->Bar(pos1 - vec2i(1, 1), pos1 + vec2i(1, 1), c2);
    796         main_screen->Bar(pos2 - vec2i(1, 1), pos2 + vec2i(1, 1), c2);
     795        main_screen->Bar(pos1 - ivec2(1, 1), pos1 + ivec2(1, 1), c2);
     796        main_screen->Bar(pos2 - ivec2(1, 1), pos2 + ivec2(1, 1), c2);
    797797    }
    798798}
     
    844844  for (y=0; y<miny; y++)
    845845    for (x=0; x<minx; x++)
    846       new_fg[x+y*w]=GetFg(vec2i(x, y));
     846      new_fg[x+y*w]=GetFg(ivec2(x, y));
    847847
    848848  miny=(nbh<bg_height) ? nbh : bg_height;
     
    851851  for (y=0; y<miny; y++)
    852852    for (x=0; x<minx; x++)
    853       new_bg[x+y*nbw]=GetBg(vec2i(x, y));
     853      new_bg[x+y*nbw]=GetBg(ivec2(x, y));
    854854
    855855  free(map_fg);
     
    16351635void level::write_thumb_nail(bFILE *fp, image *im)
    16361636{
    1637   image *i = new image(vec2i(160, 100 + wm->font()->Size().y * 2));
     1637  image *i = new image(ivec2(160, 100 + wm->font()->Size().y * 2));
    16381638  i->clear();
    16391639  scale_put(im,i,0,0,160,100);
    16401640  if (first_name)
    1641     wm->font()->PutString(i, vec2i(80 - strlen(first_name) * wm->font()->Size().x / 2, 100), first_name);
     1641    wm->font()->PutString(i, ivec2(80 - strlen(first_name) * wm->font()->Size().x / 2, 100), first_name);
    16421642
    16431643  time_t t;
     
    16461646
    16471647  strftime(buf,80,"%T %A %B %d",localtime(&t));
    1648   wm->font()->PutString(i, vec2i(80, 100) + vec2i(-strlen(buf), 2) * wm->font()->Size() / vec2i(2),buf);
     1648  wm->font()->PutString(i, ivec2(80, 100) + ivec2(-strlen(buf), 2) * wm->font()->Size() / ivec2(2),buf);
    16491649
    16501650  fp->write_uint16(i->Size().x);
     
    26382638    for (by=blocky1; by<=blocky2; by++)
    26392639    {
    2640       block=the_game->GetMapFg(vec2i(bx, by));
     2640      block=the_game->GetMapFg(ivec2(bx, by));
    26412641      if (block>BLACK)        // don't check BLACK, should be no points in it
    26422642      {
     
    27122712  for (by=blocky1; by<=blocky2; by++,y1-=f_hi,y2-=f_hi,y_addback+=f_hi)
    27132713  {
    2714     block=the_game->GetMapFg(vec2i(bx, by));
     2714    block=the_game->GetMapFg(ivec2(bx, by));
    27152715
    27162716    // now check the all the line segments in the block
  • abuse/trunk/src/level.h

    r666 r682  
    117117  uint16_t *get_fgline(int y) { CHECK(y>=0 && y<fg_height); return map_fg+y*fg_width; }
    118118  uint16_t *get_bgline(int y) { CHECK(y>=0 && y<bg_height); return map_bg+y*bg_width; }
    119   uint16_t GetFg(vec2i pos) { if (pos >= vec2i(0) && pos < vec2i(fg_width, fg_height))
     119  uint16_t GetFg(ivec2 pos) { if (pos >= ivec2(0) && pos < ivec2(fg_width, fg_height))
    120120                              return fgvalue(*(map_fg+pos.x+pos.y*fg_width));
    121121                                    else return 0;
    122122                      }
    123   uint16_t GetBg(vec2i pos) { if (pos >= vec2i(0) && pos < vec2i(bg_width, bg_height))
     123  uint16_t GetBg(ivec2 pos) { if (pos >= ivec2(0) && pos < ivec2(bg_width, bg_height))
    124124                      return *(map_bg+pos.x+pos.y*bg_width);
    125125                                     else return 0;
    126126                    }
    127   void PutFg(vec2i pos, uint16_t tile) { *(map_fg+pos.x+pos.y*fg_width)=tile; }
    128   void PutBg(vec2i pos, uint16_t tile) { *(map_bg+pos.x+pos.y*bg_width)=tile; }
     127  void PutFg(ivec2 pos, uint16_t tile) { *(map_fg+pos.x+pos.y*fg_width)=tile; }
     128  void PutBg(ivec2 pos, uint16_t tile) { *(map_bg+pos.x+pos.y*bg_width)=tile; }
    129129  void draw_objects(view *v);
    130130  void interpolate_draw_objects(view *v);
  • abuse/trunk/src/light.cpp

    r665 r682  
    775775
    776776  if (ambient==63) return ;
    777   vec2i caa, cbb;
     777  ivec2 caa, cbb;
    778778  sc->GetClip(caa, cbb);
    779779
     
    925925  else min_light_level=(int)ambient+ambient_ramp;
    926926
    927   vec2i caa, cbb;
     927  ivec2 caa, cbb;
    928928  sc->GetClip(caa, cbb);
    929929
  • abuse/trunk/src/loader2.cpp

    r651 r682  
    366366
    367367
    368   image *tmp_image = new image(vec2i(192, 104), fnt6x13);
     368  image *tmp_image = new image(ivec2(192, 104), fnt6x13);
    369369  big_font=new JCFont(tmp_image);
    370370  delete tmp_image;
  • abuse/trunk/src/loadgame.cpp

    r671 r682  
    8787    buts[i]->next=buts[i+1];
    8888
    89   return wm->CreateWindow(vec2i(mx, yres / 2 - (Jwindow::top_border() + maxih * 5) / 2), vec2i(-1), buts[0]);
     89  return wm->CreateWindow(ivec2(mx, yres / 2 - (Jwindow::top_border() + maxih * 5) / 2), ivec2(-1), buts[0]);
    9090}
    9191
     
    202202        if (fail && show_all)
    203203        {
    204             thumbnails[start_num] = new image(vec2i(160, 100));
     204            thumbnails[start_num] = new image(ivec2(160, 100));
    205205            thumbnails[start_num]->clear();
    206             console_font->PutString(thumbnails[start_num], vec2i(0), symbol_str("no_saved"));
     206            console_font->PutString(thumbnails[start_num], ivec2(0), symbol_str("no_saved"));
    207207            total_saved++;
    208208            if (!first) first=thumbnails[start_num];
     
    234234    // Create thumbnail window 5 pixels to the right of the list window
    235235    Jwindow *l_win=create_num_window(0,total_saved,MAX_SAVE_LINES,thumbnails);
    236     Jwindow *preview=wm->CreateWindow(l_win->m_pos + vec2i(l_win->m_size.x + 5, 0), vec2i(max_w, max_h), NULL, title);
    237 
    238     preview->m_surf->PutImage(first, vec2i(preview->x1(), preview->y1()));
     236    Jwindow *preview=wm->CreateWindow(l_win->m_pos + ivec2(l_win->m_size.x + 5, 0), ivec2(max_w, max_h), NULL, title);
     237
     238    preview->m_surf->PutImage(first, ivec2(preview->x1(), preview->y1()));
    239239
    240240    Event ev;
     
    252252            int draw_num=ev.message.id-ID_LOAD_GAME_PREVIEW;
    253253            preview->clear();
    254             preview->m_surf->PutImage(thumbnails[draw_num], vec2i(preview->x1(), preview->y1()));
     254            preview->m_surf->PutImage(thumbnails[draw_num], ivec2(preview->x1(), preview->y1()));
    255255        }
    256256
  • abuse/trunk/src/lol/matrix.cpp

    r555 r682  
    8383}
    8484
     85#if !defined __ANDROID__
     86template<> std::ostream &operator<<(std::ostream &stream, ivec2 const &v)
     87{
     88    return stream << "(" << v.x << ", " << v.y << ")";
     89}
     90
     91template<> std::ostream &operator<<(std::ostream &stream, ivec3 const &v)
     92{
     93    return stream << "(" << v.x << ", " << v.y << ", " << v.z << ")";
     94}
     95
     96template<> std::ostream &operator<<(std::ostream &stream, ivec4 const &v)
     97{
     98    return stream << "(" << v.x << ", " << v.y << ", "
     99                         << v.z << ", " << v.w << ")";
     100}
     101
     102template<> std::ostream &operator<<(std::ostream &stream, vec2 const &v)
     103{
     104    return stream << "(" << v.x << ", " << v.y << ")";
     105}
     106
     107template<> std::ostream &operator<<(std::ostream &stream, vec3 const &v)
     108{
     109    return stream << "(" << v.x << ", " << v.y << ", " << v.z << ")";
     110}
     111
     112template<> std::ostream &operator<<(std::ostream &stream, vec4 const &v)
     113{
     114    return stream << "(" << v.x << ", " << v.y << ", "
     115                         << v.z << ", " << v.w << ")";
     116}
     117
     118template<> std::ostream &operator<<(std::ostream &stream, mat4 const &m)
     119{
     120    stream << "((" << m[0][0] << ", " << m[1][0]
     121            << ", " << m[2][0] << ", " << m[3][0] << "), ";
     122    stream << "(" << m[0][1] << ", " << m[1][1]
     123           << ", " << m[2][1] << ", " << m[3][1] << "), ";
     124    stream << "(" << m[0][2] << ", " << m[1][2]
     125           << ", " << m[2][2] << ", " << m[3][2] << "), ";
     126    stream << "(" << m[0][3] << ", " << m[1][3]
     127           << ", " << m[2][3] << ", " << m[3][3] << "))";
     128    return stream;
     129}
     130#endif
     131
    85132template<> mat4 mat4::ortho(float left, float right, float bottom,
    86133                            float top, float near, float far)
  • abuse/trunk/src/lol/matrix.h

    r660 r682  
    1818
    1919#include <cmath>
     20#if !defined __ANDROID__
     21#   include <iostream>
     22#endif
    2023
    2124namespace lol
     
    6770        for (int n = 0; n < elems && n < dest; n++) \
    6871            ret[n] = (*this)[n]; \
     72        for (int n = elems; n < dest; n++) \
     73            ret[n] = 0; \
    6974        return ret; \
    7075    }
     
    138143    OPERATORS(2)
    139144
     145#if !defined __ANDROID__
     146    template<typename U>
     147    friend std::ostream &operator<<(std::ostream &stream, Vec2<U> const &v);
     148#endif
     149
    140150    union { T x; T a; T i; };
    141151    union { T y; T b; T j; };
     
    143153
    144154typedef Vec2<float> vec2;
    145 typedef Vec2<int> vec2i;
     155typedef Vec2<int> ivec2;
    146156
    147157template <typename T> struct Vec3
     
    152162
    153163    OPERATORS(3)
     164
     165#if !defined __ANDROID__
     166    template<typename U>
     167    friend std::ostream &operator<<(std::ostream &stream, Vec3<U> const &v);
     168#endif
    154169
    155170    union { T x; T a; T i; };
     
    159174
    160175typedef Vec3<float> vec3;
    161 typedef Vec3<int> vec3i;
     176typedef Vec3<int> ivec3;
    162177
    163178template <typename T> struct Vec4
     
    168183
    169184    OPERATORS(4)
     185
     186#if !defined __ANDROID__
     187    template<typename U>
     188    friend std::ostream &operator<<(std::ostream &stream, Vec4<U> const &v);
     189#endif
    170190
    171191    union { T x; T a; T i; };
     
    176196
    177197typedef Vec4<float> vec4;
    178 typedef Vec4<int> vec4i;
     198typedef Vec4<int> ivec4;
    179199
    180200#define SCALAR_GLOBAL(elems, op, U) \
     
    230250
    231251    void printf() const;
     252
     253#if !defined __ANDROID__
     254    template<class U>
     255    friend std::ostream &operator<<(std::ostream &stream, Mat4<U> const &m);
     256#endif
    232257
    233258    inline Mat4<T> operator +(Mat4<T> const val) const
     
    295320
    296321typedef Mat4<float> mat4;
    297 typedef Mat4<int> mat4i;
     322typedef Mat4<int> imat4;
    298323
    299324} /* namespace lol */
  • abuse/trunk/src/menu.cpp

    r679 r682  
    4545
    4646//percent is 0..256
    47 static void TintArea(vec2i aa, vec2i bb,
     47static void TintArea(ivec2 aa, ivec2 bb,
    4848                     int r_to, int g_to, int b_to, int percent)
    4949{
    50     vec2i caa, cbb;
     50    ivec2 caa, cbb;
    5151    main_screen->GetClip(caa, cbb);
    5252    aa = Max(aa, caa);
     
    7575}
    7676
    77 void DarkWidget(vec2i aa, vec2i bb, int br, int dr, int amount)
     77void DarkWidget(ivec2 aa, ivec2 bb, int br, int dr, int amount)
    7878{
    7979    main_screen->AddDirty(aa, bb);
    80     main_screen->Line(aa, vec2i(aa.x, bb.y - 1), br);
    81     main_screen->Line(aa, vec2i(bb.x - 1, aa.y), br);
    82     main_screen->Line(vec2i(bb.x - 1, aa.y + 1), bb - vec2i(1), dr);
    83     main_screen->Line(vec2i(aa.x + 1, bb.y - 1), bb - vec2i(1), dr);
    84     TintArea(aa + vec2i(1), bb, 0, 0, 0, amount);
     80    main_screen->Line(aa, ivec2(aa.x, bb.y - 1), br);
     81    main_screen->Line(aa, ivec2(bb.x - 1, aa.y), br);
     82    main_screen->Line(ivec2(bb.x - 1, aa.y + 1), bb - ivec2(1), dr);
     83    main_screen->Line(ivec2(aa.x + 1, bb.y - 1), bb - ivec2(1), dr);
     84    TintArea(aa + ivec2(1), bb, 0, 0, 0, amount);
    8585}
    8686
     
    131131
    132132
    133   main_screen->AddDirty(vec2i(mx, my), vec2i(mx + mw, my + mh));
     133  main_screen->AddDirty(ivec2(mx, my), ivec2(mx + mw, my + mh));
    134134
    135135  if (title)
     
    137137    int tl=strlen(title)*font->Size().x;
    138138    int tx=main_screen->Size().x/2-tl/2;
    139     DarkWidget(vec2i(tx - 2, my-font->Size().y - 4), vec2i(tx + tl + 3, my - 1), wm->medium_color(),wm->dark_color(),180);
    140     font->PutString(main_screen, vec2i(tx + 1, my-font->Size().y - 2), title, wm->bright_color());
    141   }
    142 
    143   DarkWidget(vec2i(mx, my), vec2i(mx + mw, my + mh),
     139    DarkWidget(ivec2(tx - 2, my-font->Size().y - 4), ivec2(tx + tl + 3, my - 1), wm->medium_color(),wm->dark_color(),180);
     140    font->PutString(main_screen, ivec2(tx + 1, my-font->Size().y - 2), title, wm->bright_color());
     141  }
     142
     143  DarkWidget(ivec2(mx, my), ivec2(mx + mw, my + mh),
    144144             wm->medium_color(), wm->dark_color(), 200);
    145145
     
    149149  {
    150150    char *ms=men_str(CAR(c));
    151     font->PutString(main_screen, vec2i(mx + 10 + 1, y + 1), ms, wm->black());
    152     font->PutString(main_screen, vec2i(mx + 10, y), ms, wm->bright_color());
     151    font->PutString(main_screen, ivec2(mx + 10 + 1, y + 1), ms, wm->black());
     152    font->PutString(main_screen, ivec2(mx + 10, y), ms, wm->bright_color());
    153153    y+=font->Size().y+1;
    154154  }
     
    158158  int choice=0,done=0;
    159159  int bh=font->Size().y+3;
    160   image *save = new image(vec2i(mw - 2,bh));
     160  image *save = new image(ivec2(mw - 2,bh));
    161161  int color=128,cdir=50;
    162162
     
    214214      int by2=by1+bh-1;
    215215
    216       save->PutPart(main_screen, vec2i(0, 0), vec2i(mx + 1, by1), vec2i(mx + mw - 1, by2 + 1));
    217       TintArea(vec2i(mx + 1, by1), vec2i(mx + mw - 1, by2 + 1),
     216      save->PutPart(main_screen, ivec2(0, 0), ivec2(mx + 1, by1), ivec2(mx + mw - 1, by2 + 1));
     217      TintArea(ivec2(mx + 1, by1), ivec2(mx + mw - 1, by2 + 1),
    218218               63, 63, 63, color);
    219219
    220220      char *cur=men_str(nth(choice,args));
    221       font->PutString(main_screen, vec2i(mx + 10 + 1, by1 + 3), cur, wm->black());
    222       font->PutString(main_screen, vec2i(mx + 10, by1 + 2), cur, wm->bright_color());
    223       main_screen->Rectangle(vec2i(mx + 1, by1), vec2i(mx + mw - 2, by2),
     221      font->PutString(main_screen, ivec2(mx + 10 + 1, by1 + 3), cur, wm->black());
     222      font->PutString(main_screen, ivec2(mx + 10, by1 + 2), cur, wm->bright_color());
     223      main_screen->Rectangle(ivec2(mx + 1, by1), ivec2(mx + mw - 2, by2),
    224224                             wm->bright_color());
    225225
     
    232232      }
    233233      wm->flush_screen();
    234       main_screen->PutImage(save, vec2i(mx + 1, by1));
     234      main_screen->PutImage(save, ivec2(mx + 1, by1));
    235235    } else { Timer tmp; tmp.WaitMs(10); }
    236236
     
    376376  if (DEFINEDP(ss->GetValue()))
    377377  {
    378     image blank(vec2i(2, 2)); blank.clear();
    379     wm->SetMouseShape(blank.copy(), vec2i(0, 0));      // don't show mouse
     378    image blank(ivec2(2, 2)); blank.clear();
     379    wm->SetMouseShape(blank.copy(), ivec2(0, 0));      // don't show mouse
    380380
    381381    LObject *tmp = (LObject *)ss->GetValue();
     
    396396      tmp = (LObject *)CDR(tmp);
    397397    }
    398     wm->SetMouseShape(cache.img(c_normal)->copy(), vec2i(1, 1));
     398    wm->SetMouseShape(cache.img(c_normal)->copy(), ivec2(1, 1));
    399399  }
    400400}
     
    640640    inm->clear_current();
    641641
    642     main_screen->AddDirty(vec2i(0), vec2i(320, 200));
     642    main_screen->AddDirty(ivec2(0), ivec2(320, 200));
    643643
    644644    Event ev;
  • abuse/trunk/src/morpher.cpp

    r657 r682  
    2424    if (fleft)
    2525    {
    26         vec2i pos = the_game->GameToMouse(vec2i(who->x - (cx >> 16),
     26        ivec2 pos = the_game->GameToMouse(ivec2(who->x - (cx >> 16),
    2727                                                who->y - (cy >> 16)), v);
    2828        mor->show(main_screen, pos.x, pos.x, color_table, pal, 1000);
  • abuse/trunk/src/net/gserver.cpp

    r671 r682  
    7171      char msg[100];
    7272      sprintf(msg,symbol_str("min_wait"),main_net_cfg->min_players-total_players());
    73       stat = wm->CreateWindow(vec2i(100, 50), vec2i(-1), new info_field(0, 0, ID_NULL, msg,
     73      stat = wm->CreateWindow(ivec2(100, 50), ivec2(-1), new info_field(0, 0, ID_NULL, msg,
    7474                       new button(0, wm->font()->Size().y * 2, ID_CANCEL,symbol_str("cancel_button"),NULL)  ));
    7575      wm->flush_screen();
  • abuse/trunk/src/netcfg.cpp

    r671 r682  
    5757void net_configuration::cfg_error(char const *msg)
    5858{
    59   Jwindow *j=wm->CreateWindow(vec2i(-1, 0), vec2i(-1), new info_field(0, 0, 0, msg,
     59  Jwindow *j=wm->CreateWindow(ivec2(-1, 0), ivec2(-1), new info_field(0, 0, 0, msg,
    6060      new button(0, 30,CFG_ERR_OK,symbol_str("ok_button"),NULL)),symbol_str("input_error"));
    6161  Event ev;
     
    268268  int ns_w=ns->Size().x,ns_h=ns->Size().y;
    269269  int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2;
    270   main_screen->PutImage(ns, vec2i(x, y));
     270  main_screen->PutImage(ns, ivec2(x, y));
    271271  JCFont *fnt=wm->font();
    272272
     
    280280      fy=y+ns_h/2-fnt->Size().y;
    281281
    282   fnt->PutString(main_screen, vec2i(fx + 1, fy + 1), message, wm->black());
    283   fnt->PutString(main_screen, vec2i(fx, fy), message, wm->bright_color());
     282  fnt->PutString(main_screen, ivec2(fx + 1, fy + 1), message, wm->black());
     283  fnt->PutString(main_screen, ivec2(fx, fy), message, wm->bright_color());
    284284
    285285
     
    308308  }
    309309
    310   main_screen->PutImage(screen_backup, vec2i(0, 0));
     310  main_screen->PutImage(screen_backup, ivec2(0, 0));
    311311  wm->flush_screen();
    312312  delete screen_backup;
     
    333333  int ns_w=ns->Size().x,ns_h=ns->Size().y;
    334334  int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2;
    335   main_screen->PutImage(ns, vec2i(x, y));
     335  main_screen->PutImage(ns, ivec2(x, y));
    336336  JCFont *fnt=wm->font();
    337337  image *ok_image=cache.img(cache.reg("art/frame.spe","dev_ok",SPEC_IMAGE,1))->copy(),
     
    452452  int ns_w=ns->Size().x,ns_h=ns->Size().y;
    453453  int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2;
    454   main_screen->PutImage(ns, vec2i(x, y));
     454  main_screen->PutImage(ns, ivec2(x, y));
    455455  char const *nw_s = symbol_str("Networking");
    456456  JCFont *fnt=wm->font();
    457457
    458458
    459   wm->font()->PutString(main_screen, vec2i(x + ns_w / 2 - strlen(nw_s) * fnt->Size().x / 2, y + 21 / 2 - fnt->Size().y / 2),
     459  wm->font()->PutString(main_screen, ivec2(x + ns_w / 2 - strlen(nw_s) * fnt->Size().x / 2, y + 21 / 2 - fnt->Size().y / 2),
    460460      nw_s,wm->medium_color());
    461461  {
  • abuse/trunk/src/objects.cpp

    r674 r682  
    381381  picture_space(x1,y1,x2,y2);
    382382
    383   vec2i pos1 = the_game->GameToMouse(vec2i(x1, y1), v);
     383  ivec2 pos1 = the_game->GameToMouse(ivec2(x1, y1), v);
    384384  if (pos1.y >= v->m_aa.y)
    385385  {
     
    387387    current_level->foreground_intersect(x, y1, tmp, draw_to);
    388388    // calculate pos2.y
    389     vec2i pos2 = the_game->GameToMouse(vec2i(x1, draw_to), v);
     389    ivec2 pos2 = the_game->GameToMouse(ivec2(x1, draw_to), v);
    390390
    391391    pos2.y = Max(v->m_aa.y, pos2.y);
     
    394394
    395395    for (int i = pos2.y; i <= pos1.y; i++)
    396       p->PutScanLine(main_screen, vec2i(pos1.x, i), 0);
     396      p->PutScanLine(main_screen, ivec2(pos1.x, i), 0);
    397397  }
    398398}
     
    671671  TransImage *cpict=picture();
    672672  cpict->PutFade(main_screen,
    673           vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     673          ivec2((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    674674                y-cpict->Size().y+1-current_vyadd),
    675675          count,max,
     
    683683  if (fade_count())
    684684    cpict->PutFadeTint(main_screen,
    685                vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     685               ivec2((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    686686                     y-cpict->Size().y+1-current_vyadd),
    687687               fade_count(),fade_max(),
     
    692692  else
    693693    cpict->PutRemap(main_screen,
    694                vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     694               ivec2((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    695695                     y-cpict->Size().y+1-current_vyadd),
    696696               cache.ctint(tint_id)->data);
     
    703703  if (fade_count())
    704704    cpict->PutFadeTint(main_screen,
    705                vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     705               ivec2((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    706706                     y-cpict->Size().y+1-current_vyadd),
    707707               fade_count(),fade_max(),
     
    712712  else
    713713    cpict->PutDoubleRemap(main_screen,
    714                vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     714               ivec2((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    715715                     y-cpict->Size().y+1-current_vyadd),
    716716               cache.ctint(tint_id)->data,
     
    724724  TransImage *cpict=picture();
    725725  cpict->PutPredator(main_screen,
    726              vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     726             ivec2((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    727727                   y-cpict->Size().y+1-current_vyadd));
    728728
     
    747747      TransImage *cpict=picture();
    748748      cpict->PutImage(main_screen,
    749                vec2i((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
     749               ivec2((direction<0 ? x-(cpict->Size().x-x_center()-1) : x-x_center())-current_vxadd,
    750750                     y-cpict->Size().y+1-current_vyadd));
    751751    }
  • abuse/trunk/src/particle.cpp

    r674 r682  
    171171void part_frame::draw(image *screen, int x, int y, int dir)
    172172{
    173     vec2i caa, cbb;
     173    ivec2 caa, cbb;
    174174    screen->GetClip(caa, cbb);
    175175
     
    209209}
    210210
    211 void ScatterLine(vec2i p1, vec2i p2, int c, int s)
    212 {
    213     vec2i caa, cbb;
     211void ScatterLine(ivec2 p1, ivec2 p2, int c, int s)
     212{
     213    ivec2 caa, cbb;
    214214    main_screen->GetClip(caa, cbb);
    215215
     
    239239}
    240240
    241 void AScatterLine(vec2i p1, vec2i p2, int c1, int c2, int s)
    242 {
    243     vec2i caa, cbb;
     241void AScatterLine(ivec2 p1, ivec2 p2, int c1, int c2, int s)
     242{
     243    ivec2 caa, cbb;
    244244    main_screen->GetClip(caa, cbb);
    245245
  • abuse/trunk/src/particle.h

    r672 r682  
    2323void tick_panims();
    2424void free_pframes();
    25 void ScatterLine(vec2i p1, vec2i p2, int c, int s);
    26 void AScatterLine(vec2i p1, vec2i p2, int c1, int c2, int s);
     25void ScatterLine(ivec2 p1, ivec2 p2, int c, int s);
     26void AScatterLine(ivec2 p1, ivec2 p2, int c1, int c2, int s);
    2727
    2828struct part
  • abuse/trunk/src/profile.cpp

    r671 r682  
    6060
    6161
    62   prof_win=wm->CreateWindow(vec2i(prop->getd("profile x", -1),
     62  prof_win=wm->CreateWindow(ivec2(prop->getd("profile x", -1),
    6363                                  prop->getd("profile y", -1)),
    64                             vec2i(20, prof_height + 1) * console_font->Size(),
     64                            ivec2(20, prof_height + 1) * console_font->Size(),
    6565                            NULL, "PROFILE");
    6666}
     
    120120  float time_scaler=(float)max_bar_length/prof_list[0].total_time;
    121121
    122   prof_win->m_surf->Bar(vec2i(0, prof_win->y1()),
    123                         vec2i(prof_win->m_surf->Size().x - 1,
     122  prof_win->m_surf->Bar(ivec2(0, prof_win->y1()),
     123                        ivec2(prof_win->m_surf->Size().x - 1,
    124124                              prof_win->m_surf->Size().y), 0);
    125125  int dy = 0;
    126126  for (; i<prof_height; i++)
    127127  {
    128     console_font->PutString(prof_win->m_surf, vec2i(spliter + 1, dy), object_names[prof_list[i].otype]);
    129     prof_win->m_surf->Bar(vec2i(spliter - 1 - (int)(prof_list[i].total_time * time_scaler), dy + 1),
    130                           vec2i(spliter - 1, dy + console_font->Size().y - 1),
     128    console_font->PutString(prof_win->m_surf, ivec2(spliter + 1, dy), object_names[prof_list[i].otype]);
     129    prof_win->m_surf->Bar(ivec2(spliter - 1 - (int)(prof_list[i].total_time * time_scaler), dy + 1),
     130                          ivec2(spliter - 1, dy + console_font->Size().y - 1),
    131131                          wm->bright_color());
    132132    dy+=console_font->Size().y+1;
  • abuse/trunk/src/sdlport/event.cpp

    r656 r682  
    4545}
    4646
    47 void EventHandler::SysWarpMouse(vec2i pos)
     47void EventHandler::SysWarpMouse(ivec2 pos)
    4848{
    4949    SDL_WarpMouse(pos.x, pos.y);
     
    133133        ev.mouse_button &= (0xff - RIGHT_BUTTON);
    134134    }
    135     m_pos = vec2i(ev.mouse_move.x, ev.mouse_move.y);
     135    m_pos = ivec2(ev.mouse_move.x, ev.mouse_move.y);
    136136    m_button = ev.mouse_button;
    137137
  • abuse/trunk/src/sdlport/video.cpp

    r643 r682  
    123123
    124124    // Create the screen image
    125     main_screen = new image(vec2i(xres, yres), NULL, 2);
     125    main_screen = new image(ivec2(xres, yres), NULL, 2);
    126126    if(main_screen == NULL)
    127127    {
  • abuse/trunk/src/statbar.cpp

    r676 r682  
    251251    {
    252252      if ((current_level->tick_counter()&4)==0)
    253         wm->SetMouseShape(cache.img(c_mouse1)->copy(), vec2i(4, 4));
    254       else wm->SetMouseShape(cache.img(c_mouse2)->copy(), vec2i(4, 4));
     253        wm->SetMouseShape(cache.img(c_mouse1)->copy(), ivec2(4, 4));
     254      else wm->SetMouseShape(cache.img(c_mouse2)->copy(), ivec2(4, 4));
    255255      changed_cursor=1;
    256256    } else if (changed_cursor)
    257257    {
    258258      if (!(dev&EDIT_MODE))
    259         wm->SetMouseShape(cache.img(c_target)->copy(), vec2i(8, 8));
     259        wm->SetMouseShape(cache.img(c_target)->copy(), ivec2(8, 8));
    260260      else
    261         wm->SetMouseShape(cache.img(c_normal)->copy(), vec2i(1, 1));
     261        wm->SetMouseShape(cache.img(c_normal)->copy(), ivec2(1, 1));
    262262      changed_cursor=0;
    263263    }
  • abuse/trunk/src/tool/abuse-tool.cpp

    r615 r682  
    347347                return EXIT_FAILURE;
    348348            }
    349             vec2i size = im->Size();
     349            ivec2 size = im->Size();
    350350            len = 2 * sizeof(uint16_t) + size.x * size.y;
    351351            data = (uint8_t *)malloc(len);
  • abuse/trunk/src/transp.cpp

    r670 r682  
    1919void transp_put(image *im, image *screen, uint8_t *table, int x, int y)
    2020{
    21     vec2i caa, cbb;
     21    ivec2 caa, cbb;
    2222    screen->GetClip(caa, cbb);
    2323
    24     vec2i aa(0), bb = im->Size();
    25     vec2i pos(x, y);
     24    ivec2 aa(0), bb = im->Size();
     25    ivec2 pos(x, y);
    2626
    27     aa += Max(caa - pos, vec2i(0));
    28     bb -= Max(caa - pos, vec2i(0));
     27    aa += Max(caa - pos, ivec2(0));
     28    bb -= Max(caa - pos, ivec2(0));
    2929    pos = Max(caa, pos);
    3030
    31     bb = Min(bb, cbb - vec2i(1) - pos);
     31    bb = Min(bb, cbb - ivec2(1) - pos);
    3232
    33     if (!(bb >= vec2i(0)))
     33    if (!(bb >= ivec2(0)))
    3434        return;
    3535    screen->AddDirty(pos, pos + bb);
  • abuse/trunk/src/ui/volumewindow.cpp

    r671 r682  
    4949void VolumeWindow::redraw()
    5050{
    51     m_surf->PutImage(cache.img(bg), vec2i(0, 0));
     51    m_surf->PutImage(cache.img(bg), ivec2(0, 0));
    5252    draw_music_vol();
    5353    draw_sfx_vol();
     
    6161    if(t != 0)
    6262    {
    63         m_surf->PutImage(cache.img(slider), vec2i(x1, y1));
     63        m_surf->PutImage(cache.img(slider), ivec2(x1, y1));
    6464//      m_surf->bar(x1,y1,dx,y2,c1);
    6565    }
     
    6868
    6969    if(dx < x2)
    70         m_surf->Bar(vec2i(dx + 1, y1), vec2i(x2, y2), c2);
     70        m_surf->Bar(ivec2(dx + 1, y1), ivec2(x2, y2), c2);
    7171}
    7272
  • abuse/trunk/src/view.cpp

    r676 r682  
    197197  no_ytop=0;
    198198  no_ybottom=0;
    199     m_lastlastpos = m_lastpos = focus ? vec2i(focus->x, focus->y) : vec2i(0);
     199    m_lastlastpos = m_lastpos = focus ? ivec2(focus->x, focus->y) : ivec2(0);
    200200  last_hp=last_ammo=-1;
    201201  last_type=-1;
     
    216216
    217217  player_number=number;
    218     m_aa = vec2i(0);
    219     m_bb = vec2i(100);
     218    m_aa = ivec2(0);
     219    m_bb = ivec2(100);
    220220    m_focus = focus;
    221221  next=Next;
    222     m_shift = vec2i(SHIFT_RIGHT_DEFAULT, SHIFT_DOWN_DEFAULT);
     222    m_shift = ivec2(SHIFT_RIGHT_DEFAULT, SHIFT_DOWN_DEFAULT);
    223223  x_suggestion=0;
    224224  y_suggestion=0;
     
    305305{
    306306    int sug_x,sug_y,sug_b1,sug_b2,sug_b3,sug_b4;
    307     vec2i sug_p(0, 0);
     307    ivec2 sug_p(0, 0);
    308308
    309309// NOTE:(AK) I have commented this out so we don't use the lisp
     
    464464      int32_t x[8];
    465465      memcpy(x,pk,8*4);  pk+=8*4;
    466       m_aa = vec2i(lltl(x[0]), lltl(x[1]));
    467       m_bb = vec2i(lltl(x[2]), lltl(x[3]));
     466      m_aa = ivec2(lltl(x[0]), lltl(x[1]));
     467      m_bb = ivec2(lltl(x[2]), lltl(x[3]));
    468468
    469469      pan_x=lltl(x[4]);
    470470      pan_y=lltl(x[5]);
    471       m_shift = vec2i(lltl(x[7]), lltl(x[6]));
     471      m_shift = ivec2(lltl(x[7]), lltl(x[6]));
    472472      if (small_render)
    473           small_render->Scale(m_bb - m_aa + vec2i(1));
     473          small_render->Scale(m_bb - m_aa + ivec2(1));
    474474
    475475      suggest.send_view=0;
     
    718718    if (!player_list->next)
    719719    {
    720       f->m_aa = vec2i(f->suggest.cx1, f->suggest.cy1);
    721       f->m_bb = vec2i(f->suggest.cx2, f->suggest.cy2);
     720      f->m_aa = ivec2(f->suggest.cx1, f->suggest.cy1);
     721      f->m_bb = ivec2(f->suggest.cx2, f->suggest.cy2);
    722722      f->suggest.send_view = 0;
    723723    }
     
    773773      v=f->next;
    774774    }
    775     v->m_aa = vec2i(320 / 2 - 155, 200 / 2 - 95);
    776     v->m_bb = vec2i(320 / 2 + 155, 200 / 2 + total_weapons ? 60 : 95);
     775    v->m_aa = ivec2(320 / 2 - 155, 200 / 2 - 95);
     776    v->m_bb = ivec2(320 / 2 + 155, 200 / 2 + total_weapons ? 60 : 95);
    777777    v->m_focus->set_controller(v);
    778778    total--;
     
    825825    memset(last_weapons,0xff,total_weapons*sizeof(int32_t));
    826826
    827     m_shift = vec2i(SHIFT_RIGHT_DEFAULT, SHIFT_DOWN_DEFAULT);
     827    m_shift = ivec2(SHIFT_RIGHT_DEFAULT, SHIFT_DOWN_DEFAULT);
    828828
    829829    if (total_weapons)
  • abuse/trunk/src/view.h

    r676 r682  
    2323{
    2424    int32_t cx1,cy1,cx2,cy2,pan_x,pan_y;
    25     vec2i shift;
     25    ivec2 shift;
    2626    int32_t new_weapon;
    2727    uint8_t send_view,send_weapon_change;
     
    121121  int get_team();
    122122
    123     vec2i m_aa, m_bb; // view area to show
    124     vec2i m_shift; // shift of view
    125     vec2i m_lastpos, m_lastlastpos;
     123    ivec2 m_aa, m_bb; // view area to show
     124    ivec2 m_shift; // shift of view
     125    ivec2 m_lastpos, m_lastlastpos;
    126126
    127127    game_object *m_focus; // object we are focusing on (player)
Note: See TracChangeset for help on using the changeset viewer.