Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added Script::ToFloat().

  • Loading branch information...
commit 85512ace28f37fabe231c976af49a2ed8150ae69 1 parent bbdca88
Dave Reid authored
Showing with 6 additions and 0 deletions.
  1. +1 −0  include/GTCore/Script.hpp
  2. +5 −0 source/Script.cpp
View
1  include/GTCore/Script.hpp
@@ -256,6 +256,7 @@ namespace GTCore
*/
int ToInteger(int index);
double ToDouble(int index);
+ float ToFloat(int index);
bool ToBoolean(int index);
const char * ToString(int index);
void * ToPointer(int index);
View
5 source/Script.cpp
@@ -284,6 +284,11 @@ namespace GTCore
{
return lua_tonumber(LUA_STATE, index);
}
+
+ float Script::ToFloat(int index)
+ {
+ return static_cast<float>(this->ToDouble(index));
+ }
bool Script::ToBoolean(int index)
{
Please sign in to comment.
Something went wrong with that request. Please try again.