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

imlib: make JCFont use vec2i classes.

File:
1 edited

Legend:

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

    r666 r668  
    115115    }
    116116
    117     info_field *inf = new info_field(0, wm->font()->height() * 2, ID_NULL,
     117    info_field *inf = new info_field(0, wm->font()->Size().y * 2, ID_NULL,
    118118                                     no_space_msg, NULL);
    119119    button *b = new button(0, 0, ID_QUIT_OK, "Quit", inf);
     
    994994        color = 2+(help_text_frames - 10);
    995995
    996     int x1 = v->cx1, y1 = v->cy1, x2 = v->cx2, y2 = v->cy1 + wm->font()->height()+10;
     996    int x1 = v->cx1, y1 = v->cy1, x2 = v->cx2, y2 = v->cy1 + wm->font()->Size().y+10;
    997997
    998998    remap_area(main_screen, x1, y1, x2, y2, white_light + 40 * 256);
     
    10001000    main_screen->Bar(vec2i(x1, y2), vec2i(x2, y2), color);
    10011001
    1002     wm->font()->put_string(main_screen, x1 + 5, y1 + 5,
    1003                    help_text, color);
     1002    wm->font()->PutString(main_screen, vec2i(x1 + 5, y1 + 5),
     1003                          help_text, color);
    10041004    if(color > 30)
    10051005        help_text_frames = -1;
     
    14471447    char str[16];
    14481448    sprintf(str, "%ld", (long)(10000.0f / avg_ms));
    1449     console_font->put_string(main_screen, first_view->cx1, first_view->cy1, str);
     1449    console_font->PutString(main_screen, vec2i(first_view->cx1, first_view->cy1), str);
    14501450
    14511451    sprintf(str, "%d", total_active);
    1452     console_font->put_string(main_screen, first_view->cx1, first_view->cy1 + 10, str);
     1452    console_font->PutString(main_screen, vec2i(first_view->cx1, first_view->cy1 + 10), str);
    14531453}
    14541454
     
    20522052    {
    20532053        char const *helpstr = "ARROW KEYS CHANGE TEXT SPEED";
    2054         wm->font()->put_string(main_screen, main_screen->Size().x/2-(wm->font()->width()*strlen(helpstr))/2 + 1,
    2055             main_screen->Size().y-wm->font()->height()-5 + 1, helpstr, wm->dark_color());
    2056         wm->font()->put_string(main_screen, main_screen->Size().x/2-(wm->font()->width()*strlen(helpstr))/2,
    2057             main_screen->Size().y-wm->font()->height()-5, helpstr, wm->bright_color());
     2054        vec2i span = wm->font()->Size() * vec2i(strlen(helpstr), 1);
     2055        vec2i pos = (main_screen->Size() - span) / vec2i(2, 1);
     2056        wm->font()->PutString(main_screen, pos + vec2i(1),
     2057                              helpstr, wm->dark_color());
     2058        wm->font()->PutString(main_screen, pos, helpstr, wm->bright_color());
    20582059    }
    20592060/*    else
     
    20612062        char *helpstr="PRESS h FOR HELP";
    20622063        wm->font()->put_string(main_screen, main_screen->Size().x-wm->font()->width()*strlen(helpstr)-5,
    2063             main_screen->Size().y-wm->font()->height()-5, helpstr);
     2064            main_screen->Size().y-wm->font()->Size().y-5, helpstr);
    20642065    }*/
    20652066/*    int dc = cache.img(window_colors)->pixel(0, 2);
Note: See TracChangeset for help on using the changeset viewer.