| 401 | } |
| 402 | |
| 403 | void TexturePacker::createChild() { |
| 404 | mChild = TexturePacker::New( mWidth, mHeight, mPixelDensity / 100.f, mForcePowOfTwo, |
| 405 | mScalableSVG, mPixelBorder, mTextureFilter, mAllowFlipping ); |
| 406 | |
| 407 | std::vector<TexturePackerTex*>::iterator it; |
| 408 | std::vector<std::vector<TexturePackerTex*>::iterator> remove; |
| 409 | |
| 410 | TexturePackerTex* t = NULL; |
| 411 | |
| 412 | for ( it = mTextures.begin(); it != mTextures.end(); ++it ) { |
| 413 | t = ( *it ); |
| 414 | |
| 415 | if ( !t->placed() ) { |
| 416 | mChild->addTexture( t->name() ); |
| 417 | mChild->mParent = this; |
| 418 | |
| 419 | t->disabled( true ); |
| 420 | |
| 421 | remove.push_back( it ); |
| 422 | |
| 423 | mCount--; |
| 424 | } |
| 425 | } |
| 426 | |
| 427 | // Removes the non-placed textures from the pack |
| 428 | std::vector<std::vector<TexturePackerTex*>::iterator>::iterator itit; |
| 429 | |
| 430 | for ( itit = remove.begin(); itit != remove.end(); ++itit ) { |
| 431 | mTextures.erase( *itit ); |
| 432 | } |
| 433 | |
| 434 | mChild->packTextures(); |
| 435 | } |
| 436 | |
| 437 | bool TexturePacker::addTexturesPath( std::string TexturesPath ) { |
| 438 | if ( FileSystem::isDirectory( TexturesPath ) ) { |
nothing calls this directly
no test coverage detected