GunChleoc has proposed merging lp:~widelands-dev/widelands/bug-1395278-underscores into lp:widelands.
Commit message: Removed leading underscores from variable and function names. Requested reviews: Widelands Developers (widelands-dev) For more details, see: https://code.launchpad.net/~widelands-dev/widelands/bug-1395278-underscores/+merge/286114 This is for all src directories :) -- Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1395278-underscores into lp:widelands.
=== modified file 'src/economy/economy.cc' --- src/economy/economy.cc 2016-02-07 06:10:47 +0000 +++ src/economy/economy.cc 2016-02-15 22:33:49 +0000 @@ -75,7 +75,7 @@ } router_ = - new Router(boost::bind(&Economy::_reset_all_pathfinding_cycles, this)); + new Router(boost::bind(&Economy::reset_all_pathfinding_cycles, this)); } Economy::~Economy() @@ -120,7 +120,7 @@ if (e1 != e2) { if (e1->get_nrflags() < e2->get_nrflags()) std::swap(e1, e2); - e1->_merge(*e2); + e1->merge(*e2); } } @@ -142,7 +142,7 @@ e->rebalance_supply(); // the real split-checking is done during rebalance } -void Economy::_check_splits() +void Economy::check_splits() { EditorGameBase & egbase = owner().egbase(); Map & map = egbase.map(); @@ -167,7 +167,7 @@ while (RoutingNode * current = astar.step()) reachable.insert(¤t->base_flag()); if (reachable.size() != flags_.size()) - _split(reachable); + split(reachable); continue; } @@ -188,7 +188,7 @@ for (;;) { RoutingNode * current = astar.step(); if (!current) { - _split(reachable); + split(reachable); break; } else if (current == f2) break; @@ -288,7 +288,7 @@ { assert(flag.get_economy() == this); - _remove_flag(flag); + do_remove_flag(flag); // automatically delete the economy when it becomes empty. if (flags_.empty()) @@ -299,7 +299,7 @@ * Remove the flag, but don't delete the economy automatically. * This is called from the merge code. */ -void Economy::_remove_flag(Flag & flag) +void Economy::do_remove_flag(Flag & flag) { flag.set_economy(nullptr); @@ -317,7 +317,7 @@ * Callback for the incredibly rare case that the \ref Router pathfinding * cycle wraps around. */ -void Economy::_reset_all_pathfinding_cycles() +void Economy::reset_all_pathfinding_cycles() { for (Flag * flag : flags_) { flag->reset_path_finding_cycle(); @@ -364,7 +364,7 @@ //log("%p: add(%i, %i)\n", this, id, count); wares_.add(id, count); - _start_request_timer(); + start_request_timer(); // TODO(unknown): add to global player inventory? } @@ -373,7 +373,7 @@ //log("%p: add(%i, %i)\n", this, id, count); workers_.add(id, count); - _start_request_timer(); + start_request_timer(); // TODO(unknown): add to global player inventory? } @@ -444,21 +444,21 @@ void Economy::add_request(Request & req) { assert(req.is_open()); - assert(!_has_request(req)); + assert(!has_request(req)); assert(&owner()); requests_.push_back(&req); // Try to fulfill the request - _start_request_timer(); + start_request_timer(); } /** * \return true if the given Request is registered with the \ref Economy, false * otherwise */ -bool Economy::_has_request(Request & req) +bool Economy::has_request(Request & req) { return std::find(requests_.begin(), requests_.end(), &req) @@ -491,7 +491,7 @@ void Economy::add_supply(Supply & supply) { supplies_.add_supply(supply); - _start_request_timer(); + start_request_timer(); } @@ -562,7 +562,7 @@ * Also transfer all wares and wares request. Try to resolve the new ware * requests if possible. */ -void Economy::_merge(Economy & e) +void Economy::merge(Economy & e) { for (const DescriptionIndex& ware_index : owner_.tribe().wares()) { TargetQuantity other_tq = e.ware_target_quantities_[ware_index]; @@ -598,7 +598,7 @@ Flag & flag = *e.flags_[0]; - e._remove_flag(flag); // do not delete other economy yet! + e.do_remove_flag(flag); // do not delete other economy yet! add_flag(flag); } @@ -612,7 +612,7 @@ /** * Split the given set of flags off into a new economy. */ -void Economy::_split(const std::set<OPtr<Flag> > & flags) +void Economy::split(const std::set<OPtr<Flag> > & flags) { assert(!flags.empty()); @@ -636,13 +636,13 @@ // As long as rebalance commands are tied to specific flags, we // need this, because the flag that rebalance commands for us were // tied to might have been moved into the other economy - _start_request_timer(); + start_request_timer(); } /** * Make sure the request timer is running. */ -void Economy::_start_request_timer(int32_t const delta) +void Economy::start_request_timer(int32_t const delta) { if (upcast(Game, game, &owner_.egbase())) game->cmdqueue().enqueue @@ -655,7 +655,7 @@ * Find the supply that is best suited to fulfill the given request. * \return 0 if no supply is found, the best supply otherwise */ -Supply * Economy::_find_best_supply +Supply * Economy::find_best_supply (Game & game, const Request & req, int32_t & cost) { assert(req.is_open()); @@ -667,7 +667,7 @@ Flag & target_flag = req.target_flag(); Map & map = game.map(); - available_supplies.clear(); + available_supplies_.clear(); for (size_t i = 0; i < supplies_.get_nrsupplies(); ++i) { Supply & supp = supplies_[i]; @@ -692,11 +692,11 @@ // std::map quarantees uniqueness, practically it means that if more wares are on the same flag, only // first one will be inserted into available_supplies - available_supplies.insert(std::make_pair(ud, &supplies_[i])); + available_supplies_.insert(std::make_pair(ud, &supplies_[i])); } // Now available supplies have been sorted by distance to requestor - for (auto& supplypair : available_supplies) { + for (auto& supplypair : available_supplies_) { Supply & supp = *supplypair.second; Route * const route = @@ -774,7 +774,7 @@ /** * Walk all Requests and find potential transfer candidates. */ -void Economy::_process_requests(Game & game, RSPairStruct & s) +void Economy::process_requests(Game & game, RSPairStruct & s) { for (Request * temp_req : requests_) { Request & req = *temp_req; @@ -789,7 +789,7 @@ } int32_t cost; // estimated time in milliseconds to fulfill Request - Supply * const supp = _find_best_supply(game, req, cost); + Supply * const supp = find_best_supply(game, req, cost); if (!supp) continue; @@ -827,13 +827,13 @@ /** * Try to fulfill open requests with available supplies. */ -void Economy::_balance_requestsupply(Game & game) +void Economy::balance_requestsupply(Game & game) { RSPairStruct rsps; rsps.nexttimer = -1; // Try to fulfill Requests. - _process_requests(game, rsps); + process_requests(game, rsps); // Now execute request/supply pairs. while (!rsps.queue.empty()) { @@ -844,7 +844,7 @@ if (!rsp.request || !rsp.supply || - !_has_request(*rsp.request) || + !has_request(*rsp.request) || !rsp.supply->nr_supplies(game, *rsp.request)) { rsps.nexttimer = 200; @@ -855,12 +855,12 @@ rsp.request->set_last_request_time(game.get_gametime()); // for multiple wares - if (rsp.request && _has_request(*rsp.request)) + if (rsp.request && has_request(*rsp.request)) rsps.nexttimer = 200; } if (rsps.nexttimer > 0) { // restart the timer, if necessary - _start_request_timer(rsps.nexttimer); + start_request_timer(rsps.nexttimer); } } @@ -871,7 +871,7 @@ * Check whether there is a supply for the given request. If the request is a * worker request without supply, attempt to create a new worker in a warehouse. */ -void Economy::_create_requested_worker(Game & game, DescriptionIndex index) +void Economy::create_requested_worker(Game & game, DescriptionIndex index) { uint32_t demand = 0; @@ -1026,7 +1026,7 @@ * Walk all Requests and find requests of workers than aren't supplied. Then * try to create the worker at warehouses. */ -void Economy::_create_requested_workers(Game & game) +void Economy::create_requested_workers(Game & game) { if (!warehouses().size()) return; @@ -1034,13 +1034,13 @@ for (const DescriptionIndex& worker_index : owner().tribe().workers()) { if (owner().is_worker_type_allowed(worker_index) && owner().tribe().get_worker_descr(worker_index)->is_buildable()) { - _create_requested_worker(game, worker_index); + create_requested_worker(game, worker_index); } } } /** - * Helper function for \ref _handle_active_supplies + * Helper function for \ref handle_active_supplies */ static bool accept_warehouse_if_policy (Warehouse & wh, WareWorker type, @@ -1053,7 +1053,7 @@ * Send all active supplies (wares that are outside on the road network without * being sent to a specific request) to a warehouse. */ -void Economy::_handle_active_supplies(Game & game) +void Economy::handle_active_supplies(Game & game) { if (!warehouses().size()) return; @@ -1121,7 +1121,7 @@ } if (!wh) { log - ("Warning: Economy::_handle_active_supplies " + ("Warning: Economy::handle_active_supplies " "didn't find warehouse\n"); return; } @@ -1157,13 +1157,13 @@ Game & game = dynamic_cast<Game&>(owner().egbase()); - _check_splits(); - - _create_requested_workers (game); - - _balance_requestsupply(game); - - _handle_active_supplies(game); + check_splits(); + + create_requested_workers (game); + + balance_requestsupply(game); + + handle_active_supplies(game); } } === modified file 'src/economy/economy.h' --- src/economy/economy.h 2016-02-07 06:10:47 +0000 +++ src/economy/economy.h 2016-02-15 22:33:49 +0000 @@ -182,7 +182,7 @@ ///< called by \ref Cmd_Call_Economy_Balance void balance(uint32_t timerid); - void rebalance_supply() {_start_request_timer();} + void rebalance_supply() {start_request_timer();} private: @@ -204,23 +204,23 @@ /*************/ /* Functions */ /*************/ - void _remove_flag(Flag &); - void _reset_all_pathfinding_cycles(); - - void _merge(Economy &); - void _check_splits(); - void _split(const std::set<OPtr<Flag> > &); - - void _start_request_timer(int32_t delta = 200); - - Supply * _find_best_supply(Game &, const Request &, int32_t & cost); - void _process_requests(Game &, RSPairStruct &); - void _balance_requestsupply(Game &); - void _handle_active_supplies(Game &); - void _create_requested_workers(Game &); - void _create_requested_worker(Game &, DescriptionIndex); - - bool _has_request(Request &); + void do_remove_flag(Flag &); + void reset_all_pathfinding_cycles(); + + void merge(Economy &); + void check_splits(); + void split(const std::set<OPtr<Flag> > &); + + void start_request_timer(int32_t delta = 200); + + Supply * find_best_supply(Game &, const Request &, int32_t & cost); + void process_requests(Game &, RSPairStruct &); + void balance_requestsupply(Game &); + void handle_active_supplies(Game &); + void create_requested_workers(Game &); + void create_requested_worker(Game &, DescriptionIndex); + + bool has_request(Request &); /*************/ /* Variables */ @@ -255,7 +255,7 @@ UI::UniqueWindow::Registry optionswindow_registry_; // 'list' of unique providers - std::map<UniqueDistance, Supply*> available_supplies; + std::map<UniqueDistance, Supply*> available_supplies_; DISALLOW_COPY_AND_ASSIGN(Economy); }; === modified file 'src/economy/flag.h' --- src/economy/flag.h 2016-02-07 06:10:47 +0000 +++ src/economy/flag.h 2016-02-15 22:33:49 +0000 @@ -35,8 +35,8 @@ class FlagDescr : public MapObjectDescr { public: - FlagDescr(char const* const _name, char const* const _descname) - : MapObjectDescr(MapObjectType::FLAG, _name, _descname) { + FlagDescr(char const* const init_name, char const* const init_descname) + : MapObjectDescr(MapObjectType::FLAG, init_name, init_descname) { } ~FlagDescr() override { } === modified file 'src/economy/fleet.h' --- src/economy/fleet.h 2016-02-07 06:10:47 +0000 +++ src/economy/fleet.h 2016-02-15 22:33:49 +0000 @@ -36,8 +36,8 @@ class FleetDescr : public MapObjectDescr { public: - FleetDescr(char const* const _name, char const* const _descname) - : MapObjectDescr(MapObjectType::FLEET, _name, _descname) { + FleetDescr(char const* const init_name, char const* const init_descname) + : MapObjectDescr(MapObjectType::FLEET, init_name, init_descname) { } ~FleetDescr() override { } === modified file 'src/economy/portdock.cc' --- src/economy/portdock.cc 2016-02-07 06:10:47 +0000 +++ src/economy/portdock.cc 2016-02-15 22:33:49 +0000 @@ -48,8 +48,8 @@ return g_portdock_descr; } -PortdockDescr::PortdockDescr(char const* const _name, char const* const _descname) - : MapObjectDescr(MapObjectType::PORTDOCK, _name, _descname) { +PortdockDescr::PortdockDescr(char const* const init_name, char const* const init_descname) + : MapObjectDescr(MapObjectType::PORTDOCK, init_name, init_descname) { } PortDock::PortDock(Warehouse* wh) @@ -253,7 +253,7 @@ ++item_iter) { if (item_iter->object_.serial() == ware.serial()) { - _update_shippingitem(game, item_iter); + update_shippingitem(game, item_iter); return; } } @@ -278,13 +278,13 @@ ++item_iter) { if (item_iter->object_.serial() == worker.serial()) { - _update_shippingitem(game, item_iter); + update_shippingitem(game, item_iter); return; } } } -void PortDock::_update_shippingitem(Game& game, std::vector<ShippingItem>::iterator it) { +void PortDock::update_shippingitem(Game& game, std::vector<ShippingItem>::iterator it) { it->update_destination(game, *this); PortDock* dst = it->get_destination(game); === modified file 'src/economy/portdock.h' --- src/economy/portdock.h 2016-02-07 06:10:47 +0000 +++ src/economy/portdock.h 2016-02-15 22:33:49 +0000 @@ -37,7 +37,7 @@ class PortdockDescr : public MapObjectDescr { public: - PortdockDescr(char const* const _name, char const* const _descname); + PortdockDescr(char const* const init_name, char const* const init_descname); ~PortdockDescr() override { } @@ -134,7 +134,7 @@ void init_fleet(EditorGameBase & egbase); void set_fleet(Fleet * fleet); - void _update_shippingitem(Game &, std::vector<ShippingItem>::iterator); + void update_shippingitem(Game &, std::vector<ShippingItem>::iterator); void set_need_ship(Game &, bool need); Fleet * fleet_; === modified file 'src/economy/request.cc' --- src/economy/request.cc 2016-02-13 19:17:06 +0000 +++ src/economy/request.cc 2016-02-15 22:33:49 +0000 @@ -49,31 +49,31 @@ */ Request::Request - (PlayerImmovable & _target, + (PlayerImmovable & init_target, DescriptionIndex const index, CallbackFn const cbfn, WareWorker const w) : type_ (w), - target_ (_target), - target_building_ (dynamic_cast<Building *>(&_target)), - target_productionsite_ (dynamic_cast<ProductionSite *>(&_target)), - target_warehouse_ (dynamic_cast<Warehouse *>(&_target)), - target_constructionsite_ (dynamic_cast<ConstructionSite *>(&_target)), - economy_ (_target.get_economy()), + target_ (init_target), + target_building_ (dynamic_cast<Building *>(&init_target)), + target_productionsite_ (dynamic_cast<ProductionSite *>(&init_target)), + target_warehouse_ (dynamic_cast<Warehouse *>(&init_target)), + target_constructionsite_ (dynamic_cast<ConstructionSite *>(&init_target)), + economy_ (init_target.get_economy()), index_ (index), count_ (1), callbackfn_ (cbfn), - required_time_ (_target.owner().egbase().get_gametime()), + required_time_ (init_target.owner().egbase().get_gametime()), required_interval_(0), last_request_time_(required_time_) { assert(type_ == wwWARE || type_ == wwWORKER); - if (w == wwWARE && !_target.owner().egbase().tribes().ware_exists(index)) + if (w == wwWARE && !init_target.owner().egbase().tribes().ware_exists(index)) throw wexception ("creating ware request with index %u, but the ware for this index doesn't exist", index); - if (w == wwWORKER && !_target.owner().egbase().tribes().worker_exists(index)) + if (w == wwWORKER && !init_target.owner().egbase().tribes().worker_exists(index)) throw wexception ("creating worker request with index %u, but the worker for this index doesn't exist", index); === modified file 'src/economy/road.cc' --- src/economy/road.cc 2016-02-07 06:10:47 +0000 +++ src/economy/road.cc 2016-02-15 22:33:49 +0000 @@ -103,7 +103,7 @@ road.flags_[FlagStart] = &start; road.flags_[FlagEnd] = &end; // flagidx_ is set when attach_road() is called, i.e. in init() - road._set_path(egbase, path); + road.set_path(egbase, path); road.init(egbase); @@ -156,7 +156,7 @@ * Set the new path, calculate costs. * You have to set start and end flags before calling this function. */ -void Road::_set_path(EditorGameBase & egbase, const Path & path) +void Road::set_path(EditorGameBase & egbase, const Path & path) { assert(path.get_nsteps() >= 2); assert(path.get_start() == flags_[FlagStart]->get_position()); @@ -172,7 +172,7 @@ /** * Add road markings to the map */ -void Road::_mark_map(EditorGameBase & egbase) +void Road::mark_map(EditorGameBase & egbase) { Map & map = egbase.map(); FCoords curf = map.get_fcoords(path_.get_start()); @@ -208,7 +208,7 @@ /** * Remove road markings from the map */ -void Road::_unmark_map(EditorGameBase & egbase) { +void Road::unmark_map(EditorGameBase & egbase) { Map & map = egbase.map(); FCoords curf(path_.get_start(), &map[path_.get_start()]); @@ -248,7 +248,7 @@ PlayerImmovable::init(egbase); if (2 <= path_.get_nsteps()) - _link_into_flags(egbase); + link_into_flags(egbase); } /** @@ -258,7 +258,7 @@ * we needed to have this road already registered * as Map Object, thats why this is moved */ -void Road::_link_into_flags(EditorGameBase & egbase) { +void Road::link_into_flags(EditorGameBase & egbase) { assert(path_.get_nsteps() >= 2); // Link into the flags (this will also set our economy) @@ -277,7 +277,7 @@ Economy::check_merge(*flags_[FlagStart], *flags_[FlagEnd]); // Mark Fields - _mark_map(egbase); + mark_map(egbase); /* * Iterate over all Carrierslots @@ -294,7 +294,7 @@ (!slot.carrier_request && (slot.carrier_type == 1 || type_ == RoadType::kBusy)) { - _request_carrier(slot); + request_carrier(slot); } } } @@ -315,7 +315,7 @@ } // Unmark Fields - _unmark_map(egbase); + unmark_map(egbase); // Unlink from flags (also clears the economy) flags_[FlagStart]->detach_road(flagidx_[FlagStart]); @@ -352,28 +352,28 @@ * Only call this if the road can handle a new carrier, and if no request has * been issued. */ -void Road::_request_carrier(CarrierSlot & slot) +void Road::request_carrier(CarrierSlot & slot) { if (slot.carrier_type == 1) slot.carrier_request = new Request (*this, owner().tribe().carrier(), - Road::_request_carrier_callback, + Road::request_carrier_callback, wwWORKER); else slot.carrier_request = new Request (*this, owner().tribe().carrier2(), - Road::_request_carrier_callback, + Road::request_carrier_callback, wwWORKER); } /** * The carrier has arrived successfully. */ -void Road::_request_carrier_callback +void Road::request_carrier_callback (Game & game, Request & rq, DescriptionIndex, @@ -420,7 +420,7 @@ if (carrier == &w) { slot.carrier = nullptr; carrier = nullptr; - _request_carrier(slot); + request_carrier(slot); } } @@ -453,7 +453,7 @@ * the new flag initializes. We remove markings to avoid interference with the * flag. */ -void Road::presplit(Game & game, Coords) {_unmark_map(game);} +void Road::presplit(Game & game, Coords) {unmark_map(game);} /** * The flag that splits this road has been initialized. Perform the actual @@ -493,14 +493,14 @@ // change road size and reattach flags_[FlagEnd] = &flag; - _set_path(game, path); + set_path(game, path); const Direction dir = get_reverse_dir(path_[path_.get_nsteps() - 1]); flags_[FlagEnd]->attach_road(dir, this); flagidx_[FlagEnd] = dir; // recreate road markings - _mark_map(game); + mark_map(game); // create the new road Road & newroad = *new Road(); @@ -508,7 +508,7 @@ newroad.type_ = type_; newroad.flags_[FlagStart] = &flag; // flagidx will be set on init() newroad.flags_[FlagEnd] = &oldend; - newroad._set_path(game, secondpath); + newroad.set_path(game, secondpath); // Find workers on this road that need to be reassigned // The algorithm is pretty simplistic, and has a bias towards keeping @@ -585,7 +585,7 @@ !slot.carrier_request && (slot.carrier_type == 1 || type_ == RoadType::kBusy)) { - _request_carrier(slot); + request_carrier(slot); } } @@ -633,7 +633,7 @@ carrier_slots_[1].carrier = nullptr; carrier_slots_[1].carrier_request = nullptr; type_ = RoadType::kNormal; - _mark_map(game); + mark_map(game); } } } @@ -649,13 +649,13 @@ busyness_last_update_ = gametime; if (500 < (busyness_ += 10)) { type_ = RoadType::kBusy; - _mark_map(game); + mark_map(game); for (CarrierSlot& slot : carrier_slots_) { if (!slot.carrier.get(game) && !slot.carrier_request && slot.carrier_type != 1) { - _request_carrier(slot); + request_carrier(slot); } } } === modified file 'src/economy/road.h' --- src/economy/road.h 2016-02-07 06:10:47 +0000 +++ src/economy/road.h 2016-02-15 22:33:49 +0000 @@ -33,8 +33,8 @@ class RoadDescr : public MapObjectDescr { public: - RoadDescr(char const* const _name, char const* const _descname) - : MapObjectDescr(MapObjectType::ROAD, _name, _descname) { + RoadDescr(char const* const init_name, char const* const init_descname) + : MapObjectDescr(MapObjectType::ROAD, init_name, init_descname) { } ~RoadDescr() override {} @@ -117,15 +117,15 @@ void draw(const EditorGameBase &, RenderTarget &, const FCoords&, const Point&) override; private: - void _set_path(EditorGameBase &, const Path &); - - void _mark_map(EditorGameBase &); - void _unmark_map(EditorGameBase &); - - void _link_into_flags(EditorGameBase &); - - void _request_carrier(CarrierSlot &); - static void _request_carrier_callback + void set_path(EditorGameBase &, const Path &); + + void mark_map(EditorGameBase &); + void unmark_map(EditorGameBase &); + + void link_into_flags(EditorGameBase &); + + void request_carrier(CarrierSlot &); + static void request_carrier_callback (Game &, Request &, DescriptionIndex, Worker *, PlayerImmovable &); private: === modified file 'src/economy/test/test_routing.cc' --- src/economy/test/test_routing.cc 2015-11-28 22:29:26 +0000 +++ src/economy/test/test_routing.cc 2016-02-15 22:33:49 +0000 @@ -41,20 +41,20 @@ public: TestingRoutingNode (int32_t wcost = 0, Coords pos = Coords(0, 0)) : - _waitcost(wcost), _position(pos) {} + waitcost_(wcost), position_(pos) {} void add_neighbour(TestingRoutingNode * nb) { - _neighbours.push_back(nb); + neighbours_.push_back(nb); } TestingRoutingNode * get_neighbour(uint8_t idx) const { - if (idx >= _neighbours.size()) + if (idx >= neighbours_.size()) throw BadAccess(); - return _neighbours[idx]; + return neighbours_[idx]; } - Flag & base_flag() override {return _flag;} - void set_waitcost(int32_t const wc) {_waitcost = wc;} - int32_t get_waitcost() const {return _waitcost;} - const Coords & get_position() const override {return _position;} + Flag & base_flag() override {return flag_;} + void set_waitcost(int32_t const wc) {waitcost_ = wc;} + int32_t get_waitcost() const {return waitcost_;} + const Coords & get_position() const override {return position_;} void get_neighbours(WareWorker type, RoutingNodeNeighbours &) override; @@ -64,16 +64,16 @@ private: using Neigbours = std::vector<TestingRoutingNode *>; - Neigbours _neighbours; - int32_t _waitcost; - Coords _position; - Flag _flag; + Neigbours neighbours_; + int32_t waitcost_; + Coords position_; + Flag flag_; }; void TestingRoutingNode::get_neighbours(WareWorker type, RoutingNodeNeighbours & n) { - for (TestingRoutingNode * nb : _neighbours) { + for (TestingRoutingNode * nb : neighbours_) { // second parameter is walktime in ms from this flag to the neighbour. // only depends on slope - n.push_back(RoutingNodeNeighbour(nb, 1000 * ((type == wwWARE)?1 + _waitcost:1))); + n.push_back(RoutingNodeNeighbour(nb, 1000 * ((type == wwWARE)?1 + waitcost_:1))); } } bool TestingRoutingNode::all_members_zeroed() { === modified file 'src/economy/wares_queue.cc' --- src/economy/wares_queue.cc 2016-02-07 06:10:47 +0000 +++ src/economy/wares_queue.cc 2016-02-15 22:33:49 +0000 @@ -37,14 +37,14 @@ * Pre-initialize a WaresQueue */ WaresQueue::WaresQueue - (PlayerImmovable & _owner, - DescriptionIndex const _ware, - uint8_t const _max_size) + (PlayerImmovable & init_owner, + DescriptionIndex const init_ware, + uint8_t const init_max_size) : - owner_ (_owner), - ware_ (_ware), - max_size_ (_max_size), - max_fill_ (_max_size), + owner_ (init_owner), + ware_ (init_ware), + max_size_ (init_max_size), + max_fill_ (init_max_size), filled_ (0), consume_interval_(0), request_ (nullptr), === modified file 'src/graphic/richtext.cc' --- src/graphic/richtext.cc 2016-01-31 21:03:15 +0000 +++ src/graphic/richtext.cc 2016-02-15 22:33:49 +0000 @@ -41,7 +41,7 @@ * rectangular bounding box. */ struct Element { - explicit Element(const Rect & _bbox) : bbox(_bbox) {} + explicit Element(const Rect & bounding_box) : bbox(bounding_box) {} virtual ~Element() {} /** @@ -54,8 +54,8 @@ }; struct ImageElement : Element { - ImageElement(const Rect & _bbox, const Image* _image) - : Element(_bbox), image(_image) {} + ImageElement(const Rect & bounding_box, const Image* init_image) + : Element(bounding_box), image(init_image) {} void draw(RenderTarget & dst) override { @@ -67,10 +67,10 @@ struct TextlineElement : Element { TextlineElement - (const Rect & _bbox, const TextStyle & _style, + (const Rect & bounding_box, const TextStyle & init_style, std::vector<std::string>::const_iterator words_begin, std::vector<std::string>::const_iterator words_end) - : Element(_bbox), style(_style), words(words_begin, words_end) {} + : Element(bounding_box), style(init_style), words(words_begin, words_end) {} void draw(RenderTarget & dst) override { @@ -250,8 +250,8 @@ /// parts of a line onto the same text baseline). std::vector<Elt> elements; - TextBuilder(RichTextImpl & _rti) : - rti(_rti), + TextBuilder(RichTextImpl & impl) : + rti(impl), images_width(0), images_height(0), maxwidth(0), === modified file 'src/logic/cmd_calculate_statistics.h' --- src/logic/cmd_calculate_statistics.h 2015-11-27 12:46:45 +0000 +++ src/logic/cmd_calculate_statistics.h 2016-02-15 22:33:49 +0000 @@ -28,8 +28,8 @@ struct CmdCalculateStatistics : public GameLogicCommand { CmdCalculateStatistics() : GameLogicCommand(0) {} // For savegame loading - CmdCalculateStatistics(uint32_t const _duetime) : - GameLogicCommand(_duetime) {} + CmdCalculateStatistics(uint32_t const init_duetime) : + GameLogicCommand(init_duetime) {} // Write these commands to a file (for savegames) void write(FileWrite &, EditorGameBase &, MapObjectSaver &) override; === modified file 'src/logic/cmd_luacoroutine.h' --- src/logic/cmd_luacoroutine.h 2015-11-27 12:46:45 +0000 +++ src/logic/cmd_luacoroutine.h 2016-02-15 22:33:49 +0000 @@ -29,8 +29,8 @@ struct CmdLuaCoroutine : public GameLogicCommand { CmdLuaCoroutine() : GameLogicCommand(0), m_cr(nullptr) {} // For savegame loading - CmdLuaCoroutine(uint32_t const _duetime, LuaCoroutine * const cr) : - GameLogicCommand(_duetime), m_cr(cr) {} + CmdLuaCoroutine(uint32_t const init_duetime, LuaCoroutine * const cr) : + GameLogicCommand(init_duetime), m_cr(cr) {} ~CmdLuaCoroutine() { delete m_cr; === modified file 'src/logic/cmd_luascript.h' --- src/logic/cmd_luascript.h 2015-11-27 12:46:45 +0000 +++ src/logic/cmd_luascript.h 2016-02-15 22:33:49 +0000 @@ -29,8 +29,8 @@ struct CmdLuaScript : public GameLogicCommand { CmdLuaScript() : GameLogicCommand(0) {} // For savegame loading CmdLuaScript - (uint32_t const _duetime, const std::string& script) : - GameLogicCommand(_duetime), script_(script) {} + (uint32_t const init_duetime, const std::string& script) : + GameLogicCommand(init_duetime), script_(script) {} // Write these commands to a file (for savegames) void write(FileWrite &, EditorGameBase &, MapObjectSaver &) override; === modified file 'src/logic/cmd_queue.h' --- src/logic/cmd_queue.h 2015-11-29 10:10:29 +0000 +++ src/logic/cmd_queue.h 2016-02-15 22:33:49 +0000 @@ -70,7 +70,7 @@ * the same for all parallel simulation. */ struct Command { - Command (const uint32_t _duetime) : m_duetime(_duetime) {} + Command (const uint32_t init_duetime) : m_duetime(init_duetime) {} virtual ~Command (); virtual void execute (Game &) = 0; @@ -92,7 +92,7 @@ * for all instances of a game to ensure parallel simulation. */ struct GameLogicCommand : public Command { - GameLogicCommand (uint32_t const _duetime) : Command(_duetime) {} + GameLogicCommand (uint32_t const init_duetime) : Command(init_duetime) {} // Write these commands to a file (for savegames) virtual void write === modified file 'src/logic/cookie_priority_queue.h' --- src/logic/cookie_priority_queue.h 2014-09-14 14:36:56 +0000 +++ src/logic/cookie_priority_queue.h 2016-02-15 22:33:49 +0000 @@ -87,7 +87,8 @@ using Compare = _Compare; using CookieAccessor = _CookieAccessor; - CookiePriorityQueue(const Compare & _c = Compare(), const CookieAccessor & _a = CookieAccessor()); + CookiePriorityQueue(const Compare& comparator = Compare(), + const CookieAccessor& accessor = CookieAccessor()); ~CookiePriorityQueue(); CookieSizeType size() const; @@ -126,9 +127,9 @@ template<typename _T, typename _Cw, typename _CA> CookiePriorityQueue<_T, _Cw, _CA>::CookiePriorityQueue - (const typename CookiePriorityQueue<_T, _Cw, _CA>::Compare & _c, - const typename CookiePriorityQueue<_T, _Cw, _CA>::CookieAccessor & _a) -: c(_c), ca(_a) + (const typename CookiePriorityQueue<_T, _Cw, _CA>::Compare & comparator, + const typename CookiePriorityQueue<_T, _Cw, _CA>::CookieAccessor & accessor) +: c(comparator), ca(accessor) { } === modified file 'src/logic/findbob.h' --- src/logic/findbob.h 2014-07-26 10:43:23 +0000 +++ src/logic/findbob.h 2016-02-15 22:33:49 +0000 @@ -40,7 +40,7 @@ * if player is 0). */ struct FindBobEnemySoldier : public FindBob { - FindBobEnemySoldier(Player * _player) : player(_player) {} + FindBobEnemySoldier(Player * init_player) : player(init_player) {} bool accept(Bob *) const override; === modified file 'src/logic/findimmovable.h' --- src/logic/findimmovable.h 2015-11-29 09:43:15 +0000 +++ src/logic/findimmovable.h 2016-02-15 22:33:49 +0000 @@ -47,7 +47,7 @@ }; template<typename T> struct Capsule : public BaseCapsule { - Capsule(const T & _op) : op(_op) {} + Capsule(const T & init_op) : op(init_op) {} bool accept(const BaseImmovable & imm) const override {return op.accept(imm);} const T op; @@ -115,7 +115,7 @@ bool accept(const BaseImmovable &) const; }; struct FindImmovablePlayerMilitarySite { - FindImmovablePlayerMilitarySite(const Player & _player) : player(_player) {} + FindImmovablePlayerMilitarySite(const Player & init_player) : player(init_player) {} bool accept(const BaseImmovable &) const; @@ -127,7 +127,7 @@ bool accept(const BaseImmovable &) const; }; struct FindImmovableByDescr { - FindImmovableByDescr(const ImmovableDescr & _descr) : descr(_descr) {} + FindImmovableByDescr(const ImmovableDescr & init_descr) : descr(init_descr) {} bool accept(const BaseImmovable &) const; === modified file 'src/logic/findnode.cc' --- src/logic/findnode.cc 2016-01-18 05:12:51 +0000 +++ src/logic/findnode.cc 2016-02-15 22:33:49 +0000 @@ -27,8 +27,8 @@ namespace Widelands { -FindNodeAnd::Subfunctor::Subfunctor(const FindNode & _ff, bool const _negate) - : negate(_negate), findfield(_ff) +FindNodeAnd::Subfunctor::Subfunctor(const FindNode& init_findfield, bool const init_negate) + : negate(init_negate), findfield(init_findfield) {} void FindNodeAnd::add(const FindNode & findfield, bool const negate) === modified file 'src/logic/findnode.h' --- src/logic/findnode.h 2014-07-05 16:41:51 +0000 +++ src/logic/findnode.h 2016-02-15 22:33:49 +0000 @@ -46,7 +46,7 @@ }; template<typename T> struct Capsule : public BaseCapsule { - Capsule(const T & _op) : op(_op) {} + Capsule(const T & init_op) : op(init_op) {} bool accept(const Map & map, const FCoords & coord) const override { return op.accept(map, coord); } @@ -105,7 +105,7 @@ bool negate; FindNode findfield; - Subfunctor(const FindNode &, bool _negate); + Subfunctor(const FindNode &, bool init_negate); }; std::vector<Subfunctor> m_subfunctors; === modified file 'src/logic/map.cc' --- src/logic/map.cc 2016-02-08 20:45:24 +0000 +++ src/logic/map.cc 2016-02-15 22:33:49 +0000 @@ -574,8 +574,8 @@ } NodeCaps Map::get_max_nodecaps(const World& world, const FCoords& fc) { - NodeCaps caps = _calc_nodecaps_pass1(world, fc, false); - caps = _calc_nodecaps_pass2(world, fc, false, caps); + NodeCaps caps = calc_nodecaps_pass1(world, fc, false); + caps = calc_nodecaps_pass2(world, fc, false, caps); return caps; } @@ -1003,10 +1003,10 @@ =============== */ void Map::recalc_nodecaps_pass1(const World& world, FCoords const f) { - f.field->caps = _calc_nodecaps_pass1(world, f, true); + f.field->caps = calc_nodecaps_pass1(world, f, true); } -NodeCaps Map::_calc_nodecaps_pass1(const World& world, FCoords const f, bool consider_mobs) { +NodeCaps Map::calc_nodecaps_pass1(const World& world, FCoords const f, bool consider_mobs) { uint8_t caps = CAPS_NONE; // 1a) Get all the neighbours to make life easier @@ -1116,10 +1116,10 @@ =============== */ void Map::recalc_nodecaps_pass2(const World& world, const FCoords & f) { - f.field->caps = _calc_nodecaps_pass2(world, f, true); + f.field->caps = calc_nodecaps_pass2(world, f, true); } -NodeCaps Map::_calc_nodecaps_pass2 +NodeCaps Map::calc_nodecaps_pass2 (const World& world, FCoords const f, bool consider_mobs, NodeCaps initcaps) { uint8_t caps = consider_mobs ? f.field->caps : static_cast<uint8_t>(initcaps); @@ -1136,7 +1136,7 @@ (!br.field->get_immovable() || br.field->get_immovable()->descr().type() != MapObjectType::FLAG)) return static_cast<NodeCaps>(caps); } else { - if (!(_calc_nodecaps_pass1(world, br, false) & BUILDCAPS_FLAG)) + if (!(calc_nodecaps_pass1(world, br, false) & BUILDCAPS_FLAG)) return static_cast<NodeCaps>(caps); } === modified file 'src/logic/map.h' --- src/logic/map.h 2016-02-12 08:01:36 +0000 +++ src/logic/map.h 2016-02-15 22:33:49 +0000 @@ -475,8 +475,8 @@ void recalc_brightness(FCoords); void recalc_nodecaps_pass1(const World& world, FCoords); void recalc_nodecaps_pass2(const World& world, const FCoords & f); - NodeCaps _calc_nodecaps_pass1(const World& world, FCoords, bool consider_mobs = true); - NodeCaps _calc_nodecaps_pass2(const World& world, + NodeCaps calc_nodecaps_pass1(const World& world, FCoords, bool consider_mobs = true); + NodeCaps calc_nodecaps_pass2(const World& world, FCoords, bool consider_mobs = true, NodeCaps initcaps = CAPS_NONE); === modified file 'src/logic/map_objects/bob.cc' --- src/logic/map_objects/bob.cc 2016-02-07 09:30:20 +0000 +++ src/logic/map_objects/bob.cc 2016-02-15 22:33:49 +0000 @@ -93,8 +93,8 @@ } -Bob::Bob(const BobDescr & _descr) : -MapObject (&_descr), +Bob::Bob(const BobDescr & init_descr) : +MapObject (&init_descr), owner_ (nullptr), position_ (FCoords(Coords(0, 0), nullptr)), // not linked anywhere linknext_ (nullptr), === modified file 'src/logic/map_objects/checkstep.h' --- src/logic/map_objects/checkstep.h 2016-02-07 09:30:20 +0000 +++ src/logic/map_objects/checkstep.h 2016-02-15 22:33:49 +0000 @@ -52,7 +52,7 @@ }; template<typename T> struct Capsule : public BaseCapsule { - Capsule(const T & _op) : op(_op) {} + Capsule(const T & init_op) : op(init_op) {} bool allowed (Map & map, const FCoords & start, const FCoords & end, === modified file 'src/logic/map_objects/immovable_program.h' --- src/logic/map_objects/immovable_program.h 2016-02-07 09:30:20 +0000 +++ src/logic/map_objects/immovable_program.h 2016-02-15 22:33:49 +0000 @@ -173,8 +173,8 @@ }; /// Create a program with a single action. - ImmovableProgram(char const * const _name, Action * const action) - : name_(_name) + ImmovableProgram(char const * const init_name, Action * const action) + : name_(init_name) { actions_.push_back(action); } === modified file 'src/logic/map_objects/map_object.h' --- src/logic/map_objects/map_object.h 2016-02-07 09:30:20 +0000 +++ src/logic/map_objects/map_object.h 2016-02-15 22:33:49 +0000 @@ -465,7 +465,7 @@ bool is_set() const {return serial_;} // TODO(unknown): dammit... without an EditorGameBase object, we can't implement a - // MapObject* operator (would be _really_ nice) + // MapObject* operator (would be really nice) MapObject * get(const EditorGameBase &); MapObject * get(const EditorGameBase & egbase) const; === modified file 'src/logic/map_objects/tribes/battle.h' --- src/logic/map_objects/tribes/battle.h 2016-02-08 17:25:17 +0000 +++ src/logic/map_objects/tribes/battle.h 2016-02-15 22:33:49 +0000 @@ -26,8 +26,8 @@ class BattleDescr : public MapObjectDescr { public: - BattleDescr(char const* const _name, char const* const _descname) - : MapObjectDescr(MapObjectType::BATTLE, _name, _descname) { + BattleDescr(char const* const init_name, char const* const init_descname) + : MapObjectDescr(MapObjectType::BATTLE, init_name, init_descname) { } ~BattleDescr() override { } === modified file 'src/logic/map_objects/tribes/building.cc' --- src/logic/map_objects/tribes/building.cc 2016-02-13 12:15:29 +0000 +++ src/logic/map_objects/tribes/building.cc 2016-02-15 22:33:49 +0000 @@ -55,10 +55,10 @@ static const int32_t BUILDING_LEAVE_INTERVAL = 1000; BuildingDescr::BuildingDescr - (const std::string& init_descname, const MapObjectType _type, + (const std::string& init_descname, const MapObjectType init_type, const LuaTable& table, const EditorGameBase& egbase) : - MapObjectDescr(_type, table.get_string("name"), init_descname, table), + MapObjectDescr(init_type, table.get_string("name"), init_descname, table), egbase_ (egbase), buildable_ (false), size_ (BaseImmovable::SMALL), @@ -80,7 +80,7 @@ i18n::Textdomain td("tribes"); // Partially finished buildings get their sizes from their associated building - if (_type != MapObjectType::CONSTRUCTIONSITE && _type != MapObjectType::DISMANTLESITE) { + if (type() != MapObjectType::CONSTRUCTIONSITE && type() != MapObjectType::DISMANTLESITE) { try { const std::string size = table.get_string("size"); if (boost::iequals(size, "small")) { === modified file 'src/logic/map_objects/tribes/production_program.cc' --- src/logic/map_objects/tribes/production_program.cc 2016-02-13 12:15:29 +0000 +++ src/logic/map_objects/tribes/production_program.cc 2016-02-15 22:33:49 +0000 @@ -1722,19 +1722,19 @@ } -ProductionProgram::ProductionProgram(const std::string& _name, - const std::string& _descname, +ProductionProgram::ProductionProgram(const std::string& init_name, + const std::string& init_descname, std::unique_ptr<LuaTable> actions_table, const EditorGameBase& egbase, ProductionSiteDescr* building) - : name_(_name), descname_(_descname) { + : name_(init_name), descname_(init_descname) { for (const std::string& action_string : actions_table->array_entries<std::string>()) { std::vector<std::string> parts; boost::split(parts, action_string, boost::is_any_of("=")); if (parts.size() != 2) { throw GameDataError("invalid line: \"%s\" in production program \"%s\" for building \"%s\"", - action_string.c_str(), _name.c_str(), building->name().c_str()); + action_string.c_str(), name().c_str(), building->name().c_str()); } std::unique_ptr<char []> arguments(new char[parts[1].size() + 1]); strncpy(arguments.get(), parts[1].c_str(), parts[1].size() + 1); @@ -1762,10 +1762,10 @@ new ActRecruit(arguments.get(), *building, egbase.tribes()))); } else if (boost::iequals(parts[0], "worker")) { actions_.push_back(std::unique_ptr<ProductionProgram::Action>( - new ActWorker(arguments.get(), _name, building, egbase.tribes()))); + new ActWorker(arguments.get(), name(), building, egbase.tribes()))); } else if (boost::iequals(parts[0], "mine")) { actions_.push_back(std::unique_ptr<ProductionProgram::Action>( - new ActMine(arguments.get(), egbase.world(), _name, building))); + new ActMine(arguments.get(), egbase.world(), name(), building))); } else if (boost::iequals(parts[0], "check_soldier")) { actions_.push_back(std::unique_ptr<ProductionProgram::Action>( new ActCheckSoldier(arguments.get()))); @@ -1777,13 +1777,13 @@ new ActPlayFX(arguments.get()))); } else if (boost::iequals(parts[0], "construct")) { actions_.push_back(std::unique_ptr<ProductionProgram::Action>( - new ActConstruct(arguments.get(), _name, building))); + new ActConstruct(arguments.get(), name(), building))); } else if (boost::iequals(parts[0], "check_map")) { actions_.push_back(std::unique_ptr<ProductionProgram::Action>( new ActCheckMap(arguments.get()))); } else { throw GameDataError("unknown command type \"%s\" in production program \"%s\" for building \"%s\"", - arguments.get(), _name.c_str(), building->name().c_str()); + arguments.get(), name().c_str(), building->name().c_str()); } const ProductionProgram::Action& action = *actions_.back().get(); @@ -1809,7 +1809,7 @@ } if (actions_.empty()) throw GameDataError("no actions in production program \"%s\" for building \"%s\"", - _name.c_str(), building->name().c_str()); + name().c_str(), building->name().c_str()); } const std::string & ProductionProgram::name() const {return name_;} === modified file 'src/logic/map_objects/tribes/production_program.h' --- src/logic/map_objects/tribes/production_program.h 2016-02-08 20:52:24 +0000 +++ src/logic/map_objects/tribes/production_program.h 2016-02-15 22:33:49 +0000 @@ -510,8 +510,8 @@ uint32_t radius; }; - ProductionProgram(const std::string& _name, - const std::string& _descname, + ProductionProgram(const std::string& init_name, + const std::string& init_descname, std::unique_ptr<LuaTable> actions_table, const EditorGameBase& egbase, ProductionSiteDescr* building); === modified file 'src/logic/map_objects/tribes/productionsite.cc' --- src/logic/map_objects/tribes/productionsite.cc 2016-02-13 12:15:29 +0000 +++ src/logic/map_objects/tribes/productionsite.cc 2016-02-15 22:33:49 +0000 @@ -55,9 +55,9 @@ */ ProductionSiteDescr::ProductionSiteDescr - (const std::string& init_descname, const std::string& msgctxt, MapObjectType _type, + (const std::string& init_descname, const std::string& msgctxt, MapObjectType init_type, const LuaTable& table, const EditorGameBase& egbase) - : BuildingDescr(init_descname, _type, table, egbase), + : BuildingDescr(init_descname, init_type, table, egbase), out_of_resource_title_(""), out_of_resource_heading_(""), out_of_resource_message_(""), === modified file 'src/logic/map_objects/tribes/requirements.cc' --- src/logic/map_objects/tribes/requirements.cc 2016-02-08 20:52:24 +0000 +++ src/logic/map_objects/tribes/requirements.cc 2016-02-15 22:33:49 +0000 @@ -67,16 +67,16 @@ } RequirementsStorage::RequirementsStorage - (uint32_t const _id, Reader const reader) - : id_(_id), reader_(reader) + (uint32_t const init_id, Reader const init_reader) + : id_(init_id), reader_(init_reader) { StorageMap & s = storageMap(); - assert(0 < _id); - assert (_id < 65535); - assert(s.find(_id) == s.end()); + assert(0 < init_id); + assert (init_id < 65535); + assert(s.find(init_id) == s.end()); - s.insert(std::make_pair(_id, this)); + s.insert(std::make_pair(init_id, this)); } uint32_t RequirementsStorage::id() const === modified file 'src/logic/map_objects/tribes/requirements.h' --- src/logic/map_objects/tribes/requirements.h 2016-02-08 20:52:24 +0000 +++ src/logic/map_objects/tribes/requirements.h 2016-02-15 22:33:49 +0000 @@ -60,7 +60,7 @@ template<typename T> struct Capsule : public BaseCapsule { - Capsule(const T & _m) : m(_m) {} + Capsule(const T & init_m) : m(init_m) {} bool check(const MapObject & obj) const override {return m.check(obj);} @@ -116,7 +116,7 @@ Requirements (*) (FileRead &, EditorGameBase &, MapObjectLoader &); - RequirementsStorage(uint32_t _id, Reader reader); + RequirementsStorage(uint32_t id, Reader reader); uint32_t id() const; static Requirements read @@ -173,8 +173,8 @@ */ struct RequireAttribute { RequireAttribute - (TrainingAttribute const _at, int32_t const _min, int32_t const _max) - : at(_at), min(_min), max(_max) {} + (TrainingAttribute const init_at, int32_t const init_min, int32_t const init_max) + : at(init_at), min(init_min), max(init_max) {} RequireAttribute() : at(atrTotal), min(SHRT_MIN), max(SHRT_MAX) {} bool check(const MapObject &) const; === modified file 'src/logic/map_objects/tribes/soldier.cc' --- src/logic/map_objects/tribes/soldier.cc 2016-02-07 09:30:20 +0000 +++ src/logic/map_objects/tribes/soldier.cc 2016-02-15 22:33:49 +0000 @@ -994,13 +994,13 @@ /** * Accept Bob when is a Soldier alive that is attacking the Player. * - * \param _game - * \param _player + * \param g + * \param p */ struct FindBobSoldierAttackingPlayer : public FindBob { - FindBobSoldierAttackingPlayer(Game & _game, Player & _player) : - player(_player), - game(_game) {} + FindBobSoldierAttackingPlayer(Game& g, Player& p) : + player(p), + game(g) {} bool accept(Bob * const bob) const override { === modified file 'src/logic/map_objects/tribes/warehouse.cc' --- src/logic/map_objects/tribes/warehouse.cc 2016-02-13 12:15:29 +0000 +++ src/logic/map_objects/tribes/warehouse.cc 2016-02-15 22:33:49 +0000 @@ -291,7 +291,7 @@ * Try to bring the given \ref PlannedWorkers up to date with our game data. * Return \c false if \p pw cannot be salvaged. */ -bool Warehouse::_load_finish_planned_worker(PlannedWorkers & pw) +bool Warehouse::load_finish_planned_worker(PlannedWorkers & pw) { const TribeDescr& tribe = owner().tribe(); @@ -351,7 +351,7 @@ } log - ("_load_finish_planned_worker: old savegame: " + ("load_finish_planned_worker: old savegame: " "need to create new request for '%s'\n", cost_it->first.c_str()); pw.requests.insert @@ -361,7 +361,7 @@ while (pw.requests.size() > idx) { log - ("_load_finish_planned_worker: old savegame: " + ("load_finish_planned_worker: old savegame: " "removing outdated request.\n"); delete pw.requests.back(); pw.requests.pop_back(); @@ -401,7 +401,7 @@ { uint32_t pwidx = 0; while (pwidx < planned_workers_.size()) { - if (!_load_finish_planned_worker(planned_workers_[pwidx])) { + if (!load_finish_planned_worker(planned_workers_[pwidx])) { planned_workers_[pwidx].cleanup(); planned_workers_.erase(planned_workers_.begin() + pwidx); } else { @@ -719,7 +719,7 @@ // check because whether we suddenly can produce a requested worker. This // is mostly previously available wares may become unavailable due to // secondary requests. - _update_all_planned_workers(game); + update_all_planned_workers(game); Building::act(game, data); } @@ -1020,7 +1020,7 @@ // This ware may be used to build planned workers, // so it seems like a good idea to update the associated requests // and use the ware before it is sent away again. - wh._update_all_planned_workers(game); + wh.update_all_planned_workers(game); } } @@ -1106,7 +1106,7 @@ // Update PlannedWorkers::amount here if appropriate, because this function // may have been called directly by the Economy. // Do not update anything else about PlannedWorkers here, because this - // function is called by _update_planned_workers, so avoid recursion + // function is called by update_planned_workers, so avoid recursion for (PlannedWorkers& planned_worker : planned_workers_) { if (planned_worker.index == worker && planned_worker.amount) planned_worker.amount--; @@ -1149,7 +1149,7 @@ available.push_back(get_workers().stock(id_w)); } else throw wexception - ("Economy::_create_requested_worker: buildcost inconsistency '%s'", + ("Economy::create_requested_worker: buildcost inconsistency '%s'", input_name.c_str()); } } @@ -1215,14 +1215,14 @@ } pw->amount = amount; - _update_planned_workers(game, *pw); + update_planned_workers(game, *pw); } /** * See if we can create the workers of the given plan, * and update requests accordingly. */ -void Warehouse::_update_planned_workers +void Warehouse::update_planned_workers (Game & game, Warehouse::PlannedWorkers & pw) { const WorkerDescr & w_desc = *owner().tribe().get_worker_descr(pw.index); @@ -1246,7 +1246,7 @@ supply = supply_->stock_workers(id_w); } else throw wexception - ("_update_planned_workers: bad buildcost '%s'", input_name.c_str()); + ("update_planned_workers: bad buildcost '%s'", input_name.c_str()); } if (supply >= pw.amount * buildcost.second) pw.requests[idx]->set_count(0); @@ -1268,11 +1268,11 @@ * Needs to be called periodically, because some necessary supplies might arrive * due to idle transfers instead of by explicit request. */ -void Warehouse::_update_all_planned_workers(Game & game) +void Warehouse::update_all_planned_workers(Game & game) { uint32_t idx = 0; while (idx < planned_workers_.size()) { - _update_planned_workers(game, planned_workers_[idx]); + update_planned_workers(game, planned_workers_[idx]); if (!planned_workers_[idx].amount) { planned_workers_[idx].cleanup(); === modified file 'src/logic/map_objects/tribes/warehouse.h' --- src/logic/map_objects/tribes/warehouse.h 2016-02-09 07:42:38 +0000 +++ src/logic/map_objects/tribes/warehouse.h 2016-02-15 22:33:49 +0000 @@ -252,9 +252,9 @@ (Game &, Request &, DescriptionIndex, Worker *, PlayerImmovable &); void check_remove_stock(Game &); - bool _load_finish_planned_worker(PlannedWorkers & pw); - void _update_planned_workers(Game &, PlannedWorkers & pw); - void _update_all_planned_workers(Game &); + bool load_finish_planned_worker(PlannedWorkers & pw); + void update_planned_workers(Game &, PlannedWorkers & pw); + void update_all_planned_workers(Game &); WarehouseSupply * supply_; === modified file 'src/logic/map_objects/world/terrain_description.cc' --- src/logic/map_objects/world/terrain_description.cc 2016-02-10 19:50:13 +0000 +++ src/logic/map_objects/world/terrain_description.cc 2016-02-15 22:33:49 +0000 @@ -64,7 +64,7 @@ } // namespace -TerrainDescription::Type::Type(TerrainDescription::Is _is) : is(_is) { +TerrainDescription::Type::Type(TerrainDescription::Is init_is) : is(init_is) { switch (is) { case Is::kArable: /** TRANSLATORS: This is a terrain type tooltip in the editor */ === modified file 'src/logic/map_objects/world/terrain_description.h' --- src/logic/map_objects/world/terrain_description.h 2016-02-10 19:50:13 +0000 +++ src/logic/map_objects/world/terrain_description.h 2016-02-15 22:33:49 +0000 @@ -53,7 +53,7 @@ }; struct Type { - Type(TerrainDescription::Is _is); + Type(TerrainDescription::Is init_is); TerrainDescription::Is is; const char* descname; === modified file 'src/logic/message_id.h' --- src/logic/message_id.h 2014-09-19 12:54:54 +0000 +++ src/logic/message_id.h 2016-02-15 22:33:49 +0000 @@ -38,7 +38,7 @@ /// MapMessageSaver does that. struct MessageId { MessageId() : id(0) {} - explicit MessageId(uint32_t const _id) : id(_id) {} + explicit MessageId(uint32_t const init_id) : id(init_id) {} /// Constant value for no message. static MessageId null() {MessageId result; result.id = 0; return result;} === modified file 'src/logic/player.cc' --- src/logic/player.cc 2016-02-13 11:25:41 +0000 +++ src/logic/player.cc 2016-02-15 22:33:49 +0000 @@ -609,23 +609,23 @@ Bulldoze the given road, flag or building. =============== */ -void Player::bulldoze(PlayerImmovable & _imm, bool const recurse) +void Player::bulldoze(PlayerImmovable & imm, bool const recurse) { std::vector<OPtr<PlayerImmovable> > bulldozelist; - bulldozelist.push_back(&_imm); + bulldozelist.push_back(&imm); while (!bulldozelist.empty()) { - PlayerImmovable * imm = bulldozelist.back().get(egbase()); + PlayerImmovable * immovable = bulldozelist.back().get(egbase()); bulldozelist.pop_back(); - if (!imm) + if (!immovable) continue; // General security check - if (imm->get_owner() != this) + if (immovable->get_owner() != this) return; // Destroy, after extended security check - if (upcast(Building, building, imm)) { + if (upcast(Building, building, immovable)) { if (!(building->get_playercaps() & Building::PCap_Bulldoze)) return; @@ -635,7 +635,7 @@ if (recurse && flag.is_dead_end()) bulldozelist.push_back(&flag); - } else if (upcast(Flag, flag, imm)) { + } else if (upcast(Flag, flag, immovable)) { if (Building * const flagbuilding = flag->get_building()) if (!(flagbuilding->get_playercaps() & Building::PCap_Bulldoze)) { log @@ -677,7 +677,7 @@ // Recursive bulldoze calls may cause flag to disappear if (flagcopy.get(egbase())) flag->destroy(egbase()); - } else if (upcast(Road, road, imm)) { + } else if (upcast(Road, road, immovable)) { Flag & start = road->get_flag(Road::FlagStart); Flag & end = road->get_flag(Road::FlagEnd); @@ -700,7 +700,7 @@ } } else throw wexception - ("Player::bulldoze(%u): bad immovable type", imm->serial()); + ("Player::bulldoze(%u): bad immovable type", immovable->serial()); } } @@ -737,7 +737,7 @@ void Player::enhance_building (Building * building, DescriptionIndex const index_of_new_building) { - _enhance_or_dismantle(building, index_of_new_building); + enhance_or_dismantle(building, index_of_new_building); } /* @@ -745,9 +745,9 @@ * apart. */ void Player::dismantle_building(Building * building) { - _enhance_or_dismantle(building, INVALID_INDEX); + enhance_or_dismantle(building, INVALID_INDEX); } -void Player::_enhance_or_dismantle +void Player::enhance_or_dismantle (Building * building, DescriptionIndex const index_of_new_building) { if (&building->owner() == === modified file 'src/logic/player.h' --- src/logic/player.h 2016-02-13 11:25:41 +0000 +++ src/logic/player.h 2016-02-15 22:33:49 +0000 @@ -549,7 +549,7 @@ void update_building_statistics(Building &, NoteImmovable::Ownership ownership); void update_team_players(); void play_message_sound(const Message::Type & msgtype); - void _enhance_or_dismantle(Building*, DescriptionIndex index_of_new_building); + void enhance_or_dismantle(Building*, DescriptionIndex index_of_new_building); // Called when a node becomes seen or has changed. Discovers the node and // those of the 6 surrounding edges/triangles that are not seen from another === modified file 'src/logic/playercommand.cc' --- src/logic/playercommand.cc 2016-01-17 08:29:59 +0000 +++ src/logic/playercommand.cc 2016-02-15 22:33:49 +0000 @@ -1122,15 +1122,15 @@ /*** class Cmd_SetWarePriority ***/ CmdSetWarePriority::CmdSetWarePriority - (const uint32_t _duetime, const PlayerNumber _sender, + (const uint32_t init_duetime, const PlayerNumber init_sender, PlayerImmovable & imm, - const int32_t type, const DescriptionIndex index, const int32_t priority) + const int32_t init_type, const DescriptionIndex i, const int32_t init_priority) : - PlayerCommand(_duetime, _sender), + PlayerCommand(init_duetime, init_sender), m_serial (imm.serial()), - m_type (type), - m_index (index), - m_priority (priority) + m_type (init_type), + m_index (i), + m_priority (init_priority) {} void CmdSetWarePriority::execute(Game & game) @@ -1201,11 +1201,11 @@ /*** class Cmd_SetWareMaxFill ***/ CmdSetWareMaxFill::CmdSetWareMaxFill - (const uint32_t _duetime, const PlayerNumber _sender, + (const uint32_t init_duetime, const PlayerNumber init_sender, PlayerImmovable & imm, const DescriptionIndex index, const uint32_t max_fill) : - PlayerCommand(_duetime, _sender), + PlayerCommand(init_duetime, init_sender), m_serial (imm.serial()), m_index (index), m_max_fill (max_fill) @@ -1274,11 +1274,11 @@ CmdChangeTargetQuantity::CmdChangeTargetQuantity - (const uint32_t _duetime, const PlayerNumber _sender, - const uint32_t _economy, const DescriptionIndex _ware_type) + (const uint32_t init_duetime, const PlayerNumber init_sender, + const uint32_t init_economy, const DescriptionIndex init_ware_type) : - PlayerCommand(_duetime, _sender), - m_economy (_economy), m_ware_type(_ware_type) + PlayerCommand(init_duetime, init_sender), + m_economy (init_economy), m_ware_type(init_ware_type) {} void CmdChangeTargetQuantity::write @@ -1319,13 +1319,13 @@ CmdSetWareTargetQuantity::CmdSetWareTargetQuantity - (const uint32_t _duetime, const PlayerNumber _sender, - const uint32_t _economy, - const DescriptionIndex _ware_type, - const uint32_t _permanent) + (const uint32_t init_duetime, const PlayerNumber init_sender, + const uint32_t init_economy, + const DescriptionIndex init_ware_type, + const uint32_t init_permanent) : - CmdChangeTargetQuantity(_duetime, _sender, _economy, _ware_type), - m_permanent(_permanent) + CmdChangeTargetQuantity(init_duetime, init_sender, init_economy, init_ware_type), + m_permanent(init_permanent) {} void CmdSetWareTargetQuantity::execute(Game & game) @@ -1381,11 +1381,11 @@ CmdResetWareTargetQuantity::CmdResetWareTargetQuantity - (const uint32_t _duetime, const PlayerNumber _sender, - const uint32_t _economy, - const DescriptionIndex _ware_type) + (const uint32_t init_duetime, const PlayerNumber init_sender, + const uint32_t init_economy, + const DescriptionIndex init_ware_type) : - CmdChangeTargetQuantity(_duetime, _sender, _economy, _ware_type) + CmdChangeTargetQuantity(init_duetime, init_sender, init_economy, init_ware_type) {} void CmdResetWareTargetQuantity::execute(Game & game) @@ -1437,13 +1437,13 @@ CmdSetWorkerTargetQuantity::CmdSetWorkerTargetQuantity - (const uint32_t _duetime, const PlayerNumber _sender, - const uint32_t _economy, - const DescriptionIndex _ware_type, - const uint32_t _permanent) + (const uint32_t init_duetime, const PlayerNumber init_sender, + const uint32_t init_economy, + const DescriptionIndex init_ware_type, + const uint32_t init_permanent) : - CmdChangeTargetQuantity(_duetime, _sender, _economy, _ware_type), - m_permanent(_permanent) + CmdChangeTargetQuantity(init_duetime, init_sender, init_economy, init_ware_type), + m_permanent(init_permanent) {} void CmdSetWorkerTargetQuantity::execute(Game & game) @@ -1499,11 +1499,11 @@ CmdResetWorkerTargetQuantity::CmdResetWorkerTargetQuantity - (const uint32_t _duetime, const PlayerNumber _sender, - const uint32_t _economy, - const DescriptionIndex _ware_type) + (const uint32_t init_duetime, const PlayerNumber init_sender, + const uint32_t init_economy, + const DescriptionIndex init_ware_type) : - CmdChangeTargetQuantity(_duetime, _sender, _economy, _ware_type) + CmdChangeTargetQuantity(init_duetime, init_sender, init_economy, init_ware_type) {} void CmdResetWorkerTargetQuantity::execute(Game & game) === modified file 'src/logic/playercommand.h' --- src/logic/playercommand.h 2015-12-04 18:27:36 +0000 +++ src/logic/playercommand.h 2016-02-15 22:33:49 +0000 @@ -70,8 +70,8 @@ CmdBulldoze (const uint32_t t, const int32_t p, PlayerImmovable & pi, - const bool _recurse = false) - : PlayerCommand(t, p), serial(pi.serial()), recurse(_recurse) + const bool init_recurse = false) + : PlayerCommand(t, p), serial(pi.serial()), recurse(init_recurse) {} CmdBulldoze (StreamRead &); @@ -92,11 +92,11 @@ struct CmdBuild:public PlayerCommand { CmdBuild() : PlayerCommand() {} // For savegame loading CmdBuild - (const uint32_t _duetime, + (const uint32_t init_duetime, const int32_t p, const Coords c, const DescriptionIndex i) - : PlayerCommand(_duetime, p), coords(c), bi(i) + : PlayerCommand(init_duetime, p), coords(c), bi(i) {} CmdBuild (StreamRead &); @@ -241,11 +241,11 @@ struct CmdEnhanceBuilding:public PlayerCommand { CmdEnhanceBuilding() : PlayerCommand(), serial(0) {} // For savegame loading CmdEnhanceBuilding - (const uint32_t _duetime, + (const uint32_t init_duetime, const int32_t p, Building & b, const DescriptionIndex i) - : PlayerCommand(_duetime, p), serial(b.serial()), bi(i) + : PlayerCommand(init_duetime, p), serial(b.serial()), bi(i) {} // Write these commands to a file (for savegames) @@ -612,8 +612,8 @@ (const uint32_t t, const int32_t p, Building & b, - const int32_t _soldier) - : PlayerCommand(t, p), serial(b.serial()), soldier(_soldier) + const int32_t init_soldier) + : PlayerCommand(t, p), serial(b.serial()), soldier(init_soldier) {} // Write these commands to a file (for savegames) === modified file 'src/logic/replay.cc' --- src/logic/replay.cc 2016-02-06 15:58:10 +0000 +++ src/logic/replay.cc 2016-02-15 22:33:49 +0000 @@ -48,8 +48,8 @@ class CmdReplaySyncRead : public Command { public: - CmdReplaySyncRead(const uint32_t _duetime, const Md5Checksum & hash) - : Command(_duetime), m_hash(hash) + CmdReplaySyncRead(const uint32_t init_duetime, const Md5Checksum & hash) + : Command(init_duetime), m_hash(hash) {} QueueCommandTypes id() const override {return QueueCommandTypes::kReplaySyncRead;} @@ -201,7 +201,7 @@ */ class CmdReplaySyncWrite : public Command { public: - CmdReplaySyncWrite(const uint32_t _duetime) : Command(_duetime) {} + CmdReplaySyncWrite(const uint32_t init_duetime) : Command(init_duetime) {} QueueCommandTypes id() const override {return QueueCommandTypes::kReplaySyncWrite;} === modified file 'src/logic/replay_game_controller.h' --- src/logic/replay_game_controller.h 2015-11-27 12:46:45 +0000 +++ src/logic/replay_game_controller.h 2016-02-15 22:33:49 +0000 @@ -46,7 +46,7 @@ private: struct CmdReplayEnd : public Widelands::Command { - CmdReplayEnd (uint32_t const _duetime) : Widelands::Command(_duetime) {} + CmdReplayEnd (uint32_t const init_duetime) : Widelands::Command(init_duetime) {} virtual void execute (Widelands::Game & game); virtual Widelands::QueueCommandTypes id() const; }; === modified file 'src/map_io/map_roaddata_packet.cc' --- src/map_io/map_roaddata_packet.cc 2016-02-07 06:10:47 +0000 +++ src/map_io/map_roaddata_packet.cc 2016-02-15 22:33:49 +0000 @@ -111,11 +111,11 @@ static_cast<long unsigned int>(nr_steps - i), e.what()); } - road._set_path(egbase, p); + road.set_path(egbase, p); // Now that all rudimentary data is set, init this road. Then // overwrite the initialization values. - road._link_into_flags(game); + road.link_into_flags(game); road.idle_index_ = fr.unsigned_32(); @@ -143,7 +143,7 @@ new Request (road, 0, - Road::_request_carrier_callback, + Road::request_carrier_callback, wwWORKER)) ->read(fr, game, mol); } else { === modified file 'src/map_io/widelands_map_loader.cc' --- src/map_io/widelands_map_loader.cc 2016-02-10 20:55:54 +0000 +++ src/map_io/widelands_map_loader.cc 2016-02-15 22:33:49 +0000 @@ -72,7 +72,7 @@ /** * Preloads a map so that the map class returns valid data for all it's - * get_info() functions (_width, _nrplayers..) + * get_info() functions (width, nrplayers..) */ int32_t WidelandsMapLoader::preload_map(bool const scenario) { assert(get_state() != STATE_LOADED); === modified file 'src/network/nethost.cc' --- src/network/nethost.cc 2016-02-15 18:40:58 +0000 +++ src/network/nethost.cc 2016-02-15 22:33:49 +0000 @@ -66,7 +66,7 @@ struct HostGameSettingsProvider : public GameSettingsProvider { - HostGameSettingsProvider(NetHost * const _h) : h(_h), m_cur_wincondition(0) {} + HostGameSettingsProvider(NetHost * const init_host) : h(init_host), m_cur_wincondition(0) {} ~HostGameSettingsProvider() {} void set_scenario(bool is_scenario) override {h->set_scenario(is_scenario);} @@ -307,7 +307,7 @@ }; struct HostChatProvider : public ChatProvider { - HostChatProvider(NetHost * const _h) : h(_h), kickClient(0) {} + HostChatProvider(NetHost * const init_host) : h(init_host), kickClient(0) {} void send(const std::string& msg) override { ChatMessage c; === modified file 'src/scripting/lua_ui.cc' --- src/scripting/lua_ui.cc 2016-02-12 16:58:41 +0000 +++ src/scripting/lua_ui.cc 2016-02-15 22:33:49 +0000 @@ -104,14 +104,14 @@ (RO) An :class:`array` of all visible buttons inside this Panel. */ -static void _put_all_visible_buttons_into_table +static void put_all_visible_buttons_into_table (lua_State * L, UI::Panel * g) { if (!g) return; for (UI::Panel * f = g->get_first_child(); f; f = f->get_next_sibling()) { - _put_all_visible_buttons_into_table(L, f); + put_all_visible_buttons_into_table(L, f); if (upcast(UI::Button, b, f)) if (b->is_visible()) { @@ -125,7 +125,7 @@ assert(panel_); lua_newtable(L); - _put_all_visible_buttons_into_table(L, panel_); + put_all_visible_buttons_into_table(L, panel_); return 1; } @@ -135,14 +135,14 @@ (RO) An :class:`array` of all visible tabs inside this Panel. */ -static void _put_all_tabs_into_table +static void put_all_tabs_into_table (lua_State * L, UI::Panel * g) { if (!g) return; for (UI::Panel * f = g->get_first_child(); f; f = f->get_next_sibling()) { - _put_all_tabs_into_table(L, f); + put_all_tabs_into_table(L, f); if (upcast(UI::TabPanel, t, f)) for (UI::Tab* tab : t->tabs()) { @@ -156,7 +156,7 @@ assert(panel_); lua_newtable(L); - _put_all_tabs_into_table(L, panel_); + put_all_tabs_into_table(L, panel_); return 1; } @@ -168,14 +168,14 @@ (RO) A :class:`array` of all currently open windows that are children of this Panel. */ -static void _put_all_visible_windows_into_table +static void put_all_visible_windows_into_table (lua_State * L, UI::Panel * g) { if (!g) return; for (UI::Panel * f = g->get_first_child(); f; f = f->get_next_sibling()) { - _put_all_visible_windows_into_table(L, f); + put_all_visible_windows_into_table(L, f); if (upcast(UI::Window, win, f)) { lua_pushstring(L, win->get_name()); @@ -188,7 +188,7 @@ assert(panel_); lua_newtable(L); - _put_all_visible_windows_into_table(L, panel_); + put_all_visible_windows_into_table(L, panel_); return 1; } === modified file 'src/ui_basic/button.cc' --- src/ui_basic/button.cc 2016-02-09 18:24:03 +0000 +++ src/ui_basic/button.cc 2016-02-15 22:33:49 +0000 @@ -39,13 +39,13 @@ const Image* bg_pic, const std::string & title_text, const std::string & tooltip_text, - bool const _enabled, bool const flat) + bool const init_enabled, bool const flat) : NamedPanel (parent, name, x, y, w, h, tooltip_text), highlighted_ (false), pressed_ (false), permpressed_ (false), - enabled_ (_enabled), + enabled_ (init_enabled), repeating_ (false), flat_ (flat), draw_flat_background_(false), @@ -71,13 +71,13 @@ const Image* bg_pic, const Image* fg_pic, const std::string & tooltip_text, - bool const _enabled, bool const flat, const bool keep_image_size) + bool const init_enabled, bool const flat, const bool keep_image_size) : NamedPanel (parent, name, x, y, w, h, tooltip_text), highlighted_ (false), pressed_ (false), permpressed_ (false), - enabled_ (_enabled), + enabled_ (init_enabled), repeating_ (false), flat_ (flat), keep_image_size_(keep_image_size), === modified file 'src/ui_basic/button.h' --- src/ui_basic/button.h 2016-02-03 18:09:15 +0000 +++ src/ui_basic/button.h 2016-02-15 22:33:49 +0000 @@ -43,7 +43,7 @@ const Image* background_picture_id, const std::string & title_text, const std::string & tooltip_text = std::string(), - bool const _enabled = true, + bool const enabled = true, bool const flat = false); // TODO(GunChleoc): We have a lot of bools here. Introduce an enum class. Button /// for pictorial buttons @@ -53,7 +53,7 @@ const Image* background_picture_id, const Image* foreground_picture_id, const std::string & tooltip_text = std::string(), - bool const _enabled = true, + bool const enabled = true, bool const flat = false, bool const keep_image_size = false); ~Button(); @@ -103,7 +103,7 @@ uint32_t time_nextact_; - std::string title_; // title string used when _mypic == 0 + std::string title_; // title string used when pic_custom_ == 0 const Image* pic_background_; // background texture (picture ID) const Image* pic_custom_; // custom icon on the button === modified file 'src/ui_basic/icongrid.cc' --- src/ui_basic/icongrid.cc 2016-02-03 18:09:15 +0000 +++ src/ui_basic/icongrid.cc 2016-02-15 22:33:49 +0000 @@ -38,18 +38,18 @@ foreground_picture_id, tooltip_text, true, true), icongrid_(parent), - _callback_argument_id(callback_argument_id) + callback_argument_id_(callback_argument_id) {} private: IconGrid & icongrid_; - const uint32_t _callback_argument_id; + const uint32_t callback_argument_id_; void handle_mousein(bool inside) override { if (inside) { - icongrid_.mousein(_callback_argument_id); + icongrid_.mousein(callback_argument_id_); } else { - icongrid_.mouseout(_callback_argument_id); + icongrid_.mouseout(callback_argument_id_); } Button::handle_mousein(inside); } === modified file 'src/ui_basic/panel.cc' --- src/ui_basic/panel.cc 2016-02-14 19:34:44 +0000 +++ src/ui_basic/panel.cc 2016-02-15 22:33:49 +0000 @@ -34,16 +34,16 @@ namespace UI { -Panel * Panel::_modal = nullptr; -Panel * Panel::_g_mousegrab = nullptr; -Panel * Panel::_g_mousein = nullptr; +Panel * Panel::modal_ = nullptr; +Panel * Panel::mousegrab_ = nullptr; +Panel * Panel::mousein_ = nullptr; // The following variable can be set to false. If so, all mouse and keyboard // events are ignored and not passed on to any widget. This is only useful // for scripts that want to show off functionality without the user interfering. -bool Panel::_g_allow_user_input = true; -const Image* Panel::s_default_cursor = nullptr; -const Image* Panel::s_default_cursor_click = nullptr; +bool Panel::allow_user_input_ = true; +const Image* Panel::default_cursor_ = nullptr; +const Image* Panel::default_cursor_click_ = nullptr; /** * Initialize a panel, link it into the parent's queue. @@ -53,26 +53,26 @@ const int nx, const int ny, const int nw, const int nh, const std::string & tooltip_text) : - _parent(nparent), _fchild(nullptr), _lchild(nullptr), _mousein(nullptr), _focus(nullptr), - _flags(pf_handle_mouse|pf_thinks|pf_visible), - _x(nx), _y(ny), _w(nw), _h(nh), - _lborder(0), _rborder(0), _tborder(0), _bborder(0), - _border_snap_distance(0), _panel_snap_distance(0), - _desired_w(nw), _desired_h(nh), - _running(false), - _tooltip(tooltip_text) + parent_(nparent), first_child_(nullptr), last_child_(nullptr), mousein_child_(nullptr), focus_(nullptr), + flags_(pf_handle_mouse|pf_thinks|pf_visible), + x_(nx), y_(ny), w_(nw), h_(nh), + lborder_(0), rborder_(0), tborder_(0), bborder_(0), + border_snap_distance_(0), panel_snap_distance_(0), + desired_w_(nw), desired_h_(nh), + running_(false), + tooltip_(tooltip_text) { assert(nparent != this); - if (_parent) { - _next = _parent->_fchild; - _prev = nullptr; - if (_next) - _next->_prev = this; + if (parent_) { + next_ = parent_->first_child_; + prev_ = nullptr; + if (next_) + next_->prev_ = this; else - _parent->_lchild = this; - _parent->_fchild = this; + parent_->last_child_ = this; + parent_->first_child_ = this; } else - _prev = _next = nullptr; + prev_ = next_ = nullptr; } /** @@ -81,29 +81,29 @@ Panel::~Panel() { // Release pointers to this object - if (_g_mousegrab == this) - _g_mousegrab = nullptr; - if (_g_mousein == this) - _g_mousein = nullptr; + if (mousegrab_ == this) + mousegrab_ = nullptr; + if (mousein_ == this) + mousein_ = nullptr; // Free children free_children(); // Unlink - if (_parent) { - if (_parent->_mousein == this) - _parent->_mousein = nullptr; - if (_parent->_focus == this) - _parent->_focus = nullptr; + if (parent_) { + if (parent_->mousein_child_ == this) + parent_->mousein_child_ = nullptr; + if (parent_->focus_ == this) + parent_->focus_ = nullptr; - if (_prev) - _prev->_next = _next; - else - _parent->_fchild = _next; - if (_next) - _next->_prev = _prev; - else - _parent->_lchild = _prev; + if (prev_) + prev_->next_ = next_; + else + parent_->first_child_ = next_; + if (next_) + next_->prev_ = prev_; + else + parent_->last_child_ = prev_; } } @@ -115,7 +115,7 @@ //Scan-build claims this results in double free. //This is a false positive. //See https://bugs.launchpad.net/widelands/+bug/1198928 - while (_fchild) delete _fchild; + while (first_child_) delete first_child_; } @@ -130,20 +130,20 @@ { // TODO(sirver): the main loop should not be in UI, but in WLApplication. WLApplication * const app = WLApplication::get(); - Panel * const prevmodal = _modal; - _modal = this; - _g_mousegrab = nullptr; // good ol' paranoia + Panel * const prevmodal = modal_; + modal_ = this; + mousegrab_ = nullptr; // good ol' paranoia app->set_mouse_lock(false); // more paranoia :-) Panel * forefather = this; - while (Panel * const p = forefather->_parent) + while (Panel * const p = forefather->parent_) forefather = p; - s_default_cursor = g_gr->images().get("images/ui_basic/cursor.png"); - s_default_cursor_click = g_gr->images().get("images/ui_basic/cursor_click.png"); + default_cursor_ = g_gr->images().get("images/ui_basic/cursor.png"); + default_cursor_click_ = g_gr->images().get("images/ui_basic/cursor_click.png"); // Loop - _running = true; + running_ = true; // Panel-specific startup code. This might call end_modal()! start(); @@ -167,7 +167,7 @@ const uint32_t initial_ticks = SDL_GetTicks(); uint32_t next_think_time = initial_ticks + kGameLogicDelay; uint32_t next_draw_time = initial_ticks + draw_delay; - while (_running) { + while (running_) { const uint32_t start_time = SDL_GetTicks(); app->handle_input(&input_callback); @@ -178,7 +178,7 @@ do_think(); - if (_flags & pf_child_die) + if (flags_ & pf_child_die) check_child_death(); next_think_time = start_time + kGameLogicDelay; } @@ -187,8 +187,8 @@ RenderTarget& rt = *g_gr->get_render_target(); forefather->do_draw(rt); rt.blit(app->get_mouse_position() - Point(3, 7), WLApplication::get()->is_mouse_pressed() ? - s_default_cursor_click : - s_default_cursor); + default_cursor_click_ : + default_cursor_); forefather->do_tooltip(); g_gr->refresh(); next_draw_time = start_time + draw_delay; @@ -202,9 +202,9 @@ end(); // Done - _modal = prevmodal; + modal_ = prevmodal; - return _retcode; + return return_code_; } /** @@ -212,7 +212,7 @@ */ bool Panel::is_modal() { - return _running; + return running_; } @@ -234,13 +234,13 @@ */ void Panel::set_size(const int nw, const int nh) { - if (nw == _w && nh == _h) + if (nw == w_ && nh == h_) return; - _w = nw; - _h = nh; + w_ = nw; + h_ = nh; - if (_parent) + if (parent_) move_inside_parent(); layout(); @@ -250,8 +250,8 @@ * Move the panel. Panel's position is relative to the parent. */ void Panel::set_pos(const Point n) { - _x = n.x; - _y = n.y; + x_ = n.x; + y_ = n.y; } /** @@ -260,8 +260,8 @@ */ void Panel::get_desired_size(int* w, int* h) const { - *w = _desired_w; - *h = _desired_h; + *w = desired_w_; + *h = desired_h_; } /** @@ -276,18 +276,18 @@ */ void Panel::set_desired_size(int w, int h) { - if (_desired_w == w && _desired_h == h) + if (desired_w_ == w && desired_h_ == h) return; assert(w < 3000); assert(h < 3000); - _desired_w = w; - _desired_h = h; - if (!get_layout_toplevel() && _parent) { - _parent->update_desired_size(); + desired_w_ = w; + desired_h_ = h; + if (!get_layout_toplevel() && parent_) { + parent_->update_desired_size(); } else { - set_size(_desired_w, _desired_h); + set_size(desired_w_, desired_h_); } } @@ -307,14 +307,14 @@ */ void Panel::set_layout_toplevel(bool ltl) { - _flags &= ~pf_layout_toplevel; + flags_ &= ~pf_layout_toplevel; if (ltl) - _flags |= pf_layout_toplevel; + flags_ |= pf_layout_toplevel; } bool Panel::get_layout_toplevel() const { - return _flags & pf_layout_toplevel; + return flags_ & pf_layout_toplevel; } /** @@ -324,10 +324,10 @@ */ Point Panel::to_parent(const Point & pt) const { - if (!_parent) + if (!parent_) return pt; - return pt + Point(_lborder + _x, _tborder + _y); + return pt + Point(lborder_ + x_, tborder_ + y_); } @@ -358,7 +358,7 @@ */ void Panel::set_inner_size(int const nw, int const nh) { - set_size(nw + _lborder + _rborder, nh + _tborder + _bborder); + set_size(nw + lborder_ + rborder_, nh + tborder_ + bborder_); } /** @@ -368,10 +368,10 @@ */ void Panel::set_border(int l, int r, int t, int b) { - _lborder = l; - _rborder = r; - _tborder = t; - _bborder = b; + lborder_ = l; + rborder_ = r; + tborder_ = t; + bborder_ = b; } /** @@ -379,27 +379,27 @@ */ void Panel::move_to_top() { - if (!_parent) + if (!parent_) return; // unlink - if (_prev) - _prev->_next = _next; - else - _parent->_fchild = _next; - if (_next) - _next->_prev = _prev; - else - _parent->_lchild = _prev; + if (prev_) + prev_->next_ = next_; + else + parent_->first_child_ = next_; + if (next_) + next_->prev_ = prev_; + else + parent_->last_child_ = prev_; // relink - _prev = nullptr; - _next = _parent->_fchild; - _parent->_fchild = this; - if (_next) - _next->_prev = this; + prev_ = nullptr; + next_ = parent_->first_child_; + parent_->first_child_ = this; + if (next_) + next_->prev_ = this; else - _parent->_lchild = this; + parent_->last_child_ = this; } /** @@ -407,12 +407,12 @@ */ void Panel::set_visible(bool const on) { - if (((_flags & pf_visible) > 1) == on) + if (((flags_ & pf_visible) > 1) == on) return; - _flags &= ~pf_visible; + flags_ &= ~pf_visible; if (on) - _flags |= pf_visible; + flags_ |= pf_visible; } /** @@ -451,7 +451,7 @@ if (thinks()) think(); - for (Panel * child = _fchild; child; child = child->_next) + for (Panel * child = first_child_; child; child = child->next_) child->do_think(); } @@ -461,8 +461,8 @@ */ Point Panel::get_mouse_position() const { return - (_parent ? - _parent ->get_mouse_position() + (parent_ ? + parent_ ->get_mouse_position() : WLApplication::get()->get_mouse_position()) - @@ -476,8 +476,8 @@ void Panel::set_mouse_pos(const Point p) { const Point relative_p = p + Point(get_x() + get_lborder(), get_y() + get_tborder()); - if (_parent) - _parent ->set_mouse_pos(relative_p); + if (parent_) + parent_ ->set_mouse_pos(relative_p); else WLApplication::get()->warp_mouse (relative_p); } @@ -541,28 +541,28 @@ */ bool Panel::handle_mousemove(const uint8_t, int32_t, int32_t, int32_t, int32_t) { - return !_tooltip.empty(); + return !tooltip_.empty(); } bool Panel::handle_key(bool down, SDL_Keysym code) { if (down) { - if (_focus) { - Panel * p = _focus->_next; + if (focus_) { + Panel * p = focus_->next_; switch (code.sym) { case SDLK_TAB: - while (p != _focus) { + while (p != focus_) { if (p->get_can_focus()) { p->focus(); break; } - if (p == _lchild) { - p = _fchild; + if (p == last_child_) { + p = first_child_; } else { - p = p->_next; + p = p->next_; } } return true; @@ -602,9 +602,9 @@ void Panel::set_handle_mouse(bool const yes) { if (yes) - _flags |= pf_handle_mouse; + flags_ |= pf_handle_mouse; else - _flags &= ~pf_handle_mouse; + flags_ &= ~pf_handle_mouse; } /** @@ -618,10 +618,10 @@ void Panel::grab_mouse(bool const grab) { if (grab) { - _g_mousegrab = this; + mousegrab_ = this; } else { - assert(!_g_mousegrab || _g_mousegrab == this); - _g_mousegrab = nullptr; + assert(!mousegrab_ || mousegrab_ == this); + mousegrab_ = nullptr; } } @@ -632,12 +632,12 @@ { if (yes) - _flags |= pf_can_focus; + flags_ |= pf_can_focus; else { - _flags &= ~pf_can_focus; + flags_ &= ~pf_can_focus; - if (_parent && _parent->_focus == this) - _parent->_focus = nullptr; + if (parent_ && parent_->focus_ == this) + parent_->focus_ = nullptr; } } @@ -659,14 +659,14 @@ } } - if (!_parent || this == _modal) { + if (!parent_ || this == modal_) { return; } - if (_parent->_focus == this) + if (parent_->focus_ == this) return; - _parent->_focus = this; - _parent->focus(false); + parent_->focus_ = this; + parent_->focus(false); } /** @@ -678,9 +678,9 @@ void Panel::set_thinks(bool const yes) { if (yes) - _flags |= pf_thinks; + flags_ |= pf_thinks; else - _flags &= ~pf_thinks; + flags_ &= ~pf_thinks; } /** @@ -691,11 +691,11 @@ */ void Panel::die() { - _flags |= pf_die; + flags_ |= pf_die; - for (Panel * p = _parent; p; p = p->_parent) { - p->_flags |= pf_child_die; - if (p == _modal) + for (Panel * p = parent_; p; p = p->parent_) { + p->flags_ |= pf_child_die; + if (p == modal_) break; } } @@ -724,18 +724,18 @@ */ void Panel::check_child_death() { - Panel * next = _fchild; + Panel * next = first_child_; while (next) { Panel * p = next; - next = p->_next; + next = p->next_; - if (p->_flags & pf_die) + if (p->flags_ & pf_die) delete p; - else if (p->_flags & pf_child_die) + else if (p->flags_ & pf_child_die) p->check_child_death(); } - _flags &= ~pf_child_die; + flags_ &= ~pf_child_die; } @@ -750,7 +750,7 @@ draw(dst); // draw back to front - for (Panel * child = _lchild; child; child = child->_prev) + for (Panel * child = last_child_; child; child = child->prev_) child->do_draw(dst); draw_overlay(dst); @@ -773,14 +773,14 @@ Rect outerrc; Point outerofs; - if (!dst.enter_window(Rect(Point(_x, _y), _w, _h), &outerrc, &outerofs)) + if (!dst.enter_window(Rect(Point(x_, y_), w_, h_), &outerrc, &outerofs)) return; draw_border(dst); Rect innerwindow - (Point(_lborder, _tborder), - _w - (_lborder + _rborder), _h - (_tborder + _bborder)); + (Point(lborder_, tborder_), + w_ - (lborder_ + rborder_), h_ - (tborder_ + bborder_)); if (dst.enter_window(innerwindow, nullptr, nullptr)) do_draw_inner(dst); @@ -791,26 +791,26 @@ /** * Returns the child panel that receives mouse events at the given location. - * Starts the search with child (which should usually be set to _fchild) and + * Starts the search with child (which should usually be set to first_child_) and * returns the first match. */ inline Panel * Panel::child_at_mouse_cursor (int32_t const x, int32_t const y, Panel * child) { - for (; child; child = child->_next) { + for (; child; child = child->next_) { if (!child->handles_mouse() || !child->is_visible()) continue; if - (x < child->_x + static_cast<int32_t>(child->_w) && x >= child->_x + (x < child->x_ + static_cast<int32_t>(child->w_) && x >= child->x_ && - y < child->_y + static_cast<int32_t>(child->_h) && y >= child->_y) + y < child->y_ + static_cast<int32_t>(child->h_) && y >= child->y_) break; } - if (_mousein && _mousein != child) - _mousein->do_mousein(false); - _mousein = child; + if (mousein_child_ && mousein_child_ != child) + mousein_child_->do_mousein(false); + mousein_child_ = child; if (child) child->do_mousein(true); @@ -823,9 +823,9 @@ */ void Panel::do_mousein(bool const inside) { - if (!inside && _mousein) { - _mousein->do_mousein(false); - _mousein = nullptr; + if (!inside && mousein_child_) { + mousein_child_->do_mousein(false); + mousein_child_ = nullptr; } handle_mousein(inside); } @@ -839,18 +839,18 @@ if (get_can_focus()) { focus(); } - x -= _lborder; - y -= _tborder; - if (_flags & pf_top_on_click) + x -= lborder_; + y -= tborder_; + if (flags_ & pf_top_on_click) move_to_top(); - if (_g_mousegrab != this) + if (mousegrab_ != this) for - (Panel * child = _fchild; + (Panel * child = first_child_; (child = child_at_mouse_cursor(x, y, child)); - child = child->_next) + child = child->next_) { - if (child->do_mousepress(btn, x - child->_x, y - child->_y)) + if (child->do_mousepress(btn, x - child->x_, y - child->y_)) return true; } return handle_mousepress(btn, x, y); @@ -862,8 +862,8 @@ // We need to find the actualy scrollable panel beneaththe mouse cursor, // so we can have multiple scrollable elements on the same screen // e.g. load map with a long desctiprion has 2 of them. - if (_focus) { - if (_focus->do_mousewheel(which, x, y)) + if (focus_) { + if (focus_->do_mousewheel(which, x, y)) return true; } @@ -872,14 +872,14 @@ bool Panel::do_mouserelease(const uint8_t btn, int32_t x, int32_t y) { - x -= _lborder; - y -= _tborder; - if (_g_mousegrab != this) + x -= lborder_; + y -= tborder_; + if (mousegrab_ != this) for - (Panel * child = _fchild; + (Panel * child = first_child_; (child = child_at_mouse_cursor(x, y, child)); - child = child->_next) - if (child->do_mouserelease(btn, x - child->_x, y - child->_y)) + child = child->next_) + if (child->do_mouserelease(btn, x - child->x_, y - child->y_)) return true; return handle_mouserelease(btn, x, y); } @@ -888,17 +888,17 @@ (uint8_t const state, int32_t x, int32_t y, int32_t const xdiff, int32_t const ydiff) { - x -= _lborder; - y -= _tborder; - if (_g_mousegrab != this) { + x -= lborder_; + y -= tborder_; + if (mousegrab_ != this) { for - (Panel * child = _fchild; + (Panel * child = first_child_; (child = child_at_mouse_cursor(x, y, child)); - child = child->_next) + child = child->next_) { if (child->do_mousemove - (state, x - child->_x, y - child->_y, xdiff, ydiff)) + (state, x - child->x_, y - child->y_, xdiff, ydiff)) { return true; } @@ -913,7 +913,7 @@ */ bool Panel::do_key(bool const down, SDL_Keysym const code) { - if (_focus && _focus->do_key(down, code)) { + if (focus_ && focus_->do_key(down, code)) { return true; } @@ -926,7 +926,7 @@ } bool Panel::do_textinput(const std::string& text) { - if (_focus && _focus->do_textinput(text)) { + if (focus_ && focus_->do_textinput(text)) { return true; } @@ -939,7 +939,7 @@ bool Panel::do_tooltip() { - if (_mousein && _mousein->do_tooltip()) { + if (mousein_child_ && mousein_child_->do_tooltip()) { return true; } return handle_tooltip(); @@ -963,32 +963,32 @@ Panel * mousein; Panel * rcv = nullptr; - if (_g_mousegrab) - mousein = rcv = _g_mousegrab; + if (mousegrab_) + mousein = rcv = mousegrab_; else - mousein = _modal; + mousein = modal_; - x -= mousein->_x; - y -= mousein->_y; - for (Panel * p = mousein->_parent; p; p = p->_parent) { - x -= p->_lborder + p->_x; - y -= p->_tborder + p->_y; + x -= mousein->x_; + y -= mousein->y_; + for (Panel * p = mousein->parent_; p; p = p->parent_) { + x -= p->lborder_ + p->x_; + y -= p->tborder_ + p->y_; } if - (0 <= x && x < static_cast<int32_t>(mousein->_w) + (0 <= x && x < static_cast<int32_t>(mousein->w_) && - 0 <= y && y < static_cast<int32_t>(mousein->_h)) + 0 <= y && y < static_cast<int32_t>(mousein->h_)) rcv = mousein; else mousein = nullptr; - if (mousein != _g_mousein) { - if (_g_mousein) - _g_mousein->do_mousein(false); - _g_mousein = mousein; - if (_g_mousein) - _g_mousein->do_mousein(true); + if (mousein != mousein_) { + if (mousein_) + mousein_->do_mousein(false); + mousein_ = mousein; + if (mousein_) + mousein_->do_mousein(true); } return rcv; @@ -999,7 +999,7 @@ * panel. */ bool Panel::ui_mousepress(const uint8_t button, int32_t x, int32_t y) { - if (!_g_allow_user_input) { + if (!allow_user_input_) { return true; } @@ -1011,7 +1011,7 @@ } bool Panel::ui_mouserelease(const uint8_t button, int32_t x, int32_t y) { - if (!_g_allow_user_input) { + if (!allow_user_input_) { return true; } @@ -1030,7 +1030,7 @@ (uint8_t const state, int32_t x, int32_t y, int32_t const xdiff, int32_t const ydiff) { - if (!_g_allow_user_input) { + if (!allow_user_input_) { return true; } @@ -1050,17 +1050,17 @@ * panel. */ bool Panel::ui_mousewheel(uint32_t which, int32_t x, int32_t y) { - if (!_g_allow_user_input) { + if (!allow_user_input_) { return true; } if (!x && !y) { return true; } Panel* p = nullptr; - if (_g_mousein) { - p = _g_mousein; + if (mousein_) { + p = mousein_; } else { - p = _g_mousegrab ? _g_mousegrab : _modal; + p = mousegrab_ ? mousegrab_ : modal_; } if (!p) { return false; @@ -1074,11 +1074,11 @@ */ bool Panel::ui_key(bool const down, SDL_Keysym const code) { - if (!_g_allow_user_input) { + if (!allow_user_input_) { return true; } - return _modal->do_key(down, code); + return modal_->do_key(down, code); } @@ -1086,10 +1086,10 @@ * Input callback function. Pass the textinput event to the currently modal panel */ bool Panel::ui_textinput(const std::string& text) { - if (!_g_allow_user_input) { + if (!allow_user_input_) { return true; } - return _modal->do_textinput(text); + return modal_->do_textinput(text); } /** === modified file 'src/ui_basic/panel.h' --- src/ui_basic/panel.h 2016-02-07 16:31:06 +0000 +++ src/ui_basic/panel.h 2016-02-15 22:33:49 +0000 @@ -83,7 +83,7 @@ const std::string& tooltip_text = std::string()); virtual ~Panel(); - Panel * get_parent() const {return _parent;} + Panel * get_parent() const {return parent_;} void free_children(); @@ -104,8 +104,8 @@ */ template<typename Returncode> void end_modal(const Returncode& code) { - _running = false; - _retcode = static_cast<int>(code); + running_ = false; + return_code_ = static_cast<int>(code); } bool is_modal(); @@ -125,62 +125,62 @@ void get_desired_size(int* w, int* h) const; - int32_t get_x() const {return _x;} - int32_t get_y() const {return _y;} - Point get_pos() const {return Point(_x, _y);} + int32_t get_x() const {return x_;} + int32_t get_y() const {return y_;} + Point get_pos() const {return Point(x_, y_);} //int unstead of uint because of overflow situations - int32_t get_w() const {return _w;} - int32_t get_h() const {return _h;} + int32_t get_w() const {return w_;} + int32_t get_h() const {return h_;} Point to_parent(const Point &) const; virtual bool is_snap_target() const {return false;} - uint16_t get_border_snap_distance() const {return _border_snap_distance;} + uint16_t get_border_snap_distance() const {return border_snap_distance_;} void set_border_snap_distance(uint8_t const value) { - _border_snap_distance = value; + border_snap_distance_ = value; } - uint8_t get_panel_snap_distance () const {return _panel_snap_distance;} + uint8_t get_panel_snap_distance () const {return panel_snap_distance_;} void set_panel_snap_distance(uint8_t const value) { - _panel_snap_distance = value; + panel_snap_distance_ = value; } bool get_snap_windows_only_when_overlapping() const { - return _flags & pf_snap_windows_only_when_overlapping; + return flags_ & pf_snap_windows_only_when_overlapping; } void set_snap_windows_only_when_overlapping(const bool on = true); bool get_dock_windows_to_edges() const { - return _flags & pf_dock_windows_to_edges; + return flags_ & pf_dock_windows_to_edges; } void set_dock_windows_to_edges(const bool on = true); void set_inner_size(int nw, int nh); void set_border(int l, int r, int t, int b); - int get_lborder() const {return _lborder;} - int get_rborder() const {return _rborder;} - int get_tborder() const {return _tborder;} - int get_bborder() const {return _bborder;} + int get_lborder() const {return lborder_;} + int get_rborder() const {return rborder_;} + int get_tborder() const {return tborder_;} + int get_bborder() const {return bborder_;} int get_inner_w() const { - assert(_lborder + _rborder <= _w); - return _w - (_lborder + _rborder); + assert(lborder_ + rborder_ <= w_); + return w_ - (lborder_ + rborder_); } int get_inner_h() const { - assert(_tborder + _bborder <= _h); - return _h - (_tborder + _bborder); + assert(tborder_ + bborder_ <= h_); + return h_ - (tborder_ + bborder_); } - const Panel * get_next_sibling () const {return _next;} - Panel * get_next_sibling () {return _next;} - const Panel * get_prev_sibling () const {return _prev;} - Panel * get_prev_sibling () {return _prev;} - const Panel * get_first_child () const {return _fchild;} - Panel * get_first_child () {return _fchild;} - const Panel * get_last_child () const {return _lchild;} - Panel * get_last_child () {return _lchild;} + const Panel * get_next_sibling () const {return next_;} + Panel * get_next_sibling () {return next_;} + const Panel * get_prev_sibling () const {return prev_;} + Panel * get_prev_sibling () {return prev_;} + const Panel * get_first_child () const {return first_child_;} + Panel * get_first_child () {return first_child_;} + const Panel * get_last_child () const {return last_child_;} + Panel * get_last_child () {return last_child_;} void move_to_top(); // Drawing, visibility - bool is_visible() const {return _flags & pf_visible;} + bool is_visible() const {return flags_ & pf_visible;} void set_visible(bool on); virtual void draw (RenderTarget &); @@ -220,26 +220,26 @@ void grab_mouse(bool grab); void set_can_focus(bool yes); - bool get_can_focus() const {return _flags & pf_can_focus;} + bool get_can_focus() const {return flags_ & pf_can_focus;} bool has_focus() const { assert(get_can_focus()); - return (_parent->_focus == this); + return (parent_->focus_ == this); } virtual void focus(bool topcaller = true); void set_top_on_click(bool const on) { if (on) - _flags |= pf_top_on_click; + flags_ |= pf_top_on_click; else - _flags &= ~pf_top_on_click; + flags_ &= ~pf_top_on_click; } - bool get_top_on_click() const {return _flags & pf_top_on_click;} - - static void set_allow_user_input(bool const t) {_g_allow_user_input = t;} - static bool allow_user_input() {return _g_allow_user_input;} - - void set_tooltip(const std::string& text) {_tooltip = text;} - const std::string& tooltip() const {return _tooltip;} + bool get_top_on_click() const {return flags_ & pf_top_on_click;} + + static void set_allow_user_input(bool const t) {allow_user_input_ = t;} + static bool allow_user_input() {return allow_user_input_;} + + void set_tooltip(const std::string& text) {tooltip_ = text;} + const std::string& tooltip() const {return tooltip_;} virtual void die(); @@ -247,14 +247,14 @@ // This panel will never receive keypresses (do_key), instead // textinput will be passed on (do_textinput). void set_handle_textinput() { - _flags |= pf_handle_textinput; + flags_ |= pf_handle_textinput; } // Defines if think() should be called repeatedly. This is true on construction. void set_thinks(bool yes); - bool keyboard_free() {return !(_focus);} + bool keyboard_free() {return !(focus_);} virtual void update_desired_size(); @@ -266,13 +266,13 @@ private: bool handles_mouse() const { - return (_flags & pf_handle_mouse) != 0; + return (flags_ & pf_handle_mouse) != 0; } bool handles_textinput() const { - return (_flags & pf_handle_textinput) != 0; + return (flags_ & pf_handle_textinput) != 0; } bool thinks() const { - return (_flags & pf_thinks) != 0; + return (flags_ & pf_thinks) != 0; } void check_child_death(); @@ -302,48 +302,48 @@ static bool ui_key(bool down, SDL_Keysym code); static bool ui_textinput(const std::string& text); - Panel * _parent; - Panel * _next, * _prev; - Panel * _fchild, * _lchild; // first, last child - Panel * _mousein; // child panel that the mouse is in - Panel * _focus; // keyboard focus + Panel * parent_; + Panel * next_, * prev_; + Panel * first_child_, * last_child_; + Panel * mousein_child_; // child panel that the mouse is in + Panel * focus_; // keyboard focus - uint32_t _flags; + uint32_t flags_; /** - * The outer rectangle is defined by (_x, _y, _w, _h) + * The outer rectangle is defined by (x_, y_, w_, h_) */ /*@{*/ - int32_t _x, _y; - int _w, _h; + int32_t x_, y_; + int w_, h_; /*@}*/ - int _lborder, _rborder, _tborder, _bborder; - uint8_t _border_snap_distance, _panel_snap_distance; - int _desired_w, _desired_h; - - bool _running; - int _retcode; - - std::string _tooltip; - static Panel * _modal; - static Panel * _g_mousegrab; - static Panel * _g_mousein; - static bool _g_allow_user_input; - static const Image* s_default_cursor; - static const Image* s_default_cursor_click; + int lborder_, rborder_, tborder_, bborder_; + uint8_t border_snap_distance_, panel_snap_distance_; + int desired_w_, desired_h_; + + bool running_; + int return_code_; + + std::string tooltip_; + static Panel * modal_; + static Panel * mousegrab_; + static Panel * mousein_; + static bool allow_user_input_; + static const Image* default_cursor_; + static const Image* default_cursor_click_; DISALLOW_COPY_AND_ASSIGN(Panel); }; inline void Panel::set_snap_windows_only_when_overlapping(const bool on) { - _flags &= ~pf_snap_windows_only_when_overlapping; + flags_ &= ~pf_snap_windows_only_when_overlapping; if (on) - _flags |= pf_snap_windows_only_when_overlapping; + flags_ |= pf_snap_windows_only_when_overlapping; } inline void Panel::set_dock_windows_to_edges(const bool on) { - _flags &= ~pf_dock_windows_to_edges; + flags_ &= ~pf_dock_windows_to_edges; if (on) - _flags |= pf_dock_windows_to_edges; + flags_ |= pf_dock_windows_to_edges; } /** === modified file 'src/ui_basic/table.cc' --- src/ui_basic/table.cc 2016-02-03 18:09:15 +0000 +++ src/ui_basic/table.cc 2016-02-15 22:33:49 +0000 @@ -178,7 +178,7 @@ void Table<void *>::EntryRecord::set_checked (uint8_t const col, bool const checked) { - _data & cell = data_.at(col); + Data & cell = data_.at(col); cell.d_checked = checked; cell.d_picture = @@ -194,7 +194,7 @@ bool Table<void *>::EntryRecord::is_checked(uint8_t const col) const { - const _data & cell = data_.at(col); + const Data & cell = data_.at(col); return cell.d_checked; } === modified file 'src/ui_basic/table.h' --- src/ui_basic/table.h 2016-02-03 18:09:15 +0000 +++ src/ui_basic/table.h 2016-02-15 22:33:49 +0000 @@ -143,14 +143,14 @@ void * entry_; bool use_clr; RGBColor clr; - struct _data { + struct Data { const Image* d_picture; std::string d_string; bool d_checked; - _data() : d_checked(false) {} + Data() : d_checked(false) {} }; - std::vector<_data> data_; + std::vector<Data> data_; }; /** === modified file 'src/ui_basic/tabpanel.cc' --- src/ui_basic/tabpanel.cc 2016-02-08 12:38:48 +0000 +++ src/ui_basic/tabpanel.cc 2016-02-15 22:33:49 +0000 @@ -52,16 +52,16 @@ int32_t x, int32_t w, const std::string& name, - const std::string& _title, - const Image* _pic, + const std::string& init_title, + const Image* init_pic, const std::string& tooltip_text, Panel* const contents) : NamedPanel(tab_parent, name, x, 0, w, kTabPanelButtonHeight, tooltip_text), parent(tab_parent), id(tab_id), - pic(_pic), - title(_title), + pic(init_pic), + title(init_title), tooltip(tooltip_text), panel(contents) { === modified file 'src/ui_basic/window.cc' --- src/ui_basic/window.cc 2016-02-07 05:54:01 +0000 +++ src/ui_basic/window.cc 2016-02-15 22:33:49 +0000 @@ -77,10 +77,10 @@ NamedPanel (parent, name, x, y, w + VT_B_PIXMAP_THICKNESS * 2, TP_B_PIXMAP_THICKNESS + h + BT_B_PIXMAP_THICKNESS), - _is_minimal(false), _dragging(false), - _docked_left(false), _docked_right(false), _docked_bottom(false), - _drag_start_win_x(0), _drag_start_win_y(0), - _drag_start_mouse_x(0), _drag_start_mouse_y(0), + is_minimal_(false), dragging_(false), + docked_left_(false), docked_right_(false), docked_bottom_(false), + drag_start_win_x_(0), drag_start_win_y_(0), + drag_start_mouse_x_(0), drag_start_mouse_y_(0), pic_lborder_ (g_gr->images().get("images/wui/window_left.png")), pic_rborder_ @@ -131,7 +131,7 @@ */ void Window::update_desired_size() { - if (center_panel_ && !_is_minimal) { + if (center_panel_ && !is_minimal_) { int innerw, innerh; center_panel_->get_desired_size(&innerw, &innerh); set_desired_size @@ -146,7 +146,7 @@ */ void Window::layout() { - if (center_panel_ && !_is_minimal) { + if (center_panel_ && !is_minimal_) { center_panel_->set_pos(Point(0, 0)); center_panel_->set_size(get_inner_w(), get_inner_h()); } @@ -210,16 +210,16 @@ if (parent->get_inner_w() >= get_w()) { if (px < 0) { px = 0; - if (parent->get_dock_windows_to_edges() && !_docked_left) - _docked_left = true; + if (parent->get_dock_windows_to_edges() && !docked_left_) + docked_left_ = true; } else if (px + get_w() >= parent->get_inner_w()) { px = parent->get_inner_w() - get_w(); - if (parent->get_dock_windows_to_edges() && !_docked_right) - _docked_right = true; + if (parent->get_dock_windows_to_edges() && !docked_right_) + docked_right_ = true; } - if (_docked_left) + if (docked_left_) px -= VT_B_PIXMAP_THICKNESS; - else if (_docked_right) + else if (docked_right_) px += VT_B_PIXMAP_THICKNESS; } if (parent->get_inner_h() >= get_h()) { @@ -228,12 +228,12 @@ else if (py + get_h() > parent->get_inner_h()) { py = parent->get_inner_h() - get_h(); if - (!_is_minimal + (!is_minimal_ && - parent->get_dock_windows_to_edges() && !_docked_bottom) - _docked_bottom = true; + parent->get_dock_windows_to_edges() && !docked_bottom_) + docked_bottom_ = true; } - if (_docked_bottom) + if (docked_bottom_) py += BT_B_PIXMAP_THICKNESS; } set_pos(Point(px, py)); @@ -319,9 +319,9 @@ UI::Align::kCenter); } - if (!_is_minimal) { + if (!is_minimal_) { const int32_t vt_bar_end = get_h() - - (_docked_bottom ? 0 : BT_B_PIXMAP_THICKNESS) - VT_B_THINGY_PIXMAP_LEN; + (docked_bottom_ ? 0 : BT_B_PIXMAP_THICKNESS) - VT_B_THINGY_PIXMAP_LEN; const int32_t vt_bar_end_minus_middle = vt_bar_end - VT_B_MIDDLE_PIXMAP_LEN; @@ -437,11 +437,11 @@ btn == SDL_BUTTON_MIDDLE) is_minimal() ? restore() : minimize(); else if (btn == SDL_BUTTON_LEFT) { - _dragging = true; - _drag_start_win_x = get_x(); - _drag_start_win_y = get_y(); - _drag_start_mouse_x = get_x() + get_lborder() + mx; - _drag_start_mouse_y = get_y() + get_tborder() + my; + dragging_ = true; + drag_start_win_x_ = get_x(); + drag_start_win_y_ = get_y(); + drag_start_mouse_x_ = get_x() + get_lborder() + mx; + drag_start_mouse_y_ = get_y() + get_tborder() + my; grab_mouse(true); } else if (btn == SDL_BUTTON_RIGHT) { play_click(); @@ -453,7 +453,7 @@ bool Window::handle_mouserelease(const uint8_t btn, int32_t, int32_t) { if (btn == SDL_BUTTON_LEFT) { grab_mouse(false); - _dragging = false; + dragging_ = false; } return true; } @@ -482,25 +482,25 @@ void Window::restore() { - assert(_is_minimal); - _is_minimal = false; + assert(is_minimal_); + is_minimal_ = false; set_border (get_lborder(), get_rborder(), get_tborder(), BT_B_PIXMAP_THICKNESS); - set_inner_size(get_inner_w(), _oldh); + set_inner_size(get_inner_w(), oldh_); update_desired_size(); move_inside_parent(); } void Window::minimize() { - assert(!_is_minimal); + assert(!is_minimal_); int32_t y = get_y(), x = get_x(); - if (_docked_bottom) { + if (docked_bottom_) { y -= BT_B_PIXMAP_THICKNESS; // Minimal can not be bottom-docked. - _docked_bottom = false; + docked_bottom_ = false; } if (y < 0) y = 0; // Move into the screen - _oldh = get_inner_h(); - _is_minimal = true; + oldh_ = get_inner_h(); + is_minimal_ = true; set_border(get_lborder(), get_rborder(), get_tborder(), 0); set_size(get_w(), TP_B_PIXMAP_THICKNESS); set_pos(Point(x, y)); // If on border, this feels more natural @@ -513,11 +513,11 @@ bool Window::handle_mousemove (const uint8_t, int32_t mx, int32_t my, int32_t, int32_t) { - if (_dragging) { + if (dragging_) { const int32_t mouse_x = get_x() + get_lborder() + mx; const int32_t mouse_y = get_y() + get_tborder() + my; - int32_t left = _drag_start_win_x + mouse_x - _drag_start_mouse_x; - int32_t top = _drag_start_win_y + mouse_y - _drag_start_mouse_y; + int32_t left = drag_start_win_x_ + mouse_x - drag_start_mouse_x_; + int32_t top = drag_start_win_y_ + mouse_y - drag_start_mouse_y_; int32_t new_left = left, new_top = top; if (const Panel * const parent = get_parent()) { @@ -530,7 +530,7 @@ top = min<int32_t>(max_y - get_tborder(), top); left = max<int32_t>(get_rborder() - w, left); top = max - (-static_cast<int32_t>(h - ((_is_minimal) ? get_tborder() : get_bborder())), top); + (-static_cast<int32_t>(h - ((is_minimal_) ? get_tborder() : get_bborder())), top); new_left = left; new_top = top; const uint8_t psnap = parent->get_panel_snap_distance (); @@ -635,22 +635,22 @@ if (parent->get_dock_windows_to_edges()) { if (new_left <= 0 && new_left >= -VT_B_PIXMAP_THICKNESS) { new_left = -VT_B_PIXMAP_THICKNESS; - _docked_left = true; - } else if (_docked_left) { - _docked_left = false; + docked_left_ = true; + } else if (docked_left_) { + docked_left_ = false; } if (new_left >= (max_x - w) && new_left <= (max_x - w) + VT_B_PIXMAP_THICKNESS) { new_left = (max_x - w) + VT_B_PIXMAP_THICKNESS; - _docked_right = true; - } else if (_docked_right) { - _docked_right = false; + docked_right_ = true; + } else if (docked_right_) { + docked_right_ = false; } - if (!_is_minimal) { // minimal windows can not be bottom-docked + if (!is_minimal_) { // minimal windows can not be bottom-docked if (new_top >= (max_y - h) && new_top <= (max_y - h) + BT_B_PIXMAP_THICKNESS) { new_top = (max_y - h) + BT_B_PIXMAP_THICKNESS; - _docked_bottom = true; - } else if (_docked_bottom) { - _docked_bottom = false; + docked_bottom_ = true; + } else if (docked_bottom_) { + docked_bottom_ = false; } } } === modified file 'src/ui_basic/window.h' --- src/ui_basic/window.h 2016-02-03 18:09:15 +0000 +++ src/ui_basic/window.h 2016-02-15 22:33:49 +0000 @@ -71,7 +71,7 @@ void warp_mouse_to_fastclick_panel(); void set_fastclick_panel(Panel * p) {fastclick_panel_ = p;} - bool is_minimal() const {return _is_minimal;} + bool is_minimal() const {return is_minimal_;} void restore (); void minimize(); bool is_snap_target() const override {return true;} @@ -94,11 +94,11 @@ void update_desired_size() override; private: - bool _is_minimal; - uint32_t _oldh; // if it is, this is the old height - bool _dragging, _docked_left, _docked_right, _docked_bottom; - int32_t _drag_start_win_x, _drag_start_win_y; - int32_t _drag_start_mouse_x, _drag_start_mouse_y; + bool is_minimal_; + uint32_t oldh_; // if it is, this is the old height + bool dragging_, docked_left_, docked_right_, docked_bottom_; + int32_t drag_start_win_x_, drag_start_win_y_; + int32_t drag_start_mouse_x_, drag_start_mouse_y_; std::string title_; === modified file 'src/ui_fsmenu/mapselect.cc' --- src/ui_fsmenu/mapselect.cc 2016-02-07 16:31:06 +0000 +++ src/ui_fsmenu/mapselect.cc 2016-02-15 22:33:49 +0000 @@ -84,7 +84,7 @@ cb_dont_localize_mapnames_->changedto.connect (boost::bind(&FullscreenMenuMapSelect::fill_table, boost::ref(*this))); - cb_show_all_maps_ = _add_tag_checkbox(vbox, "blumba", _("Show all maps")); + cb_show_all_maps_ = add_tag_checkbox(vbox, "blumba", _("Show all maps")); tags_checkboxes_.clear(); // Remove this again, it is a special tag checkbox cb_show_all_maps_->set_state(true); @@ -94,27 +94,27 @@ vbox = new UI::Box(this, tablex_, vbox->get_y() + vbox->get_h() + padding_, UI::Box::Horizontal, checkbox_space_, get_w()); - _add_tag_checkbox(vbox, "official", _("Official")); - _add_tag_checkbox(vbox, "unbalanced", _("Unbalanced")); - _add_tag_checkbox(vbox, "seafaring", _("Seafaring")); - _add_tag_checkbox(vbox, "artifacts", _("Artifacts")); - _add_tag_checkbox(vbox, "scenario", _("Scenario")); - vbox->set_size(get_w() - 2 * tablex_, checkbox_space_); - - vbox = new UI::Box(this, - tablex_, vbox->get_y() + vbox->get_h() + padding_, - UI::Box::Horizontal, checkbox_space_, get_w()); - _add_tag_checkbox(vbox, "ffa", _("Free for all")); - _add_tag_checkbox(vbox, "1v1", _("1v1")); - - vbox->set_size(get_w() - 2 * tablex_, checkbox_space_); - - vbox = new UI::Box(this, - tablex_, vbox->get_y() + vbox->get_h() + padding_, - UI::Box::Horizontal, checkbox_space_, get_w()); - _add_tag_checkbox(vbox, "2teams", _("Teams of 2")); - _add_tag_checkbox(vbox, "3teams", _("Teams of 3")); - _add_tag_checkbox(vbox, "4teams", _("Teams of 4")); + add_tag_checkbox(vbox, "official", _("Official")); + add_tag_checkbox(vbox, "unbalanced", _("Unbalanced")); + add_tag_checkbox(vbox, "seafaring", _("Seafaring")); + add_tag_checkbox(vbox, "artifacts", _("Artifacts")); + add_tag_checkbox(vbox, "scenario", _("Scenario")); + vbox->set_size(get_w() - 2 * tablex_, checkbox_space_); + + vbox = new UI::Box(this, + tablex_, vbox->get_y() + vbox->get_h() + padding_, + UI::Box::Horizontal, checkbox_space_, get_w()); + add_tag_checkbox(vbox, "ffa", _("Free for all")); + add_tag_checkbox(vbox, "1v1", _("1v1")); + + vbox->set_size(get_w() - 2 * tablex_, checkbox_space_); + + vbox = new UI::Box(this, + tablex_, vbox->get_y() + vbox->get_h() + padding_, + UI::Box::Horizontal, checkbox_space_, get_w()); + add_tag_checkbox(vbox, "2teams", _("Teams of 2")); + add_tag_checkbox(vbox, "3teams", _("Teams of 3")); + add_tag_checkbox(vbox, "4teams", _("Teams of 4")); vbox->set_size(get_w() - 2 * tablex_, checkbox_space_); scenario_types_ = settings_->settings().multiplayer ? Map::MP_SCENARIO : Map::SP_SCENARIO; @@ -299,7 +299,7 @@ /* * Add a tag to the checkboxes */ -UI::Checkbox * FullscreenMenuMapSelect::_add_tag_checkbox +UI::Checkbox * FullscreenMenuMapSelect::add_tag_checkbox (UI::Box * box, std::string tag, std::string displ_name) { int32_t id = tags_ordered_.size(); @@ -307,7 +307,7 @@ UI::Checkbox * cb = new UI::Checkbox(box, Point(0, 0), displ_name); cb->changedto.connect - (boost::bind(&FullscreenMenuMapSelect::_tagbox_changed, this, id, _1)); + (boost::bind(&FullscreenMenuMapSelect::tagbox_changed, this, id, _1)); box->add(cb, UI::Align::kLeft, true); box->add_space(checkbox_space_); @@ -319,7 +319,7 @@ /* * One of the tagboxes has changed */ -void FullscreenMenuMapSelect::_tagbox_changed(int32_t id, bool to) { +void FullscreenMenuMapSelect::tagbox_changed(int32_t id, bool to) { if (id == 0) { // Show all maps checbox if (to) { for (UI::Checkbox * checkbox : tags_checkboxes_) { === modified file 'src/ui_fsmenu/mapselect.h' --- src/ui_fsmenu/mapselect.h 2015-10-24 16:37:00 +0000 +++ src/ui_fsmenu/mapselect.h 2016-02-15 22:33:49 +0000 @@ -59,8 +59,8 @@ /// Updates buttons and text labels and returns whether a table entry is selected. bool set_has_selection(); - UI::Checkbox* _add_tag_checkbox(UI::Box*, std::string, std::string); - void _tagbox_changed(int32_t, bool); + UI::Checkbox* add_tag_checkbox(UI::Box*, std::string, std::string); + void tagbox_changed(int32_t, bool); int32_t const checkbox_space_; int32_t const checkboxes_y_; === modified file 'src/wlapplication.cc' --- src/wlapplication.cc 2016-02-14 21:18:03 +0000 +++ src/wlapplication.cc 2016-02-15 22:33:49 +0000 @@ -563,7 +563,7 @@ break; case SDL_MOUSEBUTTONDOWN: case SDL_MOUSEBUTTONUP: - _handle_mousebutton(ev, cb); + handle_mousebutton(ev, cb); break; case SDL_MOUSEWHEEL: if (cb && cb->mouse_wheel) { @@ -590,7 +590,7 @@ /* * Capsule repetitive code for mouse buttons */ -void WLApplication::_handle_mousebutton +void WLApplication::handle_mousebutton (SDL_Event & ev, InputCallback const * cb) { if (mouse_swapped_) { === modified file 'src/wlapplication.h' --- src/wlapplication.h 2016-02-06 11:11:24 +0000 +++ src/wlapplication.h 2016-02-15 22:33:49 +0000 @@ -257,7 +257,7 @@ ///\note This is private on purpose. Read the class documentation. static WLApplication * the_singleton; - void _handle_mousebutton(SDL_Event &, InputCallback const *); + void handle_mousebutton(SDL_Event &, InputCallback const *); }; #endif // end of include guard: WL_WLAPPLICATION_H === modified file 'src/wui/encyclopedia_window.cc' --- src/wui/encyclopedia_window.cc 2016-02-10 14:46:32 +0000 +++ src/wui/encyclopedia_window.cc 2016-02-15 22:33:49 +0000 @@ -51,16 +51,16 @@ constexpr int kTabHeight = 35; struct EncyclopediaTab { - EncyclopediaTab(const std::string& _key, - const std::string& _image_filename, - const std::string& _tooltip, - const std::string& _script_path, - const Widelands::MapObjectType _type) - : key(_key), - image_filename(_image_filename), - tooltip(_tooltip), - script_path(_script_path), - type(_type) { + EncyclopediaTab(const std::string& init_key, + const std::string& init_image_filename, + const std::string& init_tooltip, + const std::string& init_script_path, + const Widelands::MapObjectType init_type) + : key(init_key), + image_filename(init_image_filename), + tooltip(init_tooltip), + script_path(init_script_path), + type(init_type) { } const std::string key; const std::string image_filename; === modified file 'src/wui/encyclopedia_window.h' --- src/wui/encyclopedia_window.h 2016-02-10 14:46:32 +0000 +++ src/wui/encyclopedia_window.h 2016-02-15 22:33:49 +0000 @@ -42,10 +42,10 @@ struct EncyclopediaEntry { EncyclopediaEntry(const EncyclopediaEntry&) = default; EncyclopediaEntry& operator = (const EncyclopediaEntry&) = default; - EncyclopediaEntry(const Widelands::DescriptionIndex _index, - const std::string& _descname, - const Image* _icon) - : index(_index), descname(_descname), icon(_icon) { + EncyclopediaEntry(const Widelands::DescriptionIndex i, + const std::string& init_descname, + const Image* init_icon) + : index(i), descname(init_descname), icon(init_icon) { } Widelands::DescriptionIndex index; std::string descname; === modified file 'src/wui/interactive_base.h' --- src/wui/interactive_base.h 2016-01-28 05:24:34 +0000 +++ src/wui/interactive_base.h 2016-02-15 22:33:49 +0000 @@ -191,7 +191,7 @@ freeze(Freeze), triangles(Triangles), pos(Pos), radius(Radius), pic(Pic), jobid(Jobid) {} - bool freeze; // don't change sel _even if mouse moves + bool freeze; // don't change sel, even if mouse moves bool triangles; // otherwise nodes Widelands::NodeAndTriangle<> pos; uint32_t radius; === modified file 'src/wui/interactive_gamebase.cc' --- src/wui/interactive_gamebase.cc 2016-02-01 11:46:58 +0000 +++ src/wui/interactive_gamebase.cc 2016-02-15 22:33:49 +0000 @@ -47,10 +47,10 @@ } // namespace InteractiveGameBase::InteractiveGameBase - (Widelands::Game & _game, Section & global_s, + (Widelands::Game& g, Section & global_s, PlayerType pt, bool const chatenabled, bool const multiplayer) : - InteractiveBase(_game, global_s), + InteractiveBase(g, global_s), chat_provider_(nullptr), chatenabled_(chatenabled), multiplayer_(multiplayer), === modified file 'src/wui/interactive_player.cc' --- src/wui/interactive_player.cc 2016-01-29 08:37:22 +0000 +++ src/wui/interactive_player.cc 2016-02-15 22:33:49 +0000 @@ -60,12 +60,12 @@ using Widelands::Map; InteractivePlayer::InteractivePlayer - (Widelands::Game & _game, + (Widelands::Game & g, Section & global_s, Widelands::PlayerNumber const plyn, bool const multiplayer) : - InteractiveGameBase (_game, global_s, NONE, multiplayer, multiplayer), + InteractiveGameBase (g, global_s, NONE, multiplayer, multiplayer), auto_roadbuild_mode_(global_s.get_bool("auto_roadbuild_mode", true)), flag_to_connect_(Widelands::Coords::null()), === modified file 'src/wui/interactive_spectator.cc' --- src/wui/interactive_spectator.cc 2016-01-29 08:37:22 +0000 +++ src/wui/interactive_spectator.cc 2016-02-15 22:33:49 +0000 @@ -40,9 +40,9 @@ * Setup the replay UI for the given game. */ InteractiveSpectator::InteractiveSpectator - (Widelands::Game & _game, Section & global_s, bool const multiplayer) + (Widelands::Game& g, Section& global_s, bool const multiplayer) : - InteractiveGameBase(_game, global_s, OBSERVER, multiplayer, multiplayer), + InteractiveGameBase(g, global_s, OBSERVER, multiplayer, multiplayer), #define INIT_BTN(picture, name, tooltip) \ TOOLBAR_BUTTON_COMMON_PARAMETERS(name), \ === modified file 'src/wui/watchwindow.cc' --- src/wui/watchwindow.cc 2016-01-28 05:24:34 +0000 +++ src/wui/watchwindow.cc 2016-02-15 22:33:49 +0000 @@ -93,12 +93,12 @@ (InteractiveGameBase & parent, int32_t const x, int32_t const y, uint32_t const w, uint32_t const h, Widelands::Coords const coords, - bool const _single_window) + bool const init_single_window) : UI::Window(&parent, "watch", x, y, w, h, _("Watch")), mapview (this, 0, 0, 200, 166, parent), last_visit(game().get_gametime()), - single_window(_single_window) + single_window(init_single_window) { UI::Button * followbtn = new UI::Button @@ -118,7 +118,7 @@ _("Center the main view on this")); gotobtn->sigclicked.connect(boost::bind(&WatchWindow::do_goto, this)); - if (_single_window) { + if (init_single_window) { for (uint8_t i = 0; i < NUM_VIEWS; ++i) { view_btns[i] = new UI::Button
_______________________________________________ Mailing list: https://launchpad.net/~widelands-dev Post to : widelands-dev@lists.launchpad.net Unsubscribe : https://launchpad.net/~widelands-dev More help : https://help.launchpad.net/ListHelp