mirror of
https://github.com/minetest/irrlicht.git
synced 2025-07-03 16:50:27 +02:00
Reformat the code, using:
find -type f | # list all regular files grep -E '\.(h|cpp|mm)$' | # filter for source files grep -v '/mt_' | # filter out generated files grep -v '/vendor/' | # and vendored GL grep -v '/test/image_loader_test.cpp' | # and this file (has giant literals arrays) xargs -n 1 -P $(nproc) clang-format -i # reformat everything Co-authored-by: numzero <numzer0@yandex.ru>
This commit is contained in:
@ -6,22 +6,19 @@
|
||||
|
||||
#include "IImageLoader.h"
|
||||
|
||||
#include <cstdio> // required for jpeglib.h
|
||||
#include <cstdio> // required for jpeglib.h
|
||||
#include <jpeglib.h> // use system lib
|
||||
#include <setjmp.h>
|
||||
|
||||
|
||||
namespace irr
|
||||
{
|
||||
namespace video
|
||||
{
|
||||
|
||||
|
||||
//! Surface Loader for JPG images
|
||||
class CImageLoaderJPG : public IImageLoader
|
||||
{
|
||||
public:
|
||||
|
||||
//! constructor
|
||||
CImageLoaderJPG();
|
||||
|
||||
@ -30,13 +27,13 @@ public:
|
||||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
//! based on the file extension (e.g. ".tga")
|
||||
bool isALoadableFileExtension(const io::path& filename) const override;
|
||||
bool isALoadableFileExtension(const io::path &filename) const override;
|
||||
|
||||
//! returns true if the file maybe is able to be loaded by this class
|
||||
bool isALoadableFileFormat(io::IReadFile* file) const override;
|
||||
bool isALoadableFileFormat(io::IReadFile *file) const override;
|
||||
|
||||
//! creates a surface from the file
|
||||
IImage* loadImage(io::IReadFile* file) const override;
|
||||
IImage *loadImage(io::IReadFile *file) const override;
|
||||
|
||||
private:
|
||||
// several methods used via function pointers by jpeglib
|
||||
@ -49,7 +46,7 @@ private:
|
||||
default behavior. Note that if you continue processing, you should
|
||||
clean up the JPEG object with jpeg_abort() or jpeg_destroy().
|
||||
*/
|
||||
static void error_exit (j_common_ptr cinfo);
|
||||
static void error_exit(j_common_ptr cinfo);
|
||||
|
||||
/* output error messages via Irrlicht logger. */
|
||||
static void output_message(j_common_ptr cinfo);
|
||||
@ -58,7 +55,7 @@ private:
|
||||
data is actually read. Unlike init_destination(), it may leave
|
||||
bytes_in_buffer set to 0 (in which case a fill_input_buffer() call
|
||||
will occur immediately). */
|
||||
static void init_source (j_decompress_ptr cinfo);
|
||||
static void init_source(j_decompress_ptr cinfo);
|
||||
|
||||
/* This is called whenever bytes_in_buffer has reached zero and more
|
||||
data is wanted. In typical applications, it should read fresh data
|
||||
@ -69,7 +66,7 @@ private:
|
||||
least one more byte. bytes_in_buffer MUST be set to a positive value
|
||||
if TRUE is returned. A FALSE return should only be used when I/O
|
||||
suspension is desired (this mode is discussed in the next section). */
|
||||
static boolean fill_input_buffer (j_decompress_ptr cinfo);
|
||||
static boolean fill_input_buffer(j_decompress_ptr cinfo);
|
||||
|
||||
/* Skip num_bytes worth of data. The buffer pointer and count should
|
||||
be advanced over num_bytes input bytes, refilling the buffer as
|
||||
@ -79,13 +76,12 @@ private:
|
||||
but it's not clear that being smart is worth much trouble; large
|
||||
skips are uncommon. bytes_in_buffer may be zero on return.
|
||||
A zero or negative skip count should be treated as a no-op. */
|
||||
static void skip_input_data (j_decompress_ptr cinfo, long num_bytes);
|
||||
static void skip_input_data(j_decompress_ptr cinfo, long num_bytes);
|
||||
|
||||
/* Terminate source --- called by jpeg_finish_decompress() after all
|
||||
data has been read. Often a no-op. */
|
||||
static void term_source (j_decompress_ptr cinfo);
|
||||
static void term_source(j_decompress_ptr cinfo);
|
||||
};
|
||||
|
||||
|
||||
} // end namespace video
|
||||
} // end namespace irr
|
||||
|
Reference in New Issue
Block a user