00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "asAssetGroup.h"
00018
00019 #ifdef __COMPILE_WITH_ANGELSCRIPT__
00020
00021 #include "../ScriptHelper.h"
00022
00023 #include "../../core/AssetGroup.h"
00024
00025
00027 AssetGroup* createAssetGroup(const std::string &name, const std::string &dirName)
00028 {
00029 return new AssetGroup(name, dirName);
00030 }
00031
00033 void bindAssetGroup(asIScriptEngine *engine)
00034 {
00035
00036 int r;
00037
00038
00039 r = engine->RegisterObjectType("AssetGroup", sizeof(AssetGroup), asOBJ_REF);
00040 r = engine->RegisterObjectType("AssetProcessor", sizeof(AssetProcessor), asOBJ_REF);
00041
00042
00043 r = engine->RegisterObjectBehaviour("AssetGroup", asBEHAVE_FACTORY, "AssetGroup@ f(const string &in, " \
00044 " const string &in)", asFUNCTION(createAssetGroup), asCALL_CDECL);
00045 assert(r >= 0);
00046 r = engine->RegisterObjectBehaviour("AssetGroup", asBEHAVE_ADDREF, "void f()",
00047 asMETHOD(AssetGroup, grab), asCALL_THISCALL); assert(r >= 0);
00048 r = engine->RegisterObjectBehaviour("AssetGroup", asBEHAVE_RELEASE, "void f()",
00049 asMETHOD(AssetGroup, drop), asCALL_THISCALL); assert(r >= 0);
00050
00051 r = engine->RegisterObjectMethod("AssetGroup", "AssetGroup& opAssign(const AssetGroup &in)",
00052 asFUNCTION(assignT<AssetGroup>), asCALL_CDECL_OBJLAST); assert(r >= 0);
00053
00054
00055 r = engine->RegisterObjectMethod("AssetGroup", "u32 getID()",
00056 asMETHOD(AssetGroup, getID), asCALL_THISCALL); assert(r >= 0);
00057 r = engine->RegisterObjectMethod("AssetGroup", "const string& getName()",
00058 asMETHOD(AssetGroup, getName), asCALL_THISCALL); assert(r >= 0);
00059 r = engine->RegisterObjectMethod("AssetGroup", "const string& getBaseDir()",
00060 asMETHOD(AssetGroup, getBaseDir), asCALL_THISCALL); assert(r >= 0);
00061
00062 r = engine->RegisterObjectMethod("AssetGroup", "AssetProcessor@ getAssetProcessor(const string &in)",
00063 asMETHOD(AssetGroup, getAssetProcessor), asCALL_THISCALL); assert(r >= 0);
00064
00065 r = engine->RegisterObjectMethod("AssetGroup", "bool reloadAsset(const string &in)",
00066 asMETHOD(AssetGroup, reloadAsset), asCALL_THISCALL); assert(r >= 0);
00067 r = engine->RegisterObjectMethod("AssetGroup", "void reloadAssets()",
00068 asMETHOD(AssetGroup, reloadAssets), asCALL_THISCALL); assert(r >= 0);
00069
00070 r = engine->RegisterObjectMethod("AssetGroup", "bool removeAsset(const string &in)",
00071 asMETHOD(AssetGroup, removeAsset), asCALL_THISCALL); assert(r >= 0);
00072 r = engine->RegisterObjectMethod("AssetGroup", "void removeAssets()",
00073 asMETHOD(AssetGroup, removeAssets), asCALL_THISCALL); assert(r >= 0);
00074 }
00075
00076 #endif // __COMPILE_WITH_ANGELSCRIPT__
00077
00078