summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorColin Noga <Tempus@chronometry.ca>2012-09-27 22:59:41 -0500
committerColin Noga <Tempus@chronometry.ca>2012-09-27 22:59:41 -0500
commit64f38f642113ac4bd5b1d96e76c9ae97965bc416 (patch)
tree99d9bbf4d577ae2d8a79fcb5f7101df1b57398fe /include
parentf9afbf1109b30bbc6011e81109b7e11961a4361a (diff)
parentb3c37e5a9ef81250d6554fcbb8089154b4940c9f (diff)
downloadkamek-64f38f642113ac4bd5b1d96e76c9ae97965bc416.tar.gz
kamek-64f38f642113ac4bd5b1d96e76c9ae97965bc416.zip
Merge branch 'level-select' of ssh://treeki.rustedlogic.net:30000/Kamek into level-select
Diffstat (limited to '')
-rwxr-xr-xinclude/game.h83
-rw-r--r--include/newer.h26
2 files changed, 80 insertions, 29 deletions
diff --git a/include/game.h b/include/game.h
index e31e675..ef6aba4 100755
--- a/include/game.h
+++ b/include/game.h
@@ -24,8 +24,10 @@ inline T clamp(T value, T one, T two) { return (value < one) ? one : ((value > t
extern "C" {
int wcslen(const wchar_t *str);
+wchar_t *wcscpy(wchar_t *dest, const wchar_t *src);
int strlen(const char *str);
char *strcpy(char *dest, const char *src);
+char *strncpy(char *dest, const char *src, int num);
int strncmp(const char *str1, const char *str2, int num);
float atan(float x);
@@ -138,6 +140,17 @@ inline void *GetGameMgr() {
bool QueryPlayerAvailability(int id);
void DoStartLevel(void *gameMgr, StartLevelInfo *sl);
+
+
+// Level Conditions
+// 1 : Has Toad Block
+// 2 : Is Regular Level (has star coins, etc)
+// 0x10 : Has Normal Exit
+// 0x20 : Has Secret Exit
+// 0x40 : Warp Cannon
+// 0x80 : 1up/Green Mushroom House
+// 0x100 : Red Mushroom House
+// 0x200 : Star/Yellow Mushroom House
void SetSomeConditionShit(int world, int level, unsigned int bits);
bool IsWideScreen();
@@ -152,6 +165,31 @@ bool IsWideScreen();
#define COND_SGNORMAL 0x80
#define COND_SGSECRET 0x100
+
+// All of these are set by "SetWorldCompleteionBitfield" (I didn't name it)
+// at 801028D0. It's called by ScStage so it doesn't depend on Nintendo maps.
+
+#define SAVE_BIT_EXISTS_MAYBE 1
+
+// Controls whether you can QUICK SAVE or not.
+// Set if 8-Castle is complete.
+#define SAVE_BIT_GAME_COMPLETE 2
+
+// Set when all exits are complete.
+// This is defined by "ReturnWhetherConditionMaskIsValid" / "SetSomeConditionShit"
+// TODO: Need to RE and fix this for Newer...
+#define SAVE_BIT_ALL_EXITS 4
+
+// Set when all star coins in worlds 1-8 are obtained.
+// Valid levels are chosen by the condition crap as above.
+#define SAVE_BIT_ALL_STAR_COINS 8
+
+#define SAVE_BIT_ALL_STAR_COINS_W9 0x10
+
+// Set when, well... EVERYTHING is done.
+#define SAVE_BIT_EVERYTHING_TRULY_DONE 0x20
+
+
class SaveFirstBlock {
public:
char titleID[4]; // 0x00
@@ -200,7 +238,13 @@ public:
struct {
// ALL Newer additions should go here
// This array has been verified as safe to replace
- u8 currentNewerWorld; // 0x6FC
+ char newerWorldName[36]; // 0x6FC
+ GXColor fsTextColours[2]; // 0x720
+ GXColor fsHintColours[2]; // 0x728
+ GXColor hudTextColours[2]; // 0x730
+ s16 hudHintH, hudHintS, hudHintL; // 0x738
+ u8 currentMapMusic; // 0x73E
+ u8 _padding; // 0x73F
};
};
u8 toad_location[10]; // 0x742
@@ -553,7 +597,13 @@ namespace ut {
LinkListNode initialNode;
};
- class Color : public GXColor { };
+ class Color : public GXColor {
+ public:
+ GXColor& operator=(const GXColor &other) {
+ *((u32*)this) = *((u32*)&other);
+ return *this;
+ }
+ };
class Rect {
public:
@@ -644,9 +694,35 @@ namespace lyt {
};
+ class TexMap {
+ public:
+ void *image, *palette;
+ u16 width, height;
+ f32 minLOD, magLOD;
+ u16 lodBias, palEntryNum;
+ struct
+ {
+ u32 textureFormat: 4;
+ u32 mipmap: 1;
+ u32 wrapS: 2;
+ u32 wrapT: 2;
+ u32 minFilter: 3;
+ u32 magFilter: 1;
+ u32 biasClampEnable: 1;
+ u32 edgeLODEnable: 1;
+ u32 anisotropy: 2;
+ u32 paletteFormat: 2;
+ } mBits;
+ };
+
class Material {
public:
- // ...
+ virtual ~Material();
+
+ // cheating a bit here
+ u8 _[0x3C];
+ // this is actually a pointer to more stuff, not just texmaps
+ TexMap *texMaps;
};
class Pane {
@@ -3188,6 +3264,7 @@ namespace mHeap {
};
void WriteNumberToTextBox(int *number, const int *fieldLength, nw4r::lyt::TextBox *textBox, bool unk); // 800B3B60
+void WriteNumberToTextBox(int *number, nw4r::lyt::TextBox *textBox, bool unk); // 800B3BE0
namespace EGG {
class MsgRes {
diff --git a/include/newer.h b/include/newer.h
index d98f290..cf21cbb 100644
--- a/include/newer.h
+++ b/include/newer.h
@@ -1,32 +1,6 @@
#ifndef NEWER_H
#define NEWER_H
-enum NWRWorld {
- ISLAND = 0, YOSHI_ISLAND = 0,
- DESERT = 1, RUBBLE_RUINS = 1,
- SEWER = 2, SOGGY_SEWERS = 2,
- MOUNTAIN = 3, MUSHROOM_PEAKS = 3,
- SAKURA = 4, SAKURA_VILLAGE = 4,
- FREEZEFLAME = 5, FREEZEFLAME_GLACIER = 5,
- VOLCANO = 6, FREEZEFLAME_VOLCANO = 6,
- PUMPKIN = 7, PUMPKIN_BONEYARD = 7,
- SKY_MOUNTAIN = 8,
- SKY = 9, STARRY_SKIES = 9,
- PLANET = 10, KOOPA_PLANET = 10,
- CORE = 11, KOOPA_CORE = 11,
- BONUS_LAND = 12,
- GOLDWOOD = 13, GOLDWOOD_FOREST = 13,
- MINIMEGA = 14, MINIMEGA_ISLAND = 14,
- CRYSTAL = 15, CRYSTAL_CAVES = 15,
- BOMBARD = 16, BOMBARD_CLIFFS = 16,
- SKY_CITY = 17,
- WORLD_COUNT = 18,
- UNKNOWN_WORLD = 255
-};
-
-NWRWorld NewerWorldForLevelID(int world, int level);
-
-const wchar_t *NewerWorldName(NWRWorld world);
int getStarCoinCount();
#endif /* NEWER_H */