mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 00:55:20 +02:00
Add support for exiting formspecs by doubleclicking outside
This commit is contained in:
@@ -275,6 +275,21 @@ inline u32 getTime(TimePrecision prec)
|
||||
return 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delta calculation function taking two 32bit arguments.
|
||||
* @param old_time_ms old time for delta calculation (order is relevant!)
|
||||
* @param new_time_ms new time for delta calculation (order is relevant!)
|
||||
* @return positive 32bit delta value
|
||||
*/
|
||||
inline u32 getDeltaMs(u32 old_time_ms, u32 new_time_ms)
|
||||
{
|
||||
if (new_time_ms >= old_time_ms) {
|
||||
return (new_time_ms - old_time_ms);
|
||||
} else {
|
||||
return (old_time_ms - new_time_ms);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(linux) || defined(__linux)
|
||||
#include <sys/prctl.h>
|
||||
|
||||
|
Reference in New Issue
Block a user