Changeset 644
- Timestamp:
- May 13, 2011, 9:13:58 AM (11 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/ant.cpp
r643 r644 451 451 main_screen->clear(); 452 452 image *im=cache.img(cache.reg("art/frame.spe","end_level_screen",SPEC_IMAGE,1)); 453 im->put_image(main_screen,0,0);453 main_screen->PutImage(im, 0, 0); 454 454 455 455 -
abuse/trunk/src/automap.cpp
r643 r644 23 23 { 24 24 if (!automap_window) return ; 25 image *screen=automap_window-> screen;25 image *screen=automap_window->m_surf; 26 26 27 27 long sx,ex,sy,ey,x,y,window_xstart,window_ystart, … … 64 64 if (draw_xstart==old_dx && draw_ystart==old_dy) 65 65 { 66 automap_window-> screen->Lock();67 automap_window-> screen->AddDirty(centerx,centery,centerx + 1,centery + 1);66 automap_window->m_surf->Lock(); 67 automap_window->m_surf->AddDirty(centerx,centery,centerx + 1,centery + 1); 68 68 if ((tick++)&4) 69 automap_window-> screen->PutPixel(vec2i(centerx,centery),255);69 automap_window->m_surf->PutPixel(vec2i(centerx,centery),255); 70 70 else 71 automap_window-> screen->PutPixel(vec2i(centerx,centery),27);72 automap_window-> screen->Unlock();71 automap_window->m_surf->PutPixel(vec2i(centerx,centery),27); 72 automap_window->m_surf->Unlock(); 73 73 return ; 74 74 } … … 103 103 104 104 105 // draw the tiles that will be around the border of the automap with put_image105 // draw the tiles that will be around the border of the automap with PutImage 106 106 // because it handles clipping, but for ths reason is slower, the rest 107 107 // we will slam on as fast as possible 108 108 109 screen->SetClip(window_xstart,window_ystart,window_xend+1,window_yend+1); 110 /* for (i=draw_xstart,j=draw_ystart,x=sx,y=sy; y<=ey; j+=AUTOTILE_HEIGHT,y++) 111 foretiles[cur_lev->get_fg(x,y)]->micro_image->put_image(screen,i,j,0); 109 screen->SetClip(window_xstart, window_ystart, window_xend+1, window_yend+1); 110 #if 0 111 for (i=draw_xstart,j=draw_ystart,x=sx,y=sy; y<=ey; j+=AUTOTILE_HEIGHT,y++) 112 screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, i, j, 0); 112 113 113 114 for (i=draw_xstart+ex*AUTOTILE_WIDTH,j=draw_ystart,y=sy,x=ex; y<=ey; j+=AUTOTILE_HEIGHT,y++) 114 foretiles[cur_lev->get_fg(x,y)]->micro_image->put_image(screen,i,j,0);115 screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, i, j, 0); 115 116 116 117 for (i=draw_xstart,j=draw_ystart,x=sx,y=sy; x<=ex; i+=AUTOTILE_WIDTH,x++) 117 foretiles[cur_lev->get_fg(x,y)]->micro_image->put_image(screen,i,j,0);118 screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, i, j, 0); 118 119 119 120 for (i=draw_xstart,j=draw_ystart+ey*AUTOTILE_HEIGHT,x=sx,y=ex; x<=ex; i+=AUTOTILE_WIDTH,x++) 120 foretiles[cur_lev->get_fg(x,y)]->micro_image->put_image(screen,i,j,0); */ 121 122 121 screen->PutImage(foretiles[cur_lev->get_fg(x, y)]->micro_image, i, j, 0); 122 #endif 123 123 124 124 unsigned short *fgline; … … 132 132 int id=foretiles[ (*fgline)&0x7fff]; 133 133 if (id>=0) 134 cache.foret(id)->micro_image->put_image(screen,i,j,0);134 screen->PutImage(cache.foret(id)->micro_image, i, j, 0); 135 135 else 136 cache.foret(foretiles[0])->micro_image->put_image(screen,i,j,0);136 screen->PutImage(cache.foret(foretiles[0])->micro_image, i, j, 0); 137 137 } 138 138 else … … 143 143 // draw the person as a dot, no need to add a dirty because we marked the 144 144 // whole screen already 145 automap_window-> screen->Lock();145 automap_window->m_surf->Lock(); 146 146 if ((tick++)&4) 147 automap_window-> screen->PutPixel(vec2i(centerx,centery),255);147 automap_window->m_surf->PutPixel(vec2i(centerx,centery),255); 148 148 else 149 automap_window-> screen->PutPixel(vec2i(centerx,centery),27);150 automap_window-> screen->Unlock();149 automap_window->m_surf->PutPixel(vec2i(centerx,centery),27); 150 automap_window->m_surf->Unlock(); 151 151 152 152 // set the clip back to full window size because soemthing else could mess with the area 153 automap_window-> screen->SetClip(0,0,screen->Size().x,screen->Size().y);153 automap_window->m_surf->SetClip(0,0,screen->Size().x,screen->Size().y); 154 154 } 155 155 … … 168 168 automap_window = wm->new_window(0, 0, w * AUTOTILE_WIDTH, 169 169 h * AUTOTILE_HEIGHT, NULL, "Map"); 170 automap_window-> screen->bar(17, 1, 17 + 8 * 6 + 3, 6,170 automap_window->m_surf->bar(17, 1, 17 + 8 * 6 + 3, 6, 171 171 wm->medium_color()); 172 wm->font()->put_string(automap_window-> screen, 20, 2, "Automap",172 wm->font()->put_string(automap_window->m_surf, 20, 2, "Automap", 173 173 wm->dark_color()); 174 174 draw(); -
abuse/trunk/src/clisp.cpp
r643 r644 1844 1844 int32_t y1=lnumber_value(CAR(args)); args=lcdr(args); 1845 1845 int32_t id=lnumber_value(CAR(args)); 1846 cache.img(id)->put_image(main_screen,x1,y1,1);1846 main_screen->PutImage(cache.img(id), x1, y1, 1); 1847 1847 } break; 1848 1848 case 217 : -
abuse/trunk/src/console.cpp
r643 r644 45 45 { 46 46 if (*s) 47 fnt->put_char(con_win-> screen,dx,dy,*s);47 fnt->put_char(con_win->m_surf,dx,dy,*s); 48 48 } 49 49 } 50 fnt->put_char(con_win-> screen,wx()+cx*xa,wy()+cy*ya,'_');50 fnt->put_char(con_win->m_surf,wx()+cx*xa,wy()+cy*ya,'_'); 51 51 } 52 52 } … … 58 58 con_win=wm->new_window(lastx,lasty,screen_w(),screen_h(),NULL,name); 59 59 redraw(); 60 con_win-> screen->SetClip(con_win->x1(),con_win->y1(),con_win->x2()+1,con_win->y2()+1);60 con_win->m_surf->SetClip(con_win->x1(),con_win->y1(),con_win->x2()+1,con_win->y2()+1); 61 61 } 62 62 } … … 98 98 { 99 99 if (con_win) 100 fnt->put_char(con_win-> screen,cx*fnt->width()+wx(),cy*fnt->height()+wy(),'_');100 fnt->put_char(con_win->m_surf,cx*fnt->width()+wx(),cy*fnt->height()+wy(),'_'); 101 101 } 102 102 … … 108 108 int fw=fnt->width(),fh=fnt->height(); 109 109 int dx=wx()+x*fw,dy=wy()+y*fh; 110 con_win-> screen->bar(dx,dy,dx+fw-1,dy+fh-1,wm->black());111 fnt->put_char(con_win-> screen,dx,dy,ch);110 con_win->m_surf->bar(dx,dy,dx+fw-1,dy+fh-1,wm->black()); 111 fnt->put_char(con_win->m_surf,dx,dy,ch); 112 112 } 113 113 } -
abuse/trunk/src/cop.cpp
r643 r644 829 829 player_draw(just_fired,o->get_tint()); 830 830 if (o->controller() && o->controller()->local_player()) 831 cache.img(S_health_image)->put_image(main_screen,o->controller()->cx2-20,832 o->controller()->cy1+5,1);831 main_screen->PutImage(cache.img(S_health_image), o->controller()->cx2-20, 832 o->controller()->cy1+5,1); 833 833 } break; 834 834 case FAST_POWER : … … 850 850 o->state=(character_state)old_state; 851 851 if (o->controller() && o->controller()->local_player()) 852 cache.img(S_fast_image)->put_image(main_screen,o->controller()->cx2-20,853 o->controller()->cy1+5,1);852 main_screen->PutImage(cache.img(S_fast_image), o->controller()->cx2-20, 853 o->controller()->cy1+5,1); 854 854 } break; 855 855 case FLY_POWER : … … 871 871 872 872 if (o->controller() && o->controller()->local_player()) 873 cache.img(S_fly_image)->put_image(main_screen,o->controller()->cx2-20,874 o->controller()->cy1+5,1);873 main_screen->PutImage(cache.img(S_fly_image), o->controller()->cx2-20, 874 o->controller()->cy1+5,1); 875 875 } break; 876 876 case SNEAKY_POWER : … … 884 884 885 885 if (o->controller() && o->controller()->local_player()) 886 cache.img(S_sneaky_image)->put_image(main_screen,o->controller()->cx2-20,887 o->controller()->cy1+5,1);886 main_screen->PutImage(cache.img(S_sneaky_image), o->controller()->cx2-20, 887 o->controller()->cy1+5,1); 888 888 } break; 889 889 } … … 1048 1048 main_screen->clear(); 1049 1049 image *im=cache.img(cache.reg("art/frame.spe","end_level_screen",SPEC_IMAGE,1)); 1050 im->put_image(main_screen,0,0);1050 main_screen->PutImage(im, 0, 0); 1051 1051 int x1=im->Size().x+1,y1=0,y2=main_screen->Size().y; 1052 1052 JCFont *fnt=wm->font(); -
abuse/trunk/src/dev.cpp
r643 r644 110 110 f->PutImage(screen, cache.img(id), vec2i(x, y)); 111 111 else 112 cache.img(id)->put_image(screen,x,y);112 screen->PutImage(cache.img(id), x, y); 113 113 } 114 114 virtual int width() { return cache.img(id)->Size().x; } … … 481 481 if (f->x-vx>=0 && f->x-vx<=(v->cx2-v->cx1+1) && f->y-vy>=0 && f->y-vy<=(v->cy2-v->cy1+1)) 482 482 { 483 image *im=cache.img(light_buttons[f->type]); 484 im->put_image(main_screen,f->x-vx+v->cx1-im->Size().x/2,f->y-vy+v->cy1-im->Size().y/2,1); 485 main_screen->rectangle(f->x1-vx+v->cx1,f->y1-vy+v->cy1,f->x2-vx+v->cx1,f->y2-vy+v->cy1, 486 wm->medium_color()); 483 image *im = cache.img(light_buttons[f->type]); 484 main_screen->PutImage(im, f->x - vx + v->cx1 - im->Size().x / 2, 485 f->y - vy + v->cy1 - im->Size().y / 2, 1); 486 main_screen->rectangle(f->x1 - vx + v->cx1, f->y1 - vy + v->cy1, 487 f->x2 - vx + v->cx1, f->y2 - vy + v->cy1, 488 wm->medium_color()); 487 489 } 488 490 } … … 599 601 tbw=wm->new_window(prop->getd("toolbar x",-1), 600 602 prop->getd("toolbar y",-1),-1,-1,tp); 601 tp->set_x(setx,tbw-> screen);603 tp->set_x(setx,tbw->m_surf); 602 604 } 603 605 } … … 758 760 music_window=wm->new_window(-1,30,0,0, 759 761 new pick_list(0,0,DEV_MUSIC_PICKLIST,10,song_list,total_songs,0,NULL)); 760 wm->fnt->put_string(music_window-> screen,0,1,"songs");762 wm->fnt->put_string(music_window->m_surf,0,1,"songs"); 761 763 } else 762 764 { … … 1225 1227 cur_fg=current_level->get_fg(x,y); 1226 1228 if (forew) 1227 ((tile_picker *)forew->read(DEV_FG_PICKER))->recenter(forew-> screen);1229 ((tile_picker *)forew->read(DEV_FG_PICKER))->recenter(forew->m_surf); 1228 1230 the_game->need_refresh(); 1229 1231 } … … 1249 1251 1250 1252 if (forew) 1251 ((tile_picker *)forew->read(DEV_FG_PICKER))->recenter(forew-> screen);1253 ((tile_picker *)forew->read(DEV_FG_PICKER))->recenter(forew->m_surf); 1252 1254 } 1253 1255 } … … 3010 3012 im->clear(); 3011 3013 the_game->get_fg(pat[i])->im->PutImage(im,vec2i(0,0)); 3012 scale_put(im,me-> screen,me->x1()+(i%w)*tw,3014 scale_put(im,me->m_surf,me->x1()+(i%w)*tw, 3013 3015 me->y1()+(i/w)*th,tw,th); 3014 3016 if (d==pat[i]) 3015 3017 { 3016 3018 find=i; 3017 me-> screen->rectangle(me->x1()+(i%w)*tw,3018 me->y1()+(i/w)*th,3019 me->x1()+(i%w)*tw+tw-1,3020 me->y1()+(i/w)*th+th-1,wm->bright_color());3019 me->m_surf->rectangle(me->x1()+(i%w)*tw, 3020 me->y1()+(i/w)*th, 3021 me->x1()+(i%w)*tw+tw-1, 3022 me->y1()+(i/w)*th+th-1,wm->bright_color()); 3021 3023 } 3022 3024 } … … 3057 3059 if (dev_cont->forew) 3058 3060 ((tile_picker *)dev_cont->forew-> 3059 read(DEV_FG_PICKER))->recenter(dev_cont->forew-> screen);3061 read(DEV_FG_PICKER))->recenter(dev_cont->forew->m_surf); 3060 3062 } 3061 3063 } else if (ev.mouse_button==2) -
abuse/trunk/src/endgame.cpp
r643 r644 238 238 if (i>=30 && i<=37) 239 239 { 240 cache.img(planet)->put_image(tcopy,0,0);240 tcopy->PutImage(cache.img(planet), 0, 0); 241 241 cache.fig(explo_frames1[i-30])->forward->PutImage(tcopy,vec2i(100,50)); 242 242 scan_map(main_screen,ex,ey,tcopy, … … 437 437 438 438 int dx=(xres+1)/2-im->Size().x/2,dy=(yres+1)/2-im->Size().y/2; 439 im->put_image(main_screen,dx,dy);439 main_screen->PutImage(im, dx, dy); 440 440 console_font->put_string(main_screen,xres/2+35,yres/2+100-console_font->height()-2, 441 441 lstring_value(to_be)); … … 451 451 for (i=0; i<320 && ev.type!=EV_KEY; i++) 452 452 { 453 im->put_image(main_screen,dx,dy);453 main_screen->PutImage(im, dx, dy); 454 454 console_font->put_string(main_screen,xres/2+35,yres/2+100-console_font->height()-2, 455 455 lstring_value(to_be)); … … 503 503 for (i=0; i<320 && ev.type!=EV_KEY; i++) 504 504 { 505 im->put_image(main_screen,dx,dy);505 main_screen->PutImage(im, dx, dy); 506 506 507 507 text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot),wm->font(),cmap,wm->bright_color()); -
abuse/trunk/src/game.cpp
r643 r644 476 476 int dx = 20, dy = 5; 477 477 image *jim = cache.img(joy_picts[but * 9+(y + 1)*3 + x + 1]); 478 joy_win-> screen->bar(dx, dy, dx + jim->Size().x+6, dy + jim->Size().y+6, wm->black());479 j im->put_image(joy_win->screen, dx + 3, dy + 3);478 joy_win->m_surf->bar(dx, dy, dx + jim->Size().x+6, dy + jim->Size().y+6, wm->black()); 479 joy_win->m_surf->PutImage(jim, dx + 3, dy + 3); 480 480 481 481 if(but) … … 605 605 main_screen->GetClip(cx1, cy1, cx2, cy2); 606 606 main_screen->SetClip(viewx1, viewy1, viewx2 + 1, viewy2 + 1); 607 im->put_image(main_screen, (x - xo / btile_width())*btile_width()+viewx1 - xo % btile_width(),607 main_screen->PutImage(im, (x - xo / btile_width())*btile_width()+viewx1 - xo % btile_width(), 608 608 (y - yo / btile_height())*btile_height()+viewy1 - yo % btile_height(), 0); 609 609 main_screen->SetClip(cx1, cy1, cx2, cy2); … … 720 720 main_screen->SetClip(v->cx1, v->cy1, v->cx2 + 1, v->cy2 + 1); 721 721 image *tit = cache.img(title_screen); 722 tit->put_image(main_screen, main_screen->Size().x/2 - tit->Size().x/2,722 main_screen->PutImage(tit, main_screen->Size().x/2 - tit->Size().x/2, 723 723 main_screen->Size().y/2 - tit->Size().y/2); 724 724 if(state == SCENE_STATE) … … 828 828 else bt = get_bg(0); 829 829 830 bt->im->put_image(main_screen, draw_x, draw_y);830 main_screen->PutImage(bt->im, draw_x, draw_y); 831 831 // if(!(dev & EDIT_MODE) && bt->next) 832 832 // current_level->put_bg(x, y, bt->next); … … 1079 1079 dev_cont->dev_draw(v); 1080 1080 if(cache.in_use()) 1081 cache.img(vmm_image)->put_image(main_screen, v->cx1, v->cy2 - cache.img(vmm_image)->Size().y+1);1081 main_screen->PutImage(cache.img(vmm_image), v->cx1, v->cy2 - cache.img(vmm_image)->Size().y+1); 1082 1082 1083 1083 if(dev & DRAW_LIGHTS) … … 1172 1172 { 1173 1173 main_screen->clear(); 1174 im->put_image(main_screen, (xres + 1) / 2 - im->Size().x / 2,1175 (yres + 1) / 2 - im->Size().y / 2);1174 main_screen->PutImage(im, (xres + 1) / 2 - im->Size().x / 2, 1175 (yres + 1) / 2 - im->Size().y / 2); 1176 1176 } 1177 1177 … … 1272 1272 1273 1273 int dx = (xres + 1) / 2 - gray->Size().x / 2, dy = (yres + 1) / 2 - gray->Size().y / 2; 1274 gray->put_image(main_screen, dx, dy);1275 smoke[0]->put_image(main_screen, dx + 24, dy + 5);1274 main_screen->PutImage(gray, dx, dy); 1275 main_screen->PutImage(smoke[0], dx + 24, dy + 5); 1276 1276 1277 1277 fade_in(NULL, 16); … … 1293 1293 break; 1294 1294 1295 gray->put_image(main_screen, dx, dy);1296 smoke[i % 5]->put_image(main_screen, dx + 24, dy + 5);1295 main_screen->PutImage(gray, dx, dy); 1296 main_screen->PutImage(smoke[i % 5], dx + 24, dy + 5); 1297 1297 text_draw(205 - i, dx + 15, dy, dx + 320 - 15, dy + 199, str, wm->font(), cmap, wm->bright_color()); 1298 1298 wm->flush_screen(); … … 1500 1500 { 1501 1501 image *tit = cache.img(title_screen); 1502 tit->put_image(main_screen, main_screen->Size().x/2 - tit->Size().x/2,1503 main_screen->Size().y/2 - tit->Size().y/2);1502 main_screen->PutImage(tit, main_screen->Size().x/2 - tit->Size().x/2, 1503 main_screen->Size().y/2 - tit->Size().y/2); 1504 1504 } 1505 1505 set_state(MENU_STATE); // then go to menu state so windows will turn off … … 1573 1573 { 1574 1574 for(view *f = first_view; f; f = f->next) 1575 cache.img(pause_image)->put_image(main_screen, (f->cx1 + f->cx2)/2 - cache.img(pause_image)->Size().x/2,1575 main_screen->PutImage(cache.img(pause_image), (f->cx1 + f->cx2)/2 - cache.img(pause_image)->Size().x/2, 1576 1576 f->cy1 + 5, 1); 1577 1577 } … … 1897 1897 ((button *)ev.message.data)->push(); 1898 1898 /* volume_window->inm->redraw(); 1899 draw_value(volume_window-> screen, 2, 43,1899 draw_value(volume_window->m_surf, 2, 43, 1900 1900 (volume_window->x2()-volume_window->x1()-1), 8, sfx_volume, 127); 1901 draw_value(volume_window-> screen, 2, 94,1901 draw_value(volume_window->m_surf, 2, 94, 1902 1902 (volume_window->x2()-volume_window->x1()-1), 8, music_volume, 127); 1903 1903 */ -
abuse/trunk/src/gui.cpp
r643 r644 88 88 void ico_button::draw(int active, image *screen) 89 89 { 90 int x1,y1,x2,y2;91 area(x1,y1,x2,y2);90 int x1, y1, x2, y2; 91 area(x1, y1, x2, y2); 92 92 93 if (active!=act && activate_id!=-1 && active)94 wm->Push(new Event(activate_id,NULL));93 if (active != act && activate_id != -1 && active) 94 wm->Push(new Event(activate_id, NULL)); 95 95 96 if (up && !active) 97 cache.img(u)->put_image(screen,x1,y1); 98 else if (up && active) 99 cache.img(ua)->put_image(screen,x1,y1); 100 else if (!up && !active) 101 cache.img(d)->put_image(screen,x1,y1); 102 else cache.img(da)->put_image(screen,x1,y1); 96 screen->PutImage(cache.img((up && !active) ? u : 97 (up && active) ? ua : 98 (!up && !active) ? d : da), x1, y1); 103 99 104 if (act!=active && active && activate_id!=-1)105 wm->Push(new Event(activate_id,NULL));106 act=active;100 if (act != active && active && activate_id != -1) 101 wm->Push(new Event(activate_id, NULL)); 102 act = active; 107 103 108 if (active && key[0]) 109 { 110 int g=80; 111 screen->bar(0,0,144,20,0); 112 wm->font()->put_string(screen,0,0,symbol_str(key),color_table->Lookup(g>>3,g>>3,g>>3)); 113 } else if (!active && key[0]) 114 { 115 screen->bar(0,0,144,20,0); 116 } 117 104 if (active && key[0]) 105 { 106 int g=80; 107 screen->bar(0, 0, 144, 20, 0); 108 wm->font()->put_string(screen, 0, 0, symbol_str(key), 109 color_table->Lookup(g>>3, g>>3, g>>3)); 110 } 111 else if (!active && key[0]) 112 { 113 screen->bar(0, 0, 144, 20, 0); 114 } 118 115 } 119 116 -
abuse/trunk/src/help.cpp
r643 r644 31 31 int x1=xres/2-im->Size().x/2,y1=yres/2-im->Size().y/2; 32 32 int x2=x1+im->Size().x,y2=y1+im->Size().y; 33 im->put_image(main_screen,x1,y1);33 main_screen->PutImage(im, x1, y1); 34 34 main_screen->bar(0,0,x1-1,yres,0); 35 35 main_screen->bar(0,0,xres,y1-1,0); -
abuse/trunk/src/imlib/fonts.cpp
r555 r644 28 28 void texture_font::put_char(image *screen, int x, int y, char ch) 29 29 { if (fntpat) 30 fntpat->put_part_masked(screen,let, x,y,30 screen->PutPartMasked(fntpat, let, x,y, 31 31 ((int)ch%32)*tl,((int)ch/32)*th,0,0,tl-1,th-1); 32 else let->put_part(screen,x,y,((int)ch%32)*tl,((int)ch/32)*th,33 ((int)ch%32)*tl+tl-1, ((int)ch/32)*th+th-1,1);32 else screen->PutPart(let, x, y, ((int)ch%32)*tl, ((int)ch/32)*th, 33 ((int)ch%32)*tl+tl-1, ((int)ch/32)*th+th-1, 1); 34 34 } 35 35 … … 74 74 { 75 75 tmp.clear(); 76 letters->put_part(&tmp,0,0,((int)ch%32)*tl,((int)ch/32)*th,77 ((int)ch%32)*tl+tl-1,((int)ch/32)*th+th-1,1);78 let[ch] =new TransImage(&tmp,"JCfont");76 tmp.PutPart(letters, 0, 0, ((int)ch%32)*tl, ((int)ch/32)*th, 77 ((int)ch%32)*tl+tl-1, ((int)ch/32)*th+th-1, 1); 78 let[ch] = new TransImage(&tmp, "JCfont"); 79 79 } 80 80 } -
abuse/trunk/src/imlib/guistat.cpp
r555 r644 59 59 long h=wm->font()->height(); 60 60 61 whom->stat_win-> screen->bar(whom->stat_win->x1()+1,whom->stat_win->y2()-h-1,whom->stat_win->x2()-1,61 whom->stat_win->m_surf->bar(whom->stat_win->x1()+1,whom->stat_win->y2()-h-1,whom->stat_win->x2()-1, 62 62 whom->stat_win->y2()-1,wm->black()); 63 whom->stat_win-> screen->bar(whom->stat_win->x1()+2,whom->stat_win->y2()-h,whom->stat_win->x2()-2,63 whom->stat_win->m_surf->bar(whom->stat_win->x1()+2,whom->stat_win->y2()-h,whom->stat_win->x2()-2, 64 64 whom->stat_win->y2()-2,wm->dark_color()); 65 65 if (perc) 66 whom->stat_win-> screen->bar(whom->stat_win->x1()+3,whom->stat_win->y2()-h+1,66 whom->stat_win->m_surf->bar(whom->stat_win->x1()+3,whom->stat_win->y2()-h+1, 67 67 whom->stat_win->x1()+l*perc/100, 68 68 whom->stat_win->y2()-3,wm->bright_color()); … … 106 106 int my = first->stat_win->y1() + wm->font()->height() / 2; 107 107 first->stat_win=wm->new_window(wx, wy, len3, h1*2+h2, NULL, "status"); 108 wm->font()->put_string(first->stat_win-> screen, mx, my, first->name, wm->black());109 wm->font()->put_string(first->stat_win-> screen, mx, my, first->name, wm->bright_color());108 wm->font()->put_string(first->stat_win->m_surf, mx, my, first->name, wm->black()); 109 wm->font()->put_string(first->stat_win->m_surf, mx, my, first->name, wm->bright_color()); 110 110 if (first->show) 111 first->show->draw(first->stat_win-> screen, (first->stat_win->x2()-first->stat_win->x1())/2-111 first->show->draw(first->stat_win->m_surf, (first->stat_win->x2()-first->stat_win->x1())/2- 112 112 first->show->width()/2, my+h1, NULL); 113 113 -
abuse/trunk/src/imlib/image.cpp
r555 r644 319 319 320 320 321 void image:: put_image(image *screen, int16_t x, int16_t y, char transparent)321 void image::PutImage(image *im, int16_t x, int16_t y, char transparent) 322 322 { 323 323 int16_t i, j, xl, yl; … … 325 325 326 326 // the screen is clipped then we only want to put part of the image 327 if( screen->m_special)328 { 329 put_part(screen, x, y, 0, 0, m_size.x-1,m_size.y-1, transparent);327 if(m_special) 328 { 329 PutPart(im, x, y, 0, 0, im->m_size.x-1, im->m_size.y-1, transparent); 330 330 return; 331 331 } 332 332 333 if(x < screen->Size().x && y < screen->Size().y)334 { 335 xl = m_size.x;336 if(x + xl > screen->Size().x) // clip to the border of the screen337 xl = screen->Size().x - x;338 yl = m_size.y;339 if(y + yl > screen->Size().y)340 yl = screen->Size().y - y;333 if(x < m_size.x && y < m_size.y) 334 { 335 xl = im->m_size.x; 336 if(x + xl > m_size.x) // clip to the border of the screen 337 xl = m_size.x - x; 338 yl = im->m_size.y; 339 if(y + yl > m_size.y) 340 yl = m_size.y - y; 341 341 342 342 int startx = 0, starty = 0; … … 355 355 return; 356 356 357 screen->AddDirty(x, y, x + xl, y + yl); 358 screen->Lock(); 357 AddDirty(x, y, x + xl, y + yl); 359 358 Lock(); 359 im->Lock(); 360 360 for(j = starty; j < yl; j++, y++) 361 361 { 362 pg1 = sc reen->scan_line(y);363 pg2 = scan_line(j);362 pg1 = scan_line(y); 363 pg2 = im->scan_line(j); 364 364 if(transparent) 365 365 { … … 375 375 memcpy(&pg1[x], pg2, xl); // straight copy 376 376 } 377 im->Unlock(); 377 378 Unlock(); 378 screen->Unlock();379 379 } 380 380 } … … 434 434 435 435 436 void image:: put_part(image *screen, int16_t x, int16_t y,437 int16_t x1, int16_t y1,int16_t x2, int16_t y2, char transparent)436 void image::PutPart(image *im, int16_t x, int16_t y, int16_t x1, int16_t y1, 437 int16_t x2, int16_t y2, char transparent) 438 438 { 439 439 int16_t xlen, ylen, j, i; … … 442 442 443 443 int cx1, cy1, cx2, cy2; 444 screen->GetClip(cx1, cy1, cx2, cy2); 445 444 GetClip(cx1, cy1, cx2, cy2); 446 445 447 446 // see if the are to be put is outside of actual image, if so adjust … … 449 448 if (x1<0) { x+=-x1; x1=0; } 450 449 if (y1<0) { y+=-y1; y1=0; } 451 if (x2>= m_size.x) x2=m_size.x-1;452 if (y2>= m_size.y) y2=m_size.y-1;450 if (x2>=im->m_size.x) x2=im->m_size.x-1; 451 if (y2>=im->m_size.y) y2=im->m_size.y-1; 453 452 if (x1>x2 || y1>y2) return ; // return if it was adjusted so that nothing will be put 454 455 453 456 454 // see if the image gets clipped off the screen 457 455 if (x >= cx2 || y >= cy2 || x + (x2 - x1) < cx1 || y + (y2 - y1) < cy1) 458 456 return ; 459 460 457 461 458 if (x<cx1) … … 471 468 if (x1>x2 || y1>y2) return ; 472 469 473 474 475 476 470 xlen=x2-x1+1; 477 471 ylen=y2-y1+1; 478 472 479 screen->AddDirty(x, y, x + xlen, y + ylen); 480 481 screen->Lock(); 473 AddDirty(x, y, x + xlen, y + ylen); 474 482 475 Lock(); 483 pg1=screen->scan_line(y); 484 pg2=scan_line(y1); 476 im->Lock(); 477 pg1 = scan_line(y); 478 pg2 = im->scan_line(y1); 485 479 486 480 if (transparent) … … 490 484 for (i=0, source=&pg2[x1], dest=&pg1[x]; i<xlen; i++, source++, dest++) 491 485 if (*source) *dest=*source; 492 pg1= screen->next_line(y+j, pg1);493 pg2= next_line(y1+j, pg2);486 pg1=next_line(y+j, pg1); 487 pg2=im->next_line(y1+j, pg2); 494 488 } 495 489 } … … 498 492 { 499 493 memcpy(&pg1[x], &pg2[x1], xlen); // strait copy 500 pg1=screen->next_line(y+j, pg1); 501 pg2=next_line(y1+j, pg2); 502 } 494 pg1 = next_line(y+j, pg1); 495 pg2 = im->next_line(y1+j, pg2); 496 } 497 im->Unlock(); 503 498 Unlock(); 504 screen->Unlock(); 505 } 506 507 void image::put_part_xrev(image *screen, int16_t x, int16_t y, 508 int16_t x1, int16_t y1, int16_t x2, int16_t y2, char transparent) 499 } 500 501 void image::PutPartXrev(image *im, int16_t x, int16_t y, int16_t x1, 502 int16_t y1, int16_t x2, int16_t y2, char transparent) 509 503 { 510 504 int16_t xl, yl, j, i; … … 512 506 CHECK(x1<=x2 && y1<=y2); 513 507 514 i=x1; x1= m_size.x-x2-1; // reverse the x locations515 x2= m_size.x-i-1;508 i=x1; x1=im->m_size.x-x2-1; // reverse the x locations 509 x2=im->m_size.x-i-1; 516 510 517 511 if (x1<0) … … 520 514 { y-=y1; y1=0; } 521 515 522 if ( screen->m_special)516 if (m_special) 523 517 { 524 518 int cx1, cy1, cx2, cy2; 525 screen->m_special->GetClip(cx1, cy1, cx2, cy2);519 m_special->GetClip(cx1, cy1, cx2, cy2); 526 520 // FIXME: don't we need < cx1 instead of < 0 here? 527 521 if (x >= cx2 || y >= cy2 || x + (x2 - x1) < 0 || y + (y2 - y1) < 0) … … 536 530 { y2 = cy2 - 1 - y + y1; } 537 531 } 538 else if (x >screen->Size().x || y>screen->Size().y || x+x2<0 || y+y2<0)532 else if (x > m_size.x || y > m_size.y || x+x2<0 || y+y2<0) 539 533 return ; 540 534 541 if (x< screen->Size().x && y<screen->Size().y && x1<m_size.x && y1<m_size.y &&535 if (x<m_size.x && y<m_size.y && x1<im->m_size.x && y1<im->m_size.y && 542 536 x1<=x2 && y1<=y2) 543 537 { 544 if (x2>= m_size.x)545 x2= m_size.x-1;546 if (y2>= m_size.y)547 y2= m_size.y-1;538 if (x2>=im->m_size.x) 539 x2=im->m_size.x-1; 540 if (y2>=im->m_size.y) 541 y2=im->m_size.y-1; 548 542 xl=x2-x1+1; 549 if (x+xl> screen->Size().x)550 xl= screen->Size().x-x;543 if (x+xl>m_size.x) 544 xl=m_size.x-x; 551 545 yl=y2-y1+1; 552 if (y+yl>screen->Size().y) 553 yl=screen->Size().y-y; 554 screen->AddDirty(x, y, x + xl, y + yl); 555 screen->Lock(); 546 if (y+yl>m_size.y) 547 yl=m_size.y-y; 548 AddDirty(x, y, x + xl, y + yl); 556 549 Lock(); 550 im->Lock(); 557 551 for (j=0; j<yl; j++) 558 552 { 559 pg1=sc reen->scan_line(y+j);560 pg2= scan_line(y1+j);553 pg1=scan_line(y+j); 554 pg2=im->scan_line(y1+j); 561 555 if (transparent) 562 556 { … … 569 563 } 570 564 Unlock(); 571 screen->Unlock(); 572 } 573 } 574 575 576 void image::put_part_masked(image *screen, image *mask, int16_t x, int16_t y, 577 int16_t maskx, int16_t masky, 578 int16_t x1, int16_t y1, int16_t x2, int16_t y2) 565 im->Unlock(); 566 } 567 } 568 569 void image::PutPartMasked(image *im, image *mask, int16_t x, int16_t y, 570 int16_t maskx, int16_t masky, 571 int16_t x1, int16_t y1, int16_t x2, int16_t y2) 579 572 { 580 573 int16_t xl, yl, j, i, ml, mh; … … 582 575 CHECK(x1<=x2 && y1<=y2); 583 576 584 if ( screen->m_special)577 if (m_special) 585 578 { 586 579 int cx1, cy1, cx2, cy2; 587 screen->m_special->GetClip(cx1, cy1, cx2, cy2);580 m_special->GetClip(cx1, cy1, cx2, cy2); 588 581 if (x >= cx2 || y >= cy2 || x+(x2-x1)<0 || y+(y2-y1)<0) return ; 589 582 if (x<cx1) … … 596 589 { y2 = cy2 - 1 + y1 - y; } 597 590 } 598 else if (x> screen->Size().x || y>screen->Size().y || x+x1<0 || y+y1<0)591 else if (x>m_size.x || y>m_size.y || x+x1<0 || y+y1<0) 599 592 return ; 600 593 601 594 ml=mask->Size().x; 602 595 mh=mask->Size().y; 603 if (x< screen->Size().x && y<screen->Size().y && x1<m_size.x && y1<m_size.y &&596 if (x<m_size.x && y<m_size.y && x1<im->m_size.x && y1<im->m_size.y && 604 597 maskx<ml && masky<mh && x1<=x2 && y1<=y2) 605 598 { 606 599 607 if (x2>= m_size.x)608 x2= m_size.x-1;609 if (y2>= m_size.y)610 y2= m_size.y-1;600 if (x2>=im->m_size.x) 601 x2=im->m_size.x-1; 602 if (y2>=im->m_size.y) 603 y2=im->m_size.y-1; 611 604 xl=x2-x1+1; 612 if (x+xl> screen->Size().x)613 xl= screen->Size().x-x-1;605 if (x+xl>m_size.x) 606 xl=m_size.x-x-1; 614 607 yl=y2-y1+1; 615 if (y+yl> screen->Size().y)616 yl= screen->Size().y-y-1;617 screen->AddDirty(x, y, x + xl, y + yl);618 screen->Lock();608 if (y+yl>m_size.y) 609 yl=m_size.y-y-1; 610 AddDirty(x, y, x + xl, y + yl); 611 Lock(); 619 612 mask->Lock(); 620 Lock();613 im->Lock(); 621 614 for (j=0; j<yl; j++) 622 615 { 623 pg1=sc reen->scan_line(y+j);624 pg2= scan_line(y1+j);616 pg1=scan_line(y+j); 617 pg2=im->scan_line(y1+j); 625 618 pg3=mask->scan_line(masky++); 626 619 if (masky>=mh) // wrap the mask around if out of bounds … … 634 627 } 635 628 } 629 im->Unlock(); 630 mask->Unlock(); 636 631 Unlock(); 637 mask->Unlock();638 screen->Unlock();639 632 } 640 633 } -
abuse/trunk/src/imlib/image.h
r555 r644 119 119 void fill_image(image *screen, int16_t x1, int16_t y1, 120 120 int16_t x2, int16_t y2, int16_t align = 1); 121 void put_image(image *screen, int16_t x, int16_t y, char transparent = 0);122 void put_part(image *screen, int16_t x, int16_t y, int16_t x1, int16_t y1,123 124 void put_part_xrev(image *screen, int16_t x, int16_t y,125 126 127 void put_part_masked(image *screen, image *mask, int16_t x, int16_t y,128 129 121 void PutImage(image *screen, int16_t x, int16_t y, char transparent = 0); 122 void PutPart(image *screen, int16_t x, int16_t y, int16_t x1, int16_t y1, 123 int16_t x2, int16_t y2, char transparent = 0); 124 void PutPartXrev(image *screen, int16_t x, int16_t y, 125 int16_t x1, int16_t y1, int16_t x2, int16_t y2, 126 char transparent = 0); 127 void PutPartMasked(image *screen, image *mask, int16_t x, int16_t y, 128 int16_t maskx, int16_t masky, int16_t x1, int16_t y1, 129 int16_t x2, int16_t y2); 130 130 image *copy_part_dithered(int16_t x1, int16_t y1, int16_t x2, int16_t y2); 131 131 void bar(int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint8_t color); -
abuse/trunk/src/imlib/input.cpp
r643 r644 392 392 { 393 393 if (!active) 394 visual->put_image(screen,x,y);394 screen->PutImage(visual, x, y); 395 395 else 396 pressed->put_image(screen,x,y);397 } else act_pict->put_image(screen,x,y);396 screen->PutImage(pressed, x, y); 397 } else screen->PutImage(act_pict, x, y); 398 398 } 399 399 else … … 425 425 wm->font()->put_string(screen,x+3,y+4,text); 426 426 } 427 else visual->put_image(screen,x+3,y+3,1);427 else screen->PutImage(visual, x + 3, y + 3, 1); 428 428 } else 429 429 { … … 434 434 screen->bar(x1+1,y1+1,x2-1,y2-1,wm->medium_color()); 435 435 if (visual) 436 visual->put_image(screen,x1+3,y1+3,1);436 screen->PutImage(visual, x1 + 3, y1 + 3, 1); 437 437 else 438 438 { -
abuse/trunk/src/imlib/jwindow.cpp
r643 r644 72 72 { 73 73 p->hide(); 74 m_s creen->AddDirty(p->x, p->y, p->x + p->l, p->y + p->h);74 m_surf->AddDirty(p->x, p->y, p->x + p->l, p->y + p->h); 75 75 } 76 76 } … … 93 93 Jwindow *k; 94 94 for (k = first; k->next != j; k = k->next) 95 k-> screen->AddDirty(j->x - k->x, j->y - k->y,96 j->x + j->l - k->x, j->y + j->h - k->y);97 k-> screen->AddDirty(j->x - k->x, j->y - k->y,98 j->x + j->l - k->x, j->y + j->h - k->y);95 k->m_surf->AddDirty(j->x - k->x, j->y - k->y, 96 j->x + j->l - k->x, j->y + j->h - k->y); 97 k->m_surf->AddDirty(j->x - k->x, j->y - k->y, 98 j->x + j->l - k->x, j->y + j->h - k->y); 99 99 k->next = j->next; 100 100 } 101 m_s creen->AddDirty(j->x, j->y, j->x + j->l, j->y + j->h);101 m_surf->AddDirty(j->x, j->y, j->x + j->l, j->y + j->h); 102 102 j->hide(); 103 103 } … … 108 108 { 109 109 j->show(); 110 j-> screen->AddDirty(0, 0, j->l, j->h);110 j->m_surf->AddDirty(0, 0, j->l, j->h); 111 111 } 112 112 } … … 180 180 { 181 181 Jwindow *j=ev.window; 182 /* m_s creen->AddDirty(j->x,j->y,j->x+j->l,j->y+j->h);182 /* m_surf->AddDirty(j->x,j->y,j->x+j->l,j->y+j->h); 183 183 for (p=first; p!=j; p=p->next) 184 p-> screen->AddDirty(j->x-p->x,j->y-p->y,j->x+j->l-p->x,j->y+j->h-p->y); */185 j-> screen->AddDirty(0, 0, j->l, j->h);184 p->m_surf->AddDirty(j->x-p->x,j->y-p->y,j->x+j->l-p->x,j->y+j->h-p->y); */ 185 j->m_surf->AddDirty(0, 0, j->l, j->h); 186 186 flush_screen(); 187 187 } … … 214 214 { 215 215 for (Jwindow *j = first; j; j = j->next) 216 j-> screen->AddDirty(ev.redraw.x1 - j->x, ev.redraw.y1 - j->y,217 ev.redraw.x2 + 1 - j->x, ev.redraw.y2 + 1 - j->y);218 m_s creen->AddDirty(ev.redraw.x1, ev.redraw.y1, ev.redraw.x2 + 1, ev.redraw.y2 + 1);216 j->m_surf->AddDirty(ev.redraw.x1 - j->x, ev.redraw.y1 - j->y, 217 ev.redraw.x2 + 1 - j->x, ev.redraw.y2 + 1 - j->y); 218 m_surf->AddDirty(ev.redraw.x1, ev.redraw.y1, ev.redraw.x2 + 1, ev.redraw.y2 + 1); 219 219 flush_screen(); 220 220 ev.type=EV_SPURIOUS; // we took care of this one by ourselves. … … 224 224 void Jwindow::resize(int L, int H) 225 225 { 226 screen->SetSize(vec2i(L,H));226 m_surf->SetSize(vec2i(L,H)); 227 227 l=L; h=H; 228 228 } … … 231 231 { 232 232 Jwindow *p; 233 m_s creen->AddDirty(j->x, j->y, j->x + j->l, j->y + j->h);233 m_surf->AddDirty(j->x, j->y, j->x + j->l, j->y + j->h); 234 234 for (p=first; p!=j; p=p->next) 235 p-> screen->AddDirty(j->x - p->x, j->y - p->y, j->x + j->l - p->x, j->y + j->h - p->y);235 p->m_surf->AddDirty(j->x - p->x, j->y - p->y, j->x + j->l - p->x, j->y + j->h - p->y); 236 236 j->resize(l,h); 237 237 if (!frame_suppress) … … 241 241 void WindowManager::move_window(Jwindow *j, int x, int y) 242 242 { 243 m_s creen->AddDirty(j->x, j->y, j->x + j->l, j->y + j->h);243 m_surf->AddDirty(j->x, j->y, j->x + j->l, j->y + j->h); 244 244 for(Jwindow *p = first; p != j; p = p->next) 245 p-> screen->AddDirty(j->x - p->x, j->y - p->y,246 j->x + j->l - p->x, j->y + j->h - p->y);245 p->m_surf->AddDirty(j->x - p->x, j->y - p->y, 246 j->x + j->l - p->x, j->y + j->h - p->y); 247 247 j->x = x; 248 248 j->y = y; 249 j-> screen->AddDirty(0, 0, j->l, j->h);249 j->m_surf->AddDirty(0, 0, j->l, j->h); 250 250 } 251 251 … … 255 255 { 256 256 wm = this; 257 m_s creen= screen;257 m_surf = screen; 258 258 hi = Hi; low = Low; med = Med; first = NULL; m_pal = pal; grab = NULL; 259 259 bk = pal->find_closest(0, 0, 0); … … 299 299 Jwindow * search; 300 300 for(search = first; search->next != win; search = search->next) 301 search-> screen->AddDirty(win->x - search->x,302 win->y - search->y,303 win->x + win->l - search->x,304 win->y + win->h - search->y);305 search-> screen->AddDirty(win->x - search->x, win->y - search->y,306 win->x + win->l - search->x,307 win->y + win->h - search->y);301 search->m_surf->AddDirty(win->x - search->x, 302 win->y - search->y, 303 win->x + win->l - search->x, 304 win->y + win->h - search->y); 305 search->m_surf->AddDirty(win->x - search->x, win->y - search->y, 306 win->x + win->l - search->x, 307 win->y + win->h - search->y); 308 308 search->next = win->next; 309 309 } 310 310 311 m_s creen->AddDirty(win->x, win->y, win->x + win->l, win->y + win->h);311 m_surf->AddDirty(win->x, win->y, win->x + win->l, win->y + win->h); 312 312 } 313 313 … … 315 315 ifield * fields, char const *name) 316 316 { 317 if(x > m_s creen->Size().x - 4)318 x = m_s creen->Size().x - 25;319 if(y > m_s creen->Size().y - 4)320 y = m_s creen->Size().y - 10;317 if(x > m_surf->Size().x - 4) 318 x = m_surf->Size().x - 25; 319 if(y > m_surf->Size().y - 4) 320 y = m_surf->Size().y - 10; 321 321 322 322 Jwindow * j = new Jwindow (x, y, l, h, fields, name); … … 340 340 my = mouse->drawy(); 341 341 342 m _screen->put_part(mouse_save, 0, 0, mx, my,343 mx + mouse_pic->Size().x - 1,344 my + mouse_pic->Size().y - 1);345 m ouse_pic->put_image(m_screen, mx, my, 1);342 mouse_save->PutPart(m_surf, 0, 0, mx, my, 343 mx + mouse_pic->Size().x - 1, 344 my + mouse_pic->Size().y - 1); 345 m_surf->PutImage(mouse_pic, mx, my, 1); 346 346 } 347 347 348 348 for(p = first; p; p = p->next) 349 349 if(!p->is_hidden()) 350 m_s creen->delete_dirty(p->x, p->y, p->x + p->l, p->y + p->h);351 update_dirty(m_s creen);350 m_surf->delete_dirty(p->x, p->y, p->x + p->l, p->y + p->h); 351 update_dirty(m_surf); 352 352 353 353 if(has_mouse()) 354 m ouse_save->put_image(m_screen, mx, my);354 m_surf->PutImage(mouse_save, mx, my); 355 355 356 356 for(p = first; p; p = p->next) … … 361 361 if(has_mouse()) 362 362 { 363 p->screen->put_part(mouse_save, 0, 0, mx - p->x, my - p->y,363 mouse_save->PutPart(p->m_surf, 0, 0, mx - p->x, my - p->y, 364 364 mx - p->x + mouse_pic->Size().x - 1, 365 365 my - p->y + mouse_pic->Size().y - 1); 366 if(has_mouse()) 367 mouse_pic->put_image(p->screen, mx - p->x, my - p->y, 1); 366 p->m_surf->PutImage(mouse_pic, mx - p->x, my - p->y, 1); 368 367 } 369 368 370 // m_s creen->delete_dirty(p->x, p->y, p->x+p->l, p->y+p->h);369 // m_surf->delete_dirty(p->x, p->y, p->x+p->l, p->y+p->h); 371 370 for(q = p->next; q; q = q->next) 372 371 if(!q->is_hidden()) 373 p->screen->delete_dirty(q->x - p->x, q->y - p->y, 374 q->x + q->l - p->x, q->y + q->h - p->y); 375 update_dirty(p->screen, p->x, p->y); 372 p->m_surf->delete_dirty(q->x - p->x, q->y - p->y, 373 q->x + q->l - p->x, 374 q->y + q->h - p->y); 375 update_dirty(p->m_surf, p->x, p->y); 376 376 if(has_mouse()) 377 mouse_save->put_image(p->screen, mx - p->x, my - p->y, 0);377 p->m_surf->PutImage(mouse_save, mx - p->x, my - p->y, 0); 378 378 } 379 379 } … … 392 392 reconfigure(); 393 393 394 screen= NULL;394 m_surf = NULL; 395 395 next = NULL; 396 396 … … 411 411 _y1 = name ? top_border() : jw_top + 5; 412 412 413 screen= NULL;414 inm = new InputManager( screen, f);413 m_surf = NULL; 414 inm = new InputManager(m_surf, f); 415 415 reconfigure(); /* FIXME: TODO */ 416 416 … … 433 433 if(h < top_border() + bottom_border()) 434 434 h = top_border() + bottom_border(); 435 screen= new image(vec2i(l, h), NULL, 2);436 screen->clear(backg);435 m_surf = new image(vec2i(l, h), NULL, 2); 436 m_surf->clear(backg); 437 437 // Keep this from getting destroyed when image list is cleared 438 image_list.unlink( screen);439 inm-> screen = screen;438 image_list.unlink(m_surf); 439 inm->m_surf = m_surf; 440 440 441 441 next = NULL; … … 454 454 wm->remove_window(this); 455 455 local_close(); 456 if(screen) 457 delete screen; 456 delete m_surf; 458 457 delete inm; 459 458 if(_name) … … 494 493 if (right_border() >= 1) 495 494 { 496 screen->widget_bar (0, 0, l - 1, h - 1, hi, med, low);495 m_surf->widget_bar (0, 0, l - 1, h - 1, hi, med, low); 497 496 if (right_border() >= 3) 498 screen->widget_bar (right_border() - 1, top_border() - 1, 497 m_surf->widget_bar(right_border() - 1, top_border() - 1, 498 l - left_border(), h - bottom_border(), 499 low, med, hi); 500 501 else 502 m_surf->line (left_border() - 1, top_border() - 1, 503 right_border() - 1, top_border() - 1, low); 504 } 505 m_surf->rectangle (2, 2, top_border() - 2, top_border() - 3, 506 wm->black ()); 507 m_surf->widget_bar (3, 3, top_border() - 3, top_border() - 4, hi, med, low); // draws the 'close' button 508 } 509 510 else 511 { 512 if (right_border() >= 1) 513 { 514 m_surf->widget_bar (0, 0, l - 1, h - 1, hi, med, low); 515 if (right_border() >= 3) 516 m_surf->widget_bar (right_border() - 1, jw_top + 4, 499 517 l - left_border(), h - bottom_border(), low, 500 518 med, hi); 501 519 502 520 else 503 screen->line (left_border() - 1, top_border() - 1, 504 right_border() - 1, top_border() - 1, low); 505 } 506 screen->rectangle (2, 2, top_border() - 2, top_border() - 3, 507 wm->black ()); 508 screen->widget_bar (3, 3, top_border() - 3, top_border() - 4, hi, med, low); // draws the 'close' button 509 } 510 511 else 512 { 513 if (right_border() >= 1) 514 { 515 screen->widget_bar (0, 0, l - 1, h - 1, hi, med, low); 516 if (right_border() >= 3) 517 screen->widget_bar (right_border() - 1, jw_top + 4, 518 l - left_border(), h - bottom_border(), low, 519 med, hi); 520 521 else 522 screen->line (left_border() - 1, jw_top + 4, right_border() - 1, 521 m_surf->line (left_border() - 1, jw_top + 4, right_border() - 1, 523 522 jw_top + 4, low); 524 523 } 525 screen->rectangle (1, 1, 4, 4, wm->black ());526 screen->widget_bar (2, 2, 3, 3, hi, med, low); // draws the 'close' button524 m_surf->rectangle (1, 1, 4, 4, wm->black ()); 525 m_surf->widget_bar (2, 2, 3, 3, hi, med, low); // draws the 'close' button 527 526 } 528 527 if (_name && _name[0]) 529 528 { 530 screen->bar (top_border(), 1,529 m_surf->bar (top_border(), 1, 531 530 top_border() + fnt->width() * strlen (_name) + 1, 532 531 top_border() - 2, med); 533 fnt->put_string ( screen, top_border() + 1, 1, _name, low);534 } 535 screen->bar (x1 (), y1 (), x2 (), y2 (), backg); // clear 'client' region532 fnt->put_string (m_surf, top_border() + 1, 1, _name, low); 533 } 534 m_surf->bar (x1 (), y1 (), x2 (), y2 (), backg); // clear 'client' region 536 535 inm->redraw (); 537 536 } … … 591 590 { 592 591 if(owner) 593 screen = owner->screen;592 m_surf = owner->m_surf; 594 593 if(active) 595 active->draw(0, screen);594 active->draw(0, m_surf); 596 595 active = NULL; 597 596 } … … 603 602 604 603 if(owner) 605 screen = owner->screen;604 m_surf = owner->m_surf; 606 605 607 606 if (j) … … 626 625 { 627 626 if (active) 628 active->draw(0, screen);627 active->draw(0,m_surf); 629 628 630 629 active=in_area; 631 630 632 631 if (active) 633 active->draw(1, screen);632 active->draw(1,m_surf); 634 633 } 635 634 } 636 635 if (ev.type==EV_KEY && ev.key==JK_TAB && active) 637 636 { 638 active->draw(0, screen);637 active->draw(0,m_surf); 639 638 do 640 639 { … … 642 641 if (!active) active=first; 643 642 } while (active && !active->selectable()); 644 active->draw(1, screen);643 active->draw(1,m_surf); 645 644 } 646 645 } else active=grab; … … 649 648 { 650 649 if (ev.type!=EV_MOUSE_MOVE && ev.type!=EV_MOUSE_BUTTON) 651 active->handle_event(ev, screen,this);650 active->handle_event(ev,m_surf,this); 652 651 else 653 652 { … … 657 656 { 658 657 if (j) 659 active->handle_event(ev, screen,j->inm);660 else active->handle_event(ev, screen,this);658 active->handle_event(ev,m_surf,j->inm); 659 else active->handle_event(ev,m_surf,this); 661 660 } 662 661 } … … 679 678 ifield *i; 680 679 if(owner) 681 screen = owner->screen;680 m_surf = owner->m_surf; 682 681 for(i = first; i; i = i->next) 683 i->draw_first( screen);682 i->draw_first(m_surf); 684 683 if(active) 685 active->draw(1, screen);686 } 687 688 InputManager::InputManager(image * Screen, ifield *First)684 active->draw(1, m_surf); 685 } 686 687 InputManager::InputManager(image *screen, ifield *First) 689 688 { 690 689 no_selections_allowed = 0; … … 692 691 grab = NULL; 693 692 owner = NULL; 694 screen = Screen;693 m_surf = screen; 695 694 active = first = First; 696 695 while(active && !active->selectable()) 697 696 active = active->next; 698 if( screen)697 if(m_surf) 699 698 redraw(); 700 699 } … … 706 705 grab = NULL; 707 706 owner = Owner; 708 screen= NULL;707 m_surf = NULL; 709 708 active = first = First; 710 709 while(active && !active->selectable()) -
abuse/trunk/src/imlib/jwindow.h
r643 r644 31 31 class InputManager 32 32 { 33 friend class Jwindow; 33 friend class Jwindow; 34 35 public: 36 InputManager(image *screen, ifield *first); 37 InputManager(Jwindow *owner, ifield *first); 38 ~InputManager(); 39 40 void handle_event(Event &ev, Jwindow *j); 41 ifield *get(int id); 42 void redraw(); 43 void add(ifield *i); 44 void remap(Filter *f); 45 ifield *unlink(int id); // unlinks ID from fields list and return the pointer to it 46 void clear_current(); 47 void grab_focus(ifield *i); 48 void release_focus(); 49 void allow_no_selections(); 34 50 35 51 private: 36 image *screen; 37 ifield *first, *active, *grab; 38 Jwindow *cur, *owner; 39 int no_selections_allowed; 40 41 public: 42 InputManager(image *screen, ifield *first); 43 InputManager(Jwindow *owner, ifield *first); 44 void handle_event(Event &ev, Jwindow *j); 45 ifield *get(int id); 46 void redraw(); 47 void add(ifield *i); 48 void remap(Filter *f); 49 ifield *unlink(int id); // unlinks ID from fields list and return the pointer to it 50 void clear_current(); 51 void grab_focus(ifield *i); 52 void release_focus(); 53 void allow_no_selections(); 54 ~InputManager(); 55 } ; 52 image *m_surf; 53 ifield *first, *active, *grab; 54 Jwindow *cur, *owner; 55 int no_selections_allowed; 56 }; 56 57 57 58 class ifield … … 87 88 friend class InputManager; 88 89 89 private:90 char *_name;91 bool _hidden;92 bool _moveable;93 94 void reconfigure();95 96 protected:97 Jwindow *owner;98 int _x1, _y1, _x2, _y2;99 100 90 public: 101 91 Jwindow *next; 102 92 int x, y, l, h, backg; 103 image *screen;104 93 InputManager *inm; 105 94 void *local_info; // pointer to info block for local system (may support windows) … … 111 100 virtual void redraw(); 112 101 void resize(int L, int H); 113 void clear(int color = 0) { screen->bar(x1(), y1(), x2(), y2(), color); }102 void clear(int color = 0) { m_surf->bar(x1(), y1(), x2(), y2(), color); } 114 103 void show() { _hidden = false; } 115 104 void hide() { _hidden = true; } … … 122 111 int x2() { return _x2; } 123 112 int y2() { return _y2; } 124 void clip_in() { screen->SetClip(x1(), y1(), x2() + 1, y2() + 1); }125 void clip_out() { screen->SetClip(0, 0, l, h); }113 void clip_in() { m_surf->SetClip(x1(), y1(), x2() + 1, y2() + 1); } 114 void clip_out() { m_surf->SetClip(0, 0, l, h); } 126 115 char *read(int id) { return inm->get(id)->read(); } 127 116 void local_close(); … … 131 120 static int top_border(); 132 121 static int bottom_border(); 122 123 image *m_surf; 124 125 protected: 126 Jwindow *owner; 127 int _x1, _y1, _x2, _y2; 128 129 private: 130 char *_name; 131 bool _hidden; 132 bool _moveable; 133 134 void reconfigure(); 133 135 }; 134 136 … … 183 185 private: 184 186 palette *m_pal; 185 image *m_s creen;187 image *m_surf; 186 188 }; 187 189 -
abuse/trunk/src/imlib/pmenu.cpp
r643 r644 37 37 bar=wm->new_window(X, Y, w, 0, NULL); 38 38 bar->freeze(); // can't drag this window 39 bar-> screen->widget_bar(0,0,w-1,h-1,wm->bright_color(),wm->medium_color(),39 bar->m_surf->widget_bar(0,0,w-1,h-1,wm->bright_color(),wm->medium_color(), 40 40 wm->dark_color()); 41 41 … … 207 207 NULL); 208 208 win->freeze(); 209 win-> screen->widget_bar(0,0,w-1,h-1,wm->bright_color(),wm->medium_color(),wm->dark_color());209 win->m_surf->widget_bar(0,0,w-1,h-1,wm->bright_color(),wm->medium_color(),wm->dark_color()); 210 210 211 211 int has_flags=0; … … 228 228 { 229 229 int h=wm->font()->height(); 230 parent-> screen->widget_bar(x,y+h/2-1,x+w-1,y+h/2,wm->dark_color(),wm->medium_color(),wm->bright_color());230 parent->m_surf->widget_bar(x,y+h/2-1,x+w-1,y+h/2,wm->dark_color(),wm->medium_color(),wm->bright_color()); 231 231 } else 232 232 { … … 234 234 { 235 235 if (xp!=-1) 236 parent-> screen->xor_bar(bx,y,x+w-1,y+wm->font()->height()+1,wm->dark_color());236 parent->m_surf->xor_bar(bx,y,x+w-1,y+wm->font()->height()+1,wm->dark_color()); 237 237 else 238 238 { 239 parent-> screen->bar(bx,y,x+w-1,y+wm->font()->height()+1,wm->dark_color());240 wm->font()->put_string(parent-> screen,x+1,y+1,n,wm->medium_color());241 if (on_off && *on_off) wm->font()->put_string(parent-> screen,bx+1,y+1,"*",wm->medium_color());239 parent->m_surf->bar(bx,y,x+w-1,y+wm->font()->height()+1,wm->dark_color()); 240 wm->font()->put_string(parent->m_surf,x+1,y+1,n,wm->medium_color()); 241 if (on_off && *on_off) wm->font()->put_string(parent->m_surf,bx+1,y+1,"*",wm->medium_color()); 242 242 } 243 243 } else 244 244 { 245 245 if (xp!=-1) 246 parent-> screen->xor_bar(bx,y,x+w-1,y+wm->font()->height()+1,wm->dark_color());246 parent->m_surf->xor_bar(bx,y,x+w-1,y+wm->font()->height()+1,wm->dark_color()); 247 247 else 248 248 { 249 parent-> screen->bar(bx,y,x+w-1,y+wm->font()->height()+1,wm->medium_color());250 wm->font()->put_string(parent-> screen,x+1,y+1,n,wm->bright_color());251 if (on_off && *on_off) wm->font()->put_string(parent-> screen,bx+1,y+1,"*",wm->bright_color());249 parent->m_surf->bar(bx,y,x+w-1,y+wm->font()->height()+1,wm->medium_color()); 250 wm->font()->put_string(parent->m_surf,x+1,y+1,n,wm->bright_color()); 251 if (on_off && *on_off) wm->font()->put_string(parent->m_surf,bx+1,y+1,"*",wm->bright_color()); 252 252 } 253 253 } … … 290 290 { 291 291 if (p->xp!=-1) return p->xp; 292 int w=bar-> screen->Size().x;292 int w=bar->m_surf->Size().x; 293 293 294 294 … … 381 381 mx-=bar->x; 382 382 my-=bar->y; 383 if (mx<0 || my<0 || mx>=bar-> screen->Size().x || my>=bar->screen->Size().y) return NULL;383 if (mx<0 || my<0 || mx>=bar->m_surf->Size().x || my>=bar->m_surf->Size().y) return NULL; 384 384 else 385 385 { -
abuse/trunk/src/imlib/scroller.cpp
r643 r644 501 501 for (int j=0; j<th; j++,dy+=tex->Size().y) 502 502 for (int i=0,dx=x; i<tw; i++,dx+=tex->Size().x) 503 tex->put_image(screen,dx,dy);503 screen->PutImage(tex, dx, dy); 504 504 505 505 screen->SetClip(cx1, cy1, cx2, cy2); -
abuse/trunk/src/imlib/sprite.cpp
r555 r644 26 26 void sprite::restore_background() 27 27 { if (x+save->Size().x>=0 && y+save->Size().y>=0 && x<=xres && y<=yres) 28 s ave->put_image(screen,x,y); }28 screen->PutImage(save, x, y); } 29 29 30 30 void sprite::get_background() 31 31 { if (x+visual->Size().x>=0 && y+visual->Size().y>=0 && x<=xres && y<=yres) 32 s creen->put_part(save,0,0,x,y,x+save->Size().x-1,y+save->Size().y-1); }32 save->PutPart(screen,0,0,x,y,x+save->Size().x-1,y+save->Size().y-1); } 33 33 34 34 void sprite::draw() 35 35 { if (x+visual->Size().x>=0 && y+visual->Size().y>=0 && x<=xres && y<=yres) 36 visual->put_image(screen,x,y,1); }36 screen->PutImage(visual, x, y, 1); } 37 37 38 38 sprite::sprite(image *Screen, image *Visual, int X, int Y) -
abuse/trunk/src/loadgame.cpp
r643 r644 60 60 } 61 61 62 Jwindow *create_num_window(int mx, int total_saved, int lines, image **thumb _nails)62 Jwindow *create_num_window(int mx, int total_saved, int lines, image **thumbnails) 63 63 { 64 64 ico_button *buts[MAX_SAVE_GAMES]; … … 77 77 x += iw; 78 78 } 79 if (thumb _nails) { while (!thumb_nails[n]) n++; }79 if (thumbnails) { while (!thumbnails[n]) n++; } 80 80 buts[i]=new ico_button(x, y, ID_LOAD_GAME_NUMBER + n, 81 81 save_buts[n*3+0],save_buts[n*3+0],save_buts[n*3+1],save_buts[n*3+2],NULL); … … 167 167 { 168 168 int total_saved=0; 169 image *thumb _nails[MAX_SAVE_GAMES];169 image *thumbnails[MAX_SAVE_GAMES]; 170 170 int start_num=0; 171 171 int max_w=160,max_h=100; 172 memset(thumb _nails,0,sizeof(thumb_nails));172 memset(thumbnails,0,sizeof(thumbnails)); 173 173 174 174 image *first=NULL; … … 191 191 if (se && se->type==SPEC_IMAGE) 192 192 { 193 thumb _nails[start_num] = new image(fp, se);194 if (thumb _nails[start_num]->Size().x>max_w) max_w=thumb_nails[start_num]->Size().x;195 if (thumb _nails[start_num]->Size().y>max_h) max_h=thumb_nails[start_num]->Size().y;196 if (!first) first=thumb _nails[start_num];193 thumbnails[start_num] = new image(fp, se); 194 if (thumbnails[start_num]->Size().x>max_w) max_w=thumbnails[start_num]->Size().x; 195 if (thumbnails[start_num]->Size().y>max_h) max_h=thumbnails[start_num]->Size().y; 196 if (!first) first=thumbnails[start_num]; 197 197 total_saved++; 198 198 } … … 202 202 if (fail && show_all) 203 203 { 204 thumb _nails[start_num] = new image(vec2i(160, 100));205 thumb _nails[start_num]->clear();206 console_font->put_string(thumb _nails[start_num],0,0,symbol_str("no_saved"));204 thumbnails[start_num] = new image(vec2i(160, 100)); 205 thumbnails[start_num]->clear(); 206 console_font->put_string(thumbnails[start_num],0,0,symbol_str("no_saved")); 207 207 total_saved++; 208 if (!first) first=thumb _nails[start_num];208 if (!first) first=thumbnails[start_num]; 209 209 } 210 210 delete fp; … … 233 233 234 234 235 Jwindow *l_win=create_num_window(0,total_saved,MAX_SAVE_LINES,thumb _nails);235 Jwindow *l_win=create_num_window(0,total_saved,MAX_SAVE_LINES,thumbnails); 236 236 Jwindow *preview=wm->new_window(l_win->x+l_win->l+5,l_win->y,max_w,max_h,NULL,title); 237 237 238 first->put_image(preview->screen,preview->x1(),preview->y1());238 preview->m_surf->PutImage(first, preview->x1(), preview->y1()); 239 239 240 240 Event ev; … … 252 252 int draw_num=ev.message.id-ID_LOAD_GAME_PREVIEW; 253 253 preview->clear(); 254 thumb_nails[draw_num]->put_image(preview->screen,preview->x1(),preview->y1());254 preview->m_surf->PutImage(thumbnails[draw_num], preview->x1(), preview->y1()); 255 255 } 256 256 … … 263 263 264 264 for (i=0; i<total_saved; i++) 265 if (thumb_nails[i]) 266 delete thumb_nails[i]; 265 delete thumbnails[i]; 267 266 268 267 return got_level; -
abuse/trunk/src/menu.cpp
r643 r644 240 240 int by2=by1+bh-1; 241 241 242 main_screen->put_part(save,0,0,mx+1,by1,mx+mw-2,by2);242 save->PutPart(main_screen, 0, 0, mx + 1, by1, mx + mw - 2, by2); 243 243 tint_area(mx+1,by1,mx+mw-2,by2,63,63,63,color); 244 244 … … 256 256 } 257 257 wm->flush_screen(); 258 save->put_image(main_screen,mx+1,by1);258 main_screen->PutImage(save, mx + 1, by1); 259 259 } else { Timer tmp; tmp.WaitMs(10); } 260 260 … … 520 520 { 521 521 image *tit=cache.img(title_screen); 522 tit->put_image(main_screen,main_screen->Size().x/2-tit->Size().x/2,523 main_screen->Size().y/2-tit->Size().y/2);522 main_screen->PutImage(tit, main_screen->Size().x/2-tit->Size().x/2, 523 main_screen->Size().y/2-tit->Size().y/2); 524 524 } 525 525 inm->redraw(); -
abuse/trunk/src/netcfg.cpp
r643 r644 275 275 int ns_w=ns->Size().x,ns_h=ns->Size().y; 276 276 int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2; 277 ns->put_image(main_screen,x,y);277 main_screen->PutImage(ns, x, y); 278 278 JCFont *fnt=wm->font(); 279 279 … … 315 315 } 316 316 317 screen_backup->put_image(main_screen, 0, 0);317 main_screen->PutImage(screen_backup, 0, 0); 318 318 wm->flush_screen(); 319 319 delete screen_backup; … … 340 340 int ns_w=ns->Size().x,ns_h=ns->Size().y; 341 341 int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2; 342 ns->put_image(main_screen,x,y);342 main_screen->PutImage(ns, x, y); 343 343 JCFont *fnt=wm->font(); 344 344 image *ok_image=cache.img(cache.reg("art/frame.spe","dev_ok",SPEC_IMAGE,1))->copy(), … … 460 460 int ns_w=ns->Size().x,ns_h=ns->Size().y; 461 461 int x=(xres+1)/2-ns_w/2,y=(yres+1)/2-ns_h/2; 462 ns->put_image(main_screen, x, y);462 main_screen->PutImage(ns, x, y); 463 463 char const *nw_s = symbol_str("Networking"); 464 464 JCFont *fnt=wm->font(); -
abuse/trunk/src/profile.cpp
r643 r644 122 122 float time_scaler=(float)max_bar_length/prof_list[0].total_time; 123 123 124 prof_win-> screen->bar(0,prof_win->y1(),prof_win->screen->Size().x-1,prof_win->screen->Size().y,0);124 prof_win->m_surf->bar(0,prof_win->y1(),prof_win->m_surf->Size().x-1,prof_win->m_surf->Size().y,0); 125 125 int dy = 0; 126 126 for (; i<prof_height; i++) 127 127 { 128 console_font->put_string(prof_win-> screen,spliter+1,dy,object_names[prof_list[i].otype]);129 prof_win-> screen->bar(spliter-1-(int)(prof_list[i].total_time*time_scaler),dy+1,128 console_font->put_string(prof_win->m_surf,spliter+1,dy,object_names[prof_list[i].otype]); 129 prof_win->m_surf->bar(spliter-1-(int)(prof_list[i].total_time*time_scaler),dy+1, 130 130 spliter-1, 131 131 dy+console_font->height()-1,wm->bright_color()); -
abuse/trunk/src/ui/volumewindow.cpp
r555 r644 44 44 l = cache.img(bg)->Size().x; 45 45 h = cache.img(bg)->Size().y; 46 screen= new image(cache.img(bg)->Size(), NULL, 2);46 m_surf = new image(cache.img(bg)->Size(), NULL, 2); 47 47 redraw(); 48 48 } … … 50 50 void VolumeWindow::redraw() 51 51 { 52 cache.img(bg)->put_image(screen, 0, 0);52 m_surf->PutImage(cache.img(bg), 0, 0); 53 53 draw_music_vol(); 54 54 draw_sfx_vol(); … … 62 62 if(t != 0) 63 63 { 64 cache.img(slider)->put_image(screen, x1, y1);65 // screen->bar(x1,y1,dx,y2,c1);64 m_surf->PutImage(cache.img(slider), x1, y1); 65 // m_surf->bar(x1,y1,dx,y2,c1); 66 66 } 67 67 else … … 69 69 70 70 if(dx < x2) 71 screen->bar(dx + 1, y1, x2, y2, c2);71 m_surf->bar(dx + 1, y1, x2, y2, c2); 72 72 } 73 73
Note: See TracChangeset
for help on using the changeset viewer.