Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#5711: Add separate Q3 map writer. Move common double exporter code t…
…o shared header file.
- Loading branch information
1 parent
795f65f
commit 9979ea1
Showing
8 changed files
with
60 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#pragma once | ||
|
||
#include <ostream> | ||
#include "math/FloatTools.h" | ||
|
||
namespace map | ||
{ | ||
|
||
// Writes a double to the given stream and checks for NaN and infinity | ||
inline void writeDoubleSafe(const double d, std::ostream& os) | ||
{ | ||
if (isValid(d)) | ||
{ | ||
if (d == -0.0) | ||
{ | ||
os << 0; // convert -0 to 0 | ||
} | ||
else | ||
{ | ||
os << d; | ||
} | ||
} | ||
else | ||
{ | ||
// Is infinity or NaN, write 0 | ||
os << "0"; | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters