Merge branch 'master' of https://github.com/supertuxkart/stk-code into ScriptEngine

This commit is contained in:
Sachith Hasaranga Seneviratne
2014-06-18 13:13:16 +05:30
4 changed files with 34 additions and 8 deletions

View File

@@ -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);

View File

@@ -319,7 +319,7 @@ void FeatureUnlockedCutScene::init()
else if (!m_unlocked_stuff[n].m_pictures.empty())
{
video::SMaterial m;
m.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
//m.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL;
m.BackfaceCulling = false;
m.setTexture(0, m_unlocked_stuff[n].m_pictures[0]);
m.AmbientColor = video::SColor(255, 255, 255, 255);
@@ -335,8 +335,16 @@ void FeatureUnlockedCutScene::init()
irr_driver->createTexturedQuadMesh(&m,
m_unlocked_stuff[n].m_w,
m_unlocked_stuff[n].m_h);
m_unlocked_stuff[n].m_root_gift_node = irr_driver->addMesh(mesh);
mesh->drop();
m_unlocked_stuff[n].m_root_gift_node = irr_driver->getSceneManager()->addEmptySceneNode();
m_unlocked_stuff[n].m_side_1 = irr_driver->addMesh(mesh, m_unlocked_stuff[n].m_root_gift_node);
//mesh->drop();
mesh = irr_driver->createTexturedQuadMesh(&m,
m_unlocked_stuff[n].m_w,
m_unlocked_stuff[n].m_h);
m_unlocked_stuff[n].m_side_2 = irr_driver->addMesh(mesh, m_unlocked_stuff[n].m_root_gift_node);
m_unlocked_stuff[n].m_side_2->setRotation(core::vector3df(0.0f, 180.0f, 0.0f));
//mesh->drop();
#ifdef DEBUG
m_unlocked_stuff[n].m_root_gift_node->setName("unlocked track picture");
#endif
@@ -432,7 +440,7 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
if (textureID != previousTextureID)
{
scene::IMeshSceneNode* node = (scene::IMeshSceneNode*)m_unlocked_stuff[n].m_root_gift_node;
scene::IMesh* mesh = node->getMesh();
scene::IMesh* mesh = m_unlocked_stuff[n].m_side_1->getMesh();
assert(mesh->getMeshBufferCount() == 1);
@@ -443,7 +451,21 @@ void FeatureUnlockedCutScene::onUpdate(float dt)
// FIXME: this mesh is already associated with this node. I'm calling this
// to force irrLicht to refresh the display, now that Material has changed.
node->setMesh(mesh);
m_unlocked_stuff[n].m_side_1->setMesh(mesh);
m_unlocked_stuff[n].m_curr_image = textureID;
mesh = m_unlocked_stuff[n].m_side_2->getMesh();
assert(mesh->getMeshBufferCount() == 1);
mb = mesh->getMeshBuffer(0);
SMaterial& m2 = mb->getMaterial();
m2.setTexture(0, m_unlocked_stuff[n].m_pictures[textureID]);
// FIXME: this mesh is already associated with this node. I'm calling this
// to force irrLicht to refresh the display, now that Material has changed.
m_unlocked_stuff[n].m_side_2->setMesh(mesh);
m_unlocked_stuff[n].m_curr_image = textureID;
} // textureID != previousTextureID

View File

@@ -60,6 +60,9 @@ class FeatureUnlockedCutScene : public GUIEngine::CutsceneScreen, public GUIEngi
/** Contains whatever is in the chest */
scene::ISceneNode* m_root_gift_node;
scene::IMeshSceneNode* m_side_1;
scene::IMeshSceneNode* m_side_2;
float m_scale;
irr::core::stringw m_unlock_message;

View File

@@ -377,7 +377,8 @@ void RaceResultGUI::eventCallback(GUIEngine::Widget* widget,
// FIXME: why is this call necessary here? tearDown should be
// automatically called when the screen is left. Note that the
// NetworkKartSelectionScreen::getInstance()->tearDown(); caused #1347
KartSelectionScreen::getRunningInstance()->tearDown();
//if (KartSelectionScreen::getRunningInstance() != NULL)
// KartSelectionScreen::getRunningInstance()->tearDown();
StateManager::get()->resetAndGoToScreen(MainMenuScreen::getInstance());
if (race_manager->raceWasStartedFromOverworld())