@@ -151,6 +141,14 @@
+
+
+
+
+
+
+
+
diff --git a/src/animations/three_d_animation.cpp b/src/animations/three_d_animation.cpp
index d6446aed0..242324297 100644
--- a/src/animations/three_d_animation.cpp
+++ b/src/animations/three_d_animation.cpp
@@ -73,7 +73,8 @@ ThreeDAnimation::~ThreeDAnimation()
*/
void ThreeDAnimation::update(float dt)
{
- //if ( UserConfigParams::m_graphical_effects || m_important_animation )
+ //if (UserConfigParams::m_graphical_effects > 1 ||
+ // (UserConfigParams::m_graphical_effects > 0 && m_important_animation))
{
Vec3 xyz = m_object->getPosition();
Vec3 scale = m_object->getScale();
diff --git a/src/config/user_config.hpp b/src/config/user_config.hpp
index bf059c058..457c19192 100644
--- a/src/config/user_config.hpp
+++ b/src/config/user_config.hpp
@@ -727,9 +727,9 @@ namespace UserConfigParams
#define FBO_DEFAULT true
#endif
- PARAM_PREFIX BoolUserConfigParam m_graphical_effects
- PARAM_DEFAULT( BoolUserConfigParam(true, "anim_gfx",
- &m_graphics_quality, "Scenery animations") );
+ PARAM_PREFIX IntUserConfigParam m_graphical_effects
+ PARAM_DEFAULT( IntUserConfigParam(2, "anim_gfx",
+ &m_graphics_quality, "Scenery animations: 0 disabled, 1 only important, 2 enabled") );
// This saves the actual user preference.
PARAM_PREFIX IntUserConfigParam m_xmas_mode
diff --git a/src/graphics/explosion.cpp b/src/graphics/explosion.cpp
index 4ce9b7493..ab0a9fbfa 100644
--- a/src/graphics/explosion.cpp
+++ b/src/graphics/explosion.cpp
@@ -20,6 +20,7 @@
#include "audio/sfx_base.hpp"
#include "audio/sfx_manager.hpp"
+#include "config/user_config.hpp"
#include "graphics/irr_driver.hpp"
#include "graphics/material.hpp"
#include "graphics/material_manager.hpp"
@@ -44,7 +45,12 @@ Explosion::Explosion(const Vec3& coord, const char* explosion_sound, const char
#ifndef SERVER_ONLY
ParticleKindManager* pkm = ParticleKindManager::get();
ParticleKind* particles = pkm->getParticles(particle_file);
- m_emitter = new ParticleEmitter(particles, coord, NULL);
+ m_emitter = NULL;
+
+ if (UserConfigParams::m_graphical_effects > 0)
+ {
+ m_emitter = new ParticleEmitter(particles, coord, NULL);
+ }
#endif
} // Explosion
@@ -76,7 +82,8 @@ bool Explosion::updateAndDelete(float dt)
m_remaining_time -= dt;
#ifndef SERVER_ONLY
- if (m_remaining_time < 0.0f && m_remaining_time >= -explosion_time)
+ if (m_remaining_time < 0.0f && m_remaining_time >= -explosion_time &&
+ m_emitter != NULL)
{
scene::ISceneNode* node = m_emitter->getNode();
@@ -106,7 +113,7 @@ bool Explosion::updateAndDelete(float dt)
#ifndef SERVER_ONLY
// if framerate is very low, emit for at least a few frames, in case
// burst time is lower than the time of 1 frame
- if (m_emission_frames > 2)
+ if (m_emission_frames > 2 && m_emitter != NULL)
{
// Stop the emitter and wait a little while for all particles to have time to fade out
m_emitter->getNode()->getEmitter()->setMinParticlesPerSecond(0);
diff --git a/src/items/attachment.cpp b/src/items/attachment.cpp
index 5c22afe5b..b4b1dfd9f 100644
--- a/src/items/attachment.cpp
+++ b/src/items/attachment.cpp
@@ -153,7 +153,7 @@ void Attachment::set(AttachmentType type, float time,
break;
} // switch(type)
- if (!UserConfigParams::m_graphical_effects)
+ if (UserConfigParams::m_graphical_effects < 2)
{
m_node->setAnimationSpeed(0);
m_node->setCurrentFrame(0);
@@ -190,7 +190,7 @@ void Attachment::set(AttachmentType type, float time,
m_time_left = m_time_left * speed_mult;
- if (UserConfigParams::m_graphical_effects)
+ if (UserConfigParams::m_graphical_effects > 1)
{
// .blend was created @25 (<10 real, slow computer), make it faster
m_node->setAnimationSpeed(50);
diff --git a/src/karts/kart.cpp b/src/karts/kart.cpp
index 811a14225..9d5b1586a 100644
--- a/src/karts/kart.cpp
+++ b/src/karts/kart.cpp
@@ -1773,7 +1773,7 @@ void Kart::handleMaterialGFX(float dt)
// something with the wheels, and the material has not the
// below surface property set.
if (material && isOnGround() && !material->isBelowSurface() &&
- !getKartAnimation() && UserConfigParams::m_graphical_effects)
+ !getKartAnimation() && UserConfigParams::m_graphical_effects > 1)
{
// Get the appropriate particle data depending on
@@ -1825,7 +1825,7 @@ void Kart::handleMaterialGFX(float dt)
} // for i in all cameras for this kart
} // camera != final camera
- if (!UserConfigParams::m_graphical_effects)
+ if (UserConfigParams::m_graphical_effects < 2)
return;
// Use the middle of the contact points of the two rear wheels
@@ -2108,7 +2108,7 @@ void Kart::crashed(const Material *m, const Vec3 &normal)
{
#ifndef SERVER_ONLY
std::string particles = m->getCrashResetParticles();
- if (particles.size() > 0)
+ if (particles.size() > 0 && UserConfigParams::m_graphical_effects > 0)
{
ParticleKind* kind =
ParticleKindManager::get()->getParticles(particles);
diff --git a/src/karts/kart_gfx.cpp b/src/karts/kart_gfx.cpp
index 5d44de431..69f20e8aa 100644
--- a/src/karts/kart_gfx.cpp
+++ b/src/karts/kart_gfx.cpp
@@ -45,13 +45,6 @@ KartGFX::KartGFX(const AbstractKart *kart, RaceManager::KartType type, bool is_d
m_kart = kart;
m_wheel_toggle = 0;
m_skid_level = 0;
-
- //if(!UserConfigParams::m_graphical_effects)
- //{
- // for(unsigned int i=0; igetKartModel();
const float length = km->getLength();
@@ -173,9 +166,10 @@ void KartGFX::addEffect(KartGFXType type, const std::string &file_name,
const Vec3 &position, bool important)
{
#ifndef SERVER_ONLY
- if ((!UserConfigParams::m_graphical_effects || !CVS->isGLSL()) &&
+ if (((UserConfigParams::m_graphical_effects < 2 || !CVS->isGLSL()) &&
(!important || m_kart->getType() == RaceManager::KT_AI ||
- m_kart->getType() == RaceManager::KT_SPARE_TIRE))
+ m_kart->getType() == RaceManager::KT_SPARE_TIRE)) ||
+ UserConfigParams::m_graphical_effects < 1)
{
m_all_emitters.push_back(NULL);
return;
diff --git a/src/main.cpp b/src/main.cpp
index 67a3129f5..1726a918b 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -805,9 +805,9 @@ int handleCmdLinePreliminary()
UserConfigParams::m_gi = false;
// animated scenery
if (CommandLine::has("--enable-gfx"))
- UserConfigParams::m_graphical_effects = true;
+ UserConfigParams::m_graphical_effects = 2;
else if (CommandLine::has("--disable-gfx"))
- UserConfigParams::m_graphical_effects = false;
+ UserConfigParams::m_graphical_effects = 0;
if (CommandLine::has("--enable-motion-blur"))
UserConfigParams::m_motionblur = true;
else if (CommandLine::has("--disable-motion-blur"))
diff --git a/src/modes/world.cpp b/src/modes/world.cpp
index c48bfdede..93ae8c83d 100644
--- a/src/modes/world.cpp
+++ b/src/modes/world.cpp
@@ -1007,7 +1007,7 @@ void World::update(float dt)
}
PROFILER_PUSH_CPU_MARKER("World::update (weather)", 0x80, 0x7F, 0x00);
- if (UserConfigParams::m_graphical_effects && Weather::getInstance())
+ if (UserConfigParams::m_graphical_effects > 1 && Weather::getInstance())
{
Weather::getInstance()->update(dt);
}
diff --git a/src/states_screens/dialogs/custom_video_settings.cpp b/src/states_screens/dialogs/custom_video_settings.cpp
index 786e2041b..939320533 100644
--- a/src/states_screens/dialogs/custom_video_settings.cpp
+++ b/src/states_screens/dialogs/custom_video_settings.cpp
@@ -58,9 +58,15 @@ CustomVideoSettingsDialog::~CustomVideoSettingsDialog()
void CustomVideoSettingsDialog::beforeAddingWidgets()
{
#ifndef SERVER_ONLY
- getWidget("anim_gfx")->setState(UserConfigParams::m_graphical_effects);
getWidget("weather_gfx")->setState(UserConfigParams::m_weather_effects);
getWidget("dof")->setState(UserConfigParams::m_dof);
+
+ SpinnerWidget* anim_gfx = getWidget("anim_gfx");
+ assert(anim_gfx != NULL);
+ anim_gfx->addLabel(_("Disabled"));
+ anim_gfx->addLabel(_("Important only"));
+ anim_gfx->addLabel(_("Enabled"));
+ anim_gfx->setValue(UserConfigParams::m_graphical_effects);
SpinnerWidget* kart_anim = getWidget("steering_animations");
kart_anim->addLabel(_("Disabled")); // 0
@@ -179,7 +185,7 @@ GUIEngine::EventPropagation CustomVideoSettingsDialog::processEvent(const std::s
getWidget("texture_compression")->getState();
UserConfigParams::m_graphical_effects =
- getWidget("anim_gfx")->getState();
+ getWidget("anim_gfx")->getValue();
UserConfigParams::m_weather_effects =
getWidget("weather_gfx")->getState();
diff --git a/src/states_screens/options_screen_video.cpp b/src/states_screens/options_screen_video.cpp
index 9b2980578..611bc043d 100644
--- a/src/states_screens/options_screen_video.cpp
+++ b/src/states_screens/options_screen_video.cpp
@@ -54,7 +54,7 @@ void OptionsScreenVideo::initPresets()
({
false /* light */, 0 /* shadow */, false /* bloom */, false /* motionblur */,
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */, false /* weather */,
- false /* animatedScenery */, 0 /* animatedCharacters */, 0 /* image_quality */,
+ 1 /* animatedScenery */, 0 /* animatedCharacters */, 0 /* image_quality */,
false /* depth of field */, false /* global illumination */, true /* degraded IBL */
});
@@ -62,7 +62,7 @@ void OptionsScreenVideo::initPresets()
({
false /* light */, 0 /* shadow */, false /* bloom */, false /* motionblur */,
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */, false /* weather */,
- true /* animatedScenery */, 1 /* animatedCharacters */, 1 /* image_quality */,
+ 2 /* animatedScenery */, 1 /* animatedCharacters */, 1 /* image_quality */,
false /* depth of field */, false /* global illumination */, true /* degraded IBL */
});
@@ -70,7 +70,7 @@ void OptionsScreenVideo::initPresets()
({
true /* light */, 0 /* shadow */, false /* bloom */, false /* motionblur */,
false /* lightshaft */, false /* glow */, false /* mlaa */, false /* ssao */, true /* weather */,
- true /* animatedScenery */, 1 /* animatedCharacters */, 2 /* image_quality */,
+ 2 /* animatedScenery */, 1 /* animatedCharacters */, 2 /* image_quality */,
false /* depth of field */, false /* global illumination */, true /* degraded IBL */
});
@@ -78,7 +78,7 @@ void OptionsScreenVideo::initPresets()
({
true /* light */, 0 /* shadow */, false /* bloom */, true /* motionblur */,
true /* lightshaft */, true /* glow */, true /* mlaa */, false /* ssao */, true /* weather */,
- true /* animatedScenery */, 1 /* animatedCharacters */, 2 /* image_quality */,
+ 2 /* animatedScenery */, 1 /* animatedCharacters */, 2 /* image_quality */,
false /* depth of field */, false /* global illumination */, false /* degraded IBL */
});
@@ -86,7 +86,7 @@ void OptionsScreenVideo::initPresets()
({
true /* light */, 512 /* shadow */, true /* bloom */, true /* motionblur */,
true /* lightshaft */, true /* glow */, true /* mlaa */, true /* ssao */, true /* weather */,
- true /* animatedScenery */,
+ 2 /* animatedScenery */,
#ifndef SERVER_ONLY
(SharedGPUObjects::getMaxMat4Size() > 512 || !CVS->supportsHardwareSkinning() ? 2 : 1),
#else
@@ -100,7 +100,7 @@ void OptionsScreenVideo::initPresets()
({
true /* light */, 1024 /* shadow */, true /* bloom */, true /* motionblur */,
true /* lightshaft */, true /* glow */, true /* mlaa */, true /* ssao */, true /* weather */,
- true /* animatedScenery */,
+ 2 /* animatedScenery */,
#ifndef SERVER_ONLY
(SharedGPUObjects::getMaxMat4Size() > 512 || !CVS->supportsHardwareSkinning() ? 2 : 1),
#else
@@ -458,6 +458,8 @@ void OptionsScreenVideo::updateTooltip()
const core::stringw me = _LTR("Me Only");
//I18N: if no kart animations are enabled
const core::stringw none = _LTR("None");
+ //I18N: if only important animated scenery is enabled
+ const core::stringw important_only = _LTR("Important only");
//I18N: in the graphical options tooltip;
// indicates the rendered image quality is very low
@@ -477,7 +479,10 @@ void OptionsScreenVideo::updateTooltip()
// UserConfigParams::m_pixel_shaders ? enabled : disabled);
//I18N: in graphical options
tooltip = _("Animated Scenery: %s",
- UserConfigParams::m_graphical_effects ? enabled : disabled);
+ UserConfigParams::m_graphical_effects == 2 ? enabled :
+ UserConfigParams::m_graphical_effects == 1 ? important_only :
+ disabled);
+
//I18N: in graphical options
tooltip = tooltip + L"\n" + _("Weather Effects: %s",
UserConfigParams::m_weather_effects ? enabled : disabled);
diff --git a/src/states_screens/options_screen_video.hpp b/src/states_screens/options_screen_video.hpp
index 95f966655..c37b1c5ec 100644
--- a/src/states_screens/options_screen_video.hpp
+++ b/src/states_screens/options_screen_video.hpp
@@ -36,7 +36,7 @@ struct GFXPreset
bool mlaa;
bool ssao;
bool weather;
- bool animatedScenery;
+ int animatedScenery;
int animatedCharacters;
int image_quality;
/** Depth of field */
diff --git a/src/tracks/model_definition_loader.cpp b/src/tracks/model_definition_loader.cpp
index 1217e1a65..f3bef39a6 100644
--- a/src/tracks/model_definition_loader.cpp
+++ b/src/tracks/model_definition_loader.cpp
@@ -76,7 +76,7 @@ LODNode* ModelDefinitionLoader::instanciateAsLOD(const XMLNode* node, scene::ISc
for (unsigned int m=0; m 1 ||
World::getWorld()->getIdent() == IDENT_CUTSCENE))
{
scene::IAnimatedMesh* a_mesh = irr_driver->getAnimatedMesh(group[m].m_model_file);
diff --git a/src/tracks/track.cpp b/src/tracks/track.cpp
index 1b2b5f51d..7168c3663 100644
--- a/src/tracks/track.cpp
+++ b/src/tracks/track.cpp
@@ -1522,7 +1522,7 @@ void Track::createWater(const XMLNode &node)
*/
scene::ISceneNode* scene_node = NULL;
/*
- if (UserConfigParams::m_graphical_effects)
+ if (UserConfigParams::m_graphical_effects > 1)
{
scene::IMesh *welded;
scene_node = irr_driver->addWaterNode(mesh, &welded,
@@ -2003,7 +2003,7 @@ void Track::loadObjects(const XMLNode* root, const std::string& path, ModelDefin
}
else if (name == "particle-emitter")
{
- if (UserConfigParams::m_graphical_effects)
+ if (UserConfigParams::m_graphical_effects > 1)
{
m_track_object_manager->add(*node, parent, model_def_loader, parent_library);
}
diff --git a/src/tracks/track_object_presentation.cpp b/src/tracks/track_object_presentation.cpp
index 8f70e1ee6..f233524e1 100644
--- a/src/tracks/track_object_presentation.cpp
+++ b/src/tracks/track_object_presentation.cpp
@@ -401,7 +401,7 @@ TrackObjectPresentationMesh::TrackObjectPresentationMesh(
m_is_in_skybox = true;
}
- bool animated = skeletal_animation && (UserConfigParams::m_graphical_effects ||
+ bool animated = skeletal_animation && (UserConfigParams::m_graphical_effects > 1 ||
World::getWorld()->getIdent() == IDENT_CUTSCENE);
bool displacing = false;
xml_node.get("displacing", &displacing);
@@ -467,7 +467,7 @@ TrackObjectPresentationMesh::TrackObjectPresentationMesh(
m_node = NULL;
m_is_in_skybox = false;
m_render_info = NULL;
- bool animated = (UserConfigParams::m_graphical_effects ||
+ bool animated = (UserConfigParams::m_graphical_effects > 1 ||
World::getWorld()->getIdent() == IDENT_CUTSCENE);
m_model_file = model_file;
@@ -512,7 +512,7 @@ void TrackObjectPresentationMesh::init(const XMLNode* xml_node,
if(xml_node)
xml_node->get("skeletal-animation", &skeletal_animation);
- bool animated = skeletal_animation && (UserConfigParams::m_graphical_effects ||
+ bool animated = skeletal_animation && (UserConfigParams::m_graphical_effects > 1 ||
World::getWorld()->getIdent() == IDENT_CUTSCENE);
bool displacing = false;
std::string interaction;