mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-12 02:28:11 +02:00
Fix warnings in xBRZ
This commit is contained in:
parent
4838b51b9d
commit
b527c0d09e
@ -21,6 +21,10 @@
|
||||
#include <cmath> //std::sqrt
|
||||
#include "xbrz_tools.h"
|
||||
|
||||
#if defined _MSC_VER
|
||||
#pragma warning(disable:5051)
|
||||
#endif
|
||||
|
||||
using namespace xbrz;
|
||||
|
||||
|
||||
@ -333,19 +337,19 @@ DEF_GETTER(d) DEF_GETTER(e) DEF_GETTER(f)
|
||||
DEF_GETTER(g) DEF_GETTER(h) DEF_GETTER(i)
|
||||
#undef DEF_GETTER
|
||||
|
||||
#define DEF_GETTER(x, y) template <> inline uint32_t get_##x<ROT_90>(const Kernel_3x3& ker) { return ker.y; }
|
||||
#define DEF_GETTER(x, y) template <> [[maybe_unused]] inline uint32_t get_##x<ROT_90>(const Kernel_3x3& ker) { return ker.y; }
|
||||
DEF_GETTER(a, g) DEF_GETTER(b, d) DEF_GETTER(c, a)
|
||||
DEF_GETTER(d, h) DEF_GETTER(e, e) DEF_GETTER(f, b)
|
||||
DEF_GETTER(g, i) DEF_GETTER(h, f) DEF_GETTER(i, c)
|
||||
#undef DEF_GETTER
|
||||
|
||||
#define DEF_GETTER(x, y) template <> inline uint32_t get_##x<ROT_180>(const Kernel_3x3& ker) { return ker.y; }
|
||||
#define DEF_GETTER(x, y) template <> [[maybe_unused]] inline uint32_t get_##x<ROT_180>(const Kernel_3x3& ker) { return ker.y; }
|
||||
DEF_GETTER(a, i) DEF_GETTER(b, h) DEF_GETTER(c, g)
|
||||
DEF_GETTER(d, f) DEF_GETTER(e, e) DEF_GETTER(f, d)
|
||||
DEF_GETTER(g, c) DEF_GETTER(h, b) DEF_GETTER(i, a)
|
||||
#undef DEF_GETTER
|
||||
|
||||
#define DEF_GETTER(x, y) template <> inline uint32_t get_##x<ROT_270>(const Kernel_3x3& ker) { return ker.y; }
|
||||
#define DEF_GETTER(x, y) template <> [[maybe_unused]] inline uint32_t get_##x<ROT_270>(const Kernel_3x3& ker) { return ker.y; }
|
||||
DEF_GETTER(a, c) DEF_GETTER(b, f) DEF_GETTER(c, i)
|
||||
DEF_GETTER(d, b) DEF_GETTER(e, e) DEF_GETTER(f, h)
|
||||
DEF_GETTER(g, a) DEF_GETTER(h, d) DEF_GETTER(i, g)
|
||||
@ -709,11 +713,18 @@ void scaleImage(const uint32_t* src, uint32_t* trg, int srcWidth, int srcHeight,
|
||||
//blend all four corners of current pixel
|
||||
if (blendingNeeded(blend_xy))
|
||||
{
|
||||
#ifndef _MSC_VER
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
|
||||
#endif
|
||||
const auto& ker3 = reinterpret_cast<const Kernel_3x3&>(ker4); //"The Things We Do for Perf"
|
||||
blendPixel<Scaler, ColorDistance, ROT_0 >(ker3, out, trgWidth, blend_xy, cfg);
|
||||
blendPixel<Scaler, ColorDistance, ROT_90 >(ker3, out, trgWidth, blend_xy, cfg);
|
||||
blendPixel<Scaler, ColorDistance, ROT_180>(ker3, out, trgWidth, blend_xy, cfg);
|
||||
blendPixel<Scaler, ColorDistance, ROT_270>(ker3, out, trgWidth, blend_xy, cfg);
|
||||
#ifndef _MSC_VER
|
||||
#pragma GCC diagnostic pop
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1353,4 +1364,4 @@ void bilinearScaleAmp(const uint32_t* src, int srcWidth, int srcHeight, //throw
|
||||
});
|
||||
trgView.synchronize(); //throw ?
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user