more tweaking
authorsheepluva
Wed, 18 Jun 2014 17:23:43 +0200
changeset 10328 1eaae604d7a4
parent 10327 c3770d87311b
child 10329 e2dba215655a
child 10330 3ec09243cb55
more tweaking
hedgewars/uRender.pas
--- a/hedgewars/uRender.pas	Wed Jun 18 17:06:40 2014 +0200
+++ b/hedgewars/uRender.pas	Wed Jun 18 17:23:43 2014 +0200
@@ -1148,7 +1148,10 @@
 if Fill then
     glDrawArrays(GL_TRIANGLE_FAN, 0, 4)
 else
+    begin
+    glLineWidth(1);
     glDrawArrays(GL_LINE_LOOP, 0, 4);
+    end;
 
 untint;
 
@@ -1166,18 +1169,23 @@
 procedure DrawCircle(X, Y, Radius, Width: LongInt);
 var
     i: LongInt;
-    CircleVertex: array [0..59] of TVertex2f;
 begin
+    i:= Radius + Width;
+    if isDxAreaOffscreen(X - i, 2 * i) <> 0 then
+        exit;
+    if isDyAreaOffscreen(Y - i, 2 * i) <> 0 then
+        exit;
+
     for i := 0 to 59 do begin
-        CircleVertex[i].X := X + Radius*cos(i*pi/30);
-        CircleVertex[i].Y := Y + Radius*sin(i*pi/30);
+        VertexBuffer[i].X := X + Radius*cos(i*pi/30);
+        VertexBuffer[i].Y := Y + Radius*sin(i*pi/30);
     end;
 
     EnableTexture(False);
     glEnable(GL_LINE_SMOOTH);
     //openglPushMatrix;
     glLineWidth(Width);
-    SetVertexPointer(@CircleVertex[0], 60);
+    SetVertexPointer(@VertexBuffer[0], 60);
     glDrawArrays(GL_LINE_LOOP, 0, 60);
     //openglPopMatrix;
     EnableTexture(True);