Merge branch 'master' into jgrpp
# Conflicts: # cmake/CompileFlags.cmake # src/cargomonitor.cpp # src/core/CMakeLists.txt # src/economy.cpp # src/landscape.cpp # src/linkgraph/flowmapper.cpp # src/linkgraph/linkgraph_gui.cpp # src/linkgraph/linkgraphschedule.cpp # src/misc_gui.cpp # src/newgrf_generic.cpp # src/newgrf_storage.cpp # src/rail_gui.cpp # src/saveload/afterload.cpp # src/saveload/station_sl.cpp # src/script/script_gui.cpp # src/station_cmd.cpp # src/station_gui.cpp # src/string_func.h # src/terraform_cmd.cpp
This commit is contained in:
@@ -54,8 +54,8 @@ void FlowMapper::Run(LinkGraphJob &job) const
|
||||
* division by 0 if spawn date == last compression date. This matches
|
||||
* LinkGraph::Monthly(). */
|
||||
uint runtime = (job.StartDateTicks() / DAY_TICKS) - job.LastCompression() + 1;
|
||||
for (FlowStatMap::iterator i = flows.begin(); i != flows.end(); ++i) {
|
||||
i->ScaleToMonthly(runtime);
|
||||
for (auto &it : flows) {
|
||||
it.ScaleToMonthly(runtime);
|
||||
}
|
||||
}
|
||||
/* Clear paths. */
|
||||
|
@@ -412,11 +412,11 @@ void LinkGraphOverlay::Draw(const DrawPixelInfo *dpi) const
|
||||
void LinkGraphOverlay::DrawLinks(const DrawPixelInfo *dpi) const
|
||||
{
|
||||
int width = ScaleGUITrad(this->scale);
|
||||
for (LinkList::const_iterator i(this->cached_links.begin()); i != this->cached_links.end(); ++i) {
|
||||
if (!this->IsLinkVisible(i->from_pt, i->to_pt, dpi, width + 2)) continue;
|
||||
if (!Station::IsValidID(i->from_id)) continue;
|
||||
if (!Station::IsValidID(i->to_id)) continue;
|
||||
this->DrawContent(dpi, i->from_pt, i->to_pt, i->prop);
|
||||
for (const auto &i : this->cached_links) {
|
||||
if (!this->IsLinkVisible(i.from_pt, i.to_pt, dpi, width + 2)) continue;
|
||||
if (!Station::IsValidID(i.from_id)) continue;
|
||||
if (!Station::IsValidID(i.to_id)) continue;
|
||||
this->DrawContent(dpi, i.from_pt, i.to_pt, i.prop);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -454,14 +454,14 @@ void LinkGraphOverlay::DrawContent(const DrawPixelInfo *dpi, Point pta, Point pt
|
||||
void LinkGraphOverlay::DrawStationDots(const DrawPixelInfo *dpi) const
|
||||
{
|
||||
int width = ScaleGUITrad(this->scale);
|
||||
for (StationSupplyList::const_iterator i(this->cached_stations.begin()); i != this->cached_stations.end(); ++i) {
|
||||
const Point &pt = i->pt;
|
||||
for (const auto &i : this->cached_stations) {
|
||||
const Point &pt = i.pt;
|
||||
if (!this->IsPointVisible(pt, dpi, 3 * width)) continue;
|
||||
|
||||
const Station *st = Station::GetIfValid(i->id);
|
||||
const Station *st = Station::GetIfValid(i.id);
|
||||
if (st == nullptr) continue;
|
||||
|
||||
uint r = width * 2 + width * 2 * std::min<uint>(200, i->quantity) / 200;
|
||||
uint r = width * 2 + width * 2 * std::min<uint>(200, i.quantity) / 200;
|
||||
|
||||
LinkGraphOverlay::DrawVertex(dpi, pt.x, pt.y, r,
|
||||
_colour_gradient[st->owner != OWNER_NONE ?
|
||||
|
@@ -177,8 +177,8 @@ void LinkGraphSchedule::JoinNext()
|
||||
void LinkGraphSchedule::SpawnAll()
|
||||
{
|
||||
std::vector<LinkGraphJobGroup::JobInfo> jobs_to_execute;
|
||||
for (JobList::iterator i = this->running.begin(); i != this->running.end(); ++i) {
|
||||
jobs_to_execute.emplace_back(i->get());
|
||||
for (auto &it : this->running) {
|
||||
jobs_to_execute.emplace_back(it.get());
|
||||
}
|
||||
LinkGraphJobGroup::ExecuteJobSet(std::move(jobs_to_execute));
|
||||
}
|
||||
@@ -188,8 +188,8 @@ void LinkGraphSchedule::SpawnAll()
|
||||
*/
|
||||
/* static */ void LinkGraphSchedule::Clear()
|
||||
{
|
||||
for (JobList::iterator i(instance.running.begin()); i != instance.running.end(); ++i) {
|
||||
(*i)->AbortJob();
|
||||
for (auto &it : instance.running) {
|
||||
it->AbortJob();
|
||||
}
|
||||
instance.running.clear();
|
||||
instance.schedule.clear();
|
||||
|
@@ -154,10 +154,10 @@ bool LinkRefresher::HandleRefit(CargoID refit_cargo)
|
||||
*/
|
||||
void LinkRefresher::ResetRefit()
|
||||
{
|
||||
for (RefitList::iterator it(this->refit_capacities.begin()); it != this->refit_capacities.end(); ++it) {
|
||||
if (it->remaining == it->capacity) continue;
|
||||
this->capacities[it->cargo] += it->capacity - it->remaining;
|
||||
it->remaining = it->capacity;
|
||||
for (auto &it : this->refit_capacities) {
|
||||
if (it.remaining == it.capacity) continue;
|
||||
this->capacities[it.cargo] += it.capacity - it.remaining;
|
||||
it.remaining = it.capacity;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user