From: chaoskagami Date: Thu, 1 Sep 2016 16:39:30 +0000 (-0400) Subject: Merge branch 'master' into wip/plainconf X-Git-Tag: v0.3.0~27 X-Git-Url: https://chaos.moe/g/?a=commitdiff_plain;h=e8a60355c9acee8118ab95bb8430692526a91629;p=corbenik%2Fcorbenik.git Merge branch 'master' into wip/plainconf --- e8a60355c9acee8118ab95bb8430692526a91629 diff --cc source/arm11.c index bb57488,d985f9d..acd77c6 --- a/source/arm11.c +++ b/source/arm11.c @@@ -146,11 -146,20 +146,20 @@@ void clearScreens(void) void screen_mode(uint32_t mode) { static uint32_t stride, init_top, init_bottom, bright; - bright = brightness[config->options[OPTION_BRIGHTNESS]]; + bright = brightness[get_opt_u32(OPTION_BRIGHTNESS)]; - stride = 240 * 3; - if (mode == RGBA8) - stride = 240 * 4; + stride = 240; + switch(mode) { + case RGB8: + stride *= 3; + break; + case RGBA8: + stride *= 4; + break; + default: + stride *= 2; + break; + } init_top = MAKE_FRAMEBUFFER_PIXFMT(mode, 0, 1); init_bottom = MAKE_FRAMEBUFFER_PIXFMT(mode, 0, 0);