summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2013-05-12 23:41:19 +0200
committerTreeki <treeki@gmail.com>2013-05-12 23:41:19 +0200
commit5c519288c928f4136b973613733e70b829dda480 (patch)
tree86da6d7724947e1f3fbed15d2665598e7636b2c4
parent7f770e59f2aa8a392cc78285a0422120dc1d6ede (diff)
downloadkamek-5c519288c928f4136b973613733e70b829dda480.tar.gz
kamek-5c519288c928f4136b973613733e70b829dda480.zip
show faded out missing exits
Diffstat (limited to '')
-rwxr-xr-xinclude/game.h1
-rw-r--r--src/koopatlas/hud.cpp24
2 files changed, 21 insertions, 4 deletions
diff --git a/include/game.h b/include/game.h
index b032f40..1eb7a17 100755
--- a/include/game.h
+++ b/include/game.h
@@ -178,6 +178,7 @@ bool IsWideScreen();
#define COND_COIN_ALL 7
#define COND_NORMAL 0x10
#define COND_SECRET 0x20
+#define COND_BOTH_EXITS 0x30
#define COND_SGNORMAL 0x80
#define COND_SGSECRET 0x100
#define COND_UNLOCKED 0x200 // NEWER EXCLUSIVE
diff --git a/src/koopatlas/hud.cpp b/src/koopatlas/hud.cpp
index ff9a0e2..3802c33 100644
--- a/src/koopatlas/hud.cpp
+++ b/src/koopatlas/hud.cpp
@@ -277,15 +277,31 @@ void dWMHud_c::loadHeaderInfo() {
int l = nodeForHeader->levelNumber[1] - 1;
u32 conds = GetSaveFile()->GetBlock(-1)->GetLevelCondition(w, l);
+ // States: 0 = invisible, 1 = visible, 2 = faded
+ int normalState = 0, secretState = 0;
+
+ if ((conds & COND_BOTH_EXITS) && (infEntry->flags & 0x30) == 0x30) {
+ // If this level has two exits and one of them is already collected,
+ // then show the faded flags
+ normalState = 2;
+ secretState = 2;
+ }
+
+ if ((conds & COND_NORMAL) && (infEntry->flags & 0x10))
+ normalState = 1;
+ if ((conds & COND_SECRET) && (infEntry->flags & 0x20))
+ secretState = 1;
NormalExitFlag->trans.x = currentPos;
- NormalExitFlag->SetVisible(conds & COND_NORMAL);
- if (conds & COND_NORMAL)
+ NormalExitFlag->alpha = (normalState == 2) ? 80 : 255;
+ NormalExitFlag->SetVisible(normalState > 0);
+ if (normalState > 0)
currentPos += NormalExitFlag->size.x;
SecretExitFlag->trans.x = currentPos;
- SecretExitFlag->SetVisible(conds & COND_SECRET);
- if (conds & COND_SECRET)
+ SecretExitFlag->alpha = (secretState == 2) ? 80 : 255;
+ SecretExitFlag->SetVisible(secretState > 0);
+ if (secretState > 0)
currentPos += SecretExitFlag->size.x;
// are star coins enabled or not?