mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-22 21:26:23 +00:00
Core/Misc: update g3dlite lib (#2904)
* Core/Misc: update g3dlite lib * update Co-authored-by: Francesco Borzì <borzifrancesco@gmail.com>
This commit is contained in:
40
deps/g3dlite/source/Vector2int16.cpp
vendored
40
deps/g3dlite/source/Vector2int16.cpp
vendored
@@ -1,10 +1,10 @@
|
||||
/**
|
||||
@file Vector2int16.cpp
|
||||
\file G3D/Vector2int16.cpp
|
||||
|
||||
@author Morgan McGuire, http://graphics.cs.williams.edu
|
||||
\author Morgan McGuire, http://graphics.cs.williams.edu
|
||||
|
||||
@created 2003-08-09
|
||||
@edited 2006-01-29
|
||||
\created 2003-08-09
|
||||
\edited 2011-01-06
|
||||
*/
|
||||
|
||||
#include "G3D/platform.h"
|
||||
@@ -13,9 +13,41 @@
|
||||
#include "G3D/Vector2.h"
|
||||
#include "G3D/BinaryInput.h"
|
||||
#include "G3D/BinaryOutput.h"
|
||||
#include "G3D/Any.h"
|
||||
#include "G3D/Vector2int32.h"
|
||||
|
||||
namespace G3D {
|
||||
|
||||
Vector2int16::Vector2int16(const class Vector2int32& v) : x(v.x), y(v.y) {}
|
||||
|
||||
Vector2int16::Vector2int16(const Any& any) {
|
||||
any.verifyName("Vector2int16", "Point2int16");
|
||||
any.verifyType(Any::TABLE, Any::ARRAY);
|
||||
any.verifySize(2);
|
||||
|
||||
if (any.type() == Any::ARRAY) {
|
||||
x = any[0];
|
||||
y = any[1];
|
||||
} else {
|
||||
// Table
|
||||
x = any["x"];
|
||||
y = any["y"];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Vector2int16& Vector2int16::operator=(const Any& a) {
|
||||
*this = Vector2int16(a);
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
Any Vector2int16::toAny() const {
|
||||
Any any(Any::ARRAY, "Vector2int16");
|
||||
any.append(x, y);
|
||||
return any;
|
||||
}
|
||||
|
||||
Vector2int16::Vector2int16(const class Vector2& v) {
|
||||
x = (int16)iFloor(v.x + 0.5);
|
||||
y = (int16)iFloor(v.y + 0.5);
|
||||
|
||||
Reference in New Issue
Block a user