2014-01-05 17:22:29 +00:00
|
|
|
#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>
|
|
|
|
|
2013-08-27 13:48:13 +00:00
|
|
|
namespace Loading
|
|
|
|
{
|
|
|
|
class Listener;
|
|
|
|
}
|
|
|
|
|
2014-01-25 17:20:17 +00:00
|
|
|
namespace ESM
|
|
|
|
{
|
2014-04-26 11:42:32 +00:00
|
|
|
class GlobalMap;
|
2014-01-25 17:20:17 +00:00
|
|
|
}
|
|
|
|
|
2012-09-20 11:56:37 +00:00
|
|
|
namespace MWRender
|
|
|
|
{
|
|
|
|
|
2014-08-14 17:01:03 +00:00
|
|
|
class GlobalMap : public Ogre::ManualResourceLoader
|
2012-09-20 11:56:37 +00:00
|
|
|
{
|
|
|
|
public:
|
|
|
|
GlobalMap(const std::string& cacheDir);
|
2014-08-14 17:01:03 +00:00
|
|
|
~GlobalMap();
|
2012-09-20 11:56:37 +00:00
|
|
|
|
2013-08-27 13:48:13 +00:00
|
|
|
void render(Loading::Listener* loadingListener);
|
2012-09-20 11:56:37 +00:00
|
|
|
|
2012-09-21 14:26:04 +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);
|
|
|
|
|
2014-08-14 17:01:03 +00:00
|
|
|
virtual void loadResource(Ogre::Resource* resource);
|
|
|
|
|
2014-01-25 12:34:56 +00:00
|
|
|
/// Clears the overlay
|
|
|
|
void clear();
|
|
|
|
|
2014-04-26 11:42:32 +00:00
|
|
|
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-09-21 14:26:04 +00:00
|
|
|
|
2012-11-04 11:13:04 +00:00
|
|
|
std::vector< std::pair<int,int> > mExploredCells;
|
|
|
|
|
|
|
|
Ogre::TexturePtr mOverlayTexture;
|
2014-08-14 17:01:03 +00:00
|
|
|
Ogre::Image mOverlayImage; // Backup in system memory
|
2012-11-04 11:13:04 +00:00
|
|
|
|
2012-09-21 14:26:04 +00:00
|
|
|
int mWidth;
|
|
|
|
int mHeight;
|
|
|
|
|
|
|
|
int mMinX, mMaxX, mMinY, mMaxY;
|
2012-09-20 11:56:37 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|