mirror of
https://github.com/ZDoom/qzdoom-gpl.git
synced 2024-11-23 04:11:53 +00:00
Moved empty virtual methods to script side
This commit is contained in:
parent
2382a76be5
commit
5751f84350
2 changed files with 19 additions and 25 deletions
|
@ -368,17 +368,10 @@ DEFINE_ACTION_FUNCTION(DStaticEventHandler, Unregister)
|
|||
ACTION_RETURN_BOOL(E_UnregisterHandler(handler));
|
||||
}
|
||||
|
||||
#define DEFINE_EVENT_HANDLER(cls, funcname, args) DEFINE_ACTION_FUNCTION(cls, funcname) \
|
||||
{ \
|
||||
PARAM_SELF_PROLOGUE(cls); \
|
||||
return 0; \
|
||||
} \
|
||||
void cls::funcname(args) \
|
||||
#define DEFINE_EVENT_HANDLER(cls, funcname, args) void cls::funcname(args) \
|
||||
{ \
|
||||
IFVIRTUAL(cls, funcname) \
|
||||
{ \
|
||||
if (func == cls##_##funcname##_VMPtr) \
|
||||
return; \
|
||||
VMValue params[1] = { (cls*)this }; \
|
||||
GlobalVMStack.Call(func, params, 1, nullptr, 0, nullptr); \
|
||||
} \
|
||||
|
|
|
@ -9,22 +9,23 @@ class StaticEventHandler : Object native
|
|||
protected static native bool Register(StaticEventHandler handler);
|
||||
protected static native bool Unregister(StaticEventHandler handler);
|
||||
|
||||
virtual native void WorldLoaded();
|
||||
virtual native void WorldUnloaded();
|
||||
virtual native void WorldThingSpawned();
|
||||
|
||||
virtual native void RenderFrame();
|
||||
// world stuff
|
||||
virtual void WorldLoaded() {}
|
||||
virtual void WorldUnloaded() {}
|
||||
virtual void WorldThingSpawned() {}
|
||||
// render stuff
|
||||
virtual void RenderFrame() {}
|
||||
}
|
||||
|
||||
class StaticRenderEventHandler : StaticEventHandler native
|
||||
{
|
||||
// for frame and camera
|
||||
native readonly Vector3 ViewPos;
|
||||
native readonly double ViewAngle;
|
||||
native readonly double ViewPitch;
|
||||
native readonly double ViewRoll;
|
||||
native readonly double FracTic;
|
||||
native readonly Actor Camera;
|
||||
// for frame and camera
|
||||
native readonly Vector3 ViewPos;
|
||||
native readonly double ViewAngle;
|
||||
native readonly double ViewPitch;
|
||||
native readonly double ViewRoll;
|
||||
native readonly double FracTic;
|
||||
native readonly Actor Camera;
|
||||
}
|
||||
|
||||
class StaticWorldEventHandler : StaticEventHandler native
|
||||
|
@ -36,12 +37,12 @@ class StaticWorldEventHandler : StaticEventHandler native
|
|||
|
||||
class EventHandler : StaticEventHandler native
|
||||
{
|
||||
static native StaticEventHandler Create(class<StaticEventHandler> type);
|
||||
static native StaticEventHandler CreateOnce(class<StaticEventHandler> type);
|
||||
static native StaticEventHandler Find(class<StaticEventHandler> type);
|
||||
static native StaticEventHandler Create(class<StaticEventHandler> type);
|
||||
static native StaticEventHandler CreateOnce(class<StaticEventHandler> type);
|
||||
static native StaticEventHandler Find(class<StaticEventHandler> type);
|
||||
|
||||
static native bool Register(StaticEventHandler handler);
|
||||
static native bool Unregister(StaticEventHandler handler);
|
||||
static native bool Register(StaticEventHandler handler);
|
||||
static native bool Unregister(StaticEventHandler handler);
|
||||
}
|
||||
|
||||
class RenderEventHandler : StaticRenderEventHandler native { }
|
||||
|
|
Loading…
Reference in a new issue