Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions engine/includes/components/camera.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class ENGINE_EXPORT Camera : public Component {
A_METHODS(
A_METHOD(Matrix4, Camera::viewMatrix),
A_METHOD(Matrix4, Camera::projectionMatrix),
A_METHOD(Vector3, Camera::project),
A_METHOD(Vector3, Camera::unproject),
A_METHOD(Camera *, Camera::current),
A_METHOD(void, Camera::setCurrent),
A_STATIC(Vector3, Camera::project),
A_STATIC(Vector3, Camera::unproject),
A_STATIC(Camera *, Camera::current),
A_STATIC(void, Camera::setCurrent),
A_METHOD(Ray, Camera::castRay)
)

Expand Down
2 changes: 1 addition & 1 deletion engine/src/systems/resourcesystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ void ResourceSystem::update(World *) {
++it;
}

while(m_deleteList.empty()) {
while(!m_deleteList.empty()) {
Resource *res = m_deleteList.back();
m_deleteList.pop_back();

Expand Down
27 changes: 17 additions & 10 deletions modules/vms/angel/src/angelsystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,20 +396,30 @@ void AngelSystem::bindMetaType(asIScriptEngine *engine, const MetaType::Table &t
continue;
}

asSFuncPtr ptr(3);
method.table()->address(ptr.ptr.dummy, sizeof(void *));

string signature = retName + method.signature();
for(auto &it : signature) {
if(it == '*') {
it = '@';
}
}

engine->RegisterObjectMethod(typeName,
signature.c_str(),
ptr,
asCALL_THISCALL);
if(method.table()->type == MetaMethod::Static) {
engine->SetDefaultNamespace(typeName);

asSFuncPtr ptr(2);
method.table()->address(ptr.ptr.dummy, sizeof(void *));

engine->RegisterGlobalFunction(signature.c_str(), ptr, asCALL_CDECL);
engine->SetDefaultNamespace("");
} else {
asSFuncPtr ptr(3);
method.table()->address(ptr.ptr.dummy, sizeof(void *));

engine->RegisterObjectMethod(typeName,
signature.c_str(),
ptr,
asCALL_THISCALL);
}
}
}

Expand Down Expand Up @@ -440,9 +450,6 @@ void AngelSystem::bindMetaType(asIScriptEngine *engine, const MetaType::Table &t

string ref = (ptr) ? " &" : "";
string propertyName = property.name();
if(propertyName == "highlightedColor") {
propertyName = propertyName;
}
replace(propertyName.begin(), propertyName.end(), '/', '_');
int metaType = MetaType::type(type.name());
string get = name + " get_" + propertyName + "() property";
Expand Down
4 changes: 3 additions & 1 deletion modules/vms/angel/src/components/angelbehaviour.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,9 @@ void AngelBehaviour::loadUserData(const VariantMap &data) {
if(factory) {
Object *object = nullptr;
if(factory->first->canCastTo(RESOURCE)) {
object = Engine::loadResource<Object>(property->second.toString());
Resource *resource = Engine::loadResource<Resource>(property->second.toString());
resource->incRef();
object = resource;
} else {
uint32_t uuid = property->second.toInt();
if(uuid) {
Expand Down
9 changes: 9 additions & 0 deletions thirdparty/next/inc/core/macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,15 @@ public: \
return table; \
}

#define A_STATIC(r, m) { \
MetaMethod::Static, \
#m, \
(MetaMethod::Table::InvokeMem)&Invoker<decltype(&m)>::invoke<&m>, \
(MetaMethod::Table::AddressMem)&Invoker<decltype(&m)>::address<&m>, \
Invoker<decltype(&m)>::argCount(), \
Invoker<decltype(&m)>::types(#r), \
}

#define A_METHOD(r, m) { \
MetaMethod::Method, \
#m, \
Expand Down
1 change: 1 addition & 0 deletions thirdparty/next/inc/core/metamethod.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ class NEXT_LIBRARY_EXPORT MetaMethod {
public:
enum MethodType {
Method = 0,
Static,
Signal,
Slot
};
Expand Down