1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-11-07 03:12:36 +01:00

Fix textures in rwviewer for some models

This commit is contained in:
Daniel Evans 2014-02-11 14:16:14 +00:00
parent 751adf1d6b
commit fe1e94d167

View File

@ -46,10 +46,10 @@ void ViewerWidget::paintGL()
glUseProgram(r.worldProgram);
/*glUniform1f(uniFogStart, weather.fogStart);
glUniform1f(uniFogEnd, camera.frustum.far);*/
glUniform1f(r.uniFogStart, 90.f);
glUniform1f(r.uniFogEnd, 100.f);
glUniform4f(r.uniAmbientCol, 1.f, 1.f, 1.f, 1.f);
glUniform4f(r.uniAmbientCol, .1f, .1f, .1f, 1.f);
glUniform4f(r.uniDynamicCol, 1.f, 1.f, 1.f, 1.f);
//glUniform3f(uniSunDirection, sunDirection.x, sunDirection.y, sunDirection.z);
glUniform1f(r.uniMatDiffuse, 0.9f);
@ -86,7 +86,10 @@ void ViewerWidget::showFile(const QString& file)
void ViewerWidget::showDFF(const QString& file)
{
gworld->gameData.loadDFF(file.toStdString());
auto mit = gworld->gameData.models.find(file.left(file.size()-4).toStdString());
QString basename(file.left(file.size()-4));
// HACK this
gworld->gameData.loadTXD((basename+".txd").toStdString());
auto mit = gworld->gameData.models.find(basename.toStdString());
if(mit != gworld->gameData.models.end()) {
// TODO better error handling
currentModel = mit->second;