From e562e9bac68513486ea7ea280e6e362b0ddbab30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=C2=ADn=20Lucas=20Golini?= Date: Mon, 13 Mar 2017 01:52:25 -0300 Subject: [PATCH] Some clean up. --HG-- branch : dev-font --- bin/assets/fonts/ProggySquareSZ.dat | Bin 8224 -> 0 bytes bin/assets/fonts/ProggySquareSZ.png | Bin 5043 -> 0 bytes include/eepp/audio/soundloader.hpp | 6 ++--- include/eepp/gaming/tilemap.hpp | 2 +- include/eepp/graphics/console.hpp | 4 +++- include/eepp/graphics/textureatlasloader.hpp | 2 +- include/eepp/graphics/textureatlasmanager.hpp | 2 +- include/eepp/graphics/texturefactory.hpp | 2 +- include/eepp/graphics/textureloader.hpp | 2 +- include/eepp/system/packmanager.hpp | 2 +- include/eepp/ui/uitheme.hpp | 4 ++-- src/eepp/gaming/mapeditor/mapeditor.cpp | 2 +- src/eepp/gaming/mapeditor/uimapnew.cpp | 2 +- src/eepp/gaming/tilemap.cpp | 4 ++-- src/eepp/graphics/console.cpp | 5 ++++ src/eepp/graphics/textureatlasloader.cpp | 6 ++--- src/eepp/graphics/textureatlasmanager.cpp | 2 +- src/eepp/graphics/texturefactory.cpp | 2 +- src/eepp/graphics/textureloader.cpp | 4 ++-- src/eepp/ui/uitheme.cpp | 12 +++++----- src/examples/sprites/sprites.cpp | 4 ++-- src/test/eetest.cpp | 22 ++++++++++-------- src/test/eetest.hpp | 1 - 23 files changed, 50 insertions(+), 42 deletions(-) delete mode 100644 bin/assets/fonts/ProggySquareSZ.dat delete mode 100644 bin/assets/fonts/ProggySquareSZ.png diff --git a/bin/assets/fonts/ProggySquareSZ.dat b/bin/assets/fonts/ProggySquareSZ.dat deleted file mode 100644 index 9a3c87a1b3c19e6b766bf579a1c2470428c690de..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 8224 zcmai(Tc}l46o&Uc`=-ZAGczqKBS|nKBa$HPAupgs7czq+EJP$ELAv;0K3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JxLF2#DamJ;*DE|+Dr|+K}U-iG*`mfLbL(V?u zA7j&=xmfS)tAE-DvRrL&TsohhM~zq4FWRAPZX2!t>hCwWJR0W{;2M8kr-n`XC&5+U zx~@I%+2*+F*YoGC|LXeS^Y^0lU!T9%5`8+py92%_;QJG<`JwSY2(I%sl{nCfo~ z^f%Y&<^Mv{kM&>kW2y0S{-^!lk@TPPdjh^P;1AYt`M1`1y?+loJ;#M{v(Zl;KLYOG zpLpG`f13jPTb%ve`m;6Q+Y_FS{|<1Czn(8}akRc(0w2N||NlWQz3S^#@YVpntA;DT zuNxnmU-3QQ`u#H({{iFG?B+W~(s;2#J4a1EFLM~zqGQyi?1uZ$P(-?~o!RX-<; zm+v=e{hzGqU*mHs;J?&x`Tx7|(tnM==J(&=svr5!`j)=Yn2+%*{=dVxs3VtuUGQH2 H_lN%hrwEQ+ diff --git a/bin/assets/fonts/ProggySquareSZ.png b/bin/assets/fonts/ProggySquareSZ.png deleted file mode 100644 index 411f1164f62d2de4d3afaa1eedc3ca38885198f7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5043 zcmeI0`&ZIgzsJ9Ta#2tOQ&2+`FO@e?Go3W?259P-S<&PaD5)9aBh+K&_$UaXcu6q3 zsbgs7u_;YW3#%yvEi9e1E6!A-=omHSXgOwCa-2EmhiBG0=RbIUd9S_KdwurWYk&6I zpVwzg6XNM8GdnW?08r74$V31DtqcJH9J-=YJy%u?Y+iI^SW@opR1VH$JQPg^gG!-a zz@}P^37fipTh>fb{Sz8MtpqpAqp4I(Nx2igh&xl*8W@aJru9^;jI=_bED<8!% z(i+9Vu@2=o`_i1GM*4j%L*->0ZL)14oCwUzT&%KwY{@44(9Cwux7o#( zkcW*%ImQ(771e2w(lpq2AJf>emm2TKU{}RC-XJem-Tnr*oKA(9+(+jH7EMY)Fcus4 z5wJO_#oN_q3wMh~k&#`a5s;msB!b__@NN6=$7|wtD@oU2b*D$-qI|~LA9+&JZ^o(t zscs$e;D)|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Q>{;cY?HX1Bl$i+O6hSUS=`j9WxS4J)CE9gGnj-;<@8@|SQSJb z*^h`>$q%BIx7RtJMzm!reb@B#<7Zvg%-f-V{mLttK>cynz!SvTw?}SX)9F`nP(XV2 zz=K(O2gdY)_DyHU^v_Pasn5EPf@m=U>~D_#ca0B%ww!rlc-Yn8wyX#%qQ5s%pD0An zLdNIAVuCx6Zxiiy2##W`tm$@%f+lxrGQMV=enf)39Qoz;KEZ#TD;o}$;m+x;UEL2F z^>d-#-!kHST+X>`Li(>_TaGjzjEH(qt|^3SdcS%s!PHwW(M&Yb$ze{YpU1vdjRLBK9$_~ZHe8D;ptqH3K4 z*H`EIThJp|{w6dgoLqTp@vp8-yJCY`{(t-#X942Y332qT{r}^@SC%2yzNBycv@%zr zac{sCZc8h>9sC*qpZ`dEVp@?__5W`EKgQq5{%@K6&*7jzuOtA_Y_pm-*kJz0pMP@E MQSp)O;jE(n2IJFYfB*mh diff --git a/include/eepp/audio/soundloader.hpp b/include/eepp/audio/soundloader.hpp index 4f8d8ae79..34b7f460a 100644 --- a/include/eepp/audio/soundloader.hpp +++ b/include/eepp/audio/soundloader.hpp @@ -51,7 +51,7 @@ class tSoundLoader : public ObjectLoader { void start(); private: - void loadFromPath(); + void loadFromFile(); void loadFromMemory(); void loadFromPack(); void loadFromSamples(); @@ -124,7 +124,7 @@ void tSoundLoader::start() { ObjectLoader::start(); if ( SND_LT_PATH == mLoadType ) - loadFromPath(); + loadFromFile(); else if ( SND_LT_MEM == mLoadType ) loadFromMemory(); else if ( SND_LT_PACK == mLoadType ) @@ -137,7 +137,7 @@ void tSoundLoader::start() { } template -void tSoundLoader::loadFromPath() { +void tSoundLoader::loadFromFile() { mSndMngr->loadFromFile( mId, mFilepath ); } diff --git a/include/eepp/gaming/tilemap.hpp b/include/eepp/gaming/tilemap.hpp index ff0786f05..f07ecb66d 100644 --- a/include/eepp/gaming/tilemap.hpp +++ b/include/eepp/gaming/tilemap.hpp @@ -48,7 +48,7 @@ class EE_API TileMap { virtual MapLayer * getLayer( const std::string& name ); - virtual bool load( const std::string& path ); + virtual bool loadFromFile( const std::string& path ); virtual bool loadFromStream( IOStream& IOS ); diff --git a/include/eepp/graphics/console.hpp b/include/eepp/graphics/console.hpp index 47ea2ef82..5b09a3d8e 100755 --- a/include/eepp/graphics/console.hpp +++ b/include/eepp/graphics/console.hpp @@ -40,7 +40,9 @@ class EE_API Console : protected LogReaderInterface { Uint32 getBackgroundTextureId() const { return mTexId; } /** Set the Console Background Color */ - void setBackgroundColor( const ColorA& BackColor ) { mConColor = BackColor; } + void setBackgroundColor( const ColorA& BackColor ) { mConColor = BackColor; mMaxAlpha = mConColor.a(); } + + void setCharacterSize( const Uint32& characterSize ); /** Get the Console Background Color */ const ColorA& getBackgroundColor() const { return mConColor; } diff --git a/include/eepp/graphics/textureatlasloader.hpp b/include/eepp/graphics/textureatlasloader.hpp index 7ab17ab5c..87cfc3460 100644 --- a/include/eepp/graphics/textureatlasloader.hpp +++ b/include/eepp/graphics/textureatlasloader.hpp @@ -66,7 +66,7 @@ class EE_API TextureAtlasLoader { * If the loader is not threaded, it will load the atlas immediately. * @param TextureAtlasPath The texture atlas path. */ - void load( const std::string& TextureAtlasPath = "" ); + void loadFromFile( const std::string& TextureAtlasPath = "" ); /** Loads a texture atlas from a io stream. * If the loader is not threaded, it will load the atlas immediately. diff --git a/include/eepp/graphics/textureatlasmanager.hpp b/include/eepp/graphics/textureatlasmanager.hpp index cb2f3a0bc..dc8df53a0 100644 --- a/include/eepp/graphics/textureatlasmanager.hpp +++ b/include/eepp/graphics/textureatlasmanager.hpp @@ -16,7 +16,7 @@ class EE_API TextureAtlasManager : public ResourceManager { virtual ~TextureAtlasManager(); /** Loads a texture atlas from its path ( the texture atlas binary is expected, not the texture, the ".eta" file ). */ - TextureAtlas * load( const std::string& TextureAtlasPath ); + TextureAtlas * loadFromFile( const std::string& TextureAtlasPath ); /** Loads a texture atlas from a io stream. */ TextureAtlas * loadFromStream( IOStream& IOS ); diff --git a/include/eepp/graphics/texturefactory.hpp b/include/eepp/graphics/texturefactory.hpp index 4cc70a608..38be6fa03 100755 --- a/include/eepp/graphics/texturefactory.hpp +++ b/include/eepp/graphics/texturefactory.hpp @@ -80,7 +80,7 @@ class EE_API TextureFactory : protected Mutex { * @param KeepLocalCopy Keep the array data copy. ( useful if want to reload the texture ) * @return The internal Texture Id */ - Uint32 load( const std::string& Filepath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); + Uint32 loadFromFile( const std::string& Filepath, const bool& Mipmap = false, const EE_CLAMP_MODE& ClampMode = CLAMP_TO_EDGE, const bool& CompressTexture = false, const bool& KeepLocalCopy = false ); /** Remove and Unload the Texture Id * @param TexId diff --git a/include/eepp/graphics/textureloader.hpp b/include/eepp/graphics/textureloader.hpp index e54594176..e3662ec30 100644 --- a/include/eepp/graphics/textureloader.hpp +++ b/include/eepp/graphics/textureloader.hpp @@ -119,7 +119,7 @@ class EE_API TextureLoader : public ObjectLoader { Clock mTE; void loadFile(); - void loadFromPath(); + void loadFromFile(); void loadFromMemory(); void loadFromPack(); void loadFromPixels(); diff --git a/include/eepp/system/packmanager.hpp b/include/eepp/system/packmanager.hpp index 8a6dcc5ff..cd782c4da 100644 --- a/include/eepp/system/packmanager.hpp +++ b/include/eepp/system/packmanager.hpp @@ -30,7 +30,7 @@ class EE_API PackManager : public Container { /** @brief Sets if the files that failed to be loaded from the file system should try to be loaded from the currently open packs. ** For example if you try to load a texture from the file system a fails it will search the same path in the opened packs, and load it from there. - ** TextureFactory::instance()->load( "mytexture.png" ); + ** TextureFactory::instance()->loadFromFile( "mytexture.png" ); ** If the file is not in the file system, it will be searched in the opened packs, and loaded if is found. ** In case that the process path is appended to the path... like Sys::GetProcessPath() + "mytexture.png", the process path will be removed from the file path. */ diff --git a/include/eepp/ui/uitheme.hpp b/include/eepp/ui/uitheme.hpp index f97845d71..53aa42a70 100644 --- a/include/eepp/ui/uitheme.hpp +++ b/include/eepp/ui/uitheme.hpp @@ -51,11 +51,11 @@ class EE_API UITheme : protected ResourceManager { static UITheme * loadFromTextureAtlas( UITheme * tTheme, Graphics::TextureAtlas * getTextureAtlas ); - static UITheme * loadFromPath( UITheme * tTheme, const std::string& Path, const std::string ImgExt = "png" ); + static UITheme * loadFromFile( UITheme * tTheme, const std::string& Path, const std::string ImgExt = "png" ); static UITheme * loadFromTextureAtlas( Graphics::TextureAtlas * getTextureAtlas, const std::string& Name, const std::string NameAbbr ); - static UITheme * loadFromPath( const std::string& Path, const std::string& Name, const std::string& NameAbbr, const std::string ImgExt = "png" ); + static UITheme * loadFromFile( const std::string& Path, const std::string& Name, const std::string& NameAbbr, const std::string ImgExt = "png" ); void addThemeElement( const std::string& Element ); diff --git a/src/eepp/gaming/mapeditor/mapeditor.cpp b/src/eepp/gaming/mapeditor/mapeditor.cpp index 9e2aae0be..2c213c6b1 100644 --- a/src/eepp/gaming/mapeditor/mapeditor.cpp +++ b/src/eepp/gaming/mapeditor/mapeditor.cpp @@ -886,7 +886,7 @@ void MapEditor::updateScroll() { void MapEditor::mapOpen( const UIEvent * Event ) { UICommonDialog * CDL = reinterpret_cast ( Event->getControl() ); - if ( mUIMap->Map()->load( CDL->getFullPath() ) ) { + if ( mUIMap->Map()->loadFromFile( CDL->getFullPath() ) ) { onMapLoad(); } } diff --git a/src/eepp/gaming/mapeditor/uimapnew.cpp b/src/eepp/gaming/mapeditor/uimapnew.cpp index 5ac3ee2e4..aedc4f938 100644 --- a/src/eepp/gaming/mapeditor/uimapnew.cpp +++ b/src/eepp/gaming/mapeditor/uimapnew.cpp @@ -261,7 +261,7 @@ void UIMapNew::onOKClick( const UIEvent * Event ) { Map->setBackColor( ColorA( 100, 100, 100, 100 ) ); Map->setGridLinesColor( ColorA( 150, 150, 150, 150 ) ); Map->forceHeadersOnLoad( Sizei( w, h ), Sizei( tw, th ), ml, Flags ); - Map->load( mapPath ); + Map->loadFromFile( mapPath ); Map->disableForcedHeaders(); Map->mPath = oldPath; diff --git a/src/eepp/gaming/tilemap.cpp b/src/eepp/gaming/tilemap.cpp index 8555c4dfa..fd88a36db 100644 --- a/src/eepp/gaming/tilemap.cpp +++ b/src/eepp/gaming/tilemap.cpp @@ -840,7 +840,7 @@ bool TileMap::loadFromStream( IOStream& IOS ) { if ( NULL == TextureAtlasManager::instance()->getByName( sgname ) ) { TextureAtlasLoader * tgl = eeNew( TextureAtlasLoader, () ); - tgl->load( Sys::getProcessPath() + TextureAtlases[i] ); + tgl->loadFromFile( Sys::getProcessPath() + TextureAtlases[i] ); eeSAFE_DELETE( tgl ); } @@ -1038,7 +1038,7 @@ const std::string& TileMap::getPath() const { return mPath; } -bool TileMap::load( const std::string& path ) { +bool TileMap::loadFromFile( const std::string& path ) { if ( FileSystem::fileExists( path ) ) { mPath = path; diff --git a/src/eepp/graphics/console.cpp b/src/eepp/graphics/console.cpp index 16111d359..7931bd6a3 100755 --- a/src/eepp/graphics/console.cpp +++ b/src/eepp/graphics/console.cpp @@ -99,6 +99,11 @@ Console::~Console() { } } +void Console::setCharacterSize(const EE::Uint32 & characterSize) { + mTextCache.setCharacterSize( characterSize ); + mFontSize = (Float)( mTextCache.getFont()->getLineSpacing( mTextCache.getCharacterSizePx() ) ); +} + void Console::create( Font* Font, const bool& MakeDefaultCommands, const bool& AttachToLog, const unsigned int& MaxLogLines, const Uint32& TextureId ) { if ( NULL == mWindow ) { mWindow = Engine::instance()->getCurrentWindow(); diff --git a/src/eepp/graphics/textureatlasloader.cpp b/src/eepp/graphics/textureatlasloader.cpp index f6fcbf332..a19a3b868 100644 --- a/src/eepp/graphics/textureatlasloader.cpp +++ b/src/eepp/graphics/textureatlasloader.cpp @@ -32,7 +32,7 @@ TextureAtlasLoader::TextureAtlasLoader( const std::string& TextureAtlasPath, con mTextureAtlas(NULL), mLoadCallback( LoadCallback ) { - load(); + loadFromFile(); } TextureAtlasLoader::TextureAtlasLoader( const Uint8* Data, const Uint32& DataSize, const std::string& TextureAtlasName, const bool& Threaded, GLLoadCallback LoadCallback ) : @@ -134,7 +134,7 @@ void TextureAtlasLoader::loadFromStream( IOStream& IOS ) { } } -void TextureAtlasLoader::load( const std::string& TextureAtlasPath ) { +void TextureAtlasLoader::loadFromFile( const std::string& TextureAtlasPath ) { if ( TextureAtlasPath.size() ) mTextureAtlasPath = TextureAtlasPath; @@ -359,7 +359,7 @@ bool TextureAtlasLoader::updateTextureAtlas( std::string TextureAtlasPath, std:: return false; mSkipResourceLoad = true; - load( TextureAtlasPath ); + loadFromFile( TextureAtlasPath ); mSkipResourceLoad = false; if ( !mTempAtlass.size() ) diff --git a/src/eepp/graphics/textureatlasmanager.cpp b/src/eepp/graphics/textureatlasmanager.cpp index 2d0ff952d..e7e1e10c6 100644 --- a/src/eepp/graphics/textureatlasmanager.cpp +++ b/src/eepp/graphics/textureatlasmanager.cpp @@ -15,7 +15,7 @@ TextureAtlasManager::TextureAtlasManager() : TextureAtlasManager::~TextureAtlasManager() { } -TextureAtlas * TextureAtlasManager::load( const std::string& TextureAtlasPath ) { +TextureAtlas * TextureAtlasManager::loadFromFile( const std::string& TextureAtlasPath ) { TextureAtlasLoader loader( TextureAtlasPath ); return loader.getTextureAtlas(); diff --git a/src/eepp/graphics/texturefactory.cpp b/src/eepp/graphics/texturefactory.cpp index 3974a5683..283cc7bf6 100755 --- a/src/eepp/graphics/texturefactory.cpp +++ b/src/eepp/graphics/texturefactory.cpp @@ -55,7 +55,7 @@ Uint32 TextureFactory::loadFromStream( IOStream& Stream, const bool& Mipmap, con return myTex.getId(); } -Uint32 TextureFactory::load( const std::string& Filepath, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { +Uint32 TextureFactory::loadFromFile( const std::string& Filepath, const bool& Mipmap, const EE_CLAMP_MODE& ClampMode, const bool& CompressTexture, const bool& KeepLocalCopy ) { TextureLoader myTex( Filepath, Mipmap, ClampMode, CompressTexture, KeepLocalCopy ); myTex.load(); return myTex.getId(); diff --git a/src/eepp/graphics/textureloader.cpp b/src/eepp/graphics/textureloader.cpp index ced30162a..4689b26e6 100644 --- a/src/eepp/graphics/textureloader.cpp +++ b/src/eepp/graphics/textureloader.cpp @@ -232,7 +232,7 @@ void TextureLoader::start() { mTE.restart(); if ( TEX_LT_PATH == mLoadType ) - loadFromPath(); + loadFromFile(); else if ( TEX_LT_MEM == mLoadType ) loadFromMemory(); else if ( TEX_LT_PACK == mLoadType ) @@ -255,7 +255,7 @@ void TextureLoader::loadFile() { fs.read( reinterpret_cast ( mPixels ), mSize ); } -void TextureLoader::loadFromPath() { +void TextureLoader::loadFromFile() { if ( FileSystem::fileExists( mFilepath ) ) { mImgType = stbi_test( mFilepath.c_str() ); diff --git a/src/eepp/ui/uitheme.cpp b/src/eepp/ui/uitheme.cpp index 9e1081b85..677b74880 100644 --- a/src/eepp/ui/uitheme.cpp +++ b/src/eepp/ui/uitheme.cpp @@ -168,7 +168,7 @@ UITheme * UITheme::loadFromTextureAtlas( UITheme * tTheme, Graphics::TextureAtla return tTheme; } -UITheme * UITheme::loadFromPath( UITheme * tTheme, const std::string& Path, const std::string ImgExt ) { +UITheme * UITheme::loadFromFile( UITheme * tTheme, const std::string& Path, const std::string ImgExt ) { Clock TE; loadThemeElements( tTheme->mUIElements, tTheme->mUIIcons ); @@ -210,7 +210,7 @@ UITheme * UITheme::loadFromPath( UITheme * tTheme, const std::string& Path, cons Element = RPath + ElemName + "." + ImgExt; if ( FileSystem::fileExists( Element ) ) { - tSG->add( eeNew( SubTexture, ( TextureFactory::instance()->load( Element ), ElemName ) ) ); + tSG->add( eeNew( SubTexture, ( TextureFactory::instance()->loadFromFile( Element ), ElemName ) ) ); } } @@ -231,8 +231,8 @@ UITheme * UITheme::loadFromPath( UITheme * tTheme, const std::string& Path, cons return tTheme; } -UITheme * UITheme::loadFromPath( const std::string& Path, const std::string& Name, const std::string& NameAbbr, const std::string ImgExt ) { - return loadFromPath( eeNew( UITheme, ( Name, NameAbbr ) ), Path, ImgExt ); +UITheme * UITheme::loadFromFile( const std::string& Path, const std::string& Name, const std::string& NameAbbr, const std::string ImgExt ) { + return loadFromFile( eeNew( UITheme, ( Name, NameAbbr ) ), Path, ImgExt ); } UITheme * UITheme::loadFromTextureAtlas( Graphics::TextureAtlas * TextureAtlas, const std::string& Name, const std::string NameAbbr ) { @@ -293,7 +293,7 @@ bool UITheme::searchFilesOfElement( Graphics::TextureAtlas * SG, const std::stri ElemFullPath = ElemPath + "." + ImgExt; if ( FileSystem::fileExists( ElemFullPath ) ) { - SG->add( eeNew( SubTexture, ( TextureFactory::instance()->load( ElemFullPath ), ElemName ) ) ); + SG->add( eeNew( SubTexture, ( TextureFactory::instance()->loadFromFile( ElemFullPath ), ElemName ) ) ); IsComplex = 1; Found = true; @@ -310,7 +310,7 @@ bool UITheme::searchFilesOfElement( Graphics::TextureAtlas * SG, const std::stri ElemFullPath = ElemPath + "." + ImgExt; if ( FileSystem::fileExists( ElemFullPath ) ) { - SG->add( eeNew( SubTexture, ( TextureFactory::instance()->load( ElemFullPath ), ElemName ) ) ); + SG->add( eeNew( SubTexture, ( TextureFactory::instance()->loadFromFile( ElemFullPath ), ElemName ) ) ); Found = true; } diff --git a/src/examples/sprites/sprites.cpp b/src/examples/sprites/sprites.cpp index 84ad493ca..ebcec868a 100644 --- a/src/examples/sprites/sprites.cpp +++ b/src/examples/sprites/sprites.cpp @@ -99,8 +99,8 @@ EE_MAIN_FUNC int main (int argc, char * argv []) std::string AppPath = Sys::getProcessPath(); // Load the rock texture - Uint32 PlanetId = TextureFactory::instance()->load( AppPath + "assets/sprites/7.png" ); - Uint32 RockId = TextureFactory::instance()->load( AppPath + "assets/sprites/5.png" ); + Uint32 PlanetId = TextureFactory::instance()->loadFromFile( AppPath + "assets/sprites/7.png" ); + Uint32 RockId = TextureFactory::instance()->loadFromFile( AppPath + "assets/sprites/5.png" ); // Load a previously generated texture atlas that contains the SubTextures needed to load an animated sprite TextureAtlasLoader Blindies( AppPath + "assets/atlases/bnb.eta" ); diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index f8933146d..1ad598146 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -177,7 +177,7 @@ void EETest::loadFonts() { void EETest::onFontLoaded( ResourceLoader * ObjLoaded ) { TTF = FontManager::instance()->getByName( "arial" ); - DBSM = FontManager::instance()->getByName( "DejaVuSansMono" ); + Font * DBSM = FontManager::instance()->getByName( "DejaVuSansMono" ); eePRINTL( "Fonts loading time: %4.3f ms.", mFTE.getElapsed().asMilliseconds() ); @@ -185,8 +185,10 @@ void EETest::onFontLoaded( ResourceLoader * ObjLoaded ) { eeASSERT( DBSM != NULL ); Con.create( DBSM, true ); + Con.setBackgroundColor( 0x201f1fEE ); + Con.setFontColor( 0xcfcfcfff ); Con.ignoreCharOnPrompt( 186 ); // 'º' - Con.getTextCache().setOutlineThickness( 1 ); + Con.getTextCache().setCharacterSize( 12 ); Con.getTextCache().setOutlineColor( ColorA(0,0,0,150) ); mBuda = String::fromUtf8( "El mono ve el pez en el agua y sufre. Piensa que su mundo es el único que existe, el mejor, el real. Sufre porque es bueno y tiene compasión, lo ve y piensa: \"Pobre se está ahogando no puede respirar\". Y lo saca, lo saca y se queda tranquilo, por fin lo salvé. Pero el pez se retuerce de dolor y muere. Por eso te mostré el sueño, es imposible meter el mar en tu cabeza, que es un balde." ); @@ -275,7 +277,7 @@ void EETest::createUI() { //UI_MAN_OPS = UI_MANAGER_HIGHLIGHT_FOCUS | UI_MANAGER_HIGHLIGHT_OVER | UI_MANAGER_DRAW_DEBUG_DATA | UI_MANAGER_DRAW_BOXES; UIManager::instance()->init(UI_MAN_OPS); - //mTheme = UITheme::loadFromPath( eeNew( UIThemeDefault, ( mThemeName, mThemeName ) ), MyPath + mThemeName + "/" ); + //mTheme = UITheme::loadFromFile( eeNew( UIThemeDefault, ( mThemeName, mThemeName ) ), MyPath + mThemeName + "/" ); TextureAtlasLoader tgl( MyPath + "ui/" + mThemeName + EE_TEXTURE_ATLAS_EXTENSION ); @@ -465,10 +467,10 @@ void EETest::createUI() { #ifdef EE_PLATFORM_TOUCH TextureAtlas * SG = GlobalTextureAtlas::instance(); - Texture * butTex = TF->getTexture( TF->load( MyPath + "sprites/button-te_normal.png" ) ); + Texture * butTex = TF->getTexture( TF->loadFromFile( MyPath + "sprites/button-te_normal.png" ) ); SG->add( butTex->getId(), "button-te_normal" ); - SG->add( TF->load( MyPath + "sprites/button-te_mdown.png" ), "button-te_mdown" ); + SG->add( TF->loadFromFile( MyPath + "sprites/button-te_mdown.png" ), "button-te_mdown" ); UISkinSimple nSkin( "button-te" ); Sizei screenSize = UIManager::instance()->getMainControl()->getSize(); @@ -1024,7 +1026,7 @@ void EETest::loadTextures() { TNP.resize(12); for ( i = 0; i <= 6; i++ ) { - TN[i] = TF->load( MyPath + "sprites/" + String::toStr(i+1) + ".png", (i+1) == 7 ? true : false, ( (i+1) == 4 ) ? CLAMP_REPEAT : CLAMP_TO_EDGE ); + TN[i] = TF->loadFromFile( MyPath + "sprites/" + String::toStr(i+1) + ".png", (i+1) == 7 ? true : false, ( (i+1) == 4 ) ? CLAMP_REPEAT : CLAMP_TO_EDGE ); TNP[i] = TF->getTexture( TN[i] ); } @@ -1038,14 +1040,14 @@ void EETest::loadTextures() { Tiles[i] = SG->getByName( String::toStr( i+1 ) ); } - Tiles[6] = SG->add( TF->load( MyPath + "sprites/objects/1.png" ), "7" ); + Tiles[6] = SG->add( TF->loadFromFile( MyPath + "sprites/objects/1.png" ), "7" ); #ifdef EE_GLES Image tImg( MyPath + "sprites/objects/2.png", 4 ); tImg.CreateMaskFromColor( ColorA(0,0,0,255), 0 ); Tiles[7] = SG->Add( TF->loadFromPixels( tImg.getPixelsPtr(), tImg.getWidth(), tImg.getHeight(), tImg.getChannels() ), "8" ); #else - Tiles[7] = SG->add( TF->load( MyPath + "sprites/objects/2.png" ), "8" ); + Tiles[7] = SG->add( TF->loadFromFile( MyPath + "sprites/objects/2.png" ), "8" ); Tiles[7]->getTexture()->createMaskFromColor( ColorA(0,0,0,255), 0 ); #endif } @@ -1085,7 +1087,7 @@ void EETest::loadTextures() { Tex->unlock(false, true); } - Cursor[0] = TF->load( MyPath + "cursors/cursor.tga" ); + Cursor[0] = TF->loadFromFile( MyPath + "cursors/cursor.tga" ); CursorP[0] = TF->getTexture( Cursor[0] ); CursorManager * CurMan = mWindow->getCursorManager(); @@ -1112,7 +1114,7 @@ void EETest::loadTextures() { eePRINTL( "Textures loading time: %4.3f ms.", TE.getElapsed().asMilliseconds() ); - Map.load( MyPath + "maps/test.eem" ); + Map.loadFromFile( MyPath + "maps/test.eem" ); Map.setDrawGrid( false ); Map.setClipedArea( false ); Map.setDrawBackground( false ); diff --git a/src/test/eetest.hpp b/src/test/eetest.hpp index 5bba11a34..500ac4700 100644 --- a/src/test/eetest.hpp +++ b/src/test/eetest.hpp @@ -62,7 +62,6 @@ class EETest : private Thread { Sprite SP; Sprite CL1, CL2; Font * TTF; - Font * DBSM; Primitives PR; bool iL1, iL2;