Files
TCPlayerbotCore/src/server/game/Entities/Object/ObjectDefines.h
T

70 lines
1.8 KiB
C

/*
* Copyright (C) 2008-2014 TrinityCore <http://www.trinitycore.org/>
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
* more details.
*
* You should have received a copy of the GNU General Public License along
* with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef TRINITY_OBJECTDEFINES_H
#define TRINITY_OBJECTDEFINES_H
#include "Define.h"
#include "ObjectGuid.h"
// used for creating values for respawn for example
inline uint64 MAKE_PAIR64(uint32 l, uint32 h);
inline uint32 PAIR64_HIPART(uint64 x);
inline uint32 PAIR64_LOPART(uint64 x);
inline uint16 MAKE_PAIR16(uint8 l, uint8 h);
inline uint32 MAKE_PAIR32(uint16 l, uint16 h);
inline uint16 PAIR32_HIPART(uint32 x);
inline uint16 PAIR32_LOPART(uint32 x);
uint64 MAKE_PAIR64(uint32 l, uint32 h)
{
return uint64(l | (uint64(h) << 32));
}
uint32 PAIR64_HIPART(uint64 x)
{
return (uint32)((x >> 32) & UI64LIT(0x00000000FFFFFFFF));
}
uint32 PAIR64_LOPART(uint64 x)
{
return (uint32)(x & UI64LIT(0x00000000FFFFFFFF));
}
uint16 MAKE_PAIR16(uint8 l, uint8 h)
{
return uint16(l | (uint16(h) << 8));
}
uint32 MAKE_PAIR32(uint16 l, uint16 h)
{
return uint32(l | (uint32(h) << 16));
}
uint16 PAIR32_HIPART(uint32 x)
{
return (uint16)((x >> 16) & 0x0000FFFF);
}
uint16 PAIR32_LOPART(uint32 x)
{
return (uint16)(x & 0x0000FFFF);
}
#endif