DEADSOFTWARE

fixed npot textures
authorKetmar Dark <ketmar@ketmar.no-ip.org>
Thu, 7 Apr 2016 02:37:51 +0000 (05:37 +0300)
committerKetmar Dark <ketmar@ketmar.no-ip.org>
Thu, 7 Apr 2016 02:38:46 +0000 (05:38 +0300)
src/engine/e_textures.pas

index 7c804699660c945fe3e8fdceacba1a94397c2d42..af38f3c3c2e7d7948b5f0439eef28ba94f1b97de 100644 (file)
@@ -116,12 +116,12 @@ begin
   if Format = GL_RGBA then
   begin
     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, tex.glwidth, tex.glheight, 0, GL_RGBA, GL_UNSIGNED_BYTE, nil);
-    glTexSubImage2D(GL_TEXTURE_2D, 0,  0, 0, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, pData);
+    glTexSubImage2D(GL_TEXTURE_2D, 0,  0, tex.glheight-Height, Width, Height, GL_RGBA, GL_UNSIGNED_BYTE, pData);
   end
   else
   begin
     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB, tex.glwidth, tex.glheight, 0, GL_RGB, GL_UNSIGNED_BYTE, nil);
-    glTexSubImage2D(GL_TEXTURE_2D, 0,  0, 0, Width, Height, GL_RGB, GL_UNSIGNED_BYTE, pData);
+    glTexSubImage2D(GL_TEXTURE_2D, 0,  0, tex.glheight-Height, Width, Height, GL_RGB, GL_UNSIGNED_BYTE, pData);
   end;
 
   // the following is ok too