Cleaned up unnecessary uses of get()->
This applies both to uses of smart pointers and the SDL_Surface wrapper (surface).
This commit is contained in:
parent
7d9b3f44ad
commit
e0f3ce428d
7 changed files with 12 additions and 12 deletions
|
@ -712,7 +712,7 @@ void map_context::partial_undo()
|
|||
delete undo_chain;
|
||||
undo_stack_.pop_back();
|
||||
}
|
||||
redo_stack_.push_back(first_action_in_chain.get()->perform(*this));
|
||||
redo_stack_.push_back(first_action_in_chain->perform(*this));
|
||||
//actions_since_save_ -= last_redo_action()->action_count();
|
||||
}
|
||||
|
||||
|
|
|
@ -89,9 +89,9 @@ std::string scenario::map_size() const
|
|||
std::stringstream map_size;
|
||||
|
||||
if(map_.get() != nullptr) {
|
||||
map_size << map_.get()->w();
|
||||
map_size << map_->w();
|
||||
map_size << font::unicode_multiplication_sign;
|
||||
map_size << map_.get()->h();
|
||||
map_size << map_->h();
|
||||
} else {
|
||||
map_size << _("not available.");
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ std::string random_generate_map(const std::string& name, const config &cfg)
|
|||
throw mapgen_exception(ss.str());
|
||||
}
|
||||
|
||||
return generator.get()->create_map();
|
||||
return generator->create_map();
|
||||
}
|
||||
|
||||
config random_generate_scenario(const std::string& name, const config &cfg)
|
||||
|
|
|
@ -548,7 +548,7 @@ void mp_create_game::display_games_of_type(window& window, ng::level::TYPE type,
|
|||
list.clear();
|
||||
|
||||
for(const auto& game : create_engine_.get_levels_by_type_unfiltered(type)) {
|
||||
if(!game.get()->can_launch_game()) {
|
||||
if(!game->can_launch_game()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -556,11 +556,11 @@ void mp_create_game::display_games_of_type(window& window, ng::level::TYPE type,
|
|||
string_map item;
|
||||
|
||||
if(type == ng::level::TYPE::CAMPAIGN || type == ng::level::TYPE::SP_CAMPAIGN) {
|
||||
item["label"] = game.get()->icon();
|
||||
item["label"] = game->icon();
|
||||
data.emplace("game_icon", item);
|
||||
}
|
||||
|
||||
item["label"] = game.get()->name();
|
||||
item["label"] = game->name();
|
||||
data.emplace("game_name", item);
|
||||
|
||||
list.add_row(data);
|
||||
|
|
|
@ -199,7 +199,7 @@ void unit_list::post_show(window& window)
|
|||
if(get_retval() == window::OK) {
|
||||
const int selected_row = find_widget<listbox>(&window, "units_list", false).get_selected_row();
|
||||
|
||||
scroll_to_ = unit_list_[selected_row].get()->get_location();
|
||||
scroll_to_ = unit_list_[selected_row]->get_location();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -739,7 +739,7 @@ void set_zoom(int amount)
|
|||
template <scaling_function F>
|
||||
static surface scale_xbrz_helper(const surface & res, int w, int h)
|
||||
{
|
||||
int best_integer_zoom = std::min(w / res.get()->w, h / res.get()->h);
|
||||
int best_integer_zoom = std::min(w / res->w, h / res->h);
|
||||
int legal_zoom = utils::clamp(best_integer_zoom, 1, 5);
|
||||
return F(scale_surface_xbrz(res, legal_zoom), w, h);
|
||||
}
|
||||
|
@ -812,7 +812,7 @@ static surface get_scaled_to_zoom(const locator& i_locator)
|
|||
surface res(get_image(i_locator, UNSCALED));
|
||||
// For some reason haloes seems to have invalid images, protect against crashing
|
||||
if(!res.null()) {
|
||||
return scale_to_zoom_func(res, ((res.get()->w * zoom) / tile_size), ((res.get()->h * zoom) / tile_size));
|
||||
return scale_to_zoom_func(res, ((res->w * zoom) / tile_size), ((res->h * zoom) / tile_size));
|
||||
} else {
|
||||
return surface(nullptr);
|
||||
}
|
||||
|
|
|
@ -4384,10 +4384,10 @@ int game_lua_kernel::cfun_builtin_effect(lua_State *L)
|
|||
cfg["times"] = 1;
|
||||
|
||||
if(need_apply) {
|
||||
u.get()->apply_builtin_effect(which_effect, cfg);
|
||||
u->apply_builtin_effect(which_effect, cfg);
|
||||
return 0;
|
||||
} else {
|
||||
std::string description = u.get()->describe_builtin_effect(which_effect, cfg);
|
||||
std::string description = u->describe_builtin_effect(which_effect, cfg);
|
||||
lua_pushstring(L, description.c_str());
|
||||
return 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue