Changeset 16


Ignore:
Timestamp:
Nov 10, 2005, 8:08:09 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • shitloads of long -> int32_t changes for 64 bit safety.
Location:
abuse/trunk/src
Files:
24 edited

Legend:

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

    r2 r16  
    1717void *ant_ai();
    1818
    19 int can_see(game_object *o, long x1, long y1, long x2, long y2)
    20 {
    21   long nx2=x2,ny2=y2;
     19int 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;
    2222  current_level->foreground_intersect(x1,y1,x2,y2);
    2323  if (x2!=nx2 || y2!=ny2) return 0;
     
    9595static void fire_at_player(game_object *o, game_object *b)
    9696{
    97   long 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;
     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;
    9999  if (can_see(o,o->x,o->y,firex,firey) && can_see(o,firex,firey,playerx,playery))
    100100  {
     
    224224      if (!o->next_picture())
    225225      {
    226         long xv=0,yv=2;
     226        int32_t xv=0,yv=2;
    227227        o->try_move(o->x,o->y,xv,yv,1);
    228228        if (yv!=0)
     
    264264          else
    265265          {
    266             long xm=o->direction>0 ? get_ability(o->otype,run_top_speed) : -get_ability(o->otype,run_top_speed);
    267             long ym=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;
    268268            if (o->state!=running) o->set_state(running);
    269269
     
    349349//      o->set_yvel(o->yvel()+1);
    350350      o->set_xacel(0);
    351       long xv=0,yv=o->yvel();
     351      int32_t xv=0,yv=o->yvel();
    352352      o->y-=31;
    353353      o->try_move(o->x,o->y,xv,yv,1);
  • abuse/trunk/src/clisp.cpp

    r2 r16  
    779779    case 24 :
    780780    {
    781       long x1=lnumber_value(eval(CAR(args)));  args=CDR(args);
    782       long y1=lnumber_value(eval(CAR(args)));  args=CDR(args);
    783       long x2=lnumber_value(eval(CAR(args)));  args=CDR(args);
    784       long y2=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)));
    785785      current_level->foreground_intersect(x1,y1,x2,y2);
    786786      void *ret=NULL;
     
    816816    {
    817817     
    818       long xm,ym,but;
     818      int32_t xm,ym,but;
    819819      xm=lnumber_value(CAR(args)); args=CDR(args);
    820820      ym=lnumber_value(CAR(args)); args=CDR(args);
     
    892892    case 49 :
    893893    {
    894       long x=lnumber_value(eval(CAR(args))); args=CDR(args);
    895       long y=lnumber_value(eval(CAR(args))); args=CDR(args);
    896 
    897       long rx,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;
    898898      the_game->mouse_to_game(x,y,rx,ry);
    899899      void *ret=NULL;
     
    907907    case 50 :
    908908    {
    909       long x=lnumber_value(eval(CAR(args))); args=CDR(args);
    910       long y=lnumber_value(eval(CAR(args))); args=CDR(args);
    911 
    912       long rx,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;
    913913      the_game->game_to_mouse(x,y,current_view,rx,ry);
    914914      void *ret=NULL;
     
    10031003        long x;
    10041004        sscanf(lstring_value(eval(CAR(args))),"%lx",&x);
    1005         return new_lisp_pointer((void *)x);
     1005        return new_lisp_pointer((void *)(intptr_t)x);
    10061006    } break;
    10071007    case 64 :
     
    11381138    case 22 :
    11391139    {
    1140       long x1,y1,x2,y2,xp1,yp1,xp2,yp2;
     1140      int32_t x1,y1,x2,y2,xp1,yp1,xp2,yp2;
    11411141      current_level->attacker(current_object)->picture_space(x1,y1,x2,y2);
    11421142      current_object->picture_space(xp1,yp1,xp2,yp2);
     
    11561156    case 31 : return current_object->y; break;
    11571157    case 32 :
    1158     { long v=lnumber_value(CAR(args));
     1158    { int32_t v=lnumber_value(CAR(args));
    11591159      current_object->x=v;
    11601160//      current_object->last_x=v;
     
    11621162    } break;
    11631163    case 33 :
    1164     { long v=lnumber_value(CAR(args));
     1164    { int32_t v=lnumber_value(CAR(args));
    11651165      current_object->y=v;
    11661166//      current_object->last_y=v;
     
    11741174    case 37 :
    11751175    {
    1176       long s=lnumber_value(CAR(args));
     1176      int32_t s=lnumber_value(CAR(args));
    11771177      current_object->set_state((character_state)s);
    11781178      return (s==current_object->state);
     
    12801280    case 92 :
    12811281    {
    1282       long cx1,x1=lnumber_value(CAR(args)); args=lcdr(args);
    1283       long cy1,y1=lnumber_value(CAR(args)); args=lcdr(args);
    1284       long cx2,x2=lnumber_value(CAR(args)); args=lcdr(args);
    1285       long cy2,y2=lnumber_value(CAR(args)); args=lcdr(args);
    1286       long c=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));
    12871287      the_game->game_to_mouse(x1,y1,current_view,cx1,cy1);
    12881288      the_game->game_to_mouse(x2,y2,current_view,cx2,cy2);
     
    13021302    case 104 : 
    13031303    { light_source *l=(light_source *)lpointer_value(CAR(args));
    1304       long x=lnumber_value(CAR(CDR(args)));
     1304      int32_t x=lnumber_value(CAR(CDR(args)));
    13051305      if (x>=1)
    13061306        l->inner_radius=x;
     
    13101310    case 105 : 
    13111311    { light_source *l=(light_source *)lpointer_value(CAR(args));
    1312       long x=lnumber_value(CAR(CDR(args)));
     1312      int32_t x=lnumber_value(CAR(CDR(args)));
    13131313      if (x>l->inner_radius)
    13141314        l->outer_radius=x;
     
    13971397        if (a)
    13981398        {
    1399           long x=lnumber_value(lcar(a)); a=CDR(a);
     1399          int32_t x=lnumber_value(lcar(a)); a=CDR(a);
    14001400          if (!a)
    14011401          {
     
    14041404            exit(1);
    14051405          }
    1406           long y=lnumber_value(lcar(a));
     1406          int32_t y=lnumber_value(lcar(a));
    14071407          the_game->play_sound(id,vol,x,y);
    14081408        } else cash.sfx(id)->play(vol);       
     
    14141414    case 138 :
    14151415    { int id=lnumber_value(CAR(args)); args=CDR(args);
    1416       long x=lnumber_value(CAR(args)); args=CDR(args);
    1417       long y=lnumber_value(CAR(args)); args=CDR(args);
    1418       long dir=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));
    14191419      add_panim(id,x,y,dir);
    14201420    } break;
    14211421    case 142 :
    14221422    {
    1423       long x=lnumber_value(CAR(args)); args=CDR(args);
     1423      int32_t x=lnumber_value(CAR(args)); args=CDR(args);
    14241424      if (x<0 || x>=total_weapons)
    14251425      {
     
    14311431    case 143 :
    14321432    {
    1433       long x=lnumber_value(CAR(args)); args=CDR(args);
    1434       long y=lnumber_value(CAR(args)); args=CDR(args);
    1435       long r=lnumber_value(CAR(args)); args=CDR(args);
    1436       long m=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);
    14371437      game_object *o=(game_object *)lpointer_value(CAR(args)); args=CDR(args);
    1438       long mp=lnumber_value(CAR(args));
     1438      int32_t mp=lnumber_value(CAR(args));
    14391439      current_level->hurt_radius(x,y,r,m,current_object,o,mp);
    14401440    } break;
     
    14461446      else
    14471447      {
    1448         long x=lnumber_value(CAR(args)); args=CDR(args);
    1449         long y=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);
    14501450        if (x<0 || x>=total_weapons)
    14511451        { lbreak("weapon out of range (%d)\n",x); exit(0); }
     
    15031503    {
    15041504      game_object *o=(game_object *)lpointer_value(CAR(args));
    1505       long x=o->x-current_object->x,
     1505      int32_t x=o->x-current_object->x,
    15061506        y=-(o->y-o->picture()->height()/2-(current_object->y-(current_object->picture()->height()/2)));
    15071507      return lisp_atan2(y,x);
     
    15091509    case 154 :
    15101510    {
    1511       long ang=lnumber_value(CAR(args)); args=CDR(args);
    1512       long mag=lfixed_point_value(CAR(args));
    1513       long xvel=(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);
    15141514      current_object->set_xvel(xvel>>16);
    15151515      current_object->set_fxvel((xvel&0xffff)>>8);
    1516       long yvel=-(lisp_sin(ang)>>8)*(mag>>8);
     1516      int32_t yvel=-(lisp_sin(ang)>>8)*(mag>>8);
    15171517      current_object->set_yvel(yvel>>16);
    15181518      current_object->set_fyvel((yvel&0xffff)>>8);     
     
    15221522      int tframes=current_object->total_frames(),f;
    15231523
    1524       long ang1=lnumber_value(CAR(args)); args=CDR(args);     
     1524      int32_t ang1=lnumber_value(CAR(args)); args=CDR(args);     
    15251525      if (ang1<0) ang1=(ang1%360)+360;
    15261526      else if (ang1>=360) ang1=ang1%360;
    1527       long ang2=lnumber_value(CAR(args)); args=CDR(args);     
     1527      int32_t ang2=lnumber_value(CAR(args)); args=CDR(args);     
    15281528      if (ang2<0) ang2=(ang2%360)+360;
    15291529      else if (ang2>=360) ang2=ang2%360;
    15301530
    1531       long ang=(lnumber_value(CAR(args))+90/tframes)%360;
     1531      int32_t ang=(lnumber_value(CAR(args))+90/tframes)%360;
    15321532      if (ang1>ang2)
    15331533      {
     
    15571557    case 169 :
    15581558    {
    1559       long am=lnumber_value(CAR(args)); args=CDR(args);
     1559      int32_t am=lnumber_value(CAR(args)); args=CDR(args);
    15601560      game_object *from=(game_object *)lpointer_value(CAR(args)); args=CDR(args);
    1561       long hitx=lnumber_value(CAR(args)); args=CDR(args);     
    1562       long hity=lnumber_value(CAR(args)); args=CDR(args);     
    1563       long px=lnumber_value(CAR(args)); args=CDR(args);     
    1564       long py=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);
    15651565      current_object->damage_fun(am,from,hitx,hity,px,py);
    15661566    } break;
     
    16291629    {
    16301630      view *v=lget_view(CAR(args),"set_ambient_light");       args=CDR(args);
    1631       long x=lnumber_value(CAR(args));
     1631      int32_t x=lnumber_value(CAR(args));
    16321632      if (x>=0 && x<64) v->ambient=x;
    16331633    } break;
     
    16571657    case 192 :
    16581658    {     
    1659       long x=lnumber_value(CAR(args)); args=CDR(args);
    1660       long y=lnumber_value(CAR(args)); args=CDR(args);
    1661       long type=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));
    16621662      if (x<0 || y<0 || x>=current_level->foreground_width() || y>=current_level->foreground_width())
    16631663        lbreak("%d %d is out of range of fg map",x,y);
     
    16671667    case 193 :
    16681668    {
    1669       long x=lnumber_value(CAR(args)); args=CDR(args);
    1670       long y=lnumber_value(CAR(args));
     1669      int32_t x=lnumber_value(CAR(args)); args=CDR(args);
     1670      int32_t y=lnumber_value(CAR(args));
    16711671      if (x<0 || y<0 || x>=current_level->foreground_width() || y>=current_level->foreground_width())
    16721672        lbreak("%d %d is out of range of fg map",x,y);
     
    16751675    case 194 :
    16761676    {     
    1677       long x=lnumber_value(CAR(args)); args=CDR(args);
    1678       long y=lnumber_value(CAR(args)); args=CDR(args);
    1679       long type=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));
    16801680      if (x<0 || y<0 || x>=current_level->background_width() || y>=current_level->background_width())
    16811681        lbreak("%d %d is out of range of fg map",x,y);
     
    16851685    case 195 :
    16861686    {
    1687       long x=lnumber_value(CAR(args)); args=CDR(args);
    1688       long y=lnumber_value(CAR(args));
     1687      int32_t x=lnumber_value(CAR(args)); args=CDR(args);
     1688      int32_t y=lnumber_value(CAR(args));
    16891689      if (x<0 || y<0 || x>=current_level->background_width() || y>=current_level->background_width())
    16901690        lbreak("%d %d is out of range of fg map",x,y);
     
    17411741    case 200 :
    17421742    {
    1743       long xv=lnumber_value(CAR(args));  args=CDR(args);
    1744       long yv=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);
    17451745      int top=2;
    17461746      if (args)
    17471747        if (!CAR(args)) top=0;
    17481748       
    1749       long oxv=xv,oyv=yv;
     1749      int32_t oxv=xv,oyv=yv;
    17501750      current_object->try_move(current_object->x,current_object->y,xv,yv,1|top);
    17511751      current_object->x+=xv;
     
    17551755    case 201 :
    17561756    {
    1757       long x=lnumber_value(CAR(args));
     1757      int32_t x=lnumber_value(CAR(args));
    17581758      return figures[current_object->otype]->get_sequence((character_state)x)->length();
    17591759    } break;
    17601760    case 202 :
    17611761    {
    1762       long x1=lnumber_value(CAR(args)); args=CDR(args);
    1763       long y1=lnumber_value(CAR(args)); args=CDR(args);
    1764       long x2=lnumber_value(CAR(args)); args=CDR(args);
    1765       long y2=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);
    17661766      void *block_all=CAR(args);
    1767       long nx2=x2,ny2=y2;
     1767      int32_t nx2=x2,ny2=y2;
    17681768      current_level->foreground_intersect(x1,y1,x2,y2);
    17691769      if (x2!=nx2 || y2!=ny2) return 0;
     
    17961796    case 206 :
    17971797    {
    1798       long x=lnumber_value(CAR(args));
     1798      int32_t x=lnumber_value(CAR(args));
    17991799      if (x<current_object->total_frames())
    18001800        current_object->current_frame=x;
     
    18341834    case 216 :
    18351835    {
    1836       long x1=lnumber_value(CAR(args)); args=lcdr(args);
    1837       long y1=lnumber_value(CAR(args)); args=lcdr(args);
    1838       long id=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));
    18391839      cash.img(id)->put_image(screen,x1,y1,1);
    18401840    } break;
     
    19351935      else
    19361936      {
    1937         long x=lnumber_value(CAR(args));
     1937        int32_t x=lnumber_value(CAR(args));
    19381938        if (x<0 || x>=total_weapons)
    19391939        { lbreak("weapon out of range (%d)\n",x); exit(0); }
     
    19571957    case 234 :
    19581958    {
    1959       long cx1,x1=lnumber_value(CAR(args)); args=lcdr(args);
    1960       long cy1,y1=lnumber_value(CAR(args)); args=lcdr(args);
    1961       long cx2,x2=lnumber_value(CAR(args)); args=lcdr(args);
    1962       long cy2,y2=lnumber_value(CAR(args)); args=lcdr(args);
    1963       long c=lnumber_value(CAR(args)); args=lcdr(args);
    1964       long s=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));
    19651965      the_game->game_to_mouse(x1,y1,current_view,cx1,cy1);
    19661966      the_game->game_to_mouse(x2,y2,current_view,cx2,cy2);
     
    20092009    case 244 :
    20102010    {
    2011       long cx1,x1=lnumber_value(CAR(args)); args=lcdr(args);
    2012       long cy1,y1=lnumber_value(CAR(args)); args=lcdr(args);
    2013       long cx2,x2=lnumber_value(CAR(args)); args=lcdr(args);
    2014       long cy2,y2=lnumber_value(CAR(args)); args=lcdr(args);
    2015       long c1=lnumber_value(CAR(args)); args=lcdr(args);
    2016       long c2=lnumber_value(CAR(args)); args=lcdr(args);
    2017       long s=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));
    20182018      the_game->game_to_mouse(x1,y1,current_view,cx1,cy1);
    20192019      the_game->game_to_mouse(x2,y2,current_view,cx2,cy2);
     
    20322032    case 247 :
    20332033    {
    2034       long cx1=lnumber_value(CAR(args)); args=lcdr(args);
    2035       long cy1=lnumber_value(CAR(args)); args=lcdr(args);
    2036       long cx2=lnumber_value(CAR(args)); args=lcdr(args);
    2037       long cy2=lnumber_value(CAR(args)); args=lcdr(args);
    2038       long c1=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);     
    20392039      screen->bar(cx1,cy1,cx2,cy2,c1);
    20402040    } break;
     
    21872187    {
    21882188      JCFont *fnt=(JCFont *)lpointer_value(CAR(args)); args=CDR(args);
    2189       long x=lnumber_value(CAR(args));       args=CDR(args);
    2190       long y=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);
    21912191      char *st=lstring_value(CAR(args));     args=CDR(args);
    21922192      int color=-1;
     
    22062206    case 282 :
    22072207    {
    2208       long x1=lnumber_value(CAR(args));   args=CDR(args);
    2209       long y1=lnumber_value(CAR(args));   args=CDR(args);
    2210       long x2=lnumber_value(CAR(args));   args=CDR(args);
    2211       long y2=lnumber_value(CAR(args));   args=CDR(args);
    2212       long c=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));
    22132213      screen->bar(x1,y1,x2,y2,c);
    22142214    } break;
    22152215    case 283 :
    22162216    {
    2217       long x1=lnumber_value(CAR(args));   args=CDR(args);
    2218       long y1=lnumber_value(CAR(args));   args=CDR(args);
    2219       long x2=lnumber_value(CAR(args));   args=CDR(args);
    2220       long y2=lnumber_value(CAR(args));   args=CDR(args);
    2221       long c=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));
    22222222      screen->rectangle(x1,y1,x2,y2,c);
    22232223    } break;
  • abuse/trunk/src/collide.cpp

    r4 r16  
    55{
    66  public :
    7   long total,x1,y1,x2,y2;
     7  int32_t total,x1,y1,x2,y2;
    88  game_object **touch; 
    99  collide_patch *next;
    10   collide_patch(long X1, long Y1, long X2, long Y2, collide_patch *Next)
     10  collide_patch(int32_t X1, int32_t Y1, int32_t X2, int32_t Y2, collide_patch *Next)
    1111  {
    1212    x1=X1; y1=Y1; x2=X2; y2=Y2;
     
    1515    touch=NULL;
    1616  }
    17   void add_collide(long X1, long Y1, long X2, long Y2, game_object *who);
     17  void add_collide(int32_t X1, int32_t Y1, int32_t X2, int32_t Y2, game_object *who);
    1818  collide_patch *copy(collide_patch *Next);
    1919  ~collide_patch() { if (total) jfree(touch); }
     
    3636
    3737
    38 void add_collide(collide_patch *&first, long x1, long y1, long x2, long y2,
     38void add_collide(collide_patch *&first, int32_t x1, int32_t y1, int32_t x2, int32_t y2,
    3939                            game_object *who)
    4040{
     
    148148{
    149149  game_object *target,*rec,*subject;
    150   long sx1,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;
    151151
    152152  for (int l=0;l<attack_total;l++)
     
    184184            for (t_dat=t_damage->data,j=(int)t_damage->tot-1;j>0 && !rec;j--)
    185185            {
    186               long x1,y1,x2,y2,          // define the two line segments to check
     186              int32_t x1,y1,x2,y2,          // define the two line segments to check
    187187              xp1,yp1,xp2,yp2;
    188188
     
    200200              // ok, now we know which line segemnts to check for intersection
    201201              // 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;         
    203203              setback_intersect(x1, y1, x2, y2, xp1, yp1, xp2, yp2,0);
    204204
  • abuse/trunk/src/cop.cpp

    r4 r16  
    204204  // fire try to move up to gun level
    205205
    206   long x2=o->x,y2=firey;
     206  int32_t x2=o->x,y2=firey;
    207207//  current_level->foreground_intersect(other->x,other->y,x2,y2);      // find first location we can actuall "see"
    208208//  current_level->all_boundary_setback(o,other->x,other->y,x2,y2);       // to make we don't fire through walls
     
    247247    if (!o->lvars[fire_delay1])                   // make sur we are not waiting of previous fire
    248248    {
    249       long value=lnumber_value(eval(CAR(args)));
     249      int32_t value=lnumber_value(eval(CAR(args)));
    250250      if (value)                                   // do we have ammo ?
    251251      {
     
    289289    if (!o->lvars[fire_delay1])                   // make sur we are not waiting of previous fire
    290290    {
    291       long value=lnumber_value(eval(CAR(args)));
     291      int32_t value=lnumber_value(eval(CAR(args)));
    292292      if (value)                                   // do we have ammo ?
    293293      {
     
    316316    if (!o->lvars[fire_delay1])                   // make sur we are not waiting of previous fire
    317317    {
    318       long value=lnumber_value(eval(CAR(args)));
     318      int32_t value=lnumber_value(eval(CAR(args)));
    319319      if (value)                                   // do we have ammo ?
    320320      {
     
    340340    if (!o->lvars[fire_delay1])                   // make sur we are not waiting of previous fire
    341341    {
    342       long value=lnumber_value(eval(CAR(args)));
     342      int32_t value=lnumber_value(eval(CAR(args)));
    343343      if (value)                                   // do we have ammo ?
    344344      {
     
    367367    if (!o->lvars[fire_delay1])                   // make sur we are not waiting of previous fire
    368368    {
    369       long value=lnumber_value(eval(CAR(args)));
     369      int32_t value=lnumber_value(eval(CAR(args)));
    370370      if (value)                                   // do we have ammo ?
    371371      {
     
    466466      o->lvars[last1_x]=o->x;
    467467      o->lvars[last1_y]=o->y;
    468       long oyvel=o->yvel();
     468      int32_t oyvel=o->yvel();
    469469      int in=o->lvars[in_climbing_area];
    470470
     
    532532/*      if (o->lvars[special_power]==FAST_POWER)
    533533        {
    534           long xv=0,yv=4;
     534          int32_t xv=0,yv=4;
    535535          o->try_move(o->x,o->y,xv,yv,1);
    536536          if (yv==4)
     
    557557      if (xm)                     // trying to get off the ladder, check to see if that's ok
    558558      {
    559         long x2=0,y2=-20;
     559        int32_t x2=0,y2=-20;
    560560        o->try_move(o->x,o->y,x2,y2,3);
    561561        if (y2==-20)
     
    898898  o->lvars[sgb_speed]=o->lvars[sgb_speed]*6/5;
    899899 
    900   long ang=o->lvars[sgb_angle];
    901   long mag=o->lvars[sgb_speed];
    902 
    903   long xvel=(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);
    904904  current_object->set_xvel(xvel>>16);
    905905  current_object->set_fxvel((xvel&0xffff)>>8);
    906   long yvel=-(lisp_sin(ang))*(mag);
     906  int32_t yvel=-(lisp_sin(ang))*(mag);
    907907  current_object->set_yvel(yvel>>16);
    908908  current_object->set_fyvel((yvel&0xffff)>>8);     
     
    10191019    {
    10201020      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);
    10221022      if (sorted_players[i]==local)
    10231023        strcat(msg," <<");
     
    10661066
    10671067
    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));
    10691069    fnt->put_string(screen,x,y,msg,color);
    10701070
  • abuse/trunk/src/demo.cpp

    r4 r16  
    107107      {
    108108        process_packet_commands(buf,size);     
    109         long mx,my;
     109        int32_t mx,my;
    110110        the_game->game_to_mouse(player_list->pointer_x,player_list->pointer_y,player_list,mx,my);
    111111        eh->set_mouse_position(small_render ? mx*2 : mx, small_render ? my*2 : my);
  • abuse/trunk/src/dev.cpp

    r4 r16  
    276276
    277277
    278 long dev_controll::snap_x(long x)
     278int32_t dev_controll::snap_x(int32_t x)
    279279{
    280280  if (eh->key_pressed(JK_CTRL_L) || eh->key_pressed(JK_CTRL_R))
     
    285285}
    286286
    287 long dev_controll::snap_y(long y)
     287int32_t dev_controll::snap_y(int32_t y)
    288288{
    289289  if (eh->key_pressed(JK_CTRL_L) || eh->key_pressed(JK_CTRL_R))
     
    341341{
    342342  unsigned char *sl1,*sl2;
    343   long xstep=(im->width()<<16)/new_width,
     343  int32_t xstep=(im->width()<<16)/new_width,
    344344       ystep=(im->height()<<16)/new_height,iy,ix,sx,ix_start,iy_start;
    345345  screen->add_dirty(x,y,x+new_width-1,y+new_height-1);
     
    380380{
    381381  unsigned char *sl1,*sl2;
    382   long xstep=(im->width()<<16)/new_width,
     382  int32_t xstep=(im->width()<<16)/new_width,
    383383       ystep=(im->height()<<16)/new_height,iy,ix,sx,ix_start,iy_start;
    384384  screen->add_dirty(x,y,x+new_width-1,y+new_height-1);
     
    438438void dev_controll::dev_draw(view *v)
    439439{
    440   long x1,y1,x2,y2;
     440  int32_t x1,y1,x2,y2;
    441441  if (dev&EDIT_MODE)
    442442  {
    443     long vx=v->xoff(),vy=v->yoff();
     443    int32_t vx=v->xoff(),vy=v->yoff();
    444444 
    445445    if (dev&DRAW_LINKS)
     
    459459    if (link_object)
    460460    {
    461       long rx1,ry1;
     461      int32_t rx1,ry1;
    462462      the_game->game_to_mouse(link_object->x,link_object->y,v,rx1,ry1);     
    463463      screen->line(rx1,ry1,dlastx,dlasty,yellow);           
     
    468468      image *i=cash.img(light_buttons[0]);
    469469      int l=i->width()/2,h=i->height()/2;
    470       long rx1,ry1;
     470      int32_t rx1,ry1;
    471471      the_game->game_to_mouse(selected_light->x,selected_light->y,v,rx1,ry1);     
    472472      screen->rectangle(rx1-l,ry1-h,rx1+l,ry1+h,eh->bright_color());
     
    510510    {   
    511511      selected_object->picture_space(x1,y1,x2,y2);   
    512       long rx1,ry1,rx2,ry2;
     512      int32_t rx1,ry1,rx2,ry2;
    513513      the_game->game_to_mouse(x1,y1,v,rx1,ry1);
    514514      the_game->game_to_mouse(x2,y2,v,rx2,ry2);
     
    530530}
    531531
    532 light_source *find_light(long x, long y)
     532light_source *find_light(int32_t x, int32_t y)
    533533{
    534534  image *i=cash.img(light_buttons[0]);
     
    10311031    {
    10321032      edit_object=selected_object=NULL;
    1033       long cx=player_list->focus->x,cy=player_list->focus->y;
     1033      int32_t cx=player_list->focus->x,cy=player_list->focus->y;
    10341034
    10351035      // 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));
    10381038     
    10391039      char tmp[100];
     
    10481048      player_list->focus->y=cy;
    10491049
    1050       memcpy(player_list->weapons,w,total_weapons*sizeof(long));     
     1050      memcpy(player_list->weapons,w,total_weapons*sizeof(int32_t));     
    10511051      jfree(w);
    10521052
     
    10571057  if (!strcmp(fword,"unchop"))
    10581058  {
    1059     long rx,ry;
     1059    int32_t rx,ry;
    10601060    the_game->btile_on(dlastx,dlasty,rx,ry);
    10611061    if (rx>=0 && ry>=0)
     
    11791179    if (t>=0)                                 // did we find it?
    11801180    {
    1181       long rx,ry;
     1181      int32_t rx,ry;
    11821182      the_game->mouse_to_game(dlastx,dlasty,rx,ry);
    11831183      edit_object=create(t,rx,ry);
     
    12161216  if (!strcmp(fword,"clear_auto"))
    12171217  {
    1218     long i,j;
     1218    int32_t i,j;
    12191219    for (i=0;i<current_level->foreground_width();i++)
    12201220      for (j=0;j<current_level->foreground_height();j++)
     
    12241224  if (!strcmp(fword,"fg_select"))
    12251225  {
    1226     long x,y;
     1226    int32_t x,y;
    12271227    the_game->ftile_on(dlastx,dlasty,x,y);
    12281228    if (x>=0 && y>=0 && x<current_level->foreground_width() &&
     
    12381238  if (!strcmp(fword,"toggle_fg_raise"))
    12391239  {
    1240     long x,y;
     1240    int32_t x,y;
    12411241    the_game->ftile_on(dlastx,dlasty,x,y);
    12421242    if (x>=0 && y>=0 && x<current_level->foreground_width() &&
     
    14871487  {   
    14881488    game_object *o=ai_object;
    1489     long x;
     1489    int32_t x;
    14901490    if (o)
    14911491    {
     
    15371537  if (ev.type==EV_MOUSE_BUTTON && ev.mouse_button)
    15381538  {
    1539     long gx,gy;
     1539    int32_t gx,gy;
    15401540    the_game->mouse_to_game(last_demo_mx,last_demo_my,gx,gy);
    15411541    if (!current_level) return ;
     
    15771577  if (ev.type==EV_MOUSE_BUTTON && ev.mouse_button)
    15781578  {
    1579     long mx=last_demo_mx,my=last_demo_my;
     1579    int32_t mx=last_demo_mx,my=last_demo_my;
    15801580    view *v=the_game->view_in(mx,my);
    15811581    for (area_controller *a=current_level->area_list;a;a=a->next)
    15821582    {
    1583       long x1,y1,x2,y2;
     1583      int32_t x1,y1,x2,y2;
    15841584      the_game->game_to_mouse(a->x,a->y,v,x1,y1);
    15851585      the_game->game_to_mouse(a->x+a->w,a->y+a->h,v,x2,y2);
     
    16461646void dev_controll::handle_event(event &ev)
    16471647{
    1648   long x,y;
     1648  int32_t x,y;
    16491649  if (link_object && (dlastx!=last_link_x || dlasty!=last_link_y))
    16501650  {
     
    17241724        if (ev.window==NULL && ev.type==EV_KEY && ev.key=='d')
    17251725        {
    1726           long xv=0,yv=100;
     1726          int32_t xv=0,yv=100;
    17271727          edit_object->try_move(edit_object->x,edit_object->y,xv,yv,1);
    17281728          edit_object->y+=yv;
     
    18221822      if (current_area)
    18231823      {
    1824         long gx,gy;
     1824        int32_t gx,gy;
    18251825        the_game->mouse_to_game(last_demo_mx,last_demo_my,gx,gy);
    18261826        if (gx>current_area->x && gy>current_area->y)
     
    18451845      if (current_area)
    18461846      {
    1847         long gx,gy;
     1847        int32_t gx,gy;
    18481848        the_game->mouse_to_game(last_demo_mx,last_demo_my,gx,gy);
    18491849        if (gx<current_area->x+current_area->w && gy<current_area->y+current_area->h)
     
    18721872        if (ev.window==NULL)
    18731873        {       
    1874           long rx,ry;
     1874          int32_t rx,ry;
    18751875          the_game->mouse_to_game(last_demo_mx,last_demo_my,rx,ry);
    18761876
     
    18921892            if (ev.mouse_button==1 && !selected_object && !selected_light)
    18931893            {
    1894               long xs,ys;
     1894              int32_t xs,ys;
    18951895              the_game->ftile_on(last_demo_mx,last_demo_my,xs,ys);
    18961896              if (xs>=0 && ys>=0 && xs<current_level->foreground_width() &&
     
    19001900            } else if (ev.mouse_button==1 && !selected_object && !selected_light)
    19011901            {
    1902               long xs,ys;
     1902              int32_t xs,ys;
    19031903              the_game->btile_on(last_demo_mx,last_demo_my,xs,ys);
    19041904              if (xs>=0 && ys>=0 && xs<current_level->background_width() &&
     
    25182518        case DEV_LIGHT9 :
    25192519        {
    2520           long lx,ly;
     2520          int32_t lx,ly;
    25212521          the_game->mouse_to_game(last_demo_mx,last_demo_my,lx,ly);
    25222522          lx=snap_x(lx);
     
    28552855          case 'w' :
    28562856          {       
    2857             long rx,ry;
     2857            int32_t rx,ry;
    28582858            the_game->mouse_to_game(dlastx,dlasty,rx,ry);
    28592859            char msg[100]; sprintf(msg,symbol_str("mouse_at"),rx,ry);
     
    28772877            if (current_level && player_list && player_list->focus)
    28782878            {
    2879               long rx,ry;
     2879              int32_t rx,ry;
    28802880              the_game->mouse_to_game(dlastx,dlasty,rx,ry);
    28812881              player_list->focus->x=rx;
     
    31503150          case ' ' :
    31513151          {
    3152             long xs,ys,xx,yy;
     3152            int32_t xs,ys,xx,yy;
    31533153            the_game->ftile_on(me->x,me->y,xs,ys);
    31543154
     
    31653165          case 't' :
    31663166          {
    3167             long xs,ys;
     3167            int32_t xs,ys;
    31683168            the_game->ftile_on(me->x,me->y,xs,ys);
    31693169            dev_cont->fg_fill(-1,xs,ys,this);
     
    32113211  }
    32123212
    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);
    32143214  int i;
    32153215  for (i=0;i<w*h;i++)
  • abuse/trunk/src/game.cpp

    r9 r16  
    5858double sum_diffs=1,total_diffs=12;
    5959int total_active=0;
    60 long map_xoff=0,map_yoff=0;
    61 long current_vxadd,current_vyadd;
     60int32_t map_xoff=0,map_yoff=0;
     61int32_t current_vxadd,current_vyadd;
    6262int frame_panic=0,massive_frame_panic=0;
    6363int demo_start=0,idle_ticks=0;
     
    136136}
    137137
    138 void game::play_sound(int id, int vol, long x, long y)
     138void game::play_sound(int id, int vol, int32_t x, int32_t y)
    139139{
    140140        if( sound_avail & SFX_INITIALIZED )
     
    145145                        return;
    146146
    147                 ulong mdist = 0xffffffff;
     147                uint32_t mdist = 0xffffffff;
    148148                view *cd = NULL;
    149149                for( view *f = player_list; f ; f = f->next )
     
    151151                        if( f->local_player() )
    152152                        {
    153                                 long cx = 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;
    154154                                if( cx < cy )
    155155                                        d = cx + cy - ( cx >> 1 );
     
    277277}
    278278
    279 void game::ftile_on(int screenx, int screeny, long &x, long &y)
     279void game::ftile_on(int screenx, int screeny, int32_t &x, int32_t &y)
    280280{
    281281  mouse_to_game(screenx,screeny,x,y);
     
    285285  if (f)
    286286  {
    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;
    289289  }
    290290  else
     
    295295}
    296296
    297 void game::btile_on(int screenx, int screeny, long &x, long &y)
     297void game::btile_on(int screenx, int screeny, int32_t &x, int32_t &y)
    298298{
    299299  view *f=view_in(screenx,screeny);
    300300  if (f)
    301301  {
    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;
    304304  }
    305305  else
     
    311311
    312312
    313 void game::mouse_to_game(long x, long y, long &gamex, long &gamey, view *f)
     313void game::mouse_to_game(int32_t x, int32_t y, int32_t &gamex, int32_t &gamey, view *f)
    314314{
    315315  if (!f)
     
    324324      if (dev&MAP_MODE)
    325325      {
    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());
    328328      } else
    329329      {
    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());
    332332      }
    333333
     
    336336}
    337337
    338 void game::game_to_mouse(long gamex, long gamey, view *which, long &x, long &y)
     338void game::game_to_mouse(int32_t gamex, int32_t gamey, view *which, int32_t &x, int32_t &y)
    339339{
    340340  if (dev&MAP_MODE)
    341341  {
    342     long x1,y1;
     342    int32_t x1,y1;
    343343    if (dev&EDIT_MODE)
    344344    {
     
    757757  }
    758758
    759   long old_cx1=0,old_cy1=0,old_cx2=0,old_cy2=0;   // if we do a small render, we need to restore these
     759  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
    760760  image *old_screen=NULL;
    761761  if (small_render && (dev&DRAW_LIGHTS))  // cannot do this if we skip lighting
     
    778778
    779779
    780 //  long max_xoff=(current_level->foreground_width()-1)*ftile_width()-(v->cx2-v->cx1+1);
    781 //  long max_yoff=(current_level->foreground_height()-1)*ftile_height()-(v->cy2-v->cy1+1);
    782 
    783   long xoff,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;
    784784  if (interpolate)
    785785  {
     
    803803  nyoff=yoff*bg_ymul/bg_ydiv;
    804804
    805 //  long max_bg_xoff=(current_level->background_width())*btile_width()-(v->cx2-v->cx1+1);
    806 //  long max_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);
    807807//  if (nxoff>max_bg_xoff) nxoff=max_xoff;
    808808//  if (nyoff>max_bg_yoff) nyoff=max_yoff; 
     
    986986//    server_check();
    987987
    988   long ro=rand_on;
     988  int32_t ro=rand_on;
    989989  if (dev & DRAW_PEOPLE_LAYER)
    990990  {
     
    16671667                {
    16681668                        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);
    16701670                        if (stime>0 && !no_delay)
    16711671                        {
     
    25752575        fprintf(stderr,"Mac Options: ");
    25762576        xres = 320; yres = 200;
    2577         GetKeys((unsigned long*)&km);
     2577        GetKeys((uint32_t*)&km);
    25782578        if ((km[ 0x3a >>3] >> (0x3a & 7)) &1 != 0)
    25792579        {
  • abuse/trunk/src/include/demo.hpp

    r2 r16  
    3434
    3535
    36 extern int last_demo_mx,last_demo_my,last_demo_mbut;
     36extern int32_t last_demo_mx,last_demo_my,last_demo_mbut;
    3737//extern ulong demo_tick_on;
    3838#endif
  • abuse/trunk/src/include/dev.hpp

    r2 r16  
    1919class pal_win
    2020{
    21   long scale,w,h,x,y,last_selected;
     21  int32_t scale,w,h,x,y,last_selected;
    2222  unsigned short *pat;
    2323  void draw();
     
    101101  void make_ambient();
    102102  int ok_to_scroll();
    103   long snap_x(long x);
    104   long snap_y(long y);
     103  int32_t snap_x(int32_t x);
     104  int32_t snap_y(int32_t y);
    105105  void area_handle_input(event &ev);
    106106  void pick_handle_input(event &ev);
  • abuse/trunk/src/include/extend.hpp

    r2 r16  
    2626  uchar Fade_count,Fade_max;
    2727  uchar Flags,grav_on,targetable_on;
    28   long Xvel,Yvel,Xacel,Yacel;
     28  int32_t Xvel,Yvel,Xacel,Yacel;
    2929  uchar Fx,Fy,Fxvel,Fyvel,Fxacel,Fyacel;
    3030  uchar Aitype;
     
    4343  char *var_name(int x);
    4444  int   var_type(int x);
    45   void set_var(int x, ulong v);
    46   long get_var(int x);
     45  void set_var(int x, uint32_t v);
     46  int32_t get_var(int x);
    4747
    4848  // leave these public, so I don't have monster code changes.
    4949  simple_object();
    50   long x,y,
     50  int32_t x,y,
    5151       last_x,last_y;              // used for frame interpolation on fast machines
    5252  schar direction,active;
     
    6161  int keep_ai_info()         { return 1; }
    6262  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; }
    6767
    6868  uchar fx()                 { return Fx; }
     
    102102  void set_targetable(uchar x)    { targetable_on=x; }
    103103  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; }
    108108  void set_fx(uchar x)            { Fx=x; }
    109109  void set_fy(uchar y)            { Fy=y; }
  • abuse/trunk/src/include/game.hpp

    r2 r16  
    4646extern char **start_argv;
    4747extern int start_argc;
    48 extern long current_vxadd,current_vyadd;
     48extern int32_t current_vxadd,current_vyadd;
    4949extern int frame_panic,massive_frame_panic;
    5050extern int demo_start,idle_ticks;
     
    5858      morph_bright_color,morph_med_color,morph_dark_color;
    5959
    60   long last_time,fps;
     60  int32_t last_time,fps;
    6161  char mapname[100],command[200],help_text[200];
    6262  int refresh,mousex,mousey,help_text_frames;
     
    9393                           return cash.foret(foretiles[x]); }
    9494
    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);
    9797  void toggle_delay();
    9898  void set_delay(int on) { no_delay=!on; }
    9999  void pan(int xv, int yv);
    100100
    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);
    103103  view *view_in(int mousex, int mousey);
    104104
     
    139139  int game_over();
    140140  void grow_views(int amount);
    141   void play_sound(int id, int vol, long x, long y);
     141  void play_sound(int id, int vol, int32_t x, int32_t y);
    142142  void request_level_load(char *name);
    143143  void request_end();
  • abuse/trunk/src/include/intsect.hpp

    r2 r16  
    22#define __INTSECT_HPP_
    33
    4 int setback_intersect(long x1, long y1, long &x2, long &y2,
    5                       long xp1, long yp1, long xp2, long yp2, long inside);
     4int 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);
    66
    77#endif
  • abuse/trunk/src/include/level.hpp

    r2 r16  
    2727{
    2828  public :
    29   long x,y,w,h,active;
    30   long ambient,view_xoff,view_yoff;
    31   long ambient_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;
    3232  area_controller *next;
    33   area_controller(long X, long Y, long W, long H, area_controller *Next);
     33  area_controller(int32_t X, int32_t Y, int32_t W, int32_t H, area_controller *Next);
    3434} ;
    3535
    36 extern long last_tile_hit_x,last_tile_hit_y;
     36extern int32_t last_tile_hit_x,last_tile_hit_y;
    3737extern int dev;
    3838class level        // contain map info and objects
     
    4343                 fg_width,fg_height; 
    4444  char *Name,*first_name;
    45   long total_objs;
     45  int32_t total_objs;
    4646  game_object *first,*first_active,*last;
    4747
     
    104104  void mark_seen(int x, int y) { CHECK(x>=0 && y>=0 && x<fg_width && y<fg_height);
    105105                                          (*(map_fg+x+y*fg_width))|=0x8000; }
    106   void clear_fg(long x, long y) { *(map_fg+x+y*fg_width)&=0x7fff; }
     106  void clear_fg(int32_t x, int32_t y) { *(map_fg+x+y*fg_width)&=0x7fff; }
    107107
    108108  unsigned short *get_fgline(int y) { CHECK(y>=0 && y<fg_height); return map_fg+y*fg_width; }
     
    141141  void unactivate_all();
    142142  // forms all the objects in processing range into a linked list
    143   int add_actives(long x1, long y1, long x2, long y2);  //returns total added
     143  int add_actives(int32_t x1, int32_t y1, int32_t x2, int32_t y2);  //returns total added
    144144  void pull_actives(game_object *o, game_object *&last_active, int &t);
    145   int add_drawables(long x1, long y1, long x2, long y2);  //returns total added
    146 
    147   game_object *find_object(long x, long y);
    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);
    152152  int crush(game_object *by_who, int xamount, int yamount);
    153153  int push_characters(game_object *by_who, int xamount, int yamount);  // return 0 if fail on any.
    154154  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, long m, 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,
    159159                   int max_push);
    160   void send_signal(long signal);
     160  void send_signal(int32_t signal);
    161161  void next_focus();
    162162  void to_front(game_object *o);
     
    182182                    object_node *save_list, object_node *exclude_list);
    183183  view *make_view_list(int nplayers);
    184   long total_light_links(object_node *list);
    185   long total_object_links(object_node *save_list);
    186   game_object *find_object_in_area(long x, long y, long x1, long y1,
    187                                    long x2, long y2, Cell *list, game_object *exclude);
    188   game_object *find_object_in_angle(long x, long y, long start_angle, long end_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,
    189189                                    void *list, game_object *exclude);
    190190  object_node *make_not_list(object_node *list);
  • abuse/trunk/src/include/light.hpp

    r2 r16  
    1818{
    1919  public :
    20   long type,x,xshift,y,yshift;
    21   long outer_radius,mul_div,inner_radius;
     20  int32_t type,x,xshift,y,yshift;
     21  int32_t outer_radius,mul_div,inner_radius;
    2222
    23   long x1,y1,x2,y2;
     23  int32_t x1,y1,x2,y2;
    2424  char known;
    2525  light_source *next;
    2626
    2727  void calc_range();
    28   light_source(char Type, long X, long Y, long Inner_radius, long Outer_radius,
    29                long Xshift, long Yshift,
     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,
    3030               light_source *Next);
    3131  light_source *copy();
     
    3535{
    3636  public :
    37   long total,x1,y1,x2,y2;
     37  int32_t total,x1,y1,x2,y2;
    3838  light_source **lights; 
    3939  light_patch *next;
    40   light_patch(long X1, long Y1, long X2, long Y2, light_patch *Next)
     40  light_patch(int32_t X1, int32_t Y1, int32_t X2, int32_t Y2, light_patch *Next)
    4141  {
    4242    x1=X1; y1=Y1; x2=X2; y2=Y2;
     
    4545    lights=NULL;
    4646  }
    47   void add_light(long X1, long Y1, long X2, long Y2, light_source *who);
     47  void add_light(int32_t X1, int32_t Y1, int32_t X2, int32_t Y2, light_source *who);
    4848  light_patch *copy(light_patch *Next);
    4949  ~light_patch() { if (total) jfree(lights); }
     
    5252void delete_all_lights();
    5353void delete_light(light_source *which);
    54 light_source *add_light_source(char type, long x, long y,
    55                                long inner, long outer, long xshift, long yshift);
     54light_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);
    5656
    5757void add_light_spec(spec_directory *sd, char *level_name);
     
    6262void delete_patch_list(light_patch *first);
    6363light_patch *find_patch(int screenx, int screeny, light_patch *list);
    64 int calc_light_value(long x, long y, light_patch *which);                             
    65 void light_screen(image *sc, long screenx, long screeny, uchar *light_lookup, ushort ambient);
    66 void double_light_screen(image *sc, long screenx, long screeny, uchar *light_lookup, ushort ambient,
    67                          image *out, long out_x, long out_y);
     64int calc_light_value(int32_t x, int32_t y, light_patch *which);                       
     65void light_screen(image *sc, int32_t screenx, int32_t screeny, uchar *light_lookup, ushort ambient);
     66void 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);
    6868
    6969void calc_light_table(palette *pal);
     
    7171extern int light_detail;
    7272
    73 extern long light_to_number(light_source *l);
    74 extern light_source *number_to_light(long x);
     73extern int32_t light_to_number(light_source *l);
     74extern light_source *number_to_light(int32_t x);
    7575
    7676#endif
  • abuse/trunk/src/include/lisp.hpp

    r11 r16  
    130130void *lget_array_element(void *a, long x);
    131131void *lpointer_value(void *lpointer);
    132 long lnumber_value(void *lnumber);
     132int32_t lnumber_value(void *lnumber);
    133133char *lstring_value(void *lstring);
    134134unsigned short lcharacter_value(void *c);
  • abuse/trunk/src/include/objects.hpp

    r2 r16  
    4848public :
    4949  game_object *next,*next_active;
    50   long *lvars;
     50  int32_t *lvars;
    5151
    5252  int size();
     
    7272  void drawer();
    7373  void draw_above(view *v);
    74   void do_damage(int amount, game_object *from, long hitx, long hity, long push_xvel, long push_yvel);
    75   void damage_fun(int amount, game_object *from, long hitx, long hity, long push_xvel, long push_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);
    7676
    7777
     
    9494  int has_sequence(character_state s) { return figures[otype]->has_sequence(s); }
    9595
    96   game_object *try_move(long x, long y, long &xv, long &yv, int checks);  // 1=down,2=up,3=both
     96  game_object *try_move(int32_t x, int32_t y, int32_t &xv, int32_t &yv, int checks);  // 1=down,2=up,3=both
    9797  game_object *bmove(int &whit, game_object *exclude);  // ballestic move, return hit object,
    9898                                                        // or NULL (whit is 1 if hit wall)
     
    100100                                                                                                   
    101101  int next_picture();
    102   long x_center(); 
    103   long height();
     102  int32_t x_center(); 
     103  int32_t height();
    104104
    105105  void stop_acel() { set_xacel(0);  set_yacel(0); set_fxacel(0); set_fyacel(0); }
     
    115115  figure *current_figure() { return current_sequence()->get_figure(current_frame); }
    116116  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);
    118118  int tx(int x) { if (direction>0) return x-x_center(); else return x_center()-x; }
    119119  int ty(int y) { return y-picture()->height()+1; }
     
    134134
    135135  void change_type(int new_type);
    136   int set_var_by_name(char *name, long value);
    137   long get_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);
    138138  game_object *copy();
    139139  void change_aitype(int new_type);
     
    151151extern game_object *current_object;
    152152extern view *current_view;
    153 game_object *create(int type, long x, long y, int skip_constructor=0, int aitype=0);
     153game_object *create(int type, int32_t x, int32_t y, int skip_constructor=0, int aitype=0);
    154154int base_size();
    155155
    156156void delete_object_list(object_node *first);
    157157int          object_to_number_in_list(game_object *who, object_node *list);
    158 game_object *number_to_object_in_list(long x, object_node *list);
     158game_object *number_to_object_in_list(int32_t x, object_node *list);
    159159
    160160
  • abuse/trunk/src/include/view.hpp

    r2 r16  
    1212struct suggest_struct
    1313{
    14   long cx1,cy1,cx2,cy2,shift_down,shift_right,pan_x,pan_y;
    15   long new_weapon;
     14  int32_t cx1,cy1,cx2,cy2,shift_down,shift_right,pan_x,pan_y;
     15  int32_t new_weapon;
    1616  uchar send_view,send_weapon_change;
    1717} ;
     
    3333  char name[100];
    3434  struct suggest_struct suggest;
    35   long cx1,cy1,cx2,cy2,                    // view area to show
     35  int32_t cx1,cy1,cx2,cy2,                    // view area to show
    3636      shift_down,shift_right;             // shift of view
    3737
     
    4141  int draw_solid;                         // -1 if don't draw solid
    4242
    43   long *weapons;                          // [0..total_weapons-1]
    44   long *last_weapons;                     // last history of above array (for updating statbar)
    45   long current_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;
    4646
    4747
     
    5959
    6060  short ambient;                        // ambient lighting setting, used by draw
    61   long pan_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,
    6262       last_x,last_y,last_last_x,last_last_y,view_percent;
    6363
    64   long last_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)
    6565       last_b1,last_b2,last_b3,last_b4,last_hp,last_ammo,last_type;
    66   long secrets,kills,tsecrets,tkills;
     66  int32_t secrets,kills,tsecrets,tkills;
    6767
    6868  view(game_object *Focus, view *Next, int number);
    6969  void draw_character_damage();           // draws the characters 'status' on the viewer
    7070
    71   long x_center();                        // center of attention
    72   long y_center();
    73   long xoff();                            // top left and right corner of the screen
    74   long interpolated_xoff();
    75   long yoff();
    76   long interpolated_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();
    7777  int drawable();                        // network viewables are not drawable
    7878  int local_player();                    //  just in case I ever need non-viewable local players.
     
    9494  void draw_ammo();
    9595  void draw_logo();
    96   void resize_view(long Cx1, long Cy1, long Cx2, long Cy2);
     96  void resize_view(int32_t Cx1, int32_t Cy1, int32_t Cx2, int32_t Cy2);
    9797  void set_input(int cx, int cy, int b1, int b2, int b3, int b4, int px, int py);
    9898  int view_changed() { return suggest.send_view; }
     
    104104  void reset_player();
    105105  int receive_failed() { return focus==NULL; }
    106   long get_view_var_value(int num);
    107   long set_view_var_value(int num, long x);
     106  int32_t get_view_var_value(int num);
     107  int32_t set_view_var_value(int num, int32_t x);
    108108  void configure_for_area(area_controller *a);
    109109  ~view();
  • abuse/trunk/src/intsect.cpp

    r2 r16  
    22#include <stdlib.h>
    33
    4 void pushback(long x1,long y1,long &x2,long &y2,
    5                      long xp1, long yp1, long xp2, long yp2, int xdir, int ydir, int inside)
     4void 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)
    66{
    77
     
    1515
    1616
    17 /* int setback_intersect(long x1,long y1,long &x2,long &y2,
    18                      long xp1, long yp1, long xp2, long yp2)
     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)
    1919{
    20   long mx1,my1,b1,mx2,my2,b2,side1,side2,tx2,ty2;
     20  int32_t mx1,my1,b1,mx2,my2,b2,side1,side2,tx2,ty2;
    2121  my1=(y2-y1);
    2222  if (!my1)                  // is the first line strait across?
     
    110110          if (abs(mx1)>abs(my1))
    111111          {
    112             long ae_bd=my1*mx2-mx1*my2;
     112            int32_t ae_bd=my1*mx2-mx1*my2;
    113113            CONDITION(ae_bd,"line intersect fuck up");
    114114            tx2=(mx1*mx2*(b2-b1))/ae_bd+xadd;
     
    117117          else
    118118          {
    119             long db_ea=(my2*mx1-mx2*my1);
     119            int32_t db_ea=(my2*mx1-mx2*my1);
    120120            CONDITION(db_ea,"line intersect fuck up");
    121121            ty2=(mx1*b1*my2-my1*mx2*b2)/db_ea+yadd;
     
    137137
    138138
    139 int setback_intersect(long x1,long y1,long &x2,long &y2,
    140                       long xp1, long yp1, long xp2, long yp2,
    141                      long inside)  // which side is inside the polygon? (0 always setback)
     139int 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)
    142142{
    143143  // the line equations will be put in the form
     
    145145  //     A        B        C 
    146146
    147   long a1,b1,c1,a2,b2,c2,r1,r2;             
     147  int32_t a1,b1,c1,a2,b2,c2,r1,r2;             
    148148
    149149  a1=y2-y1;       
     
    157157  }
    158158
    159   long xdiff,ydiff;
    160 /*  long xdiff=abs(xp1-xp2),ydiff=yp1-yp2; 
     159  int32_t xdiff,ydiff;
     160/*  int32_t xdiff=abs(xp1-xp2),ydiff=yp1-yp2; 
    161161  if (xdiff>=ydiff)                              // increment the endpoints
    162162    if (xp2<xp1) { xp2--; xp1++; }                               
     
    187187           inside==0 || r2==0)
    188188      {
    189         long ae=a1*b2,bd=b1*a2;
     189        int32_t ae=a1*b2,bd=b1*a2;     
    190190        if (ae!=bd)         // co-linear returns 0
    191191        {
  • abuse/trunk/src/level.cpp

    r2 r16  
    2424#endif
    2525
     26#include <limits.h>
    2627#include <time.h>
    2728
     
    3031game_object *level::attacker(game_object *who)
    3132{
    32   long d=0x7fffffff;
     33  int32_t d=0x7fffffff;
    3334  game_object *c=NULL;
    3435  view *f=the_game->first_view;
     
    3738    if (f->focus)
    3839    {
    39       long tmp_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);
    4041      if (tmp_d<d)
    4142      {
     
    198199}
    199200
    200 int level::add_actives(long x1, long y1, long x2, long y2)
     201int level::add_actives(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
    201202{
    202203  int t=0;
     
    210211    if (!o->active)
    211212    {
    212       long xr=figures[o->otype]->rangex,
     213      int32_t xr=figures[o->otype]->rangex,
    213214           yr=figures[o->otype]->rangey;
    214215
     
    242243
    243244
    244 int level::add_drawables(long x1, long y1, long x2, long y2)
     245int level::add_drawables(int32_t x1, int32_t y1, int32_t x2, int32_t y2)
    245246{
    246247  int t=0,ft=0;
     
    256257    if (ft || !o->active)
    257258    {
    258       long xr=figures[o->otype]->draw_rangex,
     259      int32_t xr=figures[o->otype]->draw_rangex,
    259260      yr=figures[o->otype]->draw_rangey;
    260261
     
    322323void level::wall_push()
    323324{
    324   long sx1,sy1,sx2,sy2,xv,yv;
     325  int32_t sx1,sy1,sx2,sy2,xv,yv;
    325326  game_object *o=first_active;
    326327  for (;o;o=o->next_active)
     
    362363    if (abs(subject->x-target->x)<b1+b2)
    363364    {
    364       long tmove=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;
    365366      if (subject->x>target->x)
    366367        xv=tmove/2;
     
    382383{
    383384  game_object *target,*reciever=NULL;
    384   long sx1,sy1,sx2,sy2,tx1,ty1,tx2,ty2,hitx,hity,
     385  int32_t sx1,sy1,sx2,sy2,tx1,ty1,tx2,ty2,hitx,hity,
    385386      s_centerx,t_centerx;
    386387
     
    416417              for (t_dat=t_damage->data,j=(int)t_damage->tot-1;j>0 && !hit;j--)
    417418              {
    418                 long x1,y1,x2,y2,          // define the two line segments to check
     419                int32_t x1,y1,x2,y2,          // define the two line segments to check
    419420                xp1,yp1,xp2,yp2;
    420421
     
    459460*/
    460461
    461 game_object *level::boundary_setback(game_object *subject, long x1, long y1, long &x2, long &y2)
     462game_object *level::boundary_setback(game_object *subject, int32_t x1, int32_t y1, int32_t &x2, int32_t &y2)
    462463{
    463464  game_object *l=NULL;
    464   long tx1,ty1,tx2,ty2,t_centerx;
     465  int32_t tx1,ty1,tx2,ty2,t_centerx;
    465466  game_object *target=first_active;
    466467  game_object **blist=block_list;
     
    485486        while(iter-->0)
    486487        {
    487           long xp1=target->x+target->tx(*t_dat);  t_dat++;           
    488           long yp1=target->y+target->ty(*t_dat);  t_dat++;
    489           long xp2=target->x+target->tx(*t_dat);
    490           long yp2=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]);
    491492
    492493          // now check to see if (x1,y1-x2,y2) intercest with (xp1,yp1-xp2,yp2)
     
    511512
    512513
    513 game_object *level::all_boundary_setback(game_object *subject, long x1, long y1, long &x2, long &y2)
     514game_object *level::all_boundary_setback(game_object *subject, int32_t x1, int32_t y1, int32_t &x2, int32_t &y2)
    514515{
    515516  game_object *l=NULL;
    516   long tx1,ty1,tx2,ty2,t_centerx;
     517  int32_t tx1,ty1,tx2,ty2,t_centerx;
    517518  game_object *target=first_active;
    518519  game_object **blist=all_block_list;
     
    537538        while(iter-->0)
    538539        {
    539           long xp1=target->x+target->tx(*t_dat);  t_dat++;           
    540           long yp1=target->y+target->ty(*t_dat);  t_dat++;
    541           long xp2=target->x+target->tx(*t_dat);
    542           long yp2=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]);
    543544
    544545          // now check to see if (x1,y1-x2,y2) intercest with (xp1,yp1-xp2,yp2)
     
    566567void level::interpolate_draw_objects(view *v)
    567568{
    568   long old_x,old_y;
     569  int32_t old_x,old_y;
    569570  current_view=v;
    570571 
     
    607608  {
    608609    if (!rcheck) rcheck=open_file("rcheck","rb");
    609     long x=rcheck->read_long();
     610    int32_t x=rcheck->read_long();
    610611    if (x!=rand_on)
    611612      dprintf("off!\n");
     
    645646      {     
    646647        area_controller *a,*smallest=NULL;
    647         long smallest_size=0xfffffff;
     648        int32_t smallest_size=0xffffffff;
    648649        for (a=area_list;a;a=a->next)
    649650          if (o->x>=a->x && o->y>=a->y && o->x<=a->x+a->w && o->y<=a->y+a->h)
    650651          {
    651             long size=a->w*a->h;
     652            int32_t size=a->w*a->h;
    652653            if (size<smallest_size)
    653654            {
     
    693694        if (o->otype!=current_start_type)
    694695        {
    695           long fmp=o->fmp();     
     696          int32_t fmp=o->fmp();     
    696697          int reduce=figures[o->otype]->morph_power;
    697698          if (reduce)
     
    767768void level::draw_areas(view *v)
    768769{
    769   long sx1,sy1,sx2,sy2;
     770  int32_t sx1,sy1,sx2,sy2;
    770771  area_controller *a=area_list;
    771772  for (;a;a=a->next)
     
    807808
    808809
    809 void calc_bgsize(unsigned short fgw, unsigned short  fgh, unsigned short  &bgw, unsigned short  &bgh)
     810void calc_bgsize(uint16_t fgw, uint16_t  fgh, uint16_t  &bgw, uint16_t  &bgh)
    810811{
    811812  bgw=fgw/ASPECT+8;
     
    822823  }
    823824
    824   unsigned short *new_fg,*new_bg;
    825   new_fg=(unsigned 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));
    827828
    828829  int x,y,miny=(h<fg_height)? h : fg_height,minx=(w<fg_width)? w : fg_width;
    829830 
    830   unsigned short nbw,nbh;
     831  uint16_t nbw,nbh;
    831832  calc_bgsize(w,h,nbw,nbh);
    832833 
    833   new_bg=(unsigned 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));
    835836
    836837  for (y=0;y<miny;y++)
     
    885886    fp->seek(se->offset,0);
    886887    /******************************* Read debug info ******************************/
    887     short old_tot=fp->read_short(); 
    888     unsigned 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");   
    889890    char old_name[150];     
    890891    for (i=0;i<old_tot;i++)
     
    10171018  {
    10181019    fp->seek(se->offset,0);
    1019     short old_tot=fp->read_short();
     1020    int16_t old_tot=fp->read_short();
    10201021    se=sd->find("describe_names");
    10211022    if (!se || !old_tot)
    10221023      return ;
    10231024
    1024     unsigned short *o_remap=(unsigned short *)jmalloc(old_tot*2,"obj remap array");   
    1025     unsigned 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");   
    10261027    memset(o_backmap,0xff,total_objects*2);
    10271028    char old_name[150];     
     
    10411042    se=sd->find("describe_states");
    10421043    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");
    10451046    fp->seek(se->offset,0);
    10461047    int i=0;
    10471048    for (;i<old_tot;i++)
    10481049    {
    1049       short t=fp->read_short();
     1050      int16_t t=fp->read_short();
    10501051      s_remap_totals[i]=t;
    10511052      if (t)
    10521053      {
    1053         s_remap[i]=(short *)jmalloc(t*sizeof(short),"state remap");
     1054        s_remap[i]=(int16_t *)jmalloc(t*sizeof(int16_t),"state remap");
    10541055        int j=0;
    10551056        for (;j<t;j++)
     
    10761077    }
    10771078
    1078     short **v_remap=NULL;
    1079     short *v_remap_totals=NULL;
     1079    int16_t **v_remap=NULL;
     1080    int16_t *v_remap_totals=NULL;
    10801081    int load_vars=1;
    10811082    se=sd->find("describe_lvars");
    10821083    if (se)
    10831084    {
    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");
    10861087
    10871088      fp->seek(se->offset,0);
     
    10891090      for (;i<old_tot;i++)
    10901091      {
    1091         short t=fp->read_short();
     1092        int16_t t=fp->read_short();
    10921093        v_remap_totals[i]=t;
    10931094        if (t)
    10941095        {
    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));
    10971098        } else { v_remap[i]=NULL; }
    10981099        int j=0;
     
    11721173            for (;o && !abort;o=o->next)
    11731174            {
    1174               short ot=fp->read_short();
     1175              int16_t ot=fp->read_short();
    11751176              int k=0;
    11761177              for (;k<ot;k++)
     
    11791180                else
    11801181                {
    1181                   long v=fp->read_long();
     1182                  int32_t v=fp->read_long();
    11821183                  if (o->otype!=0xffff)     // non-exstant object
    11831184                  {
     
    13091310    fg_width=fp->read_long();
    13101311    fg_height=fp->read_long();
    1311     map_fg=(unsigned short *)jmalloc(2*fg_width*fg_height,"Map fg : loaded");
     1312    map_fg=(uint16_t *)jmalloc(2*fg_width*fg_height,"Map fg : loaded");
    13121313    fp->read((char *)map_fg,2*fg_width*fg_height);
    13131314    int t=fg_width*fg_height;
    1314     unsigned short *map=map_fg;
     1315    uint16_t *map=map_fg;
    13151316    while (t) { *map=lstl(*map); map++; t--; }
    13161317  } else
     
    13271328    bg_width=fp->read_long();
    13281329    bg_height=fp->read_long();
    1329     map_bg=(unsigned short *)jmalloc(2*bg_width*bg_height,"Map bg : loaded");
     1330    map_bg=(uint16_t *)jmalloc(2*bg_width*bg_height,"Map bg : loaded");
    13301331    fp->read((char *)map_bg,2*bg_width*bg_height);
    13311332    int t=bg_width*bg_height;
    1332     unsigned short *map=map_bg;
     1333    uint16_t *map=map_bg;
    13331334    while (t) { *map=lstl(*map); map++; t--; }
    13341335  } else
     
    13421343    fg_width=bg_width;
    13431344    fg_height=bg_height;
    1344     map_fg=(unsigned short *)jmalloc(2*fg_width*fg_height,"Map fg : loaded");
     1345    map_fg=(uint16_t *)jmalloc(2*fg_width*fg_height,"Map fg : loaded");
    13451346    memset(map_fg,0,2*fg_width*fg_height);
    13461347  }
     
    13501351    bg_width=fg_width/8+8;
    13511352    bg_height=fg_height/8+8;
    1352     map_bg=(unsigned short *)jmalloc(2*bg_width*bg_height,"Map bg : loaded");
     1353    map_bg=(uint16_t *)jmalloc(2*bg_width*bg_height,"Map bg : loaded");
    13531354    memset(map_bg,0,2*bg_width*bg_height);
    13541355  }
     
    13561357
    13571358  /***************** Check map for non exsistant tiles **************************/
    1358   long i,w;
    1359   unsigned short *m; 
     1359  int32_t i,w;
     1360  uint16_t *m; 
    13601361  spec_entry *load_all=sd->find("player_info");
    13611362  for (i=0,w=fg_width*fg_height,m=map_fg;i<w;i++,m++)
     
    15691570 
    15701571
    1571   // how many objects are we goint to save, use a long to specify how many
     1572  // how many objects are we goint to save, use a int32_t to specify how many
    15721573  sd.add_by_hand(new spec_entry(SPEC_DATA_ARRAY,"object_list",NULL,4,0));
    15731574 
    1574   long t=0;
     1575  int32_t t=0;
    15751576  object_node *o=save_list;
    15761577  for (;o;o=o->next)
     
    16541655void level::write_player_info(bFILE *fp, object_node *save_list)
    16551656{
    1656   long t=0;
     1657  int32_t t=0;
    16571658  view *v=player_list;
    16581659  for (;v;v=v->next) t++;
     
    17251726    }
    17261727
    1727     long total_players=fp->read_long();
     1728    int32_t total_players=fp->read_long();
    17281729    view *last=NULL;
    17291730    int i=0;
     
    17751776      if (fp->read_byte()==RC_L)
    17761777      {
    1777         long m=fp->read_long();  // read how many weapons exsisted when last saved
     1778        int32_t m=fp->read_long();  // read how many weapons exsisted when last saved
    17781779        int i;
    17791780        for (v=player_list;v;v=v->next)   
     
    17811782          for (i=0;i<m;i++)
    17821783          {
    1783             long x=fp->read_long();
     1784            int32_t x=fp->read_long();
    17841785            if (i<total_weapons)
    17851786            {
     
    17941795      for (v=player_list;v;v=v->next)     
    17951796      {
    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));
    17981799      }
    17991800    }
     
    19021903  }
    19031904 
    1904   long t=0;
     1905  int32_t t=0;
    19051906  object_node *o=save_list;
    19061907  for (;o;o=o->next) t++;
     
    19191920    for (i=0;i<figures[o->me->otype]->tv;i++)
    19201921    {
    1921       fp->write_byte(RC_L);                           // for now the only type allowed is long
     1922      fp->write_byte(RC_L);                           // for now the only type allowed is int32_t
    19221923      fp->write_long(o->me->lvars[i]);
    19231924    }
     
    19441945
    19451946
    1946 long level::total_object_links(object_node *list)
    1947 {
    1948   long tl=0;
     1947int32_t level::total_object_links(object_node *list)
     1948{
     1949  int32_t tl=0;
    19491950  for (object_node *o=list;o;o=o->next)
    19501951    tl+=o->me->total_objects();
     
    19521953}
    19531954
    1954 long level::total_light_links(object_node *list)
    1955 {
    1956   long tl=0;
     1955int32_t level::total_light_links(object_node *list)
     1956{
     1957  int32_t tl=0;
    19571958  for (object_node *o=list;o;o=o->next)
    19581959    tl+=o->me->total_lights();
     
    19741975    {
    19751976      fp->write_long(x);
    1976       long x=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);
    19771978      if (x)
    19781979        fp->write_long(x);
    19791980      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))));
    19811982    }
    19821983  }
     
    20082009    if (fp->read_byte()==RC_L)
    20092010    {
    2010       long t=fp->read_long();
     2011      int32_t t=fp->read_long();
    20112012      while (t)
    20122013      {
    2013         long x1=fp->read_long();
     2014        int32_t x1=fp->read_long();
    20142015        CONDITION(x1>=0,"expected x1 for object link to be > 0\n");
    2015         long x2=fp->read_long();
     2016        int32_t x2=fp->read_long();
    20162017        game_object *p,*q=number_to_object_in_list(x1,save_list);
    20172018        if (x2>0)
     
    20332034    if (fp->read_byte()==RC_L)
    20342035    {
    2035       long t=fp->read_long();
     2036      int32_t t=fp->read_long();
    20362037      while (t)
    20372038      {
    2038         long x1=fp->read_long();
    2039         long x2=fp->read_long();
     2039        int32_t x1=fp->read_long();
     2040        int32_t x2=fp->read_long();
    20402041        game_object *p=number_to_object_in_list(x1,save_list);
    20412042        if (p)
     
    21072108    {
    21082109      area_controller *l=NULL,*p;
    2109       long ta=fp->read_long();
     2110      int32_t ta=fp->read_long();
    21102111      int i=0;
    21112112      for (;i<ta;i++)
    21122113      {
    2113         long x,y,w,h;
     2114        int32_t x,y,w,h;
    21142115        x=fp->read_long();
    21152116        y=fp->read_long();
     
    22032204                        else
    22042205                        {
    2205                                 long size = fp->file_size();
     2206                                int32_t size = fp->file_size();
    22062207                                uchar *buf = (uchar *)jmalloc(0x1000,"copy buf");
    22072208                                int tr = 1;
     
    23672368  calc_bgsize(fg_width,fg_height,bg_width,bg_height);
    23682369 
    2369   map_bg=(unsigned short *)jmalloc(sizeof(short)*bg_width*bg_height,"map bg");
    2370   map_fg=(unsigned 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);
    23762377
    23772378  int i; 
     
    25762577}
    25772578
    2578 game_object *level::find_object(long x, long y)
    2579 {
    2580   long x1,y1,x2,y2; 
     2579game_object *level::find_object(int32_t x, int32_t y)
     2580{
     2581  int32_t x1,y1,x2,y2; 
    25812582  game_object *o=first;
    25822583  for (;o;o=o->next)
     
    25892590}
    25902591
    2591 long last_tile_hit_x,last_tile_hit_y;
     2592int32_t last_tile_hit_x,last_tile_hit_y;
    25922593
    25932594#define remapx(x) (x==0 ? -1 : x==tl-1 ? tl+1 : x)
    25942595#define remapy(y) (y==0 ? -1 : y==th-1 ? th+1 : y)
    25952596
    2596 void level::foreground_intersect(long x1, long y1, long &x2, long &y2)
     2597void level::foreground_intersect(int32_t x1, int32_t y1, int32_t &x2, int32_t &y2)
    25972598{
    25982599/*  if (x1==x2)
     
    26012602  }  */
    26022603
    2603   long tl=the_game->ftile_width(),th=the_game->ftile_height(),
     2604  int32_t tl=the_game->ftile_width(),th=the_game->ftile_height(),
    26042605    j,
    26052606    xp1,yp1,xp2,yp2,    // starting and ending points of block line segment
    26062607    swap;               // temp var
    2607   long blockx1,blocky1,blockx2,blocky2,block,bx,by;
     2608  int32_t blockx1,blocky1,blockx2,blocky2,block,bx,by;
    26082609  point_list *block_list;
    26092610  unsigned char *bdat;
     
    26422643        bdat=block_list->data;
    26432644        unsigned char *ins=f->points->inside;
    2644         long xo=bx*tl,yo=by*th;
     2645        int32_t xo=bx*tl,yo=by*th;
    26452646        for (j=0;j<total-1;j++,ins++)
    26462647        {
     
    26562657
    26572658
    2658           long ox2=x2,oy2=y2;
     2659          int32_t ox2=x2,oy2=y2;
    26592660          if (*ins)       
    26602661            setback_intersect(x1,y1,x2,y2,xp1,yp1,xp2,yp2,1);
     
    26742675
    26752676
    2676 void level::vforeground_intersect(long x1, long y1, long &y2)
    2677 {
    2678   long tl=f_wid,th=f_hi,
     2677void level::vforeground_intersect(int32_t x1, int32_t y1, int32_t &y2)
     2678{
     2679  int32_t tl=f_wid,th=f_hi,
    26792680    j,
    26802681    xp1,yp1,xp2,yp2;    // starting and ending points of block line segment temp var
    2681   long blocky1,blocky2,block,bx,by,checkx;
     2682  int32_t blocky1,blocky2,block,bx,by,checkx;
    26822683  point_list *block_list;
    26832684  unsigned char *bdat;
     
    27172718    unsigned char *ins=f->points->inside;
    27182719
    2719 //    long xo=bx*tl,yo=by*th;
     2720//    int32_t xo=bx*tl,yo=by*th;
    27202721    for (j=0;j<total-1;j++,ins++)
    27212722    {
     
    27312732
    27322733
    2733       long oy2=y2;
     2734      int32_t oy2=y2;
    27342735      if (*ins)   
    27352736        setback_intersect(checkx,y1,checkx,y2,xp1,yp1,xp2,yp2,1);
     
    27482749
    27492750
    2750 void level::send_signal(long signal)
     2751void level::send_signal(int32_t signal)
    27512752{
    27522753  if (signal)   // signal 0 is never sent!
     
    27612762int level::crush(game_object *by_who, int xamount, int yamount)
    27622763{
    2763   long xv,yv,crushed=0; 
     2764  int32_t xv,yv,crushed=0; 
    27642765  game_object *o=first_active;
    27652766  for (;o;o=o->next_active)
     
    27982799{
    27992800  int failed=0;
    2800   long xv,yv;
     2801  int32_t xv,yv;
    28012802  game_object *o=first_active;
    28022803  for (;o;o=o->next_active) 
     
    28052806    {     
    28062807      // check to see if the platform is going up and will run into us.     
    2807       long tvx,tvy;
     2808      int32_t tvx,tvy;
    28082809      if (yamount<0)
    28092810      {
     
    28482849int level::push_characters(game_object *by_who, int xamount, int yamount)
    28492850{
    2850   long xv,yv;
     2851  int32_t xv,yv;
    28512852  int failed=0;
    28522853  game_object *o=first_active;
     
    28572858      xv=-xamount;   
    28582859      yv=-yamount;
    2859       long tvx,tvy;
     2860      int32_t tvx,tvy;
    28602861      if (xv>0) tvx=xv+1; else if (xv<0) tvx=xv-1; else tvx=0;
    28612862      if (yv>0) tvy=yv+1; else if (yv<0) tvx=yv-1; else tvy=0;
     
    28772878game_object *level::find_xrange(int x, int y, int type, int xd)
    28782879{
    2879   long find_ydist=100000;
     2880  int32_t find_ydist=100000;
    28802881  game_object *find=NULL;
    28812882  game_object *o=first_active;
     
    29002901game_object *level::find_xclosest(int x, int y, int type, game_object *who)
    29012902{
    2902   long find_ydist=100000,find_xdist=0xffffff;
     2903  int32_t find_ydist=100000,find_xdist=0xffffff;
    29032904  game_object *find=NULL;
    29042905  game_object *o=first_active;
     
    29302931game_object *level::find_closest(int x, int y, int type, game_object *who)
    29312932{
    2932   long find_dist=100000;
     2933  int32_t find_dist=100000;
    29332934  game_object *find=NULL;
    29342935  game_object *o=first_active;
     
    29852986}
    29862987
    2987 void level::hurt_radius(long x, long y,long r, long m, game_object *from, game_object *exclude,
     2988void level::hurt_radius(int32_t x, int32_t y,int32_t r, int32_t m, game_object *from, game_object *exclude,
    29882989                        int max_push)
    29892990{
     
    29942995    if (o!=exclude && o->hurtable())
    29952996    {
    2996       long y1=o->y,y2=o->y-o->picture()->height();
    2997       long cx=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);
    29982999      if (cx<cy1)
    29993000        d1=cx+cy1-(cx>>1);
     
    30563057      if (v!=exclude)
    30573058      {
    3058         long cx=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;
    30593060        if (cx<cy)
    30603061          d=cx+cy-(cx>>1);
     
    31523153
    31533154
    3154 game_object *level::find_object_in_area(long x, long y, long x1, long y1, long x2, long y2,
     3155game_object *level::find_object_in_area(int32_t x, int32_t y, int32_t x1, int32_t y1, int32_t x2, int32_t y2,
    31553156                                     Cell *list, game_object *exclude)
    31563157{
    31573158  game_object *closest=NULL;
    3158   long closest_distance=0xfffffff,distance,xo,yo;
     3159  int32_t closest_distance=0xfffffff,distance,xo,yo;
    31593160  game_object *o=first_active;
    31603161  for (;o;o=o->next_active)
    31613162  {
    3162     long xp1,yp1,xp2,yp2;
     3163    int32_t xp1,yp1,xp2,yp2;
    31633164    o->picture_space(xp1,yp1,xp2,yp2);
    31643165
     
    31883189
    31893190
    3190 game_object *level::find_object_in_angle(long x, long y, long start_angle, long end_angle,
     3191game_object *level::find_object_in_angle(int32_t x, int32_t y, int32_t start_angle, int32_t end_angle,
    31913192                                    void *list, game_object *exclude)
    31923193{
    31933194  game_object *closest=NULL;
    3194   long closest_distance=0xfffffff,distance,xo,yo;
     3195  int32_t closest_distance=0xfffffff,distance,xo,yo;
    31953196  game_object *o=first_active;
    31963197  for (;o;o=o->next_active)
    31973198  {
    3198     long angle=lisp_atan2(o->y-y,o->x-x);
     3199    int32_t angle=lisp_atan2(o->y-y,o->x-x);
    31993200    if (((start_angle<=end_angle && (angle>=start_angle && angle<=end_angle))
    32003201        || (start_angle>end_angle && (angle>=start_angle || angle<=end_angle)))
     
    32503251    for (;o;o=o->next)
    32513252    {
    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);
    32543255    }
    32553256    fclose(fp);
     
    32583259
    32593260
    3260 area_controller::area_controller(long X, long Y, long W, long H, area_controller *Next)
     3261area_controller::area_controller(int32_t X, int32_t Y, int32_t W, int32_t H, area_controller *Next)
    32613262{
    32623263  x=X; y=Y; w=W; h=H;
  • abuse/trunk/src/light.cpp

    r8 r16  
    2020int light_detail=MEDIUM_DETAIL;
    2121
    22 long light_to_number(light_source *l)
     22int32_t light_to_number(light_source *l)
    2323{
    2424 
     
    3131
    3232
    33 light_source *number_to_light(long x)
     33light_source *number_to_light(int32_t x)
    3434{
    3535  if (x==0) return NULL;
     
    135135}
    136136
    137 light_source::light_source(char Type, long X, long Y, long Inner_radius,
    138                            long Outer_radius, long Xshift,  long Yshift, light_source *Next)
     137light_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)
    139139{
    140140  type=Type;
     
    158158}
    159159
    160 light_source *add_light_source(char type, long x, long y,
    161                                long inner, long outer, long xshift, long yshift)
     160light_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)
    162162{
    163163  first_light_source=new light_source(type,x,y,inner,outer,xshift,yshift,first_light_source);
     
    392392}
    393393
    394 void add_light(light_patch *&first, long x1, long y1, long x2, long y2,
     394void add_light(light_patch *&first, int32_t x1, int32_t y1, int32_t x2, int32_t y2,
    395395                            light_source *who)
    396396
     
    523523
    524524/* shit
    525 int calc_light_value(light_patch *which, long x, long y)
     525int calc_light_value(light_patch *which, int32_t x, int32_t y)
    526526{
    527527  int lv=0;
     
    537537    else
    538538    {
    539       long dx=abs(fn->x-x)<<fn->xshift;
    540       long dy=abs(fn->y-y)<<fn->yshift;
    541       long  r2;
     539      int32_t dx=abs(fn->x-x)<<fn->xshift;
     540      int32_t dy=abs(fn->y-y)<<fn->yshift;
     541      int32_t  r2;
    542542      if (dx<dy)
    543543        r2=dx+dy-(dx>>1);
     
    564564}
    565565
    566 light_patch *make_patch_list(int width, int height, long screenx, long screeny)
     566light_patch *make_patch_list(int width, int height, int32_t screenx, int32_t screeny)
    567567{
    568568  light_patch *first=new light_patch(0,0,width-1,height-1,NULL);
     
    570570  for (light_source *f=first_light_source;f;f=f->next)   // determine which lights will have effect
    571571  {
    572     long x1=f->x1-screenx,y1=f->y1-screeny,
     572    int32_t x1=f->x1-screenx,y1=f->y1-screeny,
    573573        x2=f->x2-screenx,y2=f->y2-screeny;
    574574    if (x1<0) x1=0;
     
    599599#ifdef __WATCOMC__
    600600extern "C" {
    601 extern long MAP_PUT(long pad, long screen_addr, long remap, long w);
     601extern int32_t MAP_PUT(int32_t pad, int32_t screen_addr, int32_t remap, int32_t w);
    602602} ;
    603603#else*/
    604604
    605 inline void MAP_PUT(long screen_addr, long remap, long w)
     605inline void MAP_PUT(uint8_t * screen_addr, uint8_t * remap, int w)
    606606{
    607607  register int cx=w;
    608   register int di=screen_addr;
    609   register int si=remap;
     608  register uint8_t * di=screen_addr;
     609  register uint8_t * si=remap;
    610610  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
     617inline void MAP_2PUT(uint8_t * in_addr, uint8_t * out_addr, uint8_t * remap, int w)
    615618{
    616619  while (w--)
    617620  {
    618     uchar x=*(((uchar *)remap)+(*(uchar *)(in_addr++)));
    619     *((uchar *)(out_addr++))=x;
    620     *((uchar *)(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;
    621624  }
    622625}
     
    625628#endif
    626629
    627 inline void PUT8(long *addr, uchar *remap)
    628 {
    629   register ulong in_pixels;
    630   register ulong pixel;
    631   register ulong out_pixels;
     630inline 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;
    632635  in_pixels=*addr;
    633636  pixel=in_pixels;
     
    682685}
    683686
    684 inline long MAP_PUT2(long dest_addr, long screen_addr, long remap, long w)
     687inline int32_t MAP_PUT2(int32_t dest_addr, int32_t screen_addr, int32_t remap, int32_t w)
    685688{ while (w--)
    686689  {
     
    697700// calculate the light value for this block.  sum up all contritors
    698701inline int calc_light_value(light_patch *lp,   // light patch to look at
    699                             long sx,           // screen x & y
    700                             long sy)
     702                            int32_t sx,           // screen x & y
     703                            int32_t sy)
    701704{
    702705  int lv=min_light_level,r2,light_count;
     
    708711  {
    709712    light_source *fn=*lon_p;
    710     register long *dt=&(*lon_p)->type;
     713    register int32_t *dt=&(*lon_p)->type;
    711714                                     // note we are accessing structure members by bypassing the compiler
    712715                                     // for speed, this may not work on all compilers, but don't
    713                                      // see why it shouldn't..  all members are long
     716                                     // see why it shouldn't..  all members are int32_t
    714717   
    715718    if (*dt==9)                      // (dt==type),  if light is a Solid rectangle, return it value
     
    755758  while (count--)
    756759  {
    757     uchar *off=light_lookup+(((long)*remap_line)<<8);
     760    uchar *off=light_lookup+(((int32_t)*remap_line)<<8);
    758761    remap_line++;
    759762
     
    780783  for (x=0;x<count;x++)                       
    781784  {                                           
    782     uchar *off=light_lookup+(((long)*remap)<<8);
     785    uchar *off=light_lookup+(((int32_t)*remap)<<8);
    783786
    784787    v=off[*(in_line++)];
     
    819822
    820823
    821 void light_screen(image *sc, long screenx, long screeny, uchar *light_lookup, ushort ambient)
     824void light_screen(image *sc, int32_t screenx, int32_t screeny, uchar *light_lookup, ushort ambient)
    822825{
    823826  int lx_run=0,ly_run;                     // light block x & y run size in pixels ==  (1<<lx_run)
     
    859862  int suffix=(cx2-cx1-prefix+1)&7;
    860863
    861   long remap_size=((cx2-cx1+1-prefix-suffix)>>lx_run);
     864  int32_t remap_size=((cx2-cx1+1-prefix-suffix)>>lx_run);
    862865
    863866  uchar *remap_line=(uchar *)jmalloc(remap_size,"light remap line");
     
    885888      for (;(lp->y1>y-cy1 || lp->y2<y-cy1 ||
    886889                              lp->x1>suffix_x || lp->x2<suffix_x);lp=lp->next);
    887       long caddr=(long)screen_line+cx2-cx1+1-suffix;
    888       uchar *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));
    889892      switch (todoy)
    890893      {
    891894        case 4 :
    892895        {
    893           MAP_PUT(caddr,(long)r,suffix); caddr+=scr_w;
     896          MAP_PUT(caddr,r,suffix); caddr+=scr_w;
    894897        }
    895898        case 3 :
    896         { MAP_PUT(caddr,(long)r,suffix); caddr+=scr_w;}
     899        { MAP_PUT(caddr,r,suffix); caddr+=scr_w;}
    897900        case 2 :
    898         { MAP_PUT(caddr,(long)r,suffix); caddr+=scr_w;}
     901        { MAP_PUT(caddr,r,suffix); caddr+=scr_w;}
    899902        case 1 :
    900903        {
    901           MAP_PUT(caddr,(long)r,suffix);
     904          MAP_PUT(caddr,r,suffix);
    902905        }
    903906      }
     
    910913                              lp->x1>prefix_x || lp->x2<prefix_x);lp=lp->next);
    911914
    912       uchar *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;
    914917      switch (todoy)
    915918      {
    916919        case 4 :
    917920        {
    918           MAP_PUT(caddr,(long)r,prefix);
     921          MAP_PUT(caddr,r,prefix);
    919922          caddr+=scr_w;
    920923        }
    921924        case 3 :
    922         { MAP_PUT(caddr,(long)r,prefix); caddr+=scr_w; }
     925        { MAP_PUT(caddr,r,prefix); caddr+=scr_w; }
    923926        case 2 :
    924         { MAP_PUT(caddr,(long)r,prefix); caddr+=scr_w; }
     927        { MAP_PUT(caddr,r,prefix); caddr+=scr_w; }
    925928        case 1 :
    926         { MAP_PUT(caddr,(long)r,prefix); }
     929        { MAP_PUT(caddr,r,prefix); }
    927930      }
    928931      screen_line+=prefix;
     
    969972
    970973
    971 void double_light_screen(image *sc, long screenx, long screeny, uchar *light_lookup, ushort ambient,
    972                          image *out, long out_x, long out_y)
     974void 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)
    973976{
    974977  if (sc->width()*2+out_x>out->width() ||
     
    10351038  int suffix=(cx2-cx1-prefix+1)&7;
    10361039
    1037   long remap_size=((cx2-cx1+1-prefix-suffix)>>lx_run);
     1040  int32_t remap_size=((cx2-cx1+1-prefix-suffix)>>lx_run);
    10381041
    10391042  uchar *remap_line=(uchar *)jmalloc(remap_size,"light remap line");
     
    10631066      for (;(lp->y1>y-cy1 || lp->y2<y-cy1 ||
    10641067                              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       uchar *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));
    10691072      switch (todoy)
    10701073      {
    10711074        case 4 :
    10721075        {
    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;
    10751078        }
    10761079        case 3 :
    10771080        {
    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;
    10801083        }
    10811084        case 2 :
    10821085        {
    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;
    10851088        }
    10861089        case 1 :
    10871090        {
    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;
    10901093        } break;
    10911094      }
     
    10981101                              lp->x1>prefix_x || lp->x2<prefix_x);lp=lp->next);
    10991102
    1100       uchar *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;
    11031106      switch (todoy)
    11041107      {
    11051108        case 4 :
    11061109        {
    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;
    11091112        }
    11101113        case 3 :
    11111114        {
    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;
    11141117        }
    11151118        case 2 :
    11161119        {
    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;
    11191122        }
    11201123        case 1 :
    11211124        {
    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;
    11241127        } break;
    11251128      }
     
    11841187void add_light_spec(spec_directory *sd, char *level_name)
    11851188{
    1186   long size=4+4;  // number of lights and minimum light levels
     1189  int32_t size=4+4;  // number of lights and minimum light levels
    11871190  for (light_source *f=first_light_source;f;f=f->next)
    11881191    size+=6*4+1;
     
    12171220  {
    12181221    fp->seek(se->offset,SEEK_SET);
    1219     long t=fp->read_long();
     1222    int32_t t=fp->read_long();
    12201223    min_light_level=fp->read_long();
    12211224    light_source *last=NULL;
     
    12231226    {
    12241227      t--;
    1225       long x=fp->read_long();
    1226       long y=fp->read_long();
    1227       long xshift=fp->read_long();
    1228       long yshift=fp->read_long();
    1229       long ir=fp->read_long();
    1230       long ora=fp->read_long();
    1231       long ty=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();
    12321235
    12331236      light_source *p=new light_source(ty,x,y,ir,ora,xshift,yshift,NULL);
  • abuse/trunk/src/lisp.cpp

    r11 r16  
    499499}
    500500
    501 long lnumber_value(void *lnumber)
     501int32_t lnumber_value(void *lnumber)
    502502{
    503503  switch (item_type(lnumber))
     
    28082808    case 85 :  // num2str
    28092809    {
    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))));
    28122812      ret=new_lisp_string(str);
    28132813    } break;
  • abuse/trunk/src/morpher.cpp

    r2 r16  
    88  if (fleft)
    99  {
    10     long rx,ry;
     10    int32_t rx,ry;
    1111    the_game->game_to_mouse(who->x-(cx>>16),who->y-(cy>>16),v,rx,ry);
    1212    mor->show(screen,rx,ry,color_table,pal,1000);
  • abuse/trunk/src/objects.cpp

    r4 r16  
    8282                              };
    8383 
    84 long game_object::get_var_by_name(char *name, int &error)
     84int32_t game_object::get_var_by_name(char *name, int &error)
    8585{
    8686  error=0;
     
    112112}
    113113
    114 int game_object::set_var_by_name(char *name, long value)
     114int game_object::set_var_by_name(char *name, int32_t value)
    115115{
    116116  int i=0;
     
    144144
    145145
    146 void simple_object::set_var(int xx, ulong v)
     146void simple_object::set_var(int xx, uint32_t v)
    147147{
    148148  switch (xx)
     
    184184}
    185185
    186 long simple_object::get_var(int xx)
     186int32_t simple_object::get_var(int xx)
    187187{
    188188  switch (xx)
     
    370370void game_object::draw_above(view *v)
    371371{
    372   long x1,y1,x2,y2,sy1,sy2,sx,i;
     372  int32_t x1,y1,x2,y2,sy1,sy2,sx,i;
    373373  picture_space(x1,y1,x2,y2);   
    374374
     
    376376  if (sy2>=v->cy1)
    377377  {
    378     long draw_to=y1-(sy2-v->cy1),tmp=x;
     378    int32_t draw_to=y1-(sy2-v->cy1),tmp=x;
    379379    current_level->foreground_intersect(x,y1,tmp,draw_to);     
    380380    the_game->game_to_mouse(x1,draw_to,v,i,sy1);     // calculate sy1
     
    456456
    457457   
    458 void game_object::do_damage(int amount, game_object *from, long hitx, long hity,
    459                             long push_xvel, long push_yvel)
     458void game_object::do_damage(int amount, game_object *from, int32_t hitx, int32_t hity,
     459                            int32_t push_xvel, int32_t push_yvel)
    460460{
    461461
     
    527527}
    528528
    529 void game_object::damage_fun(int amount, game_object *from, long hitx, long hity,
    530                             long push_xvel, long push_yvel)
     529void game_object::damage_fun(int amount, game_object *from, int32_t hitx, int32_t hity,
     530                            int32_t push_xvel, int32_t push_yvel)
    531531{
    532532  if (!hurtable() || !alive()) return ;
     
    569569
    570570
    571 void game_object::picture_space(long &x1, long &y1,long &x2, long &y2)
     571void game_object::picture_space(int32_t &x1, int32_t &y1,int32_t &x2, int32_t &y2)
    572572{
    573573  int xc=x_center(),w=picture()->width(),h=picture()->height(); 
     
    605605
    606606
    607 long game_object::x_center()
     607int32_t game_object::x_center()
    608608{
    609609  return current_sequence()->x_center(current_frame);   
     
    748748}
    749749
    750 game_object *game_object::try_move(long x, long y, long &xv, long &yv, int checks)
     750game_object *game_object::try_move(int32_t x, int32_t y, int32_t &xv, int32_t &yv, int checks)
    751751{
    752752  if (xv || yv)  // make sure they are suggesting movement
    753753  {   
    754754    game_object *who1=NULL,*who2=NULL;      // who did we intersect? 
    755     long x2,y2,h; 
     755    int32_t x2,y2,h; 
    756756
    757757    if (checks&1)
     
    791791void *game_object::float_tick()  // returns 1 if you hit something, 0 otherwise
    792792{
    793   long ret=0;
     793  int32_t ret=0;
    794794  if (hp()<=0)
    795795  {
     
    816816  }
    817817
    818   long fxv=sfxvel()+sfxacel(),fyv=sfyvel()+sfyacel();
    819   long xv=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);
    820820
    821821  if (xv!=xvel() || yv!=yvel())   // only store vel's if changed so we don't increase object size
     
    834834  if (fxv || fyv || xv || yv)   // don't even try if there is no velocity
    835835  {
    836     long ffx=fx()+sfxvel(),ffy=fy()+sfyvel();
    837     long nxv=xvel()+(ffx>>8);
    838     long nyv=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);
    839839    set_fx(ffx&0xff);
    840840    set_fy(ffy&0xff);
    841841   
    842     long old_nxv=nxv,old_nyv=nyv;
     842    int32_t old_nxv=nxv,old_nyv=nyv;
    843843    game_object *hit_object=try_move(x,y,nxv,nyv,3);   // now find out what velocity is safe to use
    844844   
     
    853853    if (old_nxv!=nxv || old_nyv!=nyv)
    854854    {
    855       long lx=last_tile_hit_x,ly=last_tile_hit_y;
     855      int32_t lx=last_tile_hit_x,ly=last_tile_hit_y;
    856856      stop();
    857857      if (old_nxv==0)
     
    865865      } else
    866866      {
    867         long tx=(old_nxv>0 ? 1 : -1),ty=0;
     867        int32_t tx=(old_nxv>0 ? 1 : -1),ty=0;
    868868        try_move(x,y,tx,ty,3);
    869869        if (!tx)       
     
    906906  int blocked=0;
    907907
    908   long xt=0,yt=2;
     908  int32_t xt=0,yt=2;
    909909  try_move(x,y-2,xt,yt,1);    // make sure we are not falling through the floor
    910910  y=y-2+yt;
     
    926926 
    927927  // first let's move the guy acording to his physics
    928   long xa=xacel(),ya=yacel(),fxa=sfxacel(),fya=sfyacel();
     928  int32_t xa=xacel(),ya=yacel(),fxa=sfxacel(),fya=sfyacel();
    929929  if (xa || ya || fxa || fya)
    930930  {
    931931    int fxv=sfxvel(),fyv=sfyvel();
    932932    fxv+=fxa;  fyv+=fya;   
    933     long xv=xvel()+xa+(fxv>>8);
     933    int32_t xv=xvel()+xa+(fxv>>8);
    934934    set_xvel(xvel()+xa+(fxv>>8));
    935935    set_yvel(yvel()+ya+(fyv>>8));
     
    939939 
    940940  // check to see if this advancement causes him to collide with objects
    941   long old_vy=yvel(),old_vx=xvel();  // save the correct veloicties
     941  int32_t old_vy=yvel(),old_vx=xvel();  // save the correct veloicties
    942942
    943943  if (old_vx || old_vy)
     
    946946    if (yvel()<=0)  // if we are going up or a strait across check up and down
    947947    up=2;
    948     long xv=xvel(),yv=yvel();
     948    int32_t xv=xvel(),yv=yvel();
    949949    game_object *h=try_move(x,y,xv,yv,1|up);       // now find out what velocity is safe to use
    950950    set_xvel(xv);
     
    959959      if (gravity())                         // was he going up or down?
    960960      {                       
    961         long fall_xv=0,old_fall_vy,fall_vy;
     961        int32_t fall_xv=0,old_fall_vy,fall_vy;
    962962        old_fall_vy=fall_vy=old_vy-yvel();             // make sure he gets all of his yvel
    963963        try_move(x,y,fall_xv,fall_vy,1|up);
     
    10011001          if (old_vy!=0)
    10021002          {
    1003             long testx=old_vx<0 ? -1 : 1,testy=0;    // see if we were stopped left/right
     1003            int32_t testx=old_vx<0 ? -1 : 1,testy=0;    // see if we were stopped left/right
    10041004                                                     // or just up down
    10051005            try_move(x,y,testx,testy,1|up);
     
    10321032      else                  // see if we can make him 'climb' the hill
    10331033      {
    1034         long ox=x,oy=y;       // rember orginal position in case climb doesn't work
    1035 
    1036         long climb_xvel=0,climb_yvel=-5;            // try to move up one pixel to step over the
     1034        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
    10371037        try_move(x,y,climb_xvel,climb_yvel,3);  // jutting polygon line
    10381038        y+=climb_yvel;
     
    10821082  if (yacel()==0 && !gravity())       // he is not falling, make sure he can't
    10831083  {
    1084     long nvx=0,nvy=yvel()+12;  // check three pixels below for ground
     1084    int32_t nvx=0,nvy=yvel()+12;  // check three pixels below for ground
    10851085    try_move(x,y,nvx,nvy,1);
    10861086    if (nvy>11)                    // if he falls more than 2 pixels, then he falls
     
    11171117  if (ad && current_level)
    11181118  {
    1119     long xv;
     1119    int32_t xv;
    11201120    if (direction>0) xv=ad; else xv=-ad;
    1121     long yv=0;
     1121    int32_t yv=0;
    11221122    try_move(x,y,xv,yv,3);
    11231123    x+=xv;
     
    11391139
    11401140
    1141 game_object *create(int type, long x, long y, int skip_constructor, int aitype)
     1141game_object *create(int type, int32_t x, int32_t y, int skip_constructor, int aitype)
    11421142{
    11431143  game_object *g=new game_object(type,skip_constructor);
     
    12991299  else if (!gravity() && state!=start_run_jump)
    13001300  {   
    1301     long stop_acel;
     1301    int32_t stop_acel;
    13021302    if (xvel()<0)                                    // he was going left
    13031303    {
     
    14481448
    14491449  // first let's move the guy acording to his physics
    1450   long xa=xacel(),ya=yacel(),fxa=sfxacel(),fya=sfyacel();
     1450  int32_t xa=xacel(),ya=yacel(),fxa=sfxacel(),fya=sfyacel();
    14511451  if (xa || ya || fxa || fya)
    14521452  {
    14531453    int fxv=sfxvel(),fyv=sfyvel();
    14541454    fxv+=fxa;  fyv+=fya;   
    1455     long xv=xvel()+xa+(fxv>>8);
     1455    int32_t xv=xvel()+xa+(fxv>>8);
    14561456    set_xvel(xvel()+xa+(fxv>>8));
    14571457    set_yvel(yvel()+ya+(fyv>>8));
     
    14601460  }
    14611461 
    1462   long ox2,oy2;
    1463 
    1464   long nx=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();
    14651465  nx+=nfx>>8;
    14661466  ny+=nfy>>8;
     
    15061506}
    15071507
    1508 game_object *number_to_object_in_list(long x, object_node *list)
     1508game_object *number_to_object_in_list(int32_t x, object_node *list)
    15091509{
    15101510  if (!x) return NULL; x--;
     
    15261526
    15271527
    1528 long object_list_length(object_node *list)
    1529 {
    1530   long x=0;
     1528int32_t object_list_length(object_node *list)
     1529{
     1530  int32_t x=0;
    15311531  while (list) { list=list->next; x++; }
    15321532  return x;
     
    15431543    if (t)
    15441544    {
    1545       lvars=(long *)jmalloc(t*4,"object vars");
     1545      lvars=(int32_t *)jmalloc(t*4,"object vars");
    15461546      memset(lvars,0,t*4);
    15471547    }
     
    15561556int game_object::reduced_state()
    15571557{
    1558   long x=0;
     1558  int32_t x=0;
    15591559  for (int i=0;i<figures[otype]->ts;i++)
    15601560  {
     
    16071607    if (t)
    16081608    {
    1609       lvars=(long *)jmalloc(t*4,"object vars");
     1609      lvars=(int32_t *)jmalloc(t*4,"object vars");
    16101610      memset(lvars,0,t*4);
    16111611    }
  • abuse/trunk/src/view.cpp

    r2 r16  
    9696
    9797
    98 long view::xoff()
     98int32_t view::xoff()
    9999{
    100100  if (focus)
     
    106106}
    107107
    108 long view::interpolated_xoff()
     108int32_t view::interpolated_xoff()
    109109{
    110110  if (focus)
     
    117117
    118118
    119 long view::yoff()
     119int32_t view::yoff()
    120120{
    121121  if (focus)
     
    128128
    129129
    130 long view::interpolated_yoff()
     130int32_t view::interpolated_yoff()
    131131{
    132132  if (focus)
     
    249249  if (total_weapons)
    250250  {
    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 -1
    254     memset(last_weapons,0xff,total_weapons*sizeof(long));   // set all to -1 
     251    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 
    255255  }
    256256
     
    262262}
    263263
    264 long view::x_center()
     264int32_t view::x_center()
    265265{
    266266  if (!focus)
     
    270270}   
    271271
    272 long view::y_center()
     272int32_t view::y_center()
    273273{
    274274  if (!focus)
     
    321321{
    322322        int sug_x,sug_y,sug_b1,sug_b2,sug_b3,sug_b4;
    323         long sug_px,sug_py;
     323        int32_t sug_px,sug_py;
    324324
    325325// NOTE:(AK) I have commented this out so we don't use the lisp
     
    352352                else sug_b4 = 0;
    353353
    354                 long bx = lnumber_value( CAR( ret ) );
     354                int32_t bx = lnumber_value( CAR( ret ) );
    355355                ret = CDR( ret );
    356                 long by = lnumber_value( CAR( ret ) );
     356                int32_t by = lnumber_value( CAR( ret ) );
    357357                ret = CDR( ret );
    358358                the_game->mouse_to_game( bx, by, sug_px, sug_py, this );
     
    480480    case SCMD_VIEW_RESIZE :
    481481    {
    482       long x[8];
     482      int32_t x[8];
    483483      memcpy(x,pk,8*4);  pk+=8*4;
    484484      cx1=lltl(x[0]);
     
    503503    case SCMD_WEAPON_CHANGE :
    504504    {
    505       long x;
     505      int32_t x;
    506506      memcpy(&x,pk,4);  pk+=4;
    507507      current_weapon=lltl(x);
     
    818818
    819819
    820 void view::resize_view(long Cx1, long Cy1, long Cx2, long Cy2)
     820void view::resize_view(int32_t Cx1, int32_t Cy1, int32_t Cx2, int32_t Cy2)
    821821{
    822822  if (cx1!=Cx1 || cx2!=Cx2 || cy1!=Cy1 || cy2!=Cy2)
     
    858858    }
    859859    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));   
    862862
    863863    shift_down=SHIFT_DOWN_DEFAULT;
     
    980980{ return vv_names[num]; }
    981981
    982 long view::get_view_var_value(int num)
     982int32_t view::get_view_var_value(int num)
    983983{
    984984  switch (num)
     
    10351035
    10361036
    1037 long view::set_view_var_value(int num, long x)
     1037int32_t view::set_view_var_value(int num, int32_t x)
    10381038{
    10391039  switch (num)
     
    11471147void process_packet_commands(uchar *pk, int size)
    11481148{
    1149   long sync_short=-1;
     1149  int32_t sync_short=-1;
    11501150
    11511151  if (!size) return ;
Note: See TracChangeset for help on using the changeset viewer.