From 1eb88d4f5d5cb05d62be1d4a0c88c7399f7c0de0 Mon Sep 17 00:00:00 2001 From: Chris Xiong Date: Sat, 3 Feb 2018 00:55:26 +0800 Subject: Added the GL 3.2+ port. Fixed poor performance of the truetype renderer. (Partially) Fixed texture locking. Minor addition and fixes to the math library. --- smelt/glfw/gfx_glfw.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'smelt/glfw') diff --git a/smelt/glfw/gfx_glfw.cpp b/smelt/glfw/gfx_glfw.cpp index 29841e9..485760d 100644 --- a/smelt/glfw/gfx_glfw.cpp +++ b/smelt/glfw/gfx_glfw.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;iloch;++i)//TODO: flip it... + DWORD *src=ptex->locpx+ptex->locw*ptex->loch, + *dst=ptex->px+(((ptex->rh-ptex->locy-1)*ptex->rw)+ptex->locx); + for(int i=0;iloch;++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 -- cgit v1.2.3