Rename edlevelclass to RoomProperty

That's what edlevelclass is... so that's what it should be named. (Also
removes that "ed", too, making this less coupled to the in-game editor.)

Unfortunately, for compatibility reasons, the name of the XML element
will still remain the same.
This commit is contained in:
Misa
2021-02-20 15:45:48 -08:00
committed by Misa Elizabeth Kai
parent 86b47878f9
commit d549a535e0
7 changed files with 40 additions and 39 deletions

View File

@@ -35,7 +35,7 @@
#include <inttypes.h>
#endif
edlevelclass::edlevelclass(void)
RoomProperty::RoomProperty(void)
{
tileset=0;
tilecol=0;
@@ -464,7 +464,7 @@ int customlevelclass::getenemycol(int t)
int customlevelclass::getwarpbackground(int rx, int ry)
{
const edlevelclass* const room = getroomprop(rx, ry);
const RoomProperty* const room = getroomprop(rx, ry);
switch(room->tileset)
{
case 0: //Space Station
@@ -786,7 +786,7 @@ int customlevelclass::getroompropidx(const int rx, const int ry)
return rx + ry*maxwidth;
}
const edlevelclass* customlevelclass::getroomprop(const int rx, const int ry)
const RoomProperty* customlevelclass::getroomprop(const int rx, const int ry)
{
const int idx = getroompropidx(rx, ry);
@@ -795,7 +795,7 @@ const edlevelclass* customlevelclass::getroomprop(const int rx, const int ry)
return &level[idx];
}
static edlevelclass blank;
static RoomProperty blank;
blank.tileset = 1;
blank.directmode = 1;
blank.roomname.clear();
@@ -1400,24 +1400,24 @@ bool customlevelclass::save(std::string& _path)
for(size_t i = 0; i < SDL_arraysize(level); i++)
{
tinyxml2::XMLElement *edlevelclassElement = doc.NewElement( "edLevelClass" );
edlevelclassElement->SetAttribute( "tileset", level[i].tileset);
edlevelclassElement->SetAttribute( "tilecol", level[i].tilecol);
edlevelclassElement->SetAttribute( "platx1", level[i].platx1);
edlevelclassElement->SetAttribute( "platy1", level[i].platy1);
edlevelclassElement->SetAttribute( "platx2", level[i].platx2);
edlevelclassElement->SetAttribute( "platy2", level[i].platy2);
edlevelclassElement->SetAttribute( "platv", temp_platv[i]);
edlevelclassElement->SetAttribute( "enemyx1", level[i].enemyx1);
edlevelclassElement->SetAttribute( "enemyy1", level[i].enemyy1);
edlevelclassElement->SetAttribute( "enemyx2", level[i].enemyx2);
edlevelclassElement->SetAttribute( "enemyy2", level[i].enemyy2);
edlevelclassElement->SetAttribute( "enemytype", level[i].enemytype);
edlevelclassElement->SetAttribute( "directmode", level[i].directmode);
edlevelclassElement->SetAttribute( "warpdir", level[i].warpdir);
tinyxml2::XMLElement *roompropertyElement = doc.NewElement( "edLevelClass" );
roompropertyElement->SetAttribute( "tileset", level[i].tileset);
roompropertyElement->SetAttribute( "tilecol", level[i].tilecol);
roompropertyElement->SetAttribute( "platx1", level[i].platx1);
roompropertyElement->SetAttribute( "platy1", level[i].platy1);
roompropertyElement->SetAttribute( "platx2", level[i].platx2);
roompropertyElement->SetAttribute( "platy2", level[i].platy2);
roompropertyElement->SetAttribute( "platv", temp_platv[i]);
roompropertyElement->SetAttribute( "enemyx1", level[i].enemyx1);
roompropertyElement->SetAttribute( "enemyy1", level[i].enemyy1);
roompropertyElement->SetAttribute( "enemyx2", level[i].enemyx2);
roompropertyElement->SetAttribute( "enemyy2", level[i].enemyy2);
roompropertyElement->SetAttribute( "enemytype", level[i].enemytype);
roompropertyElement->SetAttribute( "directmode", level[i].directmode);
roompropertyElement->SetAttribute( "warpdir", level[i].warpdir);
edlevelclassElement->LinkEndChild( doc.NewText( level[i].roomname.c_str() )) ;
msg->LinkEndChild( edlevelclassElement );
roompropertyElement->LinkEndChild( doc.NewText( level[i].roomname.c_str() )) ;
msg->LinkEndChild( roompropertyElement );
}
std::string scriptString;
@@ -1569,7 +1569,7 @@ void customlevelclass::generatecustomminimap(void)
// Much kudos to Dav999 for saving me a lot of work, because I stole these colors from const.lua in Ved! -Info Teddy
Uint32 customlevelclass::getonewaycol(const int rx, const int ry)
{
const edlevelclass* const room = getroomprop(rx, ry);
const RoomProperty* const room = getroomprop(rx, ry);
switch (room->tileset) {
case 0: // Space Station