diff --git a/src/graphics/ctextureloader.cpp b/src/graphics/ctextureloader.cpp index ab53df693..48dd6f342 100644 --- a/src/graphics/ctextureloader.cpp +++ b/src/graphics/ctextureloader.cpp @@ -222,10 +222,13 @@ void cTextureLoader::LoadFromPixels() { glBindTexture(GL_TEXTURE_2D, PreviousTexture); if ( tTexId ) { - if ( mIsDDS && mIsDDSCompressed && mSize > 128 ) + if ( mIsDDS && mIsDDSCompressed && mSize > 128 ) { mSize -= 128; // Remove the header size - else - mSize = mWidth * mHeight * mChannels; + } else { + mWidth = width; + mHeight = height; + mSize = mWidth * mHeight * mChannels; + } mTexId = cTextureFactory::instance()->PushTexture( mFilepath, tTexId, mImgWidth, mImgHeight, width, height, mMipmap, mChannels, mClampMode, mCompressTexture || mIsDDSCompressed, mLocalCopy, mSize ); diff --git a/src/test/ee.cpp b/src/test/ee.cpp index 2d3322122..304b1de65 100644 --- a/src/test/ee.cpp +++ b/src/test/ee.cpp @@ -1026,11 +1026,11 @@ void cEETest::LoadTextures() { Cursor[1] = TF->LoadFromPack( &PAK, "cursor.tga" ); CursorP[1] = TF->GetTexture( Cursor[1] ); - //cCursorManager * CurMan = mWindow->GetCursorManager(); - //CurMan->Visible( false ); - //CurMan->Visible( true ); + cCursorManager * CurMan = mWindow->GetCursorManager(); + CurMan->Visible( false ); + //CurMan->Visible( true ); //CurMan->Set( Window::Cursor::SYS_CURSOR_DEFAULT ); - //CurMan->Set( CurMan->Add( CurMan->Create( MyPath + "data/cursor.tga", eeVector2i( 2, 2 ), "cursor_special" ) ) ); + //CurMan->Set( CurMan->Add( CurMan->Create( CursorP[1], eeVector2i( 2, 2 ), "cursor_special" ) ) ); CL1.AddFrame(TN[2]); CL1.Position( 500, 400 ); @@ -1666,7 +1666,7 @@ void cEETest::Process() { else mFontLoader.Update(); - if ( KM->IsKeyUp(KEY_F12) ) mWindow->TakeScreenshot( MyPath + "data/screenshots/" ); //After render and before Display + if ( KM->IsKeyUp(KEY_F12) ) mWindow->TakeScreenshot( MyPath + "data/screenshots/" ); //After render and before Display mWindow->Display(); } while( mWindow->Running() ); diff --git a/src/window/cwindow.cpp b/src/window/cwindow.cpp index 672145fd5..830ee0d88 100644 --- a/src/window/cwindow.cpp +++ b/src/window/cwindow.cpp @@ -88,6 +88,9 @@ void cWindow::CreateView() { } void cWindow::Setup2D( const bool& KeepView ) { + glPixelStorei( GL_UNPACK_ALIGNMENT, 1 ); + glPixelStorei( GL_PACK_ALIGNMENT, 1 ); + BackColor( mWindow.BackgroundColor ); GLi->LineSmooth(); @@ -127,6 +130,8 @@ const eeColor& cWindow::BackColor() const { } bool cWindow::TakeScreenshot( std::string filepath, const EE_SAVE_TYPE& Format ) { + cGlobalBatchRenderer::instance()->Draw(); + bool CreateNewFile = false; std::string File, Ext;