improved performance using my own tga load function always instead of QImage
improved Profiler
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
#include "..\Header\OutputDevice.h"
|
||||
#include <QColor>
|
||||
|
||||
#include "..\Header\Profiler.h"
|
||||
|
||||
// helper function to save data from file to any variable type
|
||||
#define F2V(variableName) reinterpret_cast<char*>(&variableName)
|
||||
|
||||
@@ -278,7 +280,6 @@ void MshFile::analyseMatdChunks(std::list<ChunkHeader*>& chunkList)
|
||||
curMat->flags[i] = (std::uint8_t)(flag << (7 - i)) >> 7;
|
||||
|
||||
curMat->transparent = curMat->flags[2] || curMat->flags[3] || curMat->flags[4] || curMat->flags[6] || curMat->rendertype == 4;
|
||||
|
||||
}
|
||||
|
||||
// texture 0
|
||||
@@ -310,7 +311,6 @@ void MshFile::analyseMatdChunks(std::list<ChunkHeader*>& chunkList)
|
||||
|
||||
if (!m_materials->back().tx1d.isEmpty())
|
||||
loadTexture(m_materials->back().texture1, m_filepath, m_materials->back().tx1d);
|
||||
|
||||
}
|
||||
|
||||
// texture 2
|
||||
@@ -719,6 +719,7 @@ void MshFile::readUV(Segment * dataDestination, std::streampos position)
|
||||
void MshFile::loadTexture(QOpenGLTexture *& destination, QString filepath, QString& filename)
|
||||
{
|
||||
bool loadSuccess(false);
|
||||
|
||||
QImage img = loadTga(filepath + "/" + filename, loadSuccess);
|
||||
|
||||
if (!loadSuccess)
|
||||
|
@@ -428,8 +428,12 @@ void OglViewerWidget::setAmbCoef(double value)
|
||||
void OglViewerWidget::setHeadlight(bool value)
|
||||
{
|
||||
m_light.headlight = value;
|
||||
if (m_lightOn)
|
||||
|
||||
if (m_lightOn && value)
|
||||
{
|
||||
updateLightPosition();
|
||||
update();
|
||||
}
|
||||
}
|
||||
|
||||
void OglViewerWidget::setBackfaceCulling(bool value)
|
||||
|
Reference in New Issue
Block a user