diff --git a/src/conio/ciolib.h b/src/conio/ciolib.h index 706e1ef2924baaac8c421b99883537b929b12a4c..e355d3cba64a462556e8c210a0a8c23350aec7e1 100644 --- a/src/conio/ciolib.h +++ b/src/conio/ciolib.h @@ -305,6 +305,7 @@ typedef struct { #define CONIO_OPT_SET_NAME 512 #define CONIO_OPT_SET_ICON 1024 #define CONIO_OPT_EXTENDED_PALETTE 2048 +#define CONIO_OPT_BLOCKY_SCALING 4096 void (*clreol) (void); int (*puttext) (int,int,int,int,void *); int (*vmem_puttext) (int,int,int,int,struct vmem_cell *); diff --git a/src/conio/scale.c b/src/conio/scale.c index fd7b4972f1696e1c7cd2d425ce6bea670be45d91..6e41edc72735307030678ed6672f53ea80ad1e30 100644 --- a/src/conio/scale.c +++ b/src/conio/scale.c @@ -1,3 +1,4 @@ +#include "ciolib.h" #include "scale.h" #include "xbr.h" @@ -119,40 +120,42 @@ do_scale(struct rectlist* rect, int xscale, int yscale, double ratio) xscale = 1; total_yscaling = yscale; yscale = 1; - if ((total_xscaling & 1) == 1 && (total_xscaling == total_yscaling || (total_yscaling % total_xscaling == 0))) { - pointymult = total_xscaling; - total_xscaling /= pointymult; - xscale *= pointymult; - total_yscaling /= pointymult; - yscale *= pointymult; - } - while (total_xscaling > 1 && ((total_xscaling % 5) == 0) && ((total_yscaling % 5) == 0)) { - pointy5++; - total_xscaling /= 5; - xscale *= 5; - total_yscaling /= 5; - yscale *= 5; - } - while (total_xscaling > 1 && ((total_xscaling % 3) == 0) && ((total_yscaling % 3) == 0)) { - pointy3++; - total_xscaling /= 3; - xscale *= 3; - total_yscaling /= 3; - yscale *= 3; - } - while (total_xscaling > 1 && ((total_xscaling % 4) == 0) && ((total_yscaling % 4) == 0)) { - xbr4++; - total_xscaling /= 4; - xscale *= 4; - total_yscaling /= 4; - yscale *= 4; - } - while (total_xscaling > 1 && ((total_xscaling % 2) == 0) && ((total_yscaling % 2) == 0)) { - xbr2++; - total_xscaling /= 2; - xscale *= 2; - total_yscaling /= 2; - yscale *= 2; + if (!(cio_api.options & CONIO_OPT_BLOCKY_SCALING)) { + if ((total_xscaling & 1) == 1 && (total_xscaling == total_yscaling || (total_yscaling % total_xscaling == 0))) { + pointymult = total_xscaling; + total_xscaling /= pointymult; + xscale *= pointymult; + total_yscaling /= pointymult; + yscale *= pointymult; + } + while (total_xscaling > 1 && ((total_xscaling % 5) == 0) && ((total_yscaling % 5) == 0)) { + pointy5++; + total_xscaling /= 5; + xscale *= 5; + total_yscaling /= 5; + yscale *= 5; + } + while (total_xscaling > 1 && ((total_xscaling % 3) == 0) && ((total_yscaling % 3) == 0)) { + pointy3++; + total_xscaling /= 3; + xscale *= 3; + total_yscaling /= 3; + yscale *= 3; + } + while (total_xscaling > 1 && ((total_xscaling % 4) == 0) && ((total_yscaling % 4) == 0)) { + xbr4++; + total_xscaling /= 4; + xscale *= 4; + total_yscaling /= 4; + yscale *= 4; + } + while (total_xscaling > 1 && ((total_xscaling % 2) == 0) && ((total_yscaling % 2) == 0)) { + xbr2++; + total_xscaling /= 2; + xscale *= 2; + total_yscaling /= 2; + yscale *= 2; + } } xmult = total_xscaling; diff --git a/src/syncterm/bbslist.c b/src/syncterm/bbslist.c index 0a724c254847ebc5f145e73de7f45030836e0e27..fbfb0747ee9868ce26ab0531af71c14a0a0caddd 100644 --- a/src/syncterm/bbslist.c +++ b/src/syncterm/bbslist.c @@ -1587,8 +1587,8 @@ void change_settings(int connected) char inipath[MAX_PATH+1]; FILE *inifile; str_list_t inicontents; - char opts[12][80]; - char *opt[13]; + char opts[13][80]; + char *opt[14]; char *subopts[8]; int i,j,k,l; char str[64]; @@ -1632,6 +1632,8 @@ void change_settings(int connected) " The complete path to the user's BBS list.\n\n" "~ TERM For Shell ~\n" " The value to set the TERM envirnonment variable to goes here.\n\n" + "~ Blocky Scaling ~\n" + " Toggle \"blocky\" scaling.\n\n" "~ Custom Screen Mode ~\n" " Configure the Custom screen mode.\n\n"; SAFEPRINTF(opts[0],"Confirm Program Exit %s",settings.confirm_close?"Yes":"No"); @@ -1649,10 +1651,13 @@ void change_settings(int connected) SAFEPRINTF(opts[8],"Modem Dial String %s",settings.mdm.dial_string); SAFEPRINTF(opts[9],"List Path %s",settings.list_path); SAFEPRINTF(opts[10],"TERM For Shell %s",settings.TERM); - if (connected) - opt[11] = NULL; - else - sprintf(opts[11],"Custom Screen Mode"); + sprintf(opts[11],"Blocky Scaling %s", settings.blocky ? "On" : "Off"); + if (connected) { + opt[12] = NULL; + } + else { + sprintf(opts[12],"Custom Screen Mode"); + } switch(uifc.list(WIN_MID|WIN_SAV|WIN_ACT,0,0,0,&cur,NULL,"Program Settings",opt)) { case -1: check_exit(FALSE); @@ -1858,6 +1863,14 @@ void change_settings(int connected) check_exit(FALSE); break; case 11: + settings.blocky = !settings.blocky; + iniSetBool(&inicontents,"SyncTERM","BlockyScaling",settings.blocky,&ini_style); + if (settings.blocky) + cio_api.options |= CONIO_OPT_BLOCKY_SCALING; + else + cio_api.options &= ~CONIO_OPT_BLOCKY_SCALING; + break; + case 12: uifc.helpbuf= "`Custom Screen Mode`\n\n" "~ Rows ~\n" " Sets the number of rows in the custom screen mode\n" diff --git a/src/syncterm/syncterm.c b/src/syncterm/syncterm.c index e7da3175f861eef4f779cf13b3ba555c46ed5eef..0d64d598613d7f8bf6cbc895926f918f68872dbd 100644 --- a/src/syncterm/syncterm.c +++ b/src/syncterm/syncterm.c @@ -1253,6 +1253,7 @@ void load_settings(struct syncterm_settings *set) set->scaling_factor=iniReadInteger(inifile,"SyncTERM","ScalingFactor",0); set->window_width=iniReadInteger(inifile,"SyncTERM","WindowWidth",0); set->window_height=iniReadInteger(inifile,"SyncTERM","WindowHeight",0); + set->blocky=iniReadBool(inifile,"SyncTERM","BlockyScaling",FALSE); // TODO: Add this to the UI somewhere. set->left_just=iniReadBool(inifile,"SyncTERM","LeftJustify",FALSE); @@ -1597,8 +1598,16 @@ int main(int argc, char **argv) SAFECOPY(url,argv[i]); } + if (settings.blocky) + cio_api.options |= CONIO_OPT_BLOCKY_SCALING; + else + cio_api.options &= ~CONIO_OPT_BLOCKY_SCALING; if(initciolib(ciolib_mode)) return(1); + if (settings.blocky) + cio_api.options |= CONIO_OPT_BLOCKY_SCALING; + else + cio_api.options &= ~CONIO_OPT_BLOCKY_SCALING; ciolib_reaper=FALSE; seticon(syncterm_icon.pixel_data,syncterm_icon.width); if (settings.scaling_factor) diff --git a/src/syncterm/syncterm.h b/src/syncterm/syncterm.h index 2ee5d3daef532320b7c1a79c066bf0aae962d91a..9a222023482adf367edca785bd39133e342dd285 100644 --- a/src/syncterm/syncterm.h +++ b/src/syncterm/syncterm.h @@ -65,6 +65,7 @@ struct syncterm_settings { int window_width; int window_height; int left_just; + int blocky; }; extern char *inpath;