Skip to content

Commit

Permalink
Fix compile VS
Browse files Browse the repository at this point in the history
  • Loading branch information
NicolasPerdu committed Oct 30, 2023
1 parent 5903c44 commit 8bc6f6c
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ void MainWindow::loadJsonProject() {

if (!jsonFile.open(QIODevice::ReadOnly | QIODevice::Text)) {
qWarning() << "Failed to open the JSON file.";
return 1;
return;
}

QByteArray jsonData = jsonFile.readAll();
Expand All @@ -493,7 +493,7 @@ void MainWindow::loadJsonProject() {

if (parseError.error != QJsonParseError::NoError) {
qWarning() << "Failed to parse JSON:" << parseError.errorString();
return 1;
return;
}

if (jsonDoc.isObject()) {
Expand Down Expand Up @@ -547,7 +547,7 @@ void MainWindow::loadJsonProject() {

} else {
qWarning() << "JSON document is not an object.";
return 1;
return;
}
}

Expand Down Expand Up @@ -622,7 +622,7 @@ void MainWindow::saveIndividualImages() {
if (scene->getSprites().size() == 0) {
std::cerr << "Error: there are no sprites." << std::endl;
QMessageBox::warning(nullptr, tr("Error"), tr("Error: there are no sprites."));
return -1;
return;
}

QString dir = QFileDialog::getExistingDirectory(this, "Save directory", "/");
Expand All @@ -639,15 +639,15 @@ void MainWindow::splitSpriteSheet(int area) {
if (filename.size() == 0) {
std::cerr << "Error: The filename is empty." << std::endl;
QMessageBox::warning(nullptr, tr("Error"), tr("Error: The filename is empty."));
return -1;
return;
}

spritesheet = cv::imread(filename.toStdString());

if (spritesheet.empty()) {
std::cerr << "Error: Could not load spritesheet image." << std::endl;
QMessageBox::warning(nullptr, tr("Error"), tr("Error: Could not load spritesheet image."));
return -1;
return;
}

scene->setSpritesheet(spritesheet);
Expand Down Expand Up @@ -702,7 +702,7 @@ void MainWindow::exportJson() {
if (scene->getRect().empty()) {
std::cerr << "Error: Could not find the bounding boxes." << std::endl;
QMessageBox::warning(nullptr, tr("Error"), tr("Error: Could not find the bounding boxes."));
return -1;
return;
}

QString dir = QFileDialog::getExistingDirectory(this, "Save directory", "/");
Expand Down

0 comments on commit 8bc6f6c

Please sign in to comment.