Exemple #1
0
AtlasPage* AtlasPage_create (const char* name) {
	ExampleAtlasPage* self = CALLOC(ExampleAtlasPage, 1)
	_AtlasPage_init(&self->super, name);
	self->super._dispose = _ExampleAtlasPage_dispose;

	self->extraData = 123;

	return &self->super;
}
AtlasPage* AtlasPage_create (const char* name) {
	Cocos2dxAtlasPage* self = NEW(Cocos2dxAtlasPage);
	_AtlasPage_init(SUPER(self), name);
	VTABLE(AtlasPage, self) ->dispose = _Cocos2dxAtlasPage_dispose;

	self->texture = CCTextureCache::sharedTextureCache()->addImage(name);
	self->texture->retain();
	self->atlas = CCTextureAtlas::createWithTexture(self->texture, 4);
	self->atlas->retain();

	return SUPER(self);
}