mirror of https://github.com/OpenTTD/OpenTTD.git
(svn r21231) -Codechange: Generalize the naming of some settings and variables related to visual effects (Hirundo)
This commit is contained in:
parent
31c0ba9d29
commit
5a503d505b
|
@ -1090,7 +1090,7 @@ STR_CONFIG_SETTING_AUTOSLOPE :{LTBLUE}Allow t
|
||||||
STR_CONFIG_SETTING_CATCHMENT :{LTBLUE}Allow more realistically sized catchment areas: {ORANGE}{STRING1}
|
STR_CONFIG_SETTING_CATCHMENT :{LTBLUE}Allow more realistically sized catchment areas: {ORANGE}{STRING1}
|
||||||
STR_CONFIG_SETTING_EXTRADYNAMITE :{LTBLUE}Allow removal of more town-owned roads, bridges, etc: {ORANGE}{STRING1}
|
STR_CONFIG_SETTING_EXTRADYNAMITE :{LTBLUE}Allow removal of more town-owned roads, bridges, etc: {ORANGE}{STRING1}
|
||||||
STR_CONFIG_SETTING_MAMMOTHTRAINS :{LTBLUE}Enable building very long trains: {ORANGE}{STRING1}
|
STR_CONFIG_SETTING_MAMMOTHTRAINS :{LTBLUE}Enable building very long trains: {ORANGE}{STRING1}
|
||||||
STR_CONFIG_SETTING_SMOKE_AMOUNT :{LTBLUE}Amount of locomotive smoke/sparks: {ORANGE}{STRING1}
|
STR_CONFIG_SETTING_SMOKE_AMOUNT :{LTBLUE}Amount of vehicle smoke/sparks: {ORANGE}{STRING1}
|
||||||
STR_CONFIG_SETTING_SMOKE_AMOUNT_NONE :None
|
STR_CONFIG_SETTING_SMOKE_AMOUNT_NONE :None
|
||||||
STR_CONFIG_SETTING_SMOKE_AMOUNT_ORIGINAL :Original
|
STR_CONFIG_SETTING_SMOKE_AMOUNT_ORIGINAL :Original
|
||||||
STR_CONFIG_SETTING_SMOKE_AMOUNT_REALISTIC :Realistic
|
STR_CONFIG_SETTING_SMOKE_AMOUNT_REALISTIC :Realistic
|
||||||
|
|
|
@ -28,8 +28,8 @@ enum CallbackID {
|
||||||
|
|
||||||
/* There are no callbacks 0x02 - 0x0F. */
|
/* There are no callbacks 0x02 - 0x0F. */
|
||||||
|
|
||||||
/** Powered wagons and visual effects. */
|
/** Visual effects and wagon power. */
|
||||||
CBID_TRAIN_WAGON_POWER = 0x10, // 8 bit callback
|
CBID_VEHICLE_VISUAL_EFFECT = 0x10, // 8 bit callback
|
||||||
|
|
||||||
/** Vehicle length, returns the amount of 1/8's the vehicle is shorter for trains and RVs. */
|
/** Vehicle length, returns the amount of 1/8's the vehicle is shorter for trains and RVs. */
|
||||||
CBID_VEHICLE_LENGTH = 0x11,
|
CBID_VEHICLE_LENGTH = 0x11,
|
||||||
|
@ -279,7 +279,7 @@ enum CallbackID {
|
||||||
* Some callbacks are always used and don't have a mask.
|
* Some callbacks are always used and don't have a mask.
|
||||||
*/
|
*/
|
||||||
enum VehicleCallbackMask {
|
enum VehicleCallbackMask {
|
||||||
CBM_TRAIN_WAGON_POWER = 0, ///< Powered wagons (trains only)
|
CBM_VEHICLE_VISUAL_EFFECT = 0, ///< Visual effects and wagon power (trains only)
|
||||||
CBM_VEHICLE_LENGTH = 1, ///< Vehicle length (trains and road vehicles)
|
CBM_VEHICLE_LENGTH = 1, ///< Vehicle length (trains and road vehicles)
|
||||||
CBM_VEHICLE_LOAD_AMOUNT = 2, ///< Load amount
|
CBM_VEHICLE_LOAD_AMOUNT = 2, ///< Load amount
|
||||||
CBM_VEHICLE_REFIT_CAPACITY = 3, ///< Cargo capacity after refit
|
CBM_VEHICLE_REFIT_CAPACITY = 3, ///< Cargo capacity after refit
|
||||||
|
|
|
@ -16,16 +16,17 @@
|
||||||
#include "tile_type.h"
|
#include "tile_type.h"
|
||||||
#include "vehicle_type.h"
|
#include "vehicle_type.h"
|
||||||
|
|
||||||
|
/** Events at which a sound might be played. */
|
||||||
enum VehicleSoundEvent {
|
enum VehicleSoundEvent {
|
||||||
VSE_START = 1,
|
VSE_START = 1, ///< Vehicle starting, i.e. leaving, the station.
|
||||||
VSE_TUNNEL = 2,
|
VSE_TUNNEL = 2, ///< Train entering a tunnel.
|
||||||
VSE_BREAKDOWN = 3,
|
VSE_BREAKDOWN = 3, ///< Vehicle breaking down.
|
||||||
VSE_RUNNING = 4,
|
VSE_RUNNING = 4, ///< Vehicle running normally.
|
||||||
VSE_TOUCHDOWN = 5,
|
VSE_TOUCHDOWN = 5, ///< Whenever a plane touches down.
|
||||||
VSE_TRAIN_EFFECT = 6,
|
VSE_VISUAL_EFFECT = 6, ///< Vehicle visual effect (steam, diesel smoke or electric spark) is shown.
|
||||||
VSE_RUNNING_16 = 7,
|
VSE_RUNNING_16 = 7, ///< Every 16 ticks while the vehicle is running (speed > 0).
|
||||||
VSE_STOPPED_16 = 8,
|
VSE_STOPPED_16 = 8, ///< Every 16 ticks while the vehicle is stopped (speed == 0).
|
||||||
VSE_LOAD_UNLOAD = 9,
|
VSE_LOAD_UNLOAD = 9, ///< Whenever cargo payment is made for a vehicle.
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1448,7 +1448,6 @@ static SettingEntry _settings_vehicles_trains[] = {
|
||||||
SettingEntry("vehicle.train_acceleration_model"),
|
SettingEntry("vehicle.train_acceleration_model"),
|
||||||
SettingEntry("vehicle.train_slope_steepness"),
|
SettingEntry("vehicle.train_slope_steepness"),
|
||||||
SettingEntry("vehicle.mammoth_trains"),
|
SettingEntry("vehicle.mammoth_trains"),
|
||||||
SettingEntry("vehicle.smoke_amount"),
|
|
||||||
SettingEntry("gui.lost_train_warn"),
|
SettingEntry("gui.lost_train_warn"),
|
||||||
SettingEntry("vehicle.wagon_speed_limits"),
|
SettingEntry("vehicle.wagon_speed_limits"),
|
||||||
SettingEntry("vehicle.disable_elrails"),
|
SettingEntry("vehicle.disable_elrails"),
|
||||||
|
@ -1478,6 +1477,7 @@ static SettingEntry _settings_vehicles[] = {
|
||||||
SettingEntry("vehicle.dynamic_engines"),
|
SettingEntry("vehicle.dynamic_engines"),
|
||||||
SettingEntry("vehicle.roadveh_acceleration_model"),
|
SettingEntry("vehicle.roadveh_acceleration_model"),
|
||||||
SettingEntry("vehicle.roadveh_slope_steepness"),
|
SettingEntry("vehicle.roadveh_slope_steepness"),
|
||||||
|
SettingEntry("vehicle.smoke_amount"),
|
||||||
};
|
};
|
||||||
/** Vehicles sub-page */
|
/** Vehicles sub-page */
|
||||||
static SettingsPage _settings_vehicles_page = {_settings_vehicles, lengthof(_settings_vehicles)};
|
static SettingsPage _settings_vehicles_page = {_settings_vehicles, lengthof(_settings_vehicles)};
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
|
|
||||||
#define NICV(cb_id, bit) NIC(cb_id, Engine, info.callback_mask, bit)
|
#define NICV(cb_id, bit) NIC(cb_id, Engine, info.callback_mask, bit)
|
||||||
static const NICallback _nic_vehicles[] = {
|
static const NICallback _nic_vehicles[] = {
|
||||||
NICV(CBID_TRAIN_WAGON_POWER, CBM_TRAIN_WAGON_POWER),
|
NICV(CBID_VEHICLE_VISUAL_EFFECT, CBM_VEHICLE_VISUAL_EFFECT),
|
||||||
NICV(CBID_VEHICLE_LENGTH, CBM_VEHICLE_LENGTH),
|
NICV(CBID_VEHICLE_LENGTH, CBM_VEHICLE_LENGTH),
|
||||||
NICV(CBID_VEHICLE_LOAD_AMOUNT, CBM_VEHICLE_LOAD_AMOUNT),
|
NICV(CBID_VEHICLE_LOAD_AMOUNT, CBM_VEHICLE_LOAD_AMOUNT),
|
||||||
NICV(CBID_VEHICLE_REFIT_CAPACITY, CBM_VEHICLE_REFIT_CAPACITY),
|
NICV(CBID_VEHICLE_REFIT_CAPACITY, CBM_VEHICLE_REFIT_CAPACITY),
|
||||||
|
|
|
@ -163,8 +163,8 @@ void Train::UpdateVisualEffect(bool allow_power_change)
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Check powered wagon / visual effect callback */
|
/* Check powered wagon / visual effect callback */
|
||||||
if (HasBit(e->info.callback_mask, CBM_TRAIN_WAGON_POWER)) {
|
if (HasBit(e->info.callback_mask, CBM_VEHICLE_VISUAL_EFFECT)) {
|
||||||
uint16 callback = GetVehicleCallback(CBID_TRAIN_WAGON_POWER, 0, 0, this->engine_type, this);
|
uint16 callback = GetVehicleCallback(CBID_VEHICLE_VISUAL_EFFECT, 0, 0, this->engine_type, this);
|
||||||
|
|
||||||
if (callback != CALLBACK_FAILED) this->tcache.cached_vis_effect = GB(callback, 0, 8);
|
if (callback != CALLBACK_FAILED) this->tcache.cached_vis_effect = GB(callback, 0, 8);
|
||||||
}
|
}
|
||||||
|
@ -2032,7 +2032,7 @@ static void HandleLocomotiveSmokeCloud(const Train *v)
|
||||||
}
|
}
|
||||||
} while ((v = v->Next()) != NULL);
|
} while ((v = v->Next()) != NULL);
|
||||||
|
|
||||||
if (sound) PlayVehicleSound(u, VSE_TRAIN_EFFECT);
|
if (sound) PlayVehicleSound(u, VSE_VISUAL_EFFECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Train::PlayLeaveStationSound() const
|
void Train::PlayLeaveStationSound() const
|
||||||
|
|
Loading…
Reference in New Issue