From 7698ba2f1c469944a454a4b8a230b0c1133b5b20 Mon Sep 17 00:00:00 2001 From: kojima Date: Tue, 16 Nov 1999 00:16:07 +0000 Subject: [PATCH] - added standard colormap support - made icon images scale in the same proportion as the tiles --- src/icon.c | 12 +++++++++++- src/screen.c | 6 +++++- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/src/icon.c b/src/icon.c index 3a167703..6d8929ad 100644 --- a/src/icon.c +++ b/src/icon.c @@ -399,7 +399,16 @@ wIconValidateIconSize(WScreen *scr, RImage *icon) if (!icon) return NULL; - + + if (wPreferences.icon_size != 64) { + w = wPreferences.icon_size * icon->width / 64; + h = wPreferences.icon_size * icon->height / 64; + + tmp = RScaleImage(icon, w, h); + RDestroyImage(icon); + icon = tmp; + } +#if 0 if (icon->width > wPreferences.icon_size || icon->height > wPreferences.icon_size) { if (icon->width > icon->height) { @@ -413,6 +422,7 @@ wIconValidateIconSize(WScreen *scr, RImage *icon) RDestroyImage(icon); icon = tmp; } +#endif return icon; } diff --git a/src/screen.c b/src/screen.c index 0d352bb9..334f618d 100644 --- a/src/screen.c +++ b/src/screen.c @@ -736,15 +736,19 @@ wScreenInit(int screen_number) XDefineCursor(dpy, scr->root_win, wCursor[WCUR_DEFAULT]); /* screen descriptor for raster graphic library */ - rattr.flags = RC_RenderMode | RC_ColorsPerChannel; + rattr.flags = RC_RenderMode | RC_ColorsPerChannel | RC_StandardColormap; rattr.render_mode = wPreferences.no_dithering ? RBestMatchRendering : RDitheredRendering; + /* if the std colormap stuff works ok, this will be ignored */ rattr.colors_per_channel = wPreferences.cmap_size; if (rattr.colors_per_channel<2) rattr.colors_per_channel = 2; + /* will only be accounted for in PseudoColor */ + rattr.standard_colormap_mode = RCreateStdColormap; + if (wVisualID>=0) { rattr.flags |= RC_VisualID; rattr.visualid = wVisualID; -- 2.11.4.GIT