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

Method createUIThemeTextureAtlas

src/tests/test_all/test.cpp:225–248  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

223}
224
225void EETest::createUIThemeTextureAtlas() {
226#if !defined( EE_DEBUG ) || defined( EE_GLES )
227 return;
228#endif
229
230 std::string tgpath( MyPath + "ui/" + mThemeName );
231 std::string Path( MyPath + "ui/" + mThemeName );
232
233 if ( !FileSystem::fileExists( tgpath + EE_TEXTURE_ATLAS_EXTENSION ) ) {
234 PixelDensitySize PD = PixelDensitySize::MDPI;
235 if ( mThemeName.find( "2x" ) != std::string::npos )
236 PD = PixelDensitySize::XHDPI;
237 else if ( mThemeName.find( "1.5x" ) != std::string::npos )
238 PD = PixelDensitySize::HDPI;
239
240 TexturePacker tp( 2048, 2048, PixelDensity::toFloat( PD ), true, false, 2 );
241 tp.addTexturesPath( Path );
242 tp.packTextures();
243 tp.save( tgpath + ".png", Image::SaveType::PNG );
244 } else {
245 TextureAtlasLoader tgl;
246 tgl.updateTextureAtlas( tgpath + EE_TEXTURE_ATLAS_EXTENSION, Path );
247 }
248}
249
250void EETest::loadFonts() {
251 mFTE.restart();

Callers

nothing calls this directly

Calls 5

addTexturesPathMethod · 0.80
packTexturesMethod · 0.80
updateTextureAtlasMethod · 0.80
findMethod · 0.45
saveMethod · 0.45

Tested by

no test coverage detected