(svn r2504) Move Draw*EngineInfo to engine_gui.c to reduce dependencies

This commit is contained in:
tron
2005-07-01 14:05:44 +00:00
parent cd8d2643d3
commit b64c9b8b1f
6 changed files with 64 additions and 68 deletions

View File

@@ -9,7 +9,6 @@
#include "command.h"
#include "station.h"
#include "news.h"
#include "gfx.h"
#include "pathfind.h"
#include "npf.h"
#include "player.h"
@@ -91,20 +90,6 @@ void DrawRoadVehEngine(int x, int y, int engine, uint32 image_ormod)
DrawSprite((6 + _roadveh_images[spritenum]) | image_ormod, x, y);
}
void DrawRoadVehEngineInfo(int engine, int x, int y, int maxw)
{
const RoadVehicleInfo *rvi = RoadVehInfo(engine);
SetDParam(0, ((_price.roadveh_base >> 3) * rvi->base_cost) >> 5);
SetDParam(1, rvi->max_speed * 10 >> 5);
SetDParam(2, rvi->running_cost * _price.roadveh_running >> 8);
SetDParam(4, rvi->capacity);
SetDParam(3, _cargoc.names_long_p[rvi->cargo_type]);
DrawStringMultiCenter(x, y, STR_902A_COST_SPEED_RUNNING_COST, maxw);
}
int32 EstimateRoadVehCost(EngineID engine_type)
{
return ((_price.roadveh_base >> 3) * RoadVehInfo(engine_type)->base_cost) >> 5;