aboutsummaryrefslogtreecommitdiff
path: root/smelt/glfw
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2020-02-14 15:32:41 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2020-02-14 15:32:41 +0800
commit7398bdc3eb0f58cdfa9b588e1c6c8e5ef3797ac6 (patch)
tree46a17c4ed3ac1ac5f2c807c0c625df595db9fd3b /smelt/glfw
parent5861db0193094ac98bc0d0e71bc5b8ecc2590125 (diff)
downloadSMELT-7398bdc3eb0f58cdfa9b588e1c6c8e5ef3797ac6.tar.xz
Fix a incorrect ilConvertImage function call.
Diffstat (limited to 'smelt/glfw')
-rw-r--r--smelt/glfw/gfx_glfw.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/smelt/glfw/gfx_glfw.cpp b/smelt/glfw/gfx_glfw.cpp
index aa5f4bd..cb74a67 100644
--- a/smelt/glfw/gfx_glfw.cpp
+++ b/smelt/glfw/gfx_glfw.cpp
@@ -609,11 +609,11 @@ DWORD* SMELT_IMPL::decodeImage(BYTE *data,const char *fn,DWORD size,int &w,int &
{
w=ilGetInteger(IL_IMAGE_WIDTH);
h=ilGetInteger(IL_IMAGE_HEIGHT);
- if(ilGetInteger(IL_IMAGE_FORMAT)!=IL_UNSIGNED_INT||ilGetInteger(IL_IMAGE_TYPE)!=IL_RGBA)
- ilConvertImage(IL_UNSIGNED_INT,IL_RGBA);
+ if(ilGetInteger(IL_IMAGE_FORMAT)!=IL_UNSIGNED_BYTE||ilGetInteger(IL_IMAGE_TYPE)!=IL_RGBA)
+ ilConvertImage(IL_RGBA,IL_UNSIGNED_BYTE);
px=new DWORD[w*h];
for(int i=0;i<h;++i)
- memcpy(px+w*(h-1-i),ilGetData()+w*i*sizeof(DWORD)/sizeof(ILubyte),w*sizeof(DWORD));
+ ilCopyPixels(0,i,0,w,1,1,IL_RGBA,IL_UNSIGNED_BYTE,px+w*(h-1-i));
}
ilDeleteImages(1,&iid);
ilShutDown();