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