Replace roomnames/hiddennames/glitchnames with const char*

Since those are all downstream recipients of either static storage or
memory that doesn't move for the duration of the custom level, it's okay
to make these be `const char*`s without having to redo any of the RAII
memory management.

mapclass::currentarea() is included in this as well. I also cleaned up
Tower.cpp's headers to fix some transitive includes because I was
removing UtilityClass.h includes from all other level files too.

The "Untitled room" names no longer show any coordinates, because doing
so would require complicated memory management that's completely
unneeded. No one will ever see them, and if they do they already know
they have a problem anyway. The only time they might be able to see them
is if they corrupted the areamap, but this was only possible in 2.2 and
previous by dying outside the room deaths array in Outside Dimension
VVVVVV, which has since been patched out. Besides, sometimes the
"Untitled room" gets overwritten by something else anyway (especially in
Finalclass.cpp), so it really, really doesn't matter.
This commit is contained in:
Misa
2021-09-12 12:48:15 -07:00
parent a10342f5e6
commit a50e8ecf48
14 changed files with 69 additions and 80 deletions

View File

@@ -15,7 +15,7 @@
struct Roomtext
{
int x, y;
std::string text;
const char* text;
};
class mapclass
@@ -35,7 +35,7 @@ public:
void transformname(int t);
std::string getglitchname(int x, int y);
const char* getglitchname(int x, int y);
void initmapdata(void);
void initcustommapdata(void);
@@ -83,7 +83,7 @@ public:
void spawncompanion(void);
std::string currentarea(int t);
const char* currentarea(int t);
void loadlevel(int rx, int ry);
@@ -107,8 +107,8 @@ public:
bool warpy;
std::string roomname;
std::string hiddenname;
const char* roomname;
const char* hiddenname;
//Special tower stuff
bool towermode;
@@ -135,10 +135,10 @@ public:
int customzoom;
bool customshowmm;
std::string specialnames[8];
const char* specialnames[8];
int glitchmode;
int glitchdelay;
std::string glitchname;
const char* glitchname;
//final level colour cycling stuff
bool final_colormode;