diff options
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r-- | src/openttd.cpp | 34 |
1 files changed, 17 insertions, 17 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp index 7800fba84..aba1ae986 100644 --- a/src/openttd.cpp +++ b/src/openttd.cpp @@ -188,7 +188,7 @@ static void ShowHelp() " -p password = Password to join server\n" " -P password = Password to join company\n" " -D [ip][:port] = Start dedicated server\n" - " -l ip[:port] = Redirect DEBUG()\n" + " -l ip[:port] = Redirect Debug()\n" #if !defined(_WIN32) " -f = Fork into the background (dedicated only)\n" #endif @@ -666,7 +666,7 @@ int openttd_main(int argc, char *argv[]) DeterminePaths(argv[0], only_local_path); TarScanner::DoScan(TarScanner::BASESET); - if (dedicated) DEBUG(net, 3, "Starting dedicated server, version %s", _openttd_revision); + if (dedicated) Debug(net, 3, "Starting dedicated server, version {}", _openttd_revision); if (_dedicated_forks && !dedicated) _dedicated_forks = false; #if defined(UNIX) @@ -715,7 +715,7 @@ int openttd_main(int argc, char *argv[]) /* Initialize game palette */ GfxInitPalettes(); - DEBUG(misc, 1, "Loading blitter..."); + Debug(misc, 1, "Loading blitter..."); if (blitter.empty() && !_ini_blitter.empty()) blitter = _ini_blitter; _blitter_autodetected = blitter.empty(); /* Activate the initial blitter. @@ -945,7 +945,7 @@ bool SafeLoad(const std::string &filename, SaveLoadOperation fop, DetailedFileTy * special cases which make clients desync immediately. So we fall * back to just generating a new game with the current settings. */ - DEBUG(net, 0, "Loading game failed, so a new (random) game will be started"); + Debug(net, 0, "Loading game failed, so a new (random) game will be started"); MakeNewGame(false, true); return false; } @@ -1136,7 +1136,7 @@ static void CheckCaches() uint i = 0; for (Town *t : Town::Iterate()) { if (MemCmpT(old_town_caches.data() + i, &t->cache) != 0) { - DEBUG(desync, 2, "town cache mismatch: town %i", (int)t->index); + Debug(desync, 2, "town cache mismatch: town {}", t->index); } i++; } @@ -1151,7 +1151,7 @@ static void CheckCaches() i = 0; for (const Company *c : Company::Iterate()) { if (MemCmpT(old_infrastructure.data() + i, &c->infrastructure) != 0) { - DEBUG(desync, 2, "infrastructure cache mismatch: company %i", (int)c->index); + Debug(desync, 2, "infrastructure cache mismatch: company {}", c->index); } i++; } @@ -1208,23 +1208,23 @@ static void CheckCaches() for (const Vehicle *u = v; u != nullptr; u = u->Next()) { FillNewGRFVehicleCache(u); if (memcmp(&grf_cache[length], &u->grf_cache, sizeof(NewGRFCache)) != 0) { - DEBUG(desync, 2, "newgrf cache mismatch: type %i, vehicle %i, company %i, unit number %i, wagon %i", (int)v->type, v->index, (int)v->owner, v->unitnumber, length); + Debug(desync, 2, "newgrf cache mismatch: type {}, vehicle {}, company {}, unit number {}, wagon {}", v->type, v->index, v->owner, v->unitnumber, length); } if (memcmp(&veh_cache[length], &u->vcache, sizeof(VehicleCache)) != 0) { - DEBUG(desync, 2, "vehicle cache mismatch: type %i, vehicle %i, company %i, unit number %i, wagon %i", (int)v->type, v->index, (int)v->owner, v->unitnumber, length); + Debug(desync, 2, "vehicle cache mismatch: type {}, vehicle {}, company {}, unit number {}, wagon {}", v->type, v->index, v->owner, v->unitnumber, length); } switch (u->type) { case VEH_TRAIN: if (memcmp(&gro_cache[length], &Train::From(u)->gcache, sizeof(GroundVehicleCache)) != 0) { - DEBUG(desync, 2, "train ground vehicle cache mismatch: vehicle %i, company %i, unit number %i, wagon %i", v->index, (int)v->owner, v->unitnumber, length); + Debug(desync, 2, "train ground vehicle cache mismatch: vehicle {}, company {}, unit number {}, wagon {}", v->index, v->owner, v->unitnumber, length); } if (memcmp(&tra_cache[length], &Train::From(u)->tcache, sizeof(TrainCache)) != 0) { - DEBUG(desync, 2, "train cache mismatch: vehicle %i, company %i, unit number %i, wagon %i", v->index, (int)v->owner, v->unitnumber, length); + Debug(desync, 2, "train cache mismatch: vehicle {}, company {}, unit number {}, wagon {}", v->index, v->owner, v->unitnumber, length); } break; case VEH_ROAD: if (memcmp(&gro_cache[length], &RoadVehicle::From(u)->gcache, sizeof(GroundVehicleCache)) != 0) { - DEBUG(desync, 2, "road vehicle ground vehicle cache mismatch: vehicle %i, company %i, unit number %i, wagon %i", v->index, (int)v->owner, v->unitnumber, length); + Debug(desync, 2, "road vehicle ground vehicle cache mismatch: vehicle {}, company {}, unit number {}, wagon {}", v->index, v->owner, v->unitnumber, length); } break; default: @@ -1271,11 +1271,11 @@ static void CheckCaches() } UpdateStationDockingTiles(st); if (ta.tile != st->docking_station.tile || ta.w != st->docking_station.w || ta.h != st->docking_station.h) { - DEBUG(desync, 2, "station docking mismatch: station %i, company %i", st->index, (int)st->owner); + Debug(desync, 2, "station docking mismatch: station {}, company {}", st->index, st->owner); } for (TileIndex tile : ta) { if (docking_tiles[tile] != IsDockingTile(tile)) { - DEBUG(desync, 2, "docking tile mismatch: tile %i", (int)tile); + Debug(desync, 2, "docking tile mismatch: tile {}", tile); } } @@ -1283,7 +1283,7 @@ static void CheckCaches() IndustryList industries_near = st->industries_near; st->RecomputeCatchment(); if (st->industries_near != industries_near) { - DEBUG(desync, 2, "station industries near mismatch: station %i", st->index); + Debug(desync, 2, "station industries near mismatch: station {}", st->index); } } @@ -1291,14 +1291,14 @@ static void CheckCaches() i = 0; for (Town *t : Town::Iterate()) { if (t->stations_near != old_town_stations_near[i]) { - DEBUG(desync, 2, "town stations near mismatch: town %i", t->index); + Debug(desync, 2, "town stations near mismatch: town {}", t->index); } i++; } i = 0; for (Industry *ind : Industry::Iterate()) { if (ind->stations_near != old_industry_stations_near[i]) { - DEBUG(desync, 2, "industry stations near mismatch: industry %i", ind->index); + Debug(desync, 2, "industry stations near mismatch: industry {}", ind->index); } i++; } @@ -1406,7 +1406,7 @@ static void DoAutosave() if (++_autosave_ctr >= _settings_client.gui.max_num_autosaves) _autosave_ctr = 0; } - DEBUG(sl, 2, "Autosaving to '%s'", buf); + Debug(sl, 2, "Autosaving to '{}'", buf); if (SaveOrLoad(buf, SLO_SAVE, DFT_GAME_FILE, AUTOSAVE_DIR) != SL_OK) { ShowErrorMessage(STR_ERROR_AUTOSAVE_FAILED, INVALID_STRING_ID, WL_ERROR); } |