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

Legend:

Unmodified
Added
Removed
  • 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();
Note: See TracChangeset for help on using the changeset viewer.