diff options
author | Tony Wasserka <NeoBrainX@gmail.com> | 2014-12-04 20:41:01 +0100 |
---|---|---|
committer | Tony Wasserka <NeoBrainX@gmail.com> | 2014-12-09 16:37:34 +0100 |
commit | 79bb403089ff91c24b8356ad8d5bc5f7666a0d11 (patch) | |
tree | 83907606411e146ec64434438345d093bee696ca /src/video_core/pica.h | |
parent | Some code cleanup. (diff) | |
download | yuzu-79bb403089ff91c24b8356ad8d5bc5f7666a0d11.tar yuzu-79bb403089ff91c24b8356ad8d5bc5f7666a0d11.tar.gz yuzu-79bb403089ff91c24b8356ad8d5bc5f7666a0d11.tar.bz2 yuzu-79bb403089ff91c24b8356ad8d5bc5f7666a0d11.tar.lz yuzu-79bb403089ff91c24b8356ad8d5bc5f7666a0d11.tar.xz yuzu-79bb403089ff91c24b8356ad8d5bc5f7666a0d11.tar.zst yuzu-79bb403089ff91c24b8356ad8d5bc5f7666a0d11.zip |
Diffstat (limited to 'src/video_core/pica.h')
-rw-r--r-- | src/video_core/pica.h | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/video_core/pica.h b/src/video_core/pica.h index c1f35a011..b463a32ef 100644 --- a/src/video_core/pica.h +++ b/src/video_core/pica.h @@ -131,16 +131,22 @@ struct Regs { }; static unsigned BytesPerPixel(TextureFormat format) { - if (format == TextureFormat::RGBA8) + switch (format) { + case TextureFormat::RGBA8: return 4; - else if (format == TextureFormat::RGB8) + + case TextureFormat::RGB8: return 3; - else if (format == TextureFormat::RGBA5551 || - format == TextureFormat::RGB565 || - format == TextureFormat::RGBA4) + + case TextureFormat::RGBA5551: + case TextureFormat::RGB565: + case TextureFormat::RGBA4: return 2; - else // placeholder + + default: + // placeholder for yet unknown formats return 1; + } } BitField< 0, 1, u32> texturing_enable; |