mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r27020) -Cleanup: some coding style consistency improvements (mostly spaces)
This commit is contained in:
parent
155114aa98
commit
d534c80e94
|
@ -159,7 +159,7 @@ static inline __m128i AdjustBrightnessOfTwoPixels(__m128i from, uint32 brightnes
|
||||||
__m128i briAB = _mm_cvtsi32_si128(brightness);
|
__m128i briAB = _mm_cvtsi32_si128(brightness);
|
||||||
briAB = _mm_shuffle_epi8(briAB, BRIGHTNESS_LOW_CONTROL_MASK); // DEFAULT_BRIGHTNESS in 0, 0x00 in 2.
|
briAB = _mm_shuffle_epi8(briAB, BRIGHTNESS_LOW_CONTROL_MASK); // DEFAULT_BRIGHTNESS in 0, 0x00 in 2.
|
||||||
colAB = _mm_mullo_epi16(colAB, briAB);
|
colAB = _mm_mullo_epi16(colAB, briAB);
|
||||||
__m128i colAB_ob = _mm_srli_epi16(colAB, 8+7);
|
__m128i colAB_ob = _mm_srli_epi16(colAB, 8 + 7);
|
||||||
colAB = _mm_srli_epi16(colAB, 7);
|
colAB = _mm_srli_epi16(colAB, 7);
|
||||||
|
|
||||||
/* Sum overbright.
|
/* Sum overbright.
|
||||||
|
|
|
@ -196,7 +196,7 @@ bool SpriteFontCache::GetDrawGlyphShadow()
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static */ FontCache *FontCache::caches[FS_END] = { new SpriteFontCache(FS_NORMAL), new SpriteFontCache(FS_SMALL), new SpriteFontCache(FS_LARGE), new SpriteFontCache(FS_MONO) };
|
/* static */ FontCache *FontCache::caches[FS_END] = { new SpriteFontCache(FS_NORMAL), new SpriteFontCache(FS_SMALL), new SpriteFontCache(FS_LARGE), new SpriteFontCache(FS_MONO) };
|
||||||
|
|
||||||
#ifdef WITH_FREETYPE
|
#ifdef WITH_FREETYPE
|
||||||
#include <ft2build.h>
|
#include <ft2build.h>
|
||||||
|
|
|
@ -311,7 +311,7 @@ void MultiCommodityFlow::CleanupPaths(NodeID source_id, PathVector &paths)
|
||||||
* @param path End of the path the flow should be pushed on.
|
* @param path End of the path the flow should be pushed on.
|
||||||
* @param accuracy Accuracy of the calculation.
|
* @param accuracy Accuracy of the calculation.
|
||||||
* @param max_saturation If < UINT_MAX only push flow up to the given
|
* @param max_saturation If < UINT_MAX only push flow up to the given
|
||||||
* saturation, otherwise the path can be "overloaded".
|
* saturation, otherwise the path can be "overloaded".
|
||||||
*/
|
*/
|
||||||
uint MultiCommodityFlow::PushFlow(Edge &edge, Path *path, uint accuracy,
|
uint MultiCommodityFlow::PushFlow(Edge &edge, Path *path, uint accuracy,
|
||||||
uint max_saturation)
|
uint max_saturation)
|
||||||
|
|
|
@ -101,4 +101,4 @@ protected:
|
||||||
void RefreshLinks(const Order *cur, const Order *next, uint8 flags, uint num_hops = 0);
|
void RefreshLinks(const Order *cur, const Order *next, uint8 flags, uint num_hops = 0);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // REFRESH_H
|
#endif /* REFRESH_H */
|
||||||
|
|
|
@ -210,7 +210,7 @@ void ClientNetworkGameSocketHandler::ClientError(NetworkRecvStatus res)
|
||||||
* when that's the case handle it appropriately.
|
* when that's the case handle it appropriately.
|
||||||
* @return true when everything went okay.
|
* @return true when everything went okay.
|
||||||
*/
|
*/
|
||||||
/*static */ bool ClientNetworkGameSocketHandler::Receive()
|
/* static */ bool ClientNetworkGameSocketHandler::Receive()
|
||||||
{
|
{
|
||||||
if (my_client->CanSendReceive()) {
|
if (my_client->CanSendReceive()) {
|
||||||
NetworkRecvStatus res = my_client->ReceivePackets();
|
NetworkRecvStatus res = my_client->ReceivePackets();
|
||||||
|
@ -225,7 +225,7 @@ void ClientNetworkGameSocketHandler::ClientError(NetworkRecvStatus res)
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Send the packets of this socket handler. */
|
/** Send the packets of this socket handler. */
|
||||||
/*static */ void ClientNetworkGameSocketHandler::Send()
|
/* static */ void ClientNetworkGameSocketHandler::Send()
|
||||||
{
|
{
|
||||||
my_client->SendPackets();
|
my_client->SendPackets();
|
||||||
my_client->CheckConnection();
|
my_client->CheckConnection();
|
||||||
|
|
|
@ -2122,7 +2122,7 @@ bool AfterLoadGame()
|
||||||
/* Delete small ufos heading for non-existing vehicles */
|
/* Delete small ufos heading for non-existing vehicles */
|
||||||
Vehicle *v;
|
Vehicle *v;
|
||||||
FOR_ALL_DISASTERVEHICLES(v) {
|
FOR_ALL_DISASTERVEHICLES(v) {
|
||||||
if (v->subtype == 2/*ST_SMALL_UFO*/ && v->current_order.GetDestination() != 0) {
|
if (v->subtype == 2 /* ST_SMALL_UFO */ && v->current_order.GetDestination() != 0) {
|
||||||
const Vehicle *u = Vehicle::GetIfValid(v->dest_tile);
|
const Vehicle *u = Vehicle::GetIfValid(v->dest_tile);
|
||||||
if (u == NULL || u->type != VEH_ROAD || !RoadVehicle::From(u)->IsFrontEngine()) {
|
if (u == NULL || u->type != VEH_ROAD || !RoadVehicle::From(u)->IsFrontEngine()) {
|
||||||
delete v;
|
delete v;
|
||||||
|
|
|
@ -259,10 +259,10 @@ char *ScriptEventAdminPort::ReadValue(HSQUIRRELVM vm, char *p)
|
||||||
sq_newarray(vm, 0);
|
sq_newarray(vm, 0);
|
||||||
|
|
||||||
/* Empty array? */
|
/* Empty array? */
|
||||||
char *p2 = p+1;
|
char *p2 = p + 1;
|
||||||
SKIP_EMPTY(p2);
|
SKIP_EMPTY(p2);
|
||||||
if (*p2 == ']') {
|
if (*p2 == ']') {
|
||||||
p = p2+1;
|
p = p2 + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -230,7 +230,7 @@ template<bool Tfrom, bool Tvia>
|
||||||
return ::Station::Get(station_id)->town->index;
|
return ::Station::Get(station_id)->town->index;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static */ bool ScriptStation::IsAirportClosed(StationID station_id)
|
/* static */ bool ScriptStation::IsAirportClosed(StationID station_id)
|
||||||
{
|
{
|
||||||
EnforcePrecondition(false, IsValidStation(station_id));
|
EnforcePrecondition(false, IsValidStation(station_id));
|
||||||
EnforcePrecondition(false, HasStationType(station_id, STATION_AIRPORT));
|
EnforcePrecondition(false, HasStationType(station_id, STATION_AIRPORT));
|
||||||
|
@ -238,7 +238,7 @@ template<bool Tfrom, bool Tvia>
|
||||||
return (::Station::Get(station_id)->airport.flags & AIRPORT_CLOSED_block) != 0;
|
return (::Station::Get(station_id)->airport.flags & AIRPORT_CLOSED_block) != 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*static */ bool ScriptStation::OpenCloseAirport(StationID station_id)
|
/* static */ bool ScriptStation::OpenCloseAirport(StationID station_id)
|
||||||
{
|
{
|
||||||
EnforcePrecondition(false, IsValidStation(station_id));
|
EnforcePrecondition(false, IsValidStation(station_id));
|
||||||
EnforcePrecondition(false, HasStationType(station_id, STATION_AIRPORT));
|
EnforcePrecondition(false, HasStationType(station_id, STATION_AIRPORT));
|
||||||
|
|
|
@ -41,7 +41,7 @@ ScriptStationList_Cargo::ScriptStationList_Cargo(ScriptStationList_Cargo::CargoM
|
||||||
ScriptStationList_Cargo::CargoSelector selector, StationID station_id, CargoID cargo,
|
ScriptStationList_Cargo::CargoSelector selector, StationID station_id, CargoID cargo,
|
||||||
StationID other_station)
|
StationID other_station)
|
||||||
{
|
{
|
||||||
switch(mode) {
|
switch (mode) {
|
||||||
case CM_WAITING:
|
case CM_WAITING:
|
||||||
ScriptStationList_CargoWaiting(selector, station_id, cargo, other_station).SwapList(this);
|
ScriptStationList_CargoWaiting(selector, station_id, cargo, other_station).SwapList(this);
|
||||||
break;
|
break;
|
||||||
|
@ -57,7 +57,7 @@ ScriptStationList_CargoWaiting::ScriptStationList_CargoWaiting(
|
||||||
ScriptStationList_Cargo::CargoSelector selector, StationID station_id, CargoID cargo,
|
ScriptStationList_Cargo::CargoSelector selector, StationID station_id, CargoID cargo,
|
||||||
StationID other_station)
|
StationID other_station)
|
||||||
{
|
{
|
||||||
switch(selector) {
|
switch (selector) {
|
||||||
case CS_BY_FROM:
|
case CS_BY_FROM:
|
||||||
ScriptStationList_CargoWaitingByFrom(station_id, cargo).SwapList(this);
|
ScriptStationList_CargoWaitingByFrom(station_id, cargo).SwapList(this);
|
||||||
break;
|
break;
|
||||||
|
@ -79,7 +79,7 @@ ScriptStationList_CargoPlanned::ScriptStationList_CargoPlanned(
|
||||||
ScriptStationList_Cargo::CargoSelector selector, StationID station_id, CargoID cargo,
|
ScriptStationList_Cargo::CargoSelector selector, StationID station_id, CargoID cargo,
|
||||||
StationID other_station)
|
StationID other_station)
|
||||||
{
|
{
|
||||||
switch(selector) {
|
switch (selector) {
|
||||||
case CS_BY_FROM:
|
case CS_BY_FROM:
|
||||||
ScriptStationList_CargoPlannedByFrom(station_id, cargo).SwapList(this);
|
ScriptStationList_CargoPlannedByFrom(station_id, cargo).SwapList(this);
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -568,10 +568,10 @@ public:
|
||||||
if (widget != WID_SB_SEL_PAGE && widget != WID_SB_PAGE_PANEL) return;
|
if (widget != WID_SB_SEL_PAGE && widget != WID_SB_PAGE_PANEL) return;
|
||||||
|
|
||||||
Dimension d;
|
Dimension d;
|
||||||
d.height= FONT_HEIGHT_NORMAL;
|
d.height = FONT_HEIGHT_NORMAL;
|
||||||
d.width = 0;
|
d.width = 0;
|
||||||
|
|
||||||
switch(widget) {
|
switch (widget) {
|
||||||
case WID_SB_SEL_PAGE: {
|
case WID_SB_SEL_PAGE: {
|
||||||
|
|
||||||
/* Get max title width. */
|
/* Get max title width. */
|
||||||
|
|
|
@ -644,7 +644,7 @@ public:
|
||||||
size_t idx = s - string_base;
|
size_t idx = s - string_base;
|
||||||
|
|
||||||
WChar c = Utf8Consume(&s);
|
WChar c = Utf8Consume(&s);
|
||||||
if (c < 0x10000) {
|
if (c < 0x10000) {
|
||||||
*this->utf16_str.Append() = (UChar)c;
|
*this->utf16_str.Append() = (UChar)c;
|
||||||
} else {
|
} else {
|
||||||
/* Make a surrogate pair. */
|
/* Make a surrogate pair. */
|
||||||
|
|
|
@ -999,10 +999,10 @@ static const SpriteID SPR_CNST1_TOWNHOUSE_06_V1 = 1444;
|
||||||
static const SpriteID SPR_CNST2_TOWNHOUSE_06_V1 = 1445;
|
static const SpriteID SPR_CNST2_TOWNHOUSE_06_V1 = 1445;
|
||||||
static const SpriteID SPR_BUILD_TOWNHOUSE_06_V1 = 1446; // 1st variation
|
static const SpriteID SPR_BUILD_TOWNHOUSE_06_V1 = 1446; // 1st variation
|
||||||
static const SpriteID SPR_GRND_TOWNHOUSE_06_V1 = 1447;
|
static const SpriteID SPR_GRND_TOWNHOUSE_06_V1 = 1447;
|
||||||
static const SpriteID SPR_GRND_STADIUM_N = 1479; //stadium ground at north
|
static const SpriteID SPR_GRND_STADIUM_N = 1479; // stadium ground at north
|
||||||
static const SpriteID SPR_GRND_STADIUM_E = 1480; //stadium ground at east
|
static const SpriteID SPR_GRND_STADIUM_E = 1480; // stadium ground at east
|
||||||
static const SpriteID SPR_GRND_STADIUM_W = 1481; //stadium ground at west
|
static const SpriteID SPR_GRND_STADIUM_W = 1481; // stadium ground at west
|
||||||
static const SpriteID SPR_GRND_STADIUM_S = 1482; //stadium ground at south
|
static const SpriteID SPR_GRND_STADIUM_S = 1482; // stadium ground at south
|
||||||
static const SpriteID SPR_CNST1_TOWNHOUSE_06_V2 = 1501; // used as ground, but is stage1
|
static const SpriteID SPR_CNST1_TOWNHOUSE_06_V2 = 1501; // used as ground, but is stage1
|
||||||
static const SpriteID SPR_CNST1_TOWNHOUSE_06_V2_P = 1502; // pipes extensions for previous
|
static const SpriteID SPR_CNST1_TOWNHOUSE_06_V2_P = 1502; // pipes extensions for previous
|
||||||
static const SpriteID SPR_CNST2_TOWNHOUSE_06_V2_G = 1503; // Ground of cnst stage 2
|
static const SpriteID SPR_CNST2_TOWNHOUSE_06_V2_G = 1503; // Ground of cnst stage 2
|
||||||
|
|
|
@ -171,7 +171,7 @@ Money HouseSpec::GetRemovalCost() const
|
||||||
return (_price[PR_CLEAR_HOUSE] * this->removal_cost) >> 8;
|
return (_price[PR_CLEAR_HOUSE] * this->removal_cost) >> 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Local
|
/* Local */
|
||||||
static int _grow_town_result;
|
static int _grow_town_result;
|
||||||
|
|
||||||
/* Describe the possible states */
|
/* Describe the possible states */
|
||||||
|
|
|
@ -1439,7 +1439,7 @@ void Train::UpdateDeltaXY(Direction direction)
|
||||||
if (!IsDiagonalDirection(direction)) {
|
if (!IsDiagonalDirection(direction)) {
|
||||||
static const int _sign_table[] =
|
static const int _sign_table[] =
|
||||||
{
|
{
|
||||||
// x, y
|
/* x, y */
|
||||||
-1, -1, // DIR_N
|
-1, -1, // DIR_N
|
||||||
-1, 1, // DIR_E
|
-1, 1, // DIR_E
|
||||||
1, 1, // DIR_S
|
1, 1, // DIR_S
|
||||||
|
|
|
@ -250,8 +250,8 @@ void InitializeWindowViewport(Window *w, int x, int y,
|
||||||
vp->overlay = NULL;
|
vp->overlay = NULL;
|
||||||
|
|
||||||
w->viewport = vp;
|
w->viewport = vp;
|
||||||
vp->virtual_left = 0;//pt.x;
|
vp->virtual_left = 0; // pt.x;
|
||||||
vp->virtual_top = 0;//pt.y;
|
vp->virtual_top = 0; // pt.y;
|
||||||
}
|
}
|
||||||
|
|
||||||
static Point _vp_move_offs;
|
static Point _vp_move_offs;
|
||||||
|
|
|
@ -34,4 +34,4 @@ enum QueryEditSignWidgets {
|
||||||
WID_QES_NEXT, ///< Next button.
|
WID_QES_NEXT, ///< Next button.
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* */
|
#endif /* SIGN_WIDGET_H */
|
||||||
|
|
Loading…
Reference in New Issue