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