1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 12:28:22 +01:00

- fixed speckles (white dots) on dithered images (bug still present on the

PowerPC architecture, because on LinuxPPC char is unsigned by default, not
  signed like on the other platforms).
  Bug fixed by Philip Derrin <philipd@student.unsw.edu.au>
- miscelaneous bug fixes

We would like people with cvs access experimenting the white 'speckles' on
images to test if they still have the problem.
This commit is contained in:
dan
2001-05-10 00:16:28 +00:00
parent 19ad865f49
commit ddde229665
8 changed files with 77 additions and 55 deletions

View File

@@ -38,6 +38,7 @@ SUPPORTED PLATFORMS
- Amiga 3000 running RedHat Linux 5.1 (Rawhide) - Amiga 3000 running RedHat Linux 5.1 (Rawhide)
- IBM S/390 running Linux - IBM S/390 running Linux
- iBook running Darwin - iBook running Darwin
- Windows NT with Cygwin/XFree86
Patches to make it work on other platforms are welcome. Patches to make it work on other platforms are welcome.

View File

@@ -1294,6 +1294,7 @@ main(int argc, char **argv)
testDragAndDrop(scr); testDragAndDrop(scr);
testText(scr);
#if 0 #if 0
testColorPanel(scr); testColorPanel(scr);
testScrollView(scr); testScrollView(scr);

View File

