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/statbar.cpp

    r106 r123  
    5050  {
    5151    sprintf(iname,"bweap%04d.pcx",i+1);
    52     bweap[i]=cash.reg(sbname,iname,SPEC_IMAGE);
     52    bweap[i]=cache.reg(sbname,iname,SPEC_IMAGE);
    5353
    5454    sprintf(iname,"dweap%04d.pcx",i+1);
    55     dweap[i]=cash.reg(sbname,iname,SPEC_IMAGE);   
     55    dweap[i]=cache.reg(sbname,iname,SPEC_IMAGE);   
    5656  }
    5757
     
    5959  {
    6060    sprintf(iname,"bnum%02d",i);
    61     bnum[i]=cash.reg(sbname,iname,SPEC_IMAGE);
     61    bnum[i]=cache.reg(sbname,iname,SPEC_IMAGE);
    6262  }
    6363
    6464 
    65   sbar=cash.reg(sbname,"sbar",SPEC_IMAGE);
    66   sbar_select=cash.reg(sbname,"sbar_select",SPEC_IMAGE);
    67   sbar_numpad=cash.reg(sbname,"sbar_numpad",SPEC_IMAGE);
     65  sbar=cache.reg(sbname,"sbar",SPEC_IMAGE);
     66  sbar_select=cache.reg(sbname,"sbar_select",SPEC_IMAGE);
     67  sbar_numpad=cache.reg(sbname,"sbar_numpad",SPEC_IMAGE);
    6868}
    6969
     
    7676  }
    7777
    78   image *im=cash.img(*offset);
     78  image *im=cache.img(*offset);
    7979  int dw=small_render ? im->width()*2 : im->width();
    8080  int dh=small_render ? im->height()*2 : im->height();
    8181
    8282  int n=num/100;   
    83   scale_put(cash.img(offset[n]),screen,x,y,dw,dh);
     83  scale_put(cache.img(offset[n]),screen,x,y,dw,dh);
    8484  num-=n*100;
    8585
    8686  x+=dw; n=num/10;
    87   scale_put(cash.img(offset[n]),screen,x,y,dw,dh);
     87  scale_put(cache.img(offset[n]),screen,x,y,dw,dh);
    8888  num-=n*10;
    8989
    9090  x+=dw;
    91   scale_put(cash.img(offset[num]),screen,x,y,dw,dh);
     91  scale_put(cache.img(offset[num]),screen,x,y,dw,dh);
    9292}
    9393
     
    101101    if (!playing_state(the_game->state)) return ;
    102102
    103     image *sb=cash.img(sbar);
     103    image *sb=cache.img(sbar);
    104104   
    105105    // status bar width & height
     
    114114
    115115    // weapon icon width & height
    116     int ww=small_render ? cash.img(bweap[0])->width()*2 : cash.img(bweap[0])->width();
    117     int wh=small_render ? cash.img(bweap[0])->height()*2 : cash.img(bweap[0])->height();
     116    int ww=small_render ? cache.img(bweap[0])->width()*2 : cache.img(bweap[0])->width();
     117    int wh=small_render ? cache.img(bweap[0])->height()*2 : cache.img(bweap[0])->height();
    118118   
    119119
    120120    // numpad y offset
    121121    int np_yo=small_render ? 42 : 21;
    122     int np_w=small_render ? cash.img(sbar_numpad)->width()*2 : cash.img(sbar_numpad)->width();
    123     int np_h=small_render ? cash.img(sbar_numpad)->height()*2 : cash.img(sbar_numpad)->height();
     122    int np_w=small_render ? cache.img(sbar_numpad)->width()*2 : cache.img(sbar_numpad)->width();
     123    int np_h=small_render ? cache.img(sbar_numpad)->height()*2 : cache.img(sbar_numpad)->height();
    124124
    125125    // selection bar width * height
    126     int sel_w=small_render ? cash.img(sbar_select)->width()*2 : cash.img(sbar_select)->width();
    127     int sel_h=small_render ? cash.img(sbar_select)->height()*2 : cash.img(sbar_select)->height();
     126    int sel_w=small_render ? cache.img(sbar_select)->width()*2 : cache.img(sbar_select)->width();
     127    int sel_h=small_render ? cache.img(sbar_select)->height()*2 : cache.img(sbar_select)->height();
    128128
    129129    int sel_off=small_render ?  8 : 4;
     
    147147      {
    148148        if (v->current_weapon==i)
    149         scale_put_trans(cash.img(bweap[i]),screen,x_on,sy,ww,wh);
     149        scale_put_trans(cache.img(bweap[i]),screen,x_on,sy,ww,wh);
    150150        else
    151         scale_put_trans(cash.img(dweap[i]),screen,x_on,sy,ww,wh);
     151        scale_put_trans(cache.img(dweap[i]),screen,x_on,sy,ww,wh);
    152152       
    153         scale_put_trans(cash.img(sbar_numpad),screen,x_on-2,sy+np_yo,np_w,np_h);
     153        scale_put_trans(cache.img(sbar_numpad),screen,x_on-2,sy+np_yo,np_w,np_h);
    154154
    155155        if (v->current_weapon==i)
     
    159159       
    160160        if (i==icon_in_selection)
    161         scale_put_trans(cash.img(sbar_select),screen,x_on+sel_off,sy,sel_w,sel_h);
     161        scale_put_trans(cache.img(sbar_select),screen,x_on+sel_off,sy,sel_w,sel_h);
    162162      }
    163163    }
     
    176176  }
    177177
    178   image *sb=cash.img(sbar); 
     178  image *sb=cache.img(sbar); 
    179179
    180180  // status bar width & height
     
    246246    {
    247247      if ((current_level->tick_counter()&4)==0)
    248         wm->set_mouse_shape(cash.img(c_mouse1)->copy(),4,4);
    249       else wm->set_mouse_shape(cash.img(c_mouse2)->copy(),4,4);   
     248        wm->set_mouse_shape(cache.img(c_mouse1)->copy(),4,4);
     249      else wm->set_mouse_shape(cache.img(c_mouse2)->copy(),4,4);   
    250250      changed_cursor=1;
    251251    } else if (changed_cursor)
    252252    {
    253253      if (!(dev&EDIT_MODE))
    254         wm->set_mouse_shape(cash.img(c_target)->copy(),8,8);
     254        wm->set_mouse_shape(cache.img(c_target)->copy(),8,8);
    255255      else
    256         wm->set_mouse_shape(cash.img(c_normal)->copy(),1,1);
     256        wm->set_mouse_shape(cache.img(c_normal)->copy(),1,1);
    257257      changed_cursor=0;     
    258258    }
     
    272272  if (sbar>0 && total_weapons)
    273273  {
    274     image *sb=cash.img(sbar); 
     274    image *sb=cache.img(sbar); 
    275275
    276276    // status bar width & height
Note: See TracChangeset for help on using the changeset viewer.