Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge upstream/master into Flakebi/master

  • Loading branch information...
commit 03255a4156f4894b07b64ff423ead9f0920a86fc 2 parents cd8c27c + b041775
@Flakebi Flakebi authored
View
8 src/graphics/post_processing.cpp
@@ -417,12 +417,16 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a
}
else
{
+#if !defined(__linux__) || defined(GL_VERSION_4_2)
glUseProgram(FullScreenShader::ComputeGaussian17TapHShader::Program);
glBindImageTexture(0, in_fbo.getRTT()[0], 0, false, 0, GL_READ_ONLY, GL_R16F);
glBindImageTexture(1, auxiliary.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_R16F);
glUniform1i(FullScreenShader::ComputeGaussian17TapHShader::uniform_source, 0);
glUniform1i(FullScreenShader::ComputeGaussian17TapHShader::uniform_dest, 1);
glDispatchCompute(in_fbo.getWidth() / 8, in_fbo.getHeight() / 8, 1);
+#else
+ assert(false);
+#endif
}
}
{
@@ -443,12 +447,16 @@ void PostProcessing::renderGaussian17TapBlur(FrameBuffer &in_fbo, FrameBuffer &a
}
else
{
+#if !defined(__linux__) || defined(GL_VERSION_4_3)
glUseProgram(FullScreenShader::ComputeGaussian17TapVShader::Program);
glBindImageTexture(0, auxiliary.getRTT()[0], 0, false, 0, GL_READ_ONLY, GL_R16F);
glBindImageTexture(1, in_fbo.getRTT()[0], 0, false, 0, GL_WRITE_ONLY, GL_R16F);
glUniform1i(FullScreenShader::ComputeGaussian17TapVShader::uniform_source, 0);
glUniform1i(FullScreenShader::ComputeGaussian17TapVShader::uniform_dest, 1);
glDispatchCompute(in_fbo.getWidth() / 8, in_fbo.getHeight() / 8, 1);
+#else
+ assert(false);
+#endif
}
}
}
View
12 src/graphics/rtts.cpp
@@ -30,7 +30,13 @@ static GLuint generateRTT3D(GLenum target, size_t w, size_t h, size_t d, GLint i
if (irr_driver->getGLSLVersion() < 420)
glTexImage3D(target, 0, internalFormat, w, h, d, 0, format, type, 0);
else
+ {
+#if !defined(__linux__) || defined(GL_VERSION_4_2)
glTexStorage3D(target, 1, internalFormat, w, h, d);
+#else
+ assert(false);
+#endif
+ }
return result;
}
@@ -42,7 +48,13 @@ static GLuint generateRTT(const core::dimension2du &res, GLint internalFormat, G
if (irr_driver->getGLSLVersion() < 420)
glTexImage2D(GL_TEXTURE_2D, 0, internalFormat, res.Width, res.Height, 0, format, type, 0);
else
+ {
+#if !defined(__linux__) || defined(GL_VERSION_4_2)
glTexStorage2D(GL_TEXTURE_2D, mipmaplevel, internalFormat, res.Width, res.Height);
+#else
+ assert(false);
+#endif
+ }
return result;
}
View
10 src/graphics/shaders.cpp
@@ -277,11 +277,15 @@ 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();
@@ -2441,6 +2445,7 @@ namespace FullScreenShader
vao = createFullScreenVAO(Program);
}
+#if !defined(__linux__) || defined(GL_VERSION_4_3)
GLuint ComputeGaussian17TapHShader::Program;
GLuint ComputeGaussian17TapHShader::uniform_source;
GLuint ComputeGaussian17TapHShader::uniform_dest;
@@ -2451,7 +2456,7 @@ namespace FullScreenShader
uniform_source = glGetUniformLocation(Program, "source");
uniform_dest = glGetUniformLocation(Program, "dest");
}
-
+#endif
GLuint Gaussian6HBlurShader::Program;
GLuint Gaussian6HBlurShader::uniform_tex;
GLuint Gaussian6HBlurShader::uniform_pixel;
@@ -2497,6 +2502,7 @@ namespace FullScreenShader
GLuint ComputeGaussian17TapVShader::Program;
GLuint ComputeGaussian17TapVShader::uniform_source;
GLuint ComputeGaussian17TapVShader::uniform_dest;
+#if !defined(__linux__) || defined(GL_VERSION_4_3)
void ComputeGaussian17TapVShader::init()
{
Program = LoadProgram(
@@ -2504,7 +2510,7 @@ namespace FullScreenShader
uniform_source = glGetUniformLocation(Program, "source");
uniform_dest = glGetUniformLocation(Program, "dest");
}
-
+#endif
GLuint Gaussian6VBlurShader::Program;
GLuint Gaussian6VBlurShader::uniform_tex;
GLuint Gaussian6VBlurShader::uniform_pixel;
View
2  src/karts/kart.cpp
@@ -1752,7 +1752,7 @@ void Kart::crashed(const Material *m, const Vec3 &normal)
btVector3 gravity = m_body->getGravity();
gravity.normalize();
// Cast necessary since otherwise to operator- (vec3/btvector) exists
- Vec3 impulse = (btVector3)normal - gravity* btDot(normal, gravity);
+ Vec3 impulse = normal - gravity* btDot(normal, gravity);
if(impulse.getX() || impulse.getZ())
impulse.normalize();
else
View
24 src/modes/cutscene_world.cpp
@@ -413,7 +413,7 @@ void CutsceneWorld::enterRaceOverState()
OverWorld::enterOverWorld();
}
// TODO: remove hardcoded knowledge of cutscenes, replace with scripting probably
- else if (m_parts.size() == 1 && m_parts[0] == "gplose")
+ else if (m_parts.size() == 1 && m_parts[0] == "gplose")
{
race_manager->exitRace();
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
@@ -438,6 +438,28 @@ void CutsceneWorld::enterRaceOverState()
StateManager::get()->pushScreen( s );
}
}
+ // TODO: remove hardcoded knowledge of cutscenes, replace with scripting probably
+ else if (m_parts.size() == 1 && m_parts[0] == "featunlocked")
+ {
+ if (race_manager->getMajorMode() == RaceManager::MAJOR_MODE_GRAND_PRIX)
+ {
+ // in GP mode, continue GP after viewing this screen
+ StateManager::get()->popMenu();
+ race_manager->next();
+ }
+ else
+ {
+ // back to menu or overworld
+ race_manager->exitRace();
+ StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
+ //StateManager::get()->popMenu();
+
+ if (race_manager->raceWasStartedFromOverworld())
+ {
+ OverWorld::enterOverWorld();
+ }
+ }
+ }
else
{
race_manager->exitRace();
View
2  src/physics/physical_object.cpp
@@ -188,7 +188,7 @@ void PhysicalObject::move(const Vec3& xyz, const core::vector3df& hpr)
irr::core::quaternion tempQuat(mat);
q = btQuaternion(tempQuat.X, tempQuat.Y, tempQuat.Z, tempQuat.W);
- btTransform trans(q,(btVector3)xyz-quatRotate(q,m_graphical_offset));
+ btTransform trans(q, xyz-quatRotate(q,m_graphical_offset));
m_motion_state->setWorldTransform(trans);
} // move
View
49 src/states_screens/feature_unlocked.cpp
@@ -156,7 +156,7 @@ void FeatureUnlockedCutScene::onCutsceneEnd()
irr_driver->removeNode(m_avoid_irrlicht_bug);
m_avoid_irrlicht_bug = NULL;
#endif
-
+
m_unlocked_stuff.clearAndDeleteAll();
m_all_kart_models.clearAndDeleteAll();
@@ -353,7 +353,6 @@ void FeatureUnlockedCutScene::init()
void FeatureUnlockedCutScene::tearDown()
{
Screen::tearDown();
- ((CutsceneWorld*)World::getWorld())->abortCutscene();
} // tearDown
// ----------------------------------------------------------------------------
@@ -379,8 +378,6 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
float progress_factor = (m_global_time - GIFT_EXIT_FROM) / (GIFT_EXIT_TO - GIFT_EXIT_FROM);
float smoothed_progress_factor = sin((progress_factor - 0.5f)*M_PI)/2.0f + 0.5f;
- Log::info("smoothed_progress_factor", "%f", smoothed_progress_factor);
-
for (int n=0; n<unlockedStuffCount; n++)
{
if (m_unlocked_stuff[n].m_root_gift_node == NULL) continue;
@@ -546,7 +543,6 @@ void FeatureUnlockedCutScene::addUnlockedGP(const GrandPrixData* gp)
bool FeatureUnlockedCutScene::onEscapePressed()
{
- ((CutsceneWorld*)World::getWorld())->abortCutscene();
continueButtonPressed();
return false; // continueButtonPressed already pop'ed the menu
} // onEscapePressed
@@ -555,35 +551,20 @@ bool FeatureUnlockedCutScene::onEscapePressed()
void FeatureUnlockedCutScene::continueButtonPressed()
{
- if (m_global_time < GIFT_EXIT_TO)
- {
- // If animation was not over yet, the button is used to skip the animation
- while (m_global_time < GIFT_EXIT_TO)
- {
- // simulate all the steps of the animation until we reach the end
- onUpdate(0.4f);
- }
- }
- else
- {
- if (race_manager->getMajorMode() == RaceManager::MAJOR_MODE_GRAND_PRIX)
- {
- // in GP mode, continue GP after viewing this screen
- StateManager::get()->popMenu();
- race_manager->next();
- }
- else
- {
- // back to menu or overworld
- race_manager->exitRace();
- StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
-
- if (race_manager->raceWasStartedFromOverworld())
- {
- OverWorld::enterOverWorld();
- }
- }
- }
+ //if (m_global_time < GIFT_EXIT_TO)
+ //{
+ // // If animation was not over yet, the button is used to skip the animation
+ // while (m_global_time < GIFT_EXIT_TO)
+ // {
+ // // simulate all the steps of the animation until we reach the end
+ // onUpdate(0.4f);
+ // World::getWorld()->updateWorld(0.4f);
+ // }
+ //}
+ //else
+ //{
+ ((CutsceneWorld*)World::getWorld())->abortCutscene();
+ //}
} // continueButtonPressed
View
9 src/states_screens/grand_prix_lose.cpp
@@ -117,9 +117,18 @@ void GrandPrixLose::onCutsceneEnd()
PlayerManager::getCurrentPlayer()->getRecentlyCompletedChallenges();
if (unlocked.size() > 0)
{
+ StateManager::get()->enterGameState();
+ race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE);
+ race_manager->setNumKarts(0);
+ race_manager->setNumPlayers(0);
+ race_manager->setNumLocalPlayers(0);
+ race_manager->startSingleRace("featunlocked", 999, false);
FeatureUnlockedCutScene* scene =
FeatureUnlockedCutScene::getInstance();
+ std::vector<std::string> parts;
+ parts.push_back("featunlocked");
+ ((CutsceneWorld*)World::getWorld())->setParts(parts);
scene->addTrophy(race_manager->getDifficulty());
scene->findWhatWasUnlocked(race_manager->getDifficulty());
View
13 src/states_screens/grand_prix_win.cpp
@@ -127,7 +127,18 @@ void GrandPrixWin::onCutsceneEnd()
PlayerManager::getCurrentPlayer()->getRecentlyCompletedChallenges();
PlayerManager::getCurrentPlayer()->clearUnlocked();
- FeatureUnlockedCutScene* scene = FeatureUnlockedCutScene::getInstance();
+ StateManager::get()->enterGameState();
+ race_manager->setMinorMode(RaceManager::MINOR_MODE_CUTSCENE);
+ race_manager->setNumKarts(0);
+ race_manager->setNumPlayers(0);
+ race_manager->setNumLocalPlayers(0);
+ race_manager->startSingleRace("featunlocked", 999, false);
+
+ FeatureUnlockedCutScene* scene =
+ FeatureUnlockedCutScene::getInstance();
+ std::vector<std::string> parts;
+ parts.push_back("featunlocked");
+ ((CutsceneWorld*)World::getWorld())->setParts(parts);
assert(unlocked.size() > 0);
scene->addTrophy(race_manager->getDifficulty());
View
4 src/states_screens/race_result_gui.cpp
@@ -275,6 +275,10 @@ void RaceResultGUI::eventCallback(GUIEngine::Widget* widget,
{
FeatureUnlockedCutScene* scene =
FeatureUnlockedCutScene::getInstance();
+ std::vector<std::string> parts;
+ parts.push_back("featunlocked");
+ ((CutsceneWorld*)World::getWorld())->setParts(parts);
+
scene->addTrophy(race_manager->getDifficulty());
scene->findWhatWasUnlocked(race_manager->getDifficulty());
StateManager::get()->popMenu();
View
29 src/states_screens/register_screen.cpp
@@ -89,17 +89,11 @@ void RegisterScreen::init()
getWidget<CheckBoxWidget>("online")->setVisible(true);
getWidget<LabelWidget>("label_online")->setVisible(true);
- // Check if online is allowed
- if (UserConfigParams::m_internet_status != Online::RequestManager::IPERM_NOT_ALLOWED)
- {
- getWidget<CheckBoxWidget>("online")->setState(true);
- makeEntryFieldsVisible(true);
- }
- else
- {
- getWidget<CheckBoxWidget>("online")->setState(false);
- makeEntryFieldsVisible(false);
- }
+ onDialogClose();
+ bool online = UserConfigParams::m_internet_status
+ != Online::RequestManager::IPERM_NOT_ALLOWED;
+ getWidget<CheckBoxWidget>("online")->setState(online);
+ makeEntryFieldsVisible(online);
} // init
// -----------------------------------------------------------------------------
@@ -109,6 +103,19 @@ void RegisterScreen::setRename(PlayerProfile *player)
} // setRename
// -----------------------------------------------------------------------------
+/** Will be called first time STK is started, when the 'internet yes/no' dialog
+ * is closed. Adjust the state of the online checkbox depending on that
+ * answer.
+ */
+void RegisterScreen::onDialogClose()
+{
+ bool online = UserConfigParams::m_internet_status
+ != Online::RequestManager::IPERM_NOT_ALLOWED;
+ getWidget<CheckBoxWidget>("online")->setState(online);
+ makeEntryFieldsVisible(online);
+} // onDialogClose
+
+// -----------------------------------------------------------------------------
/** Shows or hides the entry fields for online registration, depending on
* online mode.
* \param online True if an online account should be created.
View
1  src/states_screens/register_screen.hpp
@@ -64,6 +64,7 @@ class RegisterScreen : public GUIEngine::Screen,
virtual void loadedFromFile() OVERRIDE {};
virtual void onUpdate(float dt) OVERRIDE;
virtual bool onEscapePressed() OVERRIDE;
+ virtual void onDialogClose() OVERRIDE;
void setRename(PlayerProfile *player);
void acceptTerms();
View
35 src/states_screens/user_screen.cpp
@@ -177,6 +177,10 @@ void BaseUserScreen::selectUser(int index)
m_username_tb->setText(profile->getLastOnlineName());
getWidget<CheckBoxWidget>("remember-user")->setState(
profile->rememberPassword());
+ if(profile->getLastOnlineName().size()>0)
+ m_username_tb->setDeactivated();
+ else
+ m_username_tb->setActivated();
// And make the password invisible if the session is saved (i.e
// the user does not need to enter a password).
@@ -339,10 +343,11 @@ void BaseUserScreen::login()
m_sign_out_name = current->getLastOnlineName();
current->requestSignOut();
m_state = (UserScreenState)(m_state | STATE_LOGOUT);
+
// If the online user name was changed, reset the save data
// for this user (otherwise later the saved session will be
// resumed, not logging the user with the new account).
- if(current->getLastOnlineName()!=new_username)
+ if(player==current && current->getLastOnlineName()!=new_username)
current->clearSession();
}
PlayerManager::get()->setCurrentPlayer(player);
@@ -567,34 +572,6 @@ void BaseUserScreen::unloaded()
} // unloaded
-// ----------------------------------------------------------------------------
-/** Gets called when a dialog closes. At a first time start of STK the
- * internet dialog is shown first. Only when this dialog closes is it possible
- * to open the next dialog, which is the one to create a new player (which
- * is conventient on a first start).
- */
-void BaseUserScreen::onDialogClose()
-{
- return;
- // To allow players to exit the game without creating a player, we count
- // how often this function was called. The first time is after the
- // internet allowed dialog, the 2nd time
- static int number_of_calls = 0;
- number_of_calls++;
- if(PlayerManager::get()->getNumPlayers() == 0)
- {
- // Still 0 players after the enter player dialog was shown
- // --> User wanted to abort, so pop this menu, which will
- // trigger the end of STK.
- if (number_of_calls > 1)
- {
- StateManager::get()->popMenu();
- return;
- }
- StateManager::get()->pushScreen(RegisterScreen::getInstance());
- } // getNumPlayers == 0
-} // onDialogClose
-
// ============================================================================
/** In the tab version, make sure the right tab is selected.
View
1  src/states_screens/user_screen.hpp
@@ -89,7 +89,6 @@ class BaseUserScreen : public GUIEngine::Screen
void deletePlayer();
void doDeletePlayer();
PlayerProfile* getSelectedPlayer();
- virtual void onDialogClose();
virtual void onUpdate(float dt) OVERRIDE;
public:
View
8 src/utils/vec3.hpp
@@ -168,6 +168,14 @@ class Vec3 : public btVector3
Vec3 operator-(const Vec3& v1) const {return (Vec3)(*(btVector3*)this
-(btVector3)v1); }
// ------------------------------------------------------------------------
+ /** Computes this = this - v1. On VS this special version is needed,
+ * since otherwise Vec3-btVector3 is ont unique (could be cast to
+ * btVector3-btVector3, or convert btVector3 to Vec3()). */
+ Vec3 operator-(const btVector3 v1) const
+ {
+ return *(btVector3*)this - v1;
+ }
+ // ------------------------------------------------------------------------
/** Helper functions to treat this vec3 as a 2d vector. This returns the
* square of the length of the first 2 dimensions. */
float length2_2d() const { return m_floats[0]*m_floats[0]
Please sign in to comment.
Something went wrong with that request. Please try again.