Merge branch 'master' of https://github.com/supertuxkart/stk-code into lensflare
This commit is contained in:
@@ -29,7 +29,7 @@
|
||||
time-per-kart Additional time added to the interval
|
||||
for each kart in the race. -->
|
||||
<follow-the-leader intervals="30 20 10"
|
||||
time-per-kart="1.5" />
|
||||
time-per-kart="0" />
|
||||
|
||||
<!-- Startup information.
|
||||
Penalty: Penalty time if a kart accelerates before GO. -->
|
||||
|
||||
@@ -42,6 +42,7 @@
|
||||
#include "graphics/water.hpp"
|
||||
#include "graphics/wind.hpp"
|
||||
#include "guiengine/engine.hpp"
|
||||
#include "guiengine/message_queue.hpp"
|
||||
#include "guiengine/modaldialog.hpp"
|
||||
#include "guiengine/scalable_font.hpp"
|
||||
#include "guiengine/screen.hpp"
|
||||
@@ -863,7 +864,7 @@ void IrrDriver::applyResolutionSettings()
|
||||
// No need to reload cached track data (track_manager->cleanAllCachedData
|
||||
// above) - this happens dynamically when the tracks are loaded.
|
||||
GUIEngine::reshowCurrentScreen();
|
||||
|
||||
MessageQueue::updatePosition();
|
||||
} // applyResolutionSettings
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
|
||||
@@ -664,11 +664,13 @@ void Material::setSFXSpeed(SFXBase *sfx, float speed, bool should_be_paused) con
|
||||
}
|
||||
if (speed > m_sfx_max_speed)
|
||||
{
|
||||
assert(!isnan(m_sfx_max_speed));
|
||||
sfx->setSpeed(m_sfx_max_pitch);
|
||||
return;
|
||||
}
|
||||
|
||||
float f = m_sfx_pitch_per_speed*(speed-m_sfx_min_speed) + m_sfx_min_pitch;
|
||||
assert(!isnan(f));
|
||||
sfx->setSpeed(f);
|
||||
} // setSFXSpeed
|
||||
|
||||
|
||||
@@ -121,6 +121,16 @@ void createLabel(const Message *message)
|
||||
g_area = irr::core::recti(x, y, x+dim.Width, y+dim.Height);
|
||||
} // createLabel
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Called when the screen resolution is changed to compute the new
|
||||
* position of the message. */
|
||||
void updatePosition()
|
||||
{
|
||||
if (g_all_messages.size() == 0) return;
|
||||
Message *last = g_all_messages.top();
|
||||
createLabel(last);
|
||||
} // updatePosition
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Adds a message to the message queue.
|
||||
* \param mt The MessageType of the message.
|
||||
|
||||
@@ -37,6 +37,7 @@ namespace MessageQueue
|
||||
enum MessageType {MT_FRIEND, MT_ACHIEVEMENT};
|
||||
|
||||
void add(MessageType mt, const core::stringw &message);
|
||||
void updatePosition();
|
||||
void update(float dt);
|
||||
|
||||
}; // namespace GUIEngine
|
||||
|
||||
@@ -2140,18 +2140,20 @@ void Kart::updateEngineSFX()
|
||||
if(isOnGround())
|
||||
{
|
||||
float max_speed = m_max_speed->getCurrentMaxSpeed();
|
||||
assert(max_speed>0);
|
||||
// Engine noise is based half in total speed, half in fake gears:
|
||||
// With a sawtooth graph like /|/|/| we get 3 even spaced gears,
|
||||
// ignoring the gear settings from stk_config, but providing a
|
||||
// good enough brrrBRRRbrrrBRRR sound effect. Speed factor makes
|
||||
// it a "staired sawtooth", so more acoustically rich.
|
||||
float f = m_speed/max_speed;
|
||||
float f = max_speed > 0 ? m_speed/max_speed : 1.0f;
|
||||
// Speed at this stage is not yet capped, so it can be > 1, which
|
||||
// results in odd engine sfx.
|
||||
if (f>1.0f) f=1.0f;
|
||||
|
||||
float gears = 3.0f * fmod(f, 0.333334f);
|
||||
m_engine_sound->setSpeed(0.6f + (f +gears)* 0.35f);
|
||||
assert(!isnan(f));
|
||||
m_engine_sound->setSpeed(0.6f + (f + gears) * 0.35f);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user