err, complete previous commit
authorkoda
Fri, 23 Oct 2009 11:12:01 +0000
changeset 2578 ec8e69b23097
parent 2577 275c1b068f68
child 2579 e5e4ebf528b5
err, complete previous commit
hedgewars/uConsole.pas
hedgewars/uIO.pas
hedgewars/uMisc.pas
hedgewars/uStore.pas
--- a/hedgewars/uConsole.pas	Fri Oct 23 11:11:42 2009 +0000
+++ b/hedgewars/uConsole.pas	Fri Oct 23 11:12:01 2009 +0000
@@ -241,12 +241,12 @@
 RegisterVariable('delay'   , vtLongInt, @cInactDelay    , false);
 RegisterVariable('casefreq', vtLongInt, @cCaseFactor    , false);
 RegisterVariable('sd_turns', vtLongInt, @cSuddenDTurns  , false);
-RegisterVariable('damagepct', vtLongInt, @cDamagePercent, false);
+RegisterVariable('damagepct',vtLongInt, @cDamagePercent , false);
 RegisterVariable('landadds', vtLongInt, @cLandAdditions , false);
 RegisterVariable('gmflags' , vtLongInt, @GameFlags      , false);
 RegisterVariable('trflags' , vtLongInt, @TrainingFlags  , false);
 RegisterVariable('turntime', vtLongInt, @cHedgehogTurnTime, false);
-RegisterVariable('minestime', vtLongInt, @cMinesTime, false);
+RegisterVariable('minestime',vtLongInt, @cMinesTime     , false);
 RegisterVariable('fort'    , vtCommand, @chFort         , false);
 RegisterVariable('voicepack',vtCommand, @chVoicepack    , false);
 RegisterVariable('grave'   , vtCommand, @chGrave        , false);
@@ -298,14 +298,14 @@
 RegisterVariable('-voldown', vtCommand, @chVol_p        , true );
 RegisterVariable('findhh'  , vtCommand, @chFindhh       , true );
 RegisterVariable('pause'   , vtCommand, @chPause        , true );
-RegisterVariable('+cur_u'   , vtCommand, @chCurU_p      , true );
-RegisterVariable('-cur_u'   , vtCommand, @chCurU_m      , true );
-RegisterVariable('+cur_d'   , vtCommand, @chCurD_p      , true );
-RegisterVariable('-cur_d'   , vtCommand, @chCurD_m      , true );
-RegisterVariable('+cur_l'   , vtCommand, @chCurL_p      , true );
-RegisterVariable('-cur_l'   , vtCommand, @chCurL_m      , true );
-RegisterVariable('+cur_r'   , vtCommand, @chCurR_p      , true );
-RegisterVariable('-cur_r'   , vtCommand, @chCurR_m      , true );
+RegisterVariable('+cur_u'  , vtCommand, @chCurU_p       , true );
+RegisterVariable('-cur_u'  , vtCommand, @chCurU_m       , true );
+RegisterVariable('+cur_d'  , vtCommand, @chCurD_p       , true );
+RegisterVariable('-cur_d'  , vtCommand, @chCurD_m       , true );
+RegisterVariable('+cur_l'  , vtCommand, @chCurL_p       , true );
+RegisterVariable('-cur_l'  , vtCommand, @chCurL_m       , true );
+RegisterVariable('+cur_r'  , vtCommand, @chCurR_p       , true );
+RegisterVariable('-cur_r'  , vtCommand, @chCurR_m       , true );
 
 finalization
 FreeVariablesList
--- a/hedgewars/uIO.pas	Fri Oct 23 11:11:42 2009 +0000
+++ b/hedgewars/uIO.pas	Fri Oct 23 11:12:01 2009 +0000
@@ -266,7 +266,7 @@
 while (headcmd <> nil)
 	and (tmpflag or (headcmd^.cmd = '#')) // '#' is the only cmd which can be sent within same tick after 'N'
 	and ((GameTicks = hiTicks shl 16 + headcmd^.loTime)
-		or (headcmd^.cmd = 's') // for these commands time isn't specified
+		or (headcmd^.cmd = 's') // for these commands time is not specified
 		or (headcmd^.cmd = '#')
  		or (headcmd^.cmd = 'b')
 		or (headcmd^.cmd = 'F')) do
--- a/hedgewars/uMisc.pas	Fri Oct 23 11:11:42 2009 +0000
+++ b/hedgewars/uMisc.pas	Fri Oct 23 11:12:01 2009 +0000
@@ -164,6 +164,7 @@
 procedure FreeTexture(tex: PTexture);
 function  toPowerOf2(i: Longword): Longword;
 function DecodeBase64(s: shortstring): shortstring;
+function modulo(i: LongInt): LongInt;
 {$IFNDEF IPHONEOS}
 procedure MakeScreenshot(s: shortstring);
 {$ENDIF}
@@ -488,6 +489,14 @@
 byte(DecodeBase64[0]):= t - 1
 end;
 
+function modulo (i: LongInt): LongInt;
+var result: LongInt;
+begin
+if i < 0 then result:= -i
+else result:= i;
+exit(result);
+end;
+
 {$IFNDEF IPHONEOS}
 procedure MakeScreenshot(s: shortstring);
 const head: array[0..8] of Word = (0, 2, 0, 0, 0, 0, 0, 0, 24);
--- a/hedgewars/uStore.pas	Fri Oct 23 11:11:42 2009 +0000
+++ b/hedgewars/uStore.pas	Fri Oct 23 11:12:01 2009 +0000
@@ -918,13 +918,13 @@
 			if ((tmpsurf^.w > MaxTextureSize) or (tmpsurf^.h > MaxTextureSize)) then
 			begin
 				SDL_FreeSurface(tmpsurf);
-				WriteLnToConsole('Image too big, trying to load lowres version: ' + s);
+				AddFileLog('Image too big, trying to load lowres version: ' + s);
 				tmpsurf:= IMG_Load(Str2PChar(s))
 			end;
 		end
 		else
 		begin
-			WriteLnToConsole('Image not found, trying to load lowres version: ' + s);
+			AddFileLog('Image not found, trying to load lowres version: ' + s);
 			tmpsurf:= IMG_Load(Str2PChar(s))
 		end;
 	end;