# HG changeset patch # User rubidium # Date 2010-11-18 14:01:20 # Node ID bcf8d2e544453b7194e321e34956cfcfa4875ac4 # Parent 6827cb0184c65e1c43540b5d90468955799f4d59 (svn r21231) -Codechange: Generalize the naming of some settings and variables related to visual effects (Hirundo) diff --git a/src/lang/english.txt b/src/lang/english.txt --- a/src/lang/english.txt +++ b/src/lang/english.txt @@ -1090,7 +1090,7 @@ STR_CONFIG_SETTING_AUTOSLOPE 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_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_ORIGINAL :Original STR_CONFIG_SETTING_SMOKE_AMOUNT_REALISTIC :Realistic diff --git a/src/newgrf_callbacks.h b/src/newgrf_callbacks.h --- a/src/newgrf_callbacks.h +++ b/src/newgrf_callbacks.h @@ -28,8 +28,8 @@ enum CallbackID { /* There are no callbacks 0x02 - 0x0F. */ - /** Powered wagons and visual effects. */ - CBID_TRAIN_WAGON_POWER = 0x10, // 8 bit callback + /** Visual effects and wagon power. */ + 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. */ CBID_VEHICLE_LENGTH = 0x11, @@ -279,7 +279,7 @@ enum CallbackID { * Some callbacks are always used and don't have a mask. */ 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_LOAD_AMOUNT = 2, ///< Load amount CBM_VEHICLE_REFIT_CAPACITY = 3, ///< Cargo capacity after refit diff --git a/src/newgrf_sound.h b/src/newgrf_sound.h --- a/src/newgrf_sound.h +++ b/src/newgrf_sound.h @@ -16,16 +16,17 @@ #include "tile_type.h" #include "vehicle_type.h" +/** Events at which a sound might be played. */ enum VehicleSoundEvent { - VSE_START = 1, - VSE_TUNNEL = 2, - VSE_BREAKDOWN = 3, - VSE_RUNNING = 4, - VSE_TOUCHDOWN = 5, - VSE_TRAIN_EFFECT = 6, - VSE_RUNNING_16 = 7, - VSE_STOPPED_16 = 8, - VSE_LOAD_UNLOAD = 9, + VSE_START = 1, ///< Vehicle starting, i.e. leaving, the station. + VSE_TUNNEL = 2, ///< Train entering a tunnel. + VSE_BREAKDOWN = 3, ///< Vehicle breaking down. + VSE_RUNNING = 4, ///< Vehicle running normally. + VSE_TOUCHDOWN = 5, ///< Whenever a plane touches down. + VSE_VISUAL_EFFECT = 6, ///< Vehicle visual effect (steam, diesel smoke or electric spark) is shown. + VSE_RUNNING_16 = 7, ///< Every 16 ticks while the vehicle is running (speed > 0). + VSE_STOPPED_16 = 8, ///< Every 16 ticks while the vehicle is stopped (speed == 0). + VSE_LOAD_UNLOAD = 9, ///< Whenever cargo payment is made for a vehicle. }; diff --git a/src/settings_gui.cpp b/src/settings_gui.cpp --- a/src/settings_gui.cpp +++ b/src/settings_gui.cpp @@ -1448,7 +1448,6 @@ static SettingEntry _settings_vehicles_t SettingEntry("vehicle.train_acceleration_model"), SettingEntry("vehicle.train_slope_steepness"), SettingEntry("vehicle.mammoth_trains"), - SettingEntry("vehicle.smoke_amount"), SettingEntry("gui.lost_train_warn"), SettingEntry("vehicle.wagon_speed_limits"), SettingEntry("vehicle.disable_elrails"), @@ -1478,6 +1477,7 @@ static SettingEntry _settings_vehicles[] SettingEntry("vehicle.dynamic_engines"), SettingEntry("vehicle.roadveh_acceleration_model"), SettingEntry("vehicle.roadveh_slope_steepness"), + SettingEntry("vehicle.smoke_amount"), }; /** Vehicles sub-page */ static SettingsPage _settings_vehicles_page = {_settings_vehicles, lengthof(_settings_vehicles)}; diff --git a/src/table/newgrf_debug_data.h b/src/table/newgrf_debug_data.h --- a/src/table/newgrf_debug_data.h +++ b/src/table/newgrf_debug_data.h @@ -26,7 +26,7 @@ #define NICV(cb_id, bit) NIC(cb_id, Engine, info.callback_mask, bit) 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_LOAD_AMOUNT, CBM_VEHICLE_LOAD_AMOUNT), NICV(CBID_VEHICLE_REFIT_CAPACITY, CBM_VEHICLE_REFIT_CAPACITY), diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -163,8 +163,8 @@ void Train::UpdateVisualEffect(bool allo } /* Check powered wagon / visual effect callback */ - if (HasBit(e->info.callback_mask, CBM_TRAIN_WAGON_POWER)) { - uint16 callback = GetVehicleCallback(CBID_TRAIN_WAGON_POWER, 0, 0, this->engine_type, this); + if (HasBit(e->info.callback_mask, CBM_VEHICLE_VISUAL_EFFECT)) { + 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); } @@ -2032,7 +2032,7 @@ static void HandleLocomotiveSmokeCloud(c } } while ((v = v->Next()) != NULL); - if (sound) PlayVehicleSound(u, VSE_TRAIN_EFFECT); + if (sound) PlayVehicleSound(u, VSE_VISUAL_EFFECT); } void Train::PlayLeaveStationSound() const