diff options
author | Michael Drake <tlsa@netsurf-browser.org> | 2021-06-25 18:08:17 +0100 |
---|---|---|
committer | Michael Drake <tlsa@netsurf-browser.org> | 2021-06-25 18:08:17 +0100 |
commit | 407e20578ff0b8c2b3fa534f82b4cf139e914ee0 (patch) | |
tree | ff2809a89bc28ad882aadbe47bcc70311daf650e /frontends | |
parent | 9f3d0126503d0f22ffa6cd3d0d9d907d8d400595 (diff) | |
download | netsurf-407e20578ff0b8c2b3fa534f82b4cf139e914ee0.tar.gz netsurf-407e20578ff0b8c2b3fa534f82b4cf139e914ee0.tar.bz2 |
RISC OS: GUI: Clean up alpha sprite support test.
Diffstat (limited to 'frontends')
-rw-r--r-- | frontends/riscos/gui.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/frontends/riscos/gui.c b/frontends/riscos/gui.c index 3f2a212f2..f9268cac1 100644 --- a/frontends/riscos/gui.c +++ b/frontends/riscos/gui.c @@ -1112,9 +1112,11 @@ static void ro_gui_check_resolvers(void) } /** - * Set global variable for whether the OS version supports alpha channels. + * Determine whether the OS version supports alpha channels. + * + * \return true iff alpha channels are supported, false otherwise. */ -static void ro_gui__check_os_alpha_sprites(void) +static bool ro_gui__os_alpha_sprites_supported(void) { os_error *error; int var_val; @@ -1126,17 +1128,10 @@ static void ro_gui__check_os_alpha_sprites(void) if (error) { NSLOG(netsurf, ERROR, "xos_read_mode_variable: 0x%x: %s", error->errnum, error->errmess); - return; - } - - if (var_val == (1 << 15)) { - os_alpha_sprite_supported = true; - } else { - os_alpha_sprite_supported = false; + return false; } - NSLOG(netsurf, INFO, "OS supports alpha sprites: %s (%i)", - os_alpha_sprite_supported ? "yes" : "no", var_val); + return (var_val == (1 << 15)); } /** @@ -1179,7 +1174,10 @@ static nserror gui_init(int argc, char** argv) * (remember that it's preferable to check for specific features * being present) */ xos_byte(osbyte_IN_KEY, 0, 0xff, &os_version, NULL); - ro_gui__check_os_alpha_sprites(); + + os_alpha_sprite_supported = ro_gui__os_alpha_sprites_supported(); + NSLOG(netsurf, INFO, "OS supports alpha sprites: %s", + os_alpha_sprite_supported ? "yes" : "no"); /* the first release version of the A9home OS is incapable of plotting patterned lines (presumably a fault in the hw acceleration) */ |