mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2026-10-29 03:54:30 +00:00
backed-map:: moved same_point_may_warn to backed-map.cpp
This commit is contained in:
1 parent
b1fd9bac57
commit
124eb4797f
2 files changed
+17
-17
No files matched your search
@@ -114,6 +114,23 @@ void backed_map::rebase(heptagon*& backer, transmatrix& T) {
|
||||
}
|
||||
}
|
||||
|
||||
EX ld worst_precision_error;
|
||||
|
||||
#if HDR
|
||||
struct hr_precision_error : hr_exception { hr_precision_error() : hr_exception("precision error") {} };
|
||||
#endif
|
||||
|
||||
/** check if a and b are the same, testing for equality. Throw an exception or warning if not sure */
|
||||
EX bool same_point_may_warn(hyperpoint a, hyperpoint b) {
|
||||
ld d = hdist(a, b);
|
||||
if(d > 1e-2) return false;
|
||||
if(d > 1e-3) throw hr_precision_error();
|
||||
if(d > 1e-6 && worst_precision_error <= 1e-6)
|
||||
addMessage("warning: precision errors are building up!");
|
||||
if(d > worst_precision_error) worst_precision_error = d;
|
||||
return true;
|
||||
}
|
||||
|
||||
bool in_hpe = false;
|
||||
|
||||
void backed_map::handle_precision_errors(heptagon *h) {
|
||||
|
||||
Reference in new issue
Block a user