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

    r121 r123  
    5858#define SHIFT_DOWN_DEFAULT 30
    5959
    60 extern crc_manager *net_crcs;
     60extern CrcManager *net_crcs;
     61
    6162game *the_game;
    6263WindowManager *wm = NULL;
     
    172173
    173174    if(v > 0)
    174         cash.sfx(id)->play(v, 128, p);
     175        cache.sfx(id)->play(v, 128, p);
    175176}
    176177
     
    438439
    439440    if(playing_state(state) &&  !(dev & EDIT_MODE))
    440         wm->set_mouse_shape(cash.img(c_target)->copy(), 8, 8);
     441        wm->set_mouse_shape(cache.img(c_target)->copy(), 8, 8);
    441442    else
    442         wm->set_mouse_shape(cash.img(c_normal)->copy(), 1, 1);
     443        wm->set_mouse_shape(cache.img(c_normal)->copy(), 1, 1);
    443444
    444445    if(old_state == SCENE_STATE && new_state != SCENE_STATE)
     
    470471        if(but) but = 1;
    471472        int dx = 20, dy = 5;
    472         image *jim = cash.img(joy_picts[but * 9+(y + 1)*3 + x + 1]);
     473        image *jim = cache.img(joy_picts[but * 9+(y + 1)*3 + x + 1]);
    473474        joy_win->screen->bar(dx, dy, dx + jim->width()+6, dy + jim->height()+6, wm->black());
    474475        jim->put_image(joy_win->screen, dx + 3, dy + 3);
     
    710711      if(state == SCENE_STATE)
    711712        screen->set_clip(v->cx1, v->cy1, v->cx2, v->cy2);
    712       image *tit = cash.img(title_screen);
     713      image *tit = cache.img(title_screen);
    713714      tit->put_image(screen, screen->width()/2 - tit->width()/2,
    714715                    screen->height()/2 - tit->height()/2);
     
    10851086    if(dev_cont)
    10861087    dev_cont->dev_draw(v);
    1087     if(cash.in_use())
    1088     cash.img(vmm_image)->put_image(screen, v->cx1, v->cy2 - cash.img(vmm_image)->height()+1);
     1088    if(cache.in_use())
     1089    cache.img(vmm_image)->put_image(screen, v->cx1, v->cy2 - cache.img(vmm_image)->height()+1);
    10891090
    10901091    if(dev & DRAW_LIGHTS)
     
    12531254
    12541255        if(DEFINEDP(logo_snd) && (sound_avail & SFX_INITIALIZED))
    1255             cash.sfx(lnumber_value(logo_snd))->play(sfx_volume);
     1256            cache.sfx(lnumber_value(logo_snd))->play(sfx_volume);
    12561257
    12571258        // This must be a dynamic allocated image because if it
     
    12631264        wm->set_mouse_shape(blank->copy(), 0, 0); // hide mouse
    12641265        delete blank;
    1265         fade_in(cash.img(cdc_logo), 32);
     1266        fade_in(cache.img(cdc_logo), 32);
    12661267
    12671268        milli_wait(900);
     
    13311332                if((i % 5) == 0 && DEFINEDP(space_snd) && (sound_avail & SFX_INITIALIZED))
    13321333                {
    1333                     cash.sfx(lnumber_value(space_snd))->play(sfx_volume * 90 / 127);
     1334                    cache.sfx(lnumber_value(space_snd))->play(sfx_volume * 90 / 127);
    13341335                }
    13351336            }
     
    13521353
    13531354        if(title_screen >= 0)
    1354             fade_in(cash.img(title_screen), 32);
    1355 
    1356         wm->set_mouse_shape(cash.img(c_normal)->copy(), 1, 1);
     1355            fade_in(cache.img(title_screen), 32);
     1356
     1357        wm->set_mouse_shape(cache.img(c_normal)->copy(), 1, 1);
    13571358    }
    13581359}
     
    14501451  recalc_local_view_space();   // now that we know what size the screen is...
    14511452
    1452   dark_color = get_color(cash.img(window_colors)->pixel(2, 0));
    1453   bright_color = get_color(cash.img(window_colors)->pixel(0, 0));
    1454   med_color = get_color(cash.img(window_colors)->pixel(1, 0));
    1455 
    1456   morph_dark_color = get_color(cash.img(window_colors)->pixel(2, 1));
    1457   morph_bright_color = get_color(cash.img(window_colors)->pixel(0, 1));
    1458   morph_med_color = get_color(cash.img(window_colors)->pixel(1, 1));
     1453  dark_color = get_color(cache.img(window_colors)->pixel(2, 0));
     1454  bright_color = get_color(cache.img(window_colors)->pixel(0, 0));
     1455  med_color = get_color(cache.img(window_colors)->pixel(1, 0));
     1456
     1457  morph_dark_color = get_color(cache.img(window_colors)->pixel(2, 1));
     1458  morph_bright_color = get_color(cache.img(window_colors)->pixel(0, 1));
     1459  morph_med_color = get_color(cache.img(window_colors)->pixel(1, 1));
    14591460  morph_sel_frame_color = pal->find_closest(255, 255, 0);
    14601461  light_connection_color = morph_sel_frame_color;
     
    14791480
    14801481  if(console_font_pict == -1) console_font_pict = font_pict;
    1481   game_font = new JCFont(cash.img(font_pict));
    1482 
    1483   console_font = new JCFont(cash.img(console_font_pict));
     1482  game_font = new JCFont(cache.img(font_pict));
     1483
     1484  console_font = new JCFont(cache.img(console_font_pict));
    14841485
    14851486  wm = new WindowManager(screen, pal, bright_color,
     
    15321533    if(title_screen >= 0)
    15331534    {
    1534       image *tit = cash.img(title_screen);
     1535      image *tit = cache.img(title_screen);
    15351536      tit->put_image(screen, screen->width()/2 - tit->width()/2,
    15361537                    screen->height()/2 - tit->height()/2);
     
    16101611    {
    16111612      for(view *f = first_view; f; f = f->next)
    1612         cash.img(pause_image)->put_image(screen, (f->cx1 + f->cx2)/2 - cash.img(pause_image)->width()/2,
     1613        cache.img(pause_image)->put_image(screen, (f->cx1 + f->cx2)/2 - cache.img(pause_image)->width()/2,
    16131614                   f->cy1 + 5, 1);
    16141615    }
     
    16171618  }
    16181619
    1619   if(state == RUN_STATE && cash.prof_is_on())
    1620     cash.prof_poll_end();
     1620  if(state == RUN_STATE && cache.prof_is_on())
     1621    cache.prof_poll_end();
    16211622
    16221623  wm->flush_screen();
     
    20972098        v->update_scroll();
    20982099
    2099       cash.prof_poll_start();
     2100      cache.prof_poll_start();
    21002101      current_level->tick();
    21012102      sbar.step();
     
    21982199{
    21992200    screen->add_dirty(0, 0, xres, yres);
    2200 //    image *bt = cash.img(border_tile);
     2201//    image *bt = cache.img(border_tile);
    22012202//    int tw = bt->width(), th = bt->height();
    22022203  screen->clear();
     
    22192220            screen->height()-wm->font()->height()-5, helpstr);
    22202221    }*/
    2221 /*    int dc = cash.img(window_colors)->pixel(0, 2);
    2222     int mc = cash.img(window_colors)->pixel(1, 2);
    2223     int bc = cash.img(window_colors)->pixel(2, 2);
     2222/*    int dc = cache.img(window_colors)->pixel(0, 2);
     2223    int mc = cache.img(window_colors)->pixel(1, 2);
     2224    int bc = cache.img(window_colors)->pixel(2, 2);
    22242225    screen->line(0, 0, screen->width()-1, 0, dc);
    22252226    screen->line(0, 0, 0, screen->height()-1, dc);
     
    27332734
    27342735
    2735     cash.empty();
     2736    cache.empty();
    27362737
    27372738
Note: See TracChangeset for help on using the changeset viewer.