hedgewars/uMisc.pas
changeset 2630 079ef82eac75
parent 2622 39932161194e
child 2639 8c6044bf1bb8
equal deleted inserted replaced
2629:be70fd3458c0 2630:079ef82eac75
    14  * You should have received a copy of the GNU General Public License
    14  * You should have received a copy of the GNU General Public License
    15  * along with this program; if not, write to the Free Software
    15  * along with this program; if not, write to the Free Software
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
    17  *)
    17  *)
    18 
    18 
       
    19 {$INCLUDE "options.inc"}
       
    20 
    19 unit uMisc;
    21 unit uMisc;
    20 interface
    22 interface
    21 {$INCLUDE "options.inc"}
    23 
    22 uses uConsts, SDLh,
    24 uses uConsts, SDLh,
    23 {$IFDEF GLES11}
    25 {$IFDEF GLES11}
    24 	gles11,
    26 	gles11,
    25 {$ELSE}
    27 {$ELSE}
    26 	GL,
    28 	GL,
   127 	InitStepsFlags: Longword = 0;
   129 	InitStepsFlags: Longword = 0;
   128 
   130 
   129 	RealTicks: Longword = 0;
   131 	RealTicks: Longword = 0;
   130 
   132 
   131 	AttackBar: LongInt = 0; // 0 - none, 1 - just bar at the right-down corner, 2 - like in WWP
   133 	AttackBar: LongInt = 0; // 0 - none, 1 - just bar at the right-down corner, 2 - like in WWP
       
   134 
       
   135 var	i: LongInt;
   132 
   136 
   133 type HwColor4f = record
   137 type HwColor4f = record
   134 	r, g, b, a: byte
   138 	r, g, b, a: byte
   135 	end;
   139 	end;
   136 
   140 
   557 		doSurfaceConversion:= convertedSurf
   561 		doSurfaceConversion:= convertedSurf
   558 	end
   562 	end
   559 	else doSurfaceConversion:= tmpsurf;
   563 	else doSurfaceConversion:= tmpsurf;
   560 end;
   564 end;
   561 
   565 
       
   566 
   562 initialization
   567 initialization
   563 cDrownSpeed.QWordValue:= 257698038;// 0.06
   568 cDrownSpeed.QWordValue:= 257698038;// 0.06
   564 cMaxWindSpeed.QWordValue:= 2147484;// 0.0005
   569 cMaxWindSpeed.QWordValue:= 2147484;// 0.0005
   565 cWindSpeed.QWordValue:= 429496;// 0.0001
   570 cWindSpeed.QWordValue:= 429496;// 0.0001
   566 cGravity:= cMaxWindSpeed;
   571 cGravity:= cMaxWindSpeed;
   569 cVampiric:= false;
   574 cVampiric:= false;
   570 cArtillery:= false;
   575 cArtillery:= false;
   571 
   576 
   572 {$IFDEF DEBUGFILE}
   577 {$IFDEF DEBUGFILE}
   573 {$I-}
   578 {$I-}
   574 f:= stderr;
   579 for i:= 0 to 7 do
   575 rewrite(f);
   580 begin
   576 {$IFNDEF IPHONEOS}
   581 	assign(f, 
   577 if ParamCount <> 0 then
   582 {$IFDEF IPHONEOS}
   578    for i:= 0 to 7 do
   583 	string(get_documents_path())
   579     begin
   584 {$ELSE}
   580       assign(f, ParamStr(1) + '/debug' + inttostr(i) + '.txt');
   585 	ParamStr(1)
   581       rewrite(f);
   586 {$ENDIF}
   582       if IOResult = 0 then break
   587 	+ '/debug' + inttostr(i) + '.txt');
   583     end;
   588 	rewrite(f);
   584 {$ENDIF}
   589 	if IOResult = 5 then
       
   590 	begin
       
   591 		// prevent writing on a directory you do not have permissions on
       
   592 		// should be safe to assume the current directory is writable
       
   593 		assign(f, './debug' + inttostr(i) + '.txt');
       
   594 		rewrite(f);
       
   595 	end;
       
   596 	if IOResult = 0 then break
       
   597 end;
   585 {$I+}
   598 {$I+}
   586 
   599 
   587 finalization
   600 finalization
   588 //uRandom.DumpBuffer;
   601 //uRandom.DumpBuffer;
   589 
   602