diff --git a/src/game/g_holmes.inc b/src/game/g_holmes.inc
index c8f2ace0c6dd83b805e28d9366334d587b04434d..a6d38f47873fcc2683c18e8a6b605529d2b1fd5b 100644 (file)
--- a/src/game/g_holmes.inc
+++ b/src/game/g_holmes.inc
*)
// ////////////////////////////////////////////////////////////////////////// //
// cursor (hi, Death Track!)
+const curTexWidth = 32;
+const curTexHeight = 32;
const curWidth = 17;
const curHeight = 23;
begin
if (curtexid <> 0) then exit; //begin glDeleteTextures(1, @curtexid); curtexid := 0; end;
- GetMem(tex, curWidth*curHeight*4);
+ GetMem(tex, curTexWidth*curTexHeight*4);
+ FillChar(tex^, curTexWidth*curTexHeight*4, 0);
tpp := tex;
for y := 0 to curHeight-1 do
begin
+ tpp := tex+(y*(curTexWidth*4));
for x := 0 to curWidth-1 do
begin
c := cursorImg[y*curWidth+x]*4;
//GLfloat[4] bclr = 0.0;
//glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, bclr.ptr);
- glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, curWidth, curHeight, 0, GL_RGBA{gltt}, GL_UNSIGNED_BYTE, tex);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, curTexWidth, curTexHeight, 0, GL_RGBA{gltt}, GL_UNSIGNED_BYTE, tex);
glFlush();
//FreeMem(tex);
Dec(msX, 2);
glBegin(GL_QUADS);
glTexCoord2f(0.0, 0.0); glVertex2i(msX, msY); // top-left
- glTexCoord2f(1.0, 0.0); glVertex2i(msX+curWidth, msY); // top-right
- glTexCoord2f(1.0, 1.0); glVertex2i(msX+curWidth, msY+curHeight); // bottom-right
+ glTexCoord2f(1.0, 0.0); glVertex2i(msX+curTexWidth, msY); // top-right
+ glTexCoord2f(1.0, 1.0); glVertex2i(msX+curTexWidth, msY+curHeight); // bottom-right
glTexCoord2f(0.0, 1.0); glVertex2i(msX, msY+curHeight); // bottom-left
glEnd();
Inc(msX, 2);