Ignore:
Timestamp:
May 16, 2011, 2:37:19 AM (12 years ago)
Author:
Sam Hocevar
Message:

imlib: make JCFont use vec2i classes.

File:
1 edited

Legend:

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

    r659 r668  
    277277  for (; xx; xx--,sl++) *sl=remap[*sl];
    278278
    279   int fx=x+ns_w/2-strlen(message)*fnt->width()/2,
    280     fy=y+ns_h/2-fnt->height();
    281 
    282   fnt->put_string(main_screen,fx+1,fy+1,message,wm->black());
    283   fnt->put_string(main_screen,fx,fy,message,wm->bright_color());
     279  int fx=x+ns_w/2-strlen(message)*fnt->Size().x/2,
     280      fy=y+ns_h/2-fnt->Size().y;
     281
     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());
    284284
    285285
     
    287287    char const *ok = symbol_str("ok_button");
    288288
    289     int bx=x+ns_w/2-strlen(ok)*fnt->width()/2-3,
    290       by=y+ns_h/2+fnt->height()*3;
     289    int bx=x+ns_w/2-strlen(ok)*fnt->Size().x/2-3,
     290        by=y+ns_h/2+fnt->Size().y*3;
    291291
    292292    button *sb=new button(bx,by,NET_SERVER,ok,NULL);
     
    406406
    407407
    408   list=new button(x+80-17,y+ns_h-20-fnt->height(),NET_OK,ok_image,list);
    409   list=new button(x+80+17,y+ns_h-20-fnt->height(),NET_CANCEL,cancel_image,list);
     408  list=new button(x+80-17,y+ns_h-20-fnt->Size().y,NET_OK,ok_image,list);
     409  list=new button(x+80+17,y+ns_h-20-fnt->Size().y,NET_CANCEL,cancel_image,list);
    410410
    411411  int ret=0;
     
    457457
    458458
    459   wm->font()->put_string(main_screen,x+ns_w/2-strlen(nw_s)*fnt->width()/2,y+21/2-fnt->height()/2,
     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),
    460460      nw_s,wm->medium_color());
    461461  {
    462462
    463463    char const *server_str = symbol_str("server");
    464     button *sb=new button(x+40,y+ns_h-23-fnt->height(),NET_SERVER,server_str,NULL);
     464    button *sb=new button(x+40, y+ns_h-23-fnt->Size().y, NET_SERVER, server_str, NULL);
    465465
    466466    if (main_net_cfg && (main_net_cfg->state==CLIENT || main_net_cfg->state==SERVER))
    467       sb=new button(x+40,y+ns_h-9-fnt->height(),NET_SINGLE,symbol_str("single_play"),sb);
     467      sb=new button(x+40, y+ns_h-9-fnt->Size().y, NET_SINGLE, symbol_str("single_play"), sb);
    468468
    469469    InputManager inm(main_screen,sb);
     
    525525        if (find)
    526526        {
    527           int bw=strlen(name)*fnt->width();
     527          int bw=strlen(name)*fnt->Size().x;
    528528          inm.add(new button(x+ns_w/2-bw/2,y+button_y,NET_GAME+total_games,name,NULL));
    529529          find->set_port(server_port);
     
    531531
    532532          total_games++;
    533           button_y+=fnt->height()+10;
     533          button_y += fnt->Size().y + 10;
    534534          inm.redraw();
    535535        }
Note: See TracChangeset for help on using the changeset viewer.