From 0987464cf99120b6728949496ee41bd14a35b225 Mon Sep 17 00:00:00 2001 From: Keuin Date: Sat, 24 Dec 2022 17:08:15 +0800 Subject: Make it compile with MSVC. --- bitmap.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'bitmap.h') diff --git a/bitmap.h b/bitmap.h index a544b03..ea64c3c 100644 --- a/bitmap.h +++ b/bitmap.h @@ -47,7 +47,7 @@ struct pixel { * For example: Set color depth to 8bit, for normalized color (1, 0.5, 0.25), we get: (255, 127, 63). */ static inline pixel from_normalized(double r, double g, double b) { - return pixel{.r = (T) (mod * r), .g = (T) (mod * g), .b = (T) (mod * b)}; + return pixel{(T) (mod * r), (T) (mod * g), (T) (mod * b)}; } // v3d must be a normalized vector @@ -120,12 +120,12 @@ template< typename = typename std::enable_if::value, S>::type > pixel operator*(S scale, const pixel &pixel) { - return ::pixel < T > {.r=(T) (pixel.r * scale), .g=(T) (pixel.g * scale), .b=(T) (pixel.b * scale)}; + return ::pixel < T > {(T) (pixel.r * scale), (T) (pixel.g * scale), (T) (pixel.b * scale)}; } template pixel operator*(const vec3 &scale, const pixel &pixel) { - return ::pixel < T > {.r=(T) (pixel.r * scale.x), .g=(T) (pixel.g * scale.y), .b=(T) (pixel.b * scale.z)}; + return ::pixel < T > {(T) (pixel.r * scale.x), (T) (pixel.g * scale.y), (T) (pixel.b * scale.z)}; } // Mix two colors a and b. Returns a*u + b*v -- cgit v1.2.3