From 58d6d94517bb2ac018759cea88c2d480edb1b201 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mart=C3=AD=C2=ADn=20Lucas=20Golini?= Date: Sat, 25 Feb 2017 16:07:31 -0300 Subject: [PATCH] Fixes. --HG-- branch : dev --- include/eepp/graphics/subtexture.hpp | 5 +++ src/eepp/gaming/mapeditor/mapeditor.cpp | 37 ++++++++----------- src/eepp/graphics/scrollparallax.cpp | 6 +-- src/eepp/graphics/subtexture.cpp | 29 +++++++++------ src/eepp/graphics/textureatlasloader.cpp | 2 +- src/eepp/ui/tools/textureatlaseditor.cpp | 22 ++++++----- .../ui/tools/textureatlassubtextureeditor.cpp | 9 ++++- src/eepp/ui/uigfx.cpp | 10 +++++ src/eepp/ui/uiskincomplex.cpp | 27 +++++++++++--- src/eepp/ui/uisprite.cpp | 2 +- src/test/eetest.cpp | 7 ++-- 11 files changed, 99 insertions(+), 57 deletions(-) diff --git a/include/eepp/graphics/subtexture.hpp b/include/eepp/graphics/subtexture.hpp index d0edd84c8..0ba821670 100644 --- a/include/eepp/graphics/subtexture.hpp +++ b/include/eepp/graphics/subtexture.hpp @@ -151,6 +151,10 @@ class EE_API SubTexture { Sizei getDpSize(); Sizei getPxSize(); + + Sizef getOriDestSize() const; + + void setOriDestSize(const Sizef & oriDestSize); protected: Uint8 * mPixels; Uint8 * mAlpha; @@ -159,6 +163,7 @@ class EE_API SubTexture { Uint32 mTexId; Graphics::Texture * mTexture; Recti mSrcRect; + Sizef mOriDestSize; Sizef mDestSize; Vector2i mOffset; Float mPixelDensity; diff --git a/src/eepp/gaming/mapeditor/mapeditor.cpp b/src/eepp/gaming/mapeditor/mapeditor.cpp index 6b9560ce9..83be8ffdc 100644 --- a/src/eepp/gaming/mapeditor/mapeditor.cpp +++ b/src/eepp/gaming/mapeditor/mapeditor.cpp @@ -795,39 +795,34 @@ void MapEditor::OnMapSizeChange( const UIEvent *Event ) { if ( mMouseScrolling ) return; - Vector2i v( mUIMap->Map()->getMaxOffset() ); + Vector2f t( mUIMap->Map()->getTileSize().getWidth() * mUIMap->Map()->getScale(), + mUIMap->Map()->getTileSize().getHeight() * mUIMap->Map()->getScale() ); + + Vector2f v( (Float)mUIMap->Map()->getViewSize().getWidth(), (Float)mUIMap->Map()->getViewSize().getHeight() ); + + Vector2f s( t.x * mUIMap->Map()->getSize().getWidth(), t.y * mUIMap->Map()->getSize().getHeight() ); + + Vector2f m( s.x - v.x, s.y - v.y ); mMapHScroll->setMinValue( 0 ); - mMapHScroll->setMaxValue( v.x ); - mMapHScroll->setClickStep( mUIMap->Map()->getTileSize().getWidth() * mUIMap->Map()->getScale() ); + mMapHScroll->setMaxValue( m.x ); + mMapHScroll->setClickStep( t.y ); mMapVScroll->setMinValue( 0 ); - mMapVScroll->setMaxValue( v.y ); - mMapVScroll->setClickStep( mUIMap->Map()->getTileSize().getHeight() * mUIMap->Map()->getScale() ); - mMapHScroll->setPageStep( (Float)mUIMap->Map()->getViewSize().getWidth() ); - mMapVScroll->setPageStep( (Float)mUIMap->Map()->getViewSize().getHeight() ); + mMapVScroll->setMaxValue( m.y ); + mMapVScroll->setClickStep( t.x ); + mMapHScroll->setPageStep( v.x / s.x * m.x ); + mMapVScroll->setPageStep( v.y / s.y * m.y ); } void MapEditor::OnScrollMapH( const UIEvent * Event ) { if ( mMouseScrolling ) return; - UIScrollBar * Scr = reinterpret_cast ( Event->getControl() ); - - Vector2f Off = mUIMap->Map()->getOffset(); - - Off.x = -Scr->getValue(); - - mUIMap->Map()->setOffset( Off ) ; + mUIMap->Map()->setOffset( Vector2f( -mMapHScroll->getValue(), -mMapVScroll->getValue() ) ) ; } void MapEditor::OnScrollMapV( const UIEvent * Event ) { - UIScrollBar * Scr = reinterpret_cast ( Event->getControl() ); - - Vector2f Off = mUIMap->Map()->getOffset(); - - Off.y = -Scr->getValue(); - - mUIMap->Map()->setOffset( Off ) ; + mUIMap->Map()->setOffset( Vector2f( -mMapHScroll->getValue(), -mMapVScroll->getValue() ) ) ; } void MapEditor::UpdateScroll() { diff --git a/src/eepp/graphics/scrollparallax.cpp b/src/eepp/graphics/scrollparallax.cpp index 403765eb7..8c2103ce7 100755 --- a/src/eepp/graphics/scrollparallax.cpp +++ b/src/eepp/graphics/scrollparallax.cpp @@ -31,8 +31,8 @@ void ScrollParallax::setSubTexture() { mRect = mSubTexture->getSrcRect(); mRealSize = Vector2f( (Float)mSubTexture->getRealSize().getWidth(), (Float)mSubTexture->getRealSize().getHeight() ); - mTiles.x = ( (Int32)mSize.getWidth() / mSubTexture->getRealSize().getWidth() ) + 1; - mTiles.y = ( (Int32)mSize.getHeight() / mSubTexture->getRealSize().getHeight() ) + 1; + mTiles.x = ( (Int32)mSize.getWidth() / (Int32)mRealSize.getWidth() ) + 1; + mTiles.y = ( (Int32)mSize.getHeight() / (Int32)mRealSize.getHeight() ) + 1; } } @@ -126,7 +126,7 @@ void ScrollParallax::draw() { } mSubTexture->setSrcRect( Rect ); - mSubTexture->resetDestSize(); + mSubTexture->setDestSize( Vector2f( Rect.getSize().x, Rect.getSize().y ) ); if ( !( Rect.Right == 0 || Rect.Bottom == 0 ) ) mSubTexture->draw( AABB.Left, AABB.Top, mColor, 0.f, Vector2f::One, mBlend ); diff --git a/src/eepp/graphics/subtexture.cpp b/src/eepp/graphics/subtexture.cpp index f8846e692..7138a356f 100644 --- a/src/eepp/graphics/subtexture.cpp +++ b/src/eepp/graphics/subtexture.cpp @@ -15,6 +15,7 @@ SubTexture::SubTexture() : mTexId(0), mTexture(NULL), mSrcRect( Recti(0,0,0,0) ), + mOriDestSize(0,0), mDestSize(0,0), mOffset(0,0), mPixelDensity(1) @@ -30,7 +31,8 @@ SubTexture::SubTexture( const Uint32& TexId, const std::string& Name ) : mTexId( TexId ), mTexture( TextureFactory::instance()->getTexture( TexId ) ), mSrcRect( Recti( 0, 0, NULL != mTexture ? mTexture->getImageWidth() : 0, NULL != mTexture ? mTexture->getImageHeight() : 0 ) ), - mDestSize( (Float)mSrcRect.getSize().getWidth(), (Float)mSrcRect.getSize().getHeight() ), + mOriDestSize( (Float)mSrcRect.getSize().getWidth(), (Float)mSrcRect.getSize().getHeight() ), + mDestSize( mOriDestSize ), mOffset(0,0), mPixelDensity(1) { @@ -45,7 +47,8 @@ SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const std::st mTexId( TexId ), mTexture( TextureFactory::instance()->getTexture( TexId ) ), mSrcRect( SrcRect ), - mDestSize( (Float)( mSrcRect.Right - mSrcRect.Left ), (Float)( mSrcRect.Bottom - mSrcRect.Top ) ), + mOriDestSize( (Float)( mSrcRect.Right - mSrcRect.Left ), (Float)( mSrcRect.Bottom - mSrcRect.Top ) ), + mDestSize( mOriDestSize ), mOffset(0,0), mPixelDensity(1) { @@ -60,6 +63,7 @@ SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& mTexId( TexId ), mTexture( TextureFactory::instance()->getTexture( TexId ) ), mSrcRect(SrcRect), + mOriDestSize(DestSize), mDestSize(DestSize), mOffset(0,0), mPixelDensity(1) @@ -75,6 +79,7 @@ SubTexture::SubTexture( const Uint32& TexId, const Recti& SrcRect, const Sizef& mTexId( TexId ), mTexture( TextureFactory::instance()->getTexture( TexId ) ), mSrcRect(SrcRect), + mOriDestSize(DestSize), mDestSize(DestSize), mOffset(Offset), mPixelDensity(1) @@ -374,9 +379,8 @@ bool SubTexture::saveToFile(const std::string& filepath, const EE_SAVE_TYPE& For } void SubTexture::resetDestSize() { - Sizei Size = mSrcRect.getSize(); - mDestSize.x = (Float)Size.getWidth() / mPixelDensity * PixelDensity::getPixelDensity(); - mDestSize.y = (Float)Size.getHeight() / mPixelDensity * PixelDensity::getPixelDensity(); + mDestSize.x = mOriDestSize.getWidth(); + mDestSize.y = mOriDestSize.getHeight(); } Float SubTexture::getPixelDensity() const { @@ -385,19 +389,22 @@ Float SubTexture::getPixelDensity() const { void SubTexture::setPixelDensity( const Float & pixelDensity ) { mPixelDensity = pixelDensity; - resetDestSize(); } Sizei SubTexture::getDpSize() { - Sizei Size = mSrcRect.getSize(); - - return Sizei( (Int32)( (Float)Size.getWidth() / mPixelDensity ), (Int32)( (Float)Size.getHeight() / mPixelDensity ) ); + return Sizei( (Int32)( mOriDestSize.getWidth() / mPixelDensity ), (Int32)( mOriDestSize.getHeight() / mPixelDensity ) ); } Sizei SubTexture::getPxSize() { - Sizei Size = mSrcRect.getSize(); + return Sizei( (Int32)( mOriDestSize.getWidth() / mPixelDensity * PixelDensity::getPixelDensity() ), (Int32)( mOriDestSize.getHeight() / mPixelDensity * PixelDensity::getPixelDensity() ) ); +} - return Sizei( (Int32)( (Float)Size.getWidth() / mPixelDensity * PixelDensity::getPixelDensity() ), (Int32)( (Float)Size.getHeight() / mPixelDensity * PixelDensity::getPixelDensity() ) ); +Sizef SubTexture::getOriDestSize() const { + return mOriDestSize; +} + +void SubTexture::setOriDestSize(const Sizef & oriDestSize) { + mOriDestSize = oriDestSize; } }} diff --git a/src/eepp/graphics/textureatlasloader.cpp b/src/eepp/graphics/textureatlasloader.cpp index 7ef46bfb1..7fc41a25a 100644 --- a/src/eepp/graphics/textureatlasloader.cpp +++ b/src/eepp/graphics/textureatlasloader.cpp @@ -301,7 +301,7 @@ bool TextureAtlasLoader::updateTextureAtlas() { tSh->OffsetX = tSubTexture->getOffset().x; tSh->OffsetY = tSubTexture->getOffset().x; tSh->DestWidth = (Int32)tSubTexture->getDestSize().x; - tSh->DestHeight = (Int32)tSubTexture->getDestSize().x; + tSh->DestHeight = (Int32)tSubTexture->getDestSize().y; } } } diff --git a/src/eepp/ui/tools/textureatlaseditor.cpp b/src/eepp/ui/tools/textureatlaseditor.cpp index cac54c4b6..ba64477a5 100644 --- a/src/eepp/ui/tools/textureatlaseditor.cpp +++ b/src/eepp/ui/tools/textureatlaseditor.cpp @@ -135,9 +135,9 @@ void TextureAtlasEditor::onResetDestSize( const UIEvent * Event ) { const UIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( NULL != mCurSubTexture && MouseEvent->getFlags() & EE_BUTTON_LMASK ) { - mCurSubTexture->setDestSize( Sizef( mCurSubTexture->getRealSize().getWidth(), mCurSubTexture->getRealSize().getHeight() ) ); + Sizei RealSize = mCurSubTexture->getDpSize(); - Sizei RealSize = mCurSubTexture->getSize(); + mCurSubTexture->resetDestSize(); mSpinDestW->setValue( RealSize.getWidth() ); mSpinDestH->setValue( RealSize.getHeight() ); @@ -157,7 +157,7 @@ void TextureAtlasEditor::onCenterOffset( const UIEvent * Event ) { const UIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( NULL != mCurSubTexture && MouseEvent->getFlags() & EE_BUTTON_LMASK ) { - Sizei NSize( -( (Int32)mCurSubTexture->getDestSize().x / 2 ), -( (Int32)mCurSubTexture->getDestSize().y / 2 ) ); + Sizei NSize( -( (Int32)mCurSubTexture->getDpSize().x / 2 ), -( (Int32)mCurSubTexture->getDpSize().y / 2 ) ); mSpinOffX->setValue( NSize.x ); mSpinOffY->setValue( NSize.y ); @@ -168,7 +168,7 @@ void TextureAtlasEditor::onHBOffset( const UIEvent * Event ) { const UIEventMouse * MouseEvent = reinterpret_cast ( Event ); if ( NULL != mCurSubTexture && MouseEvent->getFlags() & EE_BUTTON_LMASK ) { - Sizei NSize( -( (Int32)mCurSubTexture->getDestSize().x / 2 ), -(Int32)mCurSubTexture->getDestSize().y ); + Sizei NSize( -( (Int32)mCurSubTexture->getDpSize().x / 2 ), -(Int32)mCurSubTexture->getDpSize().y ); mSpinOffX->setValue( NSize.x ); mSpinOffY->setValue( NSize.y ); @@ -189,13 +189,15 @@ void TextureAtlasEditor::onOffYChange( const UIEvent * Event ) { void TextureAtlasEditor::onDestWChange( const UIEvent * Event ) { if ( NULL != mCurSubTexture ) { - mCurSubTexture->setDestSize( Sizef( (Int32)mSpinDestW->getValue(), mCurSubTexture->getDestSize().y ) ); + mCurSubTexture->setOriDestSize( Sizef( (Int32)mSpinDestW->getValue(), mCurSubTexture->getDpSize().y ) ); + mSubTextureEditor->getGfx()->setSize( (Int32)mSpinDestW->getValue(), mSubTextureEditor->getGfx()->getSize().getHeight() ); } } void TextureAtlasEditor::onDestHChange( const UIEvent * Event ) { if ( NULL != mCurSubTexture ) { - mCurSubTexture->setDestSize( Sizef( mCurSubTexture->getDestSize().x, (Int32)mSpinDestH->getValue() ) ); + mCurSubTexture->setOriDestSize( Sizef( mCurSubTexture->getDpSize().x, (Int32)mSpinDestH->getValue() ) ); + mSubTextureEditor->getGfx()->setSize( mSubTextureEditor->getGfx()->getSize().getWidth(), (Int32)mSpinDestH->getValue() ); } } @@ -316,10 +318,10 @@ void TextureAtlasEditor::onSubTextureChange( const UIEvent * Event ) { if ( NULL != mCurSubTexture ) { mSubTextureEditor->setSubTexture( mCurSubTexture ); - mSpinOffX->setValue( mCurSubTexture->getOffset().x ); - mSpinOffY->setValue( mCurSubTexture->getOffset().y ); - mSpinDestW->setValue( mCurSubTexture->getDestSize().x ); - mSpinDestH->setValue( mCurSubTexture->getDestSize().y ); + mSpinOffX->setValue( PixelDensity::pxToDp( mCurSubTexture->getOffset().x ) ); + mSpinOffY->setValue( PixelDensity::pxToDp( mCurSubTexture->getOffset().y ) ); + mSpinDestW->setValue( mCurSubTexture->getDpSize().x ); + mSpinDestH->setValue( mCurSubTexture->getDpSize().y ); } } } diff --git a/src/eepp/ui/tools/textureatlassubtextureeditor.cpp b/src/eepp/ui/tools/textureatlassubtextureeditor.cpp index 29624eedc..6e8bff589 100644 --- a/src/eepp/ui/tools/textureatlassubtextureeditor.cpp +++ b/src/eepp/ui/tools/textureatlassubtextureeditor.cpp @@ -16,7 +16,11 @@ TextureAtlasSubTextureEditor::TextureAtlasSubTextureEditor( const UIComplexContr mTheme = UIThemeManager::instance()->getDefaultTheme(); - mGfx = mTheme->createGfx( NULL, this ); + mGfx = eeNew( UIGfx, () ); + mGfx->setParent( this ); + mGfx->setVisible( true ); + mGfx->setEnabled( true ); + mGfx->unsetFlags( UI_FIT_TO_CONTROL ); UIDragable::CreateParams DragParams; DragParams.setParent( this ); @@ -25,6 +29,7 @@ TextureAtlasSubTextureEditor::TextureAtlasSubTextureEditor( const UIComplexContr mDrag->setEnabled( true ); mDrag->setVisible( true ); mDrag->setDragEnabled( true ); + mDrag->center(); getCenter(); } @@ -53,6 +58,8 @@ void TextureAtlasSubTextureEditor::update() { if ( NULL != mGfx->getSubTexture() && mDrag->isDragEnabled() && mDrag->isDragging() && Pos != mDrag->getRealPosition() ) { Vector2i Diff = -( Pos - mDrag->getRealPosition() ); + Diff = PixelDensity::pxToDpI( Diff ); + mGfx->getSubTexture()->setOffset( Vector2i( mGfx->getSubTexture()->getOffset().x + Diff.x, mGfx->getSubTexture()->getOffset().y + Diff.y ) ); mEditor->getSpinOffX()->setValue( mGfx->getSubTexture()->getOffset().x ); diff --git a/src/eepp/ui/uigfx.cpp b/src/eepp/ui/uigfx.cpp index c396a1fd7..0a17bfee1 100644 --- a/src/eepp/ui/uigfx.cpp +++ b/src/eepp/ui/uigfx.cpp @@ -103,9 +103,19 @@ void UIGfx::draw() { drawSubTexture(); } } else { + Sizei realOffSet = mSubTexture->getOffset(); + + mSubTexture->setOffset( Vector2i( (Int32)( (Float)realOffSet.x / mSubTexture->getPixelDensity() * PixelDensity::getPixelDensity() ), + (Int32)( (Float)realOffSet.y / mSubTexture->getPixelDensity() * PixelDensity::getPixelDensity() ) + ) ); + + mSubTexture->setDestSize( Vector2f( (Float)mSubTexture->getPxSize().x, (Float)mSubTexture->getPxSize().y ) ); + autoAlign(); drawSubTexture(); + + mSubTexture->setOffset( realOffSet ); } mSubTexture->setDestSize( oDestSize ); diff --git a/src/eepp/ui/uiskincomplex.cpp b/src/eepp/ui/uiskincomplex.cpp index 183428cbc..3c9ff0a49 100644 --- a/src/eepp/ui/uiskincomplex.cpp +++ b/src/eepp/ui/uiskincomplex.cpp @@ -32,19 +32,24 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co if ( 0 == Alpha ) return; - SubTexture * tSubTexture = mSubTexture[ State ][ UpLeft ]; mTempColor = mColor[ State ]; if ( mTempColor.Alpha != Alpha ) { mTempColor.Alpha = (Uint8)( (Float)mTempColor.Alpha * ( (Float)Alpha / 255.f ) ); } + SubTexture * tSubTexture = mSubTexture[ State ][ UpLeft ]; + Sizei uls; if ( NULL != tSubTexture ) { uls = tSubTexture->getPxSize(); + tSubTexture->setDestSize( Vector2f( (Float)uls.getWidth(), (Float)uls.getHeight() ) ); + tSubTexture->draw( X, Y, mTempColor ); + + tSubTexture->resetDestSize(); } tSubTexture = mSubTexture[ State ][ DownLeft ]; @@ -54,7 +59,11 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co if ( NULL != tSubTexture ) { dls = tSubTexture->getPxSize(); + tSubTexture->setDestSize( Vector2f( (Float)dls.getWidth(), (Float)dls.getHeight() ) ); + tSubTexture->draw( X, Y + Height - dls.getHeight(), mTempColor ); + + tSubTexture->resetDestSize(); } tSubTexture = mSubTexture[ State ][ UpRight ]; @@ -64,7 +73,11 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co if ( NULL != tSubTexture ) { urs = tSubTexture->getPxSize(); + tSubTexture->setDestSize( Vector2f( (Float)urs.getWidth(), (Float)urs.getHeight() ) ); + tSubTexture->draw( X + Width - urs.getWidth(), Y, mTempColor ); + + tSubTexture->resetDestSize(); } tSubTexture = mSubTexture[ State ][ DownRight ]; @@ -74,13 +87,17 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co if ( NULL != tSubTexture ) { drs = tSubTexture->getPxSize(); + tSubTexture->setDestSize( Vector2f( (Float)drs.getWidth(), (Float)drs.getHeight() ) ); + tSubTexture->draw( X + Width - drs.getWidth(), Y + Height - drs.getHeight(), mTempColor ); + + tSubTexture->resetDestSize(); } tSubTexture = mSubTexture[ State ][ Left ]; if ( NULL != tSubTexture ) { - tSubTexture->setDestSize( Sizef( tSubTexture->getDestSize().x, Height - uls.getHeight() - dls.getHeight() ) ); + tSubTexture->setDestSize( Sizef( tSubTexture->getPxSize().getWidth(), Height - uls.getHeight() - dls.getHeight() ) ); tSubTexture->draw( X, Y + uls.getHeight(), mTempColor ); @@ -93,7 +110,7 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co tSubTexture = mSubTexture[ State ][ Up ]; if ( NULL != tSubTexture ) { - tSubTexture->setDestSize( Sizef( Width - uls.getWidth() - urs.getWidth(), tSubTexture->getDestSize().y ) ); + tSubTexture->setDestSize( Sizef( Width - uls.getWidth() - urs.getWidth(), tSubTexture->getPxSize().getHeight() ) ); tSubTexture->draw( X + uls.getWidth(), Y, mTempColor ); @@ -112,7 +129,7 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co if ( urs.getWidth() == 0 ) urs.x = tSubTexture->getPxSize().getWidth(); - tSubTexture->setDestSize( Sizef( tSubTexture->getDestSize().x, Height - urs.getHeight() - drs.getHeight() ) ); + tSubTexture->setDestSize( Sizef( tSubTexture->getPxSize().x, Height - urs.getHeight() - drs.getHeight() ) ); tSubTexture->draw( X + Width - tSubTexture->getPxSize().getWidth(), Y + urs.getHeight(), mTempColor ); @@ -122,7 +139,7 @@ void UISkinComplex::draw( const Float& X, const Float& Y, const Float& Width, co tSubTexture = mSubTexture[ State ][ Down ]; if ( NULL != tSubTexture ) { - tSubTexture->setDestSize( Sizef( Width - dls.getWidth() - drs.getWidth(), tSubTexture->getDestSize().y ) ); + tSubTexture->setDestSize( Sizef( Width - dls.getWidth() - drs.getWidth(), tSubTexture->getPxSize().getHeight() ) ); tSubTexture->draw( X + dls.getWidth(), Y + Height - tSubTexture->getPxSize().getHeight(), mTempColor ); diff --git a/src/eepp/ui/uisprite.cpp b/src/eepp/ui/uisprite.cpp index 900054a77..54ac0bb9b 100644 --- a/src/eepp/ui/uisprite.cpp +++ b/src/eepp/ui/uisprite.cpp @@ -60,7 +60,7 @@ void UISprite::draw() { if ( NULL != subTexture ) { Sizef oDestSize = subTexture->getDestSize(); - Sizei pxSize = mSprite->getCurrentSubTexture()->getPxSize(); + Sizei pxSize = subTexture->getPxSize(); subTexture->setDestSize( Sizef( (Float)pxSize.x, (Float)pxSize.y ) ); diff --git a/src/test/eetest.cpp b/src/test/eetest.cpp index c80e07eff..3646d2ef3 100644 --- a/src/test/eetest.cpp +++ b/src/test/eetest.cpp @@ -258,14 +258,14 @@ void EETest::createUI() { mThemeName = "uitheme"; if ( PixelDensity::getPixelDensity() == 2 ) { - mThemeName += "2x"; + //mThemeName += "2x"; } createUIThemeTextureAtlas(); eePRINTL( "Texture Atlas Loading Time: %4.3f ms.", TE.getElapsed().asMilliseconds() ); - UIManager::instance()->init(); //UI_MANAGER_HIGHLIGHT_FOCUS | UI_MANAGER_HIGHLIGHT_OVER + UIManager::instance()->init(); // UI_MANAGER_DRAW_BOXES | UI_MANAGER_HIGHLIGHT_FOCUS | UI_MANAGER_HIGHLIGHT_OVER //mTheme = UITheme::LoadFromPath( eeNew( UIdefaultTheme, ( mThemeName, mThemeName ) ), MyPath + mThemeName + "/" ); @@ -286,7 +286,7 @@ void EETest::createUI() { str[i-1] = "Test ListBox " + String::toStr(i) + " testing it right now!"; } - + /**/ UIControl::CreateParams Params( UIManager::instance()->getMainControl(), Vector2i(0,0), Sizei( 530, 380 ), UI_FILL_BACKGROUND | UI_CLIP_ENABLE | UI_BORDER ); Params.Border.setWidth( 2 ); @@ -587,7 +587,6 @@ void EETest::createUI() { eePRINTL( "CreateUI time: %4.3f ms.", TE.getElapsed().asMilliseconds() ); /**/ - /**/ UIRadioButton * ctrl = eeNew( UIRadioButton, () ); ctrl->setPosition( 100, 100 ); ctrl->setSize( 320, 32 );