Skip to content

Commit

Permalink
small fix to memory managment
Browse files Browse the repository at this point in the history
  • Loading branch information
kmkolasinski committed Apr 1, 2015
1 parent a20d042 commit ccbb332
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,5 @@ log.txt


.merge_file_Gs5ohI
Sources/AwesomeBump.pro.user.d869918
Sources/AwesomeBump.pro.user.d869918
Sources/AwesomeBump.pro.user.1ac2611
2 changes: 1 addition & 1 deletion Sources/CommonObjects.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
#define AB_LOG_ALT "log.txt"
#endif

#define AWESOME_BUMP_VERSION "AwesomeBump v3.0.2 "
#define AWESOME_BUMP_VERSION "AwesomeBump v3.0.3 "

using namespace std;

Expand Down
22 changes: 11 additions & 11 deletions Sources/glimageeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,7 @@ void GLImage::render(){
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, vbos[2]);

QGLFramebufferObject* activeFBO = activeImage->fbo;
// create or resize when image was changed
FBOImages::resize(auxFBO1,activeFBO);
FBOImages::resize(auxFBO2,activeFBO);
FBOImages::resize(auxFBO3,activeFBO);
FBOImages::resize(auxFBO4,activeFBO);



bool bTransformUVs = true; // images which depend on others will not be affected by UV changes again
Expand All @@ -247,16 +243,20 @@ void GLImage::render(){
activeImage->resizeFBO(resize_width,resize_height);
// pointers were changed in resize function
activeFBO = activeImage->fbo;
FBOImages::resize(auxFBO1,activeFBO);
FBOImages::resize(auxFBO2,activeFBO);
FBOImages::resize(auxFBO3,activeFBO);
FBOImages::resize(auxFBO4,activeFBO);

bSkipStandardProcessing = true;
break;
default:
break;
}


// create or resize when image was changed
FBOImages::resize(auxFBO1,activeFBO->width(),activeFBO->height());
FBOImages::resize(auxFBO2,activeFBO->width(),activeFBO->height());
FBOImages::resize(auxFBO3,activeFBO->width(),activeFBO->height());
FBOImages::resize(auxFBO4,activeFBO->width(),activeFBO->height());

GLCHK( program->bind() );
GLCHK( program->setUniformValue("gui_image_type", activeImage->imageType) );
GLCHK( program->setUniformValue("gui_depth", float(1.0)) );
Expand Down Expand Up @@ -844,8 +844,8 @@ void GLImage::resizeFBO(int width, int height){
conversionType = CONVERT_RESIZE;
resize_width = width;
resize_height = height;
updateGL();
conversionType = CONVERT_NONE;
//updateGL();
//conversionType = CONVERT_NONE;
}

void GLImage::resetView(){
Expand Down
7 changes: 4 additions & 3 deletions Sources/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1015,8 +1015,9 @@ void MainWindow::applyResizeImage(){
FBOImageProporties* lastActive = glImage->getActiveImage();
glImage->enableShadowRender(true);
for(int i = 0 ; i < MAX_TEXTURES_TYPE ; i++){
updateImage(i);
glImage->resizeFBO(width,height);
updateImage(i);

}
glImage->enableShadowRender(false);
glImage->setActiveImage(lastActive);
Expand All @@ -1034,8 +1035,8 @@ void MainWindow::applyResizeImage(int width, int height){
FBOImageProporties* lastActive = glImage->getActiveImage();
glImage->enableShadowRender(true);
for(int i = 0 ; i < MAX_TEXTURES_TYPE ; i++){
updateImage(i);
glImage->resizeFBO(width,height);
updateImage(i);
}
glImage->enableShadowRender(false);
glImage->setActiveImage(lastActive);
Expand Down Expand Up @@ -1067,8 +1068,8 @@ void MainWindow::applyScaleImage(){
FBOImageProporties* lastActive = glImage->getActiveImage();
glImage->enableShadowRender(true);
for(int i = 0 ; i < MAX_TEXTURES_TYPE ; i++){
updateImage(i);
glImage->resizeFBO(width,height);
updateImage(i);
}
glImage->enableShadowRender(false);
glImage->setActiveImage(lastActive);
Expand Down

0 comments on commit ccbb332

Please sign in to comment.