--HG--
branch : dev
This commit is contained in:
Martín Lucas Golini
2017-10-24 01:30:55 -03:00
parent a86e1538f5
commit ec689dd667
6 changed files with 12 additions and 9 deletions

View File

@@ -55,7 +55,7 @@ ColorAf FrameBuffer::getClearColor() const {
void FrameBuffer::clear() {
GLi->clearColor( mClearColor.r, mClearColor.g, mClearColor.b, mClearColor.a );
GLi->clear( GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
GLi->clear( GL_COLOR_BUFFER_BIT | ( mHasDepthBuffer ? GL_DEPTH_BUFFER_BIT : 0 ) );
mWindow->setClearColor( mWindow->getClearColor() );
}

View File

@@ -124,6 +124,7 @@ void ClippingMask::stencilMaskEnable() {
GLi->stencilMask(0xFF);
GLi->stencilFunc(GL_NEVER, 1, 0xFF);
GLi->stencilOp(GL_REPLACE, GL_KEEP, GL_KEEP);
GLi->clear(GL_STENCIL_BUFFER_BIT);
drawMask();

View File

@@ -2,6 +2,7 @@
#include <eepp/maps/mapeditor/mapobjectproperties.hpp>
#include <eepp/maps/gameobjectobject.hpp>
#include <eepp/maps/mapobjectlayer.hpp>
#include <eepp/graphics/renderer/renderer.hpp>
#include <eepp/ui/uimanager.hpp>
#include <eepp/ui/uipopupmenu.hpp>
@@ -100,6 +101,8 @@ void UIMap::update() {
UIWidget::update();
if ( NULL != mMap ) {
invalidateDraw();
mMap->update();
if ( mEnabled && mVisible && isMouseOver() ) {

View File

@@ -214,7 +214,7 @@ void TileMap::draw() {
GlobalBatchRenderer::instance()->draw();
if ( getClipedArea() ) {
GLi->getClippingMask()->clipEnable( mScreenPos.x, mScreenPos.y, mViewSize.x, mViewSize.y );
GLi->getClippingMask()->clipPlaneEnable( mScreenPos.x, mScreenPos.y, mViewSize.x, mViewSize.y );
}
if ( getDrawBackground() ) {
@@ -227,9 +227,6 @@ void TileMap::draw() {
P.setColor( Color( 255, 255, 255, 255 ) );
}
float oldM[16];
GLi->getCurrentMatrix( GL_MODELVIEW_MATRIX, oldM );
GLi->loadIdentity();
GLi->pushMatrix();
GLi->translatef( (Float)static_cast<Int32>( mScreenPos.x + mOffset.x ), (Float)static_cast<Int32>( mScreenPos.y + mOffset.y ), 0 );
GLi->scalef( mScale, mScale, 0 );
@@ -249,10 +246,9 @@ void TileMap::draw() {
GlobalBatchRenderer::instance()->draw();
GLi->popMatrix();
GLi->loadMatrixf( oldM );
if ( getClipedArea() ) {
GLi->getClippingMask()->clipDisable();
GLi->getClippingMask()->clipPlaneDisable();
}
}

View File

@@ -5,6 +5,7 @@
#include <eepp/graphics/framebuffer.hpp>
#include <eepp/graphics/renderer/renderer.hpp>
#include <eepp/graphics/subtexture.hpp>
#include <eepp/graphics/globalbatchrenderer.hpp>
#include <eepp/ui/uilinearlayout.hpp>
#include <eepp/ui/uirelativelayout.hpp>
#include <eepp/helper/pugixml/pugixml.hpp>
@@ -1075,6 +1076,8 @@ void UIWindow::matrixSet() {
void UIWindow::matrixUnset() {
if ( ownsFrameBuffer() ) {
GlobalBatchRenderer::instance()->draw();
GLi->translatef( mScreenPos.x , mScreenPos.y, 0.f );
mFrameBuffer->unbind();

View File

@@ -296,7 +296,7 @@ void EETest::createUI() {
Uint32 UI_MAN_OPS = 0;
if ( mDebugUI )
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);
UIManager::instance()->init(UI_MAN_OPS | UI_MANAGER_USE_DRAW_INVALIDATION);
UIManager::instance()->setTranslator( mTranslator );
//mTheme = UITheme::loadFromFile( UIThemeDefault::New( mThemeName, mThemeName ), MyPath + "ui/" + mThemeName + "/" );
@@ -848,7 +848,7 @@ static void onWinDragStop( const UIEvent * event ) {
void EETest::createDecoratedWindow() {
mUIWindow = UIWindow::New();
mUIWindow->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_SHADOW /*| UI_WIN_FRAME_BUFFER*/ )
mUIWindow->setWinFlags( UI_WIN_DEFAULT_FLAGS | UI_WIN_MAXIMIZE_BUTTON | UI_WIN_SHADOW | UI_WIN_FRAME_BUFFER )
->setMinWindowSize( 530, 350 )->setPosition( 200, 50 );
mUIWindow->addEventListener( UIEvent::OnWindowCloseClick, cb::Make1( this, &EETest::onCloseClick ) );