@@ -577,7 +577,7 @@ static void DumpSubCommandLog(char *&buffer, const char *last, const CommandLog
|
||||
if (log_index > 0) {
|
||||
log_index--;
|
||||
} else {
|
||||
log_index = cmd_log.log.size() - 1;
|
||||
log_index = (uint)cmd_log.log.size() - 1;
|
||||
}
|
||||
const CommandLogEntry &entry = cmd_log.log[log_index];
|
||||
|
||||
|
@@ -2912,7 +2912,7 @@ DEF_CONSOLE_CMD(ConBankruptCompany)
|
||||
c->bankrupt_value = 42;
|
||||
c->bankrupt_asked = 1 << c->index; // Don't ask the owner
|
||||
c->bankrupt_timeout = 0;
|
||||
c->money = -(UINT64_MAX >> 2);
|
||||
c->money = INT64_MIN / 2;
|
||||
IConsolePrint(CC_DEFAULT, "Company marked as bankrupt.");
|
||||
|
||||
return true;
|
||||
|
@@ -345,8 +345,8 @@ struct DesyncMsgLog {
|
||||
{
|
||||
if (!this->count) return buffer;
|
||||
|
||||
const unsigned int count = std::min<unsigned int>(this->count, this->log.size());
|
||||
unsigned int log_index = (this->next + this->log.size() - count) % this->log.size();
|
||||
const unsigned int count = std::min<unsigned int>(this->count, (uint)this->log.size());
|
||||
unsigned int log_index = (this->next + (uint)this->log.size() - count) % (uint)this->log.size();
|
||||
unsigned int display_num = this->count - count;
|
||||
|
||||
buffer += seprintf(buffer, last, "%s:\n Showing most recent %u of %u messages\n", prefix, count, this->count);
|
||||
|
@@ -577,8 +577,8 @@ DepartureList* MakeDepartureList(StationID station, const std::vector<const Vehi
|
||||
if (_settings_client.gui.departure_smart_terminus && type == D_DEPARTURE) {
|
||||
for (uint i = 0; i < result->size() - 1; ++i) {
|
||||
Departure *d_first = (*result)[i];
|
||||
uint k = d_first->calling_at.size() - 2;
|
||||
for (uint j = d->calling_at.size(); j > 0; --j) {
|
||||
uint k = (uint)d_first->calling_at.size() - 2;
|
||||
for (uint j = (uint)d->calling_at.size(); j > 0; --j) {
|
||||
CallAt c = CallAt(d->calling_at[j - 1]);
|
||||
|
||||
if (d_first->terminus >= c && d_first->calling_at.size() >= 2) {
|
||||
|
@@ -491,7 +491,7 @@ public:
|
||||
this->EnableWidget(WID_DB_SHOW_DEPS);
|
||||
}
|
||||
|
||||
this->vscroll->SetCount(std::min<uint>(_settings_client.gui.max_departures, this->departures->size() + this->arrivals->size()));
|
||||
this->vscroll->SetCount(std::min<uint>(_settings_client.gui.max_departures, (uint)this->departures->size() + (uint)this->arrivals->size()));
|
||||
this->DrawWidgets();
|
||||
}
|
||||
|
||||
@@ -623,7 +623,7 @@ void DeparturesWindow<Twaypoint>::DrawDeparturesListItems(const Rect &r) const
|
||||
int text_right = right - (rtl ? text_offset : 0);
|
||||
|
||||
int y = r.top + 1;
|
||||
uint max_departures = std::min<uint>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), this->departures->size() + this->arrivals->size());
|
||||
uint max_departures = std::min<uint>(this->vscroll->GetPosition() + this->vscroll->GetCapacity(), (uint)this->departures->size() + (uint)this->arrivals->size());
|
||||
|
||||
if (max_departures > _settings_client.gui.max_departures) {
|
||||
max_departures = _settings_client.gui.max_departures;
|
||||
|
@@ -261,7 +261,7 @@ GroundVehicleAcceleration GroundVehicle<T, Type>::GetAcceleration()
|
||||
breakdown_factor /= (Train::From(this)->tcache.cached_num_engines + 2);
|
||||
}
|
||||
/* breakdown_chance is at least 5 (5 / 128 = ~4% of the normal chance) */
|
||||
this->breakdown_chance_factor = std::max(breakdown_factor >> 16, (uint64)5);
|
||||
this->breakdown_chance_factor = Clamp<uint64>(breakdown_factor >> 16, 5, 255);
|
||||
}
|
||||
|
||||
int braking_accel;
|
||||
|
@@ -390,7 +390,7 @@ private:
|
||||
Money this_year = 0;
|
||||
Money last_year = 0;
|
||||
uint32 occupancy = 0;
|
||||
size_t vehicle_count = this->vehicles.size();
|
||||
uint vehicle_count = (uint)this->vehicles.size();
|
||||
|
||||
for (uint i = 0; i < vehicle_count; i++) {
|
||||
const Vehicle *v = this->vehicles[i];
|
||||
|
@@ -161,7 +161,7 @@ public:
|
||||
*/
|
||||
inline void AdjustDemandNodes(LinkGraphJob &job, const std::vector<NodeID> &demands)
|
||||
{
|
||||
const uint count = std::min<uint>(demands.size(), this->missing_supply);
|
||||
const uint count = std::min<uint>((uint)demands.size(), this->missing_supply);
|
||||
this->missing_supply = 0;
|
||||
for (uint i = 0; i < count; i++) {
|
||||
job[demands[i]].ReceiveDemand(1);
|
||||
@@ -371,7 +371,7 @@ void DemandCalculator::CalcMinimisedDistanceDemand(LinkGraphJob &job, const std:
|
||||
|
||||
if (supplies.empty() || demands.empty()) return;
|
||||
|
||||
scaler.SetDemandPerNode(demands.size());
|
||||
scaler.SetDemandPerNode((uint)demands.size());
|
||||
scaler.AdjustDemandNodes(job, demands);
|
||||
|
||||
struct EdgeCandidate {
|
||||
|
@@ -62,7 +62,7 @@ const uint8 LinkGraphOverlay::LINK_COLOURS[][12] = {
|
||||
void LinkGraphOverlay::GetWidgetDpi(DrawPixelInfo *dpi, uint margin) const
|
||||
{
|
||||
const NWidgetBase *wi = this->window->GetWidget<NWidgetBase>(this->widget_id);
|
||||
dpi->left = dpi->top = -margin;
|
||||
dpi->left = dpi->top = -(int)margin;
|
||||
dpi->width = wi->current_x + 2 * margin;
|
||||
dpi->height = wi->current_y + 2 * margin;
|
||||
}
|
||||
|
@@ -425,7 +425,7 @@ void Packet::Recv_string(std::string &buffer, StringValidationSettings settings)
|
||||
|
||||
size_t length = ttd_strnlen((const char *)(this->buffer.data() + this->pos), this->Size() - this->pos - 1);
|
||||
buffer.assign((const char *)(this->buffer.data() + this->pos), length);
|
||||
this->pos += length + 1;
|
||||
this->pos += (uint)length + 1;
|
||||
str_validate_inplace(buffer, settings);
|
||||
}
|
||||
|
||||
|
@@ -95,13 +95,13 @@ void NetworkUDPSocketHandler::SendPacket(Packet *p, NetworkAddress *recv, bool a
|
||||
const uint PAYLOAD_MTU = MTU - (1 + 2 + 8 + 1 + 1 + 2);
|
||||
|
||||
const size_t packet_size = p->Size();
|
||||
const uint8 frag_count = (packet_size + PAYLOAD_MTU - 1) / PAYLOAD_MTU;
|
||||
const uint8 frag_count = (uint8)((packet_size + PAYLOAD_MTU - 1) / PAYLOAD_MTU);
|
||||
|
||||
Packet frag(PACKET_UDP_EX_MULTI);
|
||||
uint8 current_frag = 0;
|
||||
uint16 offset = 0;
|
||||
while (offset < packet_size) {
|
||||
uint16 payload_size = std::min<uint>(PAYLOAD_MTU, packet_size - offset);
|
||||
uint16 payload_size = (uint16)std::min<size_t>(PAYLOAD_MTU, packet_size - offset);
|
||||
frag.Send_uint64(token);
|
||||
frag.Send_uint8 (current_frag);
|
||||
frag.Send_uint8 (frag_count);
|
||||
@@ -501,7 +501,7 @@ void NetworkUDPSocketHandler::Receive_EX_MULTI(Packet *p, NetworkAddress *client
|
||||
for (auto &frag : fs.fragments) {
|
||||
if (!frag.size()) return;
|
||||
|
||||
total_payload += frag.size();
|
||||
total_payload += (uint)frag.size();
|
||||
}
|
||||
|
||||
DEBUG(net, 6, "[udp] merged multi-part packet from %s: " OTTD_PRINTFHEX64 ", %u bytes",
|
||||
|
@@ -565,7 +565,7 @@ NetworkRecvStatus ClientNetworkGameSocketHandler::SendDesyncLog(const std::strin
|
||||
for (size_t offset = 0; offset < log.size();) {
|
||||
Packet *p = new Packet(PACKET_CLIENT_DESYNC_LOG, SHRT_MAX);
|
||||
size_t size = std::min<size_t>(log.size() - offset, SHRT_MAX - 2 - p->Size());
|
||||
p->Send_uint16(size);
|
||||
p->Send_uint16((uint16)size);
|
||||
p->Send_binary(log.data() + offset, size);
|
||||
my_client->SendPacket(p);
|
||||
|
||||
|
@@ -254,7 +254,7 @@ void ClientNetworkContentSocketHandler::RequestContentList(ContentVector *cv, bo
|
||||
|
||||
while (cv->size() > offset) {
|
||||
Packet *p = new Packet(send_md5sum ? PACKET_CONTENT_CLIENT_INFO_EXTID_MD5 : PACKET_CONTENT_CLIENT_INFO_EXTID, TCP_MTU);
|
||||
const uint to_send = std::min<uint>(cv->size() - offset, max_per_packet);
|
||||
const uint to_send = (uint)std::min<uint>(cv->size() - offset, max_per_packet);
|
||||
p->Send_uint8(to_send);
|
||||
|
||||
for (uint i = 0; i < to_send; i++) {
|
||||
|
@@ -634,7 +634,7 @@ static LONG WINAPI ExceptionHandler(EXCEPTION_POINTERS *ep)
|
||||
if (abort_reason != nullptr) {
|
||||
wchar_t _emergency_crash[512];
|
||||
_snwprintf(_emergency_crash, lengthof(_emergency_crash),
|
||||
L"A serious fault condition occurred in the game. The game will shut down. (%s)\n", OTTD2FS(abort_reason));
|
||||
L"A serious fault condition occurred in the game. The game will shut down. (%s)\n", OTTD2FS(abort_reason).c_str());
|
||||
MessageBox(nullptr, _emergency_crash, L"Fatal Application Failure", MB_ICONERROR);
|
||||
ExitProcess(3);
|
||||
}
|
||||
|
@@ -342,9 +342,9 @@ static void CheckCurveLookAhead(const Train *v, TrainReservationLookAhead *looka
|
||||
static int LookaheadTileHeightForChunnel(int length, int offset)
|
||||
{
|
||||
if (offset == 0) return 0;
|
||||
if (offset < 3) return -1 * TILE_HEIGHT;
|
||||
if (offset < length - 3) return -2 * TILE_HEIGHT;
|
||||
if (offset < length) return -1 * TILE_HEIGHT;
|
||||
if (offset < 3) return -1 * (int)TILE_HEIGHT;
|
||||
if (offset < length - 3) return -2 * (int)TILE_HEIGHT;
|
||||
if (offset < length) return -1 * (int)TILE_HEIGHT;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -861,7 +861,7 @@ void TryCreateLookAheadForTrainInTunnelBridge(Train *t)
|
||||
int z = IsBridge(t->tile) ? GetBridgeHeight(t->tile) : GetTilePixelZ(t->tile);
|
||||
|
||||
/* Middle signals */
|
||||
int offset = -TILE_SIZE;
|
||||
int offset = -(int)TILE_SIZE;
|
||||
for (int i = 0; i < signals; i++) {
|
||||
offset += TILE_SIZE * spacing;
|
||||
t->lookahead->AddSignal(signal_speed, offset, HasBit(t->lookahead->flags, TRLF_CHUNNEL) ? LookaheadTileHeightForChunnel(length, i * spacing) : z);
|
||||
|
@@ -205,8 +205,8 @@ void SignalSlotCondition::SetSlot(TraceRestrictSlotID slot_id)
|
||||
|
||||
const TraceRestrictSlot *slot = TraceRestrictSlot::Get(this->slot_id);
|
||||
switch (this->cond_code) {
|
||||
case PSC_SLOT_OCC: return this->EvaluateComparable(slot->occupants.size());
|
||||
case PSC_SLOT_OCC_REM: return this->EvaluateComparable(slot->max_occupancy > slot->occupants.size() ? slot->max_occupancy - slot->occupants.size() : 0);
|
||||
case PSC_SLOT_OCC: return this->EvaluateComparable((uint)slot->occupants.size());
|
||||
case PSC_SLOT_OCC_REM: return this->EvaluateComparable(slot->max_occupancy > (uint)slot->occupants.size() ? slot->max_occupancy - (uint)slot->occupants.size() : 0);
|
||||
default: NOT_REACHED();
|
||||
}
|
||||
}
|
||||
|
@@ -711,7 +711,7 @@ private:
|
||||
|
||||
void RebuildInstructionList()
|
||||
{
|
||||
uint old_len = this->instructions.size();
|
||||
uint old_len = (uint)this->instructions.size();
|
||||
this->instructions.clear();
|
||||
SignalInstruction *insn = program->first_instruction;
|
||||
uint indent = 0;
|
||||
@@ -774,7 +774,7 @@ private:
|
||||
}
|
||||
} while (insn);
|
||||
|
||||
this->vscroll->SetCount(this->instructions.size());
|
||||
this->vscroll->SetCount((uint)this->instructions.size());
|
||||
if (this->instructions.size() != old_len)
|
||||
selected_instruction = -1;
|
||||
UpdateButtonState();
|
||||
|
@@ -3005,7 +3005,7 @@ CommandCost CmdConvertRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
if (!IsRoadStopTile(tile) && owner == _current_company) {
|
||||
ConvertRoadTypeOwner(tile, num_pieces, owner, from_type, to_type);
|
||||
} else {
|
||||
UpdateCompanyRoadInfrastructure(from_type, owner, -num_pieces);
|
||||
UpdateCompanyRoadInfrastructure(from_type, owner, -(int)num_pieces);
|
||||
UpdateCompanyRoadInfrastructure(to_type, owner, num_pieces);
|
||||
}
|
||||
|
||||
@@ -3080,7 +3080,7 @@ CommandCost CmdConvertRoad(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3
|
||||
SetTunnelBridgeOwner(tile, endtile, _current_company);
|
||||
}
|
||||
} else {
|
||||
UpdateCompanyRoadInfrastructure(from_type, owner, -(tile_pieces + end_pieces));
|
||||
UpdateCompanyRoadInfrastructure(from_type, owner, -(int)(tile_pieces + end_pieces));
|
||||
UpdateCompanyRoadInfrastructure(to_type, owner, tile_pieces + end_pieces);
|
||||
}
|
||||
|
||||
|
@@ -1529,7 +1529,7 @@ static void RoadVehCheckFinishOvertake(RoadVehicle *v)
|
||||
check_tile = TileAddWrap(check_tile, -ti.x, -ti.y);
|
||||
}
|
||||
|
||||
if (check_ahead > 0) {
|
||||
if (check_ahead) {
|
||||
TileIndex ahead_tile = TileAddWrap(check_tile, ti.x, ti.y);
|
||||
if (ahead_tile != INVALID_TILE) {
|
||||
if (HasVehicleOnPos(ahead_tile, VEH_ROAD, &od, EnumFindVehBlockingFinishOvertake)) return;
|
||||
|
@@ -37,7 +37,7 @@ static void Load_XBSS()
|
||||
static void RealSave_XBSS(const LongBridgeSignalStorage *lbss)
|
||||
{
|
||||
LongBridgeSignalStorageStub stub;
|
||||
stub.length = lbss->signal_red_bits.size();
|
||||
stub.length = (uint32)lbss->signal_red_bits.size();
|
||||
SlObject(&stub, _long_bridge_signal_storage_stub_desc);
|
||||
SlArray(const_cast<uint64*>(&(lbss->signal_red_bits[0])), stub.length, SLE_UINT64);
|
||||
}
|
||||
|
@@ -127,7 +127,7 @@ static void Save_CHTX()
|
||||
|
||||
SlAutolength([](void *) {
|
||||
SlWriteUint32(0); // flags
|
||||
SlWriteUint32(lengthof(_extra_cheat_descs) + _unknown_cheats.size()); // cheat count
|
||||
SlWriteUint32((uint32)(lengthof(_extra_cheat_descs) + _unknown_cheats.size())); // cheat count
|
||||
|
||||
for (uint j = 0; j < lengthof(_extra_cheat_descs); j++) {
|
||||
CheatsExtSave save = { _extra_cheat_descs[j].name, *(_extra_cheat_descs[j].cht) };
|
||||
|
@@ -473,7 +473,7 @@ static void Save_SLXI()
|
||||
if (_sl_xv_feature_versions[info->index] > 0) {
|
||||
item_count++;
|
||||
length += 6;
|
||||
length += SlCalcObjLength(info, _xlsi_sub_chunk_desc);
|
||||
length += (uint32)SlCalcObjLength(info, _xlsi_sub_chunk_desc);
|
||||
if (info->save_proc) {
|
||||
uint32 extra_data_length = info->save_proc(info, true);
|
||||
if (extra_data_length) {
|
||||
@@ -644,7 +644,7 @@ static void loadVL(const SlxiSubChunkInfo *info, uint32 length)
|
||||
|
||||
static uint32 saveVL(const SlxiSubChunkInfo *info, bool dry_run)
|
||||
{
|
||||
uint32 length = strlen(_openttd_revision);
|
||||
size_t length = strlen(_openttd_revision);
|
||||
if (!dry_run) MemoryDumper::GetCurrent()->CopyBytes(reinterpret_cast<const byte *>(_openttd_revision), length);
|
||||
return length;
|
||||
}
|
||||
|
@@ -49,7 +49,7 @@ void AfterLoadLabelMaps()
|
||||
|
||||
railtype_conversion_map[i] = r;
|
||||
}
|
||||
for (uint i = _railtype_list.size(); i < RAILTYPE_END; i++) {
|
||||
for (uint i = (uint)_railtype_list.size(); i < RAILTYPE_END; i++) {
|
||||
railtype_conversion_map[i] = RAILTYPE_RAIL;
|
||||
}
|
||||
|
||||
|
@@ -28,10 +28,10 @@ static const SaveLoad _plan_desc[] = {
|
||||
static void RealSave_PLAN(Plan *p)
|
||||
{
|
||||
SlObject(p, _plan_desc);
|
||||
SlWriteUint32(p->lines.size());
|
||||
SlWriteUint32((uint32)p->lines.size());
|
||||
for (size_t i = 0; i < p->lines.size(); i++) {
|
||||
PlanLine *pl = p->lines[i];
|
||||
SlWriteUint32(pl->tiles.size());
|
||||
SlWriteUint32((uint32)pl->tiles.size());
|
||||
SlArray(&pl->tiles[0], pl->tiles.size(), SLE_UINT32);
|
||||
}
|
||||
}
|
||||
|
@@ -171,8 +171,8 @@ void MemoryDumper::Flush(SaveFilter *writer)
|
||||
{
|
||||
this->FinaliseBlock();
|
||||
|
||||
uint block_count = this->blocks.size();
|
||||
for (uint i = 0; i < block_count; i++) {
|
||||
size_t block_count = this->blocks.size();
|
||||
for (size_t i = 0; i < block_count; i++) {
|
||||
writer->Write(this->blocks[i].data, this->blocks[i].size);
|
||||
}
|
||||
|
||||
|
@@ -146,14 +146,14 @@ static void Save_SPRG()
|
||||
|
||||
// OK, we can now write out our programs
|
||||
Buffer b;
|
||||
WriteVLI(b, _signal_programs.size());
|
||||
WriteVLI(b, (uint)_signal_programs.size());
|
||||
for(ProgramList::iterator i = _signal_programs.begin(), e = _signal_programs.end();
|
||||
i != e; ++i) {
|
||||
SignalProgram *prog = i->second;
|
||||
|
||||
WriteVLI(b, prog->tile);
|
||||
WriteVLI(b, prog->track);
|
||||
WriteVLI(b, prog->instructions.size());
|
||||
WriteVLI(b, (uint)prog->instructions.size());
|
||||
for (SignalInstruction *insn : prog->instructions) {
|
||||
WriteVLI(b, insn->Opcode());
|
||||
if(insn->Opcode() != PSO_FIRST)
|
||||
@@ -195,7 +195,7 @@ static void Save_SPRG()
|
||||
}
|
||||
}
|
||||
|
||||
uint size = b.size();
|
||||
uint size = (uint)b.size();
|
||||
SlSetLength(size);
|
||||
for(uint i = 0; i < size; i++) {
|
||||
SlWriteByte(b[i]); // TODO Gotta be a better way
|
||||
@@ -223,14 +223,14 @@ typedef std::vector<Fixup> FixupList;
|
||||
template<typename T>
|
||||
static void MakeFixup(FixupList &l, T *&ir, uint id, SignalOpcode op = PSO_INVALID)
|
||||
{
|
||||
ir = reinterpret_cast<T*>(id);
|
||||
ir = reinterpret_cast<T*>((size_t)id);
|
||||
l.emplace_back(reinterpret_cast<SignalInstruction**>(&ir), op);
|
||||
}
|
||||
|
||||
static void DoFixups(FixupList &l, InstructionList &il)
|
||||
{
|
||||
for (Fixup &i : l) {
|
||||
uint id = reinterpret_cast<size_t>(*(i.ptr));
|
||||
uint id = (uint)reinterpret_cast<size_t>(*(i.ptr));
|
||||
if (id >= il.size())
|
||||
NOT_REACHED();
|
||||
|
||||
|
@@ -517,7 +517,7 @@ static void RealSave_STNN(BaseStation *bst)
|
||||
Station *st = Station::From(bst);
|
||||
for (CargoID i = 0; i < NUM_CARGO; i++) {
|
||||
_num_dests = (uint32)st->goods[i].cargo.Packets()->MapSize();
|
||||
_num_flows = st->goods[i].flows.size();
|
||||
_num_flows = (uint32)st->goods[i].flows.size();
|
||||
SlObjectSaveFiltered(&st->goods[i], _filtered_goods_desc.data());
|
||||
for (FlowStatMap::const_iterator outer_it(st->goods[i].flows.begin()); outer_it != st->goods[i].flows.end(); ++outer_it) {
|
||||
uint32 sum_shares = 0;
|
||||
@@ -525,7 +525,7 @@ static void RealSave_STNN(BaseStation *bst)
|
||||
flow.source = outer_it->GetOrigin();
|
||||
dumper->CheckBytes(2 + 4);
|
||||
dumper->RawWriteUint16(flow.source);
|
||||
dumper->RawWriteUint32(outer_it->size());
|
||||
dumper->RawWriteUint32((uint32)outer_it->size());
|
||||
FlowStat::const_iterator inner_it(outer_it->begin());
|
||||
const FlowStat::const_iterator end(outer_it->end());
|
||||
for (; inner_it != end; ++inner_it) {
|
||||
|
@@ -97,7 +97,7 @@ static void Load_TRRP()
|
||||
static void RealSave_TRRP(TraceRestrictProgram *prog)
|
||||
{
|
||||
TraceRestrictProgramStub stub;
|
||||
stub.length = prog->items.size();
|
||||
stub.length = (uint32)prog->items.size();
|
||||
SlObject(&stub, _trace_restrict_program_stub_desc);
|
||||
SlArray(&(prog->items[0]), stub.length, SLE_UINT32);
|
||||
}
|
||||
@@ -154,7 +154,7 @@ static void RealSave_TRRS(TraceRestrictSlot *slot)
|
||||
{
|
||||
SlObject(slot, _trace_restrict_slot_desc);
|
||||
TraceRestrictSlotStub stub;
|
||||
stub.length = slot->occupants.size();
|
||||
stub.length = (uint32)slot->occupants.size();
|
||||
SlObject(&stub, _trace_restrict_slot_stub_desc);
|
||||
if (stub.length) SlArray(&(slot->occupants[0]), stub.length, SLE_UINT32);
|
||||
}
|
||||
|
@@ -1434,11 +1434,11 @@ const SaveLoad *GetVehicleLookAheadCurveDescription()
|
||||
static void RealSave_VLKA(TrainReservationLookAhead *lookahead)
|
||||
{
|
||||
SlObject(lookahead, GetVehicleLookAheadDescription());
|
||||
SlWriteUint32(lookahead->items.size());
|
||||
SlWriteUint32((uint32)lookahead->items.size());
|
||||
for (TrainReservationLookAheadItem &item : lookahead->items) {
|
||||
SlObject(&item, GetVehicleLookAheadItemDescription());
|
||||
}
|
||||
SlWriteUint32(lookahead->curves.size());
|
||||
SlWriteUint32((uint32)lookahead->curves.size());
|
||||
for (TrainReservationLookAheadCurve &curve : lookahead->curves) {
|
||||
SlObject(&curve, GetVehicleLookAheadCurveDescription());
|
||||
}
|
||||
|
@@ -219,7 +219,7 @@ struct SchdispatchWindow : Window {
|
||||
{
|
||||
this->item_count = 0;
|
||||
if (this->vehicle->orders.list != nullptr) {
|
||||
this->item_count = this->vehicle->orders.list->GetScheduledDispatch().size();
|
||||
this->item_count = (uint)this->vehicle->orders.list->GetScheduledDispatch().size();
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -2915,7 +2915,7 @@ static void SaveSettingsPatx(const SettingDesc *sd, void *object)
|
||||
size_t length = 8;
|
||||
for (const SettingDesc *desc = sd; desc->save.cmd != SL_END; desc++) {
|
||||
if (desc->patx_name == nullptr) continue;
|
||||
uint32 setting_length = SlCalcObjMemberLength(object, &desc->save);
|
||||
uint32 setting_length = (uint32)SlCalcObjMemberLength(object, &desc->save);
|
||||
if (!setting_length) continue;
|
||||
|
||||
current_setting.name = desc->patx_name;
|
||||
@@ -2933,7 +2933,7 @@ static void SaveSettingsPatx(const SettingDesc *sd, void *object)
|
||||
SlSetLength(length);
|
||||
|
||||
SlWriteUint32(0); // flags
|
||||
SlWriteUint32(settings_to_add.size()); // settings count
|
||||
SlWriteUint32((uint32)settings_to_add.size()); // settings count
|
||||
|
||||
for (size_t i = 0; i < settings_to_add.size(); i++) {
|
||||
const SettingDesc *desc = settings_to_add[i].setting;
|
||||
@@ -3060,7 +3060,7 @@ void SaveSettingsPlyx()
|
||||
uint32 setting_count = 0;
|
||||
for (const SettingDesc *desc = _company_settings; desc->save.cmd != SL_END; desc++) {
|
||||
if (desc->patx_name == nullptr) continue;
|
||||
uint32 setting_length = SlCalcObjMemberLength(&(c->settings), &desc->save);
|
||||
uint32 setting_length = (uint32)SlCalcObjMemberLength(&(c->settings), &desc->save);
|
||||
if (!setting_length) continue;
|
||||
|
||||
current_setting.name = desc->patx_name;
|
||||
@@ -3091,7 +3091,7 @@ void SaveSettingsPlyx()
|
||||
|
||||
for (const SettingDesc *desc = _company_settings; desc->save.cmd != SL_END; desc++) {
|
||||
if (desc->patx_name == nullptr) continue;
|
||||
uint32 setting_length = SlCalcObjMemberLength(&(c->settings), &desc->save);
|
||||
uint32 setting_length = (uint32)SlCalcObjMemberLength(&(c->settings), &desc->save);
|
||||
if (!setting_length) continue;
|
||||
|
||||
current_setting.flags = 0;
|
||||
|
@@ -435,8 +435,8 @@ static SigInfo ExploreSegment(Owner owner)
|
||||
if (enterdir == INVALID_DIAGDIR) {
|
||||
// incoming from the wormhole, onto signal
|
||||
if (!(info.flags & SF_TRAIN) && IsTunnelBridgeSignalSimulationExit(tile)) { // tunnel entrance is ignored
|
||||
if (HasVehicleOnPos(GetOtherTunnelBridgeEnd(tile), VEH_TRAIN, reinterpret_cast<void *>(tile), &TrainInWormholeTileEnum)) info.flags |= SF_TRAIN;
|
||||
if (!(info.flags & SF_TRAIN) && HasVehicleOnPos(tile, VEH_TRAIN, reinterpret_cast<void *>(tile), &TrainInWormholeTileEnum)) info.flags |= SF_TRAIN;
|
||||
if (HasVehicleOnPos(GetOtherTunnelBridgeEnd(tile), VEH_TRAIN, reinterpret_cast<void *>((uintptr_t)tile), &TrainInWormholeTileEnum)) info.flags |= SF_TRAIN;
|
||||
if (!(info.flags & SF_TRAIN) && HasVehicleOnPos(tile, VEH_TRAIN, reinterpret_cast<void *>((uintptr_t)tile), &TrainInWormholeTileEnum)) info.flags |= SF_TRAIN;
|
||||
}
|
||||
if (IsTunnelBridgeSignalSimulationExit(tile) && !_tbuset.Add(tile, INVALID_TRACKDIR)) {
|
||||
info.flags |= SF_FULL;
|
||||
@@ -458,9 +458,9 @@ static SigInfo ExploreSegment(Owner owner)
|
||||
}
|
||||
}
|
||||
if (!(info.flags & SF_TRAIN)) {
|
||||
if (HasVehicleOnPos(tile, VEH_TRAIN, reinterpret_cast<void *>(tile), &TrainInWormholeTileEnum)) info.flags |= SF_TRAIN;
|
||||
if (HasVehicleOnPos(tile, VEH_TRAIN, reinterpret_cast<void *>((uintptr_t)tile), &TrainInWormholeTileEnum)) info.flags |= SF_TRAIN;
|
||||
if (!(info.flags & SF_TRAIN) && IsTunnelBridgeSignalSimulationExit(tile)) {
|
||||
if (HasVehicleOnPos(GetOtherTunnelBridgeEnd(tile), VEH_TRAIN, reinterpret_cast<void *>(tile), &TrainInWormholeTileEnum)) info.flags |= SF_TRAIN;
|
||||
if (HasVehicleOnPos(GetOtherTunnelBridgeEnd(tile), VEH_TRAIN, reinterpret_cast<void *>((uintptr_t)tile), &TrainInWormholeTileEnum)) info.flags |= SF_TRAIN;
|
||||
}
|
||||
}
|
||||
continue;
|
||||
|
@@ -273,7 +273,7 @@ uint GetSpriteCountForFile(const std::string &filename, SpriteID begin, SpriteID
|
||||
*/
|
||||
uint GetMaxSpriteID()
|
||||
{
|
||||
return _spritecache.size();
|
||||
return (uint)_spritecache.size();
|
||||
}
|
||||
|
||||
static bool ResizeSpriteIn(SpriteLoader::Sprite *sprite, ZoomLevel src, ZoomLevel tgt)
|
||||
@@ -849,7 +849,7 @@ void IncreaseSpriteLRU()
|
||||
static void *AllocSprite(size_t mem_req)
|
||||
{
|
||||
assert(_last_sprite_allocation.GetPtr() == nullptr);
|
||||
_last_sprite_allocation.Allocate(mem_req);
|
||||
_last_sprite_allocation.Allocate((uint32)mem_req);
|
||||
return _last_sprite_allocation.GetPtr();
|
||||
}
|
||||
|
||||
|
@@ -452,7 +452,7 @@ public:
|
||||
std::pair<iterator, bool> insert(FlowStat flow_stat)
|
||||
{
|
||||
StationID st = flow_stat.GetOrigin();
|
||||
auto res = this->flows_index.insert(std::pair<StationID, uint16>(st, this->flows_storage.size()));
|
||||
auto res = this->flows_index.insert(std::pair<StationID, uint16>(st, (uint16)this->flows_storage.size()));
|
||||
if (res.second) {
|
||||
this->flows_storage.push_back(std::move(flow_stat));
|
||||
}
|
||||
@@ -461,7 +461,7 @@ public:
|
||||
|
||||
iterator insert(iterator hint, FlowStat flow_stat)
|
||||
{
|
||||
auto res = this->flows_index.insert(hint.current, std::pair<StationID, uint16>(flow_stat.GetOrigin(), this->flows_storage.size()));
|
||||
auto res = this->flows_index.insert(hint.current, std::pair<StationID, uint16>(flow_stat.GetOrigin(), (uint16)this->flows_storage.size()));
|
||||
if (res->second == this->flows_storage.size()) {
|
||||
this->flows_storage.push_back(std::move(flow_stat));
|
||||
}
|
||||
|
@@ -4451,7 +4451,7 @@ uint MoveGoodsToStation(CargoID type, uint amount, SourceType source_type, Sourc
|
||||
});
|
||||
|
||||
uint to_deliver = amount - moving;
|
||||
uint step_size = CeilDivT<uint>(to_deliver, used_stations.size());
|
||||
uint step_size = CeilDivT<uint>(to_deliver, (uint)used_stations.size());
|
||||
for (uint i = 0; i < used_stations.size() && to_deliver > 0; i++) {
|
||||
uint delivery = std::min<uint>(to_deliver, step_size);
|
||||
used_stations[i].second += delivery;
|
||||
|
@@ -578,7 +578,7 @@ public:
|
||||
|
||||
this->groups.shrink_to_fit();
|
||||
this->groups.RebuildDone();
|
||||
this->vscroll[0]->SetCount(groups.size());
|
||||
this->vscroll[0]->SetCount((uint)groups.size());
|
||||
}
|
||||
|
||||
void BuildTemplateGuiList()
|
||||
@@ -593,7 +593,7 @@ public:
|
||||
int left = r.left + WD_MATRIX_LEFT;
|
||||
int right = r.right - WD_MATRIX_RIGHT;
|
||||
int y = r.top;
|
||||
int max = std::min<int>(this->vscroll[0]->GetPosition() + this->vscroll[0]->GetCapacity(), this->groups.size());
|
||||
int max = std::min<int>(this->vscroll[0]->GetPosition() + this->vscroll[0]->GetCapacity(), (int)this->groups.size());
|
||||
|
||||
/* Then treat all groups defined by/for the current company */
|
||||
for (int i = this->vscroll[0]->GetPosition(); i < max; ++i) {
|
||||
@@ -651,7 +651,7 @@ public:
|
||||
int y = r.top;
|
||||
|
||||
Scrollbar *draw_vscroll = vscroll[1];
|
||||
uint max = std::min<uint>(draw_vscroll->GetPosition() + draw_vscroll->GetCapacity(), this->templates.size());
|
||||
uint max = std::min<uint>(draw_vscroll->GetPosition() + draw_vscroll->GetCapacity(), (uint)this->templates.size());
|
||||
|
||||
const TemplateVehicle *v;
|
||||
for (uint i = draw_vscroll->GetPosition(); i < max; ++i) {
|
||||
|
@@ -97,7 +97,7 @@ void BuildTemplateGuiList(GUITemplateList *list, Scrollbar *vscroll, Owner oid,
|
||||
}
|
||||
|
||||
list->RebuildDone();
|
||||
if (vscroll) vscroll->SetCount(list->size());
|
||||
if (vscroll) vscroll->SetCount((uint)list->size());
|
||||
}
|
||||
|
||||
Money CalculateOverallTemplateCost(const TemplateVehicle *tv)
|
||||
|
@@ -688,7 +688,7 @@ void UpdateSeparationOrder(Vehicle *v_start)
|
||||
const uint duration = v_start->orders.list->GetTotalDuration();
|
||||
Vehicle *v = Vehicle::Get(progress_array.back().id);
|
||||
Vehicle *v_ahead = Vehicle::Get(progress_array.front().id);
|
||||
uint behind_index = progress_array.size() - 1;
|
||||
uint behind_index = (uint)progress_array.size() - 1;
|
||||
for (uint i = 0; i < progress_array.size(); i++) {
|
||||
const TimetableProgress &info_behind = progress_array[behind_index];
|
||||
behind_index = i;
|
||||
|
@@ -284,7 +284,7 @@ struct TimetableWindow : Window {
|
||||
assert(HasBit(v->vehicle_flags, VF_TIMETABLE_STARTED));
|
||||
|
||||
bool travelling = (!(v->current_order.IsAnyLoadingType() || v->current_order.IsType(OT_WAITING)) || v->current_order.GetNonStopType() == ONSF_STOP_EVERYWHERE);
|
||||
Ticks start_time = -v->current_order_time;
|
||||
Ticks start_time = -(Ticks)v->current_order_time;
|
||||
if (v->cur_timetable_order_index != INVALID_VEH_ORDER_ID && v->cur_timetable_order_index != v->cur_real_order_index) {
|
||||
/* vehicle is taking a conditional order branch, adjust start time to compensate */
|
||||
const Order *real_current_order = v->GetOrder(v->cur_real_order_index);
|
||||
|
@@ -1303,7 +1303,7 @@ public:
|
||||
|
||||
uint NumHouseSets() const
|
||||
{
|
||||
return this->house_sets.size() - 1; // last item is a terminator
|
||||
return (uint)this->house_sets.size() - 1; // last item is a terminator
|
||||
}
|
||||
|
||||
uint NumHousesInHouseSet(uint house_set) const
|
||||
@@ -1388,7 +1388,7 @@ public:
|
||||
}
|
||||
}
|
||||
/* put a terminator on the list to make counting easier */
|
||||
this->house_sets.push_back(this->size());
|
||||
this->house_sets.push_back((uint)this->size());
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1854,7 +1854,7 @@ struct SelectTownWindow : Window {
|
||||
{
|
||||
this->CreateNestedTree();
|
||||
this->vscroll = this->GetScrollbar(WID_ST_SCROLLBAR);
|
||||
this->vscroll->SetCount(this->towns.size());
|
||||
this->vscroll->SetCount((uint)this->towns.size());
|
||||
this->FinishInitNested();
|
||||
}
|
||||
|
||||
|
@@ -381,11 +381,11 @@ void TraceRestrictProgram::Execute(const Train* v, const TraceRestrictProgramInp
|
||||
const TraceRestrictSlot *slot = TraceRestrictSlot::GetIfValid(GetTraceRestrictValue(item));
|
||||
switch (static_cast<TraceRestrictSlotOccupancyCondAuxField>(GetTraceRestrictAuxField(item))) {
|
||||
case TRSOCAF_OCCUPANTS:
|
||||
result = TestCondition(slot != nullptr ? slot->occupants.size() : 0, condop, value);
|
||||
result = TestCondition(slot != nullptr ? (uint)slot->occupants.size() : 0, condop, value);
|
||||
break;
|
||||
|
||||
case TRSOCAF_REMAINING:
|
||||
result = TestCondition(slot != nullptr ? slot->max_occupancy - slot->occupants.size() : 0, condop, value);
|
||||
result = TestCondition(slot != nullptr ? slot->max_occupancy - (uint)slot->occupants.size() : 0, condop, value);
|
||||
break;
|
||||
|
||||
default:
|
||||
@@ -1455,7 +1455,7 @@ CommandCost CmdProgramSignalTraceRestrict(TileIndex tile, DoCommandFlag flags, u
|
||||
}
|
||||
|
||||
uint32 offset_limit_exclusive = ((type == TRDCT_INSERT_ITEM) ? 1 : 0);
|
||||
if (prog) offset_limit_exclusive += prog->items.size();
|
||||
if (prog) offset_limit_exclusive += (uint)prog->items.size();
|
||||
|
||||
if (offset >= offset_limit_exclusive) {
|
||||
return_cmd_error(STR_TRACE_RESTRICT_ERROR_OFFSET_TOO_LARGE);
|
||||
|
@@ -2370,7 +2370,7 @@ private:
|
||||
int GetItemCount(const TraceRestrictProgram *prog) const
|
||||
{
|
||||
if (prog) {
|
||||
return 2 + prog->GetInstructionCount();
|
||||
return 2 + (int)prog->GetInstructionCount();
|
||||
} else {
|
||||
return 2;
|
||||
}
|
||||
@@ -2987,7 +2987,7 @@ private:
|
||||
|
||||
if (offset >= (TraceRestrictProgram::GetInstructionCount(items) + (replace ? 0 : 1))) return false; // off the end of the program
|
||||
|
||||
uint array_offset = TraceRestrictProgram::InstructionOffsetToArrayOffset(items, offset);
|
||||
uint array_offset = (uint)TraceRestrictProgram::InstructionOffsetToArrayOffset(items, offset);
|
||||
if (replace) {
|
||||
items[array_offset] = item;
|
||||
} else {
|
||||
@@ -3010,7 +3010,7 @@ private:
|
||||
}
|
||||
|
||||
/**
|
||||
* Run GenericElseInsertionDryRun with an elif instruction
|
||||
* Run GenericElseInsertionDr;yRun with an elif instruction
|
||||
*/
|
||||
bool ElseIfInsertionDryRun(bool replace)
|
||||
{
|
||||
@@ -3456,8 +3456,8 @@ public:
|
||||
|
||||
this->BuildSlotList(this->owner);
|
||||
|
||||
this->slot_sb->SetCount(this->slots.size());
|
||||
this->vscroll->SetCount(this->vehgroups.size());
|
||||
this->slot_sb->SetCount((uint)this->slots.size());
|
||||
this->vscroll->SetCount((uint)this->vehgroups.size());
|
||||
|
||||
/* Disable the slot specific function when we select all vehicles */
|
||||
this->SetWidgetsDisabledState(this->vli.index == ALL_TRAINS_TRACE_RESTRICT_SLOT_ID || _local_company != this->vli.company,
|
||||
@@ -3493,7 +3493,7 @@ public:
|
||||
|
||||
case WID_TRSL_LIST_SLOTS: {
|
||||
int y1 = r.top + WD_FRAMERECT_TOP;
|
||||
int max = std::min<int>(this->slot_sb->GetPosition() + this->slot_sb->GetCapacity(), this->slots.size());
|
||||
int max = std::min<int>(this->slot_sb->GetPosition() + this->slot_sb->GetCapacity(), (int)this->slots.size());
|
||||
for (int i = this->slot_sb->GetPosition(); i < max; ++i) {
|
||||
const TraceRestrictSlot *slot = this->slots[i];
|
||||
|
||||
@@ -3997,7 +3997,7 @@ public:
|
||||
{
|
||||
this->BuildCounterList();
|
||||
|
||||
this->sb->SetCount(this->ctrs.size());
|
||||
this->sb->SetCount((uint)this->ctrs.size());
|
||||
|
||||
/* Disable the counter specific functions when no counter is selected */
|
||||
this->SetWidgetsDisabledState(this->selected == INVALID_TRACE_RESTRICT_COUNTER_ID || _local_company != this->ctr_company,
|
||||
@@ -4024,7 +4024,7 @@ public:
|
||||
switch (widget) {
|
||||
case WID_TRCL_LIST_COUNTERS: {
|
||||
int y1 = r.top + WD_FRAMERECT_TOP;
|
||||
int max = std::min<int>(this->sb->GetPosition() + this->sb->GetCapacity(), this->ctrs.size());
|
||||
int max = std::min<int>(this->sb->GetPosition() + this->sb->GetCapacity(), (int)this->ctrs.size());
|
||||
for (int i = this->sb->GetPosition(); i < max; ++i) {
|
||||
const TraceRestrictCounter *ctr = this->ctrs[i];
|
||||
|
||||
|
@@ -2472,12 +2472,12 @@ static bool TrainApproachingCrossing(TileIndex tile)
|
||||
DiagDirection dir = AxisToDiagDir(GetCrossingRailAxis(tile));
|
||||
TileIndex tile_from = tile + TileOffsByDiagDir(dir);
|
||||
|
||||
if (HasVehicleOnPos(tile_from, VEH_TRAIN, reinterpret_cast<void *>(tile), &TrainApproachingCrossingEnum)) return true;
|
||||
if (HasVehicleOnPos(tile_from, VEH_TRAIN, reinterpret_cast<void *>((uintptr_t)tile), &TrainApproachingCrossingEnum)) return true;
|
||||
|
||||
dir = ReverseDiagDir(dir);
|
||||
tile_from = tile + TileOffsByDiagDir(dir);
|
||||
|
||||
return HasVehicleOnPos(tile_from, VEH_TRAIN, reinterpret_cast<void *>(tile), &TrainApproachingCrossingEnum);
|
||||
return HasVehicleOnPos(tile_from, VEH_TRAIN, reinterpret_cast<void *>((uintptr_t)tile), &TrainApproachingCrossingEnum);
|
||||
}
|
||||
|
||||
/** Check if the crossing should be closed
|
||||
@@ -2829,7 +2829,7 @@ void ReverseTrainDirection(Train *v)
|
||||
* Prevent setting the wrong signals by making wait_counter a non-integer multiple of TILE_SIZE.
|
||||
* Use a huge value so that the train will reverse again if there is another vehicle coming the other way.
|
||||
*/
|
||||
t->wait_counter = static_cast<uint16>(-(TILE_SIZE / 2));
|
||||
t->wait_counter = static_cast<uint16>(-((int)TILE_SIZE / 2));
|
||||
t->tunnel_bridge_signal_num = 0;
|
||||
}
|
||||
};
|
||||
@@ -3264,7 +3264,7 @@ static int GetAndClearLastBridgeEntranceSetSignalIndex(TileIndex bridge_entrance
|
||||
auto it = _long_bridge_signal_sim_map.find(bridge_entrance);
|
||||
if (it != _long_bridge_signal_sim_map.end()) {
|
||||
LongBridgeSignalStorage &lbss = it->second;
|
||||
size_t slot = lbss.signal_red_bits.size();
|
||||
uint slot = (uint)lbss.signal_red_bits.size();
|
||||
while (slot > 0) {
|
||||
slot--;
|
||||
uint64 &slot_bits = lbss.signal_red_bits[slot];
|
||||
|
@@ -1803,7 +1803,7 @@ static void DrawBridgeSignalOnMiddlePart(const TileInfo *ti, TileIndex bridge_st
|
||||
sprite += SPR_ORIGINAL_SIGNALS_BASE + (position << 1);
|
||||
} else {
|
||||
/* All other signals are picked from add on sprites. */
|
||||
sprite += SPR_SIGNALS_BASE + (SIGTYPE_NORMAL - 1) * 16 + variant * 64 + (position << 1);
|
||||
sprite += SPR_SIGNALS_BASE + ((int)SIGTYPE_NORMAL - 1) * 16 + variant * 64 + (position << 1);
|
||||
}
|
||||
|
||||
AddSortableSpriteToDraw(sprite, PAL_NONE, x, y, 1, 1, TILE_HEIGHT, z, false, 0, 0, BB_Z_SEPARATOR);
|
||||
|
@@ -768,10 +768,10 @@ int GetAvailableFreeTilesInSignalledTunnelBridge(TileIndex entrance, TileIndex e
|
||||
checker.lowest_seen = INT_MAX;
|
||||
switch (checker.direction) {
|
||||
default: NOT_REACHED();
|
||||
case DIAGDIR_NE: checker.pos = -(TileX(tile) * TILE_SIZE); break;
|
||||
case DIAGDIR_NE: checker.pos = -(int)(TileX(tile) * TILE_SIZE); break;
|
||||
case DIAGDIR_SE: checker.pos = (TileY(tile) * TILE_SIZE); break;
|
||||
case DIAGDIR_SW: checker.pos = (TileX(tile) * TILE_SIZE); break;
|
||||
case DIAGDIR_NW: checker.pos = -(TileY(tile) * TILE_SIZE); break;
|
||||
case DIAGDIR_NW: checker.pos = -(int)(TileY(tile) * TILE_SIZE); break;
|
||||
}
|
||||
|
||||
FindVehicleOnPos(entrance, VEH_TRAIN, &checker, &GetAvailableFreeTilesInSignalledTunnelBridgeEnum);
|
||||
|
@@ -1104,7 +1104,7 @@ void AddSortableSpriteToDraw(SpriteID image, PaletteID pal, int x, int y, int w,
|
||||
|
||||
if (_vd.combine_sprites == SPRITE_COMBINE_PENDING) {
|
||||
_vd.combine_sprites = SPRITE_COMBINE_ACTIVE;
|
||||
_vd.combine_psd_index = _vd.parent_sprites_to_draw.size() - 1;
|
||||
_vd.combine_psd_index = (uint)_vd.parent_sprites_to_draw.size() - 1;
|
||||
_vd.combine_left = tmp_left;
|
||||
_vd.combine_right = right;
|
||||
_vd.combine_top = tmp_top;
|
||||
@@ -2337,7 +2337,7 @@ static void ViewportMapDrawVehicleRoute(const Viewport *vp)
|
||||
static inline void DrawRouteStep(const Viewport * const vp, const TileIndex tile, const RankOrderTypeList list)
|
||||
{
|
||||
if (tile == INVALID_TILE) return;
|
||||
const uint step_count = list.size() > max_rank_order_type_count ? 1 : list.size();
|
||||
const uint step_count = list.size() > max_rank_order_type_count ? 1 : (uint)list.size();
|
||||
const int x_pos = TileX(tile) * TILE_SIZE + TILE_SIZE / 2;
|
||||
const int y_pos = TileY(tile) * TILE_SIZE + TILE_SIZE / 2;
|
||||
Point pt = RemapCoords(x_pos, y_pos, 0);
|
||||
@@ -3648,7 +3648,7 @@ void MarkAllViewportsDirty(int left, int top, int right, int bottom, ViewportMar
|
||||
|
||||
static void MarkRouteStepDirty(RouteStepsMap::const_iterator cit)
|
||||
{
|
||||
const uint size = cit->second.size() > max_rank_order_type_count ? 1 : cit->second.size();
|
||||
const uint size = cit->second.size() > max_rank_order_type_count ? 1 : (uint)cit->second.size();
|
||||
MarkRouteStepDirty(cit->first, size);
|
||||
}
|
||||
|
||||
@@ -5342,10 +5342,10 @@ static HighLightStyle CalcPolyrailDrawstyle(Point pt, bool dragging)
|
||||
if (_current_snap_lock.x != -1) {
|
||||
snap_point = FindBestPolyline(pt, &_current_snap_lock, 1, &line);
|
||||
} else if (snap_mode == RSM_SNAP_TO_TILE) {
|
||||
snap_point = FindBestPolyline(pt, _tile_snap_points.data(), _tile_snap_points.size(), &line);
|
||||
snap_point = FindBestPolyline(pt, _tile_snap_points.data(), (uint)_tile_snap_points.size(), &line);
|
||||
} else {
|
||||
assert(snap_mode == RSM_SNAP_TO_RAIL);
|
||||
snap_point = FindBestPolyline(pt, _rail_snap_points.data(), _rail_snap_points.size(), &line);
|
||||
snap_point = FindBestPolyline(pt, _rail_snap_points.data(), (uint)_rail_snap_points.size(), &line);
|
||||
}
|
||||
|
||||
if (snap_point == nullptr) {
|
||||
|
Reference in New Issue
Block a user