Changeset 16
- Timestamp:
- Nov 10, 2005, 8:08:09 PM (17 years ago)
- Location:
- abuse/trunk/src
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
abuse/trunk/src/ant.cpp
r2 r16 17 17 void *ant_ai(); 18 18 19 int can_see(game_object *o, long x1, long y1, long x2, longy2)20 { 21 longnx2=x2,ny2=y2;19 int can_see(game_object *o, int32_t x1, int32_t y1, int32_t x2, int32_t y2) 20 { 21 int32_t nx2=x2,ny2=y2; 22 22 current_level->foreground_intersect(x1,y1,x2,y2); 23 23 if (x2!=nx2 || y2!=ny2) return 0; … … 95 95 static void fire_at_player(game_object *o, game_object *b) 96 96 { 97 longfirex=o->x+(o->direction>0?15:-15),firey=o->y-15,98 playerx=b->x+b->xvel()*8,playery=b->y-15+b->yvel()*2;97 int32_t firex=o->x+(o->direction>0?15:-15),firey=o->y-15, 98 playerx=b->x+b->xvel()*8,playery=b->y-15+b->yvel()*2; 99 99 if (can_see(o,o->x,o->y,firex,firey) && can_see(o,firex,firey,playerx,playery)) 100 100 { … … 224 224 if (!o->next_picture()) 225 225 { 226 longxv=0,yv=2;226 int32_t xv=0,yv=2; 227 227 o->try_move(o->x,o->y,xv,yv,1); 228 228 if (yv!=0) … … 264 264 else 265 265 { 266 longxm=o->direction>0 ? get_ability(o->otype,run_top_speed) : -get_ability(o->otype,run_top_speed);267 longym=0,new_xm=xm;266 int32_t xm=o->direction>0 ? get_ability(o->otype,run_top_speed) : -get_ability(o->otype,run_top_speed); 267 int32_t ym=0,new_xm=xm; 268 268 if (o->state!=running) o->set_state(running); 269 269 … … 349 349 // o->set_yvel(o->yvel()+1); 350 350 o->set_xacel(0); 351 longxv=0,yv=o->yvel();351 int32_t xv=0,yv=o->yvel(); 352 352 o->y-=31; 353 353 o->try_move(o->x,o->y,xv,yv,1); -
abuse/trunk/src/clisp.cpp
r2 r16 779 779 case 24 : 780 780 { 781 longx1=lnumber_value(eval(CAR(args))); args=CDR(args);782 longy1=lnumber_value(eval(CAR(args))); args=CDR(args);783 longx2=lnumber_value(eval(CAR(args))); args=CDR(args);784 longy2=lnumber_value(eval(CAR(args)));781 int32_t x1=lnumber_value(eval(CAR(args))); args=CDR(args); 782 int32_t y1=lnumber_value(eval(CAR(args))); args=CDR(args); 783 int32_t x2=lnumber_value(eval(CAR(args))); args=CDR(args); 784 int32_t y2=lnumber_value(eval(CAR(args))); 785 785 current_level->foreground_intersect(x1,y1,x2,y2); 786 786 void *ret=NULL; … … 816 816 { 817 817 818 longxm,ym,but;818 int32_t xm,ym,but; 819 819 xm=lnumber_value(CAR(args)); args=CDR(args); 820 820 ym=lnumber_value(CAR(args)); args=CDR(args); … … 892 892 case 49 : 893 893 { 894 longx=lnumber_value(eval(CAR(args))); args=CDR(args);895 longy=lnumber_value(eval(CAR(args))); args=CDR(args);896 897 longrx,ry;894 int32_t x=lnumber_value(eval(CAR(args))); args=CDR(args); 895 int32_t y=lnumber_value(eval(CAR(args))); args=CDR(args); 896 897 int32_t rx,ry; 898 898 the_game->mouse_to_game(x,y,rx,ry); 899 899 void *ret=NULL; … … 907 907 case 50 : 908 908 { 909 longx=lnumber_value(eval(CAR(args))); args=CDR(args);910 longy=lnumber_value(eval(CAR(args))); args=CDR(args);911 912 longrx,ry;909 int32_t x=lnumber_value(eval(CAR(args))); args=CDR(args); 910 int32_t y=lnumber_value(eval(CAR(args))); args=CDR(args); 911 912 int32_t rx,ry; 913 913 the_game->game_to_mouse(x,y,current_view,rx,ry); 914 914 void *ret=NULL; … … 1003 1003 long x; 1004 1004 sscanf(lstring_value(eval(CAR(args))),"%lx",&x); 1005 return new_lisp_pointer((void *) x);1005 return new_lisp_pointer((void *)(intptr_t)x); 1006 1006 } break; 1007 1007 case 64 : … … 1138 1138 case 22 : 1139 1139 { 1140 longx1,y1,x2,y2,xp1,yp1,xp2,yp2;1140 int32_t x1,y1,x2,y2,xp1,yp1,xp2,yp2; 1141 1141 current_level->attacker(current_object)->picture_space(x1,y1,x2,y2); 1142 1142 current_object->picture_space(xp1,yp1,xp2,yp2); … … 1156 1156 case 31 : return current_object->y; break; 1157 1157 case 32 : 1158 { longv=lnumber_value(CAR(args));1158 { int32_t v=lnumber_value(CAR(args)); 1159 1159 current_object->x=v; 1160 1160 // current_object->last_x=v; … … 1162 1162 } break; 1163 1163 case 33 : 1164 { longv=lnumber_value(CAR(args));1164 { int32_t v=lnumber_value(CAR(args)); 1165 1165 current_object->y=v; 1166 1166 // current_object->last_y=v; … … 1174 1174 case 37 : 1175 1175 { 1176 longs=lnumber_value(CAR(args));1176 int32_t s=lnumber_value(CAR(args)); 1177 1177 current_object->set_state((character_state)s); 1178 1178 return (s==current_object->state); … … 1280 1280 case 92 : 1281 1281 { 1282 longcx1,x1=lnumber_value(CAR(args)); args=lcdr(args);1283 longcy1,y1=lnumber_value(CAR(args)); args=lcdr(args);1284 longcx2,x2=lnumber_value(CAR(args)); args=lcdr(args);1285 longcy2,y2=lnumber_value(CAR(args)); args=lcdr(args);1286 longc=lnumber_value(CAR(args));1282 int32_t cx1,x1=lnumber_value(CAR(args)); args=lcdr(args); 1283 int32_t cy1,y1=lnumber_value(CAR(args)); args=lcdr(args); 1284 int32_t cx2,x2=lnumber_value(CAR(args)); args=lcdr(args); 1285 int32_t cy2,y2=lnumber_value(CAR(args)); args=lcdr(args); 1286 int32_t c=lnumber_value(CAR(args)); 1287 1287 the_game->game_to_mouse(x1,y1,current_view,cx1,cy1); 1288 1288 the_game->game_to_mouse(x2,y2,current_view,cx2,cy2); … … 1302 1302 case 104 : 1303 1303 { light_source *l=(light_source *)lpointer_value(CAR(args)); 1304 longx=lnumber_value(CAR(CDR(args)));1304 int32_t x=lnumber_value(CAR(CDR(args))); 1305 1305 if (x>=1) 1306 1306 l->inner_radius=x; … … 1310 1310 case 105 : 1311 1311 { light_source *l=(light_source *)lpointer_value(CAR(args)); 1312 longx=lnumber_value(CAR(CDR(args)));1312 int32_t x=lnumber_value(CAR(CDR(args))); 1313 1313 if (x>l->inner_radius) 1314 1314 l->outer_radius=x; … … 1397 1397 if (a) 1398 1398 { 1399 longx=lnumber_value(lcar(a)); a=CDR(a);1399 int32_t x=lnumber_value(lcar(a)); a=CDR(a); 1400 1400 if (!a) 1401 1401 { … … 1404 1404 exit(1); 1405 1405 } 1406 longy=lnumber_value(lcar(a));1406 int32_t y=lnumber_value(lcar(a)); 1407 1407 the_game->play_sound(id,vol,x,y); 1408 1408 } else cash.sfx(id)->play(vol); … … 1414 1414 case 138 : 1415 1415 { int id=lnumber_value(CAR(args)); args=CDR(args); 1416 longx=lnumber_value(CAR(args)); args=CDR(args);1417 longy=lnumber_value(CAR(args)); args=CDR(args);1418 longdir=lnumber_value(CAR(args));1416 int32_t x=lnumber_value(CAR(args)); args=CDR(args); 1417 int32_t y=lnumber_value(CAR(args)); args=CDR(args); 1418 int32_t dir=lnumber_value(CAR(args)); 1419 1419 add_panim(id,x,y,dir); 1420 1420 } break; 1421 1421 case 142 : 1422 1422 { 1423 longx=lnumber_value(CAR(args)); args=CDR(args);1423 int32_t x=lnumber_value(CAR(args)); args=CDR(args); 1424 1424 if (x<0 || x>=total_weapons) 1425 1425 { … … 1431 1431 case 143 : 1432 1432 { 1433 longx=lnumber_value(CAR(args)); args=CDR(args);1434 longy=lnumber_value(CAR(args)); args=CDR(args);1435 longr=lnumber_value(CAR(args)); args=CDR(args);1436 longm=lnumber_value(CAR(args)); args=CDR(args);1433 int32_t x=lnumber_value(CAR(args)); args=CDR(args); 1434 int32_t y=lnumber_value(CAR(args)); args=CDR(args); 1435 int32_t r=lnumber_value(CAR(args)); args=CDR(args); 1436 int32_t m=lnumber_value(CAR(args)); args=CDR(args); 1437 1437 game_object *o=(game_object *)lpointer_value(CAR(args)); args=CDR(args); 1438 longmp=lnumber_value(CAR(args));1438 int32_t mp=lnumber_value(CAR(args)); 1439 1439 current_level->hurt_radius(x,y,r,m,current_object,o,mp); 1440 1440 } break; … … 1446 1446 else 1447 1447 { 1448 longx=lnumber_value(CAR(args)); args=CDR(args);1449 longy=lnumber_value(CAR(args)); args=CDR(args);1448 int32_t x=lnumber_value(CAR(args)); args=CDR(args); 1449 int32_t y=lnumber_value(CAR(args)); args=CDR(args); 1450 1450 if (x<0 || x>=total_weapons) 1451 1451 { lbreak("weapon out of range (%d)\n",x); exit(0); } … … 1503 1503 { 1504 1504 game_object *o=(game_object *)lpointer_value(CAR(args)); 1505 longx=o->x-current_object->x,1505 int32_t x=o->x-current_object->x, 1506 1506 y=-(o->y-o->picture()->height()/2-(current_object->y-(current_object->picture()->height()/2))); 1507 1507 return lisp_atan2(y,x); … … 1509 1509 case 154 : 1510 1510 { 1511 longang=lnumber_value(CAR(args)); args=CDR(args);1512 longmag=lfixed_point_value(CAR(args));1513 longxvel=(lisp_cos(ang)>>8)*(mag>>8);1511 int32_t ang=lnumber_value(CAR(args)); args=CDR(args); 1512 int32_t mag=lfixed_point_value(CAR(args)); 1513 int32_t xvel=(lisp_cos(ang)>>8)*(mag>>8); 1514 1514 current_object->set_xvel(xvel>>16); 1515 1515 current_object->set_fxvel((xvel&0xffff)>>8); 1516 longyvel=-(lisp_sin(ang)>>8)*(mag>>8);1516 int32_t yvel=-(lisp_sin(ang)>>8)*(mag>>8); 1517 1517 current_object->set_yvel(yvel>>16); 1518 1518 current_object->set_fyvel((yvel&0xffff)>>8); … … 1522 1522 int tframes=current_object->total_frames(),f; 1523 1523 1524 longang1=lnumber_value(CAR(args)); args=CDR(args);1524 int32_t ang1=lnumber_value(CAR(args)); args=CDR(args); 1525 1525 if (ang1<0) ang1=(ang1%360)+360; 1526 1526 else if (ang1>=360) ang1=ang1%360; 1527 longang2=lnumber_value(CAR(args)); args=CDR(args);1527 int32_t ang2=lnumber_value(CAR(args)); args=CDR(args); 1528 1528 if (ang2<0) ang2=(ang2%360)+360; 1529 1529 else if (ang2>=360) ang2=ang2%360; 1530 1530 1531 longang=(lnumber_value(CAR(args))+90/tframes)%360;1531 int32_t ang=(lnumber_value(CAR(args))+90/tframes)%360; 1532 1532 if (ang1>ang2) 1533 1533 { … … 1557 1557 case 169 : 1558 1558 { 1559 longam=lnumber_value(CAR(args)); args=CDR(args);1559 int32_t am=lnumber_value(CAR(args)); args=CDR(args); 1560 1560 game_object *from=(game_object *)lpointer_value(CAR(args)); args=CDR(args); 1561 longhitx=lnumber_value(CAR(args)); args=CDR(args);1562 longhity=lnumber_value(CAR(args)); args=CDR(args);1563 longpx=lnumber_value(CAR(args)); args=CDR(args);1564 longpy=lnumber_value(CAR(args)); args=CDR(args);1561 int32_t hitx=lnumber_value(CAR(args)); args=CDR(args); 1562 int32_t hity=lnumber_value(CAR(args)); args=CDR(args); 1563 int32_t px=lnumber_value(CAR(args)); args=CDR(args); 1564 int32_t py=lnumber_value(CAR(args)); args=CDR(args); 1565 1565 current_object->damage_fun(am,from,hitx,hity,px,py); 1566 1566 } break; … … 1629 1629 { 1630 1630 view *v=lget_view(CAR(args),"set_ambient_light"); args=CDR(args); 1631 longx=lnumber_value(CAR(args));1631 int32_t x=lnumber_value(CAR(args)); 1632 1632 if (x>=0 && x<64) v->ambient=x; 1633 1633 } break; … … 1657 1657 case 192 : 1658 1658 { 1659 longx=lnumber_value(CAR(args)); args=CDR(args);1660 longy=lnumber_value(CAR(args)); args=CDR(args);1661 longtype=lnumber_value(CAR(args));1659 int32_t x=lnumber_value(CAR(args)); args=CDR(args); 1660 int32_t y=lnumber_value(CAR(args)); args=CDR(args); 1661 int32_t type=lnumber_value(CAR(args)); 1662 1662 if (x<0 || y<0 || x>=current_level->foreground_width() || y>=current_level->foreground_width()) 1663 1663 lbreak("%d %d is out of range of fg map",x,y); … … 1667 1667 case 193 : 1668 1668 { 1669 longx=lnumber_value(CAR(args)); args=CDR(args);1670 longy=lnumber_value(CAR(args));1669 int32_t x=lnumber_value(CAR(args)); args=CDR(args); 1670 int32_t y=lnumber_value(CAR(args)); 1671 1671 if (x<0 || y<0 || x>=current_level->foreground_width() || y>=current_level->foreground_width()) 1672 1672 lbreak("%d %d is out of range of fg map",x,y); … … 1675 1675 case 194 : 1676 1676 { 1677 longx=lnumber_value(CAR(args)); args=CDR(args);1678 longy=lnumber_value(CAR(args)); args=CDR(args);1679 longtype=lnumber_value(CAR(args));1677 int32_t x=lnumber_value(CAR(args)); args=CDR(args); 1678 int32_t y=lnumber_value(CAR(args)); args=CDR(args); 1679 int32_t type=lnumber_value(CAR(args)); 1680 1680 if (x<0 || y<0 || x>=current_level->background_width() || y>=current_level->background_width()) 1681 1681 lbreak("%d %d is out of range of fg map",x,y); … … 1685 1685 case 195 : 1686 1686 { 1687 longx=lnumber_value(CAR(args)); args=CDR(args);1688 longy=lnumber_value(CAR(args));1687 int32_t x=lnumber_value(CAR(args)); args=CDR(args); 1688 int32_t y=lnumber_value(CAR(args)); 1689 1689 if (x<0 || y<0 || x>=current_level->background_width() || y>=current_level->background_width()) 1690 1690 lbreak("%d %d is out of range of fg map",x,y); … … 1741 1741 case 200 : 1742 1742 { 1743 longxv=lnumber_value(CAR(args)); args=CDR(args);1744 longyv=lnumber_value(CAR(args)); args=CDR(args);1743 int32_t xv=lnumber_value(CAR(args)); args=CDR(args); 1744 int32_t yv=lnumber_value(CAR(args)); args=CDR(args); 1745 1745 int top=2; 1746 1746 if (args) 1747 1747 if (!CAR(args)) top=0; 1748 1748 1749 longoxv=xv,oyv=yv;1749 int32_t oxv=xv,oyv=yv; 1750 1750 current_object->try_move(current_object->x,current_object->y,xv,yv,1|top); 1751 1751 current_object->x+=xv; … … 1755 1755 case 201 : 1756 1756 { 1757 longx=lnumber_value(CAR(args));1757 int32_t x=lnumber_value(CAR(args)); 1758 1758 return figures[current_object->otype]->get_sequence((character_state)x)->length(); 1759 1759 } break; 1760 1760 case 202 : 1761 1761 { 1762 longx1=lnumber_value(CAR(args)); args=CDR(args);1763 longy1=lnumber_value(CAR(args)); args=CDR(args);1764 longx2=lnumber_value(CAR(args)); args=CDR(args);1765 longy2=lnumber_value(CAR(args)); args=CDR(args);1762 int32_t x1=lnumber_value(CAR(args)); args=CDR(args); 1763 int32_t y1=lnumber_value(CAR(args)); args=CDR(args); 1764 int32_t x2=lnumber_value(CAR(args)); args=CDR(args); 1765 int32_t y2=lnumber_value(CAR(args)); args=CDR(args); 1766 1766 void *block_all=CAR(args); 1767 longnx2=x2,ny2=y2;1767 int32_t nx2=x2,ny2=y2; 1768 1768 current_level->foreground_intersect(x1,y1,x2,y2); 1769 1769 if (x2!=nx2 || y2!=ny2) return 0; … … 1796 1796 case 206 : 1797 1797 { 1798 longx=lnumber_value(CAR(args));1798 int32_t x=lnumber_value(CAR(args)); 1799 1799 if (x<current_object->total_frames()) 1800 1800 current_object->current_frame=x; … … 1834 1834 case 216 : 1835 1835 { 1836 longx1=lnumber_value(CAR(args)); args=lcdr(args);1837 longy1=lnumber_value(CAR(args)); args=lcdr(args);1838 longid=lnumber_value(CAR(args));1836 int32_t x1=lnumber_value(CAR(args)); args=lcdr(args); 1837 int32_t y1=lnumber_value(CAR(args)); args=lcdr(args); 1838 int32_t id=lnumber_value(CAR(args)); 1839 1839 cash.img(id)->put_image(screen,x1,y1,1); 1840 1840 } break; … … 1935 1935 else 1936 1936 { 1937 longx=lnumber_value(CAR(args));1937 int32_t x=lnumber_value(CAR(args)); 1938 1938 if (x<0 || x>=total_weapons) 1939 1939 { lbreak("weapon out of range (%d)\n",x); exit(0); } … … 1957 1957 case 234 : 1958 1958 { 1959 longcx1,x1=lnumber_value(CAR(args)); args=lcdr(args);1960 longcy1,y1=lnumber_value(CAR(args)); args=lcdr(args);1961 longcx2,x2=lnumber_value(CAR(args)); args=lcdr(args);1962 longcy2,y2=lnumber_value(CAR(args)); args=lcdr(args);1963 longc=lnumber_value(CAR(args)); args=lcdr(args);1964 longs=lnumber_value(CAR(args));1959 int32_t cx1,x1=lnumber_value(CAR(args)); args=lcdr(args); 1960 int32_t cy1,y1=lnumber_value(CAR(args)); args=lcdr(args); 1961 int32_t cx2,x2=lnumber_value(CAR(args)); args=lcdr(args); 1962 int32_t cy2,y2=lnumber_value(CAR(args)); args=lcdr(args); 1963 int32_t c=lnumber_value(CAR(args)); args=lcdr(args); 1964 int32_t s=lnumber_value(CAR(args)); 1965 1965 the_game->game_to_mouse(x1,y1,current_view,cx1,cy1); 1966 1966 the_game->game_to_mouse(x2,y2,current_view,cx2,cy2); … … 2009 2009 case 244 : 2010 2010 { 2011 longcx1,x1=lnumber_value(CAR(args)); args=lcdr(args);2012 longcy1,y1=lnumber_value(CAR(args)); args=lcdr(args);2013 longcx2,x2=lnumber_value(CAR(args)); args=lcdr(args);2014 longcy2,y2=lnumber_value(CAR(args)); args=lcdr(args);2015 longc1=lnumber_value(CAR(args)); args=lcdr(args);2016 longc2=lnumber_value(CAR(args)); args=lcdr(args);2017 longs=lnumber_value(CAR(args));2011 int32_t cx1,x1=lnumber_value(CAR(args)); args=lcdr(args); 2012 int32_t cy1,y1=lnumber_value(CAR(args)); args=lcdr(args); 2013 int32_t cx2,x2=lnumber_value(CAR(args)); args=lcdr(args); 2014 int32_t cy2,y2=lnumber_value(CAR(args)); args=lcdr(args); 2015 int32_t c1=lnumber_value(CAR(args)); args=lcdr(args); 2016 int32_t c2=lnumber_value(CAR(args)); args=lcdr(args); 2017 int32_t s=lnumber_value(CAR(args)); 2018 2018 the_game->game_to_mouse(x1,y1,current_view,cx1,cy1); 2019 2019 the_game->game_to_mouse(x2,y2,current_view,cx2,cy2); … … 2032 2032 case 247 : 2033 2033 { 2034 longcx1=lnumber_value(CAR(args)); args=lcdr(args);2035 longcy1=lnumber_value(CAR(args)); args=lcdr(args);2036 longcx2=lnumber_value(CAR(args)); args=lcdr(args);2037 longcy2=lnumber_value(CAR(args)); args=lcdr(args);2038 longc1=lnumber_value(CAR(args)); args=lcdr(args);2034 int32_t cx1=lnumber_value(CAR(args)); args=lcdr(args); 2035 int32_t cy1=lnumber_value(CAR(args)); args=lcdr(args); 2036 int32_t cx2=lnumber_value(CAR(args)); args=lcdr(args); 2037 int32_t cy2=lnumber_value(CAR(args)); args=lcdr(args); 2038 int32_t c1=lnumber_value(CAR(args)); args=lcdr(args); 2039 2039 screen->bar(cx1,cy1,cx2,cy2,c1); 2040 2040 } break; … … 2187 2187 { 2188 2188 JCFont *fnt=(JCFont *)lpointer_value(CAR(args)); args=CDR(args); 2189 longx=lnumber_value(CAR(args)); args=CDR(args);2190 longy=lnumber_value(CAR(args)); args=CDR(args);2189 int32_t x=lnumber_value(CAR(args)); args=CDR(args); 2190 int32_t y=lnumber_value(CAR(args)); args=CDR(args); 2191 2191 char *st=lstring_value(CAR(args)); args=CDR(args); 2192 2192 int color=-1; … … 2206 2206 case 282 : 2207 2207 { 2208 longx1=lnumber_value(CAR(args)); args=CDR(args);2209 longy1=lnumber_value(CAR(args)); args=CDR(args);2210 longx2=lnumber_value(CAR(args)); args=CDR(args);2211 longy2=lnumber_value(CAR(args)); args=CDR(args);2212 longc=lnumber_value(CAR(args));2208 int32_t x1=lnumber_value(CAR(args)); args=CDR(args); 2209 int32_t y1=lnumber_value(CAR(args)); args=CDR(args); 2210 int32_t x2=lnumber_value(CAR(args)); args=CDR(args); 2211 int32_t y2=lnumber_value(CAR(args)); args=CDR(args); 2212 int32_t c=lnumber_value(CAR(args)); 2213 2213 screen->bar(x1,y1,x2,y2,c); 2214 2214 } break; 2215 2215 case 283 : 2216 2216 { 2217 longx1=lnumber_value(CAR(args)); args=CDR(args);2218 longy1=lnumber_value(CAR(args)); args=CDR(args);2219 longx2=lnumber_value(CAR(args)); args=CDR(args);2220 longy2=lnumber_value(CAR(args)); args=CDR(args);2221 longc=lnumber_value(CAR(args));2217 int32_t x1=lnumber_value(CAR(args)); args=CDR(args); 2218 int32_t y1=lnumber_value(CAR(args)); args=CDR(args); 2219 int32_t x2=lnumber_value(CAR(args)); args=CDR(args); 2220 int32_t y2=lnumber_value(CAR(args)); args=CDR(args); 2221 int32_t c=lnumber_value(CAR(args)); 2222 2222 screen->rectangle(x1,y1,x2,y2,c); 2223 2223 } break; -
abuse/trunk/src/collide.cpp
r4 r16 5 5 { 6 6 public : 7 longtotal,x1,y1,x2,y2;7 int32_t total,x1,y1,x2,y2; 8 8 game_object **touch; 9 9 collide_patch *next; 10 collide_patch( long X1, long Y1, long X2, longY2, collide_patch *Next)10 collide_patch(int32_t X1, int32_t Y1, int32_t X2, int32_t Y2, collide_patch *Next) 11 11 { 12 12 x1=X1; y1=Y1; x2=X2; y2=Y2; … … 15 15 touch=NULL; 16 16 } 17 void add_collide( long X1, long Y1, long X2, longY2, game_object *who);17 void add_collide(int32_t X1, int32_t Y1, int32_t X2, int32_t Y2, game_object *who); 18 18 collide_patch *copy(collide_patch *Next); 19 19 ~collide_patch() { if (total) jfree(touch); } … … 36 36 37 37 38 void add_collide(collide_patch *&first, long x1, long y1, long x2, longy2,38 void add_collide(collide_patch *&first, int32_t x1, int32_t y1, int32_t x2, int32_t y2, 39 39 game_object *who) 40 40 { … … 148 148 { 149 149 game_object *target,*rec,*subject; 150 longsx1,sy1,sx2,sy2,tx1,ty1,tx2,ty2,hitx=0,hity=0,t_centerx;150 int32_t sx1,sy1,sx2,sy2,tx1,ty1,tx2,ty2,hitx=0,hity=0,t_centerx; 151 151 152 152 for (int l=0;l<attack_total;l++) … … 184 184 for (t_dat=t_damage->data,j=(int)t_damage->tot-1;j>0 && !rec;j--) 185 185 { 186 longx1,y1,x2,y2, // define the two line segments to check186 int32_t x1,y1,x2,y2, // define the two line segments to check 187 187 xp1,yp1,xp2,yp2; 188 188 … … 200 200 // ok, now we know which line segemnts to check for intersection 201 201 // now check to see if (x1,y1-x2,y2) intercest with (xp1,yp1-xp2,yp2) 202 int _x2=x2,_y2=y2;202 int32_t _x2=x2,_y2=y2; 203 203 setback_intersect(x1, y1, x2, y2, xp1, yp1, xp2, yp2,0); 204 204 -
abuse/trunk/src/cop.cpp
r4 r16 204 204 // fire try to move up to gun level 205 205 206 longx2=o->x,y2=firey;206 int32_t x2=o->x,y2=firey; 207 207 // current_level->foreground_intersect(other->x,other->y,x2,y2); // find first location we can actuall "see" 208 208 // current_level->all_boundary_setback(o,other->x,other->y,x2,y2); // to make we don't fire through walls … … 247 247 if (!o->lvars[fire_delay1]) // make sur we are not waiting of previous fire 248 248 { 249 longvalue=lnumber_value(eval(CAR(args)));249 int32_t value=lnumber_value(eval(CAR(args))); 250 250 if (value) // do we have ammo ? 251 251 { … … 289 289 if (!o->lvars[fire_delay1]) // make sur we are not waiting of previous fire 290 290 { 291 longvalue=lnumber_value(eval(CAR(args)));291 int32_t value=lnumber_value(eval(CAR(args))); 292 292 if (value) // do we have ammo ? 293 293 { … … 316 316 if (!o->lvars[fire_delay1]) // make sur we are not waiting of previous fire 317 317 { 318 longvalue=lnumber_value(eval(CAR(args)));318 int32_t value=lnumber_value(eval(CAR(args))); 319 319 if (value) // do we have ammo ? 320 320 { … … 340 340 if (!o->lvars[fire_delay1]) // make sur we are not waiting of previous fire 341 341 { 342 longvalue=lnumber_value(eval(CAR(args)));342 int32_t value=lnumber_value(eval(CAR(args))); 343 343 if (value) // do we have ammo ? 344 344 { … … 367 367 if (!o->lvars[fire_delay1]) // make sur we are not waiting of previous fire 368 368 { 369 longvalue=lnumber_value(eval(CAR(args)));369 int32_t value=lnumber_value(eval(CAR(args))); 370 370 if (value) // do we have ammo ? 371 371 { … … 466 466 o->lvars[last1_x]=o->x; 467 467 o->lvars[last1_y]=o->y; 468 longoyvel=o->yvel();468 int32_t oyvel=o->yvel(); 469 469 int in=o->lvars[in_climbing_area]; 470 470 … … 532 532 /* if (o->lvars[special_power]==FAST_POWER) 533 533 { 534 longxv=0,yv=4;534 int32_t xv=0,yv=4; 535 535 o->try_move(o->x,o->y,xv,yv,1); 536 536 if (yv==4) … … 557 557 if (xm) // trying to get off the ladder, check to see if that's ok 558 558 { 559 longx2=0,y2=-20;559 int32_t x2=0,y2=-20; 560 560 o->try_move(o->x,o->y,x2,y2,3); 561 561 if (y2==-20) … … 898 898 o->lvars[sgb_speed]=o->lvars[sgb_speed]*6/5; 899 899 900 longang=o->lvars[sgb_angle];901 longmag=o->lvars[sgb_speed];902 903 longxvel=(lisp_cos(ang))*(mag);900 int32_t ang=o->lvars[sgb_angle]; 901 int32_t mag=o->lvars[sgb_speed]; 902 903 int32_t xvel=(lisp_cos(ang))*(mag); 904 904 current_object->set_xvel(xvel>>16); 905 905 current_object->set_fxvel((xvel&0xffff)>>8); 906 longyvel=-(lisp_sin(ang))*(mag);906 int32_t yvel=-(lisp_sin(ang))*(mag); 907 907 current_object->set_yvel(yvel>>16); 908 908 current_object->set_fyvel((yvel&0xffff)>>8); … … 1019 1019 { 1020 1020 int color=lnumber_value(lget_array_element(symbol_value(l_player_text_color),sorted_players[i]->player_number)); 1021 sprintf(msg,"%3ld %s", sorted_players[i]->kills,sorted_players[i]->name);1021 sprintf(msg,"%3ld %s",(long)sorted_players[i]->kills,sorted_players[i]->name); 1022 1022 if (sorted_players[i]==local) 1023 1023 strcat(msg," <<"); … … 1066 1066 1067 1067 1068 sprintf(msg,"%-17s %3ld %3ld",max_name, v->kills,v->tkills+v->kills);1068 sprintf(msg,"%-17s %3ld %3ld",max_name,(long)v->kills,(long)(v->tkills+v->kills)); 1069 1069 fnt->put_string(screen,x,y,msg,color); 1070 1070 -
abuse/trunk/src/demo.cpp
r4 r16 107 107 { 108 108 process_packet_commands(buf,size); 109 longmx,my;109 int32_t mx,my; 110 110 the_game->game_to_mouse(player_list->pointer_x,player_list->pointer_y,player_list,mx,my); 111 111 eh->set_mouse_position(small_render ? mx*2 : mx, small_render ? my*2 : my); -
abuse/trunk/src/dev.cpp
r4 r16 276 276 277 277 278 long dev_controll::snap_x(longx)278 int32_t dev_controll::snap_x(int32_t x) 279 279 { 280 280 if (eh->key_pressed(JK_CTRL_L) || eh->key_pressed(JK_CTRL_R)) … … 285 285 } 286 286 287 long dev_controll::snap_y(longy)287 int32_t dev_controll::snap_y(int32_t y) 288 288 { 289 289 if (eh->key_pressed(JK_CTRL_L) || eh->key_pressed(JK_CTRL_R)) … … 341 341 { 342 342 unsigned char *sl1,*sl2; 343 longxstep=(im->width()<<16)/new_width,343 int32_t xstep=(im->width()<<16)/new_width, 344 344 ystep=(im->height()<<16)/new_height,iy,ix,sx,ix_start,iy_start; 345 345 screen->add_dirty(x,y,x+new_width-1,y+new_height-1); … … 380 380 { 381 381 unsigned char *sl1,*sl2; 382 longxstep=(im->width()<<16)/new_width,382 int32_t xstep=(im->width()<<16)/new_width, 383 383 ystep=(im->height()<<16)/new_height,iy,ix,sx,ix_start,iy_start; 384 384 screen->add_dirty(x,y,x+new_width-1,y+new_height-1); … … 438 438 void dev_controll::dev_draw(view *v) 439 439 { 440 longx1,y1,x2,y2;440 int32_t x1,y1,x2,y2; 441 441 if (dev&EDIT_MODE) 442 442 { 443 longvx=v->xoff(),vy=v->yoff();443 int32_t vx=v->xoff(),vy=v->yoff(); 444 444 445 445 if (dev&DRAW_LINKS) … … 459 459 if (link_object) 460 460 { 461 longrx1,ry1;461 int32_t rx1,ry1; 462 462 the_game->game_to_mouse(link_object->x,link_object->y,v,rx1,ry1); 463 463 screen->line(rx1,ry1,dlastx,dlasty,yellow); … … 468 468 image *i=cash.img(light_buttons[0]); 469 469 int l=i->width()/2,h=i->height()/2; 470 longrx1,ry1;470 int32_t rx1,ry1; 471 471 the_game->game_to_mouse(selected_light->x,selected_light->y,v,rx1,ry1); 472 472 screen->rectangle(rx1-l,ry1-h,rx1+l,ry1+h,eh->bright_color()); … … 510 510 { 511 511 selected_object->picture_space(x1,y1,x2,y2); 512 longrx1,ry1,rx2,ry2;512 int32_t rx1,ry1,rx2,ry2; 513 513 the_game->game_to_mouse(x1,y1,v,rx1,ry1); 514 514 the_game->game_to_mouse(x2,y2,v,rx2,ry2); … … 530 530 } 531 531 532 light_source *find_light( long x, longy)532 light_source *find_light(int32_t x, int32_t y) 533 533 { 534 534 image *i=cash.img(light_buttons[0]); … … 1031 1031 { 1032 1032 edit_object=selected_object=NULL; 1033 longcx=player_list->focus->x,cy=player_list->focus->y;1033 int32_t cx=player_list->focus->x,cy=player_list->focus->y; 1034 1034 1035 1035 // save the old weapon array 1036 long *w=(long *)jmalloc(total_weapons*sizeof(long),"tmp weapon array");1037 memcpy(w,player_list->weapons,total_weapons*sizeof( long));1036 int32_t *w=(int32_t *)jmalloc(total_weapons*sizeof(int32_t),"tmp weapon array"); 1037 memcpy(w,player_list->weapons,total_weapons*sizeof(int32_t)); 1038 1038 1039 1039 char tmp[100]; … … 1048 1048 player_list->focus->y=cy; 1049 1049 1050 memcpy(player_list->weapons,w,total_weapons*sizeof( long));1050 memcpy(player_list->weapons,w,total_weapons*sizeof(int32_t)); 1051 1051 jfree(w); 1052 1052 … … 1057 1057 if (!strcmp(fword,"unchop")) 1058 1058 { 1059 longrx,ry;1059 int32_t rx,ry; 1060 1060 the_game->btile_on(dlastx,dlasty,rx,ry); 1061 1061 if (rx>=0 && ry>=0) … … 1179 1179 if (t>=0) // did we find it? 1180 1180 { 1181 longrx,ry;1181 int32_t rx,ry; 1182 1182 the_game->mouse_to_game(dlastx,dlasty,rx,ry); 1183 1183 edit_object=create(t,rx,ry); … … 1216 1216 if (!strcmp(fword,"clear_auto")) 1217 1217 { 1218 longi,j;1218 int32_t i,j; 1219 1219 for (i=0;i<current_level->foreground_width();i++) 1220 1220 for (j=0;j<current_level->foreground_height();j++) … … 1224 1224 if (!strcmp(fword,"fg_select")) 1225 1225 { 1226 longx,y;1226 int32_t x,y; 1227 1227 the_game->ftile_on(dlastx,dlasty,x,y); 1228 1228 if (x>=0 && y>=0 && x<current_level->foreground_width() && … … 1238 1238 if (!strcmp(fword,"toggle_fg_raise")) 1239 1239 { 1240 longx,y;1240 int32_t x,y; 1241 1241 the_game->ftile_on(dlastx,dlasty,x,y); 1242 1242 if (x>=0 && y>=0 && x<current_level->foreground_width() && … … 1487 1487 { 1488 1488 game_object *o=ai_object; 1489 longx;1489 int32_t x; 1490 1490 if (o) 1491 1491 { … … 1537 1537 if (ev.type==EV_MOUSE_BUTTON && ev.mouse_button) 1538 1538 { 1539 longgx,gy;1539 int32_t gx,gy; 1540 1540 the_game->mouse_to_game(last_demo_mx,last_demo_my,gx,gy); 1541 1541 if (!current_level) return ; … … 1577 1577 if (ev.type==EV_MOUSE_BUTTON && ev.mouse_button) 1578 1578 { 1579 longmx=last_demo_mx,my=last_demo_my;1579 int32_t mx=last_demo_mx,my=last_demo_my; 1580 1580 view *v=the_game->view_in(mx,my); 1581 1581 for (area_controller *a=current_level->area_list;a;a=a->next) 1582 1582 { 1583 longx1,y1,x2,y2;1583 int32_t x1,y1,x2,y2; 1584 1584 the_game->game_to_mouse(a->x,a->y,v,x1,y1); 1585 1585 the_game->game_to_mouse(a->x+a->w,a->y+a->h,v,x2,y2); … … 1646 1646 void dev_controll::handle_event(event &ev) 1647 1647 { 1648 longx,y;1648 int32_t x,y; 1649 1649 if (link_object && (dlastx!=last_link_x || dlasty!=last_link_y)) 1650 1650 { … … 1724 1724 if (ev.window==NULL && ev.type==EV_KEY && ev.key=='d') 1725 1725 { 1726 longxv=0,yv=100;1726 int32_t xv=0,yv=100; 1727 1727 edit_object->try_move(edit_object->x,edit_object->y,xv,yv,1); 1728 1728 edit_object->y+=yv; … … 1822 1822 if (current_area) 1823 1823 { 1824 longgx,gy;1824 int32_t gx,gy; 1825 1825 the_game->mouse_to_game(last_demo_mx,last_demo_my,gx,gy); 1826 1826 if (gx>current_area->x && gy>current_area->y) … … 1845 1845 if (current_area) 1846 1846 { 1847 longgx,gy;1847 int32_t gx,gy; 1848 1848 the_game->mouse_to_game(last_demo_mx,last_demo_my,gx,gy); 1849 1849 if (gx<current_area->x+current_area->w && gy<current_area->y+current_area->h) … … 1872 1872 if (ev.window==NULL) 1873 1873 { 1874 longrx,ry;1874 int32_t rx,ry; 1875 1875 the_game->mouse_to_game(last_demo_mx,last_demo_my,rx,ry); 1876 1876 … … 1892 1892 if (ev.mouse_button==1 && !selected_object && !selected_light) 1893 1893 { 1894 longxs,ys;1894 int32_t xs,ys; 1895 1895 the_game->ftile_on(last_demo_mx,last_demo_my,xs,ys); 1896 1896 if (xs>=0 && ys>=0 && xs<current_level->foreground_width() && … … 1900 1900 } else if (ev.mouse_button==1 && !selected_object && !selected_light) 1901 1901 { 1902 longxs,ys;1902 int32_t xs,ys; 1903 1903 the_game->btile_on(last_demo_mx,last_demo_my,xs,ys); 1904 1904 if (xs>=0 && ys>=0 && xs<current_level->background_width() && … … 2518 2518 case DEV_LIGHT9 : 2519 2519 { 2520 longlx,ly;2520 int32_t lx,ly; 2521 2521 the_game->mouse_to_game(last_demo_mx,last_demo_my,lx,ly); 2522 2522 lx=snap_x(lx); … … 2855 2855 case 'w' : 2856 2856 { 2857 longrx,ry;2857 int32_t rx,ry; 2858 2858 the_game->mouse_to_game(dlastx,dlasty,rx,ry); 2859 2859 char msg[100]; sprintf(msg,symbol_str("mouse_at"),rx,ry); … … 2877 2877 if (current_level && player_list && player_list->focus) 2878 2878 { 2879 longrx,ry;2879 int32_t rx,ry; 2880 2880 the_game->mouse_to_game(dlastx,dlasty,rx,ry); 2881 2881 player_list->focus->x=rx; … … 3150 3150 case ' ' : 3151 3151 { 3152 longxs,ys,xx,yy;3152 int32_t xs,ys,xx,yy; 3153 3153 the_game->ftile_on(me->x,me->y,xs,ys); 3154 3154 … … 3165 3165 case 't' : 3166 3166 { 3167 longxs,ys;3167 int32_t xs,ys; 3168 3168 the_game->ftile_on(me->x,me->y,xs,ys); 3169 3169 dev_cont->fg_fill(-1,xs,ys,this); … … 3211 3211 } 3212 3212 3213 fprintf(fp,"(add_palette \"%s\" %ld %ld %ld %ld %ld ",name, w,h,x,y,scale);3213 fprintf(fp,"(add_palette \"%s\" %ld %ld %ld %ld %ld ",name,(long)w,(long)h,(long)x,(long)y,(long)scale); 3214 3214 int i; 3215 3215 for (i=0;i<w*h;i++) -
abuse/trunk/src/game.cpp
r9 r16 58 58 double sum_diffs=1,total_diffs=12; 59 59 int total_active=0; 60 longmap_xoff=0,map_yoff=0;61 longcurrent_vxadd,current_vyadd;60 int32_t map_xoff=0,map_yoff=0; 61 int32_t current_vxadd,current_vyadd; 62 62 int frame_panic=0,massive_frame_panic=0; 63 63 int demo_start=0,idle_ticks=0; … … 136 136 } 137 137 138 void game::play_sound(int id, int vol, long x, longy)138 void game::play_sound(int id, int vol, int32_t x, int32_t y) 139 139 { 140 140 if( sound_avail & SFX_INITIALIZED ) … … 145 145 return; 146 146 147 u longmdist = 0xffffffff;147 uint32_t mdist = 0xffffffff; 148 148 view *cd = NULL; 149 149 for( view *f = player_list; f ; f = f->next ) … … 151 151 if( f->local_player() ) 152 152 { 153 longcx = abs(f->x_center()-x),cy = abs(f->y_center()-y), d;153 int32_t cx = abs(f->x_center()-x),cy = abs(f->y_center()-y), d; 154 154 if( cx < cy ) 155 155 d = cx + cy - ( cx >> 1 ); … … 277 277 } 278 278 279 void game::ftile_on(int screenx, int screeny, long &x, long&y)279 void game::ftile_on(int screenx, int screeny, int32_t &x, int32_t &y) 280 280 { 281 281 mouse_to_game(screenx,screeny,x,y); … … 285 285 if (f) 286 286 { 287 x=(( long)(screenx)-(long)f->cx1+f->xoff())/(long)f_wid;288 y=(( long)(screeny)-(long)f->cy1+f->yoff())/(long)f_hi;287 x=((int32_t)(screenx)-(int32_t)f->cx1+f->xoff())/(int32_t)f_wid; 288 y=((int32_t)(screeny)-(int32_t)f->cy1+f->yoff())/(int32_t)f_hi; 289 289 } 290 290 else … … 295 295 } 296 296 297 void game::btile_on(int screenx, int screeny, long &x, long&y)297 void game::btile_on(int screenx, int screeny, int32_t &x, int32_t &y) 298 298 { 299 299 view *f=view_in(screenx,screeny); 300 300 if (f) 301 301 { 302 x=(( long)(screenx)-(long)f->cx1+f->xoff()*bg_xmul/bg_xdiv)/(long)b_wid;303 y=(( long)(screeny)-(long)f->cy1+f->yoff()*bg_ymul/bg_ydiv)/(long)b_hi;302 x=((int32_t)(screenx)-(int32_t)f->cx1+f->xoff()*bg_xmul/bg_xdiv)/(int32_t)b_wid; 303 y=((int32_t)(screeny)-(int32_t)f->cy1+f->yoff()*bg_ymul/bg_ydiv)/(int32_t)b_hi; 304 304 } 305 305 else … … 311 311 312 312 313 void game::mouse_to_game( long x, long y, long &gamex, long&gamey, view *f)313 void game::mouse_to_game(int32_t x, int32_t y, int32_t &gamex, int32_t &gamey, view *f) 314 314 { 315 315 if (!f) … … 324 324 if (dev&MAP_MODE) 325 325 { 326 gamex=((x-( long)f->cx1)*ftile_width()/AUTOTILE_WIDTH+map_xoff*ftile_width());327 gamey=((y-( long)f->cy1)*ftile_height()/AUTOTILE_HEIGHT+map_yoff*ftile_height());326 gamex=((x-(int32_t)f->cx1)*ftile_width()/AUTOTILE_WIDTH+map_xoff*ftile_width()); 327 gamey=((y-(int32_t)f->cy1)*ftile_height()/AUTOTILE_HEIGHT+map_yoff*ftile_height()); 328 328 } else 329 329 { 330 gamex=(x-( long)f->cx1+f->xoff());331 gamey=(y-( long)f->cy1+f->yoff());330 gamex=(x-(int32_t)f->cx1+f->xoff()); 331 gamey=(y-(int32_t)f->cy1+f->yoff()); 332 332 } 333 333 … … 336 336 } 337 337 338 void game::game_to_mouse( long gamex, long gamey, view *which, long &x, long&y)338 void game::game_to_mouse(int32_t gamex, int32_t gamey, view *which, int32_t &x, int32_t &y) 339 339 { 340 340 if (dev&MAP_MODE) 341 341 { 342 longx1,y1;342 int32_t x1,y1; 343 343 if (dev&EDIT_MODE) 344 344 { … … 757 757 } 758 758 759 longold_cx1=0,old_cy1=0,old_cx2=0,old_cy2=0; // if we do a small render, we need to restore these759 int32_t old_cx1=0,old_cy1=0,old_cx2=0,old_cy2=0; // if we do a small render, we need to restore these 760 760 image *old_screen=NULL; 761 761 if (small_render && (dev&DRAW_LIGHTS)) // cannot do this if we skip lighting … … 778 778 779 779 780 // longmax_xoff=(current_level->foreground_width()-1)*ftile_width()-(v->cx2-v->cx1+1);781 // longmax_yoff=(current_level->foreground_height()-1)*ftile_height()-(v->cy2-v->cy1+1);782 783 longxoff,yoff;780 // int32_t max_xoff=(current_level->foreground_width()-1)*ftile_width()-(v->cx2-v->cx1+1); 781 // int32_t max_yoff=(current_level->foreground_height()-1)*ftile_height()-(v->cy2-v->cy1+1); 782 783 int32_t xoff,yoff; 784 784 if (interpolate) 785 785 { … … 803 803 nyoff=yoff*bg_ymul/bg_ydiv; 804 804 805 // longmax_bg_xoff=(current_level->background_width())*btile_width()-(v->cx2-v->cx1+1);806 // longmax_bg_yoff=(current_level->background_height())*btile_height()-(v->cy2-v->cy1+1);805 // int32_t max_bg_xoff=(current_level->background_width())*btile_width()-(v->cx2-v->cx1+1); 806 // int32_t max_bg_yoff=(current_level->background_height())*btile_height()-(v->cy2-v->cy1+1); 807 807 // if (nxoff>max_bg_xoff) nxoff=max_xoff; 808 808 // if (nyoff>max_bg_yoff) nyoff=max_yoff; … … 986 986 // server_check(); 987 987 988 longro=rand_on;988 int32_t ro=rand_on; 989 989 if (dev & DRAW_PEOPLE_LAYER) 990 990 { … … 1667 1667 { 1668 1668 frame_panic = 0; 1669 long stime=(long)((1/15.0-1.0/possible_fps)*1000.0);1669 int32_t stime=(int32_t)((1/15.0-1.0/possible_fps)*1000.0); 1670 1670 if (stime>0 && !no_delay) 1671 1671 { … … 2575 2575 fprintf(stderr,"Mac Options: "); 2576 2576 xres = 320; yres = 200; 2577 GetKeys((u nsigned long*)&km);2577 GetKeys((uint32_t*)&km); 2578 2578 if ((km[ 0x3a >>3] >> (0x3a & 7)) &1 != 0) 2579 2579 { -
abuse/trunk/src/include/demo.hpp
r2 r16 34 34 35 35 36 extern int last_demo_mx,last_demo_my,last_demo_mbut;36 extern int32_t last_demo_mx,last_demo_my,last_demo_mbut; 37 37 //extern ulong demo_tick_on; 38 38 #endif -
abuse/trunk/src/include/dev.hpp
r2 r16 19 19 class pal_win 20 20 { 21 longscale,w,h,x,y,last_selected;21 int32_t scale,w,h,x,y,last_selected; 22 22 unsigned short *pat; 23 23 void draw(); … … 101 101 void make_ambient(); 102 102 int ok_to_scroll(); 103 long snap_x(longx);104 long snap_y(longy);103 int32_t snap_x(int32_t x); 104 int32_t snap_y(int32_t y); 105 105 void area_handle_input(event &ev); 106 106 void pick_handle_input(event &ev); -
abuse/trunk/src/include/extend.hpp
r2 r16 26 26 uchar Fade_count,Fade_max; 27 27 uchar Flags,grav_on,targetable_on; 28 longXvel,Yvel,Xacel,Yacel;28 int32_t Xvel,Yvel,Xacel,Yacel; 29 29 uchar Fx,Fy,Fxvel,Fyvel,Fxacel,Fyacel; 30 30 uchar Aitype; … … 43 43 char *var_name(int x); 44 44 int var_type(int x); 45 void set_var(int x, u longv);46 longget_var(int x);45 void set_var(int x, uint32_t v); 46 int32_t get_var(int x); 47 47 48 48 // leave these public, so I don't have monster code changes. 49 49 simple_object(); 50 longx,y,50 int32_t x,y, 51 51 last_x,last_y; // used for frame interpolation on fast machines 52 52 schar direction,active; … … 61 61 int keep_ai_info() { return 1; } 62 62 uchar flags() { return Flags; } 63 long xvel(){ return Xvel; }64 long yvel(){ return Yvel; }65 long xacel(){ return Xacel; }66 long yacel(){ return Yacel; }63 int32_t xvel() { return Xvel; } 64 int32_t yvel() { return Yvel; } 65 int32_t xacel() { return Xacel; } 66 int32_t yacel() { return Yacel; } 67 67 68 68 uchar fx() { return Fx; } … … 102 102 void set_targetable(uchar x) { targetable_on=x; } 103 103 void set_flags(uchar f) { Flags=f; } 104 void set_xvel( long xv){ Xvel=xv; }105 void set_yvel( long yv){ Yvel=yv; }106 void set_xacel( long xa){ Xacel=xa; }107 void set_yacel( long ya){ Yacel=ya; }104 void set_xvel(int32_t xv) { Xvel=xv; } 105 void set_yvel(int32_t yv) { Yvel=yv; } 106 void set_xacel(int32_t xa) { Xacel=xa; } 107 void set_yacel(int32_t ya) { Yacel=ya; } 108 108 void set_fx(uchar x) { Fx=x; } 109 109 void set_fy(uchar y) { Fy=y; } -
abuse/trunk/src/include/game.hpp
r2 r16 46 46 extern char **start_argv; 47 47 extern int start_argc; 48 extern longcurrent_vxadd,current_vyadd;48 extern int32_t current_vxadd,current_vyadd; 49 49 extern int frame_panic,massive_frame_panic; 50 50 extern int demo_start,idle_ticks; … … 58 58 morph_bright_color,morph_med_color,morph_dark_color; 59 59 60 longlast_time,fps;60 int32_t last_time,fps; 61 61 char mapname[100],command[200],help_text[200]; 62 62 int refresh,mousex,mousey,help_text_frames; … … 93 93 return cash.foret(foretiles[x]); } 94 94 95 void ftile_on(int screenx, int screeny, long &x, long&y);96 void btile_on(int screenx, int screeny, long &x, long&y);95 void ftile_on(int screenx, int screeny, int32_t &x, int32_t &y); 96 void btile_on(int screenx, int screeny, int32_t &x, int32_t &y); 97 97 void toggle_delay(); 98 98 void set_delay(int on) { no_delay=!on; } 99 99 void pan(int xv, int yv); 100 100 101 void mouse_to_game( long x, long y, long &gamex, long&gamey, view *v=NULL);102 void game_to_mouse( long gamex, long gamey, view *which, long &x, long&y);101 void mouse_to_game(int32_t x, int32_t y, int32_t &gamex, int32_t &gamey, view *v=NULL); 102 void game_to_mouse(int32_t gamex, int32_t gamey, view *which, int32_t &x, int32_t &y); 103 103 view *view_in(int mousex, int mousey); 104 104 … … 139 139 int game_over(); 140 140 void grow_views(int amount); 141 void play_sound(int id, int vol, long x, longy);141 void play_sound(int id, int vol, int32_t x, int32_t y); 142 142 void request_level_load(char *name); 143 143 void request_end(); -
abuse/trunk/src/include/intsect.hpp
r2 r16 2 2 #define __INTSECT_HPP_ 3 3 4 int setback_intersect( long x1, long y1, long &x2, long&y2,5 long xp1, long yp1, long xp2, long yp2, longinside);4 int setback_intersect(int32_t x1, int32_t y1, int32_t &x2, int32_t &y2, 5 int32_t xp1, int32_t yp1, int32_t xp2, int32_t yp2, int32_t inside); 6 6 7 7 #endif -
abuse/trunk/src/include/level.hpp
r2 r16 27 27 { 28 28 public : 29 longx,y,w,h,active;30 longambient,view_xoff,view_yoff;31 longambient_speed, view_xoff_speed,view_yoff_speed;29 int32_t x,y,w,h,active; 30 int32_t ambient,view_xoff,view_yoff; 31 int32_t ambient_speed, view_xoff_speed,view_yoff_speed; 32 32 area_controller *next; 33 area_controller( long X, long Y, long W, longH, area_controller *Next);33 area_controller(int32_t X, int32_t Y, int32_t W, int32_t H, area_controller *Next); 34 34 } ; 35 35 36 extern longlast_tile_hit_x,last_tile_hit_y;36 extern int32_t last_tile_hit_x,last_tile_hit_y; 37 37 extern int dev; 38 38 class level // contain map info and objects … … 43 43 fg_width,fg_height; 44 44 char *Name,*first_name; 45 longtotal_objs;45 int32_t total_objs; 46 46 game_object *first,*first_active,*last; 47 47 … … 104 104 void mark_seen(int x, int y) { CHECK(x>=0 && y>=0 && x<fg_width && y<fg_height); 105 105 (*(map_fg+x+y*fg_width))|=0x8000; } 106 void clear_fg( long x, longy) { *(map_fg+x+y*fg_width)&=0x7fff; }106 void clear_fg(int32_t x, int32_t y) { *(map_fg+x+y*fg_width)&=0x7fff; } 107 107 108 108 unsigned short *get_fgline(int y) { CHECK(y>=0 && y<fg_height); return map_fg+y*fg_width; } … … 141 141 void unactivate_all(); 142 142 // forms all the objects in processing range into a linked list 143 int add_actives( long x1, long y1, long x2, longy2); //returns total added143 int add_actives(int32_t x1, int32_t y1, int32_t x2, int32_t y2); //returns total added 144 144 void pull_actives(game_object *o, game_object *&last_active, int &t); 145 int add_drawables( long x1, long y1, long x2, longy2); //returns total added146 147 game_object *find_object( long x, longy);148 149 game_object *damage_intersect( long x1, long y1, long &x2, long&y2, game_object *exclude);150 game_object *boundary_setback(game_object *subject, long x1, long y1, long &x2, long&y2);151 game_object *all_boundary_setback(game_object *subject, long x1, long y1, long &x2, long&y2);145 int add_drawables(int32_t x1, int32_t y1, int32_t x2, int32_t y2); //returns total added 146 147 game_object *find_object(int32_t x, int32_t y); 148 149 game_object *damage_intersect(int32_t x1, int32_t y1, int32_t &x2, int32_t &y2, game_object *exclude); 150 game_object *boundary_setback(game_object *subject, int32_t x1, int32_t y1, int32_t &x2, int32_t &y2); 151 game_object *all_boundary_setback(game_object *subject, int32_t x1, int32_t y1, int32_t &x2, int32_t &y2); 152 152 int crush(game_object *by_who, int xamount, int yamount); 153 153 int push_characters(game_object *by_who, int xamount, int yamount); // return 0 if fail on any. 154 154 int platform_push(game_object *by_who, int xamount, int yamount); 155 void foreground_intersect( long x1, long y1, long &x2, long&y2);156 void vforeground_intersect( long x1, long y1, long&y2);157 158 void hurt_radius( long x, long y,long r, longm, game_object *from, game_object *exclude,155 void foreground_intersect(int32_t x1, int32_t y1, int32_t &x2, int32_t &y2); 156 void vforeground_intersect(int32_t x1, int32_t y1, int32_t &y2); 157 158 void hurt_radius(int32_t x, int32_t y,int32_t r, int32_t m, game_object *from, game_object *exclude, 159 159 int max_push); 160 void send_signal( longsignal);160 void send_signal(int32_t signal); 161 161 void next_focus(); 162 162 void to_front(game_object *o); … … 182 182 object_node *save_list, object_node *exclude_list); 183 183 view *make_view_list(int nplayers); 184 longtotal_light_links(object_node *list);185 longtotal_object_links(object_node *save_list);186 game_object *find_object_in_area( long x, long y, long x1, longy1,187 long x2, longy2, Cell *list, game_object *exclude);188 game_object *find_object_in_angle( long x, long y, long start_angle, longend_angle,184 int32_t total_light_links(object_node *list); 185 int32_t total_object_links(object_node *save_list); 186 game_object *find_object_in_area(int32_t x, int32_t y, int32_t x1, int32_t y1, 187 int32_t x2, int32_t y2, Cell *list, game_object *exclude); 188 game_object *find_object_in_angle(int32_t x, int32_t y, int32_t start_angle, int32_t end_angle, 189 189 void *list, game_object *exclude); 190 190 object_node *make_not_list(object_node *list); -
abuse/trunk/src/include/light.hpp
r2 r16 18 18 { 19 19 public : 20 longtype,x,xshift,y,yshift;21 longouter_radius,mul_div,inner_radius;20 int32_t type,x,xshift,y,yshift; 21 int32_t outer_radius,mul_div,inner_radius; 22 22 23 longx1,y1,x2,y2;23 int32_t x1,y1,x2,y2; 24 24 char known; 25 25 light_source *next; 26 26 27 27 void calc_range(); 28 light_source(char Type, long X, long Y, long Inner_radius, longOuter_radius,29 long Xshift, longYshift,28 light_source(char Type, int32_t X, int32_t Y, int32_t Inner_radius, int32_t Outer_radius, 29 int32_t Xshift, int32_t Yshift, 30 30 light_source *Next); 31 31 light_source *copy(); … … 35 35 { 36 36 public : 37 longtotal,x1,y1,x2,y2;37 int32_t total,x1,y1,x2,y2; 38 38 light_source **lights; 39 39 light_patch *next; 40 light_patch( long X1, long Y1, long X2, longY2, light_patch *Next)40 light_patch(int32_t X1, int32_t Y1, int32_t X2, int32_t Y2, light_patch *Next) 41 41 { 42 42 x1=X1; y1=Y1; x2=X2; y2=Y2; … … 45 45 lights=NULL; 46 46 } 47 void add_light( long X1, long Y1, long X2, longY2, light_source *who);47 void add_light(int32_t X1, int32_t Y1, int32_t X2, int32_t Y2, light_source *who); 48 48 light_patch *copy(light_patch *Next); 49 49 ~light_patch() { if (total) jfree(lights); } … … 52 52 void delete_all_lights(); 53 53 void delete_light(light_source *which); 54 light_source *add_light_source(char type, long x, longy,55 long inner, long outer, long xshift, longyshift);54 light_source *add_light_source(char type, int32_t x, int32_t y, 55 int32_t inner, int32_t outer, int32_t xshift, int32_t yshift); 56 56 57 57 void add_light_spec(spec_directory *sd, char *level_name); … … 62 62 void delete_patch_list(light_patch *first); 63 63 light_patch *find_patch(int screenx, int screeny, light_patch *list); 64 int calc_light_value( long x, longy, light_patch *which);65 void light_screen(image *sc, long screenx, longscreeny, uchar *light_lookup, ushort ambient);66 void double_light_screen(image *sc, long screenx, longscreeny, uchar *light_lookup, ushort ambient,67 image *out, long out_x, longout_y);64 int calc_light_value(int32_t x, int32_t y, light_patch *which); 65 void light_screen(image *sc, int32_t screenx, int32_t screeny, uchar *light_lookup, ushort ambient); 66 void double_light_screen(image *sc, int32_t screenx, int32_t screeny, uchar *light_lookup, ushort ambient, 67 image *out, int32_t out_x, int32_t out_y); 68 68 69 69 void calc_light_table(palette *pal); … … 71 71 extern int light_detail; 72 72 73 extern longlight_to_number(light_source *l);74 extern light_source *number_to_light( longx);73 extern int32_t light_to_number(light_source *l); 74 extern light_source *number_to_light(int32_t x); 75 75 76 76 #endif -
abuse/trunk/src/include/lisp.hpp
r11 r16 130 130 void *lget_array_element(void *a, long x); 131 131 void *lpointer_value(void *lpointer); 132 longlnumber_value(void *lnumber);132 int32_t lnumber_value(void *lnumber); 133 133 char *lstring_value(void *lstring); 134 134 unsigned short lcharacter_value(void *c); -
abuse/trunk/src/include/objects.hpp
r2 r16 48 48 public : 49 49 game_object *next,*next_active; 50 long*lvars;50 int32_t *lvars; 51 51 52 52 int size(); … … 72 72 void drawer(); 73 73 void draw_above(view *v); 74 void do_damage(int amount, game_object *from, long hitx, long hity, long push_xvel, longpush_yvel);75 void damage_fun(int amount, game_object *from, long hitx, long hity, long push_xvel, longpush_yvel);74 void do_damage(int amount, game_object *from, int32_t hitx, int32_t hity, int32_t push_xvel, int32_t push_yvel); 75 void damage_fun(int amount, game_object *from, int32_t hitx, int32_t hity, int32_t push_xvel, int32_t push_yvel); 76 76 77 77 … … 94 94 int has_sequence(character_state s) { return figures[otype]->has_sequence(s); } 95 95 96 game_object *try_move( long x, long y, long &xv, long&yv, int checks); // 1=down,2=up,3=both96 game_object *try_move(int32_t x, int32_t y, int32_t &xv, int32_t &yv, int checks); // 1=down,2=up,3=both 97 97 game_object *bmove(int &whit, game_object *exclude); // ballestic move, return hit object, 98 98 // or NULL (whit is 1 if hit wall) … … 100 100 101 101 int next_picture(); 102 longx_center();103 longheight();102 int32_t x_center(); 103 int32_t height(); 104 104 105 105 void stop_acel() { set_xacel(0); set_yacel(0); set_fxacel(0); set_fyacel(0); } … … 115 115 figure *current_figure() { return current_sequence()->get_figure(current_frame); } 116 116 int total_frames() { return current_sequence()->length(); } 117 void picture_space( long &x1, long &y1,long &x2, long&y2);117 void picture_space(int32_t &x1, int32_t &y1,int32_t &x2, int32_t &y2); 118 118 int tx(int x) { if (direction>0) return x-x_center(); else return x_center()-x; } 119 119 int ty(int y) { return y-picture()->height()+1; } … … 134 134 135 135 void change_type(int new_type); 136 int set_var_by_name(char *name, longvalue);137 longget_var_by_name(char *name, int &error);136 int set_var_by_name(char *name, int32_t value); 137 int32_t get_var_by_name(char *name, int &error); 138 138 game_object *copy(); 139 139 void change_aitype(int new_type); … … 151 151 extern game_object *current_object; 152 152 extern view *current_view; 153 game_object *create(int type, long x, longy, int skip_constructor=0, int aitype=0);153 game_object *create(int type, int32_t x, int32_t y, int skip_constructor=0, int aitype=0); 154 154 int base_size(); 155 155 156 156 void delete_object_list(object_node *first); 157 157 int object_to_number_in_list(game_object *who, object_node *list); 158 game_object *number_to_object_in_list( longx, object_node *list);158 game_object *number_to_object_in_list(int32_t x, object_node *list); 159 159 160 160 -
abuse/trunk/src/include/view.hpp
r2 r16 12 12 struct suggest_struct 13 13 { 14 longcx1,cy1,cx2,cy2,shift_down,shift_right,pan_x,pan_y;15 longnew_weapon;14 int32_t cx1,cy1,cx2,cy2,shift_down,shift_right,pan_x,pan_y; 15 int32_t new_weapon; 16 16 uchar send_view,send_weapon_change; 17 17 } ; … … 33 33 char name[100]; 34 34 struct suggest_struct suggest; 35 longcx1,cy1,cx2,cy2, // view area to show35 int32_t cx1,cy1,cx2,cy2, // view area to show 36 36 shift_down,shift_right; // shift of view 37 37 … … 41 41 int draw_solid; // -1 if don't draw solid 42 42 43 long*weapons; // [0..total_weapons-1]44 long*last_weapons; // last history of above array (for updating statbar)45 longcurrent_weapon;43 int32_t *weapons; // [0..total_weapons-1] 44 int32_t *last_weapons; // last history of above array (for updating statbar) 45 int32_t current_weapon; 46 46 47 47 … … 59 59 60 60 short ambient; // ambient lighting setting, used by draw 61 longpan_x,pan_y,no_xleft,no_xright,no_ytop,no_ybottom,61 int32_t pan_x,pan_y,no_xleft,no_xright,no_ytop,no_ybottom, 62 62 last_x,last_y,last_last_x,last_last_y,view_percent; 63 63 64 longlast_left,last_right,last_up,last_down, // how many frames ago were these pressed (<=0)64 int32_t last_left,last_right,last_up,last_down, // how many frames ago were these pressed (<=0) 65 65 last_b1,last_b2,last_b3,last_b4,last_hp,last_ammo,last_type; 66 longsecrets,kills,tsecrets,tkills;66 int32_t secrets,kills,tsecrets,tkills; 67 67 68 68 view(game_object *Focus, view *Next, int number); 69 69 void draw_character_damage(); // draws the characters 'status' on the viewer 70 70 71 longx_center(); // center of attention72 longy_center();73 longxoff(); // top left and right corner of the screen74 longinterpolated_xoff();75 longyoff();76 longinterpolated_yoff();71 int32_t x_center(); // center of attention 72 int32_t y_center(); 73 int32_t xoff(); // top left and right corner of the screen 74 int32_t interpolated_xoff(); 75 int32_t yoff(); 76 int32_t interpolated_yoff(); 77 77 int drawable(); // network viewables are not drawable 78 78 int local_player(); // just in case I ever need non-viewable local players. … … 94 94 void draw_ammo(); 95 95 void draw_logo(); 96 void resize_view( long Cx1, long Cy1, long Cx2, longCy2);96 void resize_view(int32_t Cx1, int32_t Cy1, int32_t Cx2, int32_t Cy2); 97 97 void set_input(int cx, int cy, int b1, int b2, int b3, int b4, int px, int py); 98 98 int view_changed() { return suggest.send_view; } … … 104 104 void reset_player(); 105 105 int receive_failed() { return focus==NULL; } 106 longget_view_var_value(int num);107 long set_view_var_value(int num, longx);106 int32_t get_view_var_value(int num); 107 int32_t set_view_var_value(int num, int32_t x); 108 108 void configure_for_area(area_controller *a); 109 109 ~view(); -
abuse/trunk/src/intsect.cpp
r2 r16 2 2 #include <stdlib.h> 3 3 4 void pushback( long x1,long y1,long &x2,long&y2,5 long xp1, long yp1, long xp2, longyp2, int xdir, int ydir, int inside)4 void pushback(int32_t x1,int32_t y1,int32_t &x2,int32_t &y2, 5 int32_t xp1, int32_t yp1, int32_t xp2, int32_t yp2, int xdir, int ydir, int inside) 6 6 { 7 7 … … 15 15 16 16 17 /* int setback_intersect( long x1,long y1,long &x2,long&y2,18 long xp1, long yp1, long xp2, longyp2)17 /* int setback_intersect(int32_t x1,int32_t y1,int32_t &x2,int32_t &y2, 18 int32_t xp1, int32_t yp1, int32_t xp2, int32_t yp2) 19 19 { 20 longmx1,my1,b1,mx2,my2,b2,side1,side2,tx2,ty2;20 int32_t mx1,my1,b1,mx2,my2,b2,side1,side2,tx2,ty2; 21 21 my1=(y2-y1); 22 22 if (!my1) // is the first line strait across? … … 110 110 if (abs(mx1)>abs(my1)) 111 111 { 112 longae_bd=my1*mx2-mx1*my2;112 int32_t ae_bd=my1*mx2-mx1*my2; 113 113 CONDITION(ae_bd,"line intersect fuck up"); 114 114 tx2=(mx1*mx2*(b2-b1))/ae_bd+xadd; … … 117 117 else 118 118 { 119 longdb_ea=(my2*mx1-mx2*my1);119 int32_t db_ea=(my2*mx1-mx2*my1); 120 120 CONDITION(db_ea,"line intersect fuck up"); 121 121 ty2=(mx1*b1*my2-my1*mx2*b2)/db_ea+yadd; … … 137 137 138 138 139 int setback_intersect( long x1,long y1,long &x2,long&y2,140 long xp1, long yp1, long xp2, longyp2,141 longinside) // which side is inside the polygon? (0 always setback)139 int setback_intersect(int32_t x1,int32_t y1,int32_t &x2,int32_t &y2, 140 int32_t xp1, int32_t yp1, int32_t xp2, int32_t yp2, 141 int32_t inside) // which side is inside the polygon? (0 always setback) 142 142 { 143 143 // the line equations will be put in the form … … 145 145 // A B C 146 146 147 longa1,b1,c1,a2,b2,c2,r1,r2;147 int32_t a1,b1,c1,a2,b2,c2,r1,r2; 148 148 149 149 a1=y2-y1; … … 157 157 } 158 158 159 longxdiff,ydiff;160 /* longxdiff=abs(xp1-xp2),ydiff=yp1-yp2;159 int32_t xdiff,ydiff; 160 /* int32_t xdiff=abs(xp1-xp2),ydiff=yp1-yp2; 161 161 if (xdiff>=ydiff) // increment the endpoints 162 162 if (xp2<xp1) { xp2--; xp1++; } … … 187 187 inside==0 || r2==0) 188 188 { 189 longae=a1*b2,bd=b1*a2;189 int32_t ae=a1*b2,bd=b1*a2; 190 190 if (ae!=bd) // co-linear returns 0 191 191 { -
abuse/trunk/src/level.cpp
r2 r16 24 24 #endif 25 25 26 #include <limits.h> 26 27 #include <time.h> 27 28 … … 30 31 game_object *level::attacker(game_object *who) 31 32 { 32 longd=0x7fffffff;33 int32_t d=0x7fffffff; 33 34 game_object *c=NULL; 34 35 view *f=the_game->first_view; … … 37 38 if (f->focus) 38 39 { 39 longtmp_d=abs(f->focus->x-who->x)+abs(f->focus->y-who->y);40 int32_t tmp_d=abs(f->focus->x-who->x)+abs(f->focus->y-who->y); 40 41 if (tmp_d<d) 41 42 { … … 198 199 } 199 200 200 int level::add_actives( long x1, long y1, long x2, longy2)201 int level::add_actives(int32_t x1, int32_t y1, int32_t x2, int32_t y2) 201 202 { 202 203 int t=0; … … 210 211 if (!o->active) 211 212 { 212 longxr=figures[o->otype]->rangex,213 int32_t xr=figures[o->otype]->rangex, 213 214 yr=figures[o->otype]->rangey; 214 215 … … 242 243 243 244 244 int level::add_drawables( long x1, long y1, long x2, longy2)245 int level::add_drawables(int32_t x1, int32_t y1, int32_t x2, int32_t y2) 245 246 { 246 247 int t=0,ft=0; … … 256 257 if (ft || !o->active) 257 258 { 258 longxr=figures[o->otype]->draw_rangex,259 int32_t xr=figures[o->otype]->draw_rangex, 259 260 yr=figures[o->otype]->draw_rangey; 260 261 … … 322 323 void level::wall_push() 323 324 { 324 longsx1,sy1,sx2,sy2,xv,yv;325 int32_t sx1,sy1,sx2,sy2,xv,yv; 325 326 game_object *o=first_active; 326 327 for (;o;o=o->next_active) … … 362 363 if (abs(subject->x-target->x)<b1+b2) 363 364 { 364 longtmove=b1+b2-abs(subject->x-target->x),xv,yv=0,xv2;365 int32_t tmove=b1+b2-abs(subject->x-target->x),xv,yv=0,xv2; 365 366 if (subject->x>target->x) 366 367 xv=tmove/2; … … 382 383 { 383 384 game_object *target,*reciever=NULL; 384 longsx1,sy1,sx2,sy2,tx1,ty1,tx2,ty2,hitx,hity,385 int32_t sx1,sy1,sx2,sy2,tx1,ty1,tx2,ty2,hitx,hity, 385 386 s_centerx,t_centerx; 386 387 … … 416 417 for (t_dat=t_damage->data,j=(int)t_damage->tot-1;j>0 && !hit;j--) 417 418 { 418 longx1,y1,x2,y2, // define the two line segments to check419 int32_t x1,y1,x2,y2, // define the two line segments to check 419 420 xp1,yp1,xp2,yp2; 420 421 … … 459 460 */ 460 461 461 game_object *level::boundary_setback(game_object *subject, long x1, long y1, long &x2, long&y2)462 game_object *level::boundary_setback(game_object *subject, int32_t x1, int32_t y1, int32_t &x2, int32_t &y2) 462 463 { 463 464 game_object *l=NULL; 464 longtx1,ty1,tx2,ty2,t_centerx;465 int32_t tx1,ty1,tx2,ty2,t_centerx; 465 466 game_object *target=first_active; 466 467 game_object **blist=block_list; … … 485 486 while(iter-->0) 486 487 { 487 longxp1=target->x+target->tx(*t_dat); t_dat++;488 longyp1=target->y+target->ty(*t_dat); t_dat++;489 longxp2=target->x+target->tx(*t_dat);490 longyp2=target->y+target->ty(t_dat[1]);488 int32_t xp1=target->x+target->tx(*t_dat); t_dat++; 489 int32_t yp1=target->y+target->ty(*t_dat); t_dat++; 490 int32_t xp2=target->x+target->tx(*t_dat); 491 int32_t yp2=target->y+target->ty(t_dat[1]); 491 492 492 493 // now check to see if (x1,y1-x2,y2) intercest with (xp1,yp1-xp2,yp2) … … 511 512 512 513 513 game_object *level::all_boundary_setback(game_object *subject, long x1, long y1, long &x2, long&y2)514 game_object *level::all_boundary_setback(game_object *subject, int32_t x1, int32_t y1, int32_t &x2, int32_t &y2) 514 515 { 515 516 game_object *l=NULL; 516 longtx1,ty1,tx2,ty2,t_centerx;517 int32_t tx1,ty1,tx2,ty2,t_centerx; 517 518 game_object *target=first_active; 518 519 game_object **blist=all_block_list; … … 537 538 while(iter-->0) 538 539 { 539 longxp1=target->x+target->tx(*t_dat); t_dat++;540 longyp1=target->y+target->ty(*t_dat); t_dat++;541 longxp2=target->x+target->tx(*t_dat);542 longyp2=target->y+target->ty(t_dat[1]);540 int32_t xp1=target->x+target->tx(*t_dat); t_dat++; 541 int32_t yp1=target->y+target->ty(*t_dat); t_dat++; 542 int32_t xp2=target->x+target->tx(*t_dat); 543 int32_t yp2=target->y+target->ty(t_dat[1]); 543 544 544 545 // now check to see if (x1,y1-x2,y2) intercest with (xp1,yp1-xp2,yp2) … … 566 567 void level::interpolate_draw_objects(view *v) 567 568 { 568 longold_x,old_y;569 int32_t old_x,old_y; 569 570 current_view=v; 570 571 … … 607 608 { 608 609 if (!rcheck) rcheck=open_file("rcheck","rb"); 609 longx=rcheck->read_long();610 int32_t x=rcheck->read_long(); 610 611 if (x!=rand_on) 611 612 dprintf("off!\n"); … … 645 646 { 646 647 area_controller *a,*smallest=NULL; 647 long smallest_size=0xfffffff;648 int32_t smallest_size=0xffffffff; 648 649 for (a=area_list;a;a=a->next) 649 650 if (o->x>=a->x && o->y>=a->y && o->x<=a->x+a->w && o->y<=a->y+a->h) 650 651 { 651 longsize=a->w*a->h;652 int32_t size=a->w*a->h; 652 653 if (size<smallest_size) 653 654 { … … 693 694 if (o->otype!=current_start_type) 694 695 { 695 longfmp=o->fmp();696 int32_t fmp=o->fmp(); 696 697 int reduce=figures[o->otype]->morph_power; 697 698 if (reduce) … … 767 768 void level::draw_areas(view *v) 768 769 { 769 longsx1,sy1,sx2,sy2;770 int32_t sx1,sy1,sx2,sy2; 770 771 area_controller *a=area_list; 771 772 for (;a;a=a->next) … … 807 808 } 808 809 809 void calc_bgsize(u nsigned short fgw, unsigned short fgh, unsigned short &bgw, unsigned short &bgh)810 void calc_bgsize(uint16_t fgw, uint16_t fgh, uint16_t &bgw, uint16_t &bgh) 810 811 { 811 812 bgw=fgw/ASPECT+8; … … 822 823 } 823 824 824 u nsigned short *new_fg,*new_bg;825 new_fg=(u nsigned short *)jmalloc(w*h*sizeof(short),"Map fg : resized");826 memset(new_fg,0,w*h*sizeof( short));825 uint16_t *new_fg,*new_bg; 826 new_fg=(uint16_t *)jmalloc(w*h*sizeof(int16_t),"Map fg : resized"); 827 memset(new_fg,0,w*h*sizeof(int16_t)); 827 828 828 829 int x,y,miny=(h<fg_height)? h : fg_height,minx=(w<fg_width)? w : fg_width; 829 830 830 u nsigned short nbw,nbh;831 uint16_t nbw,nbh; 831 832 calc_bgsize(w,h,nbw,nbh); 832 833 833 new_bg=(u nsigned short *)jmalloc((int)nbw*(int)nbh*sizeof(short),"map bg : resized");834 memset(new_bg,0,(int)nbw*(int)nbh*sizeof( short));834 new_bg=(uint16_t *)jmalloc((int)nbw*(int)nbh*sizeof(int16_t),"map bg : resized"); 835 memset(new_bg,0,(int)nbw*(int)nbh*sizeof(int16_t)); 835 836 836 837 for (y=0;y<miny;y++) … … 885 886 fp->seek(se->offset,0); 886 887 /******************************* Read debug info ******************************/ 887 short old_tot=fp->read_short();888 u nsigned short *o_remap=(unsigned short *)jmalloc(old_tot*2,"obj remap array");888 int16_t old_tot=fp->read_short(); 889 uint16_t *o_remap=(uint16_t *)jmalloc(old_tot*2,"obj remap array"); 889 890 char old_name[150]; 890 891 for (i=0;i<old_tot;i++) … … 1017 1018 { 1018 1019 fp->seek(se->offset,0); 1019 short old_tot=fp->read_short();1020 int16_t old_tot=fp->read_short(); 1020 1021 se=sd->find("describe_names"); 1021 1022 if (!se || !old_tot) 1022 1023 return ; 1023 1024 1024 u nsigned short *o_remap=(unsigned short *)jmalloc(old_tot*2,"obj remap array");1025 u nsigned short *o_backmap=(unsigned short *)jmalloc(total_objects*2,"obj remap array");1025 uint16_t *o_remap=(uint16_t *)jmalloc(old_tot*2,"obj remap array"); 1026 uint16_t *o_backmap=(uint16_t *)jmalloc(total_objects*2,"obj remap array"); 1026 1027 memset(o_backmap,0xff,total_objects*2); 1027 1028 char old_name[150]; … … 1041 1042 se=sd->find("describe_states"); 1042 1043 if (!se) { jfree(o_remap); jfree(o_backmap); return ; } 1043 short **s_remap=(short **)jmalloc(old_tot*sizeof(short *),"big state remap array");1044 short *s_remap_totals=(short *)jmalloc(old_tot*sizeof(short),"big state rmp totals");1044 int16_t **s_remap=(int16_t **)jmalloc(old_tot*sizeof(int16_t *),"big state remap array"); 1045 int16_t *s_remap_totals=(int16_t *)jmalloc(old_tot*sizeof(int16_t),"big state rmp totals"); 1045 1046 fp->seek(se->offset,0); 1046 1047 int i=0; 1047 1048 for (;i<old_tot;i++) 1048 1049 { 1049 short t=fp->read_short();1050 int16_t t=fp->read_short(); 1050 1051 s_remap_totals[i]=t; 1051 1052 if (t) 1052 1053 { 1053 s_remap[i]=( short *)jmalloc(t*sizeof(short),"state remap");1054 s_remap[i]=(int16_t *)jmalloc(t*sizeof(int16_t),"state remap"); 1054 1055 int j=0; 1055 1056 for (;j<t;j++) … … 1076 1077 } 1077 1078 1078 short **v_remap=NULL;1079 short *v_remap_totals=NULL;1079 int16_t **v_remap=NULL; 1080 int16_t *v_remap_totals=NULL; 1080 1081 int load_vars=1; 1081 1082 se=sd->find("describe_lvars"); 1082 1083 if (se) 1083 1084 { 1084 v_remap=( short **)jmalloc(old_tot*sizeof(short *),"big var remap array");1085 v_remap_totals=( short *)jmalloc(old_tot*sizeof(short),"big var rmp totals");1085 v_remap=(int16_t **)jmalloc(old_tot*sizeof(int16_t *),"big var remap array"); 1086 v_remap_totals=(int16_t *)jmalloc(old_tot*sizeof(int16_t),"big var rmp totals"); 1086 1087 1087 1088 fp->seek(se->offset,0); … … 1089 1090 for (;i<old_tot;i++) 1090 1091 { 1091 short t=fp->read_short();1092 int16_t t=fp->read_short(); 1092 1093 v_remap_totals[i]=t; 1093 1094 if (t) 1094 1095 { 1095 v_remap[i]=( short *)jmalloc(t*sizeof(short),"var remap");1096 memset(v_remap[i],0xff,t*sizeof( short));1096 v_remap[i]=(int16_t *)jmalloc(t*sizeof(int16_t),"var remap"); 1097 memset(v_remap[i],0xff,t*sizeof(int16_t)); 1097 1098 } else { v_remap[i]=NULL; } 1098 1099 int j=0; … … 1172 1173 for (;o && !abort;o=o->next) 1173 1174 { 1174 short ot=fp->read_short();1175 int16_t ot=fp->read_short(); 1175 1176 int k=0; 1176 1177 for (;k<ot;k++) … … 1179 1180 else 1180 1181 { 1181 longv=fp->read_long();1182 int32_t v=fp->read_long(); 1182 1183 if (o->otype!=0xffff) // non-exstant object 1183 1184 { … … 1309 1310 fg_width=fp->read_long(); 1310 1311 fg_height=fp->read_long(); 1311 map_fg=(u nsigned short *)jmalloc(2*fg_width*fg_height,"Map fg : loaded");1312 map_fg=(uint16_t *)jmalloc(2*fg_width*fg_height,"Map fg : loaded"); 1312 1313 fp->read((char *)map_fg,2*fg_width*fg_height); 1313 1314 int t=fg_width*fg_height; 1314 u nsigned short *map=map_fg;1315 uint16_t *map=map_fg; 1315 1316 while (t) { *map=lstl(*map); map++; t--; } 1316 1317 } else … … 1327 1328 bg_width=fp->read_long(); 1328 1329 bg_height=fp->read_long(); 1329 map_bg=(u nsigned short *)jmalloc(2*bg_width*bg_height,"Map bg : loaded");1330 map_bg=(uint16_t *)jmalloc(2*bg_width*bg_height,"Map bg : loaded"); 1330 1331 fp->read((char *)map_bg,2*bg_width*bg_height); 1331 1332 int t=bg_width*bg_height; 1332 u nsigned short *map=map_bg;1333 uint16_t *map=map_bg; 1333 1334 while (t) { *map=lstl(*map); map++; t--; } 1334 1335 } else … … 1342 1343 fg_width=bg_width; 1343 1344 fg_height=bg_height; 1344 map_fg=(u nsigned short *)jmalloc(2*fg_width*fg_height,"Map fg : loaded");1345 map_fg=(uint16_t *)jmalloc(2*fg_width*fg_height,"Map fg : loaded"); 1345 1346 memset(map_fg,0,2*fg_width*fg_height); 1346 1347 } … … 1350 1351 bg_width=fg_width/8+8; 1351 1352 bg_height=fg_height/8+8; 1352 map_bg=(u nsigned short *)jmalloc(2*bg_width*bg_height,"Map bg : loaded");1353 map_bg=(uint16_t *)jmalloc(2*bg_width*bg_height,"Map bg : loaded"); 1353 1354 memset(map_bg,0,2*bg_width*bg_height); 1354 1355 } … … 1356 1357 1357 1358 /***************** Check map for non exsistant tiles **************************/ 1358 longi,w;1359 u nsigned short *m;1359 int32_t i,w; 1360 uint16_t *m; 1360 1361 spec_entry *load_all=sd->find("player_info"); 1361 1362 for (i=0,w=fg_width*fg_height,m=map_fg;i<w;i++,m++) … … 1569 1570 1570 1571 1571 // how many objects are we goint to save, use a longto specify how many1572 // how many objects are we goint to save, use a int32_t to specify how many 1572 1573 sd.add_by_hand(new spec_entry(SPEC_DATA_ARRAY,"object_list",NULL,4,0)); 1573 1574 1574 longt=0;1575 int32_t t=0; 1575 1576 object_node *o=save_list; 1576 1577 for (;o;o=o->next) … … 1654 1655 void level::write_player_info(bFILE *fp, object_node *save_list) 1655 1656 { 1656 longt=0;1657 int32_t t=0; 1657 1658 view *v=player_list; 1658 1659 for (;v;v=v->next) t++; … … 1725 1726 } 1726 1727 1727 longtotal_players=fp->read_long();1728 int32_t total_players=fp->read_long(); 1728 1729 view *last=NULL; 1729 1730 int i=0; … … 1775 1776 if (fp->read_byte()==RC_L) 1776 1777 { 1777 longm=fp->read_long(); // read how many weapons exsisted when last saved1778 int32_t m=fp->read_long(); // read how many weapons exsisted when last saved 1778 1779 int i; 1779 1780 for (v=player_list;v;v=v->next) … … 1781 1782 for (i=0;i<m;i++) 1782 1783 { 1783 longx=fp->read_long();1784 int32_t x=fp->read_long(); 1784 1785 if (i<total_weapons) 1785 1786 { … … 1794 1795 for (v=player_list;v;v=v->next) 1795 1796 { 1796 memset(v->last_weapons,0xff,total_weapons*sizeof( long));1797 memset(v->weapons,0xff,total_weapons*sizeof( long));1797 memset(v->last_weapons,0xff,total_weapons*sizeof(int32_t)); 1798 memset(v->weapons,0xff,total_weapons*sizeof(int32_t)); 1798 1799 } 1799 1800 } … … 1902 1903 } 1903 1904 1904 longt=0;1905 int32_t t=0; 1905 1906 object_node *o=save_list; 1906 1907 for (;o;o=o->next) t++; … … 1919 1920 for (i=0;i<figures[o->me->otype]->tv;i++) 1920 1921 { 1921 fp->write_byte(RC_L); // for now the only type allowed is long1922 fp->write_byte(RC_L); // for now the only type allowed is int32_t 1922 1923 fp->write_long(o->me->lvars[i]); 1923 1924 } … … 1944 1945 1945 1946 1946 longlevel::total_object_links(object_node *list)1947 { 1948 longtl=0;1947 int32_t level::total_object_links(object_node *list) 1948 { 1949 int32_t tl=0; 1949 1950 for (object_node *o=list;o;o=o->next) 1950 1951 tl+=o->me->total_objects(); … … 1952 1953 } 1953 1954 1954 longlevel::total_light_links(object_node *list)1955 { 1956 longtl=0;1955 int32_t level::total_light_links(object_node *list) 1956 { 1957 int32_t tl=0; 1957 1958 for (object_node *o=list;o;o=o->next) 1958 1959 tl+=o->me->total_lights(); … … 1974 1975 { 1975 1976 fp->write_long(x); 1976 longx=object_to_number_in_list(o->me->get_object(i),save_list);1977 int32_t x=object_to_number_in_list(o->me->get_object(i),save_list); 1977 1978 if (x) 1978 1979 fp->write_long(x); 1979 1980 else // save links to excluded items as negative 1980 fp->write_long(( long)(-(object_to_number_in_list(o->me,exclude_list))));1981 fp->write_long((int32_t)(-(object_to_number_in_list(o->me,exclude_list)))); 1981 1982 } 1982 1983 } … … 2008 2009 if (fp->read_byte()==RC_L) 2009 2010 { 2010 longt=fp->read_long();2011 int32_t t=fp->read_long(); 2011 2012 while (t) 2012 2013 { 2013 longx1=fp->read_long();2014 int32_t x1=fp->read_long(); 2014 2015 CONDITION(x1>=0,"expected x1 for object link to be > 0\n"); 2015 longx2=fp->read_long();2016 int32_t x2=fp->read_long(); 2016 2017 game_object *p,*q=number_to_object_in_list(x1,save_list); 2017 2018 if (x2>0) … … 2033 2034 if (fp->read_byte()==RC_L) 2034 2035 { 2035 longt=fp->read_long();2036 int32_t t=fp->read_long(); 2036 2037 while (t) 2037 2038 { 2038 longx1=fp->read_long();2039 longx2=fp->read_long();2039 int32_t x1=fp->read_long(); 2040 int32_t x2=fp->read_long(); 2040 2041 game_object *p=number_to_object_in_list(x1,save_list); 2041 2042 if (p) … … 2107 2108 { 2108 2109 area_controller *l=NULL,*p; 2109 longta=fp->read_long();2110 int32_t ta=fp->read_long(); 2110 2111 int i=0; 2111 2112 for (;i<ta;i++) 2112 2113 { 2113 longx,y,w,h;2114 int32_t x,y,w,h; 2114 2115 x=fp->read_long(); 2115 2116 y=fp->read_long(); … … 2203 2204 else 2204 2205 { 2205 longsize = fp->file_size();2206 int32_t size = fp->file_size(); 2206 2207 uchar *buf = (uchar *)jmalloc(0x1000,"copy buf"); 2207 2208 int tr = 1; … … 2367 2368 calc_bgsize(fg_width,fg_height,bg_width,bg_height); 2368 2369 2369 map_bg=(u nsigned short *)jmalloc(sizeof(short)*bg_width*bg_height,"map bg");2370 map_fg=(u nsigned short *)jmalloc(sizeof(short)*fg_width*fg_height,"map fg");2371 2372 2373 2374 memset(map_bg,0,sizeof( short)*bg_width*bg_height);2375 memset(map_fg,0,sizeof( short)*fg_width*fg_height);2370 map_bg=(uint16_t *)jmalloc(sizeof(int16_t)*bg_width*bg_height,"map bg"); 2371 map_fg=(uint16_t *)jmalloc(sizeof(int16_t)*fg_width*fg_height,"map fg"); 2372 2373 2374 2375 memset(map_bg,0,sizeof(int16_t)*bg_width*bg_height); 2376 memset(map_fg,0,sizeof(int16_t)*fg_width*fg_height); 2376 2377 2377 2378 int i; … … 2576 2577 } 2577 2578 2578 game_object *level::find_object( long x, longy)2579 { 2580 longx1,y1,x2,y2;2579 game_object *level::find_object(int32_t x, int32_t y) 2580 { 2581 int32_t x1,y1,x2,y2; 2581 2582 game_object *o=first; 2582 2583 for (;o;o=o->next) … … 2589 2590 } 2590 2591 2591 longlast_tile_hit_x,last_tile_hit_y;2592 int32_t last_tile_hit_x,last_tile_hit_y; 2592 2593 2593 2594 #define remapx(x) (x==0 ? -1 : x==tl-1 ? tl+1 : x) 2594 2595 #define remapy(y) (y==0 ? -1 : y==th-1 ? th+1 : y) 2595 2596 2596 void level::foreground_intersect( long x1, long y1, long &x2, long&y2)2597 void level::foreground_intersect(int32_t x1, int32_t y1, int32_t &x2, int32_t &y2) 2597 2598 { 2598 2599 /* if (x1==x2) … … 2601 2602 } */ 2602 2603 2603 longtl=the_game->ftile_width(),th=the_game->ftile_height(),2604 int32_t tl=the_game->ftile_width(),th=the_game->ftile_height(), 2604 2605 j, 2605 2606 xp1,yp1,xp2,yp2, // starting and ending points of block line segment 2606 2607 swap; // temp var 2607 longblockx1,blocky1,blockx2,blocky2,block,bx,by;2608 int32_t blockx1,blocky1,blockx2,blocky2,block,bx,by; 2608 2609 point_list *block_list; 2609 2610 unsigned char *bdat; … … 2642 2643 bdat=block_list->data; 2643 2644 unsigned char *ins=f->points->inside; 2644 longxo=bx*tl,yo=by*th;2645 int32_t xo=bx*tl,yo=by*th; 2645 2646 for (j=0;j<total-1;j++,ins++) 2646 2647 { … … 2656 2657 2657 2658 2658 longox2=x2,oy2=y2;2659 int32_t ox2=x2,oy2=y2; 2659 2660 if (*ins) 2660 2661 setback_intersect(x1,y1,x2,y2,xp1,yp1,xp2,yp2,1); … … 2674 2675 2675 2676 2676 void level::vforeground_intersect( long x1, long y1, long&y2)2677 { 2678 longtl=f_wid,th=f_hi,2677 void level::vforeground_intersect(int32_t x1, int32_t y1, int32_t &y2) 2678 { 2679 int32_t tl=f_wid,th=f_hi, 2679 2680 j, 2680 2681 xp1,yp1,xp2,yp2; // starting and ending points of block line segment temp var 2681 longblocky1,blocky2,block,bx,by,checkx;2682 int32_t blocky1,blocky2,block,bx,by,checkx; 2682 2683 point_list *block_list; 2683 2684 unsigned char *bdat; … … 2717 2718 unsigned char *ins=f->points->inside; 2718 2719 2719 // longxo=bx*tl,yo=by*th;2720 // int32_t xo=bx*tl,yo=by*th; 2720 2721 for (j=0;j<total-1;j++,ins++) 2721 2722 { … … 2731 2732 2732 2733 2733 longoy2=y2;2734 int32_t oy2=y2; 2734 2735 if (*ins) 2735 2736 setback_intersect(checkx,y1,checkx,y2,xp1,yp1,xp2,yp2,1); … … 2748 2749 2749 2750 2750 void level::send_signal( longsignal)2751 void level::send_signal(int32_t signal) 2751 2752 { 2752 2753 if (signal) // signal 0 is never sent! … … 2761 2762 int level::crush(game_object *by_who, int xamount, int yamount) 2762 2763 { 2763 longxv,yv,crushed=0;2764 int32_t xv,yv,crushed=0; 2764 2765 game_object *o=first_active; 2765 2766 for (;o;o=o->next_active) … … 2798 2799 { 2799 2800 int failed=0; 2800 longxv,yv;2801 int32_t xv,yv; 2801 2802 game_object *o=first_active; 2802 2803 for (;o;o=o->next_active) … … 2805 2806 { 2806 2807 // check to see if the platform is going up and will run into us. 2807 longtvx,tvy;2808 int32_t tvx,tvy; 2808 2809 if (yamount<0) 2809 2810 { … … 2848 2849 int level::push_characters(game_object *by_who, int xamount, int yamount) 2849 2850 { 2850 longxv,yv;2851 int32_t xv,yv; 2851 2852 int failed=0; 2852 2853 game_object *o=first_active; … … 2857 2858 xv=-xamount; 2858 2859 yv=-yamount; 2859 longtvx,tvy;2860 int32_t tvx,tvy; 2860 2861 if (xv>0) tvx=xv+1; else if (xv<0) tvx=xv-1; else tvx=0; 2861 2862 if (yv>0) tvy=yv+1; else if (yv<0) tvx=yv-1; else tvy=0; … … 2877 2878 game_object *level::find_xrange(int x, int y, int type, int xd) 2878 2879 { 2879 longfind_ydist=100000;2880 int32_t find_ydist=100000; 2880 2881 game_object *find=NULL; 2881 2882 game_object *o=first_active; … … 2900 2901 game_object *level::find_xclosest(int x, int y, int type, game_object *who) 2901 2902 { 2902 longfind_ydist=100000,find_xdist=0xffffff;2903 int32_t find_ydist=100000,find_xdist=0xffffff; 2903 2904 game_object *find=NULL; 2904 2905 game_object *o=first_active; … … 2930 2931 game_object *level::find_closest(int x, int y, int type, game_object *who) 2931 2932 { 2932 longfind_dist=100000;2933 int32_t find_dist=100000; 2933 2934 game_object *find=NULL; 2934 2935 game_object *o=first_active; … … 2985 2986 } 2986 2987 2987 void level::hurt_radius( long x, long y,long r, longm, game_object *from, game_object *exclude,2988 void level::hurt_radius(int32_t x, int32_t y,int32_t r, int32_t m, game_object *from, game_object *exclude, 2988 2989 int max_push) 2989 2990 { … … 2994 2995 if (o!=exclude && o->hurtable()) 2995 2996 { 2996 longy1=o->y,y2=o->y-o->picture()->height();2997 longcx=abs(o->x-x),cy1=abs(y1-y),d1,d2,cy2=abs(y2-y);2997 int32_t y1=o->y,y2=o->y-o->picture()->height(); 2998 int32_t cx=abs(o->x-x),cy1=abs(y1-y),d1,d2,cy2=abs(y2-y); 2998 2999 if (cx<cy1) 2999 3000 d1=cx+cy1-(cx>>1); … … 3056 3057 if (v!=exclude) 3057 3058 { 3058 longcx=abs(v->x_center()-o->x),cy=abs(v->y_center()-o->y),d;3059 int32_t cx=abs(v->x_center()-o->x),cy=abs(v->y_center()-o->y),d; 3059 3060 if (cx<cy) 3060 3061 d=cx+cy-(cx>>1); … … 3152 3153 3153 3154 3154 game_object *level::find_object_in_area( long x, long y, long x1, long y1, long x2, longy2,3155 game_object *level::find_object_in_area(int32_t x, int32_t y, int32_t x1, int32_t y1, int32_t x2, int32_t y2, 3155 3156 Cell *list, game_object *exclude) 3156 3157 { 3157 3158 game_object *closest=NULL; 3158 longclosest_distance=0xfffffff,distance,xo,yo;3159 int32_t closest_distance=0xfffffff,distance,xo,yo; 3159 3160 game_object *o=first_active; 3160 3161 for (;o;o=o->next_active) 3161 3162 { 3162 longxp1,yp1,xp2,yp2;3163 int32_t xp1,yp1,xp2,yp2; 3163 3164 o->picture_space(xp1,yp1,xp2,yp2); 3164 3165 … … 3188 3189 3189 3190 3190 game_object *level::find_object_in_angle( long x, long y, long start_angle, longend_angle,3191 game_object *level::find_object_in_angle(int32_t x, int32_t y, int32_t start_angle, int32_t end_angle, 3191 3192 void *list, game_object *exclude) 3192 3193 { 3193 3194 game_object *closest=NULL; 3194 longclosest_distance=0xfffffff,distance,xo,yo;3195 int32_t closest_distance=0xfffffff,distance,xo,yo; 3195 3196 game_object *o=first_active; 3196 3197 for (;o;o=o->next_active) 3197 3198 { 3198 longangle=lisp_atan2(o->y-y,o->x-x);3199 int32_t angle=lisp_atan2(o->y-y,o->x-x); 3199 3200 if (((start_angle<=end_angle && (angle>=start_angle && angle<=end_angle)) 3200 3201 || (start_angle>end_angle && (angle>=start_angle || angle<=end_angle))) … … 3250 3251 for (;o;o=o->next) 3251 3252 { 3252 fprintf(fp,"%3d %s %4ld %4ld %4ld %4ld %04d\n",i++,object_names[o->otype], o->x,o->y,3253 o->xvel(),o->yvel(),o->current_frame);3253 fprintf(fp,"%3d %s %4ld %4ld %4ld %4ld %04d\n",i++,object_names[o->otype],(long)o->x,(long)o->y, 3254 (long)o->xvel(),(long)o->yvel(),o->current_frame); 3254 3255 } 3255 3256 fclose(fp); … … 3258 3259 3259 3260 3260 area_controller::area_controller( long X, long Y, long W, longH, area_controller *Next)3261 area_controller::area_controller(int32_t X, int32_t Y, int32_t W, int32_t H, area_controller *Next) 3261 3262 { 3262 3263 x=X; y=Y; w=W; h=H; -
abuse/trunk/src/light.cpp
r8 r16 20 20 int light_detail=MEDIUM_DETAIL; 21 21 22 longlight_to_number(light_source *l)22 int32_t light_to_number(light_source *l) 23 23 { 24 24 … … 31 31 32 32 33 light_source *number_to_light( longx)33 light_source *number_to_light(int32_t x) 34 34 { 35 35 if (x==0) return NULL; … … 135 135 } 136 136 137 light_source::light_source(char Type, long X, long Y, longInner_radius,138 long Outer_radius, long Xshift, longYshift, light_source *Next)137 light_source::light_source(char Type, int32_t X, int32_t Y, int32_t Inner_radius, 138 int32_t Outer_radius, int32_t Xshift, int32_t Yshift, light_source *Next) 139 139 { 140 140 type=Type; … … 158 158 } 159 159 160 light_source *add_light_source(char type, long x, longy,161 long inner, long outer, long xshift, longyshift)160 light_source *add_light_source(char type, int32_t x, int32_t y, 161 int32_t inner, int32_t outer, int32_t xshift, int32_t yshift) 162 162 { 163 163 first_light_source=new light_source(type,x,y,inner,outer,xshift,yshift,first_light_source); … … 392 392 } 393 393 394 void add_light(light_patch *&first, long x1, long y1, long x2, longy2,394 void add_light(light_patch *&first, int32_t x1, int32_t y1, int32_t x2, int32_t y2, 395 395 light_source *who) 396 396 { … … 523 523 524 524 /* shit 525 int calc_light_value(light_patch *which, long x, longy)525 int calc_light_value(light_patch *which, int32_t x, int32_t y) 526 526 { 527 527 int lv=0; … … 537 537 else 538 538 { 539 longdx=abs(fn->x-x)<<fn->xshift;540 longdy=abs(fn->y-y)<<fn->yshift;541 longr2;539 int32_t dx=abs(fn->x-x)<<fn->xshift; 540 int32_t dy=abs(fn->y-y)<<fn->yshift; 541 int32_t r2; 542 542 if (dx<dy) 543 543 r2=dx+dy-(dx>>1); … … 564 564 } 565 565 566 light_patch *make_patch_list(int width, int height, long screenx, longscreeny)566 light_patch *make_patch_list(int width, int height, int32_t screenx, int32_t screeny) 567 567 { 568 568 light_patch *first=new light_patch(0,0,width-1,height-1,NULL); … … 570 570 for (light_source *f=first_light_source;f;f=f->next) // determine which lights will have effect 571 571 { 572 longx1=f->x1-screenx,y1=f->y1-screeny,572 int32_t x1=f->x1-screenx,y1=f->y1-screeny, 573 573 x2=f->x2-screenx,y2=f->y2-screeny; 574 574 if (x1<0) x1=0; … … 599 599 #ifdef __WATCOMC__ 600 600 extern "C" { 601 extern long MAP_PUT(long pad, long screen_addr, long remap, longw);601 extern int32_t MAP_PUT(int32_t pad, int32_t screen_addr, int32_t remap, int32_t w); 602 602 } ; 603 603 #else*/ 604 604 605 inline void MAP_PUT( long screen_addr, long remap, longw)605 inline void MAP_PUT(uint8_t * screen_addr, uint8_t * remap, int w) 606 606 { 607 607 register int cx=w; 608 register intdi=screen_addr;609 register intsi=remap;608 register uint8_t * di=screen_addr; 609 register uint8_t * si=remap; 610 610 while (cx--) 611 *((uchar *)(di++))=*((uchar *)si+*((uchar *)di)); 612 } 613 614 inline void MAP_2PUT(long in_addr, long out_addr, long remap, long w) 611 { 612 uint8_t x=*((uint8_t *)si+*((uint8_t *)di)); 613 *((uint8_t *)(di++))=x; 614 } 615 } 616 617 inline void MAP_2PUT(uint8_t * in_addr, uint8_t * out_addr, uint8_t * remap, int w) 615 618 { 616 619 while (w--) 617 620 { 618 u char x=*(((uchar *)remap)+(*(uchar*)(in_addr++)));619 *((u char*)(out_addr++))=x;620 *((u char*)(out_addr++))=x;621 uint8_t x=*(((uint8_t *)remap)+(*(uint8_t *)(in_addr++))); 622 *((uint8_t *)(out_addr++))=x; 623 *((uint8_t *)(out_addr++))=x; 621 624 } 622 625 } … … 625 628 #endif 626 629 627 inline void PUT8( long*addr, uchar *remap)628 { 629 register u longin_pixels;630 register u longpixel;631 register u longout_pixels;630 inline void PUT8(int32_t *addr, uchar *remap) 631 { 632 register uint32_t in_pixels; 633 register uint32_t pixel; 634 register uint32_t out_pixels; 632 635 in_pixels=*addr; 633 636 pixel=in_pixels; … … 682 685 } 683 686 684 inline long MAP_PUT2(long dest_addr, long screen_addr, long remap, longw)687 inline int32_t MAP_PUT2(int32_t dest_addr, int32_t screen_addr, int32_t remap, int32_t w) 685 688 { while (w--) 686 689 { … … 697 700 // calculate the light value for this block. sum up all contritors 698 701 inline int calc_light_value(light_patch *lp, // light patch to look at 699 longsx, // screen x & y700 longsy)702 int32_t sx, // screen x & y 703 int32_t sy) 701 704 { 702 705 int lv=min_light_level,r2,light_count; … … 708 711 { 709 712 light_source *fn=*lon_p; 710 register long*dt=&(*lon_p)->type;713 register int32_t *dt=&(*lon_p)->type; 711 714 // note we are accessing structure members by bypassing the compiler 712 715 // for speed, this may not work on all compilers, but don't 713 // see why it shouldn't.. all members are long716 // see why it shouldn't.. all members are int32_t 714 717 715 718 if (*dt==9) // (dt==type), if light is a Solid rectangle, return it value … … 755 758 while (count--) 756 759 { 757 uchar *off=light_lookup+((( long)*remap_line)<<8);760 uchar *off=light_lookup+(((int32_t)*remap_line)<<8); 758 761 remap_line++; 759 762 … … 780 783 for (x=0;x<count;x++) 781 784 { 782 uchar *off=light_lookup+((( long)*remap)<<8);785 uchar *off=light_lookup+(((int32_t)*remap)<<8); 783 786 784 787 v=off[*(in_line++)]; … … 819 822 820 823 821 void light_screen(image *sc, long screenx, longscreeny, uchar *light_lookup, ushort ambient)824 void light_screen(image *sc, int32_t screenx, int32_t screeny, uchar *light_lookup, ushort ambient) 822 825 { 823 826 int lx_run=0,ly_run; // light block x & y run size in pixels == (1<<lx_run) … … 859 862 int suffix=(cx2-cx1-prefix+1)&7; 860 863 861 longremap_size=((cx2-cx1+1-prefix-suffix)>>lx_run);864 int32_t remap_size=((cx2-cx1+1-prefix-suffix)>>lx_run); 862 865 863 866 uchar *remap_line=(uchar *)jmalloc(remap_size,"light remap line"); … … 885 888 for (;(lp->y1>y-cy1 || lp->y2<y-cy1 || 886 889 lp->x1>suffix_x || lp->x2<suffix_x);lp=lp->next); 887 long caddr=(long)screen_line+cx2-cx1+1-suffix;888 u char *r=light_lookup+(((long)calc_light_value(lp,suffix_x+screenx,calcy)<<8));890 uint8_t * caddr=(uint8_t *)screen_line+cx2-cx1+1-suffix; 891 uint8_t *r=light_lookup+(((int32_t)calc_light_value(lp,suffix_x+screenx,calcy)<<8)); 889 892 switch (todoy) 890 893 { 891 894 case 4 : 892 895 { 893 MAP_PUT(caddr, (long)r,suffix); caddr+=scr_w;896 MAP_PUT(caddr,r,suffix); caddr+=scr_w; 894 897 } 895 898 case 3 : 896 { MAP_PUT(caddr, (long)r,suffix); caddr+=scr_w;}899 { MAP_PUT(caddr,r,suffix); caddr+=scr_w;} 897 900 case 2 : 898 { MAP_PUT(caddr, (long)r,suffix); caddr+=scr_w;}901 { MAP_PUT(caddr,r,suffix); caddr+=scr_w;} 899 902 case 1 : 900 903 { 901 MAP_PUT(caddr, (long)r,suffix);904 MAP_PUT(caddr,r,suffix); 902 905 } 903 906 } … … 910 913 lp->x1>prefix_x || lp->x2<prefix_x);lp=lp->next); 911 914 912 u char *r=light_lookup+(((long)calc_light_value(lp,prefix_x+screenx,calcy)<<8));913 long caddr=(long)screen_line;915 uint8_t *r=light_lookup+(((int32_t)calc_light_value(lp,prefix_x+screenx,calcy)<<8)); 916 uint8_t * caddr=(uint8_t *)screen_line; 914 917 switch (todoy) 915 918 { 916 919 case 4 : 917 920 { 918 MAP_PUT(caddr, (long)r,prefix);921 MAP_PUT(caddr,r,prefix); 919 922 caddr+=scr_w; 920 923 } 921 924 case 3 : 922 { MAP_PUT(caddr, (long)r,prefix); caddr+=scr_w; }925 { MAP_PUT(caddr,r,prefix); caddr+=scr_w; } 923 926 case 2 : 924 { MAP_PUT(caddr, (long)r,prefix); caddr+=scr_w; }927 { MAP_PUT(caddr,r,prefix); caddr+=scr_w; } 925 928 case 1 : 926 { MAP_PUT(caddr, (long)r,prefix); }929 { MAP_PUT(caddr,r,prefix); } 927 930 } 928 931 screen_line+=prefix; … … 969 972 970 973 971 void double_light_screen(image *sc, long screenx, longscreeny, uchar *light_lookup, ushort ambient,972 image *out, long out_x, longout_y)974 void double_light_screen(image *sc, int32_t screenx, int32_t screeny, uchar *light_lookup, ushort ambient, 975 image *out, int32_t out_x, int32_t out_y) 973 976 { 974 977 if (sc->width()*2+out_x>out->width() || … … 1035 1038 int suffix=(cx2-cx1-prefix+1)&7; 1036 1039 1037 longremap_size=((cx2-cx1+1-prefix-suffix)>>lx_run);1040 int32_t remap_size=((cx2-cx1+1-prefix-suffix)>>lx_run); 1038 1041 1039 1042 uchar *remap_line=(uchar *)jmalloc(remap_size,"light remap line"); … … 1063 1066 for (;(lp->y1>y-cy1 || lp->y2<y-cy1 || 1064 1067 lp->x1>suffix_x || lp->x2<suffix_x);lp=lp->next); 1065 long caddr=(long)in_line+cx2-cx1+1-suffix;1066 long daddr=(long)out_line+(cx2-cx1+1-suffix)*2;1067 1068 u char *r=light_lookup+(((long)calc_light_value(lp,suffix_x+screenx,calcy)<<8));1068 uint8_t * caddr=(uint8_t *)in_line+cx2-cx1+1-suffix; 1069 uint8_t * daddr=(uint8_t *)out_line+(cx2-cx1+1-suffix)*2; 1070 1071 uint8_t *r=light_lookup+(((int32_t)calc_light_value(lp,suffix_x+screenx,calcy)<<8)); 1069 1072 switch (todoy) 1070 1073 { 1071 1074 case 4 : 1072 1075 { 1073 MAP_2PUT(caddr,daddr, (long)r,suffix); daddr+=dscr_w;1074 MAP_2PUT(caddr,daddr, (long)r,suffix); daddr+=dscr_w; caddr+=scr_w;1076 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; 1077 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; caddr+=scr_w; 1075 1078 } 1076 1079 case 3 : 1077 1080 { 1078 MAP_2PUT(caddr,daddr, (long)r,suffix); daddr+=dscr_w;1079 MAP_2PUT(caddr,daddr, (long)r,suffix); daddr+=dscr_w; caddr+=scr_w;1081 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; 1082 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; caddr+=scr_w; 1080 1083 } 1081 1084 case 2 : 1082 1085 { 1083 MAP_2PUT(caddr,daddr, (long)r,suffix); daddr+=dscr_w;1084 MAP_2PUT(caddr,daddr, (long)r,suffix); daddr+=dscr_w; caddr+=scr_w;1086 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; 1087 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; caddr+=scr_w; 1085 1088 } 1086 1089 case 1 : 1087 1090 { 1088 MAP_2PUT(caddr,daddr, (long)r,suffix); daddr+=dscr_w;1089 MAP_2PUT(caddr,daddr, (long)r,suffix); daddr+=dscr_w; caddr+=scr_w;1091 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; 1092 MAP_2PUT(caddr,daddr,r,suffix); daddr+=dscr_w; caddr+=scr_w; 1090 1093 } break; 1091 1094 } … … 1098 1101 lp->x1>prefix_x || lp->x2<prefix_x);lp=lp->next); 1099 1102 1100 u char *r=light_lookup+(((long)calc_light_value(lp,prefix_x+screenx,calcy)<<8));1101 long caddr=(long)in_line;1102 long daddr=(long)out_line;1103 uint8_t *r=light_lookup+(((int32_t)calc_light_value(lp,prefix_x+screenx,calcy)<<8)); 1104 uint8_t * caddr=(uint8_t *)in_line; 1105 uint8_t * daddr=(uint8_t *)out_line; 1103 1106 switch (todoy) 1104 1107 { 1105 1108 case 4 : 1106 1109 { 1107 MAP_2PUT(caddr,daddr, (long)r,prefix); daddr+=dscr_w;1108 MAP_2PUT(caddr,daddr, (long)r,prefix); daddr+=dscr_w; caddr+=scr_w;1110 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; 1111 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; caddr+=scr_w; 1109 1112 } 1110 1113 case 3 : 1111 1114 { 1112 MAP_2PUT(caddr,daddr, (long)r,prefix); daddr+=dscr_w;1113 MAP_2PUT(caddr,daddr, (long)r,prefix); daddr+=dscr_w; caddr+=scr_w;1115 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; 1116 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; caddr+=scr_w; 1114 1117 } 1115 1118 case 2 : 1116 1119 { 1117 MAP_2PUT(caddr,daddr, (long)r,prefix); daddr+=dscr_w;1118 MAP_2PUT(caddr,daddr, (long)r,prefix); daddr+=dscr_w; caddr+=scr_w;1120 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; 1121 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; caddr+=scr_w; 1119 1122 } 1120 1123 case 1 : 1121 1124 { 1122 MAP_2PUT(caddr,daddr, (long)r,prefix); daddr+=dscr_w;1123 MAP_2PUT(caddr,daddr, (long)r,prefix); daddr+=dscr_w; caddr+=scr_w;1125 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; 1126 MAP_2PUT(caddr,daddr,r,prefix); daddr+=dscr_w; caddr+=scr_w; 1124 1127 } break; 1125 1128 } … … 1184 1187 void add_light_spec(spec_directory *sd, char *level_name) 1185 1188 { 1186 longsize=4+4; // number of lights and minimum light levels1189 int32_t size=4+4; // number of lights and minimum light levels 1187 1190 for (light_source *f=first_light_source;f;f=f->next) 1188 1191 size+=6*4+1; … … 1217 1220 { 1218 1221 fp->seek(se->offset,SEEK_SET); 1219 longt=fp->read_long();1222 int32_t t=fp->read_long(); 1220 1223 min_light_level=fp->read_long(); 1221 1224 light_source *last=NULL; … … 1223 1226 { 1224 1227 t--; 1225 longx=fp->read_long();1226 longy=fp->read_long();1227 longxshift=fp->read_long();1228 longyshift=fp->read_long();1229 longir=fp->read_long();1230 longora=fp->read_long();1231 longty=fp->read_byte();1228 int32_t x=fp->read_long(); 1229 int32_t y=fp->read_long(); 1230 int32_t xshift=fp->read_long(); 1231 int32_t yshift=fp->read_long(); 1232 int32_t ir=fp->read_long(); 1233 int32_t ora=fp->read_long(); 1234 int32_t ty=fp->read_byte(); 1232 1235 1233 1236 light_source *p=new light_source(ty,x,y,ir,ora,xshift,yshift,NULL); -
abuse/trunk/src/lisp.cpp
r11 r16 499 499 } 500 500 501 longlnumber_value(void *lnumber)501 int32_t lnumber_value(void *lnumber) 502 502 { 503 503 switch (item_type(lnumber)) … … 2808 2808 case 85 : // num2str 2809 2809 { 2810 char str[ 10];2811 sprintf(str,"%ld", lnumber_value(eval(CAR(arg_list))));2810 char str[20]; 2811 sprintf(str,"%ld",(long int)lnumber_value(eval(CAR(arg_list)))); 2812 2812 ret=new_lisp_string(str); 2813 2813 } break; -
abuse/trunk/src/morpher.cpp
r2 r16 8 8 if (fleft) 9 9 { 10 longrx,ry;10 int32_t rx,ry; 11 11 the_game->game_to_mouse(who->x-(cx>>16),who->y-(cy>>16),v,rx,ry); 12 12 mor->show(screen,rx,ry,color_table,pal,1000); -
abuse/trunk/src/objects.cpp
r4 r16 82 82 }; 83 83 84 longgame_object::get_var_by_name(char *name, int &error)84 int32_t game_object::get_var_by_name(char *name, int &error) 85 85 { 86 86 error=0; … … 112 112 } 113 113 114 int game_object::set_var_by_name(char *name, longvalue)114 int game_object::set_var_by_name(char *name, int32_t value) 115 115 { 116 116 int i=0; … … 144 144 145 145 146 void simple_object::set_var(int xx, u longv)146 void simple_object::set_var(int xx, uint32_t v) 147 147 { 148 148 switch (xx) … … 184 184 } 185 185 186 longsimple_object::get_var(int xx)186 int32_t simple_object::get_var(int xx) 187 187 { 188 188 switch (xx) … … 370 370 void game_object::draw_above(view *v) 371 371 { 372 longx1,y1,x2,y2,sy1,sy2,sx,i;372 int32_t x1,y1,x2,y2,sy1,sy2,sx,i; 373 373 picture_space(x1,y1,x2,y2); 374 374 … … 376 376 if (sy2>=v->cy1) 377 377 { 378 longdraw_to=y1-(sy2-v->cy1),tmp=x;378 int32_t draw_to=y1-(sy2-v->cy1),tmp=x; 379 379 current_level->foreground_intersect(x,y1,tmp,draw_to); 380 380 the_game->game_to_mouse(x1,draw_to,v,i,sy1); // calculate sy1 … … 456 456 457 457 458 void game_object::do_damage(int amount, game_object *from, long hitx, longhity,459 long push_xvel, longpush_yvel)458 void game_object::do_damage(int amount, game_object *from, int32_t hitx, int32_t hity, 459 int32_t push_xvel, int32_t push_yvel) 460 460 { 461 461 … … 527 527 } 528 528 529 void game_object::damage_fun(int amount, game_object *from, long hitx, longhity,530 long push_xvel, longpush_yvel)529 void game_object::damage_fun(int amount, game_object *from, int32_t hitx, int32_t hity, 530 int32_t push_xvel, int32_t push_yvel) 531 531 { 532 532 if (!hurtable() || !alive()) return ; … … 569 569 570 570 571 void game_object::picture_space( long &x1, long &y1,long &x2, long&y2)571 void game_object::picture_space(int32_t &x1, int32_t &y1,int32_t &x2, int32_t &y2) 572 572 { 573 573 int xc=x_center(),w=picture()->width(),h=picture()->height(); … … 605 605 606 606 607 longgame_object::x_center()607 int32_t game_object::x_center() 608 608 { 609 609 return current_sequence()->x_center(current_frame); … … 748 748 } 749 749 750 game_object *game_object::try_move( long x, long y, long &xv, long&yv, int checks)750 game_object *game_object::try_move(int32_t x, int32_t y, int32_t &xv, int32_t &yv, int checks) 751 751 { 752 752 if (xv || yv) // make sure they are suggesting movement 753 753 { 754 754 game_object *who1=NULL,*who2=NULL; // who did we intersect? 755 longx2,y2,h;755 int32_t x2,y2,h; 756 756 757 757 if (checks&1) … … 791 791 void *game_object::float_tick() // returns 1 if you hit something, 0 otherwise 792 792 { 793 longret=0;793 int32_t ret=0; 794 794 if (hp()<=0) 795 795 { … … 816 816 } 817 817 818 longfxv=sfxvel()+sfxacel(),fyv=sfyvel()+sfyacel();819 longxv=xvel()+xacel()+(fxv>>8),yv=yvel()+yacel()+(fyv>>8);818 int32_t fxv=sfxvel()+sfxacel(),fyv=sfyvel()+sfyacel(); 819 int32_t xv=xvel()+xacel()+(fxv>>8),yv=yvel()+yacel()+(fyv>>8); 820 820 821 821 if (xv!=xvel() || yv!=yvel()) // only store vel's if changed so we don't increase object size … … 834 834 if (fxv || fyv || xv || yv) // don't even try if there is no velocity 835 835 { 836 longffx=fx()+sfxvel(),ffy=fy()+sfyvel();837 longnxv=xvel()+(ffx>>8);838 longnyv=yvel()+(ffy>>8);836 int32_t ffx=fx()+sfxvel(),ffy=fy()+sfyvel(); 837 int32_t nxv=xvel()+(ffx>>8); 838 int32_t nyv=yvel()+(ffy>>8); 839 839 set_fx(ffx&0xff); 840 840 set_fy(ffy&0xff); 841 841 842 longold_nxv=nxv,old_nyv=nyv;842 int32_t old_nxv=nxv,old_nyv=nyv; 843 843 game_object *hit_object=try_move(x,y,nxv,nyv,3); // now find out what velocity is safe to use 844 844 … … 853 853 if (old_nxv!=nxv || old_nyv!=nyv) 854 854 { 855 longlx=last_tile_hit_x,ly=last_tile_hit_y;855 int32_t lx=last_tile_hit_x,ly=last_tile_hit_y; 856 856 stop(); 857 857 if (old_nxv==0) … … 865 865 } else 866 866 { 867 longtx=(old_nxv>0 ? 1 : -1),ty=0;867 int32_t tx=(old_nxv>0 ? 1 : -1),ty=0; 868 868 try_move(x,y,tx,ty,3); 869 869 if (!tx) … … 906 906 int blocked=0; 907 907 908 longxt=0,yt=2;908 int32_t xt=0,yt=2; 909 909 try_move(x,y-2,xt,yt,1); // make sure we are not falling through the floor 910 910 y=y-2+yt; … … 926 926 927 927 // first let's move the guy acording to his physics 928 longxa=xacel(),ya=yacel(),fxa=sfxacel(),fya=sfyacel();928 int32_t xa=xacel(),ya=yacel(),fxa=sfxacel(),fya=sfyacel(); 929 929 if (xa || ya || fxa || fya) 930 930 { 931 931 int fxv=sfxvel(),fyv=sfyvel(); 932 932 fxv+=fxa; fyv+=fya; 933 longxv=xvel()+xa+(fxv>>8);933 int32_t xv=xvel()+xa+(fxv>>8); 934 934 set_xvel(xvel()+xa+(fxv>>8)); 935 935 set_yvel(yvel()+ya+(fyv>>8)); … … 939 939 940 940 // check to see if this advancement causes him to collide with objects 941 longold_vy=yvel(),old_vx=xvel(); // save the correct veloicties941 int32_t old_vy=yvel(),old_vx=xvel(); // save the correct veloicties 942 942 943 943 if (old_vx || old_vy) … … 946 946 if (yvel()<=0) // if we are going up or a strait across check up and down 947 947 up=2; 948 longxv=xvel(),yv=yvel();948 int32_t xv=xvel(),yv=yvel(); 949 949 game_object *h=try_move(x,y,xv,yv,1|up); // now find out what velocity is safe to use 950 950 set_xvel(xv); … … 959 959 if (gravity()) // was he going up or down? 960 960 { 961 longfall_xv=0,old_fall_vy,fall_vy;961 int32_t fall_xv=0,old_fall_vy,fall_vy; 962 962 old_fall_vy=fall_vy=old_vy-yvel(); // make sure he gets all of his yvel 963 963 try_move(x,y,fall_xv,fall_vy,1|up); … … 1001 1001 if (old_vy!=0) 1002 1002 { 1003 longtestx=old_vx<0 ? -1 : 1,testy=0; // see if we were stopped left/right1003 int32_t testx=old_vx<0 ? -1 : 1,testy=0; // see if we were stopped left/right 1004 1004 // or just up down 1005 1005 try_move(x,y,testx,testy,1|up); … … 1032 1032 else // see if we can make him 'climb' the hill 1033 1033 { 1034 longox=x,oy=y; // rember orginal position in case climb doesn't work1035 1036 longclimb_xvel=0,climb_yvel=-5; // try to move up one pixel to step over the1034 int32_t ox=x,oy=y; // rember orginal position in case climb doesn't work 1035 1036 int32_t climb_xvel=0,climb_yvel=-5; // try to move up one pixel to step over the 1037 1037 try_move(x,y,climb_xvel,climb_yvel,3); // jutting polygon line 1038 1038 y+=climb_yvel; … … 1082 1082 if (yacel()==0 && !gravity()) // he is not falling, make sure he can't 1083 1083 { 1084 longnvx=0,nvy=yvel()+12; // check three pixels below for ground1084 int32_t nvx=0,nvy=yvel()+12; // check three pixels below for ground 1085 1085 try_move(x,y,nvx,nvy,1); 1086 1086 if (nvy>11) // if he falls more than 2 pixels, then he falls … … 1117 1117 if (ad && current_level) 1118 1118 { 1119 longxv;1119 int32_t xv; 1120 1120 if (direction>0) xv=ad; else xv=-ad; 1121 longyv=0;1121 int32_t yv=0; 1122 1122 try_move(x,y,xv,yv,3); 1123 1123 x+=xv; … … 1139 1139 1140 1140 1141 game_object *create(int type, long x, longy, int skip_constructor, int aitype)1141 game_object *create(int type, int32_t x, int32_t y, int skip_constructor, int aitype) 1142 1142 { 1143 1143 game_object *g=new game_object(type,skip_constructor); … … 1299 1299 else if (!gravity() && state!=start_run_jump) 1300 1300 { 1301 longstop_acel;1301 int32_t stop_acel; 1302 1302 if (xvel()<0) // he was going left 1303 1303 { … … 1448 1448 1449 1449 // first let's move the guy acording to his physics 1450 longxa=xacel(),ya=yacel(),fxa=sfxacel(),fya=sfyacel();1450 int32_t xa=xacel(),ya=yacel(),fxa=sfxacel(),fya=sfyacel(); 1451 1451 if (xa || ya || fxa || fya) 1452 1452 { 1453 1453 int fxv=sfxvel(),fyv=sfyvel(); 1454 1454 fxv+=fxa; fyv+=fya; 1455 longxv=xvel()+xa+(fxv>>8);1455 int32_t xv=xvel()+xa+(fxv>>8); 1456 1456 set_xvel(xvel()+xa+(fxv>>8)); 1457 1457 set_yvel(yvel()+ya+(fyv>>8)); … … 1460 1460 } 1461 1461 1462 longox2,oy2;1463 1464 longnx=x+xvel(),nfx=fx()+fxvel(),ny=y+yvel(),nfy=fy()+fyvel();1462 int32_t ox2,oy2; 1463 1464 int32_t nx=x+xvel(),nfx=fx()+fxvel(),ny=y+yvel(),nfy=fy()+fyvel(); 1465 1465 nx+=nfx>>8; 1466 1466 ny+=nfy>>8; … … 1506 1506 } 1507 1507 1508 game_object *number_to_object_in_list( longx, object_node *list)1508 game_object *number_to_object_in_list(int32_t x, object_node *list) 1509 1509 { 1510 1510 if (!x) return NULL; x--; … … 1526 1526 1527 1527 1528 longobject_list_length(object_node *list)1529 { 1530 longx=0;1528 int32_t object_list_length(object_node *list) 1529 { 1530 int32_t x=0; 1531 1531 while (list) { list=list->next; x++; } 1532 1532 return x; … … 1543 1543 if (t) 1544 1544 { 1545 lvars=( long*)jmalloc(t*4,"object vars");1545 lvars=(int32_t *)jmalloc(t*4,"object vars"); 1546 1546 memset(lvars,0,t*4); 1547 1547 } … … 1556 1556 int game_object::reduced_state() 1557 1557 { 1558 longx=0;1558 int32_t x=0; 1559 1559 for (int i=0;i<figures[otype]->ts;i++) 1560 1560 { … … 1607 1607 if (t) 1608 1608 { 1609 lvars=( long*)jmalloc(t*4,"object vars");1609 lvars=(int32_t *)jmalloc(t*4,"object vars"); 1610 1610 memset(lvars,0,t*4); 1611 1611 } -
abuse/trunk/src/view.cpp
r2 r16 96 96 97 97 98 longview::xoff()98 int32_t view::xoff() 99 99 { 100 100 if (focus) … … 106 106 } 107 107 108 longview::interpolated_xoff()108 int32_t view::interpolated_xoff() 109 109 { 110 110 if (focus) … … 117 117 118 118 119 longview::yoff()119 int32_t view::yoff() 120 120 { 121 121 if (focus) … … 128 128 129 129 130 longview::interpolated_yoff()130 int32_t view::interpolated_yoff() 131 131 { 132 132 if (focus) … … 249 249 if (total_weapons) 250 250 { 251 weapons=( long *)jmalloc(total_weapons*sizeof(long),"weapon array");252 last_weapons=( long *)jmalloc(total_weapons*sizeof(long),"last weapon array");253 memset(weapons,0xff,total_weapons*sizeof( long)); // set all to -1254 memset(last_weapons,0xff,total_weapons*sizeof( long)); // set all to -1251 weapons=(int32_t *)jmalloc(total_weapons*sizeof(int32_t),"weapon array"); 252 last_weapons=(int32_t *)jmalloc(total_weapons*sizeof(int32_t),"last weapon array"); 253 memset(weapons,0xff,total_weapons*sizeof(int32_t)); // set all to -1 254 memset(last_weapons,0xff,total_weapons*sizeof(int32_t)); // set all to -1 255 255 } 256 256 … … 262 262 } 263 263 264 longview::x_center()264 int32_t view::x_center() 265 265 { 266 266 if (!focus) … … 270 270 } 271 271 272 longview::y_center()272 int32_t view::y_center() 273 273 { 274 274 if (!focus) … … 321 321 { 322 322 int sug_x,sug_y,sug_b1,sug_b2,sug_b3,sug_b4; 323 longsug_px,sug_py;323 int32_t sug_px,sug_py; 324 324 325 325 // NOTE:(AK) I have commented this out so we don't use the lisp … … 352 352 else sug_b4 = 0; 353 353 354 longbx = lnumber_value( CAR( ret ) );354 int32_t bx = lnumber_value( CAR( ret ) ); 355 355 ret = CDR( ret ); 356 longby = lnumber_value( CAR( ret ) );356 int32_t by = lnumber_value( CAR( ret ) ); 357 357 ret = CDR( ret ); 358 358 the_game->mouse_to_game( bx, by, sug_px, sug_py, this ); … … 480 480 case SCMD_VIEW_RESIZE : 481 481 { 482 longx[8];482 int32_t x[8]; 483 483 memcpy(x,pk,8*4); pk+=8*4; 484 484 cx1=lltl(x[0]); … … 503 503 case SCMD_WEAPON_CHANGE : 504 504 { 505 longx;505 int32_t x; 506 506 memcpy(&x,pk,4); pk+=4; 507 507 current_weapon=lltl(x); … … 818 818 819 819 820 void view::resize_view( long Cx1, long Cy1, long Cx2, longCy2)820 void view::resize_view(int32_t Cx1, int32_t Cy1, int32_t Cx2, int32_t Cy2) 821 821 { 822 822 if (cx1!=Cx1 || cx2!=Cx2 || cy1!=Cy1 || cy2!=Cy2) … … 858 858 } 859 859 focus->set_state(stopped); 860 memset(weapons,0xff,total_weapons*sizeof( long));861 memset(last_weapons,0xff,total_weapons*sizeof( long));860 memset(weapons,0xff,total_weapons*sizeof(int32_t)); 861 memset(last_weapons,0xff,total_weapons*sizeof(int32_t)); 862 862 863 863 shift_down=SHIFT_DOWN_DEFAULT; … … 980 980 { return vv_names[num]; } 981 981 982 longview::get_view_var_value(int num)982 int32_t view::get_view_var_value(int num) 983 983 { 984 984 switch (num) … … 1035 1035 1036 1036 1037 long view::set_view_var_value(int num, longx)1037 int32_t view::set_view_var_value(int num, int32_t x) 1038 1038 { 1039 1039 switch (num) … … 1147 1147 void process_packet_commands(uchar *pk, int size) 1148 1148 { 1149 longsync_short=-1;1149 int32_t sync_short=-1; 1150 1150 1151 1151 if (!size) return ;
Note: See TracChangeset
for help on using the changeset viewer.