Ignore:
Timestamp:
Mar 18, 2008, 12:05:08 AM (12 years ago)
Author:
Sam Hocevar
Message:
  • Cleaned up cache.cpp.
  • Renamed stupid "cash" variable into "cache".
  • Rename cache_list and crc_manager into CacheList? and CrcManager?.
File:
1 edited

Legend:

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

    r106 r123  
    147147{
    148148  int i;
    149   int planet=cash.reg("art/endgame.spe","planet",SPEC_IMAGE,1);
    150   int planet2=cash.reg("art/endgame.spe","dead_planet",SPEC_IMAGE,1);
    151   int mask=cash.reg("art/endgame.spe","mask",SPEC_IMAGE,1);
    152   int ship=cash.reg("art/endgame.spe","ship",SPEC_IMAGE,1);
     149  int planet=cache.reg("art/endgame.spe","planet",SPEC_IMAGE,1);
     150  int planet2=cache.reg("art/endgame.spe","dead_planet",SPEC_IMAGE,1);
     151  int mask=cache.reg("art/endgame.spe","mask",SPEC_IMAGE,1);
     152  int ship=cache.reg("art/endgame.spe","ship",SPEC_IMAGE,1);
    153153
    154154
     
    158158 
    159159
    160   mask_line *p=make_mask_lines(cash.img(mask),cash.img(planet)->width()); 
     160  mask_line *p=make_mask_lines(cache.img(mask),cache.img(planet)->width()); 
    161161
    162162  int explo_frames1[8],explo_frames2[7];
     
    164164  for (i=0;i<8;i++)
    165165  { char nm[100]; sprintf(nm,"small_wite%04d.pcx",i+1);
    166     explo_frames1[i]=cash.reg("art/exp1.spe",nm,SPEC_CHARACTER,1);
     166    explo_frames1[i]=cache.reg("art/exp1.spe",nm,SPEC_CHARACTER,1);
    167167  }
    168168
    169169  for (i=0;i<7;i++)
    170170  { char nm[100]; sprintf(nm,"small_fire%04d.pcx",i+1);
    171     explo_frames2[i]=cash.reg("art/exp1.spe",nm,SPEC_CHARACTER,1);
     171    explo_frames2[i]=cache.reg("art/exp1.spe",nm,SPEC_CHARACTER,1);
    172172  }
    173173
    174174  int eoff=0,coff=0;
    175175
    176   int ex=xres/2-cash.img(mask)->width()/2;
    177   int ey=yres/2-cash.img(mask)->height()/2;
     176  int ex=xres/2-cache.img(mask)->width()/2;
     177  int ey=yres/2-cache.img(mask)->height()/2;
    178178  fade_out(16);
    179179
     
    211211
    212212
    213   scan_map(screen,ex,ey,cash.img(planet),cash.img(planet2),0,paddr,p,cash.img(mask)->height(),eoff,coff);     
    214   image *tcopy=cash.img(planet)->copy();
     213  scan_map(screen,ex,ey,cache.img(planet),cache.img(planet2),0,paddr,p,cache.img(mask)->height(),eoff,coff);     
     214  image *tcopy=cache.img(planet)->copy();
    215215  fade_in(NULL,32);
    216216
     
    225225    {
    226226      if ((i%10)==0 && (sound_avail&SFX_INITIALIZED))
    227         cash.sfx(space_snd)->play(64);
     227        cache.sfx(space_snd)->play(64);
    228228
    229229      old_time.get_time();
     
    235235      if (i>=30 && i<=37)
    236236      {
    237         cash.img(planet)->put_image(tcopy,0,0);
    238         cash.fig(explo_frames1[i-30])->forward->put_image(tcopy,100,50);
     237        cache.img(planet)->put_image(tcopy,0,0);
     238        cache.fig(explo_frames1[i-30])->forward->put_image(tcopy,100,50);
    239239        scan_map(screen,ex,ey,tcopy,
    240                cash.img(planet2),
     240               cache.img(planet2),
    241241               0,paddr,
    242                p,cash.img(mask)->height(),eoff,coff);     
     242               p,cache.img(mask)->height(),eoff,coff);     
    243243      }
    244244      else
    245         scan_map(screen,ex,ey,cash.img(planet),
    246                cash.img(planet2),
     245        scan_map(screen,ex,ey,cache.img(planet),
     246               cache.img(planet2),
    247247               0,paddr,
    248                p,cash.img(mask)->height(),eoff,coff);     
     248               p,cache.img(mask)->height(),eoff,coff);     
    249249      if (i>38)
    250250      {
    251251        int t=i-38;
    252         image *s=cash.img(ship);
     252        image *s=cache.img(ship);
    253253        int nw=s->width()*(t+2)/16,
    254254            nh=s->height()*(t+2)/16;
    255255
    256256
    257         scale_put_trans(s,screen,ex-(i-38)*5,ey+cash.img(mask)->height()/2+t*4,nw,nh);
     257        scale_put_trans(s,screen,ex-(i-38)*5,ey+cache.img(mask)->height()/2+t*4,nw,nh);
    258258        if (i==77)
    259259          if (sound_avail&SFX_INITIALIZED)
    260             cash.sfx(zip_snd)->play(127);
     260            cache.sfx(zip_snd)->play(127);
    261261      }
    262262       
     
    277277    {
    278278      if ((i%10)==0 && (sound_avail&SFX_INITIALIZED))
    279         cash.sfx(space_snd)->play(64);
     279        cache.sfx(space_snd)->play(64);
    280280
    281281      old_time.get_time();
     
    286286
    287287     
    288       scan_map(screen,ex,ey,cash.img(planet),
    289                cash.img(planet2),i*256/200,paddr,p,cash.img(mask)->height(),eoff,coff);     
     288      scan_map(screen,ex,ey,cache.img(planet),
     289               cache.img(planet2),i*256/200,paddr,p,cache.img(mask)->height(),eoff,coff);     
    290290
    291291      eoff+=2; if (eoff>=320) eoff-=320;
     
    295295      if (i<150 || (i<170 && ((i-149)%2)==0) || (i<180 && ((i-149)%4)==0) || (i<190 && ((i-149)%8)==0))
    296296      {
    297         clist=new ex_char(ex+jrand()%(cash.img(mask)->width()-cash.img(mask)->width()/3),
    298                         ey+jrand()%(cash.img(mask)->height()-cash.img(mask)->height()/3),0,1,clist);
     297        clist=new ex_char(ex+jrand()%(cache.img(mask)->width()-cache.img(mask)->width()/3),
     298                        ey+jrand()%(cache.img(mask)->height()-cache.img(mask)->height()/3),0,1,clist);
    299299        if (sound_avail&SFX_INITIALIZED)
    300           cash.sfx(explo_snd)->play(127);
     300          cache.sfx(explo_snd)->play(127);
    301301      }
    302302
    303 //      clist=new ex_char(ex+jrand()%(cash.img(mask)->width(),
    304 //                      ey+jrand()%(cash.img(mask)->height(),0,1,clist);
     303//      clist=new ex_char(ex+jrand()%(cache.img(mask)->width(),
     304//                      ey+jrand()%(cache.img(mask)->height(),0,1,clist);
    305305
    306306      ex_char *c=clist,*last=NULL;
     
    319319          last=c;
    320320          if (c->char_num)     
    321             cash.fig(explo_frames2[c->frame])->forward->put_image(screen,c->x,c->y);     
     321            cache.fig(explo_frames2[c->frame])->forward->put_image(screen,c->x,c->y);     
    322322
    323323          c->x-=3;
     
    347347    {
    348348      if ((i%10)==0 && (sound_avail&SFX_INITIALIZED))
    349         cash.sfx(space_snd)->play(64);
     349        cache.sfx(space_snd)->play(64);
    350350
    351351      old_time.get_time();
    352       scan_map(screen,ex,ey,cash.img(planet),
    353                cash.img(planet2),
     352      scan_map(screen,ex,ey,cache.img(planet),
     353               cache.img(planet2),
    354354               256,paddr,
    355                p,cash.img(mask)->height(),eoff,coff);     
     355               p,cache.img(mask)->height(),eoff,coff);     
    356356      eoff+=2; if (eoff>=320) eoff-=320;
    357357      coff+=1; if (coff>=320) coff-=320;     
     
    383383      screen->putpixel(dx+si[0],dy+si[1],si[2]);
    384384
    385     scan_map(screen,ex,ey,cash.img(planet),
    386              cash.img(planet2),
     385    scan_map(screen,ex,ey,cache.img(planet),
     386             cache.img(planet2),
    387387             256,paddr,
    388              p,cash.img(mask)->height(),eoff,coff);     
     388             p,cache.img(mask)->height(),eoff,coff);     
    389389    text_draw(205-i,dx+10,dy,dx+319-10,dy+199,lstring_value(end_plot),wm->font(),cmap,wm->bright_color());
    390390    wm->flush_screen();
     
    396396
    397397
    398   for (i=0;i<cash.img(mask)->height();i++)
     398  for (i=0;i<cache.img(mask)->height();i++)
    399399  {
    400400    jfree(p[i].remap);
     
    412412
    413413
    414   wm->set_mouse_shape(cash.img(c_normal)->copy(),1,1);
     414  wm->set_mouse_shape(cache.img(c_normal)->copy(),1,1);
    415415  the_game->set_state(MENU_STATE);
    416416}
     
    425425  screen->clear();
    426426
    427   image *im=cash.img(cash.reg("art/endgame.spe","tbc",SPEC_IMAGE,1));
     427  image *im=cache.img(cache.reg("art/endgame.spe","tbc",SPEC_IMAGE,1));
    428428
    429429  void *to_be=symbol_value(make_find_symbol("to_be_continued"));
     
    482482  screen->clear();
    483483
    484   image *im=cash.img(cash.reg("art/endgame.spe","end.pcx",SPEC_IMAGE,1));
     484  image *im=cache.img(cache.reg("art/endgame.spe","end.pcx",SPEC_IMAGE,1));
    485485
    486486  int dx=(xres+1)/2-320/2,dy=(yres+1)/2-200/2;
     
    526526  show_sell(1);
    527527
    528   wm->set_mouse_shape(cash.img(c_normal)->copy(),1,1);
     528  wm->set_mouse_shape(cache.img(c_normal)->copy(),1,1);
    529529  the_game->set_state(MENU_STATE);
    530530}
Note: See TracChangeset for help on using the changeset viewer.