Permalink
Browse files

Merge branch 'master' into shadowdebug

  • Loading branch information...
2 parents bd6c8c4 + b9c45b7 commit 32e6942b55ad4cfe0ddf8f3add54de9066d50a14 Vincent Lejeune committed Jun 17, 2014
Showing with 730 additions and 734 deletions.
  1. BIN data/fonts/BigDigitFont.xml
  2. BIN data/fonts/sigmar0.png
  3. +35 −0 data/gfx/gfx_sparkFire_a.xml
  4. +1 −0 data/shaders/fog.frag
  5. +1 −0 data/shaders/sunlight.frag
  6. +1 −0 data/shaders/sunlightshadow.frag
  7. +8 −1 data/shaders/tonemap.frag
  8. +1 −1 lib/bullet/src/LinearMath/btScalar.h
  9. +1 −1 sources.cmake
  10. +36 −0 src/achievements/achievements_status.cpp
  11. +1 −0 src/animations/animation_base.hpp
  12. +5 −8 src/config/player_manager.cpp
  13. +15 −11 src/config/player_profile.cpp
  14. +16 −1 src/config/player_profile.hpp
  15. +0 −4 src/config/user_config.hpp
  16. +3 −3 src/graphics/glwrap.cpp
  17. +1 −1 src/graphics/material.cpp
  18. +2 −0 src/graphics/material.hpp
  19. +6 −6 src/graphics/rtts.cpp
  20. +9 −9 src/graphics/shaders.cpp
  21. +1 −1 src/graphics/stkbillboard.cpp
  22. +5 −2 src/graphics/stkmesh.cpp
  23. +5 −3 src/guiengine/abstract_state_manager.cpp
  24. +1 −1 src/guiengine/abstract_state_manager.hpp
  25. +9 −9 src/guiengine/engine.cpp
  26. +45 −160 src/guiengine/event_handler.cpp
  27. +1 −2 src/guiengine/event_handler.hpp
  28. +4 −5 src/guiengine/scalable_font.cpp
  29. +6 −4 src/guiengine/scalable_font.hpp
  30. +0 −1 src/guiengine/widget.cpp
  31. +0 −2 src/guiengine/widgets/spinner_widget.hpp
  32. +6 −0 src/items/flyable.cpp
  33. +8 −1 src/main.cpp
  34. +105 −14 src/modes/cutscene_world.cpp
  35. +5 −0 src/modes/world.cpp
  36. +1 −1 src/modes/world_with_rank.hpp
  37. +0 −109 src/online/messages.cpp
  38. +0 −49 src/online/messages.hpp
  39. +13 −13 src/online/online_player_profile.cpp
  40. +2 −2 src/states_screens/create_server_screen.cpp
  41. +2 −2 src/states_screens/dialogs/change_password_dialog.cpp
  42. +2 −2 src/states_screens/dialogs/recovery_dialog.cpp
  43. +0 −1 src/states_screens/dialogs/registration_dialog.cpp
  44. +2 −2 src/states_screens/dialogs/server_info_dialog.cpp
  45. +2 −2 src/states_screens/dialogs/user_info_dialog.cpp
  46. +4 −5 src/states_screens/dialogs/vote_dialog.cpp
  47. +29 −5 src/states_screens/feature_unlocked.cpp
  48. +3 −0 src/states_screens/feature_unlocked.hpp
  49. +0 −40 src/states_screens/grand_prix_lose.cpp
  50. +0 −37 src/states_screens/grand_prix_win.cpp
  51. +22 −9 src/states_screens/main_menu_screen.cpp
  52. +3 −4 src/states_screens/online_profile_achievements.cpp
  53. +3 −3 src/states_screens/online_profile_friends.cpp
  54. +4 −3 src/states_screens/online_screen.cpp
  55. +3 −3 src/states_screens/online_user_search.cpp
  56. +157 −121 src/states_screens/race_gui.cpp
  57. +25 −13 src/states_screens/race_gui.hpp
  58. +2 −1 src/states_screens/race_result_gui.cpp
  59. +2 −2 src/states_screens/register_screen.cpp
  60. +4 −3 src/states_screens/server_selection.cpp
  61. +27 −44 src/states_screens/user_screen.cpp
  62. +24 −0 src/utils/string_utils.cpp
  63. +2 −0 src/utils/string_utils.hpp
  64. +18 −1 tools/font_tool/CFontTool.cpp
  65. +1 −0 tools/font_tool/CFontTool.h
  66. +1 −1 tools/font_tool/CMakeLists.txt
  67. +29 −5 tools/font_tool/main.cpp
