Skip to content
Snippets Groups Projects
Commit cd16d7c1 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Add a "fake mode" for output drivers that can't change screen size

Previously, the height was left the same, and the width was set to
the next-lowest "standard" size.  Now the cterm window is set to
the size of the requested mode and both top/bottom and side bars
are added to make the virtual screen the same as the requested one.

Using the "current" mode still retains the old behaviour.

Closes SF request 11
parent e2f5762b
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #1527 passed
......@@ -112,6 +112,7 @@ int safe_mode=0;
FILE* log_fp;
extern ini_style_t ini_style;
BOOL quitting=FALSE;
int fake_mode = -1;
#ifdef _WINSOCKAPI_
......@@ -1685,6 +1686,8 @@ int main(int argc, char **argv)
gettextinfo(&txtinfo); /* Current mode may have changed while in show_bbslist() */
FREE_AND_NULL(last_bbs);
uifcbail();
if (bbs->screen_mode != SCREEN_MODE_CURRENT)
fake_mode = screen_to_ciolib(bbs->screen_mode);
textmode(screen_to_ciolib(bbs->screen_mode));
if (!bbs->hidepopups)
init_uifc(TRUE, TRUE);
......@@ -1694,6 +1697,7 @@ int main(int argc, char **argv)
load_font_files();
uifcbail();
textmode(txtinfo.currmode);
fake_mode = -1;
init_uifc(TRUE, TRUE);
settitle("SyncTERM");
} else {
......@@ -1734,6 +1738,7 @@ int main(int argc, char **argv)
if(doterm(bbs))
quitting=TRUE;
fake_mode = -1;
setvideoflags(0);
if(log_fp!=NULL) {
......
......@@ -84,6 +84,7 @@ extern char *output_types[];
extern int output_map[];
extern char *output_descrs[];
extern char *output_enum[];
extern int fake_mode;
void parse_url(char *url, struct bbslist *bbs, int dflt_conn_type, int force_defaults);
char *get_syncterm_filename(char *fn, int fnlen, int type, int shared);
......
......@@ -2,6 +2,7 @@
#include <gen_defs.h>
#include <ciolib.h>
#include <vidmodes.h>
#include "uifcinit.h"
#include "term.h"
#include "syncterm.h"
......@@ -10,18 +11,28 @@ void
get_term_win_size(int *width, int *height, int *nostatus)
{
struct text_info txtinfo;
int vmode = find_vmode(fake_mode);
gettextinfo(&txtinfo);
if(txtinfo.screenwidth < 80)
*width=40;
if (vmode != -1 && txtinfo.screenwidth >= vparams[vmode].cols) {
*width = vparams[vmode].cols;
}
else {
if(txtinfo.screenwidth <132)
*width=80;
else
*width=132;
if(txtinfo.screenwidth < 80)
*width=40;
else {
if(txtinfo.screenwidth <132)
*width=80;
else
*width=132;
}
}
*height=txtinfo.screenheight;
if (vmode != -1) {
if (txtinfo.screenheight >= vparams[vmode].rows)
*height = vparams[vmode].rows;
}
if(!*nostatus)
(*height)--;
if(*height<24) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment