Workaround for A9home crash drawing patterned lines; maybe temporary

svn path=/trunk/netsurf/; revision=2768
This commit is contained in:
Adrian Lees 2006-07-16 16:52:28 +00:00
parent 2c4fb5d683
commit 81512fa939
2 changed files with 25 additions and 6 deletions

View File

@ -30,6 +30,7 @@
#include "oslib/osfile.h"
#include "oslib/osfscontrol.h"
#include "oslib/osgbpb.h"
#include "oslib/osmodule.h"
#include "oslib/osspriteop.h"
#include "oslib/pdriver.h"
#include "oslib/plugin.h"
@ -125,6 +126,8 @@
#define FILETYPE_ARTWORKS 0xd94
#endif
extern bool ro_plot_patterned_lines;
int os_version = 0;
const char * const __dynamic_da_name = "NetSurf"; /**< For UnixLib. */
@ -276,6 +279,7 @@ void gui_init(int argc, char** argv)
os_error *error;
int length;
char *nsdir_temp;
byte *base;
/* re-enable all FPU exceptions/traps except inexact operations,
* which we're not interested in, and underflow which is incorrectly
@ -292,6 +296,16 @@ void gui_init(int argc, char** argv)
* being present) */
xos_byte(osbyte_IN_KEY, 0, 0xff, &os_version, NULL);
/* the first release version of the A9home OS is incapable of
plotting patterned lines (presumably a fault in the hw acceleration) */
if (!xosmodule_lookup("VideoHWSMI", NULL, NULL, &base, NULL, NULL)) {
const char *help = (char*)base + ((int*)base)[5];
while (*help > 9) help++;
while (*help == 9) help++;
if (!memcmp(help, "0.55", 4))
ro_plot_patterned_lines = false;
}
atexit(ro_gui_cleanup);
prev_sigs.sigabrt = signal(SIGABRT, ro_gui_signal);
prev_sigs.sigfpe = signal(SIGFPE, ro_gui_signal);

View File

@ -66,6 +66,9 @@ int ro_plot_origin_x = 0;
int ro_plot_origin_y = 0;
float ro_plot_scale = 1.0;
/** One version of the A9home OS is incapable of drawing patterned lines */
bool ro_plot_patterned_lines = true;
bool ro_plot_clg(colour c)
{
@ -140,12 +143,14 @@ bool ro_plot_path(const draw_path * const path, int width,
if (width < 1)
width = 1;
if (dotted) {
dash.elements[0] = 512 * width;
dash_pattern = &dash;
} else if (dashed) {
dash.elements[0] = 1536 * width;
dash_pattern = &dash;
if (ro_plot_patterned_lines) {
if (dotted) {
dash.elements[0] = 512 * width;
dash_pattern = &dash;
} else if (dashed) {
dash.elements[0] = 1536 * width;
dash_pattern = &dash;
}
}
error = xcolourtrans_set_gcol(c << 8, 0, os_ACTION_OVERWRITE, 0, 0);