1
0
Fork 0

Compare commits

...

3 Commits

6 changed files with 16 additions and 5 deletions

View File

@ -456,6 +456,9 @@ void Aircraft::OnNewCalendarDay()
void Aircraft::OnNewEconomyDay() void Aircraft::OnNewEconomyDay()
{ {
if (!this->IsNormalAircraft()) return; if (!this->IsNormalAircraft()) return;
PerformanceAccumulator framerate(PFE_GL_AIRCRAFT);
EconomyAgeVehicle(this); EconomyAgeVehicle(this);
if ((++this->day_counter & 7) == 0) DecreaseVehicleValue(this); if ((++this->day_counter & 7) == 0) DecreaseVehicleValue(this);

View File

@ -84,7 +84,7 @@ struct EnginePreviewWindow : Window {
/* Get size of engine sprite, on loan from depot_gui.cpp */ /* Get size of engine sprite, on loan from depot_gui.cpp */
EngineID engine = static_cast<EngineID>(this->window_number); EngineID engine = static_cast<EngineID>(this->window_number);
EngineImageType image_type = EIT_PURCHASE; EngineImageType image_type = EIT_PREVIEW;
uint x, y; uint x, y;
int x_offs, y_offs; int x_offs, y_offs;

View File

@ -1696,6 +1696,9 @@ void RoadVehicle::OnNewCalendarDay()
void RoadVehicle::OnNewEconomyDay() void RoadVehicle::OnNewEconomyDay()
{ {
if (!this->IsFrontEngine()) return; if (!this->IsFrontEngine()) return;
PerformanceAccumulator framerate(PFE_GL_ROADVEHS);
EconomyAgeVehicle(this); EconomyAgeVehicle(this);
if ((++this->day_counter & 7) == 0) DecreaseVehicleValue(this); if ((++this->day_counter & 7) == 0) DecreaseVehicleValue(this);

View File

@ -260,6 +260,8 @@ void Ship::OnNewCalendarDay()
/** Economy day handler. */ /** Economy day handler. */
void Ship::OnNewEconomyDay() void Ship::OnNewEconomyDay()
{ {
PerformanceAccumulator framerate(PFE_GL_SHIPS);
EconomyAgeVehicle(this); EconomyAgeVehicle(this);
if ((++this->day_counter & 7) == 0) { if ((++this->day_counter & 7) == 0) {

View File

@ -4176,6 +4176,8 @@ void Train::OnNewCalendarDay()
/** Economy day handler. */ /** Economy day handler. */
void Train::OnNewEconomyDay() void Train::OnNewEconomyDay()
{ {
PerformanceAccumulator framerate(PFE_GL_TRAINS);
EconomyAgeVehicle(this); EconomyAgeVehicle(this);
if ((++this->day_counter & 7) == 0) DecreaseVehicleValue(this); if ((++this->day_counter & 7) == 0) DecreaseVehicleValue(this);

View File

@ -955,16 +955,17 @@ void CallVehicleTicks()
{ {
_vehicles_to_autoreplace.clear(); _vehicles_to_autoreplace.clear();
PerformanceAccumulator::Reset(PFE_GL_TRAINS);
PerformanceAccumulator::Reset(PFE_GL_ROADVEHS);
PerformanceAccumulator::Reset(PFE_GL_SHIPS);
PerformanceAccumulator::Reset(PFE_GL_AIRCRAFT);
RunEconomyVehicleDayProc(); RunEconomyVehicleDayProc();
{ {
PerformanceMeasurer framerate(PFE_GL_ECONOMY); PerformanceMeasurer framerate(PFE_GL_ECONOMY);
for (Station *st : Station::Iterate()) LoadUnloadStation(st); for (Station *st : Station::Iterate()) LoadUnloadStation(st);
} }
PerformanceAccumulator::Reset(PFE_GL_TRAINS);
PerformanceAccumulator::Reset(PFE_GL_ROADVEHS);
PerformanceAccumulator::Reset(PFE_GL_SHIPS);
PerformanceAccumulator::Reset(PFE_GL_AIRCRAFT);
for (Vehicle *v : Vehicle::Iterate()) { for (Vehicle *v : Vehicle::Iterate()) {
[[maybe_unused]] VehicleID vehicle_index = v->index; [[maybe_unused]] VehicleID vehicle_index = v->index;