DEADSOFTWARE

compiler hint fix
[d2df-sdl.git] / src / engine / e_texture.pas
index c0e6f990dc88ece1edfa033b5e44f1e6893bafdb..4db41dc091005e56b554d52f581c6fc822130758 100644 (file)
@@ -54,7 +54,7 @@ function LoadTextureImg (var img: TImageData; var Texture: GLTexture; var pWidth
 implementation
 
 uses
-  Classes, BinEditor, g_options, utils;
+  Classes, g_options, utils;
 
 
 function AlignP2 (n: Word): Word;
@@ -162,6 +162,10 @@ begin
 
   glBindTexture(GL_TEXTURE_2D, 0);
 
+  // so driver will really upload the texture (this is *sometimes* required for buggy videodrivers)
+  glFlush();
+  glFinish();
+
   Result := true;
 end;
 
@@ -192,7 +196,7 @@ begin
   imageSize := Width*Height*4;
   GetMem(image, imageSize);
   try
-    // it's slow, but i don't care for now
+    // it is slow, but i don't care for now
     ii := image;
     for y := height-1 downto 0 do
     begin
@@ -274,7 +278,7 @@ begin
     imageSize := img.width*img.height*4;
     GetMem(image, imageSize);
     try
-      // it's slow, but i don't care for now
+      // it is slow, but i don't care for now
       ii := image;
       for y := fY+fHeight-1 downto fY do
       begin