瀏覽代碼

Fix reading map obj gfx constants

Marcus Huderle 6 年之前
父節點
當前提交
07fa705b03
共有 1 個文件被更改,包括 4 次插入13 次删除
  1. 4
    13
      project.cpp

+ 4
- 13
project.cpp 查看文件

@@ -609,20 +609,11 @@ QString Project::getSongName(int songNumber) {
609 609
 
610 610
 QMap<QString, int> Project::getMapObjGfxConstants() {
611 611
     QMap<QString, int> constants;
612
-    QString text = readTextFile(root + "/constants/map_object_constants.inc");
612
+    QString text = readTextFile(root + "/include/constants/map_objects.h");
613 613
     if (!text.isNull()) {
614
-        QList<QStringList> *commands = parse(text);
615
-        for (int i = 0; i < commands->length(); i++) {
616
-            QStringList params = commands->value(i);
617
-            QString macro = params.value(0);
618
-            if (macro == ".set") {
619
-                QString constant = params.value(1);
620
-                if (constant.startsWith("MAP_OBJ_GFX_")) {
621
-                    int value = params.value(2).toInt(nullptr, 0);
622
-                    constants.insert(constant, value);
623
-                }
624
-            }
625
-        }
614
+        QStringList mapObjGfxPrefixes;
615
+        mapObjGfxPrefixes << "MAP_OBJ_GFX_";
616
+        constants = readCDefines(text, mapObjGfxPrefixes);
626 617
     }
627 618
     return constants;
628 619
 }