Skip to content

Commit

Permalink
Fixed|libcore|Time: Converting a high-performance time to a full time…
Browse files Browse the repository at this point in the history
…stamp
  • Loading branch information
skyjake committed Jun 5, 2016
1 parent 7015f1c commit ab34ff4
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions doomsday/sdk/libcore/src/data/time.cpp
Expand Up @@ -14,7 +14,7 @@
* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser
* General Public License for more details. You should have received a copy of
* the GNU Lesser General Public License along with this program; if not, see:
* http://www.gnu.org/licenses</small>
* http://www.gnu.org/licenses</small>
*/

#include "de/Time"
Expand Down Expand Up @@ -265,7 +265,7 @@ bool Time::operator == (Time const &t) const
}

Time Time::operator + (Delta const &delta) const
{
{
Time result = *this;
result += delta;
return result;
Expand Down Expand Up @@ -322,7 +322,7 @@ String Time::asText(Format format) const
{
elapsed = highPerfTimer.startedAt().deltaTo(Time(d->dateTime));
}
int hours = elapsed.asHours();
int hours = int(elapsed.asHours());
TimeDelta sec = elapsed - hours * 3600.0;
if (hours > 0)
{
Expand Down Expand Up @@ -399,7 +399,11 @@ QDateTime &de::Time::asDateTime()

QDateTime const &de::Time::asDateTime() const
{
DENG2_ASSERT(d->hasDateTime());
if (!d->hasDateTime() && d->flags.testFlag(Instance::HighPerformance))
{
d->dateTime = (highPerfTimer.startedAt() + d->highPerfElapsed).asDateTime();
d->flags |= Instance::DateTime;
}
return d->dateTime;
}

Expand Down

0 comments on commit ab34ff4

Please sign in to comment.