bug-freedink
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-freedink] Commented Code


From: Chris Murphy
Subject: [Bug-freedink] Commented Code
Date: Sun, 28 Sep 2014 13:30:57 -0400

Hello.  Thanks for working on this wonderful engine.

I was just wondering if a patch to remove old commented sections of code
would be welcome.  These comments would still be available via the
version control system, and removing them from current versions could
make source files smaller and simpler.  For example, in update_frame.c,
there are places like these, in which old solutions are commented out,
followed by newer, cross-platform solutions which are often much
shorter:

    /* Woe: */
    /*  while (thisTickCount - lastTickCount < 12) */
    /*    { */
    /*      Sleep (1); */
    /*      thisTickCount = GetTickCount (); */
    /*    } */

    /* SDL */
    /*  while (thisTickCount - lastTickCount < 12) */
    /*    { */
    /*      SDL_Delay (1); */
    /*      thisTickCount = SDL_GetTicks (); */
    /*    } */

    /* SDL_gfx has a more clever algorithm, which accurately sets
       the framerate to a fixed value. */
        SDL_framerateDelay(&framerate_manager);

We could make the section pithier by simply having:

    /* This SDL_gfx function accurately regulates the framerate. */
    SDL_framerateDelay(&framerate_manager);

Or, since the function's name explains itself pretty well, we could have
only:

    SDL_framerateDelay(&framerate_manager);

If this seems like something that would be good for the code, I would love
to search the code for places like these and make a patch.  What do you
think?



reply via email to

[Prev in Thread] Current Thread [Next in Thread]