mirror of https://github.com/OpenTTD/OpenTTD
Compare commits
1 Commits
14bdef8491
...
932ba0e036
Author | SHA1 | Date |
---|---|---|
|
932ba0e036 |
|
@ -103,14 +103,14 @@ void SpriteFontCache::ClearFontCache()
|
|||
|
||||
const Sprite *SpriteFontCache::GetGlyph(GlyphID key)
|
||||
{
|
||||
SpriteID sprite = static_cast<SpriteID>(key & ~SPRITE_GLYPH);
|
||||
SpriteID sprite = this->GetUnicodeGlyph(static_cast<char32_t>(key & ~SPRITE_GLYPH));
|
||||
if (sprite == 0) sprite = this->GetUnicodeGlyph('?');
|
||||
return GetSprite(sprite, SpriteType::Font);
|
||||
}
|
||||
|
||||
uint SpriteFontCache::GetGlyphWidth(GlyphID key)
|
||||
{
|
||||
SpriteID sprite = static_cast<SpriteID>(key & ~SPRITE_GLYPH);
|
||||
SpriteID sprite = this->GetUnicodeGlyph(static_cast<char32_t>(key & ~SPRITE_GLYPH));
|
||||
if (sprite == 0) sprite = this->GetUnicodeGlyph('?');
|
||||
return SpriteExists(sprite) ? GetSprite(sprite, SpriteType::Font)->width + ScaleFontTrad(this->fs != FS_NORMAL ? 1 : 0) : 0;
|
||||
}
|
||||
|
@ -120,7 +120,7 @@ GlyphID SpriteFontCache::MapCharToGlyph(char32_t key, [[maybe_unused]] bool allo
|
|||
assert(IsPrintable(key));
|
||||
SpriteID sprite = this->GetUnicodeGlyph(key);
|
||||
if (sprite == 0) return 0;
|
||||
return SPRITE_GLYPH | sprite;
|
||||
return SPRITE_GLYPH | key;
|
||||
}
|
||||
|
||||
bool SpriteFontCache::GetDrawGlyphShadow()
|
||||
|
|
|
@ -105,8 +105,8 @@ static ChangeInfoResult RoadStopChangeInfo(uint first, uint last, int prop, Byte
|
|||
AddStringForMapping(GRFStringID{buf.ReadWord()}, [rs = rs.get()](StringID str) { RoadStopClass::Get(rs->class_index)->name = str; });
|
||||
break;
|
||||
|
||||
case 0x0C: // The draw modes
|
||||
rs->draw_mode = static_cast<RoadStopDrawModes>(buf.ReadByte());
|
||||
case 0x0C: // The draw mode
|
||||
rs->draw_mode = static_cast<RoadStopDrawMode>(buf.ReadByte());
|
||||
break;
|
||||
|
||||
case 0x0D: // Cargo types for random triggers
|
||||
|
|
|
@ -298,7 +298,7 @@ void DrawRoadStopTile(int x, int y, RoadType roadtype, const RoadStopSpec *spec,
|
|||
|
||||
RoadStopDrawModes draw_mode;
|
||||
if (spec->flags.Test(RoadStopSpecFlag::DrawModeRegister)) {
|
||||
draw_mode = static_cast<RoadStopDrawModes>(object.GetRegister(0x100));
|
||||
draw_mode = static_cast<RoadStopDrawMode>(object.GetRegister(0x100));
|
||||
} else {
|
||||
draw_mode = spec->draw_mode;
|
||||
}
|
||||
|
|
|
@ -3331,7 +3331,7 @@ draw_default_foundation:
|
|||
auto result = GetRoadStopLayout(ti, stopspec, st, type, view, regs100);
|
||||
if (result.has_value()) {
|
||||
if (stopspec->flags.Test(RoadStopSpecFlag::DrawModeRegister)) {
|
||||
stop_draw_mode = static_cast<RoadStopDrawModes>(regs100[0]);
|
||||
stop_draw_mode = static_cast<RoadStopDrawMode>(regs100[0]);
|
||||
}
|
||||
if (type == StationType::RoadWaypoint && stop_draw_mode.Test(RoadStopDrawMode::WaypGround)) {
|
||||
draw_ground = true;
|
||||
|
|
|
@ -427,7 +427,6 @@ struct TimetableWindow : Window {
|
|||
void DrawTimetablePanel(const Rect &r) const
|
||||
{
|
||||
const Vehicle *v = this->vehicle;
|
||||
if (v->GetNumOrders() == 0) return;
|
||||
Rect tr = r.Shrink(WidgetDimensions::scaled.framerect);
|
||||
int i = this->vscroll->GetPosition();
|
||||
VehicleOrderID order_id = (i + 1) / 2;
|
||||
|
|
Loading…
Reference in New Issue