From: khonkhortisan Date: Sat, 30 Mar 2013 21:49:46 +0000 (-0700) Subject: Don't load menu textures every frame X-Git-Url: http://81.2.79.47:8989/gitweb/?a=commitdiff_plain;h=96387ee88a89d172fa23ef325a15da510afac3e5;p=zefram%2Fminetest%2Fminetest_engine.git Don't load menu textures every frame --- diff --git a/src/main.cpp b/src/main.cpp index 2e57a8c2..439b59d3 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -618,7 +618,7 @@ void drawMenuBackground(video::IVideoDriver* driver) { std::string path = getTexturePath("menubg.png"); if (path[0]) { - video::ITexture *bgtexture = + static const video::ITexture *bgtexture = driver->getTexture(path.c_str()); if (bgtexture) { @@ -646,7 +646,7 @@ void drawMenuFooter(video::IVideoDriver* driver, bool clouds) { std::string path = getTexturePath(clouds ? "menufooter_clouds.png" : "menufooter.png"); if (path[0]) { - video::ITexture *footertexture = + static const video::ITexture *footertexture = driver->getTexture(path.c_str()); if (footertexture) { @@ -678,7 +678,7 @@ void drawMenuHeader(video::IVideoDriver* driver) { std::string path = getTexturePath("menuheader.png"); if (path[0]) { - video::ITexture *splashtexture = + static const video::ITexture *splashtexture = driver->getTexture(path.c_str()); if(splashtexture) { @@ -713,7 +713,7 @@ void drawMenuHeader(video::IVideoDriver* driver) { void drawMenuSplash(video::IVideoDriver* driver) { core::dimension2d screensize = driver->getScreenSize(); if (getTexturePath("menusplash.png") != "") { - video::ITexture *splashtexture = + static const video::ITexture *splashtexture = driver->getTexture(getTexturePath("menusplash.png").c_str()); if(splashtexture) {