1
0
mirror of https://github.com/rwengine/openrw.git synced 2024-09-18 16:32:32 +02:00

Change default object timeOff from 0 to 24

Remove now-useless check in ObjectRenderer
This commit is contained in:
Mischa Aster Alff 2016-08-28 14:32:34 +02:00
parent 397e8ecba8
commit a56b25d4cd
2 changed files with 9 additions and 11 deletions

View File

@ -81,7 +81,8 @@ bool LoaderIDE::load(const std::string &filename)
objs->timeOff = atoi(buff.c_str());
}
else {
objs->timeOff = objs->timeOn = 0;
objs->timeOn = 0;
objs->timeOff = 24;
}
// Put stuff in our struct

View File

@ -198,17 +198,14 @@ void ObjectRenderer::renderInstance(InstanceObject *instance,
// Handles times provided by TOBJ data
if (instance->object->timeOn != 0 || instance->object->timeOff != 0)
const auto currentHour = m_world->getHour();
if (instance->object->timeOff < instance->object->timeOn)
{
const auto currentHour = m_world->getHour();
if (instance->object->timeOff < instance->object->timeOn)
{
if ( currentHour >= instance->object->timeOff && currentHour < instance->object->timeOn )
return;
} else {
if ( currentHour >= instance->object->timeOff || currentHour < instance->object->timeOn )
return;
}
if ( currentHour >= instance->object->timeOff && currentHour < instance->object->timeOn )
return;
} else {
if ( currentHour >= instance->object->timeOff || currentHour < instance->object->timeOn )
return;
}
auto matrixModel = instance->getTimeAdjustedTransform(m_renderAlpha);