Mantis: 1066

o Minimap now reloads upon map change

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@204 67975925-1194-0748-b3d5-c16f83f1a3a1
This commit is contained in:
puzl 2005-06-21 12:26:08 +00:00
parent 478306c2bc
commit ad8010a47b
3 changed files with 10 additions and 5 deletions

View file

@ -2422,6 +2422,9 @@ void AvHHud::ResetGame(bool inMapChanged)
this->mInfoLocationList.clear();
}
// puzl: 1066 reset overview map on game restart
gHUD.GetOverviewMap().Clear();
AvHParticleSystemManager::Instance()->Reset();
this->mTechSlotManager.Clear();

View file

@ -79,6 +79,8 @@ void AvHOverviewMap::Init()
this->mMiniMapSprite = 0;
this->mReticleSprite = 0;
// puzl: 1066 reset overview map
this->mLastMinimapName = "";
mLastUpdateTime = 0;
}
@ -419,17 +421,16 @@ void AvHOverviewMap::DrawMiniMap(const DrawInfo& inDrawInfo)
// Use labelled minimaps if cl_labelmaps is 1
// Load the mini-map sprite if it's not already loaded.
static string lastMiniMapName="";
if ( mMapName != "") {
int drawLabels=CVAR_GET_FLOAT(kvLabelMaps);
string theMiniMapName = AvHMiniMap::GetSpriteNameFromMap(ScreenWidth(), mMapName, drawLabels);
if ( lastMiniMapName != theMiniMapName )
if ( mLastMinimapName != theMiniMapName )
{
mMiniMapSprite = Safe_SPR_Load(theMiniMapName.c_str());
// We want to preserve the last minimap even if we fail. There's no point in failing again until the player
// changes the value of the cvar.
lastMiniMapName=theMiniMapName;
mLastMinimapName=theMiniMapName;
// Draw normal minimap if no labelled map exists ( for custom maps )
if ( !mMiniMapSprite && drawLabels ) {

View file

@ -40,7 +40,7 @@ public:
float mViewWorldMaxY;
bool mFullScreen;
};
AvHOverviewMap();
@ -75,7 +75,8 @@ protected:
AvHUser3 mUser3;
AvHTeamNumber mTeam;
// puzl: 1066 the name of the last minimap we loaded
string mLastMinimapName;
private:
void WorldToMiniMapCoords(const DrawInfo& inDrawInfo, float& x, float& y);