From d9d3afc36e23e1f377de30093b39f0fc19d45d00 Mon Sep 17 00:00:00 2001 From: Benau Date: Sun, 29 Oct 2017 16:18:16 +0800 Subject: [PATCH] Fix wrong normal, vertex 2 color and memory leak of texture quad Fix #2979 --- src/graphics/irr_driver.cpp | 10 +++++----- src/states_screens/feature_unlocked.cpp | 6 +++--- src/states_screens/main_menu_screen.cpp | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/graphics/irr_driver.cpp b/src/graphics/irr_driver.cpp index e03c8ba90..25181aa26 100644 --- a/src/graphics/irr_driver.cpp +++ b/src/graphics/irr_driver.cpp @@ -1295,25 +1295,25 @@ scene::IMesh *IrrDriver::createTexturedQuadMesh(const video::SMaterial *material video::S3DVertex v1; v1.Pos = core::vector3df(-w_2,-h_2,0); - v1.Normal = core::vector3df(0, 0, -1.0f); + v1.Normal = core::vector3df(0, 0, 1); v1.TCoords = core::vector2d(1,1); v1.Color = video::SColor(255, 255, 255, 255); video::S3DVertex v2; v2.Pos = core::vector3df(w_2,-h_2,0); - v2.Normal = core::vector3df(0, 0, -1.0f); + v2.Normal = core::vector3df(0, 0, 1); v2.TCoords = core::vector2d(0,1); - v1.Color = video::SColor(255, 255, 255, 255); + v2.Color = video::SColor(255, 255, 255, 255); video::S3DVertex v3; v3.Pos = core::vector3df(w_2,h_2,0); - v3.Normal = core::vector3df(0, 0, -1.0f); + v3.Normal = core::vector3df(0, 0, 1); v3.TCoords = core::vector2d(0,0); v3.Color = video::SColor(255, 255, 255, 255); video::S3DVertex v4; v4.Pos = core::vector3df(-w_2,h_2,0); - v4.Normal = core::vector3df(0, 0, -1.0f); + v4.Normal = core::vector3df(0, 0, 1); v4.TCoords = core::vector2d(1,0); v4.Color = video::SColor(255, 255, 255, 255); diff --git a/src/states_screens/feature_unlocked.cpp b/src/states_screens/feature_unlocked.cpp index 3a1262cf0..8ae059181 100644 --- a/src/states_screens/feature_unlocked.cpp +++ b/src/states_screens/feature_unlocked.cpp @@ -324,7 +324,7 @@ void FeatureUnlockedCutScene::init() { video::SMaterial m; //m.MaterialType = video::EMT_TRANSPARENT_ALPHA_CHANNEL; - m.BackfaceCulling = false; + m.BackfaceCulling = true; m.setTexture(0, m_unlocked_stuff[n].m_pictures[0]); m.AmbientColor = video::SColor(255, 255, 255, 255); m.DiffuseColor = video::SColor(255, 255, 255, 255); @@ -342,7 +342,7 @@ void FeatureUnlockedCutScene::init() m_unlocked_stuff[n].m_root_gift_node = irr_driver->getSceneManager()->addEmptySceneNode(); irr_driver->setAllMaterialFlags(mesh); m_unlocked_stuff[n].m_side_1 = irr_driver->addMesh(mesh, "unlocked_picture", m_unlocked_stuff[n].m_root_gift_node); - //mesh->drop(); + mesh->drop(); mesh = irr_driver->createTexturedQuadMesh(&m, m_unlocked_stuff[n].m_w, @@ -350,7 +350,7 @@ void FeatureUnlockedCutScene::init() irr_driver->setAllMaterialFlags(mesh); m_unlocked_stuff[n].m_side_2 = irr_driver->addMesh(mesh, "unlocked_picture", 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(); + mesh->drop(); #ifdef DEBUG m_unlocked_stuff[n].m_root_gift_node->setName("unlocked track picture"); #endif diff --git a/src/states_screens/main_menu_screen.cpp b/src/states_screens/main_menu_screen.cpp index 57dc0f796..35523b85d 100644 --- a/src/states_screens/main_menu_screen.cpp +++ b/src/states_screens/main_menu_screen.cpp @@ -355,7 +355,7 @@ void MainMenuScreen::eventCallback(Widget* widget, const std::string& name, track_manager->getTrack("lighthouse") ->getScreenshotFile().c_str())); textures.push_back(irr_driver->getTexture( - track_manager->getTrack("startrack") + track_manager->getTrack("snowtuxpeak") ->getScreenshotFile().c_str())); textures.push_back(irr_driver->getTexture( track_manager->getTrack("sandtrack")