Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FastNoiseLite: Sync with 1.1.0, clean up SCsub #88526

Merged
merged 1 commit into from
Feb 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion COPYRIGHT.txt
Original file line number Diff line number Diff line change
@@ -397,7 +397,7 @@ License: Expat

Files: ./thirdparty/noise/FastNoiseLite.h
Comment: FastNoise Lite
Copyright: 2020, Jordan Peck and contributors
Copyright: 2023, Jordan Peck and contributors
License: Expat

Files: ./thirdparty/misc/pcg.cpp
17 changes: 0 additions & 17 deletions modules/noise/SCsub
Original file line number Diff line number Diff line change
@@ -5,30 +5,13 @@ Import("env_modules")

env_noise = env_modules.Clone()

# Thirdparty source files

thirdparty_obj = []

thirdparty_dir = "#thirdparty/noise/"
thirdparty_sources = [
# Add C++ source files for noise modules here
]
thirdparty_sources = [thirdparty_dir + file for file in thirdparty_sources]

env_noise.Prepend(CPPPATH=[thirdparty_dir])

env_thirdparty = env_noise.Clone()
env_thirdparty.disable_warnings()
env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
env.modules_sources += thirdparty_obj

# Godot source files

module_obj = []

env_noise.add_source_files(module_obj, "*.cpp")
env_noise.add_source_files(module_obj, "editor/*.cpp")
env.modules_sources += module_obj

# Needed to force rebuilding the module files when the thirdparty library is updated.
env.Depends(module_obj, thirdparty_obj)
2 changes: 1 addition & 1 deletion thirdparty/README.md
Original file line number Diff line number Diff line change
@@ -697,7 +697,7 @@ Files extracted from the upstream source:
## noise

- Upstream: https://github.com/Auburn/FastNoiseLite
- Version: git (6be3d6bf7fb408de341285f9ee8a29b67fd953f1, 2022)
- Version: 1.1.0 (f7af54b56518aa659e1cf9fb103c0b6e36a833d9, 2023)
- License: MIT

Files extracted from the upstream source:
15 changes: 8 additions & 7 deletions thirdparty/noise/FastNoiseLite.h
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// MIT License
//
// Copyright(c) 2020 Jordan Peck (jordan.me2@gmail.com)
// Copyright(c) 2020 Contributors
// Copyright(c) 2023 Jordan Peck (jordan.me2@gmail.com)
// Copyright(c) 2023 Contributors
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files(the "Software"), to deal
@@ -44,15 +44,15 @@
// ....',;:codxkO000OOxdoc:;,''',,,;;;;,''.......',,;:clodkO00000Okxolc::;,,''..',;:ldxOKXNWWWNNK0OkkkkkkkkkkkxxddooooodxxkOOOOO000
// ....',;;clodxkkOOOkkdolc:;,,,,,,,,'..........,;:clodxkO0KKXKK0Okxdolcc::;;,,,;;:codkO0XXNNNNXKK0OOOOOkkkkxxdoollloodxkO0KKKXXXXX
//
// VERSION: 1.0.1
// https://github.com/Auburn/FastNoise
// VERSION: 1.1.0
// https://github.com/Auburn/FastNoiseLite

#ifndef FASTNOISELITE_H
#define FASTNOISELITE_H

#include <cmath>

namespace fastnoiselite{
namespace fastnoiselite {

class FastNoiseLite
{
@@ -2594,5 +2594,6 @@ const T FastNoiseLite::Lookup<T>::RandVecs3D[] =
-0.7870349638f, 0.03447489231f, 0.6159443543f, 0, -0.2015596421f, 0.6859872284f, 0.6991389226f, 0, -0.08581082512f, -0.10920836f, -0.9903080513f, 0, 0.5532693395f, 0.7325250401f, -0.396610771f, 0, -0.1842489331f, -0.9777375055f, -0.1004076743f, 0, 0.0775473789f, -0.9111505856f, 0.4047110257f, 0, 0.1399838409f, 0.7601631212f, -0.6344734459f, 0, 0.4484419361f, -0.845289248f, 0.2904925424f, 0
};

}
#endif // namespace fastnoiselite
} // namespace fastnoiselite

#endif
455 changes: 0 additions & 455 deletions thirdparty/noise/patches/FastNoiseLite.patch

This file was deleted.

43 changes: 43 additions & 0 deletions thirdparty/noise/patches/namespace-warnings.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
diff --git a/thirdparty/noise/FastNoiseLite.h b/thirdparty/noise/FastNoiseLite.h
index ed97b0fcac..fb6dbcb92a 100644
--- a/thirdparty/noise/FastNoiseLite.h
+++ b/thirdparty/noise/FastNoiseLite.h
@@ -52,6 +52,8 @@

#include <cmath>

+namespace fastnoiselite {
+
class FastNoiseLite
{
public:
@@ -1609,6 +1611,12 @@ private:
}
}

+// GCC raises warnings when integer overflows occur, which are needed for hashing here.
+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Waggressive-loop-optimizations"
+#endif
+
template <typename FNfloat>
float SingleCellular(int seed, FNfloat x, FNfloat y, FNfloat z) const
{
@@ -1763,6 +1771,9 @@ private:
}
}

+#if defined(__GNUC__) && !defined(__clang__)
+#pragma GCC diagnostic pop
+#endif

// Perlin Noise

@@ -2583,4 +2594,6 @@ const T FastNoiseLite::Lookup<T>::RandVecs3D[] =
-0.7870349638f, 0.03447489231f, 0.6159443543f, 0, -0.2015596421f, 0.6859872284f, 0.6991389226f, 0, -0.08581082512f, -0.10920836f, -0.9903080513f, 0, 0.5532693395f, 0.7325250401f, -0.396610771f, 0, -0.1842489331f, -0.9777375055f, -0.1004076743f, 0, 0.0775473789f, -0.9111505856f, 0.4047110257f, 0, 0.1399838409f, 0.7601631212f, -0.6344734459f, 0, 0.4484419361f, -0.845289248f, 0.2904925424f, 0
};

+} // namespace fastnoiselite
+
#endif