~ubuntu-branches/ubuntu/maverick/btanks/maverick

« back to all changes in this revision

Viewing changes to engine/src/hud.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Ansgar Burchardt
  • Date: 2010-01-17 00:02:57 UTC
  • mfrom: (4.2.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100117000257-iw6esnvsz1rvp6kb
Tags: 0.9.8083-2
* Fix build failure when building only arch-specific package.
* debian/control: Add DM-Upload-Allowed: yes.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
 
2
2
/* Battle Tanks Game
3
 
 * Copyright (C) 2006-2008 Battle Tanks team
 
3
 * Copyright (C) 2006-2009 Battle Tanks team
4
4
 *
5
5
 * This program is free software; you can redistribute it and/or
6
6
 * modify it under the terms of the GNU General Public License
77
77
void Hud::initMap() {
78
78
        _radar.free();
79
79
        _radar_bg.free();
 
80
 
 
81
        Config->get("hud.radar.enable", _enable_radar, true);
 
82
        
80
83
        _map_mode = MapSmall;
81
84
        
82
85
        _pointer = NULL;
83
86
        _pointer_dir = -1;
84
87
        if (RTConfig->game_type == GameTypeRacing) {
85
 
                _pointer = ResourceManager->loadSurface("pointer.png");
 
88
                _pointer = ResourceManager->load_surface("pointer.png");
86
89
        }
87
90
}
88
91
 
257
260
                _radar_bg.free();
258
261
                return;
259
262
        }
260
 
        if (_map_mode == MapNone)
 
263
 
 
264
        if (_map_mode == MapNone || !_enable_radar)
261
265
                return;
262
266
                
263
267
        if (!_radar.isNull() && !_update_radar.tick(dt)) {
682
686
        init_map_slot.assign(this, &Hud::initMap, Map->load_map_final_signal);
683
687
        on_destroy_map_slot.assign(this, &Hud::on_destroy_map, Map->destroyed_cells_signal);
684
688
 
685
 
        _background = ResourceManager->loadSurface("hud/hud_line.png");
686
 
        _loading_border = ResourceManager->loadSurface("hud/loading_border.png");
687
 
        _loading_item = ResourceManager->loadSurface("hud/loading_item.png");
688
 
        _icons = ResourceManager->loadSurface("hud/hud_icons.png");
689
 
        _splitter = ResourceManager->loadSurface("hud/hud_splitter.png");
690
 
        _screen_splitter = ResourceManager->loadSurface("hud/split_line.png");
 
689
        _background = ResourceManager->load_surface("hud/hud_line.png");
 
690
        _loading_border = ResourceManager->load_surface("hud/loading_border.png");
 
691
        _loading_item = ResourceManager->load_surface("hud/loading_item.png");
 
692
        _icons = ResourceManager->load_surface("hud/hud_icons.png");
 
693
        _splitter = ResourceManager->load_surface("hud/hud_splitter.png");
 
694
        _screen_splitter = ResourceManager->load_surface("hud/split_line.png");
691
695
        
692
696
        _font = ResourceManager->loadFont("medium", true);
693
697
        _big_font = ResourceManager->loadFont("big", true);
695
699
        
696
700
        LOG_DEBUG(("searching splash... %dx%d", w, h));
697
701
        int sw = 0;
698
 
        int splash_sizes[] = { 1280, 1152, 1024, 800 };
 
702
        int splash_sizes[] = { 1280 };
699
703
        for(unsigned si = 0; si < sizeof(splash_sizes) / sizeof(splash_sizes[0]); ++si) {
700
704
                sw = splash_sizes[si];
701
705
                if (w >= sw) {
710
714
        }
711
715
        
712
716
        if (!files.empty()) {
713
 
                _splash = ResourceManager->loadSurface(files[mrt::random(files.size())]);
 
717
                _splash = ResourceManager->load_surface(files[mrt::random(files.size())], w, 0);
714
718
        } else {
715
719
                _splash = NULL;
716
720
        }