Style: clang-format: Disable KeepEmptyLinesAtTheStartOfBlocks
Which means that reduz' beloved style which we all became used to will now be changed automatically to remove the first empty line. This makes us lean closer to 1TBS (the one true brace style) instead of hybridating it with some Allman-inspired spacing. There's still the case of braces around single-statement blocks that needs to be addressed (but clang-format can't help with that, but clang-tidy may if we agree about it). Part of #33027.
This commit is contained in:
@ -59,7 +59,6 @@ NoiseTexture::~NoiseTexture() {
|
||||
}
|
||||
|
||||
void NoiseTexture::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("set_width", "width"), &NoiseTexture::set_width);
|
||||
ClassDB::bind_method(D_METHOD("set_height", "height"), &NoiseTexture::set_height);
|
||||
|
||||
@ -88,7 +87,6 @@ void NoiseTexture::_bind_methods() {
|
||||
}
|
||||
|
||||
void NoiseTexture::_validate_property(PropertyInfo &property) const {
|
||||
|
||||
if (property.name == "bump_strength") {
|
||||
if (!as_normalmap) {
|
||||
property.usage = PROPERTY_USAGE_NOEDITOR | PROPERTY_USAGE_INTERNAL;
|
||||
@ -110,7 +108,6 @@ void NoiseTexture::_set_texture_data(const Ref<Image> &p_image) {
|
||||
}
|
||||
|
||||
void NoiseTexture::_thread_done(const Ref<Image> &p_image) {
|
||||
|
||||
_set_texture_data(p_image);
|
||||
Thread::wait_to_finish(noise_thread);
|
||||
memdelete(noise_thread);
|
||||
@ -127,7 +124,6 @@ void NoiseTexture::_thread_function(void *p_ud) {
|
||||
}
|
||||
|
||||
void NoiseTexture::_queue_update() {
|
||||
|
||||
if (update_queued)
|
||||
return;
|
||||
|
||||
@ -136,7 +132,6 @@ void NoiseTexture::_queue_update() {
|
||||
}
|
||||
|
||||
Ref<Image> NoiseTexture::_generate_texture() {
|
||||
|
||||
// Prevent memdelete due to unref() on other thread.
|
||||
Ref<OpenSimplexNoise> ref_noise = noise;
|
||||
|
||||
@ -169,7 +164,6 @@ void NoiseTexture::_update_texture() {
|
||||
use_thread = false;
|
||||
#endif
|
||||
if (use_thread) {
|
||||
|
||||
if (!noise_thread) {
|
||||
noise_thread = Thread::create(_thread_function, this);
|
||||
regen_queued = false;
|
||||
@ -239,7 +233,6 @@ bool NoiseTexture::is_normalmap() {
|
||||
}
|
||||
|
||||
void NoiseTexture::set_bump_strength(float p_bump_strength) {
|
||||
|
||||
if (p_bump_strength == bump_strength)
|
||||
return;
|
||||
bump_strength = p_bump_strength;
|
||||
@ -248,17 +241,14 @@ void NoiseTexture::set_bump_strength(float p_bump_strength) {
|
||||
}
|
||||
|
||||
float NoiseTexture::get_bump_strength() {
|
||||
|
||||
return bump_strength;
|
||||
}
|
||||
|
||||
int NoiseTexture::get_width() const {
|
||||
|
||||
return size.x;
|
||||
}
|
||||
|
||||
int NoiseTexture::get_height() const {
|
||||
|
||||
return size.y;
|
||||
}
|
||||
|
||||
@ -271,6 +261,5 @@ RID NoiseTexture::get_rid() const {
|
||||
}
|
||||
|
||||
Ref<Image> NoiseTexture::get_data() const {
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
#include "core/core_string_names.h"
|
||||
|
||||
OpenSimplexNoise::OpenSimplexNoise() {
|
||||
|
||||
seed = 0;
|
||||
persistence = 0.5;
|
||||
octaves = 3;
|
||||
@ -53,7 +52,6 @@ void OpenSimplexNoise::_init_seeds() {
|
||||
}
|
||||
|
||||
void OpenSimplexNoise::set_seed(int p_seed) {
|
||||
|
||||
if (seed == p_seed)
|
||||
return;
|
||||
|
||||
@ -65,7 +63,6 @@ void OpenSimplexNoise::set_seed(int p_seed) {
|
||||
}
|
||||
|
||||
int OpenSimplexNoise::get_seed() {
|
||||
|
||||
return seed;
|
||||
}
|
||||
|
||||
@ -101,7 +98,6 @@ void OpenSimplexNoise::set_lacunarity(float p_lacunarity) {
|
||||
}
|
||||
|
||||
Ref<Image> OpenSimplexNoise::get_image(int p_width, int p_height) {
|
||||
|
||||
Vector<uint8_t> data;
|
||||
data.resize(p_width * p_height * 4);
|
||||
|
||||
@ -124,7 +120,6 @@ Ref<Image> OpenSimplexNoise::get_image(int p_width, int p_height) {
|
||||
}
|
||||
|
||||
Ref<Image> OpenSimplexNoise::get_seamless_image(int p_size) {
|
||||
|
||||
Vector<uint8_t> data;
|
||||
data.resize(p_size * p_size * 4);
|
||||
|
||||
@ -132,7 +127,6 @@ Ref<Image> OpenSimplexNoise::get_seamless_image(int p_size) {
|
||||
|
||||
for (int i = 0; i < p_size; i++) {
|
||||
for (int j = 0; j < p_size; j++) {
|
||||
|
||||
float ii = (float)i / (float)p_size;
|
||||
float jj = (float)j / (float)p_size;
|
||||
|
||||
@ -161,7 +155,6 @@ Ref<Image> OpenSimplexNoise::get_seamless_image(int p_size) {
|
||||
}
|
||||
|
||||
void OpenSimplexNoise::_bind_methods() {
|
||||
|
||||
ClassDB::bind_method(D_METHOD("get_seed"), &OpenSimplexNoise::get_seed);
|
||||
ClassDB::bind_method(D_METHOD("set_seed", "seed"), &OpenSimplexNoise::set_seed);
|
||||
|
||||
@ -196,12 +189,10 @@ void OpenSimplexNoise::_bind_methods() {
|
||||
}
|
||||
|
||||
float OpenSimplexNoise::get_noise_1d(float x) {
|
||||
|
||||
return get_noise_2d(x, 1.0);
|
||||
}
|
||||
|
||||
float OpenSimplexNoise::get_noise_2d(float x, float y) {
|
||||
|
||||
x /= period;
|
||||
y /= period;
|
||||
|
||||
@ -222,7 +213,6 @@ float OpenSimplexNoise::get_noise_2d(float x, float y) {
|
||||
}
|
||||
|
||||
float OpenSimplexNoise::get_noise_3d(float x, float y, float z) {
|
||||
|
||||
x /= period;
|
||||
y /= period;
|
||||
z /= period;
|
||||
@ -245,7 +235,6 @@ float OpenSimplexNoise::get_noise_3d(float x, float y, float z) {
|
||||
}
|
||||
|
||||
float OpenSimplexNoise::get_noise_4d(float x, float y, float z, float w) {
|
||||
|
||||
x /= period;
|
||||
y /= period;
|
||||
z /= period;
|
||||
|
||||
@ -33,7 +33,6 @@
|
||||
#include "open_simplex_noise.h"
|
||||
|
||||
void register_opensimplex_types() {
|
||||
|
||||
ClassDB::register_class<OpenSimplexNoise>();
|
||||
ClassDB::register_class<NoiseTexture>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user