From cf7d321b5adfcccb6b4d4155402309a6651e8d19 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 14 Sep 2000 12:28:07 +0000 Subject: Fixed bug when saving image files git-svn-id: http://svn.leocad.org/trunk@115 c7d43263-9d01-0410-8a33-9dba5d9f93d6 --- common/project.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'common/project.cpp') diff --git a/common/project.cpp b/common/project.cpp index 121b0b9..c152e48 100644 --- a/common/project.cpp +++ b/common/project.cpp @@ -2884,7 +2884,7 @@ void Project::CreateImages(LC_IMAGE** images, int width, int height, unsigned sh glReadPixels (0, 0, width, height, GL_RGB, GL_UNSIGNED_BYTE, buf); for (int row = 0; row < height; row++) - memcpy ((unsigned char*)image->bits + (row*width), buf + ((height-row-1)*width), width); + memcpy ((unsigned char*)image->bits + (row*width*3), buf + ((height-row-1)*width*3), width*3); images[i-from] = image; } @@ -3475,7 +3475,7 @@ void Project::HandleCommand(LC_COMMANDS id, unsigned long nParam) glReadPixels (0, 0, cx, cy, GL_RGB,GL_UNSIGNED_BYTE, buf); for (int row = 0; row < cy; row++) - memcpy ((unsigned char*)image->bits + (row*cx), buf + ((cy-row-1)*cx), cx); + memcpy ((unsigned char*)image->bits + (row*cx*3), buf + ((cy-row-1)*cx*3), cx*3); sprintf(fn, "%s%s%s", opts.path, pInfo->m_strName, ext); SaveImage(fn, image, &opts.imdlg.imopts); -- cgit v1.2.3