Merge branch 'master' into wait_in_depot

This commit is contained in:
Jonathan G Rennison
2015-08-03 01:06:55 +01:00
468 changed files with 25326 additions and 22041 deletions

View File

@@ -90,7 +90,9 @@ void DrawShipEngine(int left, int right, int preferred_x, int y, EngineID engine
{
SpriteID sprite = GetShipIcon(engine, image_type);
const Sprite *real_sprite = GetSprite(sprite, ST_NORMAL);
preferred_x = Clamp(preferred_x, left - UnScaleByZoom(real_sprite->x_offs, ZOOM_LVL_GUI), right - UnScaleByZoom(real_sprite->width, ZOOM_LVL_GUI) - UnScaleByZoom(real_sprite->x_offs, ZOOM_LVL_GUI));
preferred_x = Clamp(preferred_x,
left - UnScaleGUI(real_sprite->x_offs),
right - UnScaleGUI(real_sprite->width) - UnScaleGUI(real_sprite->x_offs));
DrawSprite(sprite, pal, preferred_x, y);
}
@@ -107,10 +109,10 @@ void GetShipSpriteSize(EngineID engine, uint &width, uint &height, int &xoffs, i
{
const Sprite *spr = GetSprite(GetShipIcon(engine, image_type), ST_NORMAL);
width = UnScaleByZoom(spr->width, ZOOM_LVL_GUI);
height = UnScaleByZoom(spr->height, ZOOM_LVL_GUI);
xoffs = UnScaleByZoom(spr->x_offs, ZOOM_LVL_GUI);
yoffs = UnScaleByZoom(spr->y_offs, ZOOM_LVL_GUI);
width = UnScaleGUI(spr->width);
height = UnScaleGUI(spr->height);
xoffs = UnScaleGUI(spr->x_offs);
yoffs = UnScaleGUI(spr->y_offs);
}
SpriteID Ship::GetImage(Direction direction, EngineImageType image_type) const
@@ -632,8 +634,8 @@ static void ShipController(Ship *v)
if (!IsTileType(gp.new_tile, MP_TUNNELBRIDGE) || !HasBit(VehicleEnterTile(v, gp.new_tile, gp.x, gp.y), VETS_ENTERED_WORMHOLE)) {
v->x_pos = gp.x;
v->y_pos = gp.y;
VehicleUpdatePosition(v);
if ((v->vehstatus & VS_HIDDEN) == 0) VehicleUpdateViewport(v, true);
v->UpdatePosition();
if ((v->vehstatus & VS_HIDDEN) == 0) v->Vehicle::UpdateViewport(true);
return;
}
}
@@ -645,7 +647,7 @@ static void ShipController(Ship *v)
v->z_pos = GetSlopePixelZ(gp.x, gp.y);
getout:
VehicleUpdatePosition(v);
v->UpdatePosition();
v->UpdateViewport(true, true);
return;
@@ -729,7 +731,7 @@ CommandCost CmdBuildShip(TileIndex tile, DoCommandFlag flags, const Engine *e, u
v->InvalidateNewGRFCacheOfChain();
VehicleUpdatePosition(v);
v->UpdatePosition();
}
return CommandCost();