From 07fa705b033944ea478aaa469b5aed056bc0eef9 Mon Sep 17 00:00:00 2001 From: Marcus Huderle Date: Sun, 11 Feb 2018 19:20:29 -0800 Subject: [PATCH] Fix reading map obj gfx constants --- project.cpp | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/project.cpp b/project.cpp index e38a1e72..d12e73b7 100755 --- a/project.cpp +++ b/project.cpp @@ -609,20 +609,11 @@ QString Project::getSongName(int songNumber) { QMap Project::getMapObjGfxConstants() { QMap constants; - QString text = readTextFile(root + "/constants/map_object_constants.inc"); + QString text = readTextFile(root + "/include/constants/map_objects.h"); if (!text.isNull()) { - QList *commands = parse(text); - for (int i = 0; i < commands->length(); i++) { - QStringList params = commands->value(i); - 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); - } - } - } + QStringList mapObjGfxPrefixes; + mapObjGfxPrefixes << "MAP_OBJ_GFX_"; + constants = readCDefines(text, mapObjGfxPrefixes); } return constants; }