@@ -616,10 +616,10 @@ TextBlock *tb)
} }
if(!tb->sections) if(!tb->sections) {
layOutDocument(tPtr); layOutDocument(tPtr);
if(!tb->sections)
return 0; return 0;
}
*dir = !(y <= tb->sections[0].y); *dir = !(y <= tb->sections[0].y);
if(*dir) { if(*dir) {
@@ -3597,6 +3597,7 @@ WMAppendTextBlock(WMText *tPtr, void *vtb)
tPtr->currentTextBlock = tb; tPtr->currentTextBlock = tb;
} }
void* void*
WMRemoveTextBlock(WMText *tPtr) WMRemoveTextBlock(WMText *tPtr)
{ {
@@ -3637,15 +3638,15 @@ WMRemoveTextBlock(WMText *tPtr)
} }
#if 0
static void static void
destroyWidget(WMWidget *widget) destroyWidget(WMWidget *widget)
{ {
if(!widget)
return;
WMDestroyWidget(widget); WMDestroyWidget(widget);
wfree(widget); // -- never do this -- wfree(widget);
} }
#endif
void void
WMDestroyTextBlock(WMText *tPtr, void *vtb) WMDestroyTextBlock(WMText *tPtr, void *vtb)
@@ -3657,31 +3658,33 @@ WMDestroyTextBlock(WMText *tPtr, void *vtb)
if (tb->graphic) { if (tb->graphic) {
if(tb->object) { if(tb->object) {
/* naturally, there's a danger to destroying widgets whose action /* naturally, there's a danger to destroying widgets whose action
brings us here: ie. press a button to destroy it... * brings us here: ie. press a button to destroy it...
need to find a safer way. till then... this stays commented out */ * need to find a safer way. till then... this stays commented out */
/* 5 months later... destroy it 10 seconds after now which should be /* 5 months later... destroy it 10 seconds after now which should
enough time for the widget's action to be completed... :-) */ * be enough time for the widget's action to be completed... :-) */
WMAddTimerHandler(10000, destroyWidget, (void *)tb->d.widget); // This is a bad assumption. Just destroy the widget here.
tb->d.widget = NULL; // if the caller needs it, it can protect it with W_RetainView()
//WMAddTimerHandler(10000, destroyWidget, (void *)tb->d.widget);
WMDestroyWidget(tb->d.widget);
//tb->d.widget = NULL;
} else { } else {
WMReleasePixmap(tb->d.pixmap); WMReleasePixmap(tb->d.pixmap);
tb->d.pixmap = NULL; //tb->d.pixmap = NULL;
} }
} else { } else {
WMReleaseFont(tb->d.font); WMReleaseFont(tb->d.font);
} }
WMReleaseColor(tb->color); WMReleaseColor(tb->color);
if (tb->sections && tb->nsections > 0) // isn't this going to memleak if nsections==0? if (tb->sections && tb->nsections > 0)
if (tb->sections)
wfree(tb->sections); wfree(tb->sections);
wfree(tb->text); wfree(tb->text);
wfree(tb); wfree(tb);
tb = NULL; //tb = NULL;
} }
void void
WMSetTextForegroundColor(WMText *tPtr, WMColor *color) WMSetTextForegroundColor(WMText *tPtr, WMColor *color)
{ {

View File

@@ -797,18 +797,18 @@ WDefaultEntry optionList[] = {
}, },
{"ScreenSwitchKey", "None", (void*)WKBD_SWITCH_SCREEN, {"ScreenSwitchKey", "None", (void*)WKBD_SWITCH_SCREEN,
NULL, getKeybind, setKeyGrab NULL, getKeybind, setKeyGrab
}, }
#ifdef KEEP_XKB_LOCK_STATUS #ifdef KEEP_XKB_LOCK_STATUS
{"ToggleKbdModeKey", "None", (void*)WKBD_TOGGLE, ,{"ToggleKbdModeKey", "None", (void*)WKBD_TOGGLE,
NULL, getKeybind, setKeyGrab NULL, getKeybind, setKeyGrab
}, },
{"KbdModeLock", "NO", NULL, {"KbdModeLock", "NO", NULL,
&wPreferences.modelock, getBool, NULL &wPreferences.modelock, getBool, NULL
}, }
#endif /* KEEP_XKB_LOCK_STATUS */ #endif /* KEEP_XKB_LOCK_STATUS */
#ifdef DEFINABLE_CURSOR #ifdef DEFINABLE_CURSOR
{"NormalCursor", "(builtin, left_ptr)", (void*)WCUR_ROOT, ,{"NormalCursor", "(builtin, left_ptr)", (void*)WCUR_ROOT,
NULL, getCursor, setCursor NULL, getCursor, setCursor
}, },
{"MoveCursor", "(builtin, fleur)", (void*)WCUR_MOVE, {"MoveCursor", "(builtin, fleur)", (void*)WCUR_MOVE,

View File

@@ -7,6 +7,11 @@
- Small speed improvement for 24 and 32 bpp, if internal converter is used - Small speed improvement for 24 and 32 bpp, if internal converter is used
- Small speed improvement for generating gradients. - Small speed improvement for generating gradients.
- Fixed RSaveXPM() to output correct xpm images. - Fixed RSaveXPM() to output correct xpm images.
- fixed speckles (white dots) on dithered images (bug still present on the
PowerPC architecture, because on LinuxPPC char is unsigned by default, not
signed like on the other platforms).
Bug fixed by Philip Derrin <philipd@student.unsw.edu.au>
- fixed code dependant on the order of evaluation. code like - fixed code dependant on the order of evaluation. code like
*ptr++ = *ptr++ = *ptr++ = color; *ptr++ = *ptr++ = *ptr++ = color;

View File

@@ -139,7 +139,7 @@ computeStdTable(unsigned int mult, unsigned int max)
static void static void
convertTrueColor_generic(RXImage *ximg, RImage *image, convertTrueColor_generic(RXImage *ximg, RImage *image,
char *err, char *nerr, signed char *err, signed char *nerr,
const short *rtable, const short *rtable,
const short *gtable, const short *gtable,
const short *btable, const short *btable,
@@ -148,7 +148,7 @@ convertTrueColor_generic(RXImage *ximg, RImage *image,
const unsigned short goffs, const unsigned short goffs,
const unsigned short boffs) const unsigned short boffs)
{ {
char *terr; signed char *terr;
int x, y, r, g, b; int x, y, r, g, b;
int pixel; int pixel;
int rer, ger, ber; int rer, ger, ber;
@@ -330,7 +330,7 @@ image2TrueColor(RContext *ctx, RImage *image)
static void static void
convertPseudoColor_to_8(RXImage *ximg, RImage *image, convertPseudoColor_to_8(RXImage *ximg, RImage *image,
char *err, char *nerr, signed char *err, signed char *nerr,
const short *rtable, const short *rtable,
const short *gtable, const short *gtable,
const short *btable, const short *btable,
@@ -338,7 +338,7 @@ convertPseudoColor_to_8(RXImage *ximg, RImage *image,
unsigned long *pixels, unsigned long *pixels,
int cpc) int cpc)
{ {
char *terr; signed char *terr;
int x, y, r, g, b; int x, y, r, g, b;
int pixel; int pixel;
int rer, ger, ber; int rer, ger, ber;
@@ -545,8 +545,8 @@ image2StandardPseudoColor(RContext *ctx, RImage *image)
} }
} else { } else {
/* dither */ /* dither */
short *err, *nerr; signed short *err, *nerr;
short *terr; signed short *terr;
int rer, ger, ber; int rer, ger, ber;
int x1, ofs; int x1, ofs;
@@ -842,6 +842,14 @@ hermesConvert(RContext *context, RImage *image)
dest.indexed = 1; dest.indexed = 1;
dest.has_colorkey = 0; dest.has_colorkey = 0;
/*printf("source r=0x%x, g=0x%x, b=0x%x, a=0x%x, b=%d, i=%d, c=%d\n",
source.r, source.g, source.b, source.a,
source.bits, source.indexed, source.has_colorkey);
printf("dest r=0x%x, g=0x%x, b=0x%x, a=0x%x, b=%d, i=%d, c=%d\n",
dest.r, dest.g, dest.b, dest.a,
dest.bits, dest.indexed, dest.has_colorkey);
*/
Hermes_ConverterRequest(context->hermes_data->converter, &source, &dest); Hermes_ConverterRequest(context->hermes_data->converter, &source, &dest);
Hermes_ConverterPalette(context->hermes_data->converter, Hermes_ConverterPalette(context->hermes_data->converter,

View File

@@ -115,7 +115,7 @@ renderHGradient(unsigned width, unsigned height, int r0, int g0, int b0,
int rf, int gf, int bf) int rf, int gf, int bf)
{ {
int i; int i;
unsigned long r, g, b, dr, dg, db; long r, g, b, dr, dg, db;
unsigned lineSize = width*3; unsigned lineSize = width*3;
RImage *image; RImage *image;
unsigned char *ptr; unsigned char *ptr;
@@ -170,7 +170,7 @@ renderVGradient(unsigned width, unsigned height, int r0, int g0, int b0,
int rf, int gf, int bf) int rf, int gf, int bf)
{ {
int i, j; int i, j;
unsigned long r, g, b, dr, dg, db; long r, g, b, dr, dg, db;
RImage *image; RImage *image;
unsigned char *ptr; unsigned char *ptr;
unsigned char rr, gg, bb; unsigned char rr, gg, bb;
@@ -280,7 +280,7 @@ static RImage*
renderMHGradient(unsigned width, unsigned height, RColor **colors, int count) renderMHGradient(unsigned width, unsigned height, RColor **colors, int count)
{ {
int i, j, k; int i, j, k;
unsigned long r, g, b, dr, dg, db; long r, g, b, dr, dg, db;
unsigned lineSize = width*3; unsigned lineSize = width*3;
RImage *image; RImage *image;
unsigned char *ptr; unsigned char *ptr;
@@ -347,7 +347,7 @@ static RImage*
renderMVGradient(unsigned width, unsigned height, RColor **colors, int count) renderMVGradient(unsigned width, unsigned height, RColor **colors, int count)
{ {
int i, j, k; int i, j, k;
unsigned long r, g, b, dr, dg, db; long r, g, b, dr, dg, db;
unsigned lineSize = width*3; unsigned lineSize = width*3;
RImage *image; RImage *image;
unsigned char *ptr, *tmp; unsigned char *ptr, *tmp;
@@ -498,8 +498,8 @@ RRenderInterwovenGradient(unsigned width, unsigned height,
RColor colors2[2], int thickness2) RColor colors2[2], int thickness2)
{ {
int i, j, k, l, ll; int i, j, k, l, ll;
unsigned long r1, g1, b1, dr1, dg1, db1; long r1, g1, b1, dr1, dg1, db1;
unsigned long r2, g2, b2, dr2, dg2, db2; long r2, g2, b2, dr2, dg2, db2;
RImage *image; RImage *image;
unsigned char *ptr; unsigned char *ptr;
unsigned char rr, gg, bb; unsigned char rr, gg, bb;

View File

@@ -36,15 +36,19 @@ main(int argc, char **argv)
puts(RMessageForError(RErrorCode)); puts(RMessageForError(RErrorCode));
exit(1); exit(1);
} }
/*
if (argc > 2) { if (argc > 2) {
RImage *tmp = img; RImage *tmp = img;
img = RSmoothScaleImage(tmp, tmp->width*atol(argv[2]), img = RScaleImage(tmp, tmp->width*atol(argv[2]),
tmp->height*atol(argv[2])); tmp->height*atol(argv[2]));
/*img = RSmoothScaleImage(tmp, tmp->width*atol(argv[2]),
tmp->height*atol(argv[2]));
*/
RReleaseImage(tmp); RReleaseImage(tmp);
} }
*/
#if 0 #if 0
if (argc > 2) { if (argc > 2) {
img = RScaleImage(img, img->width*atof(argv[2]), img = RScaleImage(img, img->width*atof(argv[2]),