]> git.ameliathe1st.gay Git - voyage-au-centre-des-fichiers.git/commitdiff
Used assert instead of if ! { halt() }, for consistency
authorAmelia Coutard <eliottulio.coutard@gmail.com>
Fri, 13 May 2022 01:20:57 +0000 (03:20 +0200)
committerAmelia Coutard <eliottulio.coutard@gmail.com>
Fri, 13 May 2022 01:20:57 +0000 (03:20 +0200)
src/fb.cpp

index d7f50c17e023d186c29d996beb8ecbb6a6159adf..ff0beca1bafb797eb7e57e75d6e9168a8bd200be 100644 (file)
@@ -16,14 +16,8 @@ os::framebuffer::framebuffer(std::uint64_t addr, std::uint32_t pitch, std::uint3
        this->width = width;
        this->height = height;
        this->bpp = bpp;
-       if (type != 1) {
-               os::println("framebuffer not in direct RGB mode.");
-               os::halt();
-       }
-       if (bpp != 32) {
-               os::println("framebuffer bpp != 32.");
-               os::halt();
-       }
+       os::assert(type == 1, "Framebuffer not in direct RGB mode.");
+       os::assert(bpp == 32, "Framebuffer bpp != 32.");
 
        r_pos =  color_info[0];
        r_mask = (1 << color_info[1]) - 1;