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:
@ -36,7 +36,6 @@
|
||||
#include "scene/resources/texture.h"
|
||||
|
||||
Error ResourceSaverPNG::save(const String &p_path, const RES &p_resource, uint32_t p_flags) {
|
||||
|
||||
Ref<ImageTexture> texture = p_resource;
|
||||
|
||||
ERR_FAIL_COND_V_MSG(!texture.is_valid(), ERR_INVALID_PARAMETER, "Can't save invalid texture as PNG.");
|
||||
@ -50,7 +49,6 @@ Error ResourceSaverPNG::save(const String &p_path, const RES &p_resource, uint32
|
||||
};
|
||||
|
||||
Error ResourceSaverPNG::save_image(const String &p_path, const Ref<Image> &p_img) {
|
||||
|
||||
Vector<uint8_t> buffer;
|
||||
Error err = PNGDriverCommon::image_to_png(p_img, buffer);
|
||||
ERR_FAIL_COND_V_MSG(err, err, "Can't convert image to PNG.");
|
||||
@ -72,7 +70,6 @@ Error ResourceSaverPNG::save_image(const String &p_path, const Ref<Image> &p_img
|
||||
}
|
||||
|
||||
Vector<uint8_t> ResourceSaverPNG::save_image_to_buffer(const Ref<Image> &p_img) {
|
||||
|
||||
Vector<uint8_t> buffer;
|
||||
Error err = PNGDriverCommon::image_to_png(p_img, buffer);
|
||||
ERR_FAIL_COND_V_MSG(err, Vector<uint8_t>(), "Can't convert image to PNG.");
|
||||
@ -80,19 +77,16 @@ Vector<uint8_t> ResourceSaverPNG::save_image_to_buffer(const Ref<Image> &p_img)
|
||||
}
|
||||
|
||||
bool ResourceSaverPNG::recognize(const RES &p_resource) const {
|
||||
|
||||
return (p_resource.is_valid() && p_resource->is_class("ImageTexture"));
|
||||
}
|
||||
|
||||
void ResourceSaverPNG::get_recognized_extensions(const RES &p_resource, List<String> *p_extensions) const {
|
||||
|
||||
if (Object::cast_to<ImageTexture>(*p_resource)) {
|
||||
p_extensions->push_back("png");
|
||||
}
|
||||
}
|
||||
|
||||
ResourceSaverPNG::ResourceSaverPNG() {
|
||||
|
||||
Image::save_png_func = &save_image;
|
||||
Image::save_png_buffer_func = &save_image_to_buffer;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user