mirror of
https://github.com/ZDoom/Raze.git
synced 2025-05-30 08:51:08 +00:00
- removed templates.h includes.
This commit is contained in:
parent
b02a6a3ec9
commit
6e0fbb2043
84 changed files with 99 additions and 99 deletions
28
source/common/thirdparty/earcut.hpp
vendored
28
source/common/thirdparty/earcut.hpp
vendored
|
@ -132,7 +132,7 @@ private:
|
|||
alloc_traits::deallocate(alloc, allocation, blockSize);
|
||||
}
|
||||
allocations.clear();
|
||||
blockSize = max<std::size_t>(1, newBlockSize);
|
||||
blockSize = std::max<std::size_t>(1, newBlockSize);
|
||||
currentBlock = nullptr;
|
||||
currentIndex = blockSize;
|
||||
}
|
||||
|
@ -184,15 +184,15 @@ void Earcut<N>::operator()(const Polygon& points) {
|
|||
do {
|
||||
x = p->x;
|
||||
y = p->y;
|
||||
minX = min<double>(minX, x);
|
||||
minY = min<double>(minY, y);
|
||||
maxX = max<double>(maxX, x);
|
||||
maxY = max<double>(maxY, y);
|
||||
minX = std::min<double>(minX, x);
|
||||
minY = std::min<double>(minY, y);
|
||||
maxX = std::max<double>(maxX, x);
|
||||
maxY = std::max<double>(maxY, y);
|
||||
p = p->next;
|
||||
} while (p != outerNode);
|
||||
|
||||
// minX, minY and size are later used to transform coords into integers for z-order calculation
|
||||
inv_size = max<double>(maxX - minX, maxY - minY);
|
||||
inv_size = std::max<double>(maxX - minX, maxY - minY);
|
||||
inv_size = inv_size != .0 ? (1. / inv_size) : .0;
|
||||
}
|
||||
|
||||
|
@ -350,10 +350,10 @@ bool Earcut<N>::isEarHashed(Node* ear) {
|
|||
if (area(a, b, c) >= 0) return false; // reflex, can't be an ear
|
||||
|
||||
// triangle bbox; min & max are calculated like this for speed
|
||||
const double minTX = min<double>(a->x, min<double>(b->x, c->x));
|
||||
const double minTY = min<double>(a->y, min<double>(b->y, c->y));
|
||||
const double maxTX = max<double>(a->x, max<double>(b->x, c->x));
|
||||
const double maxTY = max<double>(a->y, max<double>(b->y, c->y));
|
||||
const double minTX = std::min<double>(a->x, std::min<double>(b->x, c->x));
|
||||
const double minTY = std::min<double>(a->y, std::min<double>(b->y, c->y));
|
||||
const double maxTX = std::max<double>(a->x, std::max<double>(b->x, c->x));
|
||||
const double maxTY = std::max<double>(a->y, std::max<double>(b->y, c->y));
|
||||
|
||||
// z-order range for the current triangle bbox;
|
||||
const int32_t minZ = zOrder(minTX, minTY);
|
||||
|
@ -717,10 +717,10 @@ bool Earcut<N>::intersects(const Node* p1, const Node* q1, const Node* p2, const
|
|||
// for collinear points p, q, r, check if point q lies on segment pr
|
||||
template <typename N>
|
||||
bool Earcut<N>::onSegment(const Node* p, const Node* q, const Node* r) {
|
||||
return q->x <= max<double>(p->x, r->x) &&
|
||||
q->x >= min<double>(p->x, r->x) &&
|
||||
q->y <= max<double>(p->y, r->y) &&
|
||||
q->y >= min<double>(p->y, r->y);
|
||||
return q->x <= std::max<double>(p->x, r->x) &&
|
||||
q->x >= std::min<double>(p->x, r->x) &&
|
||||
q->y <= std::max<double>(p->y, r->y) &&
|
||||
q->y >= std::min<double>(p->y, r->y);
|
||||
}
|
||||
|
||||
template <typename N>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue