X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Firr_v3d.h;h=49c2e60cebf61ea228553a5ef22f5992ef1d0225;hb=b1e58c9c35ae3eb6167a0745086cdb0ddb1dd9d7;hp=f74d601e8d548036fa74fc4837eb7844474f9569;hpb=4c9a8a91c4988b3567a38af622a3eb0d0ec19f6b;p=dragonfireclient.git diff --git a/src/irr_v3d.h b/src/irr_v3d.h index f74d601e8..49c2e60ce 100644 --- a/src/irr_v3d.h +++ b/src/irr_v3d.h @@ -17,17 +17,30 @@ with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#ifndef IRR_V3D_HEADER -#define IRR_V3D_HEADER - +#pragma once #include "irrlichttypes.h" - #include +#include typedef core::vector3df v3f; +typedef core::vector3d v3d; typedef core::vector3d v3s16; typedef core::vector3d v3u16; typedef core::vector3d v3s32; -#endif - +namespace std +{ +template <> struct hash +{ + typedef v3s16 argument_type; + typedef std::size_t result_type; + result_type operator()(const argument_type &s) const noexcept + { + // clang-format off + return static_cast((static_cast(s.X) << 20) ^ + (static_cast(s.Y) << 10) ^ + (static_cast(s.Z))); + // clang-format on + } +}; +}