OSDN Git Service

[Refactor] #40742 Removed global vairable browsing_movie
authorHourier <hourier@users.sourceforge.jp>
Mon, 21 Sep 2020 13:21:11 +0000 (22:21 +0900)
committerHourier <hourier@users.sourceforge.jp>
Mon, 21 Sep 2020 13:21:11 +0000 (22:21 +0900)
src/cmd-io/cmd-diary.c
src/core/game-play.c
src/core/game-play.h
src/io/chuukei.c
src/io/chuukei.h
src/io/inet.c
src/io/inet.h
src/main-win.c
src/main.c

index aa03d99..9472d9a 100644 (file)
@@ -117,7 +117,6 @@ static void do_cmd_erase_diary(void)
 void do_cmd_diary(player_type *creature_ptr)
 {
     screen_save();
-    int i;
     while (TRUE) {
         term_clear();
         prt(_("[ 記録の設定 ]", "[ Play Record ]"), 2, 0);
@@ -127,7 +126,7 @@ void do_cmd_diary(player_type *creature_ptr)
         prt(_("(4) 記録を消去する", "(4) Delete your record"), 7, 5);
         prt(_("(R) プレイ動画を記録する/中止する", "(R) Record playing movie / or stop it"), 9, 5);
         prt(_("コマンド:", "Command: "), 18, 0);
-        i = inkey();
+        int i = inkey();
         if (i == ESCAPE)
             break;
 
index eb9bd39..fe00699 100644 (file)
 
 /*!
  * @brief 1ゲームプレイの主要ルーチン / Actually play a game
+ * @param player_ptr プレーヤーへの参照ポインタ
+ * @param new_game 新規にゲームを始めたかどうか
+ * @param browsing_movie ムービーモードか
  * @return なし
  * @note
  * If the "new_game" parameter is true, then, after loading the
  * savefile, we will commit suicide, if necessary, to allow the
  * player to start a new game.
  */
-void play_game(player_type *player_ptr, bool new_game)
+void play_game(player_type *player_ptr, bool new_game, bool browsing_movie)
 {
     bool load_game = TRUE;
     bool init_random_seed = FALSE;
index 672a1da..2881411 100644 (file)
@@ -2,4 +2,4 @@
 
 #include "system/angband.h"
 
-void play_game(player_type* player_ptr, bool new_game);
+void play_game(player_type* player_ptr, bool new_game, bool browsing_movie);
index 1d270ce..e893823 100644 (file)
@@ -538,12 +538,9 @@ static bool flush_ringbuf_client(void)
     return TRUE;
 }
 
-void prepare_browse_movie_aux(concptr filename)
+void prepare_browse_movie_without_path_build(concptr filename)
 {
     movie_fd = fd_open(filename, O_RDONLY);
-
-    browsing_movie = TRUE;
-
     init_buffer();
 }
 
@@ -570,11 +567,10 @@ void browse_movie(void)
 }
 
 #ifndef WINDOWS
-void prepare_browse_movie(concptr filename)
+void prepare_browse_movie_with_path_build(concptr filename)
 {
     char buf[1024];
     path_build(buf, sizeof(buf), ANGBAND_DIR_USER, filename);
-
     prepare_browse_movie_aux(buf);
 }
 #endif
index d13f888..0f7873c 100644 (file)
@@ -3,8 +3,8 @@
 #include "system/angband.h"
 
 void prepare_movie_hooks(player_type *player_ptr);
-void prepare_browse_movie_aux(concptr filename);
+void prepare_browse_movie_without_path_build(concptr filename);
 void browse_movie(void);
 #ifndef WINDOWS
-void prepare_browse_movie(concptr filename);
+void prepare_browse_movie_with_path_build(concptr filename);
 #endif WINDOWS
index f7d9fa4..c2638b9 100644 (file)
@@ -28,8 +28,6 @@ static concptr errstr;
 static char *proxy;
 static int proxy_port;
 
-bool browsing_movie;
-
 /* プロキシサーバのアドレスををファイルから読んで設定する */
 void set_proxy(char *default_url, int default_port)
 {
index 8621913..e26c744 100644 (file)
@@ -2,8 +2,6 @@
 
 #include "system/angband.h"
 
-extern bool browsing_movie;
-
 int soc_write(int sd, char *buf, size_t sz);
 int soc_read(int sd, char *buf, size_t sz);
 void set_proxy(char *default_url, int default_port);
index edc7141..371db89 100644 (file)
@@ -2249,7 +2249,7 @@ static void check_for_save_file(player_type *player_ptr, LPSTR cmd_line)
     strcat(savefile, s);
     validate_file(savefile);
     game_in_progress = TRUE;
-    play_game(player_ptr, FALSE);
+    play_game(player_ptr, FALSE, FALSE);
 }
 
 /*
@@ -2268,7 +2268,7 @@ static void process_menus(player_type *player_ptr, WORD wCmd)
         } else {
             game_in_progress = TRUE;
             term_flush();
-            play_game(player_ptr, TRUE);
+            play_game(player_ptr, TRUE, FALSE);
             quit(NULL);
         }
 
@@ -2294,7 +2294,7 @@ static void process_menus(player_type *player_ptr, WORD wCmd)
                 validate_file(savefile);
                 game_in_progress = TRUE;
                 term_flush();
-                play_game(player_ptr, FALSE);
+                play_game(player_ptr, FALSE, FALSE);
                 quit(NULL);
             }
         }
@@ -2370,8 +2370,8 @@ static void process_menus(player_type *player_ptr, WORD wCmd)
             ofn.Flags = OFN_FILEMUSTEXIST | OFN_NOCHANGEDIR;
 
             if (GetOpenFileName(&ofn)) {
-                prepare_browse_movie_aux(savefile);
-                play_game(player_ptr, FALSE);
+                prepare_browse_movie_without_path_build(savefile);
+                play_game(player_ptr, FALSE, TRUE);
                 quit(NULL);
                 return;
             }
index d883528..9fd6869 100644 (file)
@@ -345,6 +345,7 @@ int main(int argc, char *argv[])
 #endif /* SET_UID */
 
     /* Process the command line arguments */
+    bool browsing_movie = FALSE;
     for (i = 1; args && (i < argc); i++) {
         /* Require proper options */
         if (argv[i][0] != '-') {
@@ -437,7 +438,8 @@ int main(int argc, char *argv[])
                 break;
             }
 
-            prepare_browse_movie(&argv[i][2]);
+            prepare_browse_movie_with_path_build(&argv[i][2]);
+            browsing_movie = TRUE;
             break;
         }
         case '-': {
@@ -533,7 +535,7 @@ int main(int argc, char *argv[])
     pause_line(23);
 
     /* Play the game */
-    play_game(p_ptr, new_game);
+    play_game(p_ptr, new_game, browsing_movie);
 
     /* Quit */
     quit(NULL);