void SkeletonAnimation::SetSlotTexture(unsigned index, const std::string& slot_name, const std::string& attach_name, const std::string& texture_path)
{
if (index >= _custom_pages.size())
{
_custom_pages.resize(index + 1, 0);
}
spAtlasPage* old_page = _custom_pages[index];
if (old_page)
{
//just return if new page equals old page
if (strcmp(old_page->name, texture_path.c_str()) == 0)
{
return;
}
//release old page
else
{
spAtlasPage_dispose(old_page);
}
}
spAtlasPage* new_page = spAtlasPage_create(_atlas, texture_path.c_str());
new_page->magFilter = new_page->minFilter = SP_ATLAS_LINEAR;
new_page->uWrap = new_page->vWrap = SP_ATLAS_CLAMPTOEDGE;
_spAtlasPage_createTexture(new_page, texture_path.c_str());
// cache new_page
_custom_pages[index] = new_page;
int tw = new_page->width;
int th = new_page->height;
/*
spAtlasRegion*
基于Spine3.3的换装(纸娃娃,avatar)功能
最新推荐文章于 2025-02-06 00:49:56 发布