hedgewars/uRender.pas
changeset 10360 c243b6a8ad9a
parent 10354 56bd029245fc
child 10404 1baaab44a0b2
child 10427 dd44d2c8fd0e
equal deleted inserted replaced
10359:744f1151c707 10360:c243b6a8ad9a
    49 procedure DrawCircle            (X, Y, Radius, Width: LongInt);
    49 procedure DrawCircle            (X, Y, Radius, Width: LongInt);
    50 procedure DrawCircle            (X, Y, Radius, Width: LongInt; r, g, b, a: Byte);
    50 procedure DrawCircle            (X, Y, Radius, Width: LongInt; r, g, b, a: Byte);
    51 
    51 
    52 procedure DrawLine              (X0, Y0, X1, Y1, Width: Single; color: LongWord); inline;
    52 procedure DrawLine              (X0, Y0, X1, Y1, Width: Single; color: LongWord); inline;
    53 procedure DrawLine              (X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte);
    53 procedure DrawLine              (X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte);
       
    54 procedure DrawLineOnScreen      (X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte);
    54 procedure DrawRect              (rect: TSDL_Rect; r, g, b, a: Byte; Fill: boolean);
    55 procedure DrawRect              (rect: TSDL_Rect; r, g, b, a: Byte; Fill: boolean);
    55 procedure DrawHedgehog          (X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
    56 procedure DrawHedgehog          (X, Y: LongInt; Dir: LongInt; Pos, Step: LongWord; Angle: real);
    56 procedure DrawScreenWidget      (widget: POnScreenWidget);
    57 procedure DrawScreenWidget      (widget: POnScreenWidget);
    57 procedure DrawWater             (Alpha: byte; OffsetY, OffsetX: LongInt);
    58 procedure DrawWater             (Alpha: byte; OffsetY, OffsetX: LongInt);
    58 procedure DrawWaves             (Dir, dX, dY, oX: LongInt; tnt: Byte);
    59 procedure DrawWaves             (Dir, dX, dY, oX: LongInt; tnt: Byte);
  1091 DrawLine(X0, Y0, X1, Y1, Width, (color shr 24) and $FF, (color shr 16) and $FF, (color shr 8) and $FF, color and $FF)
  1092 DrawLine(X0, Y0, X1, Y1, Width, (color shr 24) and $FF, (color shr 16) and $FF, (color shr 8) and $FF, color and $FF)
  1092 end;
  1093 end;
  1093 
  1094 
  1094 procedure DrawLine(X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte);
  1095 procedure DrawLine(X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte);
  1095 begin
  1096 begin
       
  1097     openglPushMatrix();
       
  1098     openglTranslatef(WorldDx, WorldDy, 0);
       
  1099 
       
  1100     UpdateModelviewProjection;
       
  1101 
       
  1102     DrawLineOnScreen(X0, Y0, X1, Y1, Width, r, g, b, a);
       
  1103 
       
  1104     openglPopMatrix();
       
  1105 end;
       
  1106 
       
  1107 procedure DrawLineOnScreen(X0, Y0, X1, Y1, Width: Single; r, g, b, a: Byte);
       
  1108 begin
  1096     glEnable(GL_LINE_SMOOTH);
  1109     glEnable(GL_LINE_SMOOTH);
  1097 
  1110 
  1098     EnableTexture(False);
  1111     EnableTexture(False);
  1099 
  1112 
  1100     openglPushMatrix;
       
  1101     openglTranslatef(WorldDx, WorldDy, 0);
       
  1102     glLineWidth(Width);
  1113     glLineWidth(Width);
  1103 
       
  1104     UpdateModelviewProjection;
       
  1105 
  1114 
  1106     Tint(r, g, b, a);
  1115     Tint(r, g, b, a);
  1107     VertexBuffer[0].X:= X0;
  1116     VertexBuffer[0].X:= X0;
  1108     VertexBuffer[0].Y:= Y0;
  1117     VertexBuffer[0].Y:= Y0;
  1109     VertexBuffer[1].X:= X1;
  1118     VertexBuffer[1].X:= X1;
  1110     VertexBuffer[1].Y:= Y1;
  1119     VertexBuffer[1].Y:= Y1;
  1111 
  1120 
  1112     SetVertexPointer(@VertexBuffer[0], 2);
  1121     SetVertexPointer(@VertexBuffer[0], 2);
  1113     glDrawArrays(GL_LINES, 0, 2);
  1122     glDrawArrays(GL_LINES, 0, 2);
  1114     untint;
  1123     untint();
  1115 
       
  1116     openglPopMatrix;
       
  1117 
  1124 
  1118     EnableTexture(True);
  1125     EnableTexture(True);
  1119 
  1126 
  1120     glDisable(GL_LINE_SMOOTH);
  1127     glDisable(GL_LINE_SMOOTH);
  1121 end;
  1128 end;