No announcement yet.

Possible Bug : OnProcess in TTimer is now unhinged in 1.10

  • Filter
  • Time
  • Show
Clear All
new posts

  • Possible Bug : OnProcess in TTimer is now unhinged in 1.10

    I compiled my current demo project with the new version 1.10 and the OnProcess speed is now unlimited (like 2000+)
    No matter what I use for Ftimer.speed.

    ONLY not setting the Ftimer.speed value will give you the default 60fps. (I was using 120)
    I tried compiling your CubewithTimer example with 1.10. Here just setting the Ftimer.speed value to anything results in a "division by zero" error.

  • #2
    This is a minor bug in Pascal headers. Please open "PXT.Headers.pas", locate the following line:
    procedure TimerSetSpeed(Timer: PTimerRec; Double: Single); cdecl; external AfterwarpLib;
    Please modify it to this:
    procedure TimerSetSpeed(Timer: PTimerRec; Speed: Double); cdecl; external AfterwarpLib;
    In this release, instead of re-building the headers with an automated tool, I manually adjusted them, which seemed faster. However, I've changed a variable name instead of data type. Sorry about that. I'll update Pascal headers with this fix next week.

    P.S. In Afterwarp v1.1, a completely new timing system was introduced (back-ported from Afterwarp v2), but from user stand-point, it should function exactly the same. However, I did modify "Speed" parameter to be "Double", to increase the precision as there is no exact way to represent number like 60 FPS in floating-point.