Пример #1
0
component_t *sprite_create(object_t *obj)
{
	component_t *c = component_create(COMPONENT_SPRITE, obj, sizeof(sprite_t));
	component_t *t = get_component_by_type(obj, COMPONENT_TRANSFORM);
	sprite_t *s = (sprite_t*) c;
	s->sprite = NULL;
	s->sprite = create_sprite();
	s->transform = (transform_t*) t;
	register_event_callback(&c->obj->scenario->ed, EV_RENDER, c, &sprite_render);
	return c;
}
Пример #2
0
component_t *tileengine_create(object_t *obj)
{
	component_t *c = component_create(COMPONENT_TILEENGINE, obj, sizeof(tileengine_t));
	tileengine_t *te = (tileengine_t*) c;
	te->current_tilemap = NULL;
	te->source.x = 0;
	te->source.y = 0;
	te->source.w = 128;
	te->source.h = 128;
	linked_list_init(&te->tilemaps);
	register_event_callback(&c->obj->scenario->ed, EV_RENDER, c, &tileengine_render);
	return c;
}
Пример #3
0
void TMU_init(void)
{
    register_event_callback( EVENT_TMU0, TMU_event_callback );
    register_event_callback( EVENT_TMU1, TMU_event_callback );
    register_event_callback( EVENT_TMU2, TMU_event_callback );
}    
Пример #4
0
void sinsp_decoder_syslog::init()
{
	register_event_callback(CT_OPEN);
	register_event_callback(CT_CONNECT);
}