From 0be6d925dc3c6413bce7a3ccb49631b8e4a6e67a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Thu, 14 May 2020 13:23:58 +0200 Subject: 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. --- modules/jpg/image_loader_jpegd.cpp | 5 ----- modules/jpg/image_loader_jpegd.h | 1 - modules/jpg/register_types.cpp | 2 -- 3 files changed, 8 deletions(-) (limited to 'modules/jpg') diff --git a/modules/jpg/image_loader_jpegd.cpp b/modules/jpg/image_loader_jpegd.cpp index 1a2afeb5b9..16ebd65147 100644 --- a/modules/jpg/image_loader_jpegd.cpp +++ b/modules/jpg/image_loader_jpegd.cpp @@ -37,7 +37,6 @@ #include Error jpeg_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p_buffer_len) { - jpgd::jpeg_decoder_mem_stream mem_stream(p_buffer, p_buffer_len); jpgd::jpeg_decoder decoder(&mem_stream); @@ -102,7 +101,6 @@ Error jpeg_load_image_from_buffer(Image *p_image, const uint8_t *p_buffer, int p } Error ImageLoaderJPG::load_image(Ref p_image, FileAccess *f, bool p_force_linear, float p_scale) { - Vector src_image; int src_image_len = f->get_len(); ERR_FAIL_COND_V(src_image_len == 0, ERR_FILE_CORRUPT); @@ -120,13 +118,11 @@ Error ImageLoaderJPG::load_image(Ref p_image, FileAccess *f, bool p_force } void ImageLoaderJPG::get_recognized_extensions(List *p_extensions) const { - p_extensions->push_back("jpg"); p_extensions->push_back("jpeg"); } static Ref _jpegd_mem_loader_func(const uint8_t *p_png, int p_size) { - Ref img; img.instance(); Error err = jpeg_load_image_from_buffer(img.ptr(), p_png, p_size); @@ -135,6 +131,5 @@ static Ref _jpegd_mem_loader_func(const uint8_t *p_png, int p_size) { } ImageLoaderJPG::ImageLoaderJPG() { - Image::_jpg_mem_loader_func = _jpegd_mem_loader_func; } diff --git a/modules/jpg/image_loader_jpegd.h b/modules/jpg/image_loader_jpegd.h index 9ef37ae303..9aebaad9e3 100644 --- a/modules/jpg/image_loader_jpegd.h +++ b/modules/jpg/image_loader_jpegd.h @@ -34,7 +34,6 @@ #include "core/io/image_loader.h" class ImageLoaderJPG : public ImageFormatLoader { - public: virtual Error load_image(Ref p_image, FileAccess *f, bool p_force_linear, float p_scale); virtual void get_recognized_extensions(List *p_extensions) const; diff --git a/modules/jpg/register_types.cpp b/modules/jpg/register_types.cpp index 61375fef10..b31746f769 100644 --- a/modules/jpg/register_types.cpp +++ b/modules/jpg/register_types.cpp @@ -35,12 +35,10 @@ static ImageLoaderJPG *image_loader_jpg = nullptr; void register_jpg_types() { - image_loader_jpg = memnew(ImageLoaderJPG); ImageLoader::add_image_format_loader(image_loader_jpg); } void unregister_jpg_types() { - memdelete(image_loader_jpg); } -- cgit v1.2.3