Changeset 659
- Timestamp:
- May 15, 2011, 6:22:25 AM (11 years ago)
- Location:
- abuse/trunk
- Files:
-
- 17 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/TODO
r658 r659 56 56 REFACTOR 57 57 -------- 58 - move to vec2i: 59 - PutPart 60 - AddDirty !! 61 - update_dirty 62 58 63 console::draw_char : vec2i 59 64 VolumeWindow::draw_vol plus grand !! 60 65 61 x, y (apparemment des membres de object)66 x, y in game_object? 62 67 get_fg ? 63 68 snap_x() snap_y() 64 69 scatter_line, ascatter_line 70 xstart() / xend() etc. 71 jwindow::area 65 72 -
abuse/trunk/src/console.cpp
r655 r659 66 66 if (con_win) 67 67 { 68 lastx=con_win-> x;69 lasty=con_win-> y;68 lastx=con_win->m_pos.x; 69 lasty=con_win->m_pos.y; 70 70 wm->close_window(con_win); 71 71 con_win=NULL; -
abuse/trunk/src/dev.cpp
r658 r659 148 148 virtual void scroll_event(int newx, image *screen) 149 149 { 150 screen->Bar( vec2i(x, y), vec2i(x + l - 1, y +h - 1), wm->dark_color());150 screen->Bar(m_pos, m_pos + vec2i(l - 1, h - 1), wm->dark_color()); 151 151 char st[100]; 152 152 sprintf(st,"%d",newx); 153 wm->font()->put_string(screen, x+30,y+1,st,wm->bright_color());153 wm->font()->put_string(screen,m_pos.x+30,m_pos.y+1,st,wm->bright_color()); 154 154 if (player_list) 155 155 player_list->ambient=newx; … … 574 574 { 575 575 tbw_on=0; 576 prop->setd("toolbar x",tbw-> x);577 prop->setd("toolbar y",tbw-> y);576 prop->setd("toolbar x",tbw->m_pos.x); 577 prop->setd("toolbar y",tbw->m_pos.y); 578 578 wm->close_window(tbw); 579 579 tbw=NULL; … … 604 604 { 605 605 show_menu_on = 0; 606 prop->setd("layer x", show_menu-> x);607 prop->setd("layer y", show_menu-> y);606 prop->setd("layer x", show_menu->m_pos.x); 607 prop->setd("layer y", show_menu->m_pos.y); 608 608 wm->close_window(show_menu); 609 609 show_menu = NULL; … … 647 647 { 648 648 omenu_on = 0; 649 prop->setd("objects x", omenu-> x);650 prop->setd("objects y", omenu-> y);649 prop->setd("objects x", omenu->m_pos.x); 650 prop->setd("objects y", omenu->m_pos.y); 651 651 wm->close_window(omenu); 652 652 omenu = NULL; … … 694 694 { 695 695 pmenu_on = 0; 696 prop->setd("pal x", pmenu-> x);697 prop->setd("pal y", pmenu-> y);696 prop->setd("pal x", pmenu->m_pos.x); 697 prop->setd("pal y", pmenu->m_pos.y); 698 698 wm->close_window(pmenu); 699 699 pmenu = NULL; … … 728 728 { 729 729 forew_on = 1; 730 prop->setd("fore x", forew-> x);731 prop->setd("fore y", forew-> y);730 prop->setd("fore x", forew->m_pos.x); 731 prop->setd("fore y", forew->m_pos.y); 732 732 wm->close_window(forew); 733 733 forew = NULL; … … 767 767 { 768 768 backw_on = 1; 769 prop->setd("back x", backw-> x);770 prop->setd("back y", backw-> y);769 prop->setd("back x", backw->m_pos.x); 770 prop->setd("back y", backw->m_pos.y); 771 771 wm->close_window(backw); 772 772 backw = NULL; … … 790 790 { 791 791 searchw_on = 1; 792 prop->setd("searchw x", search_window-> x);793 prop->setd("searchw y", search_window-> y);792 prop->setd("searchw x", search_window->m_pos.x); 793 prop->setd("searchw y", search_window->m_pos.y); 794 794 prop->set("search name", search_window->read(ID_SEARCH_TEXT)); 795 795 wm->close_window(search_window); … … 1320 1320 if(lightw) 1321 1321 { 1322 prop->setd("light create x", lightw-> x);1323 prop->setd("light create y", lightw-> y);1322 prop->setd("light create x", lightw->m_pos.x); 1323 prop->setd("light create y", lightw->m_pos.y); 1324 1324 prop->setd("light create w", atoi(lightw->read(DEV_LIGHTW))); 1325 1325 prop->setd("light create h", atoi(lightw->read(DEV_LIGHTH))); … … 1425 1425 if (ledit) 1426 1426 { 1427 prop->setd("ledit x",ledit-> x);1428 prop->setd("ledit y",ledit-> y);1427 prop->setd("ledit x",ledit->m_pos.x); 1428 prop->setd("ledit y",ledit->m_pos.y); 1429 1429 wm->close_window(ledit); ledit=NULL; 1430 1430 } … … 1500 1500 } 1501 1501 } 1502 prop->setd("ai x",aiw-> x);1503 prop->setd("ai y",aiw-> y);1502 prop->setd("ai x",aiw->m_pos.x); 1503 prop->setd("ai y",aiw->m_pos.y); 1504 1504 wm->close_window(aiw); 1505 1505 aiw=NULL; … … 1530 1530 if (area_win) 1531 1531 { 1532 prop->setd("area_box x",area_win-> x);1533 prop->setd("area_box y",area_win-> y);1532 prop->setd("area_box x",area_win->m_pos.x); 1533 prop->setd("area_box y",area_win->m_pos.y); 1534 1534 1535 1535 if (current_area && read_values) … … 1608 1608 if (oedit) 1609 1609 { 1610 prop->setd("oedit x",oedit-> x);1611 prop->setd("oedit y",oedit-> y);1610 prop->setd("oedit x",oedit->m_pos.x); 1611 prop->setd("oedit y",oedit->m_pos.y); 1612 1612 wm->close_window(oedit); 1613 1613 oedit=NULL; … … 1920 1920 if (ledit) 1921 1921 { 1922 prop->setd("ledit x",ledit-> x);1923 prop->setd("ledit x",ledit-> y);1922 prop->setd("ledit x",ledit->m_pos.x); 1923 prop->setd("ledit x",ledit->m_pos.y); 1924 1924 wm->close_window(ledit); 1925 1925 } … … 2422 2422 case DEV_LEDIT_DEL : 2423 2423 { 2424 prop->setd("ledit x",ledit-> x);2425 prop->setd("ledit y",ledit-> y);2424 prop->setd("ledit x",ledit->m_pos.x); 2425 prop->setd("ledit y",ledit->m_pos.y); 2426 2426 wm->close_window(ledit); ledit=NULL; 2427 2427 if (current_level) … … 2450 2450 edit_light->calc_range(); 2451 2451 edit_light=NULL; 2452 prop->setd("ledit x",ledit-> x);2453 prop->setd("ledit y",ledit-> y);2452 prop->setd("ledit x",ledit->m_pos.x); 2453 prop->setd("ledit y",ledit->m_pos.y); 2454 2454 wm->close_window(ledit); ledit=NULL; 2455 2455 the_game->need_refresh(); … … 2457 2457 case DEV_LEDIT_MOVE : 2458 2458 { 2459 prop->setd("ledit x",ledit-> x);2460 prop->setd("ledit y",ledit-> y);2459 prop->setd("ledit x",ledit->m_pos.x); 2460 prop->setd("ledit y",ledit->m_pos.y); 2461 2461 wm->close_window(ledit); ledit=NULL; 2462 2462 state=DEV_MOVE_LIGHT; … … 2465 2465 { 2466 2466 edit_light=edit_light->copy(); 2467 prop->setd("ledit x",ledit-> x);2468 prop->setd("ledit y",ledit-> y);2467 prop->setd("ledit x",ledit->m_pos.x); 2468 prop->setd("ledit y",ledit->m_pos.y); 2469 2469 wm->close_window(ledit); ledit=NULL; 2470 2470 state=DEV_MOVE_LIGHT; … … 2546 2546 char cmd[100]; 2547 2547 strcpy(cmd,commandw->inm->get(DEV_COMMAND)->read()); 2548 prop->setd("commandw x",commandw-> x);2549 prop->setd("commandw y",commandw-> y);2548 prop->setd("commandw x",commandw->m_pos.x); 2549 prop->setd("commandw y",commandw->m_pos.y); 2550 2550 wm->close_window(commandw); 2551 2551 commandw=NULL; … … 2649 2649 if (ev.window==commandw) 2650 2650 { 2651 prop->setd("commandw x",commandw-> x);2652 prop->setd("commandw y",commandw-> y);2651 prop->setd("commandw x",commandw->m_pos.x); 2652 prop->setd("commandw y",commandw->m_pos.y); 2653 2653 wm->close_window(commandw); 2654 2654 commandw=NULL; … … 2966 2966 if (me) // dont' close the window if the window is already closed 2967 2967 { 2968 x=me-> x; // save the old poisition of the window so that when we open it2968 x=me->m_pos.x; // save the old poisition of the window so that when we open it 2969 2969 // it will be in the same spot 2970 y=me-> y;2970 y=me->m_pos.y; 2971 2971 wm->close_window(me); 2972 2972 me=NULL; … … 3028 3028 if (ev.mouse_button==1) 3029 3029 { 3030 int selx=(last_demo_mpos.x-me-> x-me->x1())/(the_game->ftile_width()/scale),3031 sely=(last_demo_mpos.y-me-> y-me->y1())/(the_game->ftile_height()/scale);3030 int selx=(last_demo_mpos.x-me->m_pos.x-me->x1())/(the_game->ftile_width()/scale), 3031 sely=(last_demo_mpos.y-me->m_pos.y-me->y1())/(the_game->ftile_height()/scale); 3032 3032 if (selx>=0 && sely>=0 && selx<w && sely<h) 3033 3033 { … … 3043 3043 else 3044 3044 { 3045 int selx=(last_demo_mpos.x-me-> x-me->x1())/(the_game->ftile_width()/scale),3046 sely=(last_demo_mpos.y-me-> y-me->y1())/(the_game->ftile_height()/scale);3045 int selx=(last_demo_mpos.x-me->m_pos.x-me->x1())/(the_game->ftile_width()/scale), 3046 sely=(last_demo_mpos.y-me->m_pos.y-me->y1())/(the_game->ftile_height()/scale); 3047 3047 if (selx>=0 && sely>=0 && selx<w && sely<h) 3048 3048 { … … 3101 3101 { 3102 3102 int32_t xx, yy; 3103 vec2i tile = the_game->GetFgTile( vec2i(me->x, me->y));3103 vec2i tile = the_game->GetFgTile(me->m_pos); 3104 3104 3105 3105 for (xx=tile.x; xx<tile.x+w; xx++) … … 3115 3115 case 't' : 3116 3116 { 3117 vec2i tile = the_game->GetFgTile( vec2i(me->x, me->y));3117 vec2i tile = the_game->GetFgTile(me->m_pos); 3118 3118 dev_cont->fg_fill(-1, tile.x, tile.y, this); 3119 3119 } break; … … 3156 3156 if (me) 3157 3157 { 3158 x=me-> x;3159 y=me-> y;3158 x=me->m_pos.x; 3159 y=me->m_pos.y; 3160 3160 } 3161 3161 -
abuse/trunk/src/devsel.cpp
r655 r659 93 93 void tile_picker::scroll_event(int newx, image *screen) 94 94 { 95 int y o=y,ya=pich(),xw=picw(),c=get_current(),xo;95 int ya = pich(), xw = picw(), c = get_current(); 96 96 image im(vec2i(xw, ya)); 97 97 last_sel=newx; 98 98 99 screen->Bar( vec2i(x, y), vec2i(x + l - 1, y +h - 1), wm->black());99 screen->Bar(m_pos, m_pos + vec2i(l - 1, h - 1), wm->black()); 100 100 for (int i=newx; i<newx+th*wid; i++) 101 101 { 102 xo=x+((i-newx)%wid)*xw; 103 yo=y+((i-newx)/wid)*ya; 102 vec2i xyo = m_pos + vec2i(((i - newx) % wid) * xw, ((i - newx) / wid) * ya); 104 103 105 104 int blank=0; … … 118 117 if (rev) 119 118 { 120 screen->Bar(vec2i(xo, yo), vec2i(xo + xw - 1, yo + ya - 1), 121 wm->bright_color()); 122 scale_put_trans(&im,screen,xo,yo,xw,ya); 119 screen->Bar(xyo, xyo + vec2i(xw - 1, ya - 1), wm->bright_color()); 120 scale_put_trans(&im,screen,xyo.x,xyo.y,xw,ya); 123 121 } 124 else scale_put(&im,screen,x o,yo,xw,ya);122 else scale_put(&im,screen,xyo.x,xyo.y,xw,ya); 125 123 } 126 124 } break; … … 129 127 if (backtiles[i]<0) blank=1; 130 128 else 131 scale_put(the_game->get_bg(i)->im,screen, xo,yo,xw,ya);129 scale_put(the_game->get_bg(i)->im,screen,m_pos.x,m_pos.y,xw,ya); 132 130 133 131 } break; … … 135 133 { 136 134 figures[i]->get_sequence(stopped)->get_figure(0)->forward->PutImage(&im,vec2i(0,0)); 137 scale_put(&im,screen, xo,yo,xw,ya);135 scale_put(&im,screen,m_pos.x,m_pos.y,xw,ya); 138 136 } break; 139 137 } … … 141 139 142 140 if (i==c) 143 screen->Rectangle( vec2i(xo, yo), vec2i(xo + xw - 1, yo +ya - 1),141 screen->Rectangle(m_pos, m_pos + vec2i(xw - 1, ya - 1), 144 142 wm->bright_color()); 145 143 … … 153 151 if (ev.type==EV_MOUSE_BUTTON) 154 152 { 155 int sel=((ev.mouse_move.y- y)/pich()*wid)+(ev.mouse_move.x-x)/picw()+last_sel;153 int sel=((ev.mouse_move.y-m_pos.y)/pich()*wid)+(ev.mouse_move.x-m_pos.x)/picw()+last_sel; 156 154 if (sel<t && sel>=0 && sel!=get_current()) 157 155 { -
abuse/trunk/src/gui.cpp
r655 r659 27 27 ico_switch_button::ico_switch_button(int X, int Y, int ID, int start_on, ifield *butts, ifield *Next) 28 28 { 29 x=X; y=Y; id=ID;29 m_pos = vec2i(X, Y); id=ID; 30 30 next=Next; 31 31 blist=cur_but=butts; 32 32 act=0; 33 for (ifield *b=blist; b; b=b->next) { b->x=x; b->y=y; } 33 for (ifield *b=blist; b; b=b->next) 34 b->m_pos = m_pos; 34 35 while (cur_but && start_on--) cur_but=cur_but->next; 35 36 if (!cur_but) cur_but=blist; … … 51 52 if (Y2>y2) y2=Y2; 52 53 } 53 if (!blist) { x1=x2= x; y1=y2=y; }54 if (!blist) { x1=x2=m_pos.x; y1=y2=m_pos.y; } 54 55 } 55 56 … … 135 136 void ico_button::area(int &x1, int &y1, int &x2, int &y2) 136 137 { 137 x1= x; y1=y;138 x2= x+cache.img(u)->Size().x-1;139 y2= y+cache.img(u)->Size().y-1;138 x1=m_pos.x; y1=m_pos.y; 139 x2=m_pos.x+cache.img(u)->Size().x-1; 140 y2=m_pos.y+cache.img(u)->Size().y-1; 140 141 } 141 142 … … 150 151 151 152 up=1; 152 x=X; y=Y; id=ID;153 m_pos = vec2i(X, Y); id=ID; 153 154 u=Up; d=down; 154 155 ua=upa; da=downa; -
abuse/trunk/src/gui.h
r643 r659 28 28 29 29 virtual char *read() { return (char *)&up; } 30 void set_xy(int X, int Y) { x=X; y=Y; }31 int X() { return x; }32 int Y() { return y; }33 30 int status() { return up; } 34 31 void set_act_id(int id); -
abuse/trunk/src/imlib/guistat.cpp
r655 r659 109 109 gui_status_node *p=first->next; 110 110 while (p && !p->stat_win) p=p->next; 111 if (p) wy=p->stat_win-> y+p->stat_win->y2()+5;111 if (p) wy=p->stat_win->m_pos.y+p->stat_win->y2()+5; 112 112 113 113 int mx = first->stat_win->x1() + 1; -
abuse/trunk/src/imlib/input.cpp
r655 r659 49 49 button_box::button_box(int X, int Y, int ID, int MaxDown, button *Buttons, ifield *Next) 50 50 { 51 x=X; y=Y; id=ID; next=Next;51 m_pos = vec2i(X, Y); id=ID; next=Next; 52 52 buttons=Buttons; 53 53 maxdown=MaxDown; … … 95 95 } 96 96 97 void button_box:: move(int newx, int newy)97 void button_box::Move(vec2i pos) 98 98 { 99 99 for(button * b = buttons; b; b = (button *)b->next) 100 b->move(newx + b->x, newy + b->y); 101 x = newx; 102 y = newy; 100 b->Move(pos + b->m_pos); 101 m_pos = pos; 103 102 } 104 103 … … 169 168 void button_box::arrange_left_right() 170 169 { 171 button *b=buttons; 172 int x_on=x,x1,y1,x2,y2; 173 for (; b; b=(button *)b->next) 174 { 175 b->area(x1,y1,x2,y2); 176 b->x=x_on; 177 b->y=y; 178 x_on+=(x2-x1+1)+1; 179 } 170 vec2i on = m_pos; 171 for (button *b = buttons; b; b = (button *)b->next) 172 { 173 int x1, y1, x2, y2; 174 b->area(x1, y1, x2, y2); 175 b->m_pos = on; 176 on.x += (x2 - x1 + 1) + 1; 177 } 180 178 } 181 179 182 180 void button_box::arrange_up_down() 183 181 { 184 button *b=buttons; 185 int y_on=y,x1,y1,x2,y2; 186 for (; b; b=(button *)b->next) 187 { 188 b->area(x1,y1,x2,y2); 189 b->y=y_on; 190 b->x=x; 191 y_on+=(y2-y1+1)+1; 192 } 182 vec2i on = m_pos; 183 for (button *b = buttons; b; b = (button *)b->next) 184 { 185 int x1, y1, x2, y2; 186 b->area(x1,y1,x2,y2); 187 b->m_pos = on; 188 on.y += (y2 - y1 + 1) + 1; 189 } 193 190 } 194 191 … … 201 198 void button::area(int &x1, int &y1, int &x2, int &y2) 202 199 { 203 x1=x; y1=y; 204 if (pressed) 205 { 206 x2=x+pressed->Size().x-1; 207 y2=y+pressed->Size().y-1; 208 } 209 else 210 { 211 if (text) 212 { 213 x2=x+wm->font()->width()*strlen(text)+6; 214 y2=y+wm->font()->height()+6; 215 } else 216 { 217 x2=x+6+visual->Size().x; 218 y2=y+6+visual->Size().y; 219 } 220 } 200 vec2i pos1 = m_pos; 201 vec2i pos2 = m_pos; 202 203 if (pressed) 204 pos2 += pressed->Size() - vec2i(1, 1); 205 else if (text) 206 pos2 += vec2i(wm->font()->width() * strlen(text) + 6, 207 wm->font()->height() + 6); 208 else 209 pos2 += visual->Size() + vec2i(6, 6); 210 211 x1 = pos1.x; y1 = pos1.y; 212 x2 = pos2.x; y2 = pos2.y; 221 213 } 222 214 … … 224 216 button::button(int X, int Y, int ID, char const *Text, ifield *Next) 225 217 { 226 x=X; y=Y; id=ID; 227 act_id=-1; 228 text = strdup(Text); 229 up=1; next=Next; act=0; 230 visual=NULL; 231 pressed=NULL; 218 m_pos = vec2i(X, Y); 219 id = ID; 220 act_id=-1; 221 text = strdup(Text); 222 up=1; next=Next; act=0; 223 visual=NULL; 224 pressed=NULL; 232 225 } 233 226 234 227 235 228 button::button(int X, int Y, int ID, image *vis, ifield *Next) 236 { x=X; y=Y; id=ID; text=NULL; 237 act_id=-1; 238 visual=vis; up=1; next=Next; act=0; 239 pressed=NULL; 229 { 230 m_pos = vec2i(X, Y); 231 id=ID; text=NULL; 232 act_id=-1; 233 visual=vis; up=1; next=Next; act=0; 234 pressed=NULL; 240 235 } 241 236 242 237 button::button(int X, int Y, int ID, image *Depressed, image *Pressed, image *active, ifield *Next) 243 { x=X; y=Y; id=ID; text=NULL; 244 act_id=-1; 245 visual=Depressed; up=1; next=Next; act=0; 246 pressed=Pressed; 247 act_pict=active; 238 { 239 m_pos = vec2i(X, Y); 240 id=ID; text=NULL; 241 act_id=-1; 242 visual=Depressed; up=1; next=Next; act=0; 243 pressed=Pressed; 244 act_pict=active; 248 245 } 249 246 … … 316 313 if (active) 317 314 { 318 screen->Rectangle(vec2i(xstart(), y), vec2i(xend(), yend()),315 screen->Rectangle(vec2i(xstart(), m_pos.y), vec2i(xend(), yend()), 319 316 wm->bright_color()); 320 317 draw_cur(wm->bright_color(),screen); … … 322 319 else 323 320 { 324 screen->Rectangle(vec2i(xstart(), y), vec2i(xend(), yend()),321 screen->Rectangle(vec2i(xstart(), m_pos.y), vec2i(xend(), yend()), 325 322 wm->dark_color()); 326 323 draw_cur(wm->dark_color(),screen); … … 330 327 void text_field::area(int &x1, int &y1, int &x2, int &y2) 331 328 { 332 x1=x; y1=y; 333 x2=xend(); 334 y2=yend(); 329 x1 = m_pos.x; y1 = m_pos.y; 330 x2 = xend(); y2 = yend(); 335 331 } 336 332 … … 338 334 char const *Format, char const *Data, ifield *Next) 339 335 { 340 int slen=(strlen(Format)>strlen(Data) ? strlen(Format) : strlen(Data)); 341 342 x=X; y=Y; id=ID; 343 prompt = strdup(Prompt); 344 format=strcpy((char *)malloc(slen+1),Format); 345 data=strcpy((char *)malloc(slen+1),Data); 346 cur=strlen(data); 347 while (cur && data[cur-1]==' ') cur--; 348 next=Next; 336 int slen=(strlen(Format)>strlen(Data) ? strlen(Format) : strlen(Data)); 337 338 m_pos = vec2i(X, Y); 339 id=ID; 340 prompt = strdup(Prompt); 341 format=strcpy((char *)malloc(slen+1),Format); 342 data=strcpy((char *)malloc(slen+1),Data); 343 cur=strlen(data); 344 while (cur && data[cur-1]==' ') cur--; 345 next=Next; 349 346 } 350 347 … … 355 352 sprintf(num,"%g",Data); 356 353 int slen=(strlen(Format)>strlen(num) ? strlen(Format) : strlen(num)); 357 x=X; y=Y; id=ID;354 m_pos = vec2i(X, Y); id=ID; 358 355 prompt = strdup(Prompt); 359 356 format=strcpy((char *)malloc(slen+1),Format); … … 394 391 { 395 392 if (!active) 396 screen->PutImage(visual, vec2i(x, y));393 screen->PutImage(visual, m_pos); 397 394 else 398 screen->PutImage(pressed, vec2i(x, y));399 } else screen->PutImage(act_pict, vec2i(x, y));395 screen->PutImage(pressed, m_pos); 396 } else screen->PutImage(act_pict, m_pos); 400 397 } 401 398 else … … 425 422 if (text) 426 423 { 427 wm->font()->put_string(screen, x+4,y+5,text,wm->black());428 wm->font()->put_string(screen, x+3,y+4,text);424 wm->font()->put_string(screen,m_pos.x+4,m_pos.y+5,text,wm->black()); 425 wm->font()->put_string(screen,m_pos.x+3,m_pos.y+4,text); 429 426 } 430 else screen->PutImage(visual, vec2i(x + 3, y +3), 1);427 else screen->PutImage(visual, m_pos + vec2i(3, 3), 1); 431 428 } else 432 429 { … … 441 438 else 442 439 { 443 wm->font()->put_string(screen, x+4,y+5,text,wm->black());444 wm->font()->put_string(screen, x+3,y+4,text);440 wm->font()->put_string(screen,m_pos.x+4,m_pos.y+5,text,wm->black()); 441 wm->font()->put_string(screen,m_pos.x+3,m_pos.y+4,text); 445 442 } 446 443 } … … 450 447 void text_field::draw_first(image *screen) 451 448 { 452 wm->font()->put_string(screen, x,y+3,prompt);453 screen->Bar(vec2i(xstart(), y), vec2i(xend(), yend()), wm->dark_color());454 wm->font()->put_string(screen,xstart()+1, y+3,data);449 wm->font()->put_string(screen,m_pos.x,m_pos.y+3,prompt); 450 screen->Bar(vec2i(xstart(), m_pos.y), vec2i(xend(), yend()), wm->dark_color()); 451 wm->font()->put_string(screen,xstart()+1,m_pos.y+3,data); 455 452 } 456 453 … … 467 464 info_field::info_field(int X, int Y, int ID, char const *info, ifield *Next) 468 465 { 469 x = X; y = Y; id = ID; next = Next;466 m_pos = vec2i(X, Y); id = ID; next = Next; 470 467 text = strdup(info); 471 468 w = -1; … … 491 488 w=maxw; 492 489 } 493 x1 =x;494 y1 =y;495 x2 =x+w;496 y2 =y+h;490 x1 = m_pos.x; 491 y1 = m_pos.y; 492 x2 = m_pos.x + w; 493 y2 = m_pos.y + h; 497 494 } 498 495 … … 519 516 void info_field::draw_first(image *screen) 520 517 { 521 put_para(screen,text, x+1,y+1,wm->font()->width(),wm->font()->height(),wm->font(),wm->black());522 put_para(screen,text, x,y,wm->font()->width(),wm->font()->height(),wm->font(),wm->bright_color());523 } 524 525 526 527 518 put_para(screen,text,m_pos.x+1,m_pos.y+1,wm->font()->width(),wm->font()->height(),wm->font(),wm->black()); 519 put_para(screen,text,m_pos.x,m_pos.y,wm->font()->width(),wm->font()->height(),wm->font(),wm->bright_color()); 520 } 521 522 523 524 -
abuse/trunk/src/imlib/input.h
r655 r659 49 49 void press_button(int id); // if button box doesn't contain id, nothing happens 50 50 virtual void remap(Filter *f); 51 virtual void move(int newx, int newy);51 virtual void Move(vec2i pos); 52 52 virtual void area(int &x1, int &y1, int &x2, int &y2); 53 53 virtual void draw_first(image *screen); … … 65 65 int cur; 66 66 char *prompt,*data,*format; 67 int xstart() { return x+wm->font()->width()*(strlen(prompt)+1)+3; }68 int xend() { return x+wm->font()->width()*(strlen(prompt)+1+strlen(format))+7; }69 int yend() { return y+wm->font()->height()+5; }67 int xstart() { return m_pos.x+wm->font()->width()*(strlen(prompt)+1)+3; } 68 int xend() { return m_pos.x+wm->font()->width()*(strlen(prompt)+1+strlen(format))+7; } 69 int yend() { return m_pos.y+wm->font()->height()+5; } 70 70 void draw_cur(int color, image *screen); 71 71 int last_spot() { int x=strlen(data); while (x && data[x-1]==' ') x--; return x; } 72 72 void draw_text(image *screen) 73 73 { 74 screen->Bar(vec2i(xstart() + 1, y + 1), vec2i(xend() - 1, yend() - 1),74 screen->Bar(vec2i(xstart() + 1, m_pos.y + 1), vec2i(xend() - 1, yend() - 1), 75 75 wm->dark_color()); 76 wm->font()->put_string(screen,xstart()+1, y+3,data);76 wm->font()->put_string(screen,xstart()+1,m_pos.y+3,data); 77 77 } 78 78 public : -
abuse/trunk/src/imlib/jwindow.cpp
r655 r659 48 48 { 49 49 for (Jwindow *f=m_first; f; f=f->next) 50 if (f-> x<=x2 && f->y<=y2 && f->x+f->l-1>=x1 && f->y+f->h-1>=y1)50 if (f->m_pos.x<=x2 && f->m_pos.y<=y2 && f->m_pos.x+f->l-1>=x1 && f->m_pos.y+f->h-1>=y1) 51 51 return 1; 52 52 return 0; … … 72 72 { 73 73 p->hide(); 74 m_surf->AddDirty(p-> x, p->y, p->x + p->l, p->y + p->h);74 m_surf->AddDirty(p->m_pos.x, p->m_pos.y, p->m_pos.x + p->l, p->m_pos.y + p->h); 75 75 } 76 76 } … … 93 93 Jwindow *k; 94 94 for (k = m_first; k->next != j; k = k->next) 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);95 k->m_surf->AddDirty(j->m_pos.x - k->m_pos.x, j->m_pos.y - k->m_pos.y, 96 j->m_pos.x + j->l - k->m_pos.x, j->m_pos.y + j->h - k->m_pos.y); 97 k->m_surf->AddDirty(j->m_pos.x - k->m_pos.x, j->m_pos.y - k->m_pos.y, 98 j->m_pos.x + j->l - k->m_pos.x, j->m_pos.y + j->h - k->m_pos.y); 99 99 k->next = j->next; 100 100 } 101 m_surf->AddDirty(j-> x, j->y, j->x + j->l, j->y + j->h);101 m_surf->AddDirty(j->m_pos.x, j->m_pos.y, j->m_pos.x + j->l, j->m_pos.y + j->h); 102 102 j->hide(); 103 103 } … … 125 125 Jwindow *j; 126 126 for (ev.window=NULL,j=m_first; j; j=j->next) 127 if (!j->is_hidden() && ev.mouse_move .x>=j->x && ev.mouse_move.y>=j->y &&128 ev.mouse_move.x<j->x+j->l && ev.mouse_move.y<j->y+j->h)127 if (!j->is_hidden() && ev.mouse_move >= j->m_pos 128 && ev.mouse_move < j->m_pos + vec2i(j->l, j->h)) 129 129 ev.window=j; 130 130 … … 136 136 137 137 if ((ev.type==EV_MOUSE_BUTTON && ev.mouse_button==1 && ev.window && 138 ev.mouse_move .x>=ev.window->x && ev.mouse_move.y>=ev.window->y&&139 ev.mouse_move .x<ev.window->x+ev.window->l && ev.mouse_move.y<ev.window->y+ev.window->y1()))138 ev.mouse_move >= ev.window->m_pos && 139 ev.mouse_move < ev.window->m_pos + vec2i(ev.window->l, ev.window->y1()))) 140 140 { 141 if (ev.mouse_move.x-ev.window-> x<11) closew=1;141 if (ev.mouse_move.x-ev.window->m_pos.x < 11) closew=1; 142 142 else if (ev.window->is_moveable()) movew=1; 143 143 } else if (m_grab) … … 189 189 state=dragging; 190 190 drag_window=ev.window; 191 drag_mousex=ev.window-> x-ev.mouse_move.x;192 drag_mousey=ev.window-> y-ev.mouse_move.y;191 drag_mousex=ev.window->m_pos.x-ev.mouse_move.x; 192 drag_mousey=ev.window->m_pos.y-ev.mouse_move.y; 193 193 ev.type=EV_SPURIOUS; 194 194 } else if (ev.window) … … 214 214 { 215 215 for (Jwindow *j = m_first; j; j = j->next) 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);216 j->m_surf->AddDirty(ev.redraw.x1 - j->m_pos.x, ev.redraw.y1 - j->m_pos.y, 217 ev.redraw.x2 + 1 - j->m_pos.x, ev.redraw.y2 + 1 - j->m_pos.y); 218 218 m_surf->AddDirty(ev.redraw.x1, ev.redraw.y1, ev.redraw.x2 + 1, ev.redraw.y2 + 1); 219 219 flush_screen(); … … 231 231 { 232 232 Jwindow *p; 233 m_surf->AddDirty(j-> x, j->y, j->x + j->l, j->y + j->h);233 m_surf->AddDirty(j->m_pos.x, j->m_pos.y, j->m_pos.x + j->l, j->m_pos.y + j->h); 234 234 for (p=m_first; p!=j; p=p->next) 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);235 p->m_surf->AddDirty(j->m_pos.x - p->m_pos.x, j->m_pos.y - p->m_pos.y, j->m_pos.x + j->l - p->m_pos.x, j->m_pos.y + j->h - p->m_pos.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_surf->AddDirty(j-> x, j->y, j->x + j->l, j->y + j->h);243 m_surf->AddDirty(j->m_pos.x, j->m_pos.y, j->m_pos.x + j->l, j->m_pos.y + j->h); 244 244 for(Jwindow *p = m_first; p != j; p = p->next) 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 j-> x = x;248 j-> y = y;245 p->m_surf->AddDirty(j->m_pos.x - p->m_pos.x, j->m_pos.y - p->m_pos.y, 246 j->m_pos.x + j->l - p->m_pos.x, j->m_pos.y + j->h - p->m_pos.y); 247 j->m_pos.x = x; 248 j->m_pos.y = y; 249 249 j->m_surf->AddDirty(0, 0, j->l, j->h); 250 250 } … … 299 299 Jwindow * search; 300 300 for(search = m_first; search->next != win; search = search->next) 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); 301 search->m_surf->AddDirty(win->m_pos.x - search->m_pos.x, 302 win->m_pos.y - search->m_pos.y, 303 win->m_pos.x + win->l - search->m_pos.x, 304 win->m_pos.y + win->h - search->m_pos.y); 305 search->m_surf->AddDirty(win->m_pos.x - search->m_pos.x, 306 win->m_pos.y - search->m_pos.y, 307 win->m_pos.x + win->l - search->m_pos.x, 308 win->m_pos.y + win->h - search->m_pos.y); 308 309 search->next = win->next; 309 310 } 310 311 311 m_surf->AddDirty(win-> x, win->y, win->x + win->l, win->y + win->h);312 m_surf->AddDirty(win->m_pos.x, win->m_pos.y, win->m_pos.x + win->l, win->m_pos.y + win->h); 312 313 } 313 314 … … 320 321 y = m_surf->Size().y - 10; 321 322 322 Jwindow * j = new Jwindow ( x, y, l, h, fields, name);323 Jwindow * j = new Jwindow (vec2i(x, y), l, h, fields, name); 323 324 j->show(); 324 325 … … 328 329 void WindowManager::flush_screen() 329 330 { 330 int mx = 0, my = 0;331 vec2i m1(0, 0); 331 332 332 333 if (has_mouse()) 333 334 { 334 mx = (m_pos - m_center).x; 335 my = (m_pos - m_center).y; 336 337 m_sprite->save->PutPart(m_surf, 0, 0, mx, my, 338 mx + m_sprite->visual->Size().x - 1, 339 my + m_sprite->visual->Size().y - 1); 340 m_surf->PutImage(m_sprite->visual, vec2i(mx, my), 1); 335 m1 = m_pos - m_center; 336 vec2i m2 = m1 + m_sprite->visual->Size() - vec2i(1, 1); 337 338 m_sprite->save->PutPart(m_surf, 0, 0, m1.x, m1.y, m2.x, m2.y); 339 m_surf->PutImage(m_sprite->visual, m1, 1); 341 340 } 342 341 343 342 for (Jwindow *p = m_first; p; p = p->next) 344 343 if (!p->is_hidden()) 345 m_surf->delete_dirty(p-> x, p->y, p->x + p->l, p->y + p->h);344 m_surf->delete_dirty(p->m_pos.x, p->m_pos.y, p->m_pos.x + p->l, p->m_pos.y + p->h); 346 345 update_dirty(m_surf); 347 346 348 347 if (has_mouse()) 349 m_surf->PutImage(m_sprite->save, vec2i(mx, my));348 m_surf->PutImage(m_sprite->save, m1); 350 349 351 350 for (Jwindow *p = m_first; p; p = p->next) … … 356 355 if (has_mouse()) 357 356 { 358 m_sprite->save->PutPart(p->m_surf, 0, 0, mx - p->x, my - p->y, 359 mx - p->x + m_sprite->visual->Size().x - 1, 360 my - p->y + m_sprite->visual->Size().y - 1); 361 p->m_surf->PutImage(m_sprite->visual, 362 vec2i(mx - p->x, my - p->y), 1); 357 m_sprite->save->PutPart(p->m_surf, 0, 0, m1.x - p->m_pos.x, m1.y - p->m_pos.y, 358 m1.x - p->m_pos.x + m_sprite->visual->Size().x - 1, 359 m1.y - p->m_pos.y + m_sprite->visual->Size().y - 1); 360 p->m_surf->PutImage(m_sprite->visual, m1 - p->m_pos, 1); 363 361 } 364 362 365 // m_surf->delete_dirty(p-> x, p->y, p->x+p->l, p->y+p->h);363 // m_surf->delete_dirty(p->m_pos.x, p->m_pos.y, p->m_pos.x+p->l, p->m_pos.y+p->h); 366 364 for (Jwindow *q = p->next; q; q = q->next) 367 365 if (!q->is_hidden()) 368 p->m_surf->delete_dirty(q-> x - p->x, q->y - p->y,369 q-> x + q->l - p->x,370 q-> y + q->h - p->y);371 update_dirty(p->m_surf, p-> x, p->y);366 p->m_surf->delete_dirty(q->m_pos.x - p->m_pos.x, q->m_pos.y - p->m_pos.y, 367 q->m_pos.x + q->l - p->m_pos.x, 368 q->m_pos.y + q->h - p->m_pos.y); 369 update_dirty(p->m_surf, p->m_pos.x, p->m_pos.y); 372 370 if (has_mouse()) 373 p->m_surf->PutImage(m_sprite->save, vec2i(mx - p->x, my - p->y), 0);371 p->m_surf->PutImage(m_sprite->save, m1 - p->m_pos, 0); 374 372 } 375 373 } … … 397 395 } 398 396 399 Jwindow::Jwindow( int X, int Y, int L, int H, ifield *f, char const *name)397 Jwindow::Jwindow(vec2i pos, int L, int H, ifield *f, char const *name) 400 398 { 401 399 l = 0; … … 413 411 l = L >= 0 ? L + left_border() : l - L; 414 412 h = H >= 0 ? H + top_border() : h - H; 415 y = Y >= 0 ? Y : yres - h + Y - top_border() - bottom_border() - 1;416 x = X >= 0 ? X : xres - l + X - left_border() - right_border() - 1;413 m_pos.x = pos.x >= 0 ? pos.x : xres - l + pos.x - left_border() - right_border() - 1; 414 m_pos.y = pos.y >= 0 ? pos.y : yres - h + pos.y - top_border() - bottom_border() - 1; 417 415 418 416 backg = wm->medium_color(); … … 605 603 if (j) 606 604 { 607 ev.mouse_move.x-=j->x; 608 ev.mouse_move.y-=j->y; 609 m_cur=j; 605 ev.mouse_move -= j->m_pos; 606 m_cur = j; 610 607 } 611 608 … … 662 659 663 660 if (j) 664 { 665 ev.mouse_move.x+=j->x; 666 ev.mouse_move.y+=j->y; 667 } 661 ev.mouse_move += j->m_pos; 668 662 } 669 663 … … 759 753 { 760 754 owner = NULL; 761 x = 0; 762 y = 0; 755 m_pos = vec2i(0, 0); 763 756 next = NULL; 764 757 id = 0; … … 774 767 { 775 768 if(owner) 776 move(x - owner->x1(), y - owner->y1());769 Move(m_pos - vec2i(owner->x1(), owner->y1())); 777 770 owner = newowner; 778 771 if(owner) 779 move(x + owner->x1(), y + owner->y1());780 } 781 772 Move(m_pos + vec2i(owner->x1(), owner->y1())); 773 } 774 -
abuse/trunk/src/imlib/jwindow.h
r655 r659 61 61 friend class InputManager; 62 62 63 protected:64 Jwindow *owner;65 66 63 public : 67 64 ifield(); 68 int x, y;65 virtual ~ifield(); 69 66 70 int id;71 ifield *next;72 67 virtual void set_owner(Jwindow *owner); 73 virtual void move(int newx, int newy) { x = newx; y = newy; }68 virtual void Move(vec2i pos) { m_pos = pos; } 74 69 virtual void area(int &x1, int &y1, int &x2, int &y2) = 0; 75 70 virtual void draw_first(image *screen) = 0; … … 81 76 virtual ifield *find(int search_id) { if (id==search_id) return this; else return NULL; } 82 77 virtual ifield *unlink(int id) { (void)id; return NULL; } 83 virtual ~ifield(); 84 } ; 78 79 vec2i m_pos; 80 int id; 81 ifield *next; 82 83 protected: 84 Jwindow *owner; 85 }; 85 86 86 87 class Jwindow … … 90 91 public: 91 92 Jwindow *next; 92 int x, y,l, h, backg;93 int l, h, backg; 93 94 InputManager *inm; 94 95 void *local_info; // pointer to info block for local system (may support windows) 95 96 96 97 Jwindow(char const *name = NULL); 97 Jwindow( int X, int Y, int L, int H, ifield *f, char const *name = NULL);98 Jwindow(vec2i pos, int L, int H, ifield *f, char const *name = NULL); 98 99 ~Jwindow(); 99 100 … … 122 123 static int bottom_border(); 123 124 125 vec2i m_pos; 124 126 image *m_surf; 125 127 -
abuse/trunk/src/imlib/pmenu.cpp
r655 r659 191 191 int cx1, cy1, cx2, cy2; 192 192 main_screen->GetClip(cx1, cy1, cx2, cy2); 193 if (parent-> x+w+x>=cx2)194 x=cx2-1-w-parent-> x;195 if (h+y+parent-> y>=cy2)196 { 197 if (parent-> y+parent->h+wm->font()->height()>=cy2)193 if (parent->m_pos.x + w + x >= cx2) 194 x=cx2-1-w-parent->m_pos.x; 195 if (h+y+parent->m_pos.y>=cy2) 196 { 197 if (parent->m_pos.y+parent->h+wm->font()->height()>=cy2) 198 198 y=-h; 199 199 else y=y-h+wm->font()->height()+5; … … 201 201 202 202 203 win=wm->new_window(parent-> x+x,parent->y+y,203 win=wm->new_window(parent->m_pos.x+x,parent->m_pos.y+y, 204 204 w - Jwindow::left_border() - Jwindow::right_border(), 205 205 h - Jwindow::top_border() - Jwindow::bottom_border(), … … 325 325 main_screen->GetClip(cx1, cy1, cx2, cy2); 326 326 327 x=win-> x;328 y=win-> y;327 x=win->m_pos.x; 328 y=win->m_pos.y; 329 329 330 330 int has_flags=0,dx=3; … … 353 353 } else return 1; 354 354 } else if (active!=-1) 355 return item_num(active)->handle_event(win,win-> x+dx,win->y+3+active*(th+1),w-6,0,ev);355 return item_num(active)->handle_event(win,win->m_pos.x+dx,win->m_pos.y+3+active*(th+1),w-6,0,ev); 356 356 else return 0; 357 357 … … 362 362 Event &ev) 363 363 { 364 x+=parent-> x;365 y+=parent-> y;364 x+=parent->m_pos.x; 365 y+=parent->m_pos.y; 366 366 if (ev.mouse_move.x>=x && ev.mouse_move.y>=y && ev.mouse_move.x<x+w && 367 367 ev.mouse_move.y<y+wm->font()->height()+2) … … 386 386 int cx1, cy1, cx2, cy2; 387 387 screen->GetClip(cx1, cy1, cx2, cy2); 388 mx-=bar-> x;389 my-=bar-> y;388 mx-=bar->m_pos.x; 389 my-=bar->m_pos.y; 390 390 if (mx<0 || my<0 || mx>=bar->m_surf->Size().x || my>=bar->m_surf->Size().y) return NULL; 391 391 else -
abuse/trunk/src/imlib/scroller.cpp
r655 r659 82 82 83 83 scroller::scroller(int X, int Y, int ID, int L, int H, int Vert, int Total_items, ifield *Next) 84 { x=X; y=Y; id=ID; next=Next; l=L; h=H; sx=0; t=Total_items; drag=-1; vert=Vert;84 { m_pos = vec2i(X, Y); id=ID; next=Next; l=L; h=H; sx=0; t=Total_items; drag=-1; vert=Vert; 85 85 } 86 86 … … 89 89 { 90 90 area_config(); 91 x1= x-1; y1=y-1;91 x1=m_pos.x-1; y1=m_pos.y-1; 92 92 if (vert) 93 { x2= x+l+bw(); y2=y+h; }93 { x2=m_pos.x+l+bw(); y2=m_pos.y+h; } 94 94 else 95 { x2= x+l; y2=y+h+bh(); }95 { x2=m_pos.x+l; y2=m_pos.y+h+bh(); } 96 96 } 97 97 … … 99 99 { 100 100 if (vert) 101 { x1= x+l; y1=y+bh(); x2=x+l+bw()-1; y2=y+h-bh()-1; }102 else { x1= x+bw(); y1=y+h; x2=x+l-bw(); y2=y+h+bh()-1; }101 { x1=m_pos.x+l; y1=m_pos.y+bh(); x2=m_pos.x+l+bw()-1; y2=m_pos.y+h-bh()-1; } 102 else { x1=m_pos.x+bw(); y1=m_pos.y+h; x2=m_pos.x+l-bw(); y2=m_pos.y+h+bh()-1; } 103 103 } 104 104 … … 146 146 if (vert) 147 147 { 148 x1= x+l+1;148 x1=m_pos.x+l+1; 149 149 if (t<2) 150 y1= y+bh()+1;150 y1=m_pos.y+bh()+1; 151 151 else 152 y1= y+bh()+1+sx*(sy2-sy1+1-bh())/(t-1);152 y1=m_pos.y+bh()+1+sx*(sy2-sy1+1-bh())/(t-1); 153 153 } else 154 154 { 155 if (t<2) x1= x+bw()+1;156 else x1= x+bw()+1+sx*(sx2-sx1+1-bw())/(t-1);157 y1= y+h+1;155 if (t<2) x1=m_pos.x+bw()+1; 156 else x1=m_pos.x+bw()+1+sx*(sx2-sx1+1-bw())/(t-1); 157 y1=m_pos.y+h+1; 158 158 } 159 159 x2=x1+bw()-3; … … 259 259 int x1,y1,x2,y2; 260 260 wig_area(x1,y1,x2,y2); 261 if (mx>= x && mx<=x+l-1 && my>=y && my<=y+h-1)261 if (mx>=m_pos.x && mx<=m_pos.x+l-1 && my>=m_pos.y && my<=m_pos.y+h-1) 262 262 handle_inside_event(ev,screen,inm); 263 263 } … … 351 351 int h=(y2-y1+1-bh()); 352 352 if (h) 353 return (my- y-bh()-bh()/2)*(t-1)/h;353 return (my-m_pos.y-bh()-bh()/2)*(t-1)/h; 354 354 else return 0; 355 355 } … … 358 358 int w=(x2-x1+1-bw()); 359 359 if (w) 360 return (mx- x-bw()-bw()/2)*(t-1)/w;360 return (mx-m_pos.x-bw()-bw()/2)*(t-1)/w; 361 361 else return 0; 362 362 } … … 366 366 void scroller::scroll_event(int newx, image *screen) 367 367 { 368 screen->Bar( vec2i(x, y), vec2i(x + l - 1, y +h - 1), wm->black());368 screen->Bar(m_pos, m_pos + vec2i(l - 1, h - 1), wm->black()); 369 369 int xa,ya,xo=0,yo; 370 if (vert) { xa=0; ya=30; yo= x+5; yo=y+5; } else { xa=30; ya=0; xo=x+5; yo=y+5; }370 if (vert) { xa=0; ya=30; yo=m_pos.x+5; yo=m_pos.y+5; } else { xa=30; ya=0; xo=m_pos.x+5; yo=m_pos.y+5; } 371 371 for (int i=newx,c=0; c<30 && i<100; i++,c++) 372 372 { … … 419 419 if (ev.type==EV_MOUSE_MOVE && activate_on_mouse_move()) 420 420 { 421 int sel=last_sel+(ev.mouse_move.y- y)/(wm->font()->height()+1);421 int sel=last_sel+(ev.mouse_move.y-m_pos.y)/(wm->font()->height()+1); 422 422 if (sel!=cur_sel && sel<t && sel>=0) 423 423 { … … 428 428 else if (ev.type==EV_MOUSE_BUTTON) 429 429 { 430 int sel=last_sel+(ev.mouse_move.y- y)/(wm->font()->height()+1);430 int sel=last_sel+(ev.mouse_move.y-m_pos.y)/(wm->font()->height()+1); 431 431 if (sel<t && sel>=0) 432 432 { … … 496 496 int cx1, cy1, cx2, cy2; 497 497 screen->GetClip(cx1, cy1, cx2, cy2); 498 screen->SetClip( x,y,x+l,y+h);498 screen->SetClip(m_pos.x,m_pos.y,m_pos.x+l,m_pos.y+h); 499 499 int tw=(l+tex->Size().x-1)/tex->Size().x; 500 500 int th=(h+tex->Size().y-1)/tex->Size().y; 501 int dy= y;501 int dy=m_pos.y; 502 502 for (int j=0; j<th; j++,dy+=tex->Size().y) 503 for (int i=0,dx= x; i<tw; i++,dx+=tex->Size().x)503 for (int i=0,dx=m_pos.x; i<tw; i++,dx+=tex->Size().x) 504 504 screen->PutImage(tex, vec2i(dx, dy)); 505 505 506 506 screen->SetClip(cx1, cy1, cx2, cy2); 507 } else screen->Bar( vec2i(x, y), vec2i(x + l - 1, y +h - 1), wm->black());508 509 int dy= y;507 } else screen->Bar(m_pos, m_pos + vec2i(l - 1, h - 1), wm->black()); 508 509 int dy=m_pos.y; 510 510 for (int i=0; i<th; i++,dy+=wm->font()->height()+1) 511 511 { 512 512 if (i+newx==cur_sel) 513 screen->Bar(vec2i( x, dy), vec2i(x + wid * wm->font()->width() - 1,513 screen->Bar(vec2i(m_pos.x, dy), vec2i(m_pos.x + wid * wm->font()->width() - 1, 514 514 dy + wm->font()->height()), 515 515 wm->dark_color()); 516 516 if (i+newx<t) 517 wm->font()->put_string(screen, x,dy,lis[i+newx].name,wm->bright_color());517 wm->font()->put_string(screen,m_pos.x,dy,lis[i+newx].name,wm->bright_color()); 518 518 } 519 519 } … … 581 581 void spicker::draw_background(image *screen) 582 582 { 583 screen->Bar( vec2i(x, y), vec2i(x + l - 1, y +h - 1), wm->dark_color());583 screen->Bar(m_pos, m_pos + vec2i(l - 1, h - 1), wm->dark_color()); 584 584 } 585 585 … … 611 611 last_sel=newx; 612 612 int xa,ya,xo,yo; 613 xo= x+2;614 yo= y+2;613 xo=m_pos.x+2; 614 yo=m_pos.y+2; 615 615 if (vert) { xa=0; ya=item_height(); } 616 616 else { xa=item_width(); ya=0; } … … 641 641 int me; 642 642 if (vert) 643 me=last_sel+(ev.mouse_move.y- y)/item_height();643 me=last_sel+(ev.mouse_move.y-m_pos.y)/item_height(); 644 644 else 645 me=last_sel+(ev.mouse_move.x- x)/item_width();645 me=last_sel+(ev.mouse_move.x-m_pos.x)/item_width(); 646 646 if (me<t && me>=0) 647 647 { … … 659 659 int me; 660 660 if (vert) 661 me=last_sel+(ev.mouse_move.y- y)/item_height();661 me=last_sel+(ev.mouse_move.y-m_pos.y)/item_height(); 662 662 else 663 me=last_sel+(ev.mouse_move.x- x)/item_width();663 me=last_sel+(ev.mouse_move.x-m_pos.x)/item_width(); 664 664 if (me<t && me>=0) 665 665 { -
abuse/trunk/src/imlib/scroller.h
r643 r659 23 23 void drag_area(int &x1, int &y1, int &x2, int &y2); 24 24 void dragger_area(int &x1, int &y1, int &x2, int &y2); 25 int b1x() { if (vert) return x+l; else returnx; }26 int b1y() { if (vert) return y; else returny+h; }27 int b2x() { if (vert) return x+l; else returnx+l-bw(); }28 int b2y() { if (vert) return y+h-bh(); else returny+h; }25 int b1x() { if (vert) return m_pos.x+l; else return m_pos.x; } 26 int b1y() { if (vert) return m_pos.y; else return m_pos.y+h; } 27 int b2x() { if (vert) return m_pos.x+l; else return m_pos.x+l-bw(); } 28 int b2y() { if (vert) return m_pos.y+h-bh(); else return m_pos.y+h; } 29 29 unsigned char *b1(); 30 30 unsigned char *b2(); -
abuse/trunk/src/loadgame.cpp
r658 r659 234 234 235 235 Jwindow *l_win=create_num_window(0,total_saved,MAX_SAVE_LINES,thumbnails); 236 Jwindow *preview=wm->new_window(l_win-> x+l_win->l+5,l_win->y,max_w,max_h,NULL,title);236 Jwindow *preview=wm->new_window(l_win->m_pos.x+l_win->l+5,l_win->m_pos.y,max_w,max_h,NULL,title); 237 237 238 238 preview->m_surf->PutImage(first, vec2i(preview->x1(), preview->y1())); -
abuse/trunk/src/netcfg.cpp
r651 r659 318 318 int X1,Y1,X2,Y2; 319 319 i->area(X1,Y1,X2,Y2); 320 i-> x=(x1+x2)/2-(X2-X1)/2;320 i->m_pos.x=(x1+x2)/2-(X2-X1)/2; 321 321 322 322 if (place_below) 323 323 { 324 324 place_below->area(X1,Y1,X2,Y2); 325 i-> y=Y2+2;325 i->m_pos.y=Y2+2; 326 326 } 327 327 return i; -
abuse/trunk/src/ui/volumewindow.cpp
r655 r659 31 31 d_da = cache.reg(ff, "d_da", SPEC_IMAGE, 1), 32 32 slider = cache.reg(ff, "volume_slide", SPEC_IMAGE, 1); 33 x = prop->getd("volume_x", xres / 2 - 20);34 y = prop->getd("volume_y", yres / 2 - 50);33 m_pos.x = prop->getd("volume_x", xres / 2 - 20); 34 m_pos.y = prop->getd("volume_y", yres / 2 - 50); 35 35 inm->add(new ico_button(10, 27, ID_SFX_DOWN, d_u, d_d, d_ua, d_da, 36 36 new ico_button(21, 27, ID_SFX_UP, u_u, u_d, u_ua, u_da,
Note: See TracChangeset
for help on using the changeset viewer.