Exemplo n.º 1
0
void NativeScriptLanguage::frame() {
#ifndef NO_THREADS
	if (has_objects_to_register) {
		MutexLock lock(mutex);
		for (Set<Ref<GDNativeLibrary> >::Element *L = libs_to_init.front(); L; L = L->next()) {
			init_library(L->get());
		}
		libs_to_init.clear();
		for (Set<NativeScript *>::Element *S = scripts_to_register.front(); S; S = S->next()) {
			register_script(S->get());
		}
		scripts_to_register.clear();
		has_objects_to_register = false;
	}
#endif

#ifdef DEBUG_ENABLED
	{
#ifndef NO_THREADS
		MutexLock lock(mutex);
#endif

		for (Map<StringName, ProfileData>::Element *d = profile_data.front(); d; d = d->next()) {
			d->get().last_frame_call_count = d->get().frame_call_count;
			d->get().last_frame_self_time = d->get().frame_self_time;
			d->get().last_frame_total_time = d->get().frame_total_time;
			d->get().frame_call_count = 0;
			d->get().frame_self_time = 0;
			d->get().frame_total_time = 0;
		}
	}
#endif

	call_libraries_cb(_frame_call_name);
}
Exemplo n.º 2
0
void NativeScriptLanguage::frame() {
#ifndef NO_THREADS
	if (has_objects_to_register) {
		MutexLock lock(mutex);
		for (Set<Ref<GDNativeLibrary> >::Element *L = libs_to_init.front(); L; L = L->next()) {
			init_library(L->get());
		}
		libs_to_init.clear();
		for (Set<NativeScript *>::Element *S = scripts_to_register.front(); S; S = S->next()) {
			register_script(S->get());
		}
		scripts_to_register.clear();
		has_objects_to_register = false;
	}
#endif
	call_libraries_cb(_frame_call_name);
}
Exemplo n.º 3
0
void NativeScriptLanguage::thread_exit() {
	call_libraries_cb(_thread_exit_call_name);
}