Move some key data members in preparation for lifting thec drawing logic.

This commit is contained in:
Eric S. Raymond 2007-06-23 17:13:22 +00:00
parent cbbf4bba46
commit f8aadff796
2 changed files with 12 additions and 15 deletions

View file

@ -63,9 +63,11 @@ namespace {
size_t sunset_timer = 0;
}
map_display::map_display(CVideo& video, const gamemap& map, const config& theme_cfg) :
map_display::map_display(CVideo& video, const gamemap& map, const config& theme_cfg, const config& cfg, const config& level) :
screen_(video), map_(map), xpos_(0), ypos_(0),
theme_(theme_cfg,screen_area()), zoom_(DefaultZoom)
theme_(theme_cfg,screen_area()), zoom_(DefaultZoom),
builder_(cfg, level, map),
minimap_(NULL), redrawMinimap_(false), redraw_background_(true)
{
if(non_interactive()) {
screen_.lock_updates(true);
@ -384,18 +386,16 @@ std::map<gamemap::location,fixed_t> display::debugHighlights_;
display::display(unit_map& units, CVideo& video, const gamemap& map,
const gamestatus& status, const std::vector<team>& t,
const config& theme_cfg, const config& cfg, const config& level) :
map_display(video, map, theme_cfg),
map_display(video, map, theme_cfg, cfg, level),
_scroll_event("scrolled"),
units_(units),
temp_unit_(NULL),
minimap_(NULL), redrawMinimap_(false), redraw_background_(true),
status_(status),
teams_(t), nextDraw_(0),
invalidateAll_(true), invalidateUnit_(true),
invalidateGameStatus_(true), panelsDrawn_(false),
currentTeam_(0), activeTeam_(0),
turbo_speed_(2), turbo_(false), grid_(false), sidebarScaling_(1.0),
builder_(cfg, level, map),
first_turn_(true), in_game_(false), map_labels_(*this,map, 0),
tod_hex_mask1(NULL), tod_hex_mask2(NULL), reach_map_changed_(true),
diagnostic_label_(0), fps_handle_(0)

View file

@ -53,7 +53,8 @@ class unit_map;
class map_display
{
public:
map_display(CVideo& video, const gamemap& map, const config& theme_cfg);
map_display(CVideo& video, const gamemap& map, const config& theme_cfg,
const config& cfg, const config& level);
~map_display();
static Uint32 rgb(Uint8 red, Uint8 green, Uint8 blue)
@ -147,6 +148,10 @@ protected:
int xpos_, ypos_;
theme theme_;
int zoom_;
terrain_builder builder_;
surface minimap_;
bool redrawMinimap_;
bool redraw_background_;
// Not set by the initializer
std::vector<gui::button> buttons_;
};
@ -500,10 +505,6 @@ private:
const SDL_Rect& calculate_energy_bar(surface surf);
std::map<surface,SDL_Rect> energy_bar_rects_;
surface minimap_;
bool redrawMinimap_;
bool redraw_background_;
paths::route route_;
const gamestatus& status_;
@ -541,14 +542,10 @@ private:
size_t currentTeam_, activeTeam_;
double turbo_speed_;
bool turbo_, grid_;
double sidebarScaling_;
terrain_builder builder_;
bool first_turn_, in_game_;
std::set<std::string> observers_;
@ -591,7 +588,7 @@ private:
//
std::vector<animated<image::locator> > flags_;
//the handle for the label which displays fps
//the handle for the label which displays frames per second
int fps_handle_;
static display * singleton_;
};