trying to fix the 2xEmit bug,

write directly mirrored to the image,
This commit is contained in:
Anakin
2017-01-05 14:46:01 +01:00
parent 1d5d20cfb8
commit 44e36b8b0d
6 changed files with 55 additions and 51 deletions

View File

@@ -100,6 +100,8 @@ void GeometryEngine::loadFile(const char* filePath)
for(auto& it : *textureNames)
loadTexture(path.c_str(), it.c_str());
loadTexture("", "");
emit requestUpdate();
emit sendMessage("done..", 0);
}
@@ -114,12 +116,13 @@ void GeometryEngine::loadTexture(const char* filePath, const char* fileName)
bool loadSuccess(false);
QImage img;
//if (!strcmp(fileName, ""))
//{
// img = QImage(1, 1, QImage::Format_RGB32);
// img.fill(Qt::red);
//}
//else
if (!strcmp(fileName, ""))
{
loadSuccess = true;
img = QImage(1, 1, QImage::Format_RGB32);
img.fill(Qt::red);
}
else
img = loadTga((std::string(filePath) + std::string(fileName)).c_str(), loadSuccess);
//TODO: emit if not successfull

View File

@@ -74,7 +74,7 @@ void MainWindow::aboutTool()
dialog->exec();
}
void MainWindow::showMessage(QString message, int severity)
void MainWindow::printMessage(QString message, int severity)
{
if (severity < m_curSeverity)
return;

View File

@@ -197,7 +197,7 @@ void OglViewerWidget::setConnections()
connect(m_dataEngine, &GeometryEngine::requestResetView, this, &OglViewerWidget::resetView);
connect(parentWidget(), SIGNAL(loadFile(const char*)), m_dataEngine, SLOT(loadFile(const char*)));
connect(this, SIGNAL(loadFile(const char*)), m_dataEngine, SLOT(loadFile(const char*)));
connect(m_dataEngine, SIGNAL(sendMessage(QString, int)), parentWidget(), SLOT(showMessage(QString, int)));
connect(m_dataEngine, SIGNAL(sendMessage(QString, int)), parentWidget(), SLOT(printMessage(QString, int)));
connect(m_dataEngine, SIGNAL(requestUpdate()), this, SLOT(update()));
}