From: David Griffith Date: Mon, 27 Feb 2017 04:08:48 +0000 (-0800) Subject: Move use_blorb and exec_in_blorb from u_setup_t to f_setup_t. X-Git-Url: https://scope-eye.net/git/?a=commitdiff_plain;h=2f2d4b14f77fa70b7e953235b60abedce77e3e6e;p=liskon_frotz.git Move use_blorb and exec_in_blorb from u_setup_t to f_setup_t. --- diff --git a/src/common/setup.h b/src/common/setup.h index 206015d..932c14a 100644 --- a/src/common/setup.h +++ b/src/common/setup.h @@ -31,6 +31,9 @@ typedef struct frotz_setup_struct { char *story_path; char *zcode_path; int restore_mode; /* for a save file passed from command line*/ + + bool use_blorb; + bool exec_in_blorb; } f_setup_t; extern f_setup_t f_setup; diff --git a/src/curses/ux_blorb.c b/src/curses/ux_blorb.c index 438d5ca..5980fa3 100644 --- a/src/curses/ux_blorb.c +++ b/src/curses/ux_blorb.c @@ -80,7 +80,7 @@ bb_err_t ux_blorb_init(char *filename) * zcode file and our resources are in a seperate blorb file. */ if (isblorb(fp)) { /* Now we know to look */ - u_setup.exec_in_blorb = 1; /* for zcode in the blorb */ + f_setup.exec_in_blorb = 1; /* for zcode in the blorb */ blorb_fp = fopen(filename, "rb"); } else { len1 = strlen(filename) + strlen(EXT_BLORB); @@ -112,7 +112,7 @@ bb_err_t ux_blorb_init(char *filename) /* At this point we know that we're using a naked zcode file */ /* with resources in a seperate Blorb file. */ - u_setup.use_blorb = 1; + f_setup.use_blorb = 1; } /* Create a Blorb map from this file. @@ -126,10 +126,10 @@ bb_err_t ux_blorb_init(char *filename) /* Locate the EXEC chunk within the blorb file and record its * location so os_load_story() can find it. */ - if (u_setup.exec_in_blorb) { + if (f_setup.exec_in_blorb) { blorb_err = bb_load_chunk_by_type(blorb_map, bb_method_FilePos, &blorb_res, bb_make_id('Z','C','O','D'), 0); - u_setup.exec_in_blorb = 1; + f_setup.exec_in_blorb = 1; } fclose(fp); diff --git a/src/curses/ux_init.c b/src/curses/ux_init.c index 46db288..e08e2b4 100644 --- a/src/curses/ux_init.c +++ b/src/curses/ux_init.c @@ -609,7 +609,7 @@ FILE *os_load_story(void) fp = fopen(f_setup.story_file, "rb"); /* Is this a Blorb file containing Zcode? */ - if (u_setup.exec_in_blorb) + if (f_setup.exec_in_blorb) fseek(fp, blorb_res.data.startpos, SEEK_SET); return fp; @@ -626,7 +626,7 @@ FILE *os_load_story(void) int os_storyfile_seek(FILE * fp, long offset, int whence) { /* Is this a Blorb file containing Zcode? */ - if (u_setup.exec_in_blorb) + if (f_setup.exec_in_blorb) { switch (whence) { @@ -660,7 +660,7 @@ int os_storyfile_seek(FILE * fp, long offset, int whence) int os_storyfile_tell(FILE * fp) { /* Is this a Blorb file containing Zcode? */ - if (u_setup.exec_in_blorb) + if (f_setup.exec_in_blorb) { return ftell(fp) - blorb_res.data.startpos; } @@ -1026,8 +1026,8 @@ void os_init_setup(void) f_setup.err_report_mode = ERR_DEFAULT_REPORT_MODE; f_setup.restore_mode = 0; - u_setup.use_blorb = 0; - u_setup.exec_in_blorb = 0; + f_setup.use_blorb = 0; + f_setup.exec_in_blorb = 0; u_setup.disable_color = 0; u_setup.force_color = 0; diff --git a/src/curses/ux_setup.h b/src/curses/ux_setup.h index 330fdd1..894d36d 100644 --- a/src/curses/ux_setup.h +++ b/src/curses/ux_setup.h @@ -12,10 +12,6 @@ typedef struct unix_setup_struct { int plain_ascii; int current_color; /* ux_text.c ux_screen.c */ bool color_enabled; /* ux_init.c ux_pic.c ux_text.c */ - - bool use_blorb; - bool exec_in_blorb; - int interpreter; /* see frotz.h */ } u_setup_t;