Ignore:
Timestamp:
Jul 31, 2013, 6:13:53 PM (9 years ago)
Author:
Sam Hocevar
Message:

core: refactor Palette so that it uses Array<u8vec3> instead of uint8_t *.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • abuse/branches/lol/src/imlib/pcxread.cpp

    r682 r694  
    120120}
    121121
    122 image *read_PCX(char const *filename, palette *&pal)
     122image *read_PCX(char const *filename, Palette *&pal)
    123123{
    124124  if (PCX_file_type(filename)!=PCX_8) return NULL;
     
    134134  if (!fread(&palette_confirm,1,1,fp) || palette_confirm!=12)
    135135  {
    136     pal=new palette;
     136    pal = new Palette;
    137137    pal->defaults();
    138138  }
    139139  else
    140140  {
    141     pal=new palette;
    142     fread(pal->addr(),1,256*3,fp);
     141    pal = new Palette;
     142    fread(pal->Data(), 1, 256 * 3, fp);
    143143  }
    144144  fclose(fp);
     
    146146}
    147147
    148 void write_PCX(image *im, palette *pal, char const *filename)
     148void write_PCX(image *im, Palette *pal, char const *filename)
    149149{
    150150  FILE *fp=fopen(filename,"wb");
     
    200200  }
    201201  fputc(12,fp);  // note that there is a palette attached
    202   fwrite(pal->addr(),1,256*3,fp);
     202  fwrite(pal->Data(), 1, 256 * 3, fp);
    203203  fclose(fp);
    204204}
Note: See TracChangeset for help on using the changeset viewer.