1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-19 10:22:39 +01:00

Codechange: use std::vector/std::span for DrawTileSprites over malloc-ed table

This commit is contained in:
Rubidium
2025-01-12 19:20:44 +01:00
committed by rubidium42
parent 6cf7a899e9
commit 069ff846e4
16 changed files with 93 additions and 87 deletions

View File

@@ -87,7 +87,7 @@ public:
{
const auto *spec = this->GetSpec(cls_id, id);
if (!spec->grf_prop.HasGrfFile()) {
extern const DrawTileSprites _objects[];
extern const DrawTileSpriteSpan _objects[];
const DrawTileSprites *dts = &_objects[spec->grf_prop.local_id];
DrawOrigTileSeqInGUI(x, y, dts, PAL_NONE);
} else {
@@ -207,7 +207,7 @@ public:
int y = (ir.Height() + ScaleSpriteTrad(PREVIEW_HEIGHT)) / 2 - ScaleSpriteTrad(PREVIEW_BOTTOM);
if (!spec->grf_prop.HasGrfFile()) {
extern const DrawTileSprites _objects[];
extern const DrawTileSpriteSpan _objects[];
const DrawTileSprites *dts = &_objects[spec->grf_prop.local_id];
DrawOrigTileSeqInGUI(x, y, dts, PAL_NONE);
} else {