static_cast

This commit is contained in:
collecting
2025-09-23 01:10:58 +00:00
parent 8b48af611f
commit bc6a169829

View File

@@ -99,10 +99,10 @@ VkClearColorValue ZBCClear::ConvertColorToVulkan(const std::array<u32, 4>& color
const u32 primary_color = color_u32[0];
// Extract RGBA components (assuming RGBA8888 format)
const u8 r = (primary_color >> 0) & 0xFF;
const u8 g = (primary_color >> 8) & 0xFF;
const u8 b = (primary_color >> 16) & 0xFF;
const u8 a = (primary_color >> 24) & 0xFF;
const u8 r = static_cast<u8>((primary_color >> 0) & 0xFF);
const u8 g = static_cast<u8>((primary_color >> 8) & 0xFF);
const u8 b = static_cast<u8>((primary_color >> 16) & 0xFF);
const u8 a = static_cast<u8>((primary_color >> 24) & 0xFF);
// Convert to normalized float values [0.0, 1.0]
clear_color.float32[0] = static_cast<f32>(r) / 255.0f; // Red