Ignore:
Timestamp:
Dec 11, 2000, 8:54:20 AM (25 years ago)
Author:
umoeller
Message:

Coupla bugfixes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/helpers/animate.c

    r14 r15  
    4141#define INCL_DOSDEVICES
    4242#define INCL_DOSDEVIOCTL
     43#define INCL_DOSMISC
    4344#define INCL_DOSERRORS
    4445
     
    5859#include "helpers\animate.h"
    5960
    60 #include "helpers\datetime.h"
    6161#include "helpers\winh.h"
    6262#include "helpers\gpih.h"
     
    8585 *      Returns the count of animation steps that were drawn.
    8686 *      This is dependent on the speed of the system.
     87 *
     88 *@@changed V0.9.7 (2000-12-08) [umoeller]: got rid of dtGetULongTime
    8789 */
    8890
     
    122124        // 2) since large bitmaps take more time to calculate,
    123125        //    the animation won't appear to slow down then
    124         ulInitialTime = dtGetULongTime();
     126        DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT,
     127                        &ulInitialTime,
     128                        sizeof(ulInitialTime));
    125129        ul = 1;
    126130        ulSteps = 1000;
     
    137141                    DBM_STRETCH);
    138142
    139             ulNowTime = dtGetULongTime();
     143            DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT,
     144                            &ulNowTime,
     145                            sizeof(ulNowTime));
    140146
    141147            // recalculate ul: rule of three based on the
     
    175181 *      been acquired using WinGetScreenPS,
    176182 *      ulSteps should be around 40-50.
     183 *
     184 *@@changed V0.9.7 (2000-12-08) [umoeller]: got rid of dtGetULongTime
    177185 */
    178186
     
    195203    ulPhase = 1;
    196204
    197     do {
    198         ULONG ulFromTime = dtGetULongTime();
     205    do
     206    {
     207        ULONG ulFromTime, ulTime2;
     208        DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT,
     209                        &ulFromTime,
     210                        sizeof(ulFromTime));
    199211
    200212        if (ulPhase == 1)
     
    225237            rclNow.yTop = (rclScreen.yTop) - rclNow.yBottom;
    226238
    227             if (rclNow.yBottom > (rclNow.yTop - LAST_WIDTH) ) {
     239            if (rclNow.yBottom > (rclNow.yTop - LAST_WIDTH) )
     240            {
    228241                rclNow.yBottom = (rclScreen.yTop / 2) - LAST_WIDTH;
    229242                rclNow.yTop = (rclScreen.yTop / 2) + LAST_WIDTH;
     
    262275
    263276            // done with "shrinking"?
    264             if ( rclNow.xRight < ((rclScreen.xRight / 2) + LAST_WIDTH) ) {
     277            if ( rclNow.xRight < ((rclScreen.xRight / 2) + LAST_WIDTH) )
    265278                ulPhase = 2; // exit
    266             }
    267 
    268         } else if (ulPhase == 2) {
     279        }
     280        else if (ulPhase == 2)
     281        {
    269282            // Phase 2: draw a horizontal white line about
    270283            // where the last rclNow was. This is only
     
    290303            ul = 0;
    291304
    292         } else if (ulPhase == 3) {
     305        }
     306        else if (ulPhase == 3)
     307        {
    293308            // Phase 3: make the white line shorter with
    294309            // every iteration by drawing black rectangles
     
    324339
    325340            ul++;
    326             if (ul > LAST_STEPS) {
     341            if (ul > LAST_STEPS)
    327342                ulPhase = 99;
    328             }
    329343        }
    330344
    331345        ul++;
    332346
    333         while (dtGetULongTime() < ulFromTime + WAIT_TIME) {
    334             // PSZ p = NULL; // keep compiler happy
    335         }
     347        DosSleep(WAIT_TIME);
     348
     349        /* do
     350        {
     351            DosSleep(0);
     352            DosQuerySysInfo(QSV_MS_COUNT, QSV_MS_COUNT,
     353                            &ulTime2,
     354                            sizeof(ulTime2));
     355        }  while (ulTime2 < ulFromTime + WAIT_TIME); */
    336356    } while (ulPhase != 99);
    337357
Note: See TracChangeset for help on using the changeset viewer.