mirror of
https://github.com/Relintai/thread_pool.git
synced 2024-11-12 10:25:29 +01:00
More work on fixing the compile for 4.0.
This commit is contained in:
parent
2192f2c54c
commit
c401b7a027
@ -137,7 +137,11 @@ void ThreadPoolJob::execute() {
|
||||
_start_time = OS::get_singleton()->get_ticks_msec();
|
||||
#endif
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
call("_execute");
|
||||
#else
|
||||
GDVIRTUAL_CALL(_execute);
|
||||
#endif
|
||||
}
|
||||
|
||||
ThreadPoolJob::ThreadPoolJob() {
|
||||
@ -171,7 +175,11 @@ void ThreadPoolJob::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_max_allocated_time"), &ThreadPoolJob::get_max_allocated_time);
|
||||
ClassDB::bind_method(D_METHOD("set_max_allocated_time", "value"), &ThreadPoolJob::set_max_allocated_time);
|
||||
#if VERSION_MAJOR < 4
|
||||
ADD_PROPERTY(PropertyInfo(Variant::REAL, "max_allocated_time"), "set_max_allocated_time", "get_max_allocated_time");
|
||||
#else
|
||||
ADD_PROPERTY(PropertyInfo(Variant::FLOAT, "max_allocated_time"), "set_max_allocated_time", "get_max_allocated_time");
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_start_time"), &ThreadPoolJob::get_start_time);
|
||||
ClassDB::bind_method(D_METHOD("set_start_time", "value"), &ThreadPoolJob::set_start_time);
|
||||
@ -192,7 +200,12 @@ void ThreadPoolJob::_bind_methods() {
|
||||
ClassDB::bind_method(D_METHOD("should_do", "just_check"), &ThreadPoolJob::should_do, DEFVAL(false));
|
||||
ClassDB::bind_method(D_METHOD("should_return"), &ThreadPoolJob::should_return);
|
||||
|
||||
#if VERSION_MAJOR < 4
|
||||
BIND_VMETHOD(MethodInfo("_execute"));
|
||||
#else
|
||||
GDVIRTUAL_BIND(_execute);
|
||||
#endif
|
||||
|
||||
ClassDB::bind_method(D_METHOD("execute"), &ThreadPoolJob::execute);
|
||||
|
||||
ADD_SIGNAL(MethodInfo("completed"));
|
||||
|
@ -30,6 +30,8 @@ SOFTWARE.
|
||||
#ifndef Reference
|
||||
#define Reference RefCounted
|
||||
#endif
|
||||
#include "core/object/gdvirtual.gen.inc"
|
||||
#include "core/object/script_language.h"
|
||||
#else
|
||||
#include "core/reference.h"
|
||||
#endif
|
||||
@ -74,6 +76,10 @@ public:
|
||||
|
||||
void execute();
|
||||
|
||||
#if VERSION_MAJOR >= 4
|
||||
GDVIRTUAL0(_execute);
|
||||
#endif
|
||||
|
||||
ThreadPoolJob();
|
||||
~ThreadPoolJob();
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user