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/imlib/sprite.cpp

    r494 r512  
    1313#include <math.h>
    1414
     15#include "common.h"
     16
    1517#include "macs.h"
    1618#include "video.h"
     
    2224
    2325void sprite::restore_background()
    24 { if (x+save->width()>=0 && y+save->height()>=0 && x<=xres && y<=yres)
     26{ if (x+save->Size().x>=0 && y+save->Size().y>=0 && x<=xres && y<=yres)
    2527      save->put_image(screen,x,y); }
    2628
    2729void sprite::get_background()
    28 { if (x+visual->width()>=0 && y+visual->height()>=0 && x<=xres && y<=yres)
    29    screen->put_part(save,0,0,x,y,x+save->width()-1,y+save->height()-1); }
     30{ if (x+visual->Size().x>=0 && y+visual->Size().y>=0 && x<=xres && y<=yres)
     31   screen->put_part(save,0,0,x,y,x+save->Size().x-1,y+save->Size().y-1); }
    3032
    3133void sprite::draw()
    32 { if (x+visual->width()>=0 && y+visual->height()>=0 && x<=xres && y<=yres)
     34{ if (x+visual->Size().x>=0 && y+visual->Size().y>=0 && x<=xres && y<=yres)
    3335   visual->put_image(screen,x,y,1); }
    3436
     
    3739  CHECK(Visual && Screen);
    3840  x=X; y=Y; visual=Visual; screen=Screen;
    39   save=new image(visual->width(),visual->height());
     41  save=new image(visual->Size().x,visual->Size().y);
    4042  get_background();
    4143} ;
     
    6264    delete visual;
    6365  visual=Visual;
    64   if (save->width()!=Visual->width() || save->height()!=Visual->height())
     66  if (save->Size().x!=Visual->Size().x || save->Size().y!=Visual->Size().y)
    6567  {
    6668    delete save;
    67     save=new image(visual->width(),visual->height());
     69    save=new image(visual->Size().x,visual->Size().y);
    6870  }
    6971  get_background();
Note: See TracChangeset for help on using the changeset viewer.