diff options
author | Treeki <treeki@gmail.com> | 2012-10-01 05:16:17 +0200 |
---|---|---|
committer | Treeki <treeki@gmail.com> | 2012-10-01 05:16:17 +0200 |
commit | 5c846f6c4e8600b84d7c2971e4d467cda2d7d521 (patch) | |
tree | 343403dc82b2a17a3bb3923aec3c20de72d02d5d | |
parent | 6956c9fa2f56c2fa5af8ace0dbe298ab2a6c201b (diff) | |
download | kamek-5c846f6c4e8600b84d7c2971e4d467cda2d7d521.tar.gz kamek-5c846f6c4e8600b84d7c2971e4d467cda2d7d521.zip |
fixed positioning of HUD stars
Diffstat (limited to '')
-rw-r--r-- | src/koopatlas/hud.cpp | 27 |
1 files changed, 19 insertions, 8 deletions
diff --git a/src/koopatlas/hud.cpp b/src/koopatlas/hud.cpp index 7a1b9a6..bcfab17 100644 --- a/src/koopatlas/hud.cpp +++ b/src/koopatlas/hud.cpp @@ -497,15 +497,18 @@ void dWMHud_c::loadFooterInfo() { 24, 24, 24, 3, 5 }; + bool starVisibility[3]; + starVisibility[0] = false; + dLevelInfo_c *linfo = &dScKoopatlas_c::instance->levelInfo; dLevelInfo_c::entry_s *lastLevel = linfo->searchByDisplayNum(save->newerWorldID, lastLevelIDs[save->newerWorldID]); - bool lastComplete = false; if (lastLevel) { - lastComplete = (save->GetLevelCondition(lastLevel->worldSlot,lastLevel->levelSlot) & COND_NORMAL); + starVisibility[0] = (save->GetLevelCondition(lastLevel->worldSlot,lastLevel->levelSlot) & COND_NORMAL); } // now calculate the other two - bool haveExits = true, haveCoins = true; + starVisibility[1] = true; + starVisibility[2] = true; dLevelInfo_c::section_s *sect = linfo->getSectionByIndex(save->newerWorldID); @@ -515,17 +518,25 @@ void dWMHud_c::loadFooterInfo() { if (((entry->flags & 0x10) && !(conds & COND_NORMAL)) || ((entry->flags & 0x20) && !(conds & COND_SECRET))) - haveExits = false; + starVisibility[1] = false; if (entry->flags & 2) { if ((conds & COND_COIN_ALL) != COND_COIN_ALL) - haveCoins = false; + starVisibility[2] = false; + } + } + + float startX = Star[0]->trans.x; + for (int i = 0; i < 3; i++) { + Star[i]->SetVisible(starVisibility[i]); + Star[i]->trans.x = startX; + if (starVisibility[i]) { + startX += Star[i]->size.x + 4.0f; } } - Star[0]->SetVisible(lastComplete); - Star[1]->SetVisible(haveExits); - Star[2]->SetVisible(haveCoins); + WorldName->trans.x = startX + 4.0f; + WorldNameS->trans.x = startX + 6.0f; } |