Fix #10114: Wonky depot layout. (#10191)

Depot lists internal layout was not handled well. This is improved by
throwing more Rects at it:
- Vehicle images are now be vertically centred in the rect.
- Image clipping is relaxed to cover the rect, improving larger sprites.
- Outline highlight is now aware of bevel thickness.
This commit is contained in:
PeterN
2022-11-23 21:01:09 +00:00
committed by GitHub
parent e85d2603d9
commit 53682b4b6b
8 changed files with 112 additions and 114 deletions

View File

@@ -45,10 +45,10 @@ struct TestedEngineDetails {
int DrawVehiclePurchaseInfo(int left, int right, int y, EngineID engine_number, TestedEngineDetails &te);
void DrawTrainImage(const Train *v, int left, int right, int y, VehicleID selection, EngineImageType image_type, int skip, VehicleID drag_dest = INVALID_VEHICLE);
void DrawRoadVehImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type, int skip = 0);
void DrawShipImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type);
void DrawAircraftImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type);
void DrawTrainImage(const Train *v, const Rect &r, VehicleID selection, EngineImageType image_type, int skip, VehicleID drag_dest = INVALID_VEHICLE);
void DrawRoadVehImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type, int skip = 0);
void DrawShipImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type);
void DrawAircraftImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type);
void ShowBuildVehicleWindow(TileIndex tile, VehicleType type);
@@ -106,7 +106,7 @@ void StartStopVehicle(const Vehicle *v, bool texteffect);
Vehicle *CheckClickOnVehicle(const struct Viewport *vp, int x, int y);
void DrawVehicleImage(const Vehicle *v, int left, int right, int y, VehicleID selection, EngineImageType image_type, int skip);
void DrawVehicleImage(const Vehicle *v, const Rect &r, VehicleID selection, EngineImageType image_type, int skip);
void SetMouseCursorVehicle(const Vehicle *v, EngineImageType image_type);
#endif /* VEHICLE_GUI_H */