Ignore:
Timestamp:
May 14, 2011, 3:06:23 AM (11 years ago)
Author:
Sam Hocevar
Message:

imlib: make some Image methods use vec2i.

File:
1 edited

Legend:

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

    r645 r650  
    477477        image *jim = cache.img(joy_picts[but * 9+(y + 1)*3 + x + 1]);
    478478        joy_win->m_surf->bar(dx, dy, dx + jim->Size().x+6, dy + jim->Size().y+6, wm->black());
    479         joy_win->m_surf->PutImage(jim, dx + 3, dy + 3);
     479        joy_win->m_surf->PutImage(jim, vec2i(dx + 3, dy + 3));
    480480
    481481        if(but)
     
    605605      main_screen->GetClip(cx1, cy1, cx2, cy2);
    606606      main_screen->SetClip(viewx1, viewy1, viewx2 + 1, viewy2 + 1);
    607       main_screen->PutImage(im, (x - xo / btile_width())*btile_width()+viewx1 - xo % btile_width(),
    608             (y - yo / btile_height())*btile_height()+viewy1 - yo % btile_height(), 0);
     607      main_screen->PutImage(im, vec2i((x - xo / btile_width())*btile_width()+viewx1 - xo % btile_width(),
     608            (y - yo / btile_height())*btile_height()+viewy1 - yo % btile_height()), 0);
    609609      main_screen->SetClip(cx1, cy1, cx2, cy2);
    610610    }
     
    720720        main_screen->SetClip(v->cx1, v->cy1, v->cx2 + 1, v->cy2 + 1);
    721721      image *tit = cache.img(title_screen);
    722       main_screen->PutImage(tit, main_screen->Size().x/2 - tit->Size().x/2,
    723                     main_screen->Size().y/2 - tit->Size().y/2);
     722      main_screen->PutImage(tit, main_screen->Size() / 2 - tit->Size() / 2);
    724723      if(state == SCENE_STATE)
    725724        main_screen->SetClip(cx1, cy1, cx2, cy2);
     
    828827    else bt = get_bg(0);
    829828
    830         main_screen->PutImage(bt->im, draw_x, draw_y);
     829        main_screen->PutImage(bt->im, vec2i(draw_x, draw_y));
    831830//        if(!(dev & EDIT_MODE) && bt->next)
    832831//      current_level->put_bg(x, y, bt->next);
     
    10791078    dev_cont->dev_draw(v);
    10801079    if(cache.in_use())
    1081     main_screen->PutImage(cache.img(vmm_image), v->cx1, v->cy2 - cache.img(vmm_image)->Size().y+1);
     1080    main_screen->PutImage(cache.img(vmm_image), vec2i(v->cx1, v->cy2 - cache.img(vmm_image)->Size().y+1));
    10821081
    10831082    if(dev & DRAW_LIGHTS)
     
    11721171    {
    11731172        main_screen->clear();
    1174         main_screen->PutImage(im, (xres + 1) / 2 - im->Size().x / 2,
    1175                                   (yres + 1) / 2 - im->Size().y / 2);
     1173        main_screen->PutImage(im, vec2i(xres + 1, yres + 1) / 2
     1174                                   - im->Size() / 2);
    11761175    }
    11771176
     
    12721271
    12731272        int dx = (xres + 1) / 2 - gray->Size().x / 2, dy = (yres + 1) / 2 - gray->Size().y / 2;
    1274         main_screen->PutImage(gray, dx, dy);
    1275         main_screen->PutImage(smoke[0], dx + 24, dy + 5);
     1273        main_screen->PutImage(gray, vec2i(dx, dy));
     1274        main_screen->PutImage(smoke[0], vec2i(dx + 24, dy + 5));
    12761275
    12771276        fade_in(NULL, 16);
     
    12931292                break;
    12941293
    1295             main_screen->PutImage(gray, dx, dy);
    1296             main_screen->PutImage(smoke[i % 5], dx + 24, dy + 5);
     1294            main_screen->PutImage(gray, vec2i(dx, dy));
     1295            main_screen->PutImage(smoke[i % 5], vec2i(dx + 24, dy + 5));
    12971296            text_draw(205 - i, dx + 15, dy, dx + 320 - 15, dy + 199, str, wm->font(), cmap, wm->bright_color());
    12981297            wm->flush_screen();
     
    14991498    if(title_screen >= 0)
    15001499    {
    1501       image *tit = cache.img(title_screen);
    1502       main_screen->PutImage(tit, main_screen->Size().x/2 - tit->Size().x/2,
    1503                             main_screen->Size().y/2 - tit->Size().y/2);
     1500      image *im = cache.img(title_screen);
     1501      main_screen->PutImage(im, main_screen->Size() / 2 - im->Size() / 2);
    15041502    }
    15051503    set_state(MENU_STATE);   // then go to menu state so windows will turn off
     
    15731571    {
    15741572      for(view *f = first_view; f; f = f->next)
    1575         main_screen->PutImage(cache.img(pause_image), (f->cx1 + f->cx2)/2 - cache.img(pause_image)->Size().x/2,
    1576                    f->cy1 + 5, 1);
     1573        main_screen->PutImage(cache.img(pause_image), vec2i((f->cx1 + f->cx2)/2 - cache.img(pause_image)->Size().x/2,
     1574                   f->cy1 + 5), 1);
    15771575    }
    15781576
Note: See TracChangeset for help on using the changeset viewer.