diff options
Diffstat (limited to 'smelt')
-rw-r--r-- | smelt/glfw/gfx_glfw.cpp | 2 | ||||
-rw-r--r-- | smelt/glfw_m/gfx_glfw.cpp | 2 | ||||
-rw-r--r-- | smelt/sdl/gfx_sdl.cpp | 7 |
3 files changed, 6 insertions, 5 deletions
diff --git a/smelt/glfw/gfx_glfw.cpp b/smelt/glfw/gfx_glfw.cpp index 485760d..5586112 100644 --- a/smelt/glfw/gfx_glfw.cpp +++ b/smelt/glfw/gfx_glfw.cpp @@ -538,7 +538,7 @@ void SMELT_IMPL::smTexutreUnlock(SMTEX tex) if(!ptex->locpx)return; if(!ptex->roloc) { - DWORD *src=ptex->locpx+ptex->locw*ptex->loch, + DWORD *src=ptex->locpx+ptex->locw*(ptex->loch-1), *dst=ptex->px+(((ptex->rh-ptex->locy-1)*ptex->rw)+ptex->locx); for(int i=0;i<ptex->loch;++i) { diff --git a/smelt/glfw_m/gfx_glfw.cpp b/smelt/glfw_m/gfx_glfw.cpp index ebd24bf..41b4d7b 100644 --- a/smelt/glfw_m/gfx_glfw.cpp +++ b/smelt/glfw_m/gfx_glfw.cpp @@ -534,7 +534,7 @@ void SMELT_IMPL::smTexutreUnlock(SMTEX tex) if(!ptex->locpx)return; if(!ptex->roloc) { - DWORD *src=ptex->locpx+ptex->locw*ptex->loch, + DWORD *src=ptex->locpx+ptex->locw*(ptex->loch-1), *dst=ptex->px+(((ptex->rh-ptex->locy-1)*ptex->rw)+ptex->locx); for(int i=0;i<ptex->loch;++i) { diff --git a/smelt/sdl/gfx_sdl.cpp b/smelt/sdl/gfx_sdl.cpp index ae50db2..875f103 100644 --- a/smelt/sdl/gfx_sdl.cpp +++ b/smelt/sdl/gfx_sdl.cpp @@ -538,11 +538,12 @@ void SMELT_IMPL::smTexutreUnlock(SMTEX tex) if(!ptex->locpx)return; if(!ptex->roloc) { - DWORD *src=ptex->locpx,*dst=ptex->px+((ptex->locy*ptex->rw)+ptex->locx); - for(int i=0;i<ptex->loch;++i)//TODO: flip it... + DWORD *src=ptex->locpx+ptex->locw*(ptex->loch-1), + *dst=ptex->px+(((ptex->rh-ptex->locy-1)*ptex->rw)+ptex->locx); + for(int i=0;i<ptex->loch;++i) { memcpy(dst,src,ptex->locw*sizeof(DWORD)); - dst+=ptex->rw;src+=ptex->locw; + dst-=ptex->rw;src-=ptex->locw; } if(ptex->lost)configTexture(ptex,ptex->rw,ptex->rh,ptex->px); else |