Changeset 592 for trunk/Brain.pas


Ignore:
Timestamp:
Aug 10, 2024, 3:40:04 PM (6 weeks ago)
Author:
chronos
Message:
  • Fixed: Avoided more GTK2 chrashes.
  • Fixed: Build StdAI with O1 optimization level to avoid crash.
  • Modified: Code cleanup.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Brain.pas

    r589 r592  
    8484    with Picture.Canvas do begin
    8585      Brush.Color := $904830;
    86       FillRect(Rect(0, 0, 64, 64));
     86      FillRect(Rect(0, 0, Picture.Width, Picture.Height));
    8787      Font.Assign(UniFont[ftTiny]);
    8888      Font.Style := [];
    8989      Font.Color := $5FDBFF;
    9090      TextSize := TextExtent(FileName);
    91       TextOut(32 - TextSize.Width div 2, 32 - TextSize.Height div 2, FileName);
     91      TextOut((Picture.Width - TextSize.Width) div 2,
     92        (Picture.Height - TextSize.Height) div 2, FileName);
    9293    end;
    9394  end;
     
    110111  Flags := fMultiple;
    111112  Client := nil;
    112   Initialized := false;
     113  Initialized := False;
    113114  ServerVersion := 0;
    114115  if not FileExists(AIFileName) then
     
    118119  while not EOF(T) do
    119120  begin
    120     ReadLn(T, s);
    121     s := trim(s);
     121    ReadLn(T, S);
     122    S := Trim(s);
    122123    if Pos(' ', S) > 0 then begin
    123124      Key := Copy(S, 1, Pos(' ', S) - 1);
     
    160161    {$ENDIF}{$ENDIF}
    161162    else if Key = '#GAMEVERSION' then
    162       for i := 1 to Length(Value) do
    163         case Value[i] of
     163      for I := 1 to Length(Value) do
     164        case Value[I] of
    164165          '0' .. '9':
    165166            ServerVersion := ServerVersion and $FFFF00 + ServerVersion and
    166               $FF * 10 + ord(Value[i]) - 48;
     167              $FF * 10 + Ord(Value[I]) - 48;
    167168          '.':
    168169          ServerVersion := ServerVersion shl 8;
Note: See TracChangeset for help on using the changeset viewer.