Changeset 227


Ignore:
Timestamp:
May 14, 2020, 9:31:00 PM (5 years ago)
Author:
chronos
Message:
  • Fixed: Wrong timeout calculation in movie mode.
  • Fixed: City dialog sound index out of range.
Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Database.pas

    r207 r227  
    2929
    3030  CityOwnTile = 13;
     31
     32type
     33  TGameMode = (moLoading_Fast, moLoading, moMovie, moPlaying);
    3134
    3235var
     
    4548  GTurn: Integer; { current turn }
    4649  GTestFlags: Integer;
    47   Mode: (moLoading_Fast, moLoading, moMovie, moPlaying);
     50  Mode: TGameMode;
    4851  GWonder: array [0 .. 27] of TWonderInfo;
    4952  ServerVersion: array [0 .. nPl - 1] of integer;
  • trunk/LocalPlayer/CityScreen.pas

    r211 r227  
    16571657  end
    16581658  else
     1659  if OpenSoundEvent >= 0 then
    16591660    Play(CityEventSoundItem[OpenSoundEvent]);
    16601661  OpenSoundEvent := -2;
  • trunk/LocalPlayer/MessgEx.pas

    r215 r227  
    212212        Sleep(1);
    213213        Ticks := NowPrecise;
    214       until MovieCancelled or (MillisecondOf(Ticks - Ticks0) >= 1500);
     214      until MovieCancelled or (Round((Ticks - Ticks0) / OneMillisecond) >= 1500);
    215215      Hide;
    216216    end;
     
    373373      begin
    374374        p1 := MyRO.Wonder[IconIndex].EffectiveOwner;
     375        // TODO: Explicitly clear background to black but in fact BitBlt SRCCOPY should do it
     376        Buffer.Canvas.FillRect(0, 0, 1, 1);
    375377        BitBltCanvas(Buffer.Canvas, 0, 0, xSizeBig + 2 * GlowRange,
    376378          ySizeBig + 2 * GlowRange, Canvas,
  • trunk/LocalPlayer/Term.pas

    r220 r227  
    60806080      NoMap.PaintUnit(xMoving - xMin, yMoving - yMin, UnitInfo, 0);
    60816081      PaintBufferToScreen(xMin, yMin, xRange, yRange);
     6082      {$IFDEF LINUX}
     6083      // TODO: Force animation under linux
     6084      Application.ProcessMessages;
     6085      {$ENDIF}
    60826086
    60836087      SliceCount := 0;
     
    60856089      repeat
    60866090        if (SliceCount = 0) or
    6087           (MillisecondOf(Ticks - Ticks0) * 12 * (SliceCount + 1) div SliceCount
     6091          (Round(((Ticks - Ticks0) * 12) / OneMillisecond) * (SliceCount + 1) div SliceCount
    60886092          < MoveTime) then
    60896093        begin
    60906094          if not idle or (GameMode = cMovie) then
    60916095            Application.ProcessMessages;
    6092           {$IFDEF LINUX}
    6093           // TODO: Force animation under linux
    6094           Application.ProcessMessages;
    6095           {$ENDIF}
    60966096          Sleep(1);
    60976097          inc(SliceCount)
    60986098        end;
    60996099        Ticks := NowPrecise;
    6100       until (Ticks - Ticks0) / OneMillisecond * 12 >= MoveTime;
     6100      until (((Ticks - Ticks0) * 12) / OneMillisecond) >= MoveTime;
    61016101      Ticks0 := Ticks
    61026102    end;
     
    65396539          time1 := NowPrecise;
    65406540          SimpleMessage(Format('Map repaint time: %.3f ms',
    6541             [MillisecondOf(time1 - time0)]));
     6541            [(time1 - time0) / OneMillisecond]));
    65426542        end
    65436543    end
Note: See TracChangeset for help on using the changeset viewer.