1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-26 18:35:20 +00:00
OpenMW/apps/openmw/mwrender/globalmap.hpp

72 lines
1.3 KiB
C++
Raw Normal View History

#ifndef GAME_RENDER_GLOBALMAP_H
#define GAME_RENDER_GLOBALMAP_H
2012-09-20 13:56:37 +02:00
#include <string>
2015-05-16 14:48:20 +02:00
#include <vector>
2012-09-20 13:56:37 +02:00
2015-05-16 14:48:20 +02:00
#include <osg/ref_ptr>
namespace osg
{
class Texture2D;
}
2012-11-04 12:13:04 +01:00
namespace Loading
{
class Listener;
}
2014-01-25 18:20:17 +01:00
namespace ESM
{
struct GlobalMap;
2014-01-25 18:20:17 +01:00
}
2012-09-20 13:56:37 +02:00
namespace MWRender
{
2015-05-16 14:48:20 +02:00
class GlobalMap
2012-09-20 13:56:37 +02:00
{
public:
2015-05-16 14:48:20 +02:00
GlobalMap();
~GlobalMap();
2012-09-20 13:56:37 +02:00
void render(Loading::Listener* loadingListener);
2012-09-20 13:56:37 +02:00
int getWidth() const { return mWidth; }
int getHeight() const { return mHeight; }
int getCellSize() const { return mCellSize; }
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);
/// Clears the overlay
void clear();
void write (ESM::GlobalMap& map);
void read (ESM::GlobalMap& map);
2014-01-25 18:20:17 +01:00
2015-05-16 14:48:20 +02:00
osg::ref_ptr<osg::Texture2D> getBaseTexture();
//osg::ref_ptr<osg::Texture2D> getOverlayTexture();
2015-05-16 14:48:20 +02:00
private:
int mCellSize;
2012-11-04 12:13:04 +01:00
std::vector< std::pair<int,int> > mExploredCells;
2015-05-16 14:48:20 +02:00
osg::ref_ptr<osg::Texture2D> mBaseTexture;
2012-11-04 12:13:04 +01:00
int mWidth;
int mHeight;
int mMinX, mMaxX, mMinY, mMaxY;
2012-09-20 13:56:37 +02:00
};
}
#endif