Spooky hash, smarter animqueue diffs

This commit is contained in:
2021-07-18 17:48:39 -04:00
parent 4357fd647f
commit a39eb4a218
14 changed files with 645 additions and 197 deletions

View File

@@ -11,8 +11,16 @@
namespace util {
enum WorldType {
WORLD_TYPE_STANDALONE,
WORLD_TYPE_C_SYNC,
WORLD_TYPE_S_SYNC,
WORLD_TYPE_MASTER,
};
using stringvec = std::vector<std::string>;
using stringset = std::set<std::string>;
using HashValue = std::pair<uint64_t, uint64_t>;
// String to lowercase/uppercase
std::string tolower(std::string input);
@@ -41,12 +49,6 @@ std::string get_file_fingerprint(const std::string &path);
// Calculate distance between two points
double distance_squared(double x1, double y1, double x2, double y2);
// Return a pseudorandom number which is a hash function of A,B,C.
uint32_t hash3(uint32_t a, uint32_t b, uint32_t c);
// Return a pseudorandom float between lo and hi inclusive.
double hash_to_float(double lo, double hi, uint32_t a, uint32_t b, uint32_t c);
// An XYZ coordinate, general purpose.
struct XYZ {
float x, y, z;
@@ -56,6 +58,6 @@ struct XYZ {
bool operator !=(const XYZ &o) const { return x!=o.x || y != o.y || z!=o.z; }
};
std::ostream & operator << (std::ostream &out, const XYZ &xyz);
} // namespace util
#endif // UTIL_HPP