Fix reading map obj gfx constants
This commit is contained in:
parent
26d4f234aa
commit
07fa705b03
1 changed files with 4 additions and 13 deletions
17
project.cpp
17
project.cpp
|
@ -609,20 +609,11 @@ QString Project::getSongName(int songNumber) {
|
||||||
|
|
||||||
QMap<QString, int> Project::getMapObjGfxConstants() {
|
QMap<QString, int> Project::getMapObjGfxConstants() {
|
||||||
QMap<QString, int> constants;
|
QMap<QString, int> constants;
|
||||||
QString text = readTextFile(root + "/constants/map_object_constants.inc");
|
QString text = readTextFile(root + "/include/constants/map_objects.h");
|
||||||
if (!text.isNull()) {
|
if (!text.isNull()) {
|
||||||
QList<QStringList> *commands = parse(text);
|
QStringList mapObjGfxPrefixes;
|
||||||
for (int i = 0; i < commands->length(); i++) {
|
mapObjGfxPrefixes << "MAP_OBJ_GFX_";
|
||||||
QStringList params = commands->value(i);
|
constants = readCDefines(text, mapObjGfxPrefixes);
|
||||||
QString macro = params.value(0);
|
|
||||||
if (macro == ".set") {
|
|
||||||
QString constant = params.value(1);
|
|
||||||
if (constant.startsWith("MAP_OBJ_GFX_")) {
|
|
||||||
int value = params.value(2).toInt(nullptr, 0);
|
|
||||||
constants.insert(constant, value);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return constants;
|
return constants;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue