1
0
Fork 0

(svn r3048) Replace 0/1/2 by RAILTYPE_RAIL/MONO/MAGLEV where appropriate

release/0.4.5
tron 2005-10-16 07:58:15 +00:00
parent d52bf846f3
commit ab657338ec
3 changed files with 15 additions and 16 deletions

View File

@ -19,12 +19,9 @@ static StringID GetEngineCategoryName(EngineID engine)
{ {
if (engine < NUM_TRAIN_ENGINES) { if (engine < NUM_TRAIN_ENGINES) {
switch (GetEngine(engine)->railtype) { switch (GetEngine(engine)->railtype) {
case 0: case RAILTYPE_RAIL: return STR_8102_RAILROAD_LOCOMOTIVE;
return STR_8102_RAILROAD_LOCOMOTIVE; case RAILTYPE_MONO: return STR_8106_MONORAIL_LOCOMOTIVE;
case 1: case RAILTYPE_MAGLEV: return STR_8107_MAGLEV_LOCOMOTIVE;
return STR_8106_MONORAIL_LOCOMOTIVE;
case 2:
return STR_8107_MAGLEV_LOCOMOTIVE;
} }
} }

View File

@ -291,7 +291,7 @@ static int GetTrainAcceleration(Vehicle *v, bool mode)
v->max_speed = max_speed; v->max_speed = max_speed;
if (v->u.rail.railtype != 2) { if (v->u.rail.railtype != RAILTYPE_MAGLEV) {
resistance = 13 * mass / 10; resistance = 13 * mass / 10;
resistance += 60 * num; resistance += 60 * num;
resistance += friction * mass * speed / 1000; resistance += friction * mass * speed / 1000;
@ -303,14 +303,14 @@ static int GetTrainAcceleration(Vehicle *v, bool mode)
if (speed > 0) { if (speed > 0) {
switch (v->u.rail.railtype) { switch (v->u.rail.railtype) {
case 0: case RAILTYPE_RAIL:
case 1: case RAILTYPE_MONO:
force = power / speed; //[N] force = power / speed; //[N]
force *= 22; force *= 22;
force /= 10; force /= 10;
break; break;
case 2: case RAILTYPE_MAGLEV:
force = power / 25; force = power / 25;
break; break;
} }
@ -321,7 +321,7 @@ static int GetTrainAcceleration(Vehicle *v, bool mode)
if (force <= 0) force = 10000; if (force <= 0) force = 10000;
if (v->u.rail.railtype != 2) force = min(force, mass * 10 * 200); if (v->u.rail.railtype != RAILTYPE_MAGLEV) force = min(force, mass * 10 * 200);
if (mode == AM_ACCEL) { if (mode == AM_ACCEL) {
return (force - resistance) / (mass * 4); return (force - resistance) / (mass * 4);
@ -1743,7 +1743,7 @@ static void HandleLocomotiveSmokeCloud(Vehicle *v)
// no smoke? // no smoke?
if (RailVehInfo(engtype)->flags & 2 || if (RailVehInfo(engtype)->flags & 2 ||
GetEngine(engtype)->railtype > 0 || GetEngine(engtype)->railtype > RAILTYPE_RAIL ||
(v->vehstatus & VS_HIDDEN) || (v->u.rail.track & 0xC0)) (v->vehstatus & VS_HIDDEN) || (v->u.rail.track & 0xC0))
continue; continue;
@ -1788,13 +1788,15 @@ static void TrainPlayLeaveStationSound(Vehicle *v)
EngineID engtype = v->engine_type; EngineID engtype = v->engine_type;
switch (GetEngine(engtype)->railtype) { switch (GetEngine(engtype)->railtype) {
case 0: case RAILTYPE_RAIL:
SndPlayVehicleFx(sfx[RailVehInfo(engtype)->engclass], v); SndPlayVehicleFx(sfx[RailVehInfo(engtype)->engclass], v);
break; break;
case 1:
case RAILTYPE_MONO:
SndPlayVehicleFx(SND_47_MAGLEV_2, v); SndPlayVehicleFx(SND_47_MAGLEV_2, v);
break; break;
case 2:
case RAILTYPE_MAGLEV:
SndPlayVehicleFx(SND_41_MAGLEV, v); SndPlayVehicleFx(SND_41_MAGLEV, v);
break; break;
} }

View File

@ -175,7 +175,7 @@ void SortVehicleList(vehiclelist_d *vl)
/* General Vehicle GUI based procedures that are independent of vehicle types */ /* General Vehicle GUI based procedures that are independent of vehicle types */
void InitializeVehiclesGuiList(void) void InitializeVehiclesGuiList(void)
{ {
_railtype_selected_in_replace_gui = 0; _railtype_selected_in_replace_gui = RAILTYPE_RAIL;
} }
// draw the vehicle profit button in the vehicle list window. // draw the vehicle profit button in the vehicle list window.