X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=src%2Firr_v3d.h;h=49c2e60cebf61ea228553a5ef22f5992ef1d0225;hb=b1e58c9c35ae3eb6167a0745086cdb0ddb1dd9d7;hp=21051f93c8bc47327ab104dba519de6118d586f2;hpb=9f031a67594162a53b07acbfbc65faf8c4938e99;p=dragonfireclient.git diff --git a/src/irr_v3d.h b/src/irr_v3d.h index 21051f93c..49c2e60ce 100644 --- a/src/irr_v3d.h +++ b/src/irr_v3d.h @@ -1,6 +1,6 @@ /* -Minetest-c55 -Copyright (C) 2010-2012 celeron55, Perttu Ahola +Minetest +Copyright (C) 2010-2013 celeron55, Perttu Ahola This program is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by @@ -17,16 +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 + } +}; +}