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

Legend:

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

    r2 r17  
    3535  for (y=y1;y<=y2;y++)
    3636  {
    37     unsigned char *sl=screen->scan_line(y)+x1;
     37    uint8_t *sl=screen->scan_line(y)+x1;
    3838    for (x=x1;x<=x2;x++,sl++)
    3939    {
    40       unsigned char *paddr=(unsigned char *)pal->addr()+(*sl)*3;
    41       unsigned char r=((*(paddr++))-r_to)*percent/256+r_to;
    42       unsigned char g=((*(paddr++))-g_to)*percent/256+g_to;
    43       unsigned char b=((*(paddr++))-b_to)*percent/256+b_to;
     40      uint8_t *paddr=(uint8_t *)pal->addr()+(*sl)*3;
     41      uint8_t r=((*(paddr++))-r_to)*percent/256+r_to;
     42      uint8_t g=((*(paddr++))-g_to)*percent/256+g_to;
     43      uint8_t b=((*(paddr++))-b_to)*percent/256+b_to;
    4444      *sl=color_table->lookup_color((r)>>3,(g)>>3,(b)>>3);
    4545    }
     
    6161  for (y=y1;y<=y2;y++)
    6262  {
    63     unsigned char *sl=screen->scan_line(y)+x1;
     63    uint8_t *sl=screen->scan_line(y)+x1;
    6464    for (x=x1;x<=x2;x++,sl++)
    6565    {
    66       unsigned char *paddr=(unsigned char *)pal->addr()+(*sl)*3;
    67       unsigned char r=(*(paddr++))*amount/256;
    68       unsigned char g=(*(paddr++))*amount/256;
    69       unsigned char b=(*(paddr++))*amount/256;
     66      uint8_t *paddr=(uint8_t *)pal->addr()+(*sl)*3;
     67      uint8_t r=(*(paddr++))*amount/256;
     68      uint8_t g=(*(paddr++))*amount/256;
     69      uint8_t b=(*(paddr++))*amount/256;
    7070      *sl=color_table->lookup_color((r)>>3,(g)>>3,(b)>>3);
    7171    }
     
    251251{
    252252  int x,size;
    253   ushort *remap;
     253  uint16_t *remap;
    254254} ;
    255255
     
    261261  int x1=10000,x2=0;
    262262  int iw=im->width(); 
    263   ushort r,co,off,cc;
     263  uint16_t r,co,off,cc;
    264264  int y=0;
    265265  for (;y<mask_height;y++)
    266266  {
    267267    mask_line *n=p+y;
    268     uchar *sl=screen->scan_line(y+sy)+sx+n->x;
    269     uchar *sl2=im->scan_line(y);
    270 //    uchar *sl3=clouds->scan_line(y);
    271     ushort *rem=n->remap;
     268    uint8_t *sl=screen->scan_line(y+sy)+sx+n->x;
     269    uint8_t *sl2=im->scan_line(y);
     270//    uint8_t *sl3=clouds->scan_line(y);
     271    uint16_t *rem=n->remap;
    272272    if (sx+n->x<x1) x1=sx+n->x;   
    273273    int x=0;
     
    301301  {
    302302    // find the start of the run..
    303     uchar *sl=mask->scan_line(y);   
     303    uint8_t *sl=mask->scan_line(y);   
    304304    int x=0;
    305305    while (*sl==0) { sl++; x++; }
     
    313313
    314314    // now calculate remap for line
    315     p[y].remap=(ushort *)jmalloc(size*2,"mask remap");
    316     ushort *rem=p[y].remap;
     315    p[y].remap=(uint16_t *)jmalloc(size*2,"mask remap");
     316    uint16_t *rem=p[y].remap;
    317317    for (x=0;x<size;x++,rem++)
    318318    {
     
    508508  ico_button *buts[MENU_TICONS];
    509509
    510   long maxx=0,maxy=0;
     510  int32_t maxx=0,maxy=0;
    511511  int i=0;
    512512  for (;i<MENU_TICONS;i++)
     
    519519    menu_icons[i*3+2]=cash.reg("art/icons.spe",name,SPEC_IMAGE,1);
    520520
    521     long x=WINDOW_FRAME_LEFT+(i%9)*cash.img(menu_icons[0])->width();
    522     long y=WINDOW_FRAME_TOP+(i/9)*cash.img(menu_icons[0])->height();
     521    int32_t x=WINDOW_FRAME_LEFT+(i%9)*cash.img(menu_icons[0])->width();
     522    int32_t y=WINDOW_FRAME_TOP+(i/9)*cash.img(menu_icons[0])->height();
    523523    if (x>maxx) maxx=x;
    524524    if (y>maxy) maxy=y;
     
    587587  event ev;
    588588//  main_pm->draw(screen,eh,1);
    589   long x=84,y=60;
     589  int32_t x=84,y=60;
    590590  Cell *v=find_symbol("earth_x");
    591591  if (v && DEFINEDP(v)) x=lnumber_value(symbol_value(v));
Note: See TracChangeset for help on using the changeset viewer.