De-duplicate number of menu text bytes

I've moved this to a define that gets declared in Game.h. I could've
made it a const int, but that's only legal in C++ mode.
This commit is contained in:
Misa
2021-03-06 18:14:44 -08:00
committed by Ethan Lee
parent 40c6a01917
commit 22d71affba
3 changed files with 7 additions and 6 deletions

View File

@@ -14,10 +14,12 @@ namespace tinyxml2
class XMLElement;
}
/* 40 chars (160 bytes) covers the entire screen, + 1 more for null terminator */
#define MENU_TEXT_BYTES 161
struct MenuOption
{
char text[161]; // 40 chars (160 bytes) covers the entire screen, + 1 more for null terminator
// WARNING: should match Game::menutextbytes below
char text[MENU_TEXT_BYTES];
bool active;
};
@@ -252,7 +254,6 @@ public:
int current_credits_list_index;
int menuxoff, menuyoff;
int menuspacing;
static const int menutextbytes = 161; // this is just sizeof(MenuOption::text), but doing that is non-standard
std::vector<MenuStackFrame> menustack;
void inline option(const char* text, bool active = true)