DEADSOFTWARE

textmap code cleanup
[d2df-sdl.git] / src / game / g_holmes.inc
index e3dd3804062e387e50ab515390ce367d26031214..05576256800f8cbda29ca747148baf856279ae69 100644 (file)
@@ -501,7 +501,9 @@ begin
 
   glDisable(GL_TEXTURE_2D);
   glColor4f(r/255.0, g/255.0, b/255.0, a/255.0);
+
   glLineWidth(1);
+  glPointSize(1);
 
   glBegin(GL_LINES);
     glVertex2i(x1, y1);
@@ -513,23 +515,35 @@ begin
 end;
 
 
+procedure drawRect (x, y, w, h: Integer; r, g, b: Integer; a: Integer=255);
+begin
+  if (w < 0) or (h < 0) then exit;
+  if (w = 1) and (h = 1) then begin drawLine(x, y, x, y, r, g, b, a); exit; end;
+  Inc(w);
+  Inc(h);
+  drawLine(x, y, x+w-1, y, r, g, b, a);
+  drawLine(x+w-1, y+1, x+w-1, y+h-2, r, g, b, a);
+  drawLine(x+w-2, y+h-1, x, y+h-1, r, g, b, a);
+  drawLine(x, y+h-2, x, y+1, r, g, b, a);
+end;
+
+
 // ////////////////////////////////////////////////////////////////////////// //
-procedure shadeRect (x, y, w, h: Integer; a: Integer);
+procedure darkenRect (x, y, w, h: Integer; a: Integer);
 begin
   if (a < 0) then a := 0;
   if (a > 255) then a := 255;
   glEnable(GL_BLEND);
-  glBlendFunc(GL_DST_COLOR, GL_SRC_COLOR);
-  //glBlendFunc(GL_ONE, GL_DST_COLOR);
-  //glBlendEquation(GL_FUNC_SUBTRACT);
+  glBlendFunc(GL_ZERO, GL_SRC_ALPHA);
   glDisable(GL_TEXTURE_2D);
-  glColor4f(0.0, 0.0, a/255.0, 1.0);
+  glColor4f(0.0, 0.0, 0.0, a/255.0);
   glBegin(GL_QUADS);
     glVertex2i(x, y);
     glVertex2i(x+w, y);
     glVertex2i(x+w, y+h);
     glVertex2i(x, y+h);
   glEnd();
+  //glRect(x, y, x+w, y+h);
   glColor4f(1, 1, 1, 1);
   glDisable(GL_BLEND);
   //glBlendEquation(GL_FUNC_ADD);