View
BIN data/fonts/BigDigitFont.xml 100644 → 100755
Binary file not shown.
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -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>
View
@@ -12,6 +12,7 @@ uniform mat4 ViewMatrix;
uniform mat4 ProjectionMatrix;
uniform mat4 InverseViewMatrix;
uniform mat4 InverseProjectionMatrix;
+uniform vec2 screen;
#else
layout (std140) uniform MatrixesData
{
@@ -13,6 +13,7 @@ uniform mat4 ViewMatrix;
uniform mat4 ProjectionMatrix;
uniform mat4 InverseViewMatrix;
uniform mat4 InverseProjectionMatrix;
+uniform vec2 screen;
#else
layout (std140) uniform MatrixesData
{
@@ -16,6 +16,7 @@ uniform mat4 ProjectionMatrix;
uniform mat4 InverseViewMatrix;
uniform mat4 InverseProjectionMatrix;
uniform mat4 ShadowViewProjMatrixes[4];
+uniform vec2 screen;
#else
layout (std140) uniform MatrixesData
{
@@ -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);
}
@@ -109,7 +109,7 @@ inline int btGetVersion()
#ifdef __SPU__
#include <spu_printf.h>
#define printf spu_printf
- #define btAssert(x) {if(!(x)){printf("Assert "__FILE__ ":%u ("#x")\n", __LINE__);spu_hcmpeq(0,0);}}
+ #define btAssert(x) {if(!(x)){printf("Assert " __FILE__ ":%u ("#x")\n", __LINE__);spu_hcmpeq(0,0);}}
#else
#define btAssert assert
#endif
View
@@ -1,5 +1,5 @@
# Modify this file to change the last-modified date when you add/remove a file.
# This will then trigger a new cmake run automatically.
-file(GLOB_RECURSE STK_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp")
file(GLOB_RECURSE STK_HEADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.hpp")
+file(GLOB_RECURSE STK_SOURCES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "src/*.cpp")
file(GLOB_RECURSE STK_SHADERS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "data/shaders/*")
@@ -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,48 @@ 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;
+
+ // String to collect all local ids that are not synched
+ // to the online account
+ std::string ids;
+ for(i=m_achievements.begin(); i!=m_achievements.end(); i++)
+ {
+ unsigned int id = i->second->getID();
+ if(i->second->isAchieved() && (id>=done.size() || !done[id]) )
+ {
+ ids=ids+StringUtils::toString(id)+",";
+ }
+ }
+
+ if(ids.size()>0)
+ {
+ ids = ids.substr(0, ids.size() - 1); // delete the last "," in the string
+ Log::info("Achievements", "Synching achievement %d to server.",
+ ids.c_str());
+ Online::HTTPRequest * request = new Online::HTTPRequest(true, 2);
+ PlayerManager::setUserDetails(request, "achieving");
+ request->addParameter("achievementid", ids);
+ request->queue();
+ }
} // sync
// ----------------------------------------------------------------------------
@@ -132,6 +167,7 @@ void AchievementsStatus::onRaceEnd()
}
} // onRaceEnd
+// ----------------------------------------------------------------------------
void AchievementsStatus::onLapEnd()
{
//reset all values that need to be reset
@@ -69,6 +69,7 @@ class AnimationBase
public:
AnimationBase(const XMLNode &node);
AnimationBase(Ipo *ipo);
+ virtual ~AnimationBase() {}
virtual void update(float dt, Vec3 *xyz=NULL, Vec3 *hpr=NULL,
Vec3 *scale=NULL);
/** This needs to be implemented by the inheriting classes. It is called
@@ -166,15 +166,12 @@ PlayerManager::PlayerManager()
*/
PlayerManager::~PlayerManager()
{
- // If the passwords should not be remembered, clear all saved sessions.
- if(!UserConfigParams::m_remember_user)
+ // If the passwords should not be remembered, clear the saved session.
+ PlayerProfile *player;
+ for_in(player, m_all_players)
{
- PlayerProfile *player;
- for_in(player, m_all_players)
- {
+ if(!player->rememberPassword())
player->clearSession();
- }
-
}
save();
@@ -266,7 +263,7 @@ void PlayerManager::save()
players_file << L"<?xml version=\"1.0\"?>\n";
players_file << L"<players version=\"1\" >\n";
- if(m_current_player && UserConfigParams::m_remember_user)
+ if(m_current_player)
{
players_file << L" <current player=\""
<< m_current_player->getName() << L"\"/>\n";
@@ -47,6 +47,7 @@ PlayerProfile::PlayerProfile(const core::stringw& name, bool is_guest)
m_saved_user_id = 0;
m_last_online_name = "";
m_last_was_online = false;
+ m_remember_password = false;
initRemainingData();
} // PlayerProfile
@@ -72,20 +73,22 @@ PlayerProfile::PlayerProfile(const XMLNode* node)
m_saved_user_id = 0;
m_last_online_name = "";
m_last_was_online = false;
+ m_remember_password = false;
m_story_mode_status = NULL;
m_achievements_status = NULL;
m_icon_filename = "";
- node->get("name", &m_local_name );
- node->get("guest", &m_is_guest_account);
- node->get("use-frequency", &m_use_frequency );
- node->get("unique-id", &m_unique_id );
- node->get("saved-session", &m_saved_session );
- node->get("saved-user", &m_saved_user_id );
- node->get("saved-token", &m_saved_token );
- node->get("last-online-name", &m_last_online_name);
- node->get("last-was-online", &m_last_was_online );
- node->get("icon-filename", &m_icon_filename );
+ node->get("name", &m_local_name );
+ node->get("guest", &m_is_guest_account );
+ node->get("use-frequency", &m_use_frequency );
+ node->get("unique-id", &m_unique_id );
+ node->get("saved-session", &m_saved_session );
+ node->get("saved-user", &m_saved_user_id );
+ node->get("saved-token", &m_saved_token );
+ node->get("last-online-name", &m_last_online_name );
+ node->get("last-was-online", &m_last_was_online );
+ node->get("remember-password", &m_remember_password);
+ node->get("icon-filename", &m_icon_filename );
#ifdef DEBUG
m_magic_number = 0xABCD1234;
@@ -203,7 +206,8 @@ void PlayerProfile::save(UTFWriter &out)
out << L" saved-user=\"" << m_saved_user_id
<< L"\" saved-token=\"" << m_saved_token << L"\"\n";
out << L" last-online-name=\"" << m_last_online_name
- << L"\" last-was-online=\"" << m_last_was_online<< L"\">\n";
+ << L"\" last-was-online=\"" << m_last_was_online << L"\"\n";
+ out << L" remember-password=\"" << m_remember_password << L"\">\n";
{
if(m_story_mode_status)
m_story_mode_status->save(out);
@@ -101,6 +101,9 @@ class PlayerProfile : public NoCopy
/** True if the last time this player was used as online. */
bool m_last_was_online;
+ /** True if the login data are saved. */
+ bool m_remember_password;
+
/** The complete challenge state. */
StoryModeStatus *m_story_mode_status;
@@ -212,7 +215,10 @@ class PlayerProfile : public NoCopy
// ------------------------------------------------------------------------
bool isFirstTime() const { return m_story_mode_status->isFirstTime(); }
// ------------------------------------------------------------------------
- void clearUnlocked() { m_story_mode_status->clearUnlocked(); }
+ void clearUnlocked()
+ {
+ m_story_mode_status->clearUnlocked();
+ }
// ------------------------------------------------------------------------
/** Returns the current challenge for this player. */
const ChallengeStatus* getCurrentChallengeStatus() const
@@ -248,6 +254,8 @@ class PlayerProfile : public NoCopy
/** Returns true if a session was saved for this player. */
bool hasSavedSession() const { return m_saved_session; }
// ------------------------------------------------------------------------
+ StoryModeStatus* getStoryModeStatus() { return m_story_mode_status; }
+ // ------------------------------------------------------------------------
/** If a session was saved, return the id of the saved user. */
int getSavedUserId() const
{
@@ -269,6 +277,13 @@ class PlayerProfile : public NoCopy
/** Sets if this player was logged in last time it was used. */
void setWasOnlineLastTime(bool b) { m_last_was_online = b; }
// ------------------------------------------------------------------------
+ /** Returns if the last time this player was used it was used online or
+ * offline. */
+ bool rememberPassword() const { return m_remember_password; }
+ // ------------------------------------------------------------------------
+ /** Sets if this player was logged in last time it was used. */
+ void setRememberPassword(bool b) { m_remember_password = b; }
+ // ------------------------------------------------------------------------
}; // class PlayerProfile
#endif
@@ -682,10 +682,6 @@ namespace UserConfigParams
// ---- User managerment
- PARAM_PREFIX BoolUserConfigParam m_remember_user
- PARAM_DEFAULT( BoolUserConfigParam(true, "remember_me",
- "Automatically remember login data"));
-
PARAM_PREFIX BoolUserConfigParam m_always_show_login_screen
PARAM_DEFAULT( BoolUserConfigParam(false, "always_show_login_screen",
"Always show the login screen even if last player's session was saved."));
View
@@ -532,7 +532,7 @@ unsigned GPUTimer::elapsedTimeus()
FrameBuffer::FrameBuffer() {}
FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, size_t w, size_t h, bool layered) :
- DepthTexture(0), RenderTargets(RTTs), width(w), height(h)
+ RenderTargets(RTTs), DepthTexture(0), width(w), height(h)
{
glGenFramebuffers(1, &fbo);
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
@@ -551,7 +551,7 @@ FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, size_t w, size_t h, bo
}
FrameBuffer::FrameBuffer(const std::vector<GLuint> &RTTs, GLuint DS, size_t w, size_t h, bool layered) :
- DepthTexture(DS), RenderTargets(RTTs), width(w), height(h)
+ RenderTargets(RTTs), DepthTexture(DS), width(w), height(h)
{
glGenFramebuffers(1, &fbo);
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
@@ -904,4 +904,4 @@ void GL32_draw2DRectangle(video::SColor color, const core::rect<s32>& position,
glUseProgram(0);
glGetError();
-}
+}
@@ -137,7 +137,7 @@ Material::Material(const XMLNode *node, int index, bool deprecated)
node->get("fog", &m_fog );
node->get("mask", &m_mask );
-
+ node->get("gloss-map", &m_gloss_map );
node->get("water-splash", &m_water_splash );
node->get("jump", &m_is_jump_texture );
node->get("has-gravity", &m_has_gravity );
@@ -224,6 +224,8 @@ class Material : public NoCopy
/** If m_splatting is true, indicates the fourth splatting texture */
std::string m_splatting_texture_4;
+ std::string m_gloss_map;
+
bool m_deprecated;
void init (unsigned int index);
View
@@ -31,7 +31,7 @@ static GLuint generateRTT3D(GLenum target, size_t w, size_t h, size_t d, GLint i
glTexImage3D(target, 0, internalFormat, w, h, d, 0, format, type, 0);
else
{
-#if !defined(__linux__) || defined(GL_VERSION_4_2)
+#if WIN32
glTexStorage3D(target, 1, internalFormat, w, h, d);
#else
assert(false);
@@ -49,7 +49,7 @@ static GLuint generateRTT(const core::dimension2du &res, GLint internalFormat, G
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, res.Width, res.Height, 0, format, type, 0);
else
{
-#if !defined(__linux__) || defined(GL_VERSION_4_2)
+#if WIN32
glTexStorage2D(GL_TEXTURE_2D, mipmaplevel, internalFormat, res.Width, res.Height);
#else
assert(false);
@@ -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));
Oops, something went wrong.

0 comments on commit 32e6942

Please sign in to comment.