Ignore:
Timestamp:
Apr 20, 2011, 12:39:27 AM (11 years ago)
Author:
Sam Hocevar
Message:

imlib: use vec2i for image::size and unroll all necessary changes
everywhere else in the code.

File:
1 edited

Legend:

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

    r496 r512  
    1313#include <ctype.h>
    1414#include <string.h>
     15
     16#include "common.h"
    1517
    1618#include "dev.h"
     
    109111      cache.img(id)->put_image(screen,x,y);
    110112  }
    111   virtual int width() { return cache.img(id)->width(); }
    112   virtual int height() { return cache.img(id)->height(); }
     113  virtual int width() { return cache.img(id)->Size().x; }
     114  virtual int height() { return cache.img(id)->Size().y; }
    113115} ;
    114116
     
    368370{
    369371  unsigned char *sl1,*sl2;
    370   int32_t xstep=(im->width()<<16)/new_width,
    371        ystep=(im->height()<<16)/new_height,iy,ix,sx,ix_start,iy_start;
     372  int32_t xstep=(im->Size().x<<16)/new_width,
     373       ystep=(im->Size().y<<16)/new_height,iy,ix,sx,ix_start,iy_start;
    372374  screen->add_dirty(x,y,x+new_width-1,y+new_height-1);
    373375
     
    410412{
    411413  unsigned char *sl1,*sl2;
    412   int32_t xstep=(im->width()<<16)/new_width,
    413        ystep=(im->height()<<16)/new_height,iy,ix,sx,ix_start,iy_start;
     414  int32_t xstep=(im->Size().x<<16)/new_width,
     415       ystep=(im->Size().y<<16)/new_height,iy,ix,sx,ix_start,iy_start;
    414416  screen->add_dirty(x,y,x+new_width-1,y+new_height-1);
    415417
     
    482484    {
    483485      image *im=cache.img(light_buttons[f->type]);
    484       im->put_image(screen,f->x-vx+v->cx1-im->width()/2,f->y-vy+v->cy1-im->height()/2,1);
     486      im->put_image(screen,f->x-vx+v->cx1-im->Size().x/2,f->y-vy+v->cy1-im->Size().y/2,1);
    485487      screen->rectangle(f->x1-vx+v->cx1,f->y1-vy+v->cy1,f->x2-vx+v->cx1,f->y2-vy+v->cy1,
    486488                wm->medium_color());
     
    499501    {
    500502      image *i=cache.img(light_buttons[0]);
    501       int l=i->width()/2,h=i->height()/2;
     503      int l=i->Size().x/2,h=i->Size().y/2;
    502504      int32_t rx1,ry1;
    503505      the_game->game_to_mouse(selected_light->x,selected_light->y,v,rx1,ry1);
     
    563565{
    564566  image *i=cache.img(light_buttons[0]);
    565   int l=i->width()/2,h=i->height()/2;
     567  int l=i->Size().x/2,h=i->Size().y/2;
    566568  for (light_source *f=first_light_source; f; f=f->next)
    567569  {
     
    803805    }
    804806
    805     int bw = cache.img(dev_forward)->width();
     807    int bw = cache.img(dev_forward)->Size().x;
    806808    /* FIXME: previous code had 1,1 instead of 0,0 -- investigate */
    807809    search_window = wm->new_window(prop->getd("searchw x", -30),
     
    15791581    {
    15801582      if (area_win) close_area_win(0);
    1581       int wl=0,wh=0,th=wm->font()->height()+12,bw=cache.img(dev_ok)->width()+10;
     1583      int wl=0,wh=0,th=wm->font()->height()+12,bw=cache.img(dev_ok)->Size().x+10;
    15821584      area_win=wm->new_window(prop->getd("area_box x",0),
    15831585                  prop->getd("area_box y",0),
Note: See TracChangeset for help on using the changeset viewer.