hedgewars/uRender.pas
changeset 4451 1c342980b4aa
parent 4420 6be946bcd17a
child 4452 258945553b18
equal deleted inserted replaced
4450:b8d30b0e4829 4451:1c342980b4aa
    19 procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real);
    19 procedure DrawRotatedTex(Tex: PTexture; hw, hh, X, Y, Dir: LongInt; Angle: real);
    20 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
    20 procedure DrawCentered(X, Top: LongInt; Source: PTexture);
    21 procedure DrawLine(X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte);
    21 procedure DrawLine(X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte);
    22 procedure DrawFillRect(r: TSDL_Rect);
    22 procedure DrawFillRect(r: TSDL_Rect);
    23 procedure DrawCircle(X, Y, Radius, Width: LongInt; r, g, b, a: Byte);
    23 procedure DrawCircle(X, Y, Radius, Width: LongInt; r, g, b, a: Byte);
       
    24 procedure DrawCircle(X, Y, Radius, Width: LongInt);
    24 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
    25 procedure DrawHedgehog(X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
    25 procedure Tint(r, g, b, a: Byte); inline;
    26 procedure Tint(r, g, b, a: Byte); inline;
    26 procedure Tint(c: Longword); inline;
    27 procedure Tint(c: Longword); inline;
    27 
    28 
    28 var
    29 var
   350 Tint($FF, $FF, $FF, $FF);
   351 Tint($FF, $FF, $FF, $FF);
   351 glEnable(GL_TEXTURE_2D)
   352 glEnable(GL_TEXTURE_2D)
   352 end;
   353 end;
   353 
   354 
   354 procedure DrawCircle(X, Y, Radius, Width: LongInt; r, g, b, a: Byte); 
   355 procedure DrawCircle(X, Y, Radius, Width: LongInt; r, g, b, a: Byte); 
       
   356 begin
       
   357     Tint(r, g, b, a);
       
   358     DrawCircle(X, Y, Radius, Width); 
       
   359     Tint($FF, $FF, $FF, $FF);
       
   360 end;
       
   361 
       
   362 procedure DrawCircle(X, Y, Radius, Width: LongInt); 
   355 var
   363 var
   356     i: LongInt;
   364     i: LongInt;
   357     CircleVertex: array [0..359] of TVertex2f;
   365     CircleVertex: array [0..359] of TVertex2f;
   358 begin
   366 begin
   359     for i := 0 to 359 do begin
   367     for i := 0 to 359 do begin
   362     end;
   370     end;
   363     glDisable(GL_TEXTURE_2D);
   371     glDisable(GL_TEXTURE_2D);
   364     glEnable(GL_LINE_SMOOTH);
   372     glEnable(GL_LINE_SMOOTH);
   365     glPushMatrix;
   373     glPushMatrix;
   366     glLineWidth(Width);
   374     glLineWidth(Width);
   367     Tint(r, g, b, a);
       
   368     glVertexPointer(2, GL_FLOAT, 0, @CircleVertex[0]);
   375     glVertexPointer(2, GL_FLOAT, 0, @CircleVertex[0]);
   369     glDrawArrays(GL_LINE_LOOP, 0, 360);
   376     glDrawArrays(GL_LINE_LOOP, 0, 360);
   370     Tint($FF, $FF, $FF, $FF);
       
   371     glPopMatrix;
   377     glPopMatrix;
   372     glEnable(GL_TEXTURE_2D);
   378     glEnable(GL_TEXTURE_2D);
   373     glDisable(GL_LINE_SMOOTH);
   379     glDisable(GL_LINE_SMOOTH);
   374 end;
   380 end;
   375 
   381