--- deliantra/server/include/traits.h 2012/11/11 04:29:11 1.29 +++ deliantra/server/include/traits.h 2012/11/12 03:14:32 1.30 @@ -20,6 +20,8 @@ * The authors can be reached via e-mail to */ +/* define traits (actually just types at the moment) for basic types */ + #ifndef TRAITS_H__ #define TRAITS_H__ @@ -34,8 +36,17 @@ typedef int64_t sint64; typedef uint64_t uint64; -typedef uint32_t tick_t; -typedef uint16_t faceidx; +typedef uint32 weight_t; +typedef sint64 volume_t; +typedef uint32 tick_t; +typedef uint16 faceidx; + +inline weight_t +weight_to_kg_approx (weight_t w) +{ + // we divide by 1024, because otherwise we need a 64 bit multiply + return w >> 10; +} const int sint32_digits = 11; // number of digits an sint32 uses max. const int sint64_digits = 20;