2018-04-22 15:55:55 +00:00
|
|
|
#ifndef AVHOVERVIEWMAP_H
|
|
|
|
#define AVHOVERVIEWMAP_H
|
|
|
|
|
|
|
|
#include "AvHEntityHierarchy.h"
|
|
|
|
#include "AvHMapExtents.h"
|
|
|
|
#include "AvHOrder.h"
|
|
|
|
|
|
|
|
class DrawableEntity
|
|
|
|
{
|
|
|
|
public:
|
2024-04-29 22:42:44 +00:00
|
|
|
DrawableEntity() : mUser3(AVH_USER3_NONE), mIsAlive(true), mX(0), mY(0), mAngleRadians(0), mIsLocalPlayer(false), mEntityNumber(0), mTeam(TEAM_IND), mSquadNumber(0), mIsUnderAttack(0), mIsUnbuilt(false), mIsRecycling(false)
|
2018-04-22 15:55:55 +00:00
|
|
|
{}
|
|
|
|
|
|
|
|
AvHUser3 mUser3;
|
|
|
|
bool mIsAlive;
|
|
|
|
bool mIsUnderAttack;
|
|
|
|
int mX;
|
|
|
|
int mY;
|
|
|
|
AvHTeamNumber mTeam;
|
|
|
|
float mAngleRadians;
|
|
|
|
bool mIsLocalPlayer;
|
|
|
|
int mEntityNumber;
|
|
|
|
int mSquadNumber;
|
2024-04-29 22:42:44 +00:00
|
|
|
bool mIsUnbuilt;
|
|
|
|
bool mIsRecycling;
|
2018-04-22 15:55:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class AvHOverviewMap
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
|
|
|
|
struct DrawInfo
|
|
|
|
{
|
|
|
|
|
|
|
|
int mX;
|
|
|
|
int mY;
|
|
|
|
int mWidth;
|
|
|
|
int mHeight;
|
|
|
|
|
|
|
|
float mViewWorldMinX;
|
|
|
|
float mViewWorldMinY;
|
|
|
|
float mViewWorldMaxX;
|
|
|
|
float mViewWorldMaxY;
|
|
|
|
|
|
|
|
float mZoomScale;
|
|
|
|
bool mFullScreen;
|
|
|
|
bool mCommander;
|
|
|
|
};
|
|
|
|
AvHOverviewMap();
|
|
|
|
|
|
|
|
void Clear();
|
|
|
|
|
|
|
|
bool GetHasData() const;
|
|
|
|
void GetWorldPosFromMouse(const DrawInfo& inDrawInfo, int inMouseX, int inMouseY, float& outWorldX, float& outWorldY);
|
|
|
|
|
|
|
|
void SetMapExtents(const string& inMapName, const AvHMapExtents& inMapExtents);
|
|
|
|
void GetMapExtents(AvHMapExtents& outMapExtents);
|
|
|
|
|
|
|
|
void SetUser3(AvHUser3 inUser3);
|
|
|
|
void SetWorldPosition(float inWorldX, float inWorldY);
|
|
|
|
void GetWorldPosition(float& outWorldX, float& outWorldY);
|
|
|
|
|
|
|
|
void Update(float inCurrentTime);
|
|
|
|
void UpdateOrders(const OrderListType& inOrderList, const EntityListType& inDrawPlayers);
|
|
|
|
void VidInit(void);
|
|
|
|
|
|
|
|
void AddAlert(float x, float y);
|
|
|
|
|
|
|
|
void Draw(const DrawInfo& inDrawInfo);
|
|
|
|
|
|
|
|
int GetEntityAtWorldPosition(float inWorldX, float inWorldY, float inRadius) const;
|
2023-08-23 02:19:29 +00:00
|
|
|
AvHFont tFont;
|
2018-04-22 15:55:55 +00:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void KillOldAlerts(float inCurrentTime);
|
|
|
|
|
|
|
|
void DrawMiniMap(const DrawInfo& inDrawInfo);
|
|
|
|
void DrawMiniMapEntity(const DrawInfo& inDrawInfo, const DrawableEntity& inEntity);
|
|
|
|
void DrawAlerts(const DrawInfo& inDrawInfo);
|
|
|
|
|
|
|
|
AvHUser3 mUser3;
|
|
|
|
AvHTeamNumber mTeam;
|
|
|
|
// : 1066 the name of the last minimap we loaded
|
|
|
|
int mLastMinimap;
|
|
|
|
private:
|
|
|
|
|
|
|
|
void WorldToMiniMapCoords(const DrawInfo& inDrawInfo, float& x, float& y);
|
|
|
|
|
|
|
|
void Init();
|
2018-06-02 19:10:29 +00:00
|
|
|
void GetSpriteForEntity(const DrawableEntity& entity, AVHHSPRITE& outSprite, int& outFrame, int& outRenderMode, bool commanderOverview);
|
2024-04-29 22:42:44 +00:00
|
|
|
void GetColorForEntity(const DrawableEntity& entity, float& outR, float& outG, float& outB, float& outA);
|
2018-04-22 15:55:55 +00:00
|
|
|
|
|
|
|
void UpdateDrawData(float inCurrentTime);
|
|
|
|
|
|
|
|
float mWorldPlayerX;
|
|
|
|
float mWorldPlayerY;
|
|
|
|
|
|
|
|
float mBlinkTime;
|
|
|
|
bool mBlinkOn;
|
|
|
|
|
|
|
|
AvHMapExtents mMapExtents;
|
|
|
|
|
|
|
|
string mMapName;
|
|
|
|
int mMiniMapSprite;
|
|
|
|
|
2018-06-02 19:10:29 +00:00
|
|
|
AVHHSPRITE mReticleSprite;
|
2018-04-22 15:55:55 +00:00
|
|
|
|
|
|
|
typedef vector<DrawableEntity> DrawableEntityListType;
|
|
|
|
DrawableEntityListType mDrawableEntityList;
|
|
|
|
|
|
|
|
struct MapAlert
|
|
|
|
{
|
|
|
|
|
|
|
|
float mStartTime;
|
|
|
|
float mExpireTime;
|
|
|
|
|
|
|
|
float mX; // World space.
|
|
|
|
float mY;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::vector<MapAlert> MapAlertListType;
|
|
|
|
MapAlertListType mAlertList;
|
|
|
|
|
|
|
|
struct MapOrder
|
|
|
|
{
|
|
|
|
float mX; // World space.
|
|
|
|
float mY;
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef std::vector<MapOrder> MapOrderListType;
|
|
|
|
MapOrderListType mMapOrderList;
|
|
|
|
|
|
|
|
float mLastUpdateTime;
|
|
|
|
|
2023-09-15 00:56:02 +00:00
|
|
|
bool mMapNamesFontLoaded;
|
|
|
|
|
2018-04-22 15:55:55 +00:00
|
|
|
};
|
|
|
|
|
2005-03-09 01:31:56 +00:00
|
|
|
#endif
|