hedgewars/uMisc.pas
changeset 2171 8208946331ba
parent 2163 12730f5e79b9
child 2210 1cb7118a77dd
equal deleted inserted replaced
2170:aa77f2a6b4f1 2171:8208946331ba
   116 
   116 
   117 	RealTicks: Longword = 0;
   117 	RealTicks: Longword = 0;
   118 
   118 
   119 	AttackBar: LongInt = 0; // 0 - none, 1 - just bar at the right-down corner, 2 - like in WWP
   119 	AttackBar: LongInt = 0; // 0 - none, 1 - just bar at the right-down corner, 2 - like in WWP
   120 
   120 
   121 type HwColor3f = record
   121 type HwColor4f = record
   122 		r, g, b: byte
   122 		r, g, b, a: byte
   123 		end;
   123 		end;
   124 
   124 
   125 var WaterColorArray: array[0..3] of HwColor3f;
   125 var WaterColorArray: array[0..3] of HwColor4f;
   126 
   126 
   127 function hwSign(r: hwFloat): LongInt;
   127 function hwSign(r: hwFloat): LongInt;
   128 function Min(a, b: LongInt): LongInt;
   128 function Min(a, b: LongInt): LongInt;
   129 function Max(a, b: LongInt): LongInt;
   129 function Max(a, b: LongInt): LongInt;
   130 procedure OutError(Msg: String; isFatalError: boolean);
   130 procedure OutError(Msg: String; isFatalError: boolean);
   362 	begin
   362 	begin
   363 		modeIntFormat:= GL_RGB;
   363 		modeIntFormat:= GL_RGB;
   364 		{$IFDEF IPHONEOS}
   364 		{$IFDEF IPHONEOS}
   365 		modeFormat:= GL_BGR;
   365 		modeFormat:= GL_BGR;
   366 		{$ELSE}
   366 		{$ELSE}
   367 		modeFormat:=modeIntFormat;
   367 		modeFormat:= modeIntFormat;
   368 		{$ENDIF}
   368 		{$ENDIF}
   369 	end
   369 	end
   370 else
   370 else
   371 if (surf^.format^.BytesPerPixel = 4) then
   371 if (surf^.format^.BytesPerPixel = 4) then
   372 	begin
   372 	begin
   373 		modeIntFormat:= GL_RGBA;
   373 		modeIntFormat:= GL_RGBA;
   374 		{$IFDEF IPHONEOS}
   374 		{$IFDEF IPHONEOS}
   375 		modeFormat:=GL_BGRA;
   375 		modeFormat:= GL_BGRA;
   376 		{$ELSE}
   376 		{$ELSE}
   377 		modeFormat:=modeIntFormat;
   377 		modeFormat:= modeIntFormat;
   378 		{$ENDIF}
   378 		{$ENDIF}
   379 	end
   379 	end
   380 else
   380 else
   381    begin
   381    begin
   382    TryDo(false, 'Surface2Tex: BytesPerPixel not in [3, 4]', true);
   382    TryDo(false, 'Surface2Tex: BytesPerPixel not in [3, 4]', true);