diff options
author | Gaktan <igaktan@gmail.com> | 2024-09-15 23:13:24 +0200 |
---|---|---|
committer | Gaktan <igaktan@gmail.com> | 2024-09-15 23:13:24 +0200 |
commit | 453f32ae0ada5cc94bb292d372e6fc5263be4ebe (patch) | |
tree | 0b1c96477cd58bab33a1e9f068fc8e3acd19e3c0 /core | |
parent | 6681f2563b99e14929a8acb27f4908fece398ef1 (diff) | |
download | redot-engine-453f32ae0ada5cc94bb292d372e6fc5263be4ebe.tar.gz |
Fix weird MSVC compilation error
For some reason, MSVC doesn't appreciate uint8 math with enum constants
Diffstat (limited to 'core')
-rw-r--r-- | core/io/image.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/io/image.cpp b/core/io/image.cpp index fcbe483e38..762c735066 100644 --- a/core/io/image.cpp +++ b/core/io/image.cpp @@ -866,12 +866,10 @@ static void _scale_cubic(const uint8_t *__restrict p_src, uint8_t *__restrict p_ template <int CC, typename T> static void _scale_bilinear(const uint8_t *__restrict p_src, uint8_t *__restrict p_dst, uint32_t p_src_width, uint32_t p_src_height, uint32_t p_dst_width, uint32_t p_dst_height) { - enum { - FRAC_BITS = 8, - FRAC_LEN = (1 << FRAC_BITS), - FRAC_HALF = (FRAC_LEN >> 1), - FRAC_MASK = FRAC_LEN - 1 - }; + constexpr uint32_t FRAC_BITS = 8; + constexpr uint32_t FRAC_LEN = (1 << FRAC_BITS); + constexpr uint32_t FRAC_HALF = (FRAC_LEN >> 1); + constexpr uint32_t FRAC_MASK = FRAC_LEN - 1; for (uint32_t i = 0; i < p_dst_height; i++) { // Add 0.5 in order to interpolate based on pixel center |