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