Add support for floating point main callback rates
This commit is contained in:
committed by
Ryan C. Gordon
parent
06cfea6a03
commit
9e6a6c01e4
@@ -34,9 +34,9 @@ static void SDLCALL MainCallbackRateHintChanged(void *userdata, const char *name
|
||||
if (iterate_after_waitevent) {
|
||||
callback_rate_increment = 0;
|
||||
} else {
|
||||
const int callback_rate = newValue ? SDL_atoi(newValue) : 0;
|
||||
if (callback_rate > 0) {
|
||||
callback_rate_increment = ((Uint64) 1000000000) / ((Uint64) callback_rate);
|
||||
const double callback_rate = newValue ? SDL_atof(newValue) : 0.0;
|
||||
if (callback_rate > 0.0) {
|
||||
callback_rate_increment = (Uint64) ((double) SDL_NS_PER_SECOND / callback_rate);
|
||||
} else {
|
||||
callback_rate_increment = 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user