mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add support for exiting formspecs by doubleclicking outside
This commit is contained in:
parent
763a511ca5
commit
003634e049
4 changed files with 136 additions and 27 deletions
|
@ -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>
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue