Changeset 512


Ignore:
Timestamp:
Apr 20, 2011, 12:39:27 AM (6 years ago)
Author:
sam
Message:

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

Location:
abuse/trunk/src
Files:
70 edited

Legend:

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

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "ability.h"
  • abuse/trunk/src/ant.cpp

    r499 r512  
    1212
    1313#include <ctype.h>
     14
     15#include "common.h"
    1416
    1517#include "ant.h"
     
    450452
    451453
    452     int x1=im->width()+1,y1=0,x2=xres,y2=screen->height();
     454    int x1=im->Size().x+1,y1=0,x2=xres,y2=screen->Size().y;
    453455    fade_in(NULL,16);
    454456
  • abuse/trunk/src/automap.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "automap.h"
     
    151153
    152154  // set the clip back to full window size because soemthing else could mess with the area
    153   automap_window->screen->set_clip(0,0,screen->width()-1,screen->height()-1);
     155  automap_window->screen->set_clip(0,0,screen->Size().x-1,screen->Size().y-1);
    154156}
    155157
  • abuse/trunk/src/cache.cpp

    r506 r512  
    1717#include <fcntl.h>
    1818#include <string.h>
     19
     20#include "common.h"
    1921
    2022#include "cache.h"
  • abuse/trunk/src/chars.cpp

    r496 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "chars.h"
  • abuse/trunk/src/chat.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "chat.h"
  • abuse/trunk/src/clisp.cpp

    r497 r512  
    1212
    1313#include <string.h>
     14
     15#include "common.h"
    1416
    1517#include "sdlport/joy.h"
     
    21372139    case 268 :
    21382140    {
    2139       return cache.img(lnumber_value(CAR(args)))->width();
     2141      return cache.img(lnumber_value(CAR(args)))->Size().x;
    21402142    } break;
    21412143    case 269 :
    21422144    {
    2143       return cache.img(lnumber_value(CAR(args)))->height();
     2145      return cache.img(lnumber_value(CAR(args)))->Size().y;
    21442146    } break;
    21452147    case 270 :
  • abuse/trunk/src/collide.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "level.h"
  • abuse/trunk/src/configuration.cpp

    r494 r512  
    1212
    1313#include <ctype.h>
     14
     15#include "common.h"
    1416
    1517#include "sdlport/joy.h"
  • abuse/trunk/src/console.cpp

    r494 r512  
    1414#include <stdarg.h>
    1515#include <string.h>
     16
     17#include "common.h"
    1618
    1719#include "game.h"
  • abuse/trunk/src/cop.cpp

    r497 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "lisp.h"
     
    10451047  image *im=cache.img(cache.reg("art/frame.spe","end_level_screen",SPEC_IMAGE,1));
    10461048  im->put_image(screen,0,0);
    1047   int x1=im->width()+1,y1=0,y2=screen->height();
     1049  int x1=im->Size().x+1,y1=0,y2=screen->Size().y;
    10481050  JCFont *fnt=wm->font();
    10491051
  • abuse/trunk/src/demo.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "game.h"
  • 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),
  • abuse/trunk/src/devsel.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "devsel.h"
     
    3537    case SPEC_BACKTILE :
    3638    {
    37       return cache.backt(backtiles[0])->im->width()/scale;
     39      return cache.backt(backtiles[0])->im->Size().x/scale;
    3840    } break;
    3941    default :
     
    5254    case SPEC_BACKTILE :
    5355    {
    54       return cache.backt(backtiles[0])->im->height()/scale;
     56      return cache.backt(backtiles[0])->im->Size().y/scale;
    5557    } break;
    5658    default :
  • abuse/trunk/src/director.cpp

    r494 r512  
    1111#include "config.h"
    1212
     13#include "common.h"
     14
    1315#include "director.h"
    1416#include "game.h"
  • abuse/trunk/src/endgame.cpp

    r494 r512  
    1212
    1313#include <math.h>
     14
     15#include "common.h"
    1416
    1517#include "menu.h"
     
    4345static mask_line *make_mask_lines(image *mask, int map_width)
    4446{
    45   mask_line *p=(mask_line *)malloc(mask->height()*sizeof(mask_line));
    46   for (int y=0; y<mask->height(); y++)
     47  mask_line *p=(mask_line *)malloc(mask->Size().y*sizeof(mask_line));
     48  for (int y=0; y<mask->Size().y; y++)
    4749  {
    4850    // find the start of the run..
     
    5658    int size=0;
    5759    uint8_t *sl_start=sl;
    58     while (*sl!=0 && x<mask->width()) { sl++; x++; size++; }
     60    while (*sl!=0 && x<mask->Size().x) { sl++; x++; size++; }
    5961    p[y].size=size;
    6062
     
    7577        *rem=map_width/2-(int)(sqrt((size-x)/(double)(size*2.0))*map_width/2.0);
    7678
    77 //      (int)(mask->width()-(sqrt((size-x)/(double)size)*map_width/2.0)+mask->width()/2);
     79//      (int)(mask->Size().x-(sqrt((size-x)/(double)size)*map_width/2.0)+mask->Size().x/2);
    7880    }
    7981  }
     
    8688{
    8789  int x1=10000,x2=0;
    88   int iw=im1->width();
     90  int iw=im1->Size().x;
    8991  uint16_t r,off;
    9092  int y=0;
     
    159161
    160162
    161   mask_line *p=make_mask_lines(cache.img(mask),cache.img(planet)->width());
     163  mask_line *p=make_mask_lines(cache.img(mask),cache.img(planet)->Size().x);
    162164
    163165  int explo_frames1[8],explo_frames2[7];
     
    175177  int eoff=0,coff=0;
    176178
    177   int ex=xres/2-cache.img(mask)->width()/2;
    178   int ey=yres/2-cache.img(mask)->height()/2;
     179  int ex=xres/2-cache.img(mask)->Size().x/2;
     180  int ey=yres/2-cache.img(mask)->Size().y/2;
    179181  fade_out(16);
    180182
     
    212214
    213215
    214   scan_map(screen,ex,ey,cache.img(planet),cache.img(planet2),0,paddr,p,cache.img(mask)->height(),eoff,coff);
     216  scan_map(screen,ex,ey,cache.img(planet),cache.img(planet2),0,paddr,p,cache.img(mask)->Size().y,eoff,coff);
    215217  image *tcopy=cache.img(planet)->copy();
    216218  fade_in(NULL,32);
     
    241243           cache.img(planet2),
    242244           0,paddr,
    243            p,cache.img(mask)->height(),eoff,coff);
     245           p,cache.img(mask)->Size().y,eoff,coff);
    244246      }
    245247      else
     
    247249           cache.img(planet2),
    248250           0,paddr,
    249            p,cache.img(mask)->height(),eoff,coff);
     251           p,cache.img(mask)->Size().y,eoff,coff);
    250252      if (i>38)
    251253      {
    252254    int t=i-38;
    253255    image *s=cache.img(ship);
    254     int nw=s->width()*(t+2)/16,
    255         nh=s->height()*(t+2)/16;
    256 
    257 
    258         scale_put_trans(s,screen,ex-(i-38)*5,ey+cache.img(mask)->height()/2+t*4,nw,nh);
     256    int nw=s->Size().x*(t+2)/16,
     257        nh=s->Size().y*(t+2)/16;
     258
     259
     260        scale_put_trans(s,screen,ex-(i-38)*5,ey+cache.img(mask)->Size().y/2+t*4,nw,nh);
    259261    if (i==77)
    260262      if (sound_avail&SFX_INITIALIZED)
     
    288290
    289291      scan_map(screen,ex,ey,cache.img(planet),
    290            cache.img(planet2),i*256/200,paddr,p,cache.img(mask)->height(),eoff,coff);
     292           cache.img(planet2),i*256/200,paddr,p,cache.img(mask)->Size().y,eoff,coff);
    291293
    292294      eoff+=2; if (eoff>=320) eoff-=320;
     
    296298      if (i<150 || (i<170 && ((i-149)%2)==0) || (i<180 && ((i-149)%4)==0) || (i<190 && ((i-149)%8)==0))
    297299      {
    298         clist=new ex_char(ex+jrand()%(cache.img(mask)->width()-cache.img(mask)->width()/3),
    299             ey+jrand()%(cache.img(mask)->height()-cache.img(mask)->height()/3),0,1,clist);
     300        clist=new ex_char(ex+jrand()%(cache.img(mask)->Size().x-cache.img(mask)->Size().x/3),
     301            ey+jrand()%(cache.img(mask)->Size().y-cache.img(mask)->Size().y/3),0,1,clist);
    300302    if (sound_avail&SFX_INITIALIZED)
    301303          cache.sfx(explo_snd)->play(127);
    302304      }
    303305
    304 //      clist=new ex_char(ex+jrand()%(cache.img(mask)->width(),
    305 //            ey+jrand()%(cache.img(mask)->height(),0,1,clist);
     306//      clist=new ex_char(ex+jrand()%(cache.img(mask)->Size().x,
     307//            ey+jrand()%(cache.img(mask)->Size().y,0,1,clist);
    306308
    307309      ex_char *c=clist,*last=NULL;
     
    354356           cache.img(planet2),
    355357           256,paddr,
    356            p,cache.img(mask)->height(),eoff,coff);
     358           p,cache.img(mask)->Size().y,eoff,coff);
    357359      eoff+=2; if (eoff>=320) eoff-=320;
    358360      coff+=1; if (coff>=320) coff-=320;
     
    387389         cache.img(planet2),
    388390         256,paddr,
    389          p,cache.img(mask)->height(),eoff,coff);
     391         p,cache.img(mask)->Size().y,eoff,coff);
    390392    text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot),wm->font(),cmap,wm->bright_color());
    391393    wm->flush_screen();
     
    397399
    398400
    399   for (i=0; i<cache.img(mask)->height(); i++)
     401  for (i=0; i<cache.img(mask)->Size().y; i++)
    400402  {
    401403    free(p[i].remap);
     
    434436  PtrRef r2(mid_plot);
    435437
    436   int dx=(xres+1)/2-im->width()/2,dy=(yres+1)/2-im->height()/2;
     438  int dx=(xres+1)/2-im->Size().x/2,dy=(yres+1)/2-im->Size().y/2;
    437439  im->put_image(screen,dx,dy);
    438440  console_font->put_string(screen,xres/2+35,yres/2+100-console_font->height()-2,
  • abuse/trunk/src/extend.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "extend.h"
  • abuse/trunk/src/game.cpp

    r507 r512  
    1818#   include <SDL.h>
    1919#endif
     20
     21#include "common.h"
    2022
    2123#include "sdlport/joy.h"
     
    469471        int dx = 20, dy = 5;
    470472        image *jim = cache.img(joy_picts[but * 9+(y + 1)*3 + x + 1]);
    471         joy_win->screen->bar(dx, dy, dx + jim->width()+6, dy + jim->height()+6, wm->black());
     473        joy_win->screen->bar(dx, dy, dx + jim->Size().x+6, dy + jim->Size().y+6, wm->black());
    472474        jim->put_image(joy_win->screen, dx + 3, dy + 3);
    473475
     
    624626    int xs, ys;
    625627    if(mousex < xmargin &&  dev_cont->ok_to_scroll()) xs = -18;
    626     else if(mousex>(screen->width()-xmargin) &&  dev_cont->ok_to_scroll()) xs = 18;
     628    else if(mousex>(screen->Size().x-xmargin) &&  dev_cont->ok_to_scroll()) xs = 18;
    627629    else if(wm->key_pressed(JK_LEFT) && !last_input && !dev_cont->need_arrows())
    628630      xs = -18;
     
    633635
    634636    if(mousey < ymargin && dev_cont->ok_to_scroll()) ys = -18;
    635     else if(mousey>(screen->height()-ymargin) &&  dev_cont->ok_to_scroll()) ys = 18;
     637    else if(mousey>(screen->Size().y-ymargin) &&  dev_cont->ok_to_scroll()) ys = 18;
    636638    else if(wm->key_pressed(JK_UP) && !last_input)
    637639      ys = -18;
     
    671673
    672674    uint8_t *sl = (uint8_t *)screen->scan_line(y1) + x1;
    673     int step = screen->width() - (x2 - x1 + 1);
     675    int step = screen->Size().x - (x2 - x1 + 1);
    674676
    675677    for(int y = y1; y <= y2; y++)
     
    711713        screen->set_clip(v->cx1, v->cy1, v->cx2, v->cy2);
    712714      image *tit = cache.img(title_screen);
    713       tit->put_image(screen, screen->width()/2 - tit->width()/2,
    714                     screen->height()/2 - tit->height()/2);
     715      tit->put_image(screen, screen->Size().x/2 - tit->Size().x/2,
     716                    screen->Size().y/2 - tit->Size().y/2);
    715717      if(state == SCENE_STATE)
    716718        screen->set_clip(cx1, cy1, cx2, cy2);
     
    753755    v->cx1 = 0;
    754756    v->cy1 = 0;
    755     v->cx2 = small_render->width()-1;
    756     v->cy2 = small_render->height()-1;
     757    v->cx2 = small_render->Size().x-1;
     758    v->cy2 = small_render->Size().y-1;
    757759
    758760    old_screen = screen;
     
    883885    screen->get_clip(ncx1, ncy1, ncx2, ncy2);
    884886
    885     int scr_w = screen->width();
     887    int scr_w = screen->Size().x;
    886888    if(dev & MAP_MODE)
    887889    {
     
    10741076    dev_cont->dev_draw(v);
    10751077    if(cache.in_use())
    1076     cache.img(vmm_image)->put_image(screen, v->cx1, v->cy2 - cache.img(vmm_image)->height()+1);
     1078    cache.img(vmm_image)->put_image(screen, v->cx1, v->cy2 - cache.img(vmm_image)->Size().y+1);
    10771079
    10781080    if(dev & DRAW_LIGHTS)
     
    11641166  {
    11651167    screen->clear();
    1166     im->put_image(screen, (xres + 1)/2 - im->width()/2, (yres + 1)/2 - im->height()/2);
     1168    im->put_image(screen, (xres + 1)/2 - im->Size().x/2, (yres + 1)/2 - im->Size().y/2);
    11671169  }
    11681170
     
    12791281        pal->load();
    12801282
    1281         int dx = (xres + 1) / 2 - gray->width() / 2, dy = (yres + 1) / 2 - gray->height() / 2;
     1283        int dx = (xres + 1) / 2 - gray->Size().x / 2, dy = (yres + 1) / 2 - gray->Size().y / 2;
    12821284        gray->put_image(screen, dx, dy);
    12831285        smoke[0]->put_image(screen, dx + 24, dy + 5);
     
    15091511    {
    15101512      image *tit = cache.img(title_screen);
    1511       tit->put_image(screen, screen->width()/2 - tit->width()/2,
    1512                     screen->height()/2 - tit->height()/2);
     1513      tit->put_image(screen, screen->Size().x/2 - tit->Size().x/2,
     1514                    screen->Size().y/2 - tit->Size().y/2);
    15131515    }
    15141516    set_state(MENU_STATE);   // then go to menu state so windows will turn off
     
    15861588    {
    15871589      for(view *f = first_view; f; f = f->next)
    1588         cache.img(pause_image)->put_image(screen, (f->cx1 + f->cx2)/2 - cache.img(pause_image)->width()/2,
     1590        cache.img(pause_image)->put_image(screen, (f->cx1 + f->cx2)/2 - cache.img(pause_image)->Size().x/2,
    15891591                   f->cy1 + 5, 1);
    15901592    }
     
    21522154    {
    21532155        char const *helpstr = "ARROW KEYS CHANGE TEXT SPEED";
    2154         wm->font()->put_string(screen, screen->width()/2-(wm->font()->width()*strlen(helpstr))/2 + 1,
    2155             screen->height()-wm->font()->height()-5 + 1, helpstr, wm->dark_color());
    2156         wm->font()->put_string(screen, screen->width()/2-(wm->font()->width()*strlen(helpstr))/2,
    2157             screen->height()-wm->font()->height()-5, helpstr, wm->bright_color());
     2156        wm->font()->put_string(screen, screen->Size().x/2-(wm->font()->width()*strlen(helpstr))/2 + 1,
     2157            screen->Size().y-wm->font()->height()-5 + 1, helpstr, wm->dark_color());
     2158        wm->font()->put_string(screen, screen->Size().x/2-(wm->font()->width()*strlen(helpstr))/2,
     2159            screen->Size().y-wm->font()->height()-5, helpstr, wm->bright_color());
    21582160    }
    21592161/*    else
    21602162    {
    21612163        char *helpstr="PRESS h FOR HELP";
    2162         wm->font()->put_string(screen, screen->width()-wm->font()->width()*strlen(helpstr)-5,
    2163             screen->height()-wm->font()->height()-5, helpstr);
     2164        wm->font()->put_string(screen, screen->Size().x-wm->font()->width()*strlen(helpstr)-5,
     2165            screen->Size().y-wm->font()->height()-5, helpstr);
    21642166    }*/
    21652167/*    int dc = cache.img(window_colors)->pixel(0, 2);
    21662168    int mc = cache.img(window_colors)->pixel(1, 2);
    21672169    int bc = cache.img(window_colors)->pixel(2, 2);
    2168     screen->line(0, 0, screen->width()-1, 0, dc);
    2169     screen->line(0, 0, 0, screen->height()-1, dc);
    2170     screen->line(0, screen->height()-1, screen->width()-1, screen->height()-1, bc);
    2171     screen->line(screen->width()-1, 0, screen->width()-1, screen->height()-1, bc); */
     2170    screen->line(0, 0, screen->Size().x-1, 0, dc);
     2171    screen->line(0, 0, 0, screen->Size().y-1, dc);
     2172    screen->line(0, screen->Size().y-1, screen->Size().x-1, screen->Size().y-1, bc);
     2173    screen->line(screen->Size().x-1, 0, screen->Size().x-1, screen->Size().y-1, bc); */
    21722174
    21732175    for(view *f = first_view; f; f = f->next)
  • abuse/trunk/src/gamma.cpp

    r494 r512  
    1212
    1313#include <math.h>
     14
     15#include "common.h"
    1416
    1517#include "game.h"
  • abuse/trunk/src/gui.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "cache.h"
     
    135137{
    136138  x1=x; y1=y;
    137   x2=x+cache.img(u)->width()-1;
    138   y2=y+cache.img(u)->height()-1;
     139  x2=x+cache.img(u)->Size().x-1;
     140  y2=y+cache.img(u)->Size().y-1;
    139141}
    140142
  • abuse/trunk/src/help.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "help.h"
     
    2527{
    2628  image *im=cache.img(help_screens[help_page]);
    27   int x1=xres/2-im->width()/2,y1=yres/2-im->height()/2;
    28   int x2=x1+im->width(),y2=y1+im->height();
     29  int x1=xres/2-im->Size().x/2,y1=yres/2-im->Size().y/2;
     30  int x2=x1+im->Size().x,y2=y1+im->Size().y;
    2931  im->put_image(screen,x1,y1);
    3032  screen->bar(0,0,x1-1,yres,0);
  • abuse/trunk/src/imlib/Makefile.am

    r510 r512  
    3030    $(NULL)
    3131
    32 INCLUDES = -I$(srcdir) $(SDL_CFLAGS)
     32INCLUDES = -I$(srcdir) -I$(srcdir)/.. $(SDL_CFLAGS)
    3333
    3434CPPFLAGS = @CPPFLAGS@ -DNO_CHECK
  • abuse/trunk/src/imlib/filesel.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "filesel.h"
  • abuse/trunk/src/imlib/filter.cpp

    r494 r512  
    1111#include "config.h"
    1212
     13#include "common.h"
     14
    1315#include "image.h"
    1416#include "macs.h"
     
    8486  CONDITION(im,"null image passed in filter::apply\n");
    8587  im->lock();
    86   for (y=im->height()-1; y>=0; y--)
     88  for (y=im->Size().y-1; y>=0; y--)
    8789  {
    8890    c=im->scan_line(y);
    89     for (x=im->width()-1; x>=0; x--)
     91    for (x=im->Size().x-1; x>=0; x--)
    9092    {
    9193      CONDITION((unsigned) c[x]<nc,"not enough filter colors");
     
    179181{
    180182    short cx1, cy1, cx2, cy2, x1 = 0, y1 = 0,
    181           x2 = im->width() - 1, y2 = im->height() - 1;
     183          x2 = im->Size().x - 1, y2 = im->Size().y - 1;
    182184    screen->get_clip(cx1,cy1,cx2,cy2);
    183185
  • abuse/trunk/src/imlib/fonts.cpp

    r494 r512  
    1313#include <ctype.h>
    1414
     15#include "common.h"
     16
    1517#include "fonts.h"
    1618
     
    1820{ fntpat=font_pattern;
    1921  let=letters;
    20   tl=(let->width()+1)/32;
    21   th=(let->height()+1)/8;
     22  tl=(let->Size().x+1)/32;
     23  th=(let->Size().y+1)/8;
    2224}
    2325
     
    6062JCFont::JCFont(image *letters)
    6163{
    62   tl=(letters->width()+1)/32;
    63   th=(letters->height()+1)/8;
     64  tl=(letters->Size().x+1)/32;
     65  th=(letters->Size().y+1)/8;
    6466
    6567  image tmp(tl,th);
  • abuse/trunk/src/imlib/guistat.cpp

    r494 r512  
    1212
    1313#include <string.h>
     14
     15#include "common.h"
    1416
    1517#include "input.h"
  • abuse/trunk/src/imlib/image.cpp

    r494 r512  
    1818#endif
    1919#include <stdlib.h>
     20
     21#include "common.h"
    2022
    2123#include "image.h"
     
    9193{
    9294  delete_page();
    93   w=new_width;
    94   h=new_height;
     95  size = vec2i(new_width, new_height);
    9596  make_page(new_width, new_height, page);
    9697}
     
    120121uint8_t image::pixel(int16_t x, int16_t y)
    121122{
    122   CONDITION(x>=0 && x<width() && y>=0 && y<height(),
     123  CONDITION(x>=0 && x<size.x && y>=0 && y<size.y,
    123124     "image::pixel Bad pixel xy");
    124125  return (*(scan_line(y)+x));
     
    127128void image::putpixel(int16_t x, int16_t y, char color)
    128129{
    129   CONDITION(x>=0 && x<width() && y>=0 && y<height(),
     130  CONDITION(x>=0 && x<size.x && y>=0 && y<size.y,
    130131     "image::putpixel Bad pixel xy");
    131132  if (special)
     
    139140image::image(int16_t width, int16_t height, uint8_t *page_buffer, int16_t create_descriptor)
    140141{
    141   w=width;
    142   h=height;
     142  size = vec2i(width, height);
    143143  if (create_descriptor || page_buffer)
    144144  {
     
    154154image::image(spec_entry *e, bFILE *fp)
    155155{
    156   int16_t i;
    157   fp->seek(e->offset, 0);
    158   w=fp->read_uint16();
    159   h=fp->read_uint16();
    160   special=NULL;
    161   make_page(w, h, NULL);
    162   for (i=0; i<h; i++)
    163     fp->read(scan_line(i), w);
    164   image_list.add_end((linked_node *) this);
     156    int16_t i;
     157    fp->seek(e->offset, 0);
     158    size.x = fp->read_uint16();
     159    size.y = fp->read_uint16();
     160    special = NULL;
     161    make_page(size.x, size.y, NULL);
     162    for (i = 0; i < size.y; i++)
     163        fp->read(scan_line(i), size.x);
     164    image_list.add_end((linked_node *) this);
    165165    _locked = false;
    166166}
     
    168168image::image(bFILE *fp)
    169169{
    170   int16_t i;
    171   w=fp->read_uint16();
    172   h=fp->read_uint16();
    173   special=NULL;
    174   make_page(w, h, NULL);
    175   for (i=0; i<h; i++)
    176     fp->read(scan_line(i), w);
    177   image_list.add_end((linked_node *) this);
     170    int16_t i;
     171    size.x = fp->read_uint16();
     172    size.y = fp->read_uint16();
     173    special = NULL;
     174    make_page(size.x, size.y, NULL);
     175    for (i = 0; i < size.y; i++)
     176        fp->read(scan_line(i), size.x);
     177    image_list.add_end((linked_node *) this);
    178178    _locked = false;
    179179}
     
    237237
    238238    lock();
    239     for(co = 0, i = height() - 1; i >= 0; i--)
     239    for(co = 0, i = size.y - 1; i >= 0; i--)
    240240    {
    241241        c = scan_line(i);
    242         for(j = width() - 1; j >= 0; j--, c++)
     242        for(j = size.x - 1; j >= 0; j--, c++)
    243243            if(*c != background) co++;
    244244    }
     
    262262    }
    263263    else
    264         for(i = height() - 1; i >= 0; i--)
    265             memset(scan_line(i), color, width());
    266     add_dirty(0, 0, width() - 1, height() - 1);
     264        for(i = size.y - 1; i >= 0; i--)
     265            memset(scan_line(i), color, size.x);
     266    add_dirty(0, 0, size.x - 1, size.y - 1);
    267267    unlock();
    268268}
     
    275275
    276276    lock();
    277     dat = (uint8_t *)malloc(width());
    278     im = new image(width(), height());
     277    dat = (uint8_t *)malloc(size.x);
     278    im = new image(size.x, size.y);
    279279    im->lock();
    280     for(i = height() - 1; i >= 0; i--)
     280    for(i = size.y - 1; i >= 0; i--)
    281281    {
    282282        c = scan_line(i);
    283         memcpy(dat, c, width());
     283        memcpy(dat, c, size.x);
    284284        c = im->scan_line(i);
    285         memcpy(c, dat, width());
     285        memcpy(c, dat, size.x);
    286286    }
    287287    im->unlock();
     
    443443    if(screen->special)
    444444    {
    445         put_part(screen, x, y, 0, 0, width()-1, height()-1, transparent);
     445        put_part(screen, x, y, 0, 0, size.x-1, size.y-1, transparent);
    446446        return;
    447447    }
    448448
    449     if(x < screen->width() && y < screen->height())
    450     {
    451         xl = width();
    452         if(x + xl > screen->width()) // clip to the border of the screen
    453             xl = screen->width() - x;
    454         yl = height();
    455         if(y + yl > screen->height())
    456             yl = screen->height() - y;
     449    if(x < screen->Size().x && y < screen->Size().y)
     450    {
     451        xl = size.x;
     452        if(x + xl > screen->Size().x) // clip to the border of the screen
     453            xl = screen->Size().x - x;
     454        yl = size.y;
     455        if(y + yl > screen->Size().y)
     456            yl = screen->Size().y - y;
    457457
    458458        int startx = 0, starty = 0;
     
    511511  { if (x1<0) x1=0;
    512512    if (y2<0) y1=0;
    513     if (x2>=screen->width())  x2=screen->width()-1;
    514     if (y2>=screen->height()) y2=screen->height()-1;
    515   }
    516   if (x2<0 || y2<0 || x1>=screen->width() || y1>=screen->height())
     513    if (x2>=screen->Size().x)  x2=screen->Size().x-1;
     514    if (y2>=screen->Size().y) y2=screen->Size().y-1;
     515  }
     516  if (x2<0 || y2<0 || x1>=screen->Size().x || y1>=screen->Size().y)
    517517    return ;
    518518  screen->add_dirty(x1, y1, x2, y2);
    519   w=width();
     519  w=size.x;
    520520  if (align)
    521521  {
    522522    start=x1%w;
    523     starty=y1%height();
     523    starty=y1%size.y;
    524524  }
    525525  else
     
    533533    pg1=screen->scan_line(j);
    534534    pg2=scan_line(starty++);
    535     if (starty>=height()) starty=0;
     535    if (starty>=size.y) starty=0;
    536536    i=x1;
    537537    xx=start;
     
    565565  if (x1<0) { x+=-x1; x1=0; }
    566566  if (y1<0) { y+=-y1; y1=0; }
    567   if (x2>=width()) x2=width()-1;
    568   if (y2>=height()) y2=height()-1;
     567  if (x2>=size.x) x2=size.x-1;
     568  if (y2>=size.y) y2=size.y-1;
    569569  if (x1>x2 || y1>y2) return ;      // return if it was adjusted so that nothing will be put
    570570
     
    628628  CHECK(x1<=x2 && y1<=y2);
    629629
    630   i=x1; x1=width()-x2-1;  // reverse the x locations
    631   x2=width()-i-1;
     630  i=x1; x1=size.x-x2-1;  // reverse the x locations
     631  x2=size.x-i-1;
    632632
    633633  if (x1<0)
     
    649649    { y2=cy2-y+y1; }
    650650  }
    651   else  if (x>screen->width() || y>screen->height() || x+x2<0 || y+y2<0)
     651  else  if (x>screen->Size().x || y>screen->Size().y || x+x2<0 || y+y2<0)
    652652    return ;
    653653
    654   if (x<screen->width() && y<screen->height() && x1<width() && y1<height() &&
     654  if (x<screen->Size().x && y<screen->Size().y && x1<size.x && y1<size.y &&
    655655      x1<=x2 && y1<=y2)
    656656  {
    657     if (x2>=width())
    658       x2=width()-1;
    659     if (y2>=height())
    660       y2=height()-1;
     657    if (x2>=size.x)
     658      x2=size.x-1;
     659    if (y2>=size.y)
     660      y2=size.y-1;
    661661    xl=x2-x1+1;
    662     if (x+xl>screen->width())
    663       xl=screen->width()-x;
     662    if (x+xl>screen->Size().x)
     663      xl=screen->Size().x-x;
    664664    yl=y2-y1+1;
    665     if (y+yl>screen->height())
    666       yl=screen->height()-y;
     665    if (y+yl>screen->Size().y)
     666      yl=screen->Size().y-y;
    667667    screen->add_dirty(x, y, x+xl-1, y+yl-1);
    668668    screen->lock();
     
    709709    { y2=cy2+y1-y; }
    710710  }
    711   else  if (x>screen->width() || y>screen->height() || x+x1<0 || y+y1<0)
     711  else  if (x>screen->Size().x || y>screen->Size().y || x+x1<0 || y+y1<0)
    712712    return ;
    713713
    714   ml=mask->width();
    715   mh=mask->height();
    716   if (x<screen->width() && y<screen->height() && x1<width() && y1<height() &&
     714  ml=mask->Size().x;
     715  mh=mask->Size().y;
     716  if (x<screen->Size().x && y<screen->Size().y && x1<size.x && y1<size.y &&
    717717      maskx<ml && masky<mh && x1<=x2 && y1<=y2)
    718718  {
    719719
    720     if (x2>=width())
    721       x2=width()-1;
    722     if (y2>=height())
    723       y2=height()-1;
     720    if (x2>=size.x)
     721      x2=size.x-1;
     722    if (y2>=size.y)
     723      y2=size.y-1;
    724724    xl=x2-x1+1;
    725     if (x+xl>screen->width())
    726       xl=screen->width()-x-1;
     725    if (x+xl>screen->Size().x)
     726      xl=screen->Size().x-x-1;
    727727    yl=y2-y1+1;
    728     if (y+yl>screen->height())
    729       yl=screen->height()-y-1;
     728    if (y+yl>screen->Size().y)
     729      yl=screen->Size().y-y-1;
    730730    screen->add_dirty(x, y, x+xl-1, y+yl-1);
    731731    screen->lock();
     
    761761  brv=0; bri=0;
    762762  lock();
    763   for (j=0; j<h; j++)
     763  for (j=0; j<size.y; j++)
    764764  {
    765765    p=scan_line(j);
    766     for (i=0; i<w; i++)
     766    for (i=0; i<size.x; i++)
    767767    { pal->get(p[i], r, g, b);
    768768      if ((int32_t)r*(int32_t)g*(int32_t)b>brv)
     
    782782  brv=(int32_t)258*(int32_t)258*(int32_t)258; bri=0;
    783783  lock();
    784   for (j=0; j<h; j++)
     784  for (j=0; j<size.y; j++)
    785785  {
    786786    p=scan_line(j);
    787     for (i=0; i<w; i++)
     787    for (i=0; i<size.x; i++)
    788788    { pal->get(p[i], r, g, b);
    789789      x=(int32_t)r*(int32_t)g*(int32_t)b;
     
    811811    // with no dirty rectangle keeping.
    812812    if(!special)
    813         special = new image_descriptor(width(), height(), 0);
     813        special = new image_descriptor(size.x, size.y, 0);
    814814
    815815    // set the image descriptor what the clip
     
    823823    special->get_clip(x1, y1, x2, y2);
    824824  else
    825   { x1=0; y1=0; x2=width()-1; y2=height()-1; }
     825  { x1=0; y1=0; x2=size.x-1; y2=size.y-1; }
    826826}
    827827
     
    10561056  { if (x1<0) x1=0;
    10571057    if (y1<0) y1=0;
    1058     if (x2>=width())  x2=width()-1;
    1059     if (y2>=height()) y2=height()-1;
    1060   }
    1061   if (x2<0 || y2<0 || x1>=width() || y1>=height() || x2<x1 || y2<y1)
     1058    if (x2>=size.x)  x2=size.x-1;
     1059    if (y2>=size.y) y2=size.y-1;
     1060  }
     1061  if (x2<0 || y2<0 || x1>=size.x || y1>=size.y || x2<x1 || y2<y1)
    10621062    return ;
    10631063  lock();
     
    10811081  { if (x1<0) x1=0;
    10821082    if (y1<0) y1=0;
    1083     if (x2>=width())  x2=width()-1;
    1084     if (y2>=height()) y2=height()-1;
    1085   }
    1086   if (x2<0 || y2<0 || x1>=width() || y1>=height() || x2<x1 || y2<y1)
     1083    if (x2>=size.x)  x2=size.x-1;
     1084    if (y2>=size.y) y2=size.y-1;
     1085  }
     1086  if (x2<0 || y2<0 || x1>=size.x || y1>=size.y || x2<x1 || y2<y1)
    10871087    return ;
    10881088
     
    10941094    for (x=x1; x<=x2; x++, s++)
    10951095      *s=(*s)^color;
    1096     sl+=w;
     1096    sl+=size.x;
    10971097  }
    10981098  unlock();
     
    11061106  int16_t x;
    11071107  uint8_t *sl, *ex, mask, bt, sh;
    1108   ex=(uint8_t *)malloc(width());
     1108  ex=(uint8_t *)malloc(size.x);
    11091109
    11101110  lock();
    11111111  sl=scan_line(line);
    1112   memcpy(ex, sl, width());
     1112  memcpy(ex, sl, size.x);
    11131113  unlock();
    11141114
     
    11171117  else                 {  mask=128+64+32+16; bt=2; }
    11181118
    1119   for (x=0; x<width(); x++)
     1119  for (x=0; x<size.x; x++)
    11201120  { sh=((x%bt)<<(bitsperpixel-1));
    11211121    sl[x]=(ex[x/bt]&(mask>>sh))>>(bt-sh-1);
     
    11351135  uint8_t *sl;
    11361136  lock();
    1137   for (y=height()-1; y>=0; y--)
     1137  for (y=size.y-1; y>=0; y--)
    11381138  {
    11391139    sl=scan_line(y);
    1140     for (i=0, j=y%4, x=width()-1; x>=0; x--)
     1140    for (i=0, j=y%4, x=size.x-1; x>=0; x--)
    11411141    {
    11421142      if (pal->red(sl[x])>dt_matrix[j*4+i])
     
    11621162void image::resize(int16_t new_width, int16_t new_height)
    11631163{
    1164   int old_width=width(), old_height=height();
    1165   uint8_t *im=(uint8_t *)malloc(width()*height());
     1164  int old_width=size.x, old_height=size.y;
     1165  uint8_t *im=(uint8_t *)malloc(size.x*size.y);
    11661166  lock();
    1167   memcpy(im, scan_line(0), width()*height());
     1167  memcpy(im, scan_line(0), size.x*size.y);
    11681168
    11691169  delete_page();
    11701170  make_page(new_width, new_height, NULL);
    1171   w=new_width;      // set the new hieght and width
    1172   h=new_height;
     1171  size = vec2i(new_width, new_height); // set the new height and width
    11731172
    11741173  uint8_t *sl1, *sl2;
     
    11961195{
    11971196  int16_t cx1, cy1, cx2, cy2;
    1198   CHECK(x1>=0 && y1>=0 && x1<x2 && y1<y2 && x2<width() && y2<height());
     1197  CHECK(x1>=0 && y1>=0 && x1<x2 && y1<y2 && x2<size.x && y2<size.y);
    11991198  if (special)
    12001199  {
     
    12281227  d=smoothness*2+1;
    12291228  d=d*d;
    1230   im=new image(width(), height());
    1231   for (i=0; i<width(); i++)
    1232     for (j=0; j<height(); j++)
     1229  im=new image(size.x, size.y);
     1230  for (i=0; i<size.x; i++)
     1231    for (j=0; j<size.y; j++)
    12331232    {
    12341233      for (t=0, k=-smoothness; k<=smoothness; k++)
    12351234    for (l=-smoothness; l<=smoothness; l++)
    1236       if (i+k>smoothness && i+k<width()-smoothness && j+l<height()-smoothness && j+l>smoothness)
     1235      if (i+k>smoothness && i+k<size.x-smoothness && j+l<size.y-smoothness && j+l>smoothness)
    12371236        t+=pixel(i+k, j+l);
    12381237      else t+=pixel(i, j);
     
    12911290        }
    12921291      }
    1293       if (y<height()-1)
     1292      if (y<size.y-1)
    12941293      {
    12951294        above=scan_line(y+1);
     
    13121311          }
    13131312        }
    1314         if (y<height()-1)
     1313        if (y<size.y-1)
    13151314        { below=scan_line(y+1);
    13161315          if (x>0 && below[x-1]!=fcolor && below[x]==fcolor)
     
    13201319        }
    13211320        x++;
    1322       } while (sl[x]==fcolor && x<width());
     1321      } while (sl[x]==fcolor && x<size.x);
    13231322      x--;
    13241323      if (y>0)
     
    13301329        }
    13311330      }
    1332       if (y<height()-1)
     1331      if (y<size.y-1)
    13331332      {
    13341333        above=scan_line(y+1);
     
    14251424void image::flip_x()
    14261425{
    1427   uint8_t *rev=(uint8_t *)malloc(width()), *sl;
     1426  uint8_t *rev=(uint8_t *)malloc(size.x), *sl;
    14281427  CONDITION(rev, "memory allocation");
    14291428  int y, x, i;
     
    14311430  /* FIXME: Abuse Win32 uses RestoreSurface() here instead of locking */
    14321431  lock();
    1433   for (y=0; y<height(); y++)
     1432  for (y=0; y<size.y; y++)
    14341433  { sl=scan_line(y);
    1435     for (i=0, x=width()-1; x>=0; x--, i++)
     1434    for (i=0, x=size.x-1; x>=0; x--, i++)
    14361435      rev[i]=sl[x];
    1437     memcpy(sl, rev, width());
     1436    memcpy(sl, rev, size.x);
    14381437  }
    14391438  unlock();
     
    14431442void image::flip_y()
    14441443{
    1445   uint8_t *rev=(uint8_t *)malloc(width()), *sl;
     1444  uint8_t *rev=(uint8_t *)malloc(size.x), *sl;
    14461445  CONDITION(rev, "memory allocation");
    14471446  int y;
     
    14491448  /* FIXME: Abuse Win32 uses RestoreSurface() here instead of locking */
    14501449  lock();
    1451   for (y=0; y<height()/2; y++)
     1450  for (y=0; y<size.y/2; y++)
    14521451  { sl=scan_line(y);
    1453     memcpy(rev, sl, width());
    1454     memcpy(sl, scan_line(height()-y-1), width());
    1455     memcpy(scan_line(height()-y-1), rev, width());
     1452    memcpy(rev, sl, size.x);
     1453    memcpy(sl, scan_line(size.y-y-1), size.x);
     1454    memcpy(scan_line(size.y-y-1), rev, size.x);
    14561455  }
    14571456  unlock();
     
    14641463  int y, x;
    14651464  lock();
    1466   for (y=0; y<height(); y++)
     1465  for (y=0; y<size.y; y++)
    14671466  {
    14681467    sl=scan_line(y);
    1469     for (x=width(); x; x--, sl++)
     1468    for (x=size.x; x; x--, sl++)
    14701469      if (*sl)
    14711470        *sl=color;
  • abuse/trunk/src/imlib/image.h

    r494 r512  
    119119private:
    120120    uint8_t *data;
    121     int16_t w, h;
     121    vec2i size;
    122122    void make_page(int16_t width, int16_t height, uint8_t *page_buffer);
    123123    void delete_page();
     
    140140    uint8_t *scan_line(int16_t y)
    141141    {
    142         return data + y * w;
     142        return data + y * size.x;
    143143    }
    144144    uint8_t *next_line(int16_t lasty, uint8_t *last_scan)
    145145    {
    146         return last_scan + w;
     146        return last_scan + size.x;
    147147    }
    148148    int32_t total_pixels(uint8_t background=0);
     
    150150    void clear(int16_t color = -1); // -1 is background color
    151151    void to_24bit(palette &pal);
    152     int16_t width()
    153     {
    154         return (int16_t)w;
    155     }
    156     int16_t height()
    157     {
    158         return (int16_t)h;
    159     }
    160     int16_t pitch()
    161     {
    162         return (int16_t)w; // FIXME: for now, pitch == width
    163     }
     152
     153    vec2i Size() const { return size; }
     154    int Pitch() const { return size.x; } // FIXME: for now, pitch == width
     155
    164156    void scroll(int16_t x1, int16_t y1, int16_t x2, int16_t y2,
    165157                int16_t xd, int16_t yd);
  • abuse/trunk/src/imlib/include.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "include.h"
     
    5355      }
    5456    }
    55     fprintf(fp,"unsigned char %s[%d*%d]={\n    ",tmp_name,
    56             im->width(),im->height());
    57     int x,y,max=im->width()*im->height()-1;
    58     for (y=0,i=0; y<im->height(); y++)
    59       for (x=0; x<im->width(); x++,i++)
     57    vec2i size = im->Size();
     58    fprintf(fp,"unsigned char %s[%d*%d]={\n    ",tmp_name, size.x, size.y);
     59    int x,y,max=size.x*size.y-1;
     60    for (y=0,i=0; y<size.y; y++)
     61      for (x=0; x<size.x; x++,i++)
    6062      {
    6163        fprintf(fp,"%d",(int)im->pixel(x,y));
  • abuse/trunk/src/imlib/input.cpp

    r494 r512  
    1212
    1313#include <string.h>
     14
     15#include "common.h"
    1416
    1517#include "input.h"
     
    202204  if (pressed)
    203205  {
    204     x2=x+pressed->width()-1;
    205     y2=y+pressed->height()-1;
     206    x2=x+pressed->Size().x-1;
     207    y2=y+pressed->Size().y-1;
    206208  }
    207209  else
     
    213215    } else
    214216    {
    215       x2=x+6+visual->width();
    216       y2=y+6+visual->height();
     217      x2=x+6+visual->Size().x;
     218      y2=y+6+visual->Size().y;
    217219    }
    218220  }
  • abuse/trunk/src/imlib/jwindow.cpp

    r494 r512  
    1212
    1313#include <string.h>
     14
     15#include "common.h"
    1416
    1517#include "video.h"
     
    314316                                     ifield * fields, char const *name)
    315317{
    316     if(x > screen->width () - 4)
    317         x = screen->width () - 25;
    318     if(y > screen->height () - 4)
    319         y = screen->height () - 10;
     318    if(x > screen->Size().x - 4)
     319        x = screen->Size().x - 25;
     320    if(y > screen->Size().y - 4)
     321        y = screen->Size().y - 10;
    320322
    321323    Jwindow * j = new Jwindow (x, y, l, h, fields, name);
     
    340342
    341343        screen->put_part(mouse_save, 0, 0, mx, my,
    342                          mx + mouse_pic->width() - 1,
    343                          my + mouse_pic->height() - 1);
     344                         mx + mouse_pic->Size().x - 1,
     345                         my + mouse_pic->Size().y - 1);
    344346        mouse_pic->put_image(screen, mx, my, 1);
    345347    }
     
    361363        {
    362364            p->screen->put_part(mouse_save, 0, 0, mx - p->x, my - p->y,
    363                                 mx - p->x + mouse_pic->width() - 1,
    364                                 my - p->y + mouse_pic->height() - 1);
     365                                mx - p->x + mouse_pic->Size().x - 1,
     366                                my - p->y + mouse_pic->Size().y - 1);
    365367            if(has_mouse())
    366368                mouse_pic->put_image(p->screen, mx - p->x, my - p->y, 1);
     
    529531    {
    530532      screen->bar (top_border(), 1,
    531                     top_border() + fnt->width () * strlen (_name) + 1,
     533                    top_border() + fnt->width() * strlen (_name) + 1,
    532534                    top_border() - 2, med);
    533535      fnt->put_string (screen, top_border() + 1, 1, _name, low);
  • abuse/trunk/src/imlib/palette.cpp

    r494 r512  
    1212
    1313#include <math.h>
     14
     15#include "common.h"
    1416
    1517#include "palette.h"
  • abuse/trunk/src/imlib/pcxread.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "pcxread.h"
     
    6062  PCX_header.xmin=0;
    6163  PCX_header.ymin=0;
    62   PCX_header.xmax=im->width()-1;
    63   PCX_header.ymax=im->height()-1;
     64  PCX_header.xmax=im->Size().x-1;
     65  PCX_header.ymax=im->Size().y-1;
    6466  PCX_header.hres=320;
    6567  PCX_header.vres=200;
    6668  PCX_header.reserved=0;
    6769  PCX_header.color_planes=1;
    68   PCX_header.bytes_per_line=im->width();
     70  PCX_header.bytes_per_line=im->Size().x;
    6971  PCX_header.palette_type=0;
    7072  memset(PCX_header.filter,0,58);
     
    7880  int y,run_length,x;
    7981  unsigned char *sl,code;
    80   for (y=0; y<im->height(); y++)
     82  for (y=0; y<im->Size().y; y++)
    8183  {
    8284    sl=im->scan_line(y);
    83     for (x=0; x<im->width(); )
     85    for (x=0; x<im->Size().x; )
    8486    {
    8587      run_length=1;
    86       while (x+run_length<im->width() && sl[x]==sl[x+run_length])
     88      while (x+run_length<im->Size().x && sl[x]==sl[x+run_length])
    8789        run_length++;
    8890      if (run_length==1 && sl[x]<64)
  • abuse/trunk/src/imlib/pmenu.cpp

    r494 r512  
    1313#include <string.h>
    1414
     15#include "common.h"
     16
    1517#include "pmenu.h"
    1618
     
    285287{
    286288  if (p->xp!=-1) return p->xp;
    287   int w=bar->screen->width();
     289  int w=bar->screen->Size().x;
    288290
    289291
     
    376378  mx-=bar->x;
    377379  my-=bar->y;
    378   if (mx<0 || my<0 || mx>=bar->screen->width() || my>=bar->screen->height()) return NULL;
     380  if (mx<0 || my<0 || mx>=bar->screen->Size().x || my>=bar->screen->Size().y) return NULL;
    379381  else
    380382  {
  • abuse/trunk/src/imlib/scroller.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "scroller.h"
     
    492494    screen->get_clip(cx1,cy1,cx2,cy2);
    493495    screen->set_clip(x,y,x+l-1,y+h-1);
    494     int tw=(l+tex->width()-1)/tex->width();
    495     int th=(h+tex->height()-1)/tex->height();
     496    int tw=(l+tex->Size().x-1)/tex->Size().x;
     497    int th=(h+tex->Size().y-1)/tex->Size().y;
    496498    int dy=y;
    497     for (int j=0; j<th; j++,dy+=tex->height())
    498       for (int i=0,dx=x; i<tw; i++,dx+=tex->width())
     499    for (int j=0; j<th; j++,dy+=tex->Size().y)
     500      for (int i=0,dx=x; i<tw; i++,dx+=tex->Size().x)
    499501        tex->put_image(screen,dx,dy);
    500502
  • abuse/trunk/src/imlib/specs.cpp

    r494 r512  
    2121#   include <sys/stat.h>
    2222#endif
     23
     24#include "common.h"
    2325
    2426#include "image.h"
  • 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();
  • abuse/trunk/src/imlib/status.cpp

    r494 r512  
    1212
    1313#include <string.h>
     14
     15#include "common.h"
    1416
    1517#include "macs.h"
  • abuse/trunk/src/imlib/supmorph.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "supmorph.h"
  • abuse/trunk/src/imlib/timage.cpp

    r494 r512  
    1111#include "config.h"
    1212
     13#include "common.h"
     14
    1315#include "timage.h"
    1416
     
    7072  int size=0,x,y;
    7173  uint8_t *sl,*datap,*marker;
    72   w=im->width();
    73   h=im->height();
     74  w=im->Size().x;
     75  h=im->Size().y;
    7476
    7577  im->lock();
    7678
    7779  // first we must find out how much data to allocate
    78   for (y=0; y<im->height(); y++)
     80  for (y=0; y<im->Size().y; y++)
    7981  {
    8082    sl=im->scan_line(y);
     
    99101
    100102  data=(uint8_t *)malloc(size);
    101   int ww=im->width(),hh=im->height();
     103  int ww=im->Size().x,hh=im->Size().y;
    102104  datap=data;
    103105  if (!datap)
    104   { printf("size = %d %d (%d)\n",im->width(),im->height(),size);  }
     106  { printf("size = %d %d (%d)\n",im->Size().x,im->Size().y,size);  }
    105107  CONDITION(datap,"malloc error for trans_image::data");
    106108
     
    112114    {
    113115      *datap=0;  // start the skip at 0
    114       while (x<im->width() && (*sl)==0)
     116      while (x<im->Size().x && (*sl)==0)
    115117      { sl++; x++; (*datap)++; }
    116118      datap++;
     
    121123    *marker=0;
    122124    datap++;    // skip over this spot
    123         while (x<im->width() && (*sl)!=0)
     125        while (x<im->Size().x && (*sl)!=0)
    124126        {
    125127          (*marker)++;
     
    274276
    275277  screen_line=screen->scan_line(y)+x;
    276   int sw=screen->width()-w;
     278  int sw=screen->Size().x-w;
    277279  x1-=x; x2-=x;
    278280  for (; ysteps>0; ysteps--)
     
    343345
    344346  screen->lock();
    345   screen_skip = screen->width() - w;
     347  screen_skip = screen->Size().x - w;
    346348  for (; ysteps; ysteps--)
    347349  {
     
    366368    ix+=skip;
    367369
    368     if (s_off>=screen->scan_line(screen->height()+1))
     370    if (s_off>=screen->scan_line(screen->Size().y+1))
    369371            printf("bad write in trans_image::put_image_offseted");
    370372      }
     
    386388  screen->lock();
    387389  screen_line=screen->scan_line(y)+x;
    388   int sw=screen->width();
     390  int sw=screen->Size().x;
    389391  x1-=x; x2-=x;
    390392  for (; ysteps>0; ysteps--)
     
    451453  screen->lock();
    452454  screen_line=screen->scan_line(y)+x;
    453   int sw=screen->width();
     455  int sw=screen->Size().x;
    454456  x1-=x; x2-=x;
    455457  for (; ysteps>0; ysteps--)
     
    529531  screen->lock();
    530532  screen_line=screen->scan_line(y)+x;
    531   int sw=screen->width();
     533  int sw=screen->Size().x;
    532534  x1-=x; x2-=x;
    533535  for (; ysteps>0; ysteps--)
     
    857859                *blend_line,*screen_line;
    858860  if (!datap) return ;
    859   CONDITION(y>=blendy && y+ysteps<blendy+blend->height()+1,"Blend doesn't fit on trans_image");
     861  CONDITION(y>=blendy && y+ysteps<blendy+blend->Size().y+1,"Blend doesn't fit on trans_image");
    860862
    861863  blend_amount=16-blend_amount;
     
    979981  screen->lock();
    980982  screen_line=screen->scan_line(y)+x;
    981   int sw=screen->width();
     983  int sw=screen->Size().x;
    982984  x1-=x; x2-=x;
    983985  for (; ysteps>0; ysteps--)
  • abuse/trunk/src/imlib/tools.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "tools.h"
  • abuse/trunk/src/imlib/visobj.h

    r494 r512  
    3333  image_visual(image *img) { im=img; }
    3434  virtual void draw(image *screen, int x, int y, filter *f);
    35   virtual int width() { return im->width(); }
    36   virtual int height() { return im->height(); }
     35  virtual int width() { return im->Size().x; }
     36  virtual int height() { return im->Size().y; }
    3737} ;
    3838
  • abuse/trunk/src/innet.cpp

    r494 r512  
    1212
    1313#include <stdio.h>
     14
     15#include "common.h"
    1416
    1517#include "demo.h"
  • abuse/trunk/src/items.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "items.h"
     
    216218
    217219    //uint8_t *buffer=(uint8_t *)&micro_image;
    218     int x, y, w = img->width(), h = img->height(), l;
     220    int x, y, w = img->Size().x, h = img->Size().y, l;
    219221    int r[AUTOTILE_WIDTH * AUTOTILE_HEIGHT],
    220222        g[AUTOTILE_WIDTH * AUTOTILE_HEIGHT],
  • abuse/trunk/src/items.h

    r494 r512  
    3737  backtile(spec_entry *e, bFILE *fp);
    3838  backtile(bFILE *fp);
    39   int32_t size() { return 2+4+im->width()*im->height(); }
     39  int32_t size() { vec2i s = im->Size(); return 2 + 4 + s.x * s.y; }
    4040  ~backtile() { delete im; }
    4141} ;
  • abuse/trunk/src/level.cpp

    r497 r512  
    1818#include <limits.h>
    1919#include <time.h>
     20
     21#include "common.h"
    2022
    2123#include "light.h"
     
    16541656  wm->font()->put_string(i,80-strlen(buf)*wm->font()->width()/2,100+wm->font()->height(),buf);
    16551657
    1656   fp->write_uint16(i->width());
    1657   fp->write_uint16(i->height());
     1658  fp->write_uint16(i->Size().x);
     1659  fp->write_uint16(i->Size().y);
    16581660
    16591661  i->lock();
    1660   for(int y = 0; y < i->height(); y++)
    1661     fp->write(i->scan_line(y),i->width());
     1662  for(int y = 0; y < i->Size().y; y++)
     1663    fp->write(i->scan_line(y),i->Size().x);
    16621664  i->unlock();
    16631665
  • abuse/trunk/src/light.cpp

    r494 r512  
    1212
    1313#include <stdlib.h>
     14
     15#include "common.h"
    1416
    1517#include "light.h"
     
    793795  screen->lock();
    794796
    795   int scr_w=screen->width();
     797  int scr_w=screen->Size().x;
    796798  uint8_t *screen_line=screen->scan_line(cy1)+cx1;
    797799
     
    899901             image *out, int32_t out_x, int32_t out_y)
    900902{
    901   if (sc->width()*2+out_x>out->width() ||
    902       sc->height()*2+out_y>out->height())
     903  if (sc->Size().x*2+out_x>out->Size().x ||
     904      sc->Size().y*2+out_y>out->Size().y)
    903905    return ;   // screen was resized and small_render has not changed size yet
    904906
     
    930932    uint8_t *src=sc->scan_line(0);
    931933    uint8_t *dst=out->scan_line(out_y+cy1*2)+cx1*2+out_x;
    932     int d_skip=out->width()-sc->width()*2;
     934    int d_skip=out->Size().x-sc->Size().x*2;
    933935    int x,y;
    934936    uint16_t v;
    935     for (y=sc->height(); y; y--)
    936     {
    937       for (x=sc->width(); x; x--)
     937    for (y=sc->Size().y; y; y--)
     938    {
     939      for (x=sc->Size().x; x; x--)
    938940      {
    939941    v=*(src++);
     
    942944      }
    943945      dst=dst+d_skip;
    944       memcpy(dst,dst-out->width(),sc->width()*2);
    945       dst+=out->width();
     946      memcpy(dst,dst-out->Size().x,sc->Size().x*2);
     947      dst+=out->Size().x;
    946948    }
    947949
     
    951953  light_patch *first=make_patch_list(cx2-cx1+1,cy2-cy1+1,screenx,screeny);
    952954
    953   int scr_w=sc->width();
    954   int dscr_w=out->width();
     955  int scr_w=sc->Size().x;
     956  int dscr_w=out->Size().x;
    955957
    956958  int prefix_x=(screenx&7);
  • abuse/trunk/src/lisp/lisp.cpp

    r504 r512  
    1616#include <string.h>
    1717#include <stdarg.h>
     18
     19#include "common.h"
    1820
    1921#define TYPE_CHECKING 1
  • abuse/trunk/src/loader2.cpp

    r503 r512  
    1212
    1313#include <math.h>
     14
     15#include "common.h"
    1416
    1517#include "timing.h"
     
    7577  image *im=new image(e,fp);
    7678  if (scale_mult!=1 || scale_div!=1)
    77     im->resize(im->width()*scale_mult/scale_div,im->height()*scale_mult/scale_div);
     79    im->resize(im->Size().x*scale_mult/scale_div,im->Size().y*scale_mult/scale_div);
    7880  return im;
    7981}
     
    8385  image *im=new image(fp);
    8486  if (scale_mult!=1 || scale_div!=1)
    85     im->resize(im->width()*scale_mult/scale_div,im->height()*scale_mult/scale_div);
     87    im->resize(im->Size().x*scale_mult/scale_div,im->Size().y*scale_mult/scale_div);
    8688
    8789  return im;
     
    456458  f_wid=cache.foret(foretiles[0])->im->width();
    457459  f_hi=cache.foret(foretiles[0])->im->height();
    458   b_wid=cache.backt(backtiles[0])->im->width();
    459   b_hi=cache.backt(backtiles[0])->im->height();
     460  b_wid=cache.backt(backtiles[0])->im->Size().x;
     461  b_hi=cache.backt(backtiles[0])->im->Size().y;
    460462
    461463#if 0
  • abuse/trunk/src/loadgame.cpp

    r494 r512  
    1212
    1313#include <string.h>
     14
     15#include "common.h"
    1416
    1517#include "game.h"
     
    6062  ico_button *buts[MAX_SAVE_GAMES];
    6163  int y = 0, i;
    62   int ih=cache.img(save_buts[0])->height();
     64  int ih=cache.img(save_buts[0])->Size().y;
    6365  int x=0;
    6466  for (i=0; i<total_saved; i++,y+=ih)
     
    9395  if (last_free) return last_free;    // if there are any slots not created yet...
    9496
    95   int w=cache.img(save_buts[0])->width();
     97  int w=cache.img(save_buts[0])->Size().x;
    9698  int mx=last_demo_mx-w/2;
    9799  if(mx + w + 10 > xres) mx = xres - w - 10;
     
    179181            {
    180182                thumb_nails[start_num]=new image(se,fp);
    181                 if (thumb_nails[start_num]->width()>max_w) max_w=thumb_nails[start_num]->width();
    182                 if (thumb_nails[start_num]->height()>max_h) max_h=thumb_nails[start_num]->height();
     183                if (thumb_nails[start_num]->Size().x>max_w) max_w=thumb_nails[start_num]->Size().x;
     184                if (thumb_nails[start_num]->Size().y>max_h) max_h=thumb_nails[start_num]->Size().y;
    183185                if (!first) first=thumb_nails[start_num];
    184186                total_saved++;
     
    203205
    204206    int i;
    205 /*  int ih=cache.img(save_buts[0])->height();
     207/*  int ih=cache.img(save_buts[0])->Size().y;
    206208  ico_button *buts[MAX_SAVE_GAMES];
    207209  int y=0;
  • abuse/trunk/src/menu.cpp

    r496 r512  
    1212
    1313#include <math.h>
     14
     15#include "common.h"
    1416
    1517#include "dev.h"
     
    146148
    147149  int mw=(font->width())*maxw+20;
    148   int mx=screen->width()/2-mw/2,
    149       my=screen->height()/2-mh/2;
     150  int mx=screen->Size().x/2-mw/2,
     151      my=screen->Size().y/2-mh/2;
    150152
    151153
     
    155157  {
    156158    int tl=strlen(title)*font->width();
    157     int tx=screen->width()/2-tl/2;
     159    int tx=screen->Size().x/2-tl/2;
    158160    dark_widget(tx-2,my-font->height()-4,tx+tl+2,my-2,wm->medium_color(),wm->dark_color(),180);
    159161    font->put_string(screen,tx+1,my-font->height()-2,title,wm->bright_color());
     
    512514      {
    513515        image *tit=cache.img(title_screen);
    514           tit->put_image(screen,screen->width()/2-tit->width()/2,
    515                           screen->height()/2-tit->height()/2);
     516          tit->put_image(screen,screen->Size().x/2-tit->Size().x/2,
     517                          screen->Size().y/2-tit->Size().y/2);
    516518      }
    517519      inm->redraw();
     
    546548  c=cache.reg("art/icons.spe",name,SPEC_IMAGE,1);
    547549
    548   h=cache.img(a)->height();
     550  h=cache.img(a)->Size().y;
    549551
    550552  return new ico_button(x,y,id,b,b,a,c,next,-1,key);
  • abuse/trunk/src/morpher.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "morpher.h"
  • abuse/trunk/src/net/gclient.cpp

    r494 r512  
    1919#include <string.h>
    2020#include <signal.h>
     21
     22#include "common.h"
    2123
    2224#include "netcfg.h"
  • abuse/trunk/src/net/gserver.cpp

    r494 r512  
    1919#include <string.h>
    2020#include <signal.h>
     21
     22#include "common.h"
    2123
    2224#include "system.h"
  • abuse/trunk/src/netcfg.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "game.h"
     
    262264
    263265  image *ns=cache.img(cache.reg("art/frame.spe","net_screen",SPEC_IMAGE,1));
    264   int ns_w=ns->width(),ns_h=ns->height();
     266  int ns_w=ns->Size().x,ns_h=ns->Size().y;
    265267  int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2;
    266268  ns->put_image(screen,x,y);
     
    270272
    271273  uint8_t *sl=screen->scan_line(0);
    272   int xx=screen->width()*screen->height();
     274  int xx=screen->Size().x*screen->Size().y;
    273275  for (; xx; xx--,sl++) *sl=remap[*sl];
    274276
     
    327329{
    328330  image *ns=cache.img(cache.reg("art/frame.spe","net_screen",SPEC_IMAGE,1));
    329   int ns_w=ns->width(),ns_h=ns->height();
     331  int ns_w=ns->Size().x,ns_h=ns->Size().y;
    330332  int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2;
    331333  ns->put_image(screen,x,y);
     
    446448
    447449  image *ns=cache.img(cache.reg("art/frame.spe","net_screen",SPEC_IMAGE,1));
    448   int ns_w=ns->width(),ns_h=ns->height();
     450  int ns_w=ns->Size().x,ns_h=ns->Size().y;
    449451  int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2;
    450452  ns->put_image(screen,x,y);
  • abuse/trunk/src/nfclient.cpp

    r494 r512  
    1717#include <unistd.h>
    1818#include <ctype.h>
     19
     20#include "common.h"
    1921
    2022#include "system.h"
  • abuse/trunk/src/objects.cpp

    r499 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "timage.h"
  • abuse/trunk/src/particle.cpp

    r494 r512  
    1111#include "config.h"
    1212
     13#include "common.h"
     14
    1315#include "macs.h"
    1416#include "particle.h"
     
    247249    screen->lock();
    248250
    249     int w = screen->width();
     251    int w = screen->Size().x;
    250252    uint8_t *addr;
    251253
  • abuse/trunk/src/points.cpp

    r494 r512  
    1212
    1313#include <string.h>
     14
     15#include "common.h"
    1416
    1517#include "points.h"
  • abuse/trunk/src/profile.cpp

    r494 r512  
    1111#include "config.h"
    1212
     13#include "common.h"
     14
    1315#include "game.h"
    14 
    1516
    1617#include "profile.h"
     
    119120  float time_scaler=(float)max_bar_length/prof_list[0].total_time;
    120121
    121   prof_win->screen->bar(0,prof_win->y1(),prof_win->screen->width()-1,prof_win->screen->height(),0);
     122  prof_win->screen->bar(0,prof_win->y1(),prof_win->screen->Size().x-1,prof_win->screen->Size().y,0);
    122123  int dy = 0;
    123124  for (; i<prof_height; i++)
  • abuse/trunk/src/property.cpp

    r494 r512  
    1313#include <stdio.h>
    1414#include <string.h>
     15
     16#include "common.h"
    1517
    1618#include "property.h"
  • abuse/trunk/src/sdlport/event.cpp

    r494 r512  
    2222
    2323#include <SDL.h>
     24
     25#include "common.h"
    2426
    2527#include "system.h"
     
    375377    x = (x << 16) / mouse_xscale;
    376378    y = (y << 16) / mouse_yscale;
    377     if( x > screen->width() - 1 )
    378     {
    379         x = screen->width() - 1;
    380     }
    381     if( y > screen->height() - 1 )
    382     {
    383         y = screen->height() - 1;
     379    if( x > screen->Size().x - 1 )
     380    {
     381        x = screen->Size().x - 1;
     382    }
     383    if( y > screen->Size().y - 1 )
     384    {
     385        y = screen->Size().y - 1;
    384386    }
    385387    ev.mouse_move.x = x;
  • abuse/trunk/src/sdlport/mouse.cpp

    r494 r512  
    2222
    2323#include <SDL.h>
     24
     25#include "common.h"
    2426
    2527#include "video.h"
     
    6466    f.apply( im );
    6567    sp = new sprite( Screen, im, 100, 100 );
    66     mx = Screen->width() / 2;
    67     my = Screen->height() / 2;
     68    mx = Screen->Size().x / 2;
     69    my = Screen->Size().y / 2;
    6870}
    6971
     
    98100{
    99101    // Make sure the values we are given are sensible.
    100     if( new_mx > screen->width() - 1 )
     102    if( new_mx > screen->Size().x - 1 )
    101103    {
    102         new_mx = screen->width() - 1;
     104        new_mx = screen->Size().x - 1;
    103105    }
    104     if( new_my > screen->height() - 1 )
     106    if( new_my > screen->Size().y - 1 )
    105107    {
    106         new_my = screen->height() - 1;
     108        new_my = screen->Size().y - 1;
    107109    }
    108110
  • abuse/trunk/src/sdlport/video.cpp

    r494 r512  
    3333#endif    /* HAVE_OPENGL */
    3434
     35#include "common.h"
     36
    3537#include "filter.h"
    3638#include "system.h"
     
    343345void put_image(image * im, int x, int y)
    344346{
    345     put_part_image(im, x, y, 0, 0, im->width() - 1, im->height() - 1);
     347    put_part_image(im, x, y, 0, 0, im->Size().x - 1, im->Size().y - 1);
    346348}
    347349
  • abuse/trunk/src/sensor.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "lisp.h"
  • abuse/trunk/src/seq.cpp

    r503 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "seq.h"
  • abuse/trunk/src/statbar.cpp

    r494 r512  
    1111#include "config.h"
    1212
     13#include "common.h"
     14
    1315#include "sbar.h"
    1416#include "view.h"
     
    7880
    7981  image *im=cache.img(*offset);
    80   int dw=small_render ? im->width()*2 : im->width();
    81   int dh=small_render ? im->height()*2 : im->height();
     82  int dw=small_render ? im->Size().x*2 : im->Size().x;
     83  int dh=small_render ? im->Size().y*2 : im->Size().y;
    8284
    8385  int n=num/100;
     
    105107
    106108    // status bar width & height
    107     int sb_w=(small_render ? sb->width()*2 : sb->width()),
    108     sb_h=(small_render ? sb->height()*2 : sb->height());
     109    int sb_w=(small_render ? sb->Size().x*2 : sb->Size().x),
     110    sb_h=(small_render ? sb->Size().y*2 : sb->Size().y);
    109111
    110112    // status bar x & y position
     
    115117
    116118    // weapon icon width & height
    117     int ww=small_render ? cache.img(bweap[0])->width()*2 : cache.img(bweap[0])->width();
    118     int wh=small_render ? cache.img(bweap[0])->height()*2 : cache.img(bweap[0])->height();
     119    int ww=small_render ? cache.img(bweap[0])->Size().x*2 : cache.img(bweap[0])->Size().x;
     120    int wh=small_render ? cache.img(bweap[0])->Size().y*2 : cache.img(bweap[0])->Size().y;
    119121
    120122
    121123    // numpad y offset
    122124    int np_yo=small_render ? 42 : 21;
    123     int np_w=small_render ? cache.img(sbar_numpad)->width()*2 : cache.img(sbar_numpad)->width();
    124     int np_h=small_render ? cache.img(sbar_numpad)->height()*2 : cache.img(sbar_numpad)->height();
     125    int np_w=small_render ? cache.img(sbar_numpad)->Size().x*2 : cache.img(sbar_numpad)->Size().x;
     126    int np_h=small_render ? cache.img(sbar_numpad)->Size().y*2 : cache.img(sbar_numpad)->Size().y;
    125127
    126128    // selection bar width * height
    127     int sel_w=small_render ? cache.img(sbar_select)->width()*2 : cache.img(sbar_select)->width();
    128     int sel_h=small_render ? cache.img(sbar_select)->height()*2 : cache.img(sbar_select)->height();
     129    int sel_w=small_render ? cache.img(sbar_select)->Size().x*2 : cache.img(sbar_select)->Size().x;
     130    int sel_h=small_render ? cache.img(sbar_select)->Size().y*2 : cache.img(sbar_select)->Size().y;
    129131
    130132    int sel_off=small_render ?  8 : 4;
     
    180182
    181183  // status bar width & height
    182   int sb_w=sb->width(),
    183       sb_h=sb->height();
     184  int sb_w=sb->Size().x,
     185      sb_h=sb->Size().y;
    184186
    185187  if (small_render) { sb_w*=2; sb_h*=2; }
     
    276278
    277279    // status bar width & height
    278     sb_w=sb->width();
    279     sb_h=sb->height();
     280    sb_w=sb->Size().x;
     281    sb_h=sb->Size().y;
    280282  }
    281283
  • abuse/trunk/src/transp.cpp

    r494 r512  
    1111#include "config.h"
    1212
     13#include "common.h"
     14
    1315#include "transp.h"
    1416
     
    1719  short cx1,cy1,cx2,cy2;
    1820  screen->get_clip(cx1,cy1,cx2,cy2);
    19   int xs=0,ys=0,xl=im->width(),yl=im->height();
     21  int xs=0,ys=0,xl=im->Size().x,yl=im->Size().y;
    2022  if (x<cx1)
    2123  {
     
    4547  uint8_t *isl=im->scan_line(ys)+xs;
    4648  uint8_t *ssl=screen->scan_line(y)+x;
    47   int iw=im->width(),sw=screen->width();
     49  int iw=im->Size().x,sw=screen->Size().x;
    4850
    4951  for (int iy=ys; iy<ye; iy++,y++,isl+=iw,ssl+=sw)
  • abuse/trunk/src/ui/volumewindow.cpp

    r494 r512  
    1010
    1111#include "config.h"
     12
     13#include "common.h"
    1214
    1315#include "volumewindow.h" // class VolumeWindow
     
    3840    //reconfigure();
    3941    bg = cache.reg(ff, "vcontrol", SPEC_IMAGE, 1);
    40     l = cache.img(bg)->width();
    41     h = cache.img(bg)->height();
     42    l = cache.img(bg)->Size().x;
     43    h = cache.img(bg)->Size().y;
    4244    screen = new image(l, h, NULL, 2);
    4345    redraw();
  • abuse/trunk/src/view.cpp

    r499 r512  
    1111#include "config.h"
    1212
     13#include "common.h"
     14
    1315#include "game.h"
    14 
    1516
    1617#include "system.h"
Note: See TracChangeset for help on using the changeset viewer.