Ignore:
Timestamp:
Nov 10, 2005, 9:41:13 PM (14 years ago)
Author:
Sam Hocevar
Message:
  • absolute shitloads of 64 bit fixes.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/trunk/src/imlib/timage.cpp

    r2 r17  
    33void trans_image::make_color(int c)
    44{
    5   unsigned char *dp=data;
     5  uint8_t *dp=data;
    66  int y,x;
    77  for (y=0;y<h;y++)
     
    2525{
    2626  image *im=new image(w,h);
    27   unsigned char *d=im->scan_line(0),*dp=data,*dline;
     27  uint8_t *d=im->scan_line(0),*dp=data,*dline;
    2828  int y,x;
    2929  for (y=0;y<h;y++)
     
    5454{
    5555  int size=0,x,y;
    56   unsigned char *sl,*datap,*marker;
     56  uint8_t *sl,*datap,*marker;
    5757  w=im->width();
    5858  h=im->height();
     
    8484  char st[80];
    8585  sprintf(st,"trans_image::data (%s)",name);
    86   data=(unsigned char *)jmalloc(size,st);
     86  data=(uint8_t *)jmalloc(size,st);
    8787#else
    88   data=(unsigned char *)jmalloc(size,"");
     88  data=(uint8_t *)jmalloc(size,"");
    8989#endif
    9090  int ww=im->width(),hh=im->height();
     
    125125void trans_image::put_scan_line(image *screen, int x, int y, int line)   // always transparent   
    126126{
    127   short x1,y1,x2,y2;
     127  int16_t x1,y1,x2,y2;
    128128  screen->get_clip(x1,y1,x2,y2);
    129129  if (y+line<y1 || y+line>y2 || x>x2 || x+w-1<x1)            // clipped off completely?
    130130    return;
    131131
    132   unsigned char *datap=data;
     132  uint8_t *datap=data;
    133133  int ix; 
    134134  while (line)            // skip scan line data until we get to the line of interest
     
    151151 
    152152  // now slam this list of runs to the screen
    153   unsigned char *screen_line=screen->scan_line(y)+x;
     153  uint8_t *screen_line=screen->scan_line(y)+x;
    154154   
    155155  for (ix=0;ix<w;)             
     
    202202
    203203
    204 inline unsigned char *trans_image::clip_y(image *screen, int x1, int y1, int x2, int y2,
     204inline uint8_t *trans_image::clip_y(image *screen, int x1, int y1, int x2, int y2,
    205205                                   int x, int &y, int &ysteps)
    206206{
     
    209209    return NULL;
    210210
    211   register unsigned char *datap=data; 
     211  register uint8_t *datap=data; 
    212212
    213213
     
    245245
    246246void trans_image::put_image_filled(image *screen, int x, int y,
    247                                    uchar fill_color)
    248 {
    249  short x1,y1,x2,y2;
     247                                   uint8_t fill_color)
     248{
     249 int16_t x1,y1,x2,y2;
    250250  int chop_length,ysteps;
    251251
    252252  screen->get_clip(x1,y1,x2,y2);
    253   register unsigned char *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),*screen_line;
     253  register uint8_t *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),*screen_line;
    254254  if (!datap) return ;     // if clip_y says nothing to draw, return
    255255 
     
    316316}
    317317
    318 void trans_image::put_image_offseted(image *screen, uchar *s_off)   // if screen x & y offset already calculated save a mul
     318void trans_image::put_image_offseted(image *screen, uint8_t *s_off)   // if screen x & y offset already calculated save a mul
    319319{
    320320  int ix,ysteps=height();
    321321  int screen_skip=screen->width()-w;
    322   uchar skip,*datap=data;
     322  uint8_t skip,*datap=data;
    323323  for (;ysteps;ysteps--)
    324324  {
     
    353353void trans_image::put_image(image *screen, int x, int y)
    354354{
    355   short x1,y1,x2,y2;
     355  int16_t x1,y1,x2,y2;
    356356  int chop_length,ysteps;
    357357
    358358  screen->get_clip(x1,y1,x2,y2);
    359   register unsigned char *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),*screen_line;
     359  register uint8_t *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),*screen_line;
    360360  if (!datap) return ;     // if clip_y says nothing to draw, return
    361361 
     
    414414}
    415415
    416 void trans_image::put_remaped(image *screen, int x, int y, unsigned char *remap)
    417 {
    418   short x1,y1,x2,y2;
     416void trans_image::put_remaped(image *screen, int x, int y, uint8_t *remap)
     417{
     418  int16_t x1,y1,x2,y2;
    419419  int chop_length,ysteps;
    420420
    421421  screen->get_clip(x1,y1,x2,y2);
    422   register unsigned char *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),*screen_line;
     422  register uint8_t *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),*screen_line;
    423423  if (!datap) return ;     // if clip_y says nothing to draw, return
    424424 
     
    470470              counter=slam_length;
    471471
    472             register unsigned char *sl=screen_line+ix,*sl2=datap;
     472            register uint8_t *sl=screen_line+ix,*sl2=datap;
    473473            ix+=slam_length;       
    474474            datap+=slam_length;
     
    490490
    491491
    492 void trans_image::put_double_remaped(image *screen, int x, int y, unsigned char *remap, unsigned char *remap2)
    493 {
    494   short x1,y1,x2,y2;
     492void trans_image::put_double_remaped(image *screen, int x, int y, uint8_t *remap, uint8_t *remap2)
     493{
     494  int16_t x1,y1,x2,y2;
    495495  int chop_length,ysteps;
    496496
    497497  screen->get_clip(x1,y1,x2,y2);
    498   register unsigned char *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),*screen_line;
     498  register uint8_t *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),*screen_line;
    499499  if (!datap) return ;     // if clip_y says nothing to draw, return
    500500 
     
    546546              counter=slam_length;
    547547
    548             register unsigned char *sl=screen_line+ix,*sl2=datap;
     548            register uint8_t *sl=screen_line+ix,*sl2=datap;
    549549            ix+=slam_length;       
    550550            datap+=slam_length;
     
    570570                           color_filter *f, palette *pal)
    571571{
    572   short x1,y1,x2,y2;
     572  int16_t x1,y1,x2,y2;
    573573  int ix,slam_length,chop_length,ysteps;
    574574
    575575  screen->get_clip(x1,y1,x2,y2);
    576   unsigned char *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),
     576  uint8_t *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),
    577577                *screen_line;
    578578  if (!datap) return ;
    579579
    580   unsigned char *screen_run,*paddr=(unsigned char *)pal->addr(),
     580  uint8_t *screen_run,*paddr=(uint8_t *)pal->addr(),
    581581                *caddr1,*caddr2,r_dest,g_dest,b_dest;
    582582
     
    659659void trans_image::put_fade_tint(image *screen, int x, int y,
    660660                                int frame_on, int total_frames,
    661                                 uchar *tint,
     661                                uint8_t *tint,
    662662                                color_filter *f, palette *pal)
    663663{
    664   short x1,y1,x2,y2;
     664  int16_t x1,y1,x2,y2;
    665665  int ix,slam_length,chop_length,ysteps;
    666666
    667667  screen->get_clip(x1,y1,x2,y2);
    668   unsigned char *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),
     668  uint8_t *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),
    669669                *screen_line;
    670670  if (!datap) return ;
    671671
    672   unsigned char *screen_run,*paddr=(unsigned char *)pal->addr(),
     672  uint8_t *screen_run,*paddr=(uint8_t *)pal->addr(),
    673673                *caddr1,*caddr2,r_dest,g_dest,b_dest;
    674674
     
    753753void trans_image::put_color(image *screen, int x, int y, int color)
    754754{
    755   short x1,y1,x2,y2;
     755  int16_t x1,y1,x2,y2;
    756756  int ix,slam_length,chop_length,ysteps;
    757757 
    758758  screen->get_clip(x1,y1,x2,y2);
    759   unsigned char *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),
     759  uint8_t *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),
    760760                *screen_line;
    761761  if (!datap) return ;
     
    819819
    820820{
    821   short x1,y1,x2,y2;
     821  int16_t x1,y1,x2,y2;
    822822  int ix,slam_length,chop_length,ysteps;
    823   unsigned char *paddr=(unsigned char *)pal->addr(); 
     823  uint8_t *paddr=(uint8_t *)pal->addr(); 
    824824 
    825825  screen->get_clip(x1,y1,x2,y2);
    826   unsigned char *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),
     826  uint8_t *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),
    827827                *blend_line,*screen_line;
    828828  if (!datap) return ;
     
    876876            else chop_length=slam_length;
    877877
    878             unsigned char *screen_run=screen_line+x+ix,
     878            uint8_t *screen_run=screen_line+x+ix,
    879879                          *blend_run=blend_line+x+ix-blendx,
    880880                          *caddr1,*caddr2,r_dest,g_dest,b_dest;     
     
    918918void trans_image::put_predator(image *screen, int x, int y)
    919919{
    920   short x1,y1,x2,y2;
     920  int16_t x1,y1,x2,y2;
    921921  int chop_length,ysteps;
    922922
    923923  screen->get_clip(x1,y1,x2,y2);
    924   register unsigned char *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),*screen_line;
     924  register uint8_t *datap=clip_y(screen,x1,y1,x2,y2,x,y,ysteps),*screen_line;
    925925  if (!datap) return ;     // if clip_y says nothing to draw, return
    926926
     
    10021002int trans_image::size()
    10031003{
    1004   uchar *d=data;
     1004  uint8_t *d=data;
    10051005  int t=0;
    10061006  for (int y=0;y<h;y++)
Note: See TracChangeset for help on using the changeset viewer.