Web assembly #6
3 changed files with 335 additions and 171 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -77,9 +77,9 @@ struct System
|
|||
/************************************************************************************************************************
|
||||
*Get system name.
|
||||
*/
|
||||
export const (char)[] name() nothrow @nogc
|
||||
export const(char)[] name() nothrow @nogc
|
||||
{
|
||||
return cast(const (char)[])m_name;
|
||||
return cast(const(char)[]) m_name;
|
||||
}
|
||||
|
||||
struct EventCaller
|
||||
|
|
@ -120,10 +120,13 @@ package:
|
|||
ushort[] m_read_only_components;
|
||||
ushort[] m_modified_components;
|
||||
|
||||
EntityManager.SystemCaller* m_any_system_caller;
|
||||
|
||||
EventCaller[] m_event_callers;
|
||||
|
||||
//void function(ref EntityManager.CallData data) m_update;
|
||||
void* m_update; ///workaroud for DMD bug with upper line
|
||||
void delegate() m_update_delegate;
|
||||
|
||||
//void function(void* system_pointer) m_enable;
|
||||
//void function(void* system_pointer) m_disable;
|
||||
|
|
|
|||
|
|
@ -501,6 +501,20 @@ struct TestSystem2
|
|||
|
||||
}
|
||||
|
||||
struct ExternalUpdateCallTest
|
||||
{
|
||||
int print_count = 3;
|
||||
|
||||
void update(TestSystem2.EntitiesData data)
|
||||
{
|
||||
if(print_count > 0)
|
||||
{
|
||||
print_count--;
|
||||
printf("ExternalUpdateCallTest %u %u\n", data.test[0].gg, cast(uint)data.length);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extern(C) int main()
|
||||
{
|
||||
|
||||
|
|
@ -660,8 +674,6 @@ extern(C) int main()
|
|||
gEM.registerSystem!TestSystem2(0);
|
||||
gEM.endRegister();
|
||||
|
||||
System* sys = EntityManager.instance.getSystem(TestSystem2.system_id);
|
||||
|
||||
//gEM.generateDependencies();
|
||||
|
||||
//assert(*(cast(EntityID*)(cast(void*)tmpl.info.first_block+24)) == EntityID(1,1));
|
||||
|
|
@ -799,6 +811,12 @@ extern(C) int main()
|
|||
|
||||
gEM.commit();
|
||||
|
||||
System* sys = EntityManager.instance.getSystem(TestSystem2.system_id);
|
||||
|
||||
ExternalUpdateCallTest external_update_test;
|
||||
|
||||
EntityManager.instance.callEntitiesFunction!TestSystem2(&external_update_test.update);
|
||||
|
||||
printf("pre end\n");
|
||||
|
||||
writeEntityComponents(gEM.getEntity(entity));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue