From 18301b6f78fd6d7eb77b5055129b71d2b8dce270 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Sun, 19 Jul 2009 14:54:16 +0000 Subject: [PATCH] * Used ldexp() in real_to_double() instead of doing the calculation manually * Moved static declaration of real_to_double() to game.cpp svn-id: r42616 --- engines/draci/game.cpp | 6 +++--- engines/draci/game.h | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/engines/draci/game.cpp b/engines/draci/game.cpp index 03d87b8c6b0..d913eb904f6 100644 --- a/engines/draci/game.cpp +++ b/engines/draci/game.cpp @@ -35,6 +35,8 @@ namespace Draci { +static double real_to_double(byte real[6]); + Game::Game(DraciEngine *vm) : _vm(vm) { unsigned int i; Common::String path("INIT.DFW"); @@ -555,9 +557,7 @@ static double real_to_double(byte real[6]) { } // Calculate final value - return mantissa * pow(2.0, exp); + return ldexp(mantissa, exp); } - - } diff --git a/engines/draci/game.h b/engines/draci/game.h index 6600813b8fb..0c3dddae20e 100644 --- a/engines/draci/game.h +++ b/engines/draci/game.h @@ -43,8 +43,6 @@ enum StructSizes { personSize = sizeof(uint16) * 2 + sizeof(byte) }; -static double real_to_double(byte real[6]); - class WalkingMap { public: