Commit d85ae3cd authored by mercury233's avatar mercury233

don't removeTexture same pointer twice in ImageManager::ResizeTexture

the driver do support removeTexture twice although
parent 88ba8c9c
...@@ -93,7 +93,8 @@ void ImageManager::ResizeTexture() { ...@@ -93,7 +93,8 @@ void ImageManager::ResizeTexture() {
irr::s32 bgWidth = 1024 * mainGame->xScale; irr::s32 bgWidth = 1024 * mainGame->xScale;
irr::s32 bgHeight = 640 * mainGame->yScale; irr::s32 bgHeight = 640 * mainGame->yScale;
driver->removeTexture(tCover[0]); driver->removeTexture(tCover[0]);
driver->removeTexture(tCover[1]); if(tCover[1] != tCover[0])
driver->removeTexture(tCover[1]);
tCover[0] = GetTextureFromFile("textures/cover.jpg", imgWidth, imgHeight); tCover[0] = GetTextureFromFile("textures/cover.jpg", imgWidth, imgHeight);
tCover[1] = GetTextureFromFile("textures/cover2.jpg", imgWidth, imgHeight); tCover[1] = GetTextureFromFile("textures/cover2.jpg", imgWidth, imgHeight);
if(!tCover[1]) if(!tCover[1])
...@@ -107,12 +108,14 @@ void ImageManager::ResizeTexture() { ...@@ -107,12 +108,14 @@ void ImageManager::ResizeTexture() {
tUnknownFit = GetTextureFromFile("textures/unknown.jpg", imgWidthFit, imgHeightFit); tUnknownFit = GetTextureFromFile("textures/unknown.jpg", imgWidthFit, imgHeightFit);
tUnknownThumb = GetTextureFromFile("textures/unknown.jpg", imgWidthThumb, imgHeightThumb); tUnknownThumb = GetTextureFromFile("textures/unknown.jpg", imgWidthThumb, imgHeightThumb);
driver->removeTexture(tBackGround); driver->removeTexture(tBackGround);
if(tBackGround_menu != tBackGround)
driver->removeTexture(tBackGround_menu);
if(tBackGround_deck != tBackGround)
driver->removeTexture(tBackGround_deck);
tBackGround = GetTextureFromFile("textures/bg.jpg", bgWidth, bgHeight); tBackGround = GetTextureFromFile("textures/bg.jpg", bgWidth, bgHeight);
driver->removeTexture(tBackGround_menu);
tBackGround_menu = GetTextureFromFile("textures/bg_menu.jpg", bgWidth, bgHeight); tBackGround_menu = GetTextureFromFile("textures/bg_menu.jpg", bgWidth, bgHeight);
if(!tBackGround_menu) if(!tBackGround_menu)
tBackGround_menu = tBackGround; tBackGround_menu = tBackGround;
driver->removeTexture(tBackGround_deck);
tBackGround_deck = GetTextureFromFile("textures/bg_deck.jpg", bgWidth, bgHeight); tBackGround_deck = GetTextureFromFile("textures/bg_deck.jpg", bgWidth, bgHeight);
if(!tBackGround_deck) if(!tBackGround_deck)
tBackGround_deck = tBackGround; tBackGround_deck = tBackGround;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment