forked from teamnwah/openmw-tes3coop
remove useless member, fix map rendering crash
This commit is contained in:
parent
98c1dc1151
commit
a161b34c67
3 changed files with 14 additions and 12 deletions
|
@ -286,11 +286,11 @@ void MapWindow::addVisitedLocation(const std::string& name, int x, int y)
|
|||
{
|
||||
const int cellSize = 24;
|
||||
|
||||
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton ().getByName("GlobalMap.png");
|
||||
int size = 24 * 61;
|
||||
|
||||
MyGUI::IntCoord widgetCoord(
|
||||
(x+30)*cellSize+6,
|
||||
(tex->getHeight()-1) - (y+30)*cellSize+6,
|
||||
(size-1) - (y+30)*cellSize+6,
|
||||
12, 12);
|
||||
|
||||
|
||||
|
@ -351,9 +351,10 @@ void MapWindow::open()
|
|||
{
|
||||
mGlobalMapImage->setImageTexture("GlobalMap.png");
|
||||
|
||||
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton ().getByName("GlobalMap.png");
|
||||
mGlobalMap->setCanvasSize (tex->getWidth(), tex->getHeight());
|
||||
mGlobalMapImage->setSize(tex->getWidth(), tex->getHeight());
|
||||
int size = 24 * 61;
|
||||
|
||||
mGlobalMap->setCanvasSize (size, size);
|
||||
mGlobalMapImage->setSize(size, size);
|
||||
|
||||
for (unsigned int i=0; i<mGlobalMapImage->getChildCount (); ++i)
|
||||
{
|
||||
|
@ -372,7 +373,7 @@ void MapWindow::open()
|
|||
/// \todo save this last position in the savegame?
|
||||
if (MWBase::Environment::get().getWorld ()->isCellExterior ())
|
||||
{
|
||||
mPlayerArrowGlobal->setPosition(MyGUI::IntPoint(tex->getWidth() * worldX - 16, tex->getHeight() * worldY - 16));
|
||||
mPlayerArrowGlobal->setPosition(MyGUI::IntPoint(size * worldX - 16, size * worldY - 16));
|
||||
|
||||
MyGUI::ISubWidget* main = mPlayerArrowGlobal->getSubWidgetMain();
|
||||
MyGUI::RotatingSkin* rotatingSubskin = main->castType<MyGUI::RotatingSkin>();
|
||||
|
|
|
@ -82,9 +82,6 @@ namespace MWGui
|
|||
MyGUI::Button* mEventBoxGlobal;
|
||||
MyGUI::Button* mEventBoxLocal;
|
||||
|
||||
int mGlobalMapSizeX;
|
||||
int mGlobalMapSizeY;
|
||||
|
||||
protected:
|
||||
virtual void onPinToggled();
|
||||
};
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
#include "globalmap.hpp"
|
||||
|
||||
#include <boost/filesystem.hpp>
|
||||
|
||||
#include <OgreImage.h>
|
||||
#include <OgreTextureManager.h>
|
||||
#include <OgreColourValue.h>
|
||||
|
@ -23,10 +25,9 @@ namespace MWRender
|
|||
|
||||
void GlobalMap::render ()
|
||||
{
|
||||
Ogre::TexturePtr tex;
|
||||
|
||||
Ogre::TexturePtr tex = Ogre::TextureManager::getSingleton ().getByName ("GlobalMap.png");
|
||||
|
||||
if (tex.isNull ())
|
||||
if (!boost::filesystem::exists(mCacheDir + "/GlobalMap.png"))
|
||||
{
|
||||
|
||||
int cellSize = 24;
|
||||
|
@ -138,6 +139,9 @@ namespace MWRender
|
|||
Ogre::TEX_TYPE_2D, width, height, 0, Ogre::PF_B8G8R8, Ogre::TU_DEFAULT);
|
||||
tex->loadImage(image);
|
||||
}
|
||||
else
|
||||
tex = Ogre::TextureManager::getSingleton ().getByName ("GlobalMap.png");
|
||||
|
||||
tex->load();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue