OSDN Git Service

[Refactor] #38997 calc_score() に player_type * 引数を追加.
[hengband/hengband.git] / src / report.c
index d9a56a9..c0213b5 100644 (file)
@@ -7,6 +7,21 @@
 
 #define _GNU_SOURCE /*!< 未使用*/
 #include "angband.h"
+#include "util.h"
+#include "core.h"
+#include "inet.h"
+#include "dungeon.h"
+
+#include "floor.h"
+#include "player-status.h"
+#include "player-class.h"
+#include "player-race.h"
+#include "player-personality.h"
+#include "files.h"
+#include "world.h"
+#include "realm.h"
+#include "term.h"
+#include "view-mainwindow.h"
 
 #ifdef WORLD_SCORE
 
@@ -31,6 +46,8 @@
 #include <signal.h>
 #endif
 
+concptr screen_dump = NULL;
+
 /*
  * internet resource value
  */
@@ -100,7 +117,7 @@ static void buf_delete(BUF *b)
  * @param size 追加サイズ
  * @return 追加後のバッファ容量
  */
-static int buf_append(BUF *buf, cptr data, size_t size)
+static int buf_append(BUF *buf, concptr data, size_t size)
 {
        while (buf->size + size > buf->max_size)
        {
@@ -126,7 +143,7 @@ static int buf_append(BUF *buf, cptr data, size_t size)
  * @param fmt 文字列フォーマット
  * @return 追加後のバッファ容量
  */
-static int buf_sprintf(BUF *buf, cptr fmt, ...)
+static int buf_sprintf(BUF *buf, concptr fmt, ...)
 {
        int             ret;
        char    tmpbuf[8192];
@@ -194,7 +211,7 @@ static int buf_write(BUF *buf, int fd)
        return buf->size;
 }
 
-static int buf_search(BUF *buf, cptr str)
+static int buf_search(BUF *buf, concptr str)
 {
        char *ret;
 
@@ -228,11 +245,11 @@ static BUF * buf_subbuf(BUF *buf, int pos1, size_t sz)
  * @param buf 伝送内容バッファ
  * @return なし
  */
-static bool http_post(int sd, cptr url, BUF *buf)
+static bool http_post(int sd, concptr url, BUF *buf)
 {
        BUF *output;
        char response_buf[1024] = "";
-       cptr HTTP_RESPONSE_CODE_OK = "HTTP/1.1 200 OK";
+       concptr HTTP_RESPONSE_CODE_OK = "HTTP/1.1 200 OK";
 
        output = buf_new();
        buf_sprintf(output, "POST %s HTTP/1.0\r\n", url);
@@ -297,8 +314,6 @@ static errr make_dump(BUF* dumpbuf)
                (void)buf_sprintf(dumpbuf, "%s", buf);
        }
        my_fclose(fff);
-
-       /* Remove the file */
        fd_kill(file_name);
 
        /* Success */
@@ -309,21 +324,21 @@ static errr make_dump(BUF* dumpbuf)
  * @brief スクリーンダンプを作成する/ Make screen dump to buffer
  * @return 作成したスクリーンダンプの参照ポインタ
  */
-cptr make_screen_dump(void)
+concptr make_screen_dump(void)
 {
        BUF *screen_buf;
        int y, x, i;
-       cptr ret;
+       concptr ret;
 
        TERM_COLOR a = 0, old_a = 0;
-       char c = ' ';
+       SYMBOL_CODE c = ' ';
 
-       static cptr html_head[] = {
+       static concptr html_head[] = {
                "<html>\n<body text=\"#ffffff\" bgcolor=\"#000000\">\n",
                "<pre>",
                0,
        };
-       static cptr html_foot[] = {
+       static concptr html_foot[] = {
                "</pre>\n",
                "</body>\n</html>\n",
                0,
@@ -365,7 +380,7 @@ cptr make_screen_dump(void)
                for (x = 0; x < wid - 1; x++)
                {
                        int rv, gv, bv;
-                       cptr cc = NULL;
+                       concptr cc = NULL;
                        /* Get the attr/char */
                        (void)(Term_what(x, y, &a, &c));
 
@@ -467,13 +482,13 @@ errr report_score(void)
        buf_sprintf(score, "version: Hengband %d.%d.%d\n",
                    FAKE_VER_MAJOR-10, FAKE_VER_MINOR, FAKE_VER_PATCH);
 #endif
-       buf_sprintf(score, "score: %d\n", total_points());
+       buf_sprintf(score, "score: %d\n", calc_score(p_ptr));
        buf_sprintf(score, "level: %d\n", p_ptr->lev);
-       buf_sprintf(score, "depth: %d\n", dun_level);
+       buf_sprintf(score, "depth: %d\n", current_floor_ptr->dun_level);
        buf_sprintf(score, "maxlv: %d\n", p_ptr->max_plv);
        buf_sprintf(score, "maxdp: %d\n", max_dlv[DUNGEON_ANGBAND]);
        buf_sprintf(score, "au: %d\n", p_ptr->au);
-       buf_sprintf(score, "turns: %d\n", turn_real(turn));
+       buf_sprintf(score, "turns: %d\n", turn_real(current_world_ptr->game_turn));
        buf_sprintf(score, "sex: %d\n", p_ptr->psex);
        buf_sprintf(score, "race: %s\n", rp_ptr->title);
        buf_sprintf(score, "class: %s\n", cp_ptr->title);