diff options
author | Slendi <slendi@socopon.com> | 2023-09-27 21:03:05 +0300 |
---|---|---|
committer | Slendi <slendi@socopon.com> | 2023-09-27 21:03:05 +0300 |
commit | 528add23ba110a02d517ab248e68a522d38bafde (patch) | |
tree | eec9885a9e19ba71d0ef5a94bf2ebbd42666d5ef | |
parent | 1a3b5f7e8027213f40f4afddeae6e6d63de85c42 (diff) |
Format code.
Signed-off-by: Slendi <slendi@socopon.com>
-rw-r--r-- | main.odin | 45 |
1 files changed, 22 insertions, 23 deletions
@@ -7,32 +7,32 @@ L :: intrinsics.constant_utf16_cstring hsv2rgb::proc(H, S, V: f32) -> EFI_GRAPHICS_OUTPUT_BLT_PIXEL{ r, g, b: f32; - h :f32= H / 1; - s :f32= S / 1; - v :f32= V / 1; - - i :int= auto_cast (h * 6); - f :f32= h * 6 - f32(i); - p :f32= v * (1 - s); - q :f32= v * (1 - f * s); - t :f32= v * (1 - (1 - f) * s); + h: f32= H / 1 + s: f32= S / 1 + v: f32= V / 1 + + i: int= auto_cast (h * 6) + f: f32= h * 6 - f32(i) + p: f32= v * (1 - s) + q: f32= v * (1 - f * s) + t: f32= v * (1 - (1 - f) * s) switch (i % 6) { - case 0: r = v; g = t; b = p; break; - case 1: r = q; g = v; b = p; break; - case 2: r = p; g = v; b = t; break; - case 3: r = p; g = q; b = v; break; - case 4: r = t; g = p; b = v; break; - case 5: r = v; g = p; b = q; break; + case 0: r = v; g = t; b = p; break + case 1: r = q; g = v; b = p; break + case 2: r = p; g = v; b = t; break + case 3: r = p; g = q; b = v; break + case 4: r = t; g = p; b = v; break + case 5: r = v; g = p; b = q; break } - color :EFI_GRAPHICS_OUTPUT_BLT_PIXEL - color.Red = auto_cast (r * 255); - color.Green = auto_cast (g * 255); - color.Blue = auto_cast (b * 255); + color: EFI_GRAPHICS_OUTPUT_BLT_PIXEL + color.Red = auto_cast (r * 255) + color.Green = auto_cast (g * 255) + color.Blue = auto_cast (b * 255) color.Reserved = 0xff - return color; + return color } main_ :: proc(efi_handle: rawptr, system_table: ^EfiSystemTable) -> u64 { @@ -68,13 +68,12 @@ main_ :: proc(efi_handle: rawptr, system_table: ^EfiSystemTable) -> u64 { native_move = auto_cast gop.mode.mode num_modes = auto_cast gop.mode.max_mode - pixel: EFI_GRAPHICS_OUTPUT_BLT_PIXEL= { + pixel: EFI_GRAPHICS_OUTPUT_BLT_PIXEL = { 0xff, 0xff, 0xff, 0 } - hue :f32= 0.0 + hue: f32 = 0.0 for { - // Create new color pixel = hsv2rgb(hue, 1, 1) system_table.boot_services.stall(50 * 000); |