Adds math functions to Angelscript
This commit is contained in:
parent
b7c27cb1f8
commit
50feb94ca1
|
@ -139,6 +139,7 @@ if (SCRIPT_PROVIDER STREQUAL "angelscript")
|
||||||
"${Angelscript_SOURCE_DIR}/add_on/scriptstdstring/scriptstdstring.cpp"
|
"${Angelscript_SOURCE_DIR}/add_on/scriptstdstring/scriptstdstring.cpp"
|
||||||
"${Angelscript_SOURCE_DIR}/add_on/scriptdictionary/scriptdictionary.cpp"
|
"${Angelscript_SOURCE_DIR}/add_on/scriptdictionary/scriptdictionary.cpp"
|
||||||
"${Angelscript_SOURCE_DIR}/add_on/scriptarray/scriptarray.cpp"
|
"${Angelscript_SOURCE_DIR}/add_on/scriptarray/scriptarray.cpp"
|
||||||
|
"${Angelscript_SOURCE_DIR}/add_on/scriptmath/scriptmath.cpp"
|
||||||
"CInterface/AngelScript/*.cpp"
|
"CInterface/AngelScript/*.cpp"
|
||||||
"CInterface/AngelScript/*.hpp"
|
"CInterface/AngelScript/*.hpp"
|
||||||
)
|
)
|
||||||
|
@ -203,8 +204,8 @@ endif ()
|
||||||
if (STATICC)
|
if (STATICC)
|
||||||
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
|
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed")
|
||||||
message(STATUS "Linking C library statically")
|
message(STATUS "Linking C library statically")
|
||||||
set(_LINKS ${_LINKS} -static-libstdc++ -Wl,-Bstatic -lm -lgcc -lstdc++ -Wl,-Bdynamic)
|
set(_LINKS ${_LINKS} -static-libstdc++ -Wl,-Bstatic -lgcc -lstdc++ -Wl,-Bdynamic)
|
||||||
SET(_TESTLINKS ${_TESTLINKS} -Wl,-Bstatic -lm -lgcc -lstdc++ -Wl,-Bdynamic)
|
SET(_TESTLINKS ${_TESTLINKS} -Wl,-Bstatic -lgcc -lstdc++ -Wl,-Bdynamic)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
target_link_libraries(pkmnLib PRIVATE ${_LINKS})
|
target_link_libraries(pkmnLib PRIVATE ${_LINKS})
|
||||||
|
|
|
@ -6,8 +6,7 @@
|
||||||
#include <scripthandle/scripthandle.h>
|
#include <scripthandle/scripthandle.h>
|
||||||
#include <scripthelper/scripthelper.h>
|
#include <scripthelper/scripthelper.h>
|
||||||
#include <scriptstdstring/scriptstdstring.h>
|
#include <scriptstdstring/scriptstdstring.h>
|
||||||
#include "../../Battling/PkmnScriptCategory.hpp"
|
#include <scriptmath/scriptmath.h>
|
||||||
#include "../../Battling/Pokemon/Pokemon.hpp"
|
|
||||||
#include "AngelScriptMetadata.hpp"
|
#include "AngelScriptMetadata.hpp"
|
||||||
#include "AngelscriptUserdata.hpp"
|
#include "AngelscriptUserdata.hpp"
|
||||||
#include "ByteCodeHandling/FileByteCodeStream.hpp"
|
#include "ByteCodeHandling/FileByteCodeStream.hpp"
|
||||||
|
@ -102,6 +101,7 @@ void AngelScriptResolver::Initialize(CreatureLib::Battling::BattleLibrary* arg,
|
||||||
RegisterScriptArray(_engine, true);
|
RegisterScriptArray(_engine, true);
|
||||||
RegisterScriptHandle(_engine);
|
RegisterScriptHandle(_engine);
|
||||||
RegisterScriptDictionary(_engine);
|
RegisterScriptDictionary(_engine);
|
||||||
|
RegisterScriptMath(_engine);
|
||||||
r = _engine->RegisterGlobalFunction("void print(const string &in)", asFUNCTION(Print), asCALL_CDECL);
|
r = _engine->RegisterGlobalFunction("void print(const string &in)", asFUNCTION(Print), asCALL_CDECL);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
throw ArbUt::Exception("Registering print function failed.");
|
throw ArbUt::Exception("Registering print function failed.");
|
||||||
|
|
Loading…
Reference in New Issue