From a01ad865cd431f919b2d177ccfb035ee6c7c1609 Mon Sep 17 00:00:00 2001 From: Yohann Ferreira Date: Sat, 30 Apr 2011 23:35:06 +0200 Subject: De-dustify the get_elapsed-time function documentation a bit. Trivial. --- src/client.cpp | 12 ++++-------- src/client.h | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/client.cpp b/src/client.cpp index 437e1f06..9c5bdde7 100644 --- a/src/client.cpp +++ b/src/client.cpp @@ -153,16 +153,12 @@ Uint32 nextSecond(Uint32 interval, void *param) return interval; } -/** - * @return the elapsed time in milliseconds - * between two tick values. - */ -int get_elapsed_time(int start_time) +int get_elapsed_time(int startTime) { - if (start_time <= tick_time) - return (tick_time - start_time) * MILLISECONDS_IN_A_TICK; + if (startTime <= tick_time) + return (tick_time - startTime) * MILLISECONDS_IN_A_TICK; else - return (tick_time + (MAX_TICK_VALUE - start_time)) + return (tick_time + (MAX_TICK_VALUE - startTime)) * MILLISECONDS_IN_A_TICK; } diff --git a/src/client.h b/src/client.h index 4a0bc750..ba8d6906 100644 --- a/src/client.h +++ b/src/client.h @@ -56,12 +56,21 @@ extern std::string errorMessage; extern LoginData loginData; /** - * Returns elapsed time. (Warning: supposes the delay is always < 100 seconds) + * get_elapsed_time + * + * @param startTime The value to check in client ticks. + * + * @return the elapsed time in milliseconds. + * between startTime and the current client tick value. + * + * @warning This function can't handle delays > 10 seconds. + * @see MILLISECONDS_IN_A_TICK + * @see tick_time */ -int get_elapsed_time(int start_time); +int get_elapsed_time(int startTime); /** - * Returns if this call and the last call were done for the same + * Returns whether this call and the last call were done for the same * selected index and within a short time. */ bool isDoubleClick(int selected); -- cgit v1.2.3-70-g09d2