Move use_blorb and exec_in_blorb from u_setup_t to f_setup_t.
authorDavid Griffith <dave@661.org>
Mon, 27 Feb 2017 04:08:48 +0000 (20:08 -0800)
committerDavid Griffith <dave@661.org>
Mon, 27 Feb 2017 04:08:48 +0000 (20:08 -0800)
src/common/setup.h
src/curses/ux_blorb.c
src/curses/ux_init.c
src/curses/ux_setup.h

index 206015d2cf4334163ae0a6b6370dda9e1936eb9a..932c14a9fd244823c8889ad185a10573edfbd333 100644 (file)
@@ -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;
index 438d5cac2a13237c773c66081ef0f8a74be1c2b1..5980fa3a896d6102efed0f9c5562e7c320cc6b76 100644 (file)
@@ -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);
index 46db288e19a95f0aeb217802753aa246074eea37..e08e2b4825ae427c57c157b2f6ac5bc02b2065ce 100644 (file)
@@ -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;
index 330fdd13069bdacb25939742f4d8fc7fff9eba7d..894d36da5578e0e2f3f8bda00e0fd7f6621fa7f9 100644 (file)
@@ -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;