Changeset 67


Ignore:
Timestamp:
Jan 23, 2020, 12:58:45 AM (5 years ago)
Author:
chronos
Message:
Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Forms/UFormMain.pas

    r66 r67  
    5656    MoveBuffer: array of TMoveDirection;
    5757    MoveBufferLock: TCriticalSection;
    58     MoveThread: TMoveThread;
    5958    procedure AddToMoveBuffer(Direction: TMoveDirection);
    6059    procedure ProcessMoveBuffer;
    6160  public
     61    MoveThread: TMoveThread;
    6262    procedure Redraw;
    6363    procedure UpdateInterface;
  • trunk/UCore.pas

    r65 r67  
    4242    procedure GamePaint(Sender: TObject);
    4343    procedure GameWin(Sender: TObject);
     44    procedure GameWinSync;
    4445    procedure GameOver(Sender: TObject);
     46    procedure GameOverSync;
    4547  public
    4648    Game: TGame;
     
    191193procedure TCore.GameWin(Sender: TObject);
    192194begin
     195  TThread.Synchronize(FormMain.MoveThread, GameWinSync);
     196end;
     197
     198procedure TCore.GameWinSync;
     199begin
    193200  MessageDlg(SWinCaption, Format(SWinMessage, [Game.GetTileSkinValue(Game.WinTileValue)]), mtInformation, [mbOk], 0);
    194201end;
    195202
    196203procedure TCore.GameOver(Sender: TObject);
     204begin
     205  TThread.Synchronize(FormMain.MoveThread, GameOverSync);
     206end;
     207
     208procedure TCore.GameOverSync;
    197209begin
    198210  MessageDlg(SGameOverCaption, SGameOverMessage, mtInformation, [mbOK], 0);
Note: See TracChangeset for help on using the changeset viewer.