1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-07 03:54:40 +00:00
OpenMW/apps/openmw/mwrender/globalmap.hpp

64 lines
1.2 KiB
C++
Raw Normal View History

#ifndef GAME_RENDER_GLOBALMAP_H
#define GAME_RENDER_GLOBALMAP_H
2012-09-20 11:56:37 +00:00
#include <string>
2012-11-04 11:13:04 +00:00
#include <OgreTexture.h>
namespace Loading
{
class Listener;
}
2014-01-25 17:20:17 +00:00
namespace ESM
{
class GlobalMap;
2014-01-25 17:20:17 +00:00
}
2012-09-20 11:56:37 +00:00
namespace MWRender
{
class GlobalMap : public Ogre::ManualResourceLoader
2012-09-20 11:56:37 +00:00
{
public:
GlobalMap(const std::string& cacheDir);
~GlobalMap();
2012-09-20 11:56:37 +00:00
void render(Loading::Listener* loadingListener);
2012-09-20 11:56:37 +00:00
int getWidth() { return mWidth; }
int getHeight() { return mHeight; }
void worldPosToImageSpace(float x, float z, float& imageX, float& imageY);
void cellTopLeftCornerToImageSpace(int x, int y, float& imageX, float& imageY);
2012-11-04 11:13:04 +00:00
void exploreCell (int cellX, int cellY);
virtual void loadResource(Ogre::Resource* resource);
/// Clears the overlay
void clear();
void write (ESM::GlobalMap& map);
void read (ESM::GlobalMap& map);
2014-01-25 17:20:17 +00:00
2012-09-20 11:56:37 +00:00
private:
std::string mCacheDir;
2012-11-04 11:13:04 +00:00
std::vector< std::pair<int,int> > mExploredCells;
Ogre::TexturePtr mOverlayTexture;
Ogre::Image mOverlayImage; // Backup in system memory
2012-11-04 11:13:04 +00:00
int mWidth;
int mHeight;
int mMinX, mMaxX, mMinY, mMaxY;
2012-09-20 11:56:37 +00:00
};
}
#endif