MCPcopy Create free account
hub / github.com/SpartanJ/eepp / createChild

Method createChild

src/eepp/graphics/texturepacker.cpp:403–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

401}
402
403void 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
437bool TexturePacker::addTexturesPath( std::string TexturesPath ) {
438 if ( FileSystem::isDirectory( TexturesPath ) ) {

Callers

nothing calls this directly

Calls 9

placedMethod · 0.80
addTextureMethod · 0.80
disabledMethod · 0.80
push_backMethod · 0.80
packTexturesMethod · 0.80
NewFunction · 0.50
beginMethod · 0.45
endMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected