diff options
-rw-r--r-- | amiga/bitmap.c | 6 | ||||
-rwxr-xr-x | amiga/gui_options.c | 78 | ||||
-rwxr-xr-x | amiga/gui_options.h | 4 | ||||
-rw-r--r-- | amiga/options.h | 5 |
4 files changed, 91 insertions, 2 deletions
diff --git a/amiga/bitmap.c b/amiga/bitmap.c index 31b9f11e3..5e9c16e03 100644 --- a/amiga/bitmap.c +++ b/amiga/bitmap.c @@ -359,12 +359,15 @@ struct BitMap *ami_getcachenativebm(struct bitmap *bitmap,int width,int height,s if(GfxBase->lib_Version >= 53) // AutoDoc says v52, but this function isn't in OS4.0, so checking for v53 (OS4.1) { uint32 comptype = COMPOSITE_Src; + uint32 flags = COMPFLAG_IgnoreDestAlpha; + if(!bitmap->opaque) comptype = COMPOSITE_Src_Over_Dest; + if(option_scale_quality) flags |= COMPFLAG_SrcFilter; CompositeTags(comptype,tbm,scaledbm, COMPTAG_ScaleX,COMP_FLOAT_TO_FIX(width/bitmap->width), COMPTAG_ScaleY,COMP_FLOAT_TO_FIX(height/bitmap->height), - COMPTAG_Flags,COMPFLAG_IgnoreDestAlpha, + COMPTAG_Flags, flags, COMPTAG_DestX,0, COMPTAG_DestY,0, COMPTAG_DestWidth,width, @@ -392,6 +395,7 @@ struct BitMap *ami_getcachenativebm(struct bitmap *bitmap,int width,int height,s bsa.bsa_SrcBitMap = tbm; bsa.bsa_DestBitMap = scaledbm; bsa.bsa_Flags = 0; + if(option_scale_quality) bsa.bsa_Flags = BSAF_BILINEAR; BitMapScale(&bsa); } diff --git a/amiga/gui_options.c b/amiga/gui_options.c index 2a7e6c849..7318e00a3 100755 --- a/amiga/gui_options.c +++ b/amiga/gui_options.c @@ -20,6 +20,7 @@ #include <string.h> #include <proto/exec.h> #include <proto/intuition.h> +#include <proto/graphics.h> #include "amiga/object.h" #include "amiga/gui.h" @@ -59,6 +60,7 @@ static struct ami_gui_opts_window *gow = NULL; CONST_STRPTR tabs[9]; CONST_STRPTR screenopts[4]; CONST_STRPTR proxyopts[5]; +CONST_STRPTR nativebmopts[3]; CONST_STRPTR gadlab[GID_OPTS_LAST]; void ami_gui_opts_setup(void) @@ -84,6 +86,11 @@ void ami_gui_opts_setup(void) proxyopts[3] = (char *)ami_utf8_easy((char *)messages_get("NTLM")); proxyopts[4] = NULL; + nativebmopts[0] = (char *)ami_utf8_easy((char *)messages_get("None")); + nativebmopts[1] = (char *)ami_utf8_easy((char *)messages_get("Scaled")); + nativebmopts[2] = (char *)ami_utf8_easy((char *)messages_get("All")); + nativebmopts[3] = NULL; + gadlab[GID_OPTS_HOMEPAGE] = (char *)ami_utf8_easy((char *)messages_get("URL")); gadlab[GID_OPTS_HOMEPAGE_DEFAULT] = (char *)ami_utf8_easy((char *)messages_get("UseDefault")); gadlab[GID_OPTS_HOMEPAGE_CURRENT] = (char *)ami_utf8_easy((char *)messages_get("UseCurrent")); @@ -101,6 +108,10 @@ void ami_gui_opts_setup(void) gadlab[GID_OPTS_FETCHMAX] = (char *)ami_utf8_easy((char *)messages_get("FetchesMax")); gadlab[GID_OPTS_FETCHHOST] = (char *)ami_utf8_easy((char *)messages_get("FetchesPerHost")); gadlab[GID_OPTS_FETCHCACHE] = (char *)ami_utf8_easy((char *)messages_get("FetchesCached")); + gadlab[GID_OPTS_NATIVEBM] = (char *)ami_utf8_easy((char *)messages_get("CacheNative")); + gadlab[GID_OPTS_SCALEQ] = (char *)ami_utf8_easy((char *)messages_get("ScaleQuality")); + gadlab[GID_OPTS_ANIMSPEED] = (char *)ami_utf8_easy((char *)messages_get("AnimSpeed")); + gadlab[GID_OPTS_ANIMDISABLE] = (char *)ami_utf8_easy((char *)messages_get("AnimDisable")); gadlab[GID_OPTS_SAVE] = (char *)ami_utf8_easy((char *)messages_get("Save")); gadlab[GID_OPTS_USE] = (char *)ami_utf8_easy((char *)messages_get("Use")); gadlab[GID_OPTS_CANCEL] = (char *)ami_utf8_easy((char *)messages_get("Cancel")); @@ -115,6 +126,8 @@ void ami_gui_opts_open(void) ULONG proxytype = 0; BOOL screenmodedisabled = FALSE, screennamedisabled = FALSE; BOOL proxyhostdisabled = TRUE, proxyauthdisabled = TRUE; + BOOL disableanims; + char animspeed[10]; if(option_use_pubscreen && option_use_pubscreen[0] != '\0') { @@ -155,6 +168,11 @@ void ami_gui_opts_open(void) } } + sprintf(animspeed,"%.2f",(float)(option_minimum_gif_delay/100.0)); + + if(option_animate_images) disableanims = FALSE; + else disableanims = TRUE; + if(!gow) { ami_gui_opts_setup(); @@ -452,7 +470,52 @@ void ami_gui_opts_open(void) */ PAGE_Add, LayoutObject, LAYOUT_AddChild,VGroupObject, + LAYOUT_AddChild,VGroupObject, + LAYOUT_SpaceOuter, TRUE, + LAYOUT_BevelStyle, BVS_GROUP, + LAYOUT_Label, messages_get("Images"), + LAYOUT_AddChild, gow->gadgets[GID_OPTS_NATIVEBM] = ChooserObject, + GA_ID, GID_OPTS_NATIVEBM, + GA_RelVerify, TRUE, + CHOOSER_PopUp, TRUE, + CHOOSER_LabelArray, nativebmopts, + CHOOSER_Selected, option_cache_bitmaps, + ChooserEnd, + CHILD_Label, LabelObject, + LABEL_Text, gadlab[GID_OPTS_NATIVEBM], + LabelEnd, + LAYOUT_AddChild, gow->gadgets[GID_OPTS_SCALEQ] = CheckBoxObject, + GA_ID, GID_OPTS_SCALEQ, + GA_RelVerify, TRUE, + GA_Text, gadlab[GID_OPTS_SCALEQ], + GA_Selected, option_scale_quality, + CheckBoxEnd, + LayoutEnd, // images + CHILD_WeightedHeight, 0, + LAYOUT_AddChild,VGroupObject, + LAYOUT_SpaceOuter, TRUE, + LAYOUT_BevelStyle, BVS_GROUP, + LAYOUT_Label, messages_get("Animations"), + LAYOUT_AddChild, gow->gadgets[GID_OPTS_ANIMSPEED] = StringObject, + GA_ID, GID_OPTS_ANIMSPEED, + GA_RelVerify, TRUE, + STRINGA_HookType, SHK_FLOAT, + STRINGA_TextVal, animspeed, + STRINGA_BufferPos,0, + StringEnd, + CHILD_Label, LabelObject, + LABEL_Text, gadlab[GID_OPTS_ANIMSPEED], + LabelEnd, + LAYOUT_AddChild, gow->gadgets[GID_OPTS_ANIMDISABLE] = CheckBoxObject, + GA_ID, GID_OPTS_ANIMDISABLE, + GA_RelVerify, TRUE, + GA_Text, gadlab[GID_OPTS_ANIMDISABLE], + GA_Selected, disableanims, + CheckBoxEnd, + LayoutEnd, //animations + CHILD_WeightedHeight, 0, LayoutEnd, // page vgroup + CHILD_WeightedHeight, 0, PageEnd, // page object /* ** Fonts @@ -513,6 +576,7 @@ void ami_gui_opts_open(void) void ami_gui_opts_use(void) { ULONG data; + float animspeed; GetAttr(STRINGA_TextVal,gow->gadgets[GID_OPTS_HOMEPAGE],(ULONG *)&data); if(option_homepage_url) free(option_homepage_url); @@ -595,6 +659,20 @@ void ami_gui_opts_use(void) GetAttr(STRINGA_TextVal,gow->gadgets[GID_OPTS_PROXY_PASS],(ULONG *)&data); if(option_http_proxy_auth_pass) free(option_http_proxy_auth_pass); option_http_proxy_auth_pass = (char *)strdup((char *)data); + + GetAttr(CHOOSER_Selected,gow->gadgets[GID_OPTS_NATIVEBM],(ULONG *)&option_cache_bitmaps); + + GetAttr(GA_Selected,gow->gadgets[GID_OPTS_SCALEQ],(ULONG *)&data); + if(data) option_scale_quality = true; + else option_scale_quality = false; + + GetAttr(STRINGA_TextVal,gow->gadgets[GID_OPTS_ANIMSPEED],(ULONG *)&data); + animspeed = strtof(data,NULL); + option_minimum_gif_delay = (int)(animspeed * 100); + + GetAttr(GA_Selected,gow->gadgets[GID_OPTS_ANIMDISABLE],(ULONG *)&data); + if(data) option_animate_images = false; + else option_animate_images = true; } void ami_gui_opts_close(void) diff --git a/amiga/gui_options.h b/amiga/gui_options.h index fde4d23da..ceebced4d 100755 --- a/amiga/gui_options.h +++ b/amiga/gui_options.h @@ -48,6 +48,10 @@ enum GID_OPTS_FETCHMAX, GID_OPTS_FETCHHOST, GID_OPTS_FETCHCACHE, + GID_OPTS_NATIVEBM, + GID_OPTS_SCALEQ, + GID_OPTS_ANIMSPEED, + GID_OPTS_ANIMDISABLE, GID_OPTS_SAVE, GID_OPTS_USE, GID_OPTS_CANCEL, diff --git a/amiga/options.h b/amiga/options.h index 912b1a77a..beb6f1086 100644 --- a/amiga/options.h +++ b/amiga/options.h @@ -40,6 +40,7 @@ extern char *option_arexx_dir; extern char *option_download_dir; extern bool option_faster_scroll; extern bool option_direct_render; +extern bool option_scale_quality; #define EXTRA_OPTION_DEFINE \ bool option_verbose_log = false; \ @@ -62,6 +63,7 @@ char *option_arexx_dir = 0; \ char *option_download_dir = 0; \ bool option_faster_scroll = true; \ bool option_direct_render = false; \ +bool option_scale_quality = false; \ #define EXTRA_OPTION_TABLE \ { "verbose_log", OPTION_BOOL, &option_verbose_log}, \ @@ -83,5 +85,6 @@ bool option_direct_render = false; \ { "arexx_dir", OPTION_STRING, &option_arexx_dir }, \ { "download_dir", OPTION_STRING, &option_download_dir }, \ { "faster_scroll", OPTION_BOOL, &option_faster_scroll}, \ -{ "debug_dr", OPTION_BOOL, &option_direct_render}, +{ "debug_dr", OPTION_BOOL, &option_direct_render}, \ +{ "scale_quality", OPTION_BOOL, &option_scale_quality}, #endif |