Fix wrong normal, vertex 2 color and memory leak of texture quad

Fix #2979
This commit is contained in:
Benau 2017-10-29 16:18:16 +08:00
parent e57c2bbbd3
commit d9d3afc36e
3 changed files with 9 additions and 9 deletions

View File

@ -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<f32>(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<f32>(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<f32>(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<f32>(1,0);
v4.Color = video::SColor(255, 255, 255, 255);

View File

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

View File

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