Changeset 512
- Timestamp:
- Apr 20, 2011, 12:39:27 AM (11 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 70 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/ability.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "ability.h" -
abuse/trunk/src/ant.cpp
r499 r512 12 12 13 13 #include <ctype.h> 14 15 #include "common.h" 14 16 15 17 #include "ant.h" … … 450 452 451 453 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; 453 455 fade_in(NULL,16); 454 456 -
abuse/trunk/src/automap.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "automap.h" … … 151 153 152 154 // 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); 154 156 } 155 157 -
abuse/trunk/src/cache.cpp
r506 r512 17 17 #include <fcntl.h> 18 18 #include <string.h> 19 20 #include "common.h" 19 21 20 22 #include "cache.h" -
abuse/trunk/src/chars.cpp
r496 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "chars.h" -
abuse/trunk/src/chat.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "chat.h" -
abuse/trunk/src/clisp.cpp
r497 r512 12 12 13 13 #include <string.h> 14 15 #include "common.h" 14 16 15 17 #include "sdlport/joy.h" … … 2137 2139 case 268 : 2138 2140 { 2139 return cache.img(lnumber_value(CAR(args)))-> width();2141 return cache.img(lnumber_value(CAR(args)))->Size().x; 2140 2142 } break; 2141 2143 case 269 : 2142 2144 { 2143 return cache.img(lnumber_value(CAR(args)))-> height();2145 return cache.img(lnumber_value(CAR(args)))->Size().y; 2144 2146 } break; 2145 2147 case 270 : -
abuse/trunk/src/collide.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "level.h" -
abuse/trunk/src/configuration.cpp
r494 r512 12 12 13 13 #include <ctype.h> 14 15 #include "common.h" 14 16 15 17 #include "sdlport/joy.h" -
abuse/trunk/src/console.cpp
r494 r512 14 14 #include <stdarg.h> 15 15 #include <string.h> 16 17 #include "common.h" 16 18 17 19 #include "game.h" -
abuse/trunk/src/cop.cpp
r497 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "lisp.h" … … 1045 1047 image *im=cache.img(cache.reg("art/frame.spe","end_level_screen",SPEC_IMAGE,1)); 1046 1048 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; 1048 1050 JCFont *fnt=wm->font(); 1049 1051 -
abuse/trunk/src/demo.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "game.h" -
abuse/trunk/src/dev.cpp
r496 r512 13 13 #include <ctype.h> 14 14 #include <string.h> 15 16 #include "common.h" 15 17 16 18 #include "dev.h" … … 109 111 cache.img(id)->put_image(screen,x,y); 110 112 } 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; } 113 115 } ; 114 116 … … 368 370 { 369 371 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; 372 374 screen->add_dirty(x,y,x+new_width-1,y+new_height-1); 373 375 … … 410 412 { 411 413 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; 414 416 screen->add_dirty(x,y,x+new_width-1,y+new_height-1); 415 417 … … 482 484 { 483 485 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); 485 487 screen->rectangle(f->x1-vx+v->cx1,f->y1-vy+v->cy1,f->x2-vx+v->cx1,f->y2-vy+v->cy1, 486 488 wm->medium_color()); … … 499 501 { 500 502 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; 502 504 int32_t rx1,ry1; 503 505 the_game->game_to_mouse(selected_light->x,selected_light->y,v,rx1,ry1); … … 563 565 { 564 566 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; 566 568 for (light_source *f=first_light_source; f; f=f->next) 567 569 { … … 803 805 } 804 806 805 int bw = cache.img(dev_forward)-> width();807 int bw = cache.img(dev_forward)->Size().x; 806 808 /* FIXME: previous code had 1,1 instead of 0,0 -- investigate */ 807 809 search_window = wm->new_window(prop->getd("searchw x", -30), … … 1579 1581 { 1580 1582 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; 1582 1584 area_win=wm->new_window(prop->getd("area_box x",0), 1583 1585 prop->getd("area_box y",0), -
abuse/trunk/src/devsel.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "devsel.h" … … 35 37 case SPEC_BACKTILE : 36 38 { 37 return cache.backt(backtiles[0])->im-> width()/scale;39 return cache.backt(backtiles[0])->im->Size().x/scale; 38 40 } break; 39 41 default : … … 52 54 case SPEC_BACKTILE : 53 55 { 54 return cache.backt(backtiles[0])->im-> height()/scale;56 return cache.backt(backtiles[0])->im->Size().y/scale; 55 57 } break; 56 58 default : -
abuse/trunk/src/director.cpp
r494 r512 11 11 #include "config.h" 12 12 13 #include "common.h" 14 13 15 #include "director.h" 14 16 #include "game.h" -
abuse/trunk/src/endgame.cpp
r494 r512 12 12 13 13 #include <math.h> 14 15 #include "common.h" 14 16 15 17 #include "menu.h" … … 43 45 static mask_line *make_mask_lines(image *mask, int map_width) 44 46 { 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++) 47 49 { 48 50 // find the start of the run.. … … 56 58 int size=0; 57 59 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++; } 59 61 p[y].size=size; 60 62 … … 75 77 *rem=map_width/2-(int)(sqrt((size-x)/(double)(size*2.0))*map_width/2.0); 76 78 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); 78 80 } 79 81 } … … 86 88 { 87 89 int x1=10000,x2=0; 88 int iw=im1-> width();90 int iw=im1->Size().x; 89 91 uint16_t r,off; 90 92 int y=0; … … 159 161 160 162 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); 162 164 163 165 int explo_frames1[8],explo_frames2[7]; … … 175 177 int eoff=0,coff=0; 176 178 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; 179 181 fade_out(16); 180 182 … … 212 214 213 215 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); 215 217 image *tcopy=cache.img(planet)->copy(); 216 218 fade_in(NULL,32); … … 241 243 cache.img(planet2), 242 244 0,paddr, 243 p,cache.img(mask)-> height(),eoff,coff);245 p,cache.img(mask)->Size().y,eoff,coff); 244 246 } 245 247 else … … 247 249 cache.img(planet2), 248 250 0,paddr, 249 p,cache.img(mask)-> height(),eoff,coff);251 p,cache.img(mask)->Size().y,eoff,coff); 250 252 if (i>38) 251 253 { 252 254 int t=i-38; 253 255 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); 259 261 if (i==77) 260 262 if (sound_avail&SFX_INITIALIZED) … … 288 290 289 291 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); 291 293 292 294 eoff+=2; if (eoff>=320) eoff-=320; … … 296 298 if (i<150 || (i<170 && ((i-149)%2)==0) || (i<180 && ((i-149)%4)==0) || (i<190 && ((i-149)%8)==0)) 297 299 { 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); 300 302 if (sound_avail&SFX_INITIALIZED) 301 303 cache.sfx(explo_snd)->play(127); 302 304 } 303 305 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); 306 308 307 309 ex_char *c=clist,*last=NULL; … … 354 356 cache.img(planet2), 355 357 256,paddr, 356 p,cache.img(mask)-> height(),eoff,coff);358 p,cache.img(mask)->Size().y,eoff,coff); 357 359 eoff+=2; if (eoff>=320) eoff-=320; 358 360 coff+=1; if (coff>=320) coff-=320; … … 387 389 cache.img(planet2), 388 390 256,paddr, 389 p,cache.img(mask)-> height(),eoff,coff);391 p,cache.img(mask)->Size().y,eoff,coff); 390 392 text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot),wm->font(),cmap,wm->bright_color()); 391 393 wm->flush_screen(); … … 397 399 398 400 399 for (i=0; i<cache.img(mask)-> height(); i++)401 for (i=0; i<cache.img(mask)->Size().y; i++) 400 402 { 401 403 free(p[i].remap); … … 434 436 PtrRef r2(mid_plot); 435 437 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; 437 439 im->put_image(screen,dx,dy); 438 440 console_font->put_string(screen,xres/2+35,yres/2+100-console_font->height()-2, -
abuse/trunk/src/extend.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "extend.h" -
abuse/trunk/src/game.cpp
r507 r512 18 18 # include <SDL.h> 19 19 #endif 20 21 #include "common.h" 20 22 21 23 #include "sdlport/joy.h" … … 469 471 int dx = 20, dy = 5; 470 472 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()); 472 474 jim->put_image(joy_win->screen, dx + 3, dy + 3); 473 475 … … 624 626 int xs, ys; 625 627 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; 627 629 else if(wm->key_pressed(JK_LEFT) && !last_input && !dev_cont->need_arrows()) 628 630 xs = -18; … … 633 635 634 636 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; 636 638 else if(wm->key_pressed(JK_UP) && !last_input) 637 639 ys = -18; … … 671 673 672 674 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); 674 676 675 677 for(int y = y1; y <= y2; y++) … … 711 713 screen->set_clip(v->cx1, v->cy1, v->cx2, v->cy2); 712 714 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); 715 717 if(state == SCENE_STATE) 716 718 screen->set_clip(cx1, cy1, cx2, cy2); … … 753 755 v->cx1 = 0; 754 756 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; 757 759 758 760 old_screen = screen; … … 883 885 screen->get_clip(ncx1, ncy1, ncx2, ncy2); 884 886 885 int scr_w = screen-> width();887 int scr_w = screen->Size().x; 886 888 if(dev & MAP_MODE) 887 889 { … … 1074 1076 dev_cont->dev_draw(v); 1075 1077 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); 1077 1079 1078 1080 if(dev & DRAW_LIGHTS) … … 1164 1166 { 1165 1167 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); 1167 1169 } 1168 1170 … … 1279 1281 pal->load(); 1280 1282 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; 1282 1284 gray->put_image(screen, dx, dy); 1283 1285 smoke[0]->put_image(screen, dx + 24, dy + 5); … … 1509 1511 { 1510 1512 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); 1513 1515 } 1514 1516 set_state(MENU_STATE); // then go to menu state so windows will turn off … … 1586 1588 { 1587 1589 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, 1589 1591 f->cy1 + 5, 1); 1590 1592 } … … 2152 2154 { 2153 2155 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()); 2158 2160 } 2159 2161 /* else 2160 2162 { 2161 2163 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); 2164 2166 }*/ 2165 2167 /* int dc = cache.img(window_colors)->pixel(0, 2); 2166 2168 int mc = cache.img(window_colors)->pixel(1, 2); 2167 2169 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); */ 2172 2174 2173 2175 for(view *f = first_view; f; f = f->next) -
abuse/trunk/src/gamma.cpp
r494 r512 12 12 13 13 #include <math.h> 14 15 #include "common.h" 14 16 15 17 #include "game.h" -
abuse/trunk/src/gui.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "cache.h" … … 135 137 { 136 138 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; 139 141 } 140 142 -
abuse/trunk/src/help.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "help.h" … … 25 27 { 26 28 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; 29 31 im->put_image(screen,x1,y1); 30 32 screen->bar(0,0,x1-1,yres,0); -
abuse/trunk/src/imlib/Makefile.am
r510 r512 30 30 $(NULL) 31 31 32 INCLUDES = -I$(srcdir) $(SDL_CFLAGS)32 INCLUDES = -I$(srcdir) -I$(srcdir)/.. $(SDL_CFLAGS) 33 33 34 34 CPPFLAGS = @CPPFLAGS@ -DNO_CHECK -
abuse/trunk/src/imlib/filesel.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "filesel.h" -
abuse/trunk/src/imlib/filter.cpp
r494 r512 11 11 #include "config.h" 12 12 13 #include "common.h" 14 13 15 #include "image.h" 14 16 #include "macs.h" … … 84 86 CONDITION(im,"null image passed in filter::apply\n"); 85 87 im->lock(); 86 for (y=im-> height()-1; y>=0; y--)88 for (y=im->Size().y-1; y>=0; y--) 87 89 { 88 90 c=im->scan_line(y); 89 for (x=im-> width()-1; x>=0; x--)91 for (x=im->Size().x-1; x>=0; x--) 90 92 { 91 93 CONDITION((unsigned) c[x]<nc,"not enough filter colors"); … … 179 181 { 180 182 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; 182 184 screen->get_clip(cx1,cy1,cx2,cy2); 183 185 -
abuse/trunk/src/imlib/fonts.cpp
r494 r512 13 13 #include <ctype.h> 14 14 15 #include "common.h" 16 15 17 #include "fonts.h" 16 18 … … 18 20 { fntpat=font_pattern; 19 21 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; 22 24 } 23 25 … … 60 62 JCFont::JCFont(image *letters) 61 63 { 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; 64 66 65 67 image tmp(tl,th); -
abuse/trunk/src/imlib/guistat.cpp
r494 r512 12 12 13 13 #include <string.h> 14 15 #include "common.h" 14 16 15 17 #include "input.h" -
abuse/trunk/src/imlib/image.cpp
r494 r512 18 18 #endif 19 19 #include <stdlib.h> 20 21 #include "common.h" 20 22 21 23 #include "image.h" … … 91 93 { 92 94 delete_page(); 93 w=new_width; 94 h=new_height; 95 size = vec2i(new_width, new_height); 95 96 make_page(new_width, new_height, page); 96 97 } … … 120 121 uint8_t image::pixel(int16_t x, int16_t y) 121 122 { 122 CONDITION(x>=0 && x< width() && y>=0 && y<height(),123 CONDITION(x>=0 && x<size.x && y>=0 && y<size.y, 123 124 "image::pixel Bad pixel xy"); 124 125 return (*(scan_line(y)+x)); … … 127 128 void image::putpixel(int16_t x, int16_t y, char color) 128 129 { 129 CONDITION(x>=0 && x< width() && y>=0 && y<height(),130 CONDITION(x>=0 && x<size.x && y>=0 && y<size.y, 130 131 "image::putpixel Bad pixel xy"); 131 132 if (special) … … 139 140 image::image(int16_t width, int16_t height, uint8_t *page_buffer, int16_t create_descriptor) 140 141 { 141 w=width; 142 h=height; 142 size = vec2i(width, height); 143 143 if (create_descriptor || page_buffer) 144 144 { … … 154 154 image::image(spec_entry *e, bFILE *fp) 155 155 { 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); 165 165 _locked = false; 166 166 } … … 168 168 image::image(bFILE *fp) 169 169 { 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); 178 178 _locked = false; 179 179 } … … 237 237 238 238 lock(); 239 for(co = 0, i = height()- 1; i >= 0; i--)239 for(co = 0, i = size.y - 1; i >= 0; i--) 240 240 { 241 241 c = scan_line(i); 242 for(j = width()- 1; j >= 0; j--, c++)242 for(j = size.x - 1; j >= 0; j--, c++) 243 243 if(*c != background) co++; 244 244 } … … 262 262 } 263 263 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); 267 267 unlock(); 268 268 } … … 275 275 276 276 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); 279 279 im->lock(); 280 for(i = height()- 1; i >= 0; i--)280 for(i = size.y - 1; i >= 0; i--) 281 281 { 282 282 c = scan_line(i); 283 memcpy(dat, c, width());283 memcpy(dat, c, size.x); 284 284 c = im->scan_line(i); 285 memcpy(c, dat, width());285 memcpy(c, dat, size.x); 286 286 } 287 287 im->unlock(); … … 443 443 if(screen->special) 444 444 { 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); 446 446 return; 447 447 } 448 448 449 if(x < screen-> width() && y < screen->height())450 { 451 xl = width();452 if(x + xl > screen-> width()) // clip to the border of the screen453 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; 457 457 458 458 int startx = 0, starty = 0; … … 511 511 { if (x1<0) x1=0; 512 512 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) 517 517 return ; 518 518 screen->add_dirty(x1, y1, x2, y2); 519 w= width();519 w=size.x; 520 520 if (align) 521 521 { 522 522 start=x1%w; 523 starty=y1% height();523 starty=y1%size.y; 524 524 } 525 525 else … … 533 533 pg1=screen->scan_line(j); 534 534 pg2=scan_line(starty++); 535 if (starty>= height()) starty=0;535 if (starty>=size.y) starty=0; 536 536 i=x1; 537 537 xx=start; … … 565 565 if (x1<0) { x+=-x1; x1=0; } 566 566 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; 569 569 if (x1>x2 || y1>y2) return ; // return if it was adjusted so that nothing will be put 570 570 … … 628 628 CHECK(x1<=x2 && y1<=y2); 629 629 630 i=x1; x1= width()-x2-1; // reverse the x locations631 x2= width()-i-1;630 i=x1; x1=size.x-x2-1; // reverse the x locations 631 x2=size.x-i-1; 632 632 633 633 if (x1<0) … … 649 649 { y2=cy2-y+y1; } 650 650 } 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) 652 652 return ; 653 653 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 && 655 655 x1<=x2 && y1<=y2) 656 656 { 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; 661 661 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; 664 664 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; 667 667 screen->add_dirty(x, y, x+xl-1, y+yl-1); 668 668 screen->lock(); … … 709 709 { y2=cy2+y1-y; } 710 710 } 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) 712 712 return ; 713 713 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 && 717 717 maskx<ml && masky<mh && x1<=x2 && y1<=y2) 718 718 { 719 719 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; 724 724 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; 727 727 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; 730 730 screen->add_dirty(x, y, x+xl-1, y+yl-1); 731 731 screen->lock(); … … 761 761 brv=0; bri=0; 762 762 lock(); 763 for (j=0; j< h; j++)763 for (j=0; j<size.y; j++) 764 764 { 765 765 p=scan_line(j); 766 for (i=0; i< w; i++)766 for (i=0; i<size.x; i++) 767 767 { pal->get(p[i], r, g, b); 768 768 if ((int32_t)r*(int32_t)g*(int32_t)b>brv) … … 782 782 brv=(int32_t)258*(int32_t)258*(int32_t)258; bri=0; 783 783 lock(); 784 for (j=0; j< h; j++)784 for (j=0; j<size.y; j++) 785 785 { 786 786 p=scan_line(j); 787 for (i=0; i< w; i++)787 for (i=0; i<size.x; i++) 788 788 { pal->get(p[i], r, g, b); 789 789 x=(int32_t)r*(int32_t)g*(int32_t)b; … … 811 811 // with no dirty rectangle keeping. 812 812 if(!special) 813 special = new image_descriptor( width(), height(), 0);813 special = new image_descriptor(size.x, size.y, 0); 814 814 815 815 // set the image descriptor what the clip … … 823 823 special->get_clip(x1, y1, x2, y2); 824 824 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; } 826 826 } 827 827 … … 1056 1056 { if (x1<0) x1=0; 1057 1057 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) 1062 1062 return ; 1063 1063 lock(); … … 1081 1081 { if (x1<0) x1=0; 1082 1082 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) 1087 1087 return ; 1088 1088 … … 1094 1094 for (x=x1; x<=x2; x++, s++) 1095 1095 *s=(*s)^color; 1096 sl+= w;1096 sl+=size.x; 1097 1097 } 1098 1098 unlock(); … … 1106 1106 int16_t x; 1107 1107 uint8_t *sl, *ex, mask, bt, sh; 1108 ex=(uint8_t *)malloc( width());1108 ex=(uint8_t *)malloc(size.x); 1109 1109 1110 1110 lock(); 1111 1111 sl=scan_line(line); 1112 memcpy(ex, sl, width());1112 memcpy(ex, sl, size.x); 1113 1113 unlock(); 1114 1114 … … 1117 1117 else { mask=128+64+32+16; bt=2; } 1118 1118 1119 for (x=0; x< width(); x++)1119 for (x=0; x<size.x; x++) 1120 1120 { sh=((x%bt)<<(bitsperpixel-1)); 1121 1121 sl[x]=(ex[x/bt]&(mask>>sh))>>(bt-sh-1); … … 1135 1135 uint8_t *sl; 1136 1136 lock(); 1137 for (y= height()-1; y>=0; y--)1137 for (y=size.y-1; y>=0; y--) 1138 1138 { 1139 1139 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--) 1141 1141 { 1142 1142 if (pal->red(sl[x])>dt_matrix[j*4+i]) … … 1162 1162 void image::resize(int16_t new_width, int16_t new_height) 1163 1163 { 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); 1166 1166 lock(); 1167 memcpy(im, scan_line(0), width()*height());1167 memcpy(im, scan_line(0), size.x*size.y); 1168 1168 1169 1169 delete_page(); 1170 1170 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 1173 1172 1174 1173 uint8_t *sl1, *sl2; … … 1196 1195 { 1197 1196 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); 1199 1198 if (special) 1200 1199 { … … 1228 1227 d=smoothness*2+1; 1229 1228 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++) 1233 1232 { 1234 1233 for (t=0, k=-smoothness; k<=smoothness; k++) 1235 1234 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) 1237 1236 t+=pixel(i+k, j+l); 1238 1237 else t+=pixel(i, j); … … 1291 1290 } 1292 1291 } 1293 if (y< height()-1)1292 if (y<size.y-1) 1294 1293 { 1295 1294 above=scan_line(y+1); … … 1312 1311 } 1313 1312 } 1314 if (y< height()-1)1313 if (y<size.y-1) 1315 1314 { below=scan_line(y+1); 1316 1315 if (x>0 && below[x-1]!=fcolor && below[x]==fcolor) … … 1320 1319 } 1321 1320 x++; 1322 } while (sl[x]==fcolor && x< width());1321 } while (sl[x]==fcolor && x<size.x); 1323 1322 x--; 1324 1323 if (y>0) … … 1330 1329 } 1331 1330 } 1332 if (y< height()-1)1331 if (y<size.y-1) 1333 1332 { 1334 1333 above=scan_line(y+1); … … 1425 1424 void image::flip_x() 1426 1425 { 1427 uint8_t *rev=(uint8_t *)malloc( width()), *sl;1426 uint8_t *rev=(uint8_t *)malloc(size.x), *sl; 1428 1427 CONDITION(rev, "memory allocation"); 1429 1428 int y, x, i; … … 1431 1430 /* FIXME: Abuse Win32 uses RestoreSurface() here instead of locking */ 1432 1431 lock(); 1433 for (y=0; y< height(); y++)1432 for (y=0; y<size.y; y++) 1434 1433 { 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++) 1436 1435 rev[i]=sl[x]; 1437 memcpy(sl, rev, width());1436 memcpy(sl, rev, size.x); 1438 1437 } 1439 1438 unlock(); … … 1443 1442 void image::flip_y() 1444 1443 { 1445 uint8_t *rev=(uint8_t *)malloc( width()), *sl;1444 uint8_t *rev=(uint8_t *)malloc(size.x), *sl; 1446 1445 CONDITION(rev, "memory allocation"); 1447 1446 int y; … … 1449 1448 /* FIXME: Abuse Win32 uses RestoreSurface() here instead of locking */ 1450 1449 lock(); 1451 for (y=0; y< height()/2; y++)1450 for (y=0; y<size.y/2; y++) 1452 1451 { 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); 1456 1455 } 1457 1456 unlock(); … … 1464 1463 int y, x; 1465 1464 lock(); 1466 for (y=0; y< height(); y++)1465 for (y=0; y<size.y; y++) 1467 1466 { 1468 1467 sl=scan_line(y); 1469 for (x= width(); x; x--, sl++)1468 for (x=size.x; x; x--, sl++) 1470 1469 if (*sl) 1471 1470 *sl=color; -
abuse/trunk/src/imlib/image.h
r494 r512 119 119 private: 120 120 uint8_t *data; 121 int16_t w, h;121 vec2i size; 122 122 void make_page(int16_t width, int16_t height, uint8_t *page_buffer); 123 123 void delete_page(); … … 140 140 uint8_t *scan_line(int16_t y) 141 141 { 142 return data + y * w;142 return data + y * size.x; 143 143 } 144 144 uint8_t *next_line(int16_t lasty, uint8_t *last_scan) 145 145 { 146 return last_scan + w;146 return last_scan + size.x; 147 147 } 148 148 int32_t total_pixels(uint8_t background=0); … … 150 150 void clear(int16_t color = -1); // -1 is background color 151 151 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 164 156 void scroll(int16_t x1, int16_t y1, int16_t x2, int16_t y2, 165 157 int16_t xd, int16_t yd); -
abuse/trunk/src/imlib/include.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "include.h" … … 53 55 } 54 56 } 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++) 60 62 { 61 63 fprintf(fp,"%d",(int)im->pixel(x,y)); -
abuse/trunk/src/imlib/input.cpp
r494 r512 12 12 13 13 #include <string.h> 14 15 #include "common.h" 14 16 15 17 #include "input.h" … … 202 204 if (pressed) 203 205 { 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; 206 208 } 207 209 else … … 213 215 } else 214 216 { 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; 217 219 } 218 220 } -
abuse/trunk/src/imlib/jwindow.cpp
r494 r512 12 12 13 13 #include <string.h> 14 15 #include "common.h" 14 16 15 17 #include "video.h" … … 314 316 ifield * fields, char const *name) 315 317 { 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; 320 322 321 323 Jwindow * j = new Jwindow (x, y, l, h, fields, name); … … 340 342 341 343 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); 344 346 mouse_pic->put_image(screen, mx, my, 1); 345 347 } … … 361 363 { 362 364 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); 365 367 if(has_mouse()) 366 368 mouse_pic->put_image(p->screen, mx - p->x, my - p->y, 1); … … 529 531 { 530 532 screen->bar (top_border(), 1, 531 top_border() + fnt->width 533 top_border() + fnt->width() * strlen (_name) + 1, 532 534 top_border() - 2, med); 533 535 fnt->put_string (screen, top_border() + 1, 1, _name, low); -
abuse/trunk/src/imlib/palette.cpp
r494 r512 12 12 13 13 #include <math.h> 14 15 #include "common.h" 14 16 15 17 #include "palette.h" -
abuse/trunk/src/imlib/pcxread.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "pcxread.h" … … 60 62 PCX_header.xmin=0; 61 63 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; 64 66 PCX_header.hres=320; 65 67 PCX_header.vres=200; 66 68 PCX_header.reserved=0; 67 69 PCX_header.color_planes=1; 68 PCX_header.bytes_per_line=im-> width();70 PCX_header.bytes_per_line=im->Size().x; 69 71 PCX_header.palette_type=0; 70 72 memset(PCX_header.filter,0,58); … … 78 80 int y,run_length,x; 79 81 unsigned char *sl,code; 80 for (y=0; y<im-> height(); y++)82 for (y=0; y<im->Size().y; y++) 81 83 { 82 84 sl=im->scan_line(y); 83 for (x=0; x<im-> width(); )85 for (x=0; x<im->Size().x; ) 84 86 { 85 87 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]) 87 89 run_length++; 88 90 if (run_length==1 && sl[x]<64) -
abuse/trunk/src/imlib/pmenu.cpp
r494 r512 13 13 #include <string.h> 14 14 15 #include "common.h" 16 15 17 #include "pmenu.h" 16 18 … … 285 287 { 286 288 if (p->xp!=-1) return p->xp; 287 int w=bar->screen-> width();289 int w=bar->screen->Size().x; 288 290 289 291 … … 376 378 mx-=bar->x; 377 379 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; 379 381 else 380 382 { -
abuse/trunk/src/imlib/scroller.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "scroller.h" … … 492 494 screen->get_clip(cx1,cy1,cx2,cy2); 493 495 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; 496 498 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) 499 501 tex->put_image(screen,dx,dy); 500 502 -
abuse/trunk/src/imlib/specs.cpp
r494 r512 21 21 # include <sys/stat.h> 22 22 #endif 23 24 #include "common.h" 23 25 24 26 #include "image.h" -
abuse/trunk/src/imlib/sprite.cpp
r494 r512 13 13 #include <math.h> 14 14 15 #include "common.h" 16 15 17 #include "macs.h" 16 18 #include "video.h" … … 22 24 23 25 void 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) 25 27 save->put_image(screen,x,y); } 26 28 27 29 void 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); } 30 32 31 33 void 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) 33 35 visual->put_image(screen,x,y,1); } 34 36 … … 37 39 CHECK(Visual && Screen); 38 40 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); 40 42 get_background(); 41 43 } ; … … 62 64 delete visual; 63 65 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) 65 67 { 66 68 delete save; 67 save=new image(visual-> width(),visual->height());69 save=new image(visual->Size().x,visual->Size().y); 68 70 } 69 71 get_background(); -
abuse/trunk/src/imlib/status.cpp
r494 r512 12 12 13 13 #include <string.h> 14 15 #include "common.h" 14 16 15 17 #include "macs.h" -
abuse/trunk/src/imlib/supmorph.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "supmorph.h" -
abuse/trunk/src/imlib/timage.cpp
r494 r512 11 11 #include "config.h" 12 12 13 #include "common.h" 14 13 15 #include "timage.h" 14 16 … … 70 72 int size=0,x,y; 71 73 uint8_t *sl,*datap,*marker; 72 w=im-> width();73 h=im-> height();74 w=im->Size().x; 75 h=im->Size().y; 74 76 75 77 im->lock(); 76 78 77 79 // 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++) 79 81 { 80 82 sl=im->scan_line(y); … … 99 101 100 102 data=(uint8_t *)malloc(size); 101 int ww=im-> width(),hh=im->height();103 int ww=im->Size().x,hh=im->Size().y; 102 104 datap=data; 103 105 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); } 105 107 CONDITION(datap,"malloc error for trans_image::data"); 106 108 … … 112 114 { 113 115 *datap=0; // start the skip at 0 114 while (x<im-> width()&& (*sl)==0)116 while (x<im->Size().x && (*sl)==0) 115 117 { sl++; x++; (*datap)++; } 116 118 datap++; … … 121 123 *marker=0; 122 124 datap++; // skip over this spot 123 while (x<im-> width()&& (*sl)!=0)125 while (x<im->Size().x && (*sl)!=0) 124 126 { 125 127 (*marker)++; … … 274 276 275 277 screen_line=screen->scan_line(y)+x; 276 int sw=screen-> width()-w;278 int sw=screen->Size().x-w; 277 279 x1-=x; x2-=x; 278 280 for (; ysteps>0; ysteps--) … … 343 345 344 346 screen->lock(); 345 screen_skip = screen-> width()- w;347 screen_skip = screen->Size().x - w; 346 348 for (; ysteps; ysteps--) 347 349 { … … 366 368 ix+=skip; 367 369 368 if (s_off>=screen->scan_line(screen-> height()+1))370 if (s_off>=screen->scan_line(screen->Size().y+1)) 369 371 printf("bad write in trans_image::put_image_offseted"); 370 372 } … … 386 388 screen->lock(); 387 389 screen_line=screen->scan_line(y)+x; 388 int sw=screen-> width();390 int sw=screen->Size().x; 389 391 x1-=x; x2-=x; 390 392 for (; ysteps>0; ysteps--) … … 451 453 screen->lock(); 452 454 screen_line=screen->scan_line(y)+x; 453 int sw=screen-> width();455 int sw=screen->Size().x; 454 456 x1-=x; x2-=x; 455 457 for (; ysteps>0; ysteps--) … … 529 531 screen->lock(); 530 532 screen_line=screen->scan_line(y)+x; 531 int sw=screen-> width();533 int sw=screen->Size().x; 532 534 x1-=x; x2-=x; 533 535 for (; ysteps>0; ysteps--) … … 857 859 *blend_line,*screen_line; 858 860 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"); 860 862 861 863 blend_amount=16-blend_amount; … … 979 981 screen->lock(); 980 982 screen_line=screen->scan_line(y)+x; 981 int sw=screen-> width();983 int sw=screen->Size().x; 982 984 x1-=x; x2-=x; 983 985 for (; ysteps>0; ysteps--) -
abuse/trunk/src/imlib/tools.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "tools.h" -
abuse/trunk/src/imlib/visobj.h
r494 r512 33 33 image_visual(image *img) { im=img; } 34 34 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; } 37 37 } ; 38 38 -
abuse/trunk/src/innet.cpp
r494 r512 12 12 13 13 #include <stdio.h> 14 15 #include "common.h" 14 16 15 17 #include "demo.h" -
abuse/trunk/src/items.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "items.h" … … 216 218 217 219 //uint8_t *buffer=(uint8_t *)µ_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; 219 221 int r[AUTOTILE_WIDTH * AUTOTILE_HEIGHT], 220 222 g[AUTOTILE_WIDTH * AUTOTILE_HEIGHT], -
abuse/trunk/src/items.h
r494 r512 37 37 backtile(spec_entry *e, bFILE *fp); 38 38 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; } 40 40 ~backtile() { delete im; } 41 41 } ; -
abuse/trunk/src/level.cpp
r497 r512 18 18 #include <limits.h> 19 19 #include <time.h> 20 21 #include "common.h" 20 22 21 23 #include "light.h" … … 1654 1656 wm->font()->put_string(i,80-strlen(buf)*wm->font()->width()/2,100+wm->font()->height(),buf); 1655 1657 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); 1658 1660 1659 1661 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); 1662 1664 i->unlock(); 1663 1665 -
abuse/trunk/src/light.cpp
r494 r512 12 12 13 13 #include <stdlib.h> 14 15 #include "common.h" 14 16 15 17 #include "light.h" … … 793 795 screen->lock(); 794 796 795 int scr_w=screen-> width();797 int scr_w=screen->Size().x; 796 798 uint8_t *screen_line=screen->scan_line(cy1)+cx1; 797 799 … … 899 901 image *out, int32_t out_x, int32_t out_y) 900 902 { 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) 903 905 return ; // screen was resized and small_render has not changed size yet 904 906 … … 930 932 uint8_t *src=sc->scan_line(0); 931 933 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; 933 935 int x,y; 934 936 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--) 938 940 { 939 941 v=*(src++); … … 942 944 } 943 945 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; 946 948 } 947 949 … … 951 953 light_patch *first=make_patch_list(cx2-cx1+1,cy2-cy1+1,screenx,screeny); 952 954 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; 955 957 956 958 int prefix_x=(screenx&7); -
abuse/trunk/src/lisp/lisp.cpp
r504 r512 16 16 #include <string.h> 17 17 #include <stdarg.h> 18 19 #include "common.h" 18 20 19 21 #define TYPE_CHECKING 1 -
abuse/trunk/src/loader2.cpp
r503 r512 12 12 13 13 #include <math.h> 14 15 #include "common.h" 14 16 15 17 #include "timing.h" … … 75 77 image *im=new image(e,fp); 76 78 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); 78 80 return im; 79 81 } … … 83 85 image *im=new image(fp); 84 86 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); 86 88 87 89 return im; … … 456 458 f_wid=cache.foret(foretiles[0])->im->width(); 457 459 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; 460 462 461 463 #if 0 -
abuse/trunk/src/loadgame.cpp
r494 r512 12 12 13 13 #include <string.h> 14 15 #include "common.h" 14 16 15 17 #include "game.h" … … 60 62 ico_button *buts[MAX_SAVE_GAMES]; 61 63 int y = 0, i; 62 int ih=cache.img(save_buts[0])-> height();64 int ih=cache.img(save_buts[0])->Size().y; 63 65 int x=0; 64 66 for (i=0; i<total_saved; i++,y+=ih) … … 93 95 if (last_free) return last_free; // if there are any slots not created yet... 94 96 95 int w=cache.img(save_buts[0])-> width();97 int w=cache.img(save_buts[0])->Size().x; 96 98 int mx=last_demo_mx-w/2; 97 99 if(mx + w + 10 > xres) mx = xres - w - 10; … … 179 181 { 180 182 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; 183 185 if (!first) first=thumb_nails[start_num]; 184 186 total_saved++; … … 203 205 204 206 int i; 205 /* int ih=cache.img(save_buts[0])-> height();207 /* int ih=cache.img(save_buts[0])->Size().y; 206 208 ico_button *buts[MAX_SAVE_GAMES]; 207 209 int y=0; -
abuse/trunk/src/menu.cpp
r496 r512 12 12 13 13 #include <math.h> 14 15 #include "common.h" 14 16 15 17 #include "dev.h" … … 146 148 147 149 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; 150 152 151 153 … … 155 157 { 156 158 int tl=strlen(title)*font->width(); 157 int tx=screen-> width()/2-tl/2;159 int tx=screen->Size().x/2-tl/2; 158 160 dark_widget(tx-2,my-font->height()-4,tx+tl+2,my-2,wm->medium_color(),wm->dark_color(),180); 159 161 font->put_string(screen,tx+1,my-font->height()-2,title,wm->bright_color()); … … 512 514 { 513 515 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); 516 518 } 517 519 inm->redraw(); … … 546 548 c=cache.reg("art/icons.spe",name,SPEC_IMAGE,1); 547 549 548 h=cache.img(a)-> height();550 h=cache.img(a)->Size().y; 549 551 550 552 return new ico_button(x,y,id,b,b,a,c,next,-1,key); -
abuse/trunk/src/morpher.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "morpher.h" -
abuse/trunk/src/net/gclient.cpp
r494 r512 19 19 #include <string.h> 20 20 #include <signal.h> 21 22 #include "common.h" 21 23 22 24 #include "netcfg.h" -
abuse/trunk/src/net/gserver.cpp
r494 r512 19 19 #include <string.h> 20 20 #include <signal.h> 21 22 #include "common.h" 21 23 22 24 #include "system.h" -
abuse/trunk/src/netcfg.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "game.h" … … 262 264 263 265 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; 265 267 int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2; 266 268 ns->put_image(screen,x,y); … … 270 272 271 273 uint8_t *sl=screen->scan_line(0); 272 int xx=screen-> width()*screen->height();274 int xx=screen->Size().x*screen->Size().y; 273 275 for (; xx; xx--,sl++) *sl=remap[*sl]; 274 276 … … 327 329 { 328 330 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; 330 332 int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2; 331 333 ns->put_image(screen,x,y); … … 446 448 447 449 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; 449 451 int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2; 450 452 ns->put_image(screen,x,y); -
abuse/trunk/src/nfclient.cpp
r494 r512 17 17 #include <unistd.h> 18 18 #include <ctype.h> 19 20 #include "common.h" 19 21 20 22 #include "system.h" -
abuse/trunk/src/objects.cpp
r499 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "timage.h" -
abuse/trunk/src/particle.cpp
r494 r512 11 11 #include "config.h" 12 12 13 #include "common.h" 14 13 15 #include "macs.h" 14 16 #include "particle.h" … … 247 249 screen->lock(); 248 250 249 int w = screen-> width();251 int w = screen->Size().x; 250 252 uint8_t *addr; 251 253 -
abuse/trunk/src/points.cpp
r494 r512 12 12 13 13 #include <string.h> 14 15 #include "common.h" 14 16 15 17 #include "points.h" -
abuse/trunk/src/profile.cpp
r494 r512 11 11 #include "config.h" 12 12 13 #include "common.h" 14 13 15 #include "game.h" 14 15 16 16 17 #include "profile.h" … … 119 120 float time_scaler=(float)max_bar_length/prof_list[0].total_time; 120 121 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); 122 123 int dy = 0; 123 124 for (; i<prof_height; i++) -
abuse/trunk/src/property.cpp
r494 r512 13 13 #include <stdio.h> 14 14 #include <string.h> 15 16 #include "common.h" 15 17 16 18 #include "property.h" -
abuse/trunk/src/sdlport/event.cpp
r494 r512 22 22 23 23 #include <SDL.h> 24 25 #include "common.h" 24 26 25 27 #include "system.h" … … 375 377 x = (x << 16) / mouse_xscale; 376 378 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; 384 386 } 385 387 ev.mouse_move.x = x; -
abuse/trunk/src/sdlport/mouse.cpp
r494 r512 22 22 23 23 #include <SDL.h> 24 25 #include "common.h" 24 26 25 27 #include "video.h" … … 64 66 f.apply( im ); 65 67 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; 68 70 } 69 71 … … 98 100 { 99 101 // Make sure the values we are given are sensible. 100 if( new_mx > screen-> width()- 1 )102 if( new_mx > screen->Size().x - 1 ) 101 103 { 102 new_mx = screen-> width()- 1;104 new_mx = screen->Size().x - 1; 103 105 } 104 if( new_my > screen-> height()- 1 )106 if( new_my > screen->Size().y - 1 ) 105 107 { 106 new_my = screen-> height()- 1;108 new_my = screen->Size().y - 1; 107 109 } 108 110 -
abuse/trunk/src/sdlport/video.cpp
r494 r512 33 33 #endif /* HAVE_OPENGL */ 34 34 35 #include "common.h" 36 35 37 #include "filter.h" 36 38 #include "system.h" … … 343 345 void put_image(image * im, int x, int y) 344 346 { 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); 346 348 } 347 349 -
abuse/trunk/src/sensor.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "lisp.h" -
abuse/trunk/src/seq.cpp
r503 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "seq.h" -
abuse/trunk/src/statbar.cpp
r494 r512 11 11 #include "config.h" 12 12 13 #include "common.h" 14 13 15 #include "sbar.h" 14 16 #include "view.h" … … 78 80 79 81 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; 82 84 83 85 int n=num/100; … … 105 107 106 108 // 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); 109 111 110 112 // status bar x & y position … … 115 117 116 118 // 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; 119 121 120 122 121 123 // numpad y offset 122 124 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; 125 127 126 128 // 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; 129 131 130 132 int sel_off=small_render ? 8 : 4; … … 180 182 181 183 // 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; 184 186 185 187 if (small_render) { sb_w*=2; sb_h*=2; } … … 276 278 277 279 // 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; 280 282 } 281 283 -
abuse/trunk/src/transp.cpp
r494 r512 11 11 #include "config.h" 12 12 13 #include "common.h" 14 13 15 #include "transp.h" 14 16 … … 17 19 short cx1,cy1,cx2,cy2; 18 20 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; 20 22 if (x<cx1) 21 23 { … … 45 47 uint8_t *isl=im->scan_line(ys)+xs; 46 48 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; 48 50 49 51 for (int iy=ys; iy<ye; iy++,y++,isl+=iw,ssl+=sw) -
abuse/trunk/src/ui/volumewindow.cpp
r494 r512 10 10 11 11 #include "config.h" 12 13 #include "common.h" 12 14 13 15 #include "volumewindow.h" // class VolumeWindow … … 38 40 //reconfigure(); 39 41 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; 42 44 screen = new image(l, h, NULL, 2); 43 45 redraw(); -
abuse/trunk/src/view.cpp
r499 r512 11 11 #include "config.h" 12 12 13 #include "common.h" 14 13 15 #include "game.h" 14 15 16 16 17 #include "system.h"
Note: See TracChangeset
for help on using the changeset viewer.