Merge branch 'master' of https://github.com/supertuxkart/stk-code into ScriptEngine
This commit is contained in:
commit
4c3b8f435b
35
data/gfx/gfx_sparkFire_a.xml
Normal file
35
data/gfx/gfx_sparkFire_a.xml
Normal file
@ -0,0 +1,35 @@
|
||||
<?xml version="1.0"?>
|
||||
|
||||
<!-- For sky particles, the size of the box is ignored -->
|
||||
<particles emitter="box" box_x="0.1" box_y="0.5" box_z="0.1">
|
||||
|
||||
<spreading angle="30" />
|
||||
|
||||
<velocity x="-0.000"
|
||||
y="0.002"
|
||||
z="-0.000" />
|
||||
|
||||
<material file="gfx_sparkFire_a.png" clampu="Y" clampv="Y" />
|
||||
|
||||
<!-- Amount of particles emitted per second -->
|
||||
<rate min="20"
|
||||
max="50" />
|
||||
|
||||
<!-- Minimal and maximal lifetime of a particle, in milliseconds. -->
|
||||
<lifetime min="3000"
|
||||
max="3000" />
|
||||
|
||||
<!-- Size of the particles -->
|
||||
<size min="0.2"
|
||||
max="0.3" />
|
||||
|
||||
<color min="40 40 255"
|
||||
max="255 255 255" />
|
||||
|
||||
<!-- How much time in milliseconds before the particle is fully faded out -->
|
||||
<fadeout time="100" />
|
||||
|
||||
<wind speed="0.16"
|
||||
flips="Y" />
|
||||
|
||||
</particles>
|
@ -43,5 +43,12 @@ void main()
|
||||
// Uncharted2 tonemap with Auria's custom coefficients
|
||||
vec4 perChannel = (col * (6.9 * col + .5)) / (col * (5.2 * col + 1.7) + 0.06);
|
||||
perChannel = pow(perChannel, vec4(2.2));
|
||||
FragColor = vec4(perChannel.xyz, col.a);
|
||||
|
||||
vec2 inside = uv - 0.5;
|
||||
float vignette = 1 - dot(inside, inside);
|
||||
vignette = clamp(pow(vignette, 0.8), 0., 1.);
|
||||
//vignette = clamp(vignette + vignette - 0.5, 0., 1.15);
|
||||
|
||||
|
||||
FragColor = vec4(perChannel.xyz * vignette, col.a);
|
||||
}
|
||||
|
@ -22,6 +22,7 @@
|
||||
|
||||
#include "achievements/achievement_info.hpp"
|
||||
#include "achievements/achievements_manager.hpp"
|
||||
#include "config/player_manager.hpp"
|
||||
#include "io/utf_writer.hpp"
|
||||
#include "utils/log.hpp"
|
||||
#include "utils/ptr_vector.hpp"
|
||||
@ -112,14 +113,39 @@ Achievement * AchievementsStatus::getAchievement(uint32_t id)
|
||||
} // getAchievement
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
/** Synchronises the achievements between local and online usage. It takes
|
||||
* the list of online achievements, and marks them all to be achieved
|
||||
* locally. Then it issues 'achieved' requests to the server for all local
|
||||
* achievements that are not set online.
|
||||
*/
|
||||
void AchievementsStatus::sync(const std::vector<uint32_t> & achieved_ids)
|
||||
{
|
||||
std::vector<bool> done;
|
||||
for(unsigned int i =0; i < achieved_ids.size(); ++i)
|
||||
{
|
||||
if(done.size()< achieved_ids[i]+1)
|
||||
done.resize(achieved_ids[i]+1);
|
||||
done[achieved_ids[i]] = true;
|
||||
Achievement * achievement = getAchievement(achieved_ids[i]);
|
||||
if(achievement != NULL)
|
||||
achievement->setAchieved();
|
||||
}
|
||||
|
||||
std::map<uint32_t, Achievement*>::iterator i;
|
||||
|
||||
for(i=m_achievements.begin(); i!=m_achievements.end(); i++)
|
||||
{
|
||||
int id = i->second->getID();
|
||||
if(i->second->isAchieved() && (id>=done.size() || !done[id]) )
|
||||
{
|
||||
Log::info("Achievements", "Synching achievement %d to server.",
|
||||
i->first);
|
||||
Online::HTTPRequest * request = new Online::HTTPRequest(true,2);
|
||||
PlayerManager::setUserDetails(request, "achieving");
|
||||
request->addParameter("achievementid", i->second->getID());
|
||||
request->queue();
|
||||
}
|
||||
}
|
||||
} // sync
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
@ -132,6 +158,7 @@ void AchievementsStatus::onRaceEnd()
|
||||
}
|
||||
} // onRaceEnd
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
void AchievementsStatus::onLapEnd()
|
||||
{
|
||||
//reset all values that need to be reset
|
||||
|
@ -145,10 +145,6 @@ RTT::RTT(size_t width, size_t height)
|
||||
somevector.push_back(RenderTargetTextures[RTT_SSAO]);
|
||||
|
||||
FrameBuffers.push_back(new FrameBuffer(somevector, res.Width, res.Height));
|
||||
// Clear this FBO to 1s so that if no SSAO is computed we can still use it.
|
||||
glClearColor(1., 1., 1., 1.);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
somevector.clear();
|
||||
somevector.push_back(RenderTargetTextures[RTT_NORMAL_AND_DEPTH]);
|
||||
FrameBuffers.push_back(new FrameBuffer(somevector, DepthStencilTexture, res.Width, res.Height));
|
||||
@ -189,6 +185,10 @@ RTT::RTT(size_t width, size_t height)
|
||||
somevector.clear();
|
||||
somevector.push_back(RenderTargetTextures[RTT_HALF1_R]);
|
||||
FrameBuffers.push_back(new FrameBuffer(somevector, half.Width, half.Height));
|
||||
// Clear this FBO to 1s so that if no SSAO is computed we can still use it.
|
||||
glClearColor(1., 1., 1., 1.);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
somevector.clear();
|
||||
somevector.push_back(RenderTargetTextures[RTT_HALF2]);
|
||||
FrameBuffers.push_back(new FrameBuffer(somevector, half.Width, half.Height));
|
||||
|
@ -277,15 +277,11 @@ void Shaders::loadShaders()
|
||||
FullScreenShader::DepthOfFieldShader::init();
|
||||
FullScreenShader::FogShader::init();
|
||||
FullScreenShader::Gaussian17TapHShader::init();
|
||||
#if !defined(__linux__) || defined(GL_VERSION_4_3)
|
||||
FullScreenShader::ComputeGaussian17TapHShader::init();
|
||||
#endif
|
||||
FullScreenShader::Gaussian3HBlurShader::init();
|
||||
FullScreenShader::Gaussian3VBlurShader::init();
|
||||
FullScreenShader::Gaussian17TapVShader::init();
|
||||
#if !defined(__linux__) || defined(GL_VERSION_4_3)
|
||||
FullScreenShader::ComputeGaussian17TapVShader::init();
|
||||
#endif
|
||||
FullScreenShader::Gaussian6HBlurShader::init();
|
||||
FullScreenShader::Gaussian6VBlurShader::init();
|
||||
FullScreenShader::GlowShader::init();
|
||||
@ -419,6 +415,8 @@ namespace UtilShader
|
||||
|
||||
void ColoredLine::setUniforms(const irr::video::SColor &col)
|
||||
{
|
||||
if (UserConfigParams::m_ubo_disabled)
|
||||
bypassUBO(Program);
|
||||
glUniform4i(uniform_color, col.getRed(), col.getGreen(), col.getBlue(), col.getAlpha());
|
||||
glUniformMatrix4fv(glGetUniformLocation(Program, "ModelMatrix"), 1, GL_FALSE, core::IdentityMatrix.pointer());
|
||||
}
|
||||
@ -2448,18 +2446,19 @@ namespace FullScreenShader
|
||||
vao = createFullScreenVAO(Program);
|
||||
}
|
||||
|
||||
#if !defined(__linux__) || defined(GL_VERSION_4_3)
|
||||
GLuint ComputeGaussian17TapHShader::Program;
|
||||
GLuint ComputeGaussian17TapHShader::uniform_source;
|
||||
GLuint ComputeGaussian17TapHShader::uniform_dest;
|
||||
void ComputeGaussian17TapHShader::init()
|
||||
{
|
||||
#if WIN32
|
||||
Program = LoadProgram(
|
||||
GL_COMPUTE_SHADER, file_manager->getAsset("shaders/gaussian.comp").c_str());
|
||||
uniform_source = glGetUniformLocation(Program, "source");
|
||||
uniform_dest = glGetUniformLocation(Program, "dest");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
GLuint Gaussian6HBlurShader::Program;
|
||||
GLuint Gaussian6HBlurShader::uniform_tex;
|
||||
GLuint Gaussian6HBlurShader::uniform_pixel;
|
||||
@ -2505,15 +2504,16 @@ namespace FullScreenShader
|
||||
GLuint ComputeGaussian17TapVShader::Program;
|
||||
GLuint ComputeGaussian17TapVShader::uniform_source;
|
||||
GLuint ComputeGaussian17TapVShader::uniform_dest;
|
||||
#if !defined(__linux__) || defined(GL_VERSION_4_3)
|
||||
void ComputeGaussian17TapVShader::init()
|
||||
{
|
||||
#if WIN32
|
||||
Program = LoadProgram(
|
||||
GL_COMPUTE_SHADER, file_manager->getAsset("shaders/gaussianv.comp").c_str());
|
||||
uniform_source = glGetUniformLocation(Program, "source");
|
||||
uniform_dest = glGetUniformLocation(Program, "dest");
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
GLuint Gaussian6VBlurShader::Program;
|
||||
GLuint Gaussian6VBlurShader::uniform_tex;
|
||||
GLuint Gaussian6VBlurShader::uniform_pixel;
|
||||
|
@ -193,12 +193,12 @@ namespace Online
|
||||
}
|
||||
ProfileManager::get()->addPersistent(m_profile);
|
||||
std::string achieved_string("");
|
||||
if(input->get("achieved", &achieved_string) == 1)
|
||||
{
|
||||
std::vector<uint32_t> achieved_ids =
|
||||
StringUtils::splitToUInt(achieved_string, ' ');
|
||||
PlayerManager::getCurrentAchievementsStatus()->sync(achieved_ids);
|
||||
}
|
||||
// Even if no achievements were sent, we have to call sync
|
||||
// in order to upload local achievements to the server
|
||||
input->get("achieved", &achieved_string);
|
||||
std::vector<uint32_t> achieved_ids =
|
||||
StringUtils::splitToUInt(achieved_string, ' ');
|
||||
PlayerManager::getCurrentAchievementsStatus()->sync(achieved_ids);
|
||||
m_profile->fetchFriends();
|
||||
} // if success
|
||||
else
|
||||
|
Loading…
x
Reference in New Issue
Block a user