c define ignore nonexistent values (#56)
This commit is contained in:
parent
761c25ee4c
commit
92b23e515d
2 changed files with 5 additions and 3 deletions
|
@ -1224,13 +1224,13 @@ QMap<QString, QStringList> Project::getTilesets() {
|
||||||
// Advance to command specifying whether or not it is a secondary tileset
|
// Advance to command specifying whether or not it is a secondary tileset
|
||||||
i += 2;
|
i += 2;
|
||||||
if (commands->at(i).at(0) != ".byte") {
|
if (commands->at(i).at(0) != ".byte") {
|
||||||
qDebug() << "Unexpected command found for secondary tileset flag in tileset" << tilesetLabel << ". Expected '.byte', but found: " << commands->at(i).at(0);
|
qDebug().nospace() << "Unexpected command found for secondary tileset flag in tileset" << tilesetLabel << ". Expected '.byte', but found: " << commands->at(i).at(0);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString secondaryTilesetValue = commands->at(i).at(1);
|
QString secondaryTilesetValue = commands->at(i).at(1);
|
||||||
if (secondaryTilesetValue != "TRUE" && secondaryTilesetValue != "FALSE" && secondaryTilesetValue != "0" && secondaryTilesetValue != "1") {
|
if (secondaryTilesetValue != "TRUE" && secondaryTilesetValue != "FALSE" && secondaryTilesetValue != "0" && secondaryTilesetValue != "1") {
|
||||||
qDebug() << "Unexpected secondary tileset flag found. Expected \"TRUE\", \"FALSE\", \"0\", or \"1\", but found: " << secondaryTilesetValue;
|
qDebug().nospace() << "Unexpected secondary tileset flag found. Expected \"TRUE\", \"FALSE\", \"0\", or \"1\", but found: " << secondaryTilesetValue;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1852,6 +1852,7 @@ QString Project::readCIncbin(QString text, QString label) {
|
||||||
|
|
||||||
QMap<QString, int> Project::readCDefines(QString text, QStringList prefixes) {
|
QMap<QString, int> Project::readCDefines(QString text, QStringList prefixes) {
|
||||||
ParseUtil parser;
|
ParseUtil parser;
|
||||||
|
text.replace(QRegularExpression("//.*"), "");
|
||||||
QMap<QString, int> allDefines;
|
QMap<QString, int> allDefines;
|
||||||
QMap<QString, int> filteredDefines;
|
QMap<QString, int> filteredDefines;
|
||||||
QRegularExpression re("#define\\s+(?<defineName>\\w+)[^\\S\\n]+(?<defineValue>.+)");
|
QRegularExpression re("#define\\s+(?<defineName>\\w+)[^\\S\\n]+(?<defineValue>.+)");
|
||||||
|
@ -1860,7 +1861,7 @@ QMap<QString, int> Project::readCDefines(QString text, QStringList prefixes) {
|
||||||
QRegularExpressionMatch match = iter.next();
|
QRegularExpressionMatch match = iter.next();
|
||||||
QString name = match.captured("defineName");
|
QString name = match.captured("defineName");
|
||||||
QString expression = match.captured("defineValue");
|
QString expression = match.captured("defineValue");
|
||||||
expression.replace(QRegularExpression("//.*"), "");
|
if (expression == " ") continue;
|
||||||
int value = parser.evaluateDefine(expression, &allDefines);
|
int value = parser.evaluateDefine(expression, &allDefines);
|
||||||
allDefines.insert(name, value);
|
allDefines.insert(name, value);
|
||||||
for (QString prefix : prefixes) {
|
for (QString prefix : prefixes) {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
#include "connectionpixmapitem.h"
|
#include "connectionpixmapitem.h"
|
||||||
|
#include <cmath>
|
||||||
|
|
||||||
void ConnectionPixmapItem::render(qreal opacity) {
|
void ConnectionPixmapItem::render(qreal opacity) {
|
||||||
QPixmap newPixmap = this->basePixmap.copy(0, 0, this->basePixmap.width(), this->basePixmap.height());
|
QPixmap newPixmap = this->basePixmap.copy(0, 0, this->basePixmap.width(), this->basePixmap.height());
|
||||||
|
|
Loading…
Reference in a new issue