# HG changeset patch # User nemo # Date 1288541994 14400 # Node ID cfdbddc4b385fc825d7a7fcf2149defe70006ae3 # Parent e3a2a39a82770d16a3d92e41d56e471416799402 making indentation consistent (noticed while debugging) diff -r e3a2a39a8277 -r cfdbddc4b385 hedgewars/hwengine.pas --- a/hedgewars/hwengine.pas Sun Oct 31 00:32:41 2010 -0400 +++ b/hedgewars/hwengine.pas Sun Oct 31 12:19:54 2010 -0400 @@ -267,24 +267,25 @@ LoadLocale(Pathz[ptLocale] + '/en.txt'); // Do an initial load with english if cLocaleFName <> 'en.txt' then - begin + begin // Try two letter locale first before trying specific locale overrides if (Length(cLocaleFName) > 6) and (Copy(cLocaleFName,1,2)+'.txt' <> 'en.txt') then LoadLocale(Pathz[ptLocale] + '/' + Copy(cLocaleFName,1,2)+'.txt'); LoadLocale(Pathz[ptLocale] + '/' + cLocaleFName); - end; + end; WriteLnToConsole(msgGettingConfig); + if recordFileName = '' then - begin + begin InitIPC; SendIPCAndWaitReply('C'); // ask for game config - end + end else - begin + begin LoadRecordFromFile(recordFileName); perfExt_SaveBeganSynching(); - end; + end; ScriptOnGameInit; diff -r e3a2a39a8277 -r cfdbddc4b385 hedgewars/uConsole.pas --- a/hedgewars/uConsole.pas Sun Oct 31 00:32:41 2010 -0400 +++ b/hedgewars/uConsole.pas Sun Oct 31 12:19:54 2010 -0400 @@ -90,22 +90,22 @@ done: boolean; begin {$IFNDEF NOCONSOLE} - {$IFDEF DEBUGFILE}AddFileLog('Console write: ' + s);{$ENDIF} - Write(s); - done:= false; +{$IFDEF DEBUGFILE}AddFileLog('Console write: ' + s);{$ENDIF} +Write(s); +done:= false; - while not done do +while not done do begin - Len:= cLineWidth - Length(ConsoleLines[CurrLine].s); - SetLine(ConsoleLines[CurrLine], ConsoleLines[CurrLine].s + copy(s, 1, Len)); - Delete(s, 1, Len); - if byte(ConsoleLines[CurrLine].s[0]) = cLineWidth then + Len:= cLineWidth - Length(ConsoleLines[CurrLine].s); + SetLine(ConsoleLines[CurrLine], ConsoleLines[CurrLine].s + copy(s, 1, Len)); + Delete(s, 1, Len); + if byte(ConsoleLines[CurrLine].s[0]) = cLineWidth then begin - inc(CurrLine); - if CurrLine = cLinesCount then CurrLine:= 0; - PByte(@ConsoleLines[CurrLine].s)^:= 0 + inc(CurrLine); + if CurrLine = cLinesCount then CurrLine:= 0; + PByte(@ConsoleLines[CurrLine].s)^:= 0 end; - done:= (Length(s) = 0); + done:= (Length(s) = 0); end; {$ENDIF} end; @@ -113,12 +113,12 @@ procedure WriteLnToConsole(s: shortstring); begin {$IFNDEF NOCONSOLE} - WriteToConsole(s); - WriteLn; - inc(CurrLine); - if CurrLine = cLinesCount then - CurrLine:= 0; - PByte(@ConsoleLines[CurrLine].s)^:= 0 +WriteToConsole(s); +WriteLn; +inc(CurrLine); +if CurrLine = cLinesCount then + CurrLine:= 0; +PByte(@ConsoleLines[CurrLine].s)^:= 0 {$ENDIF} end; diff -r e3a2a39a8277 -r cfdbddc4b385 hedgewars/uKeys.pas --- a/hedgewars/uKeys.pas Sun Oct 31 00:32:41 2010 -0400 +++ b/hedgewars/uKeys.pas Sun Oct 31 12:19:54 2010 -0400 @@ -264,15 +264,16 @@ for i:= 6 to cKeyMaxIndex do begin - s:= shortstring(sdl_getkeyname(i)); + s:= shortstring(sdl_getkeyname(i)); //writeln(stdout,inttostr(i) + ': ' + s); - if s = 'unknown key' then KeyNames[i]:= '' - else begin + if s = 'unknown key' then KeyNames[i]:= '' + else + begin for t:= 1 to Length(s) do if s[t] = ' ' then s[t]:= '_'; - KeyNames[i]:= s + KeyNames[i]:= s end; -end; + end; //for i:= 0 to cKeyMaxIndex do writeln(stdout,inttostr(i) + ': ' + KeyNames[i]); diff -r e3a2a39a8277 -r cfdbddc4b385 hedgewars/uMisc.pas --- a/hedgewars/uMisc.pas Sun Oct 31 00:32:41 2010 -0400 +++ b/hedgewars/uMisc.pas Sun Oct 31 12:19:54 2010 -0400 @@ -280,12 +280,12 @@ begin // obsolete? written in WriteLnToConsole() anyway // {$IFDEF DEBUGFILE}AddFileLog(Msg);{$ENDIF} - WriteLnToConsole(Msg); - if isFatalError then +WriteLnToConsole(Msg); +if isFatalError then begin - SendIPC('E' + GetLastConsoleLine); - SDL_Quit; - halt(1) + SendIPC('E' + GetLastConsoleLine); + SDL_Quit; + halt(1) end end;