diff options
author | Adrian Lees <adrian@aemulor.com> | 2006-03-25 06:21:21 +0000 |
---|---|---|
committer | Adrian Lees <adrian@aemulor.com> | 2006-03-25 06:21:21 +0000 |
commit | 29802d84045b208b398efcedf847625251a9aad8 (patch) | |
tree | 1002e3b652c7371d24deb5402b6a7f3c1bb4f694 /riscos/buffer.c | |
parent | 74a86c37510ffdc13b2ab30f40455758e69eb35f (diff) | |
download | netsurf-29802d84045b208b398efcedf847625251a9aad8.tar.gz netsurf-29802d84045b208b398efcedf847625251a9aad8.tar.bz2 |
[project @ 2006-03-25 06:21:21 by adrianl]
Correct operation in non-square 32bpp modes
svn path=/import/netsurf/; revision=2160
Diffstat (limited to 'riscos/buffer.c')
-rw-r--r-- | riscos/buffer.c | 58 |
1 files changed, 27 insertions, 31 deletions
diff --git a/riscos/buffer.c b/riscos/buffer.c index b062e13cb..699b1e49f 100644 --- a/riscos/buffer.c +++ b/riscos/buffer.c @@ -125,42 +125,38 @@ void ro_gui_buffer_open(wimp_draw *redraw) { #ifdef BUFFER_EMULATE_32BPP mode = tinct_SPRITE_MODE; #else - if (bpp == 5) { - mode = tinct_SPRITE_MODE; - } else { - if ((error = xwimpreadsysinfo_wimp_mode(&mode)) != NULL) { - LOG(("Error reading mode '%s'", error->errmess)); + if ((error = xwimpreadsysinfo_wimp_mode(&mode)) != NULL) { + LOG(("Error reading mode '%s'", error->errmess)); + ro_gui_buffer_free(); + return; + } + + /* if we're not in a numbered screen mode then we need + to build a suitable sprite mode word */ + if (mode >= (os_mode)0x100) { + const os_VDU_VAR_LIST(4) vars = { + { os_MODEVAR_LOG2_BPP, + os_MODEVAR_XEIG_FACTOR, + os_MODEVAR_YEIG_FACTOR, + os_VDUVAR_END_LIST } + }; + int xeig, yeig; + int vals[4]; + int type; + + error = xos_read_vdu_variables((const os_vdu_var_list*)&vars, vals); + if (error) { + LOG(("Error reading mode properties '%s'", error->errmess)); ro_gui_buffer_free(); return; } - /* if we're not in a numbered screen mode then we need - to build a suitable sprite mode word */ - if (mode >= (os_mode)0x100) { - const os_VDU_VAR_LIST(4) vars = { - { os_MODEVAR_LOG2_BPP, - os_MODEVAR_XEIG_FACTOR, - os_MODEVAR_YEIG_FACTOR, - os_VDUVAR_END_LIST } - }; - int xeig, yeig; - int vals[4]; - int type; - - error = xos_read_vdu_variables((const os_vdu_var_list*)&vars, vals); - if (error) { - LOG(("Error reading mode properties '%s'", error->errmess)); - ro_gui_buffer_free(); - return; - } + type = 1 + vals[0]; + xeig = vals[1]; + yeig = vals[2]; - type = 1 + vals[0]; - xeig = vals[1]; - yeig = vals[2]; - - mode = (os_mode)((type << 27) | ((180 >> yeig) << 14) | - ((180 >> xeig) << 1) | 1); - } + mode = (os_mode)((type << 27) | ((180 >> yeig) << 14) | + ((180 >> xeig) << 1) | 1); } #endif |