OSDN Git Service

hengbandforosx/hengbandosx.git
20 months ago[Refactor] #2651 Renamed get_rnd_line() to get_random_line()
Hourier [Fri, 23 Dec 2022 11:55:48 +0000 (20:55 +0900)]
[Refactor] #2651 Renamed get_rnd_line() to get_random_line()

20 months agoMerge pull request #3008 from backwardsEric/monster_desc-refactor-cleanup
Hourier [Tue, 27 Dec 2022 08:33:39 +0000 (17:33 +0900)]
Merge pull request #3008 from backwardsEric/monster_desc-refactor-cleanup

Cleanup the monster_desc() refactoring.

20 months agoMerge pull request #3015 from habu1010/feature/fix-incorrectly-describe-monster-corpse
Habu [Tue, 27 Dec 2022 08:32:20 +0000 (17:32 +0900)]
Merge pull request #3015 from habu1010/feature/fix-incorrectly-describe-monster-corpse

[Fix] モンスターの死体や骨が正しく表示されない

20 months agoCleanup the monster_desc() refactoring.
Eric Branlund [Mon, 26 Dec 2022 13:23:18 +0000 (06:23 -0700)]
Cleanup the monster_desc() refactoring.

20 months ago[Fix] モンスターの死体や骨が正しく表示されない
Habu [Mon, 26 Dec 2022 15:30:02 +0000 (00:30 +0900)]
[Fix] モンスターの死体や骨が正しく表示されない

describe_flavor をリファクタリングした時に basename と modstr の順序が誤って逆に
なっていた。正しい順序に修正する。

20 months agoMerge pull request #3013 from habu1010/feature/refactor-monster-ball
Habu [Mon, 26 Dec 2022 14:25:56 +0000 (23:25 +0900)]
Merge pull request #3013 from habu1010/feature/refactor-monster-ball

[Refactor] モンスターボール発動のソースコード

20 months ago[Refactor] モンスターボール発動のソースコード
Habu [Mon, 26 Dec 2022 13:25:47 +0000 (22:25 +0900)]
[Refactor] モンスターボール発動のソースコード

- 特に必要なさそうだったので ae_type から切り離す
- ポインタを使用したコードをC++風に書き換え
- 関数名と引数をそれらしく調整

20 months agoMerge pull request #3011 from Hourier/Extract-Macro-Function-Grid
Hourier [Mon, 26 Dec 2022 13:14:03 +0000 (22:14 +0900)]
Merge pull request #3011 from Hourier/Extract-Macro-Function-Grid

マクロ関数update_local_illumination_aux() を普通の関数に展開した

20 months ago[Refactor] Extract macro function 'update_local_illumination_aux()' to normal function
Hourier [Mon, 26 Dec 2022 12:39:13 +0000 (21:39 +0900)]
[Refactor] Extract macro function 'update_local_illumination_aux()' to normal function

20 months ago[Refactor] Moved MONSTER_FLOW_DEPTH to using point
Hourier [Mon, 26 Dec 2022 12:39:01 +0000 (21:39 +0900)]
[Refactor] Moved MONSTER_FLOW_DEPTH to using point

20 months agoMerge pull request #3010 from habu1010/feature/gf-colors-to-string
Habu [Mon, 26 Dec 2022 12:19:36 +0000 (21:19 +0900)]
Merge pull request #3010 from habu1010/feature/gf-colors-to-string

[Refactor] gf_colors に直接 std::string を持たせる

20 months agoMerge pull request #3009 from habu1010/feature/refactor-pet-name
Habu [Mon, 26 Dec 2022 12:19:21 +0000 (21:19 +0900)]
Merge pull request #3009 from habu1010/feature/refactor-pet-name

[Refactor] MonsterEntity::nickname をquarkインデックスから std::string に変える

20 months ago[Refactor] gf_colors に直接 std::string を持たせる
Habu [Mon, 26 Dec 2022 09:55:02 +0000 (18:55 +0900)]
[Refactor] gf_colors に直接 std::string を持たせる

既存の gf_colors (魔法やブレスなどの属性毎の描画色定義) は quark_str のインデック
スを保持している。これを std::string を直接持つように変更する。

20 months ago[Refactor] MonsterEntity::nickname の型を std::string に変更
Habu [Mon, 26 Dec 2022 09:50:35 +0000 (18:50 +0900)]
[Refactor] MonsterEntity::nickname の型を std::string に変更

既存の quark_str のインデックスを格納する方式から直接 std::string 型で文字列を格納
する方式に変更する。

20 months ago[Refactor] モンスター(ペット)に名付けているか判定するメソッドを追加
Habu [Mon, 26 Dec 2022 09:50:34 +0000 (18:50 +0900)]
[Refactor] モンスター(ペット)に名付けているか判定するメソッドを追加

MonsterEntity::nickname は quark_str のインデックスを保持しており、名付け済みか
どうかを nickname が非ゼロかどうか直接比較することで判定している。
わかりやすくするため、is_named() メソッドを追加し、代わりにこれを使用する。
また、まず is_pet() でペットかどうか調べた後に nickname を調べるというパターンが
頻出するため、is_named_pet() メソッドも追加し、このメソッドでまとめて調べられるよう
にする。

20 months agoMerge pull request #3007 from habu1010/feature/fix-string-view-constructor-overload
Habu [Sun, 25 Dec 2022 15:25:54 +0000 (00:25 +0900)]
Merge pull request #3007 from habu1010/feature/fix-string-view-constructor-overload

[Fix] Apple Clang で日本語版がコンパイルできない

20 months ago[Fix] Apple Clang で日本語版がコンパイルできない
Habu [Sun, 25 Dec 2022 15:17:43 +0000 (00:17 +0900)]
[Fix] Apple Clang で日本語版がコンパイルできない

std::string_view のイテレータのペアを引数に取るコンストラクタのオーバーロードがまだ
Apple Clang でサポートされていないためコンパイルエラーになる。
サポートされている、文字列の先頭文字へのポインタと文字列の長さを取るオーバーロードに変
更する。(そもそもこちらのほうが素直だし最初からこちらにするべきだった)

20 months agoMerge pull request #3006 from backwardsEric/remove-print_header-wizard-fixed-artifact...
Hourier [Sun, 25 Dec 2022 14:43:33 +0000 (23:43 +0900)]
Merge pull request #3006 from backwardsEric/remove-print_header-wizard-fixed-artifacts-spoiler

Refactor: remove wizard/fixed-artifacts-spoiler.cpp's print_header()

20 months agoRefactor: remove wizard/fixed-artifacts-spoiler.cpp's print_header()
Eric Branlund [Sun, 25 Dec 2022 13:42:36 +0000 (06:42 -0700)]
Refactor: remove wizard/fixed-artifacts-spoiler.cpp's print_header()

20 months agoMerge pull request #3004 from sikabane-works/release/3.0.0Alpha73
Deskull [Sun, 25 Dec 2022 13:20:22 +0000 (22:20 +0900)]
Merge pull request #3004 from sikabane-works/release/3.0.0Alpha73

[Release] 3.0.0Alpha73

20 months ago[Release] 3.0.0Alpha73
Deskull [Sun, 25 Dec 2022 13:06:21 +0000 (22:06 +0900)]
[Release] 3.0.0Alpha73

20 months agoMerge pull request #2981 from backwardsEric/sprintf-refactor-monster_desc
Hourier [Sun, 25 Dec 2022 12:27:59 +0000 (21:27 +0900)]
Merge pull request #2981 from backwardsEric/sprintf-refactor-monster_desc

Refactor monster_desc() to avoid sprintf().  To work with the …

20 months agoMerge pull request #2974 from backwardsEric/sprintf-refactor-put_version
Hourier [Sun, 25 Dec 2022 12:27:08 +0000 (21:27 +0900)]
Merge pull request #2974 from backwardsEric/sprintf-refactor-put_version

Rename put_version() to get_version(); refactor it to avoid sprintf()…

20 months agoMerge pull request #3000 from habu1010/feature/refactor-item-inscription-to-string
Habu [Sun, 25 Dec 2022 07:04:17 +0000 (16:04 +0900)]
Merge pull request #3000 from habu1010/feature/refactor-item-inscription-to-string

[Refactor] ItemEntity::inscription の型を変更

20 months agoMerge pull request #2999 from habu1010/feature/fix-torch-stack
Habu [Sun, 25 Dec 2022 06:48:20 +0000 (15:48 +0900)]
Merge pull request #2999 from habu1010/feature/fix-torch-stack

[Fix] 光源のスタックの挙動がおかしい

20 months ago[Refactor] ItemEntity::inscription の型を変更
Habu [Sun, 25 Dec 2022 05:37:50 +0000 (14:37 +0900)]
[Refactor] ItemEntity::inscription の型を変更

既存の quark_str のインデクスを持たせる方式から文字列を直接持たせる方式に変更する。
空文字列を銘を刻んでいない状態とするのはやや紛らわしくなるので、
std::optional<std::string> 型とし、銘を刻んでいない場合は値を std::nullopt と
する。

20 months ago[Fix] 光源のスタックの挙動がおかしい
Habu [Sun, 25 Dec 2022 06:07:14 +0000 (15:07 +0900)]
[Fix] 光源のスタックの挙動がおかしい

光源のスタックの挙動において、重なるべきものが重ならなかったり、逆に重ならないはずのも
のが重なったりする。
おかしな挙動の原因は2つ。

- 初期所持の光源は pval が初期値のままだが、店売りアイテムは LiteEnchanter により
  pval が 0 になる。したがって pval が異なることにより重ならない。
- 店のアイテムのスタック判定 store_object_similar で fuel の値が考慮されていない
  ため、残りターン数が異なっても重なってしまう。

LiteEnchanter で pval を 0 にせずそのままの値とし、store_object_similar には
fuel の比較を追加することで修正する。

20 months agoMerge pull request #2997 from habu1010/feature/refactor-itementity-art_name
Habu [Sun, 25 Dec 2022 04:05:44 +0000 (13:05 +0900)]
Merge pull request #2997 from habu1010/feature/refactor-itementity-art_name

[Refactor] ItemEntity::art_name の型/名称を変更

20 months agoMerge pull request #2996 from habu1010/feature/fix-monster-expload-no-damge
Habu [Sun, 25 Dec 2022 03:31:46 +0000 (12:31 +0900)]
Merge pull request #2996 from habu1010/feature/fix-monster-expload-no-damge

[Fix] モンスターの爆発でプレイヤーがダメージを受けない

20 months agoMerge pull request #2994 from habu1010/feature/fix-killing-monster-message
Habu [Sun, 25 Dec 2022 03:31:34 +0000 (12:31 +0900)]
Merge pull request #2994 from habu1010/feature/fix-killing-monster-message

[Fix] モンスターを倒した時のメッセージがおかしい

20 months ago[Refactor] ItemEntity::art_name の型/名称を変更
Habu [Sun, 25 Dec 2022 03:27:51 +0000 (12:27 +0900)]
[Refactor] ItemEntity::art_name の型/名称を変更

quark_add/quark_str のインデクスを持たせるのではなく直接文字列を持たせるようにする。
既存のインデクスが0以外ならランダムアーティファクト、0なら非ランダムアーティファクト
という仕様を維持するため std::optional<std::string> 型にし、非ランダムアーティファ
クトの場合は std::nullopt とする。
また明確にランダムアーティファクトの名称である事がわかるようにするためメンバの名称を
randart_name に変更する。

20 months ago[Fix] モンスターが爆発した時のメッセージ
Habu [Sun, 25 Dec 2022 02:55:10 +0000 (11:55 +0900)]
[Fix] モンスターが爆発した時のメッセージ

生命が無いモンスターが爆発した時と同じく、生命があるモンスターが爆発した時も専用のメッ
セージを表示する。

20 months ago[Fix] モンスターの爆発でプレイヤーがダメージを受けない
Habu [Sun, 25 Dec 2022 02:24:54 +0000 (11:24 +0900)]
[Fix] モンスターの爆発でプレイヤーがダメージを受けない

過去に HURT に対応する AttributeType が MONSTER_MELEE に変更されたが、その時
switch_effects_player に MONSTER_MELEE が追加されなかったため、爆発のダメージが
入らなくなっている。
ひとまず元の MISSILE と同じく MONSTER_MELEE でも effect_player_missile を呼ぶ
ようにしておく。

20 months ago[Fix] モンスターを倒した時のメッセージがおかしい
Habu [Sun, 25 Dec 2022 02:17:10 +0000 (11:17 +0900)]
[Fix] モンスターを倒した時のメッセージがおかしい

以前行われていた、モンスターを倒した時の状況に合わせた「殺した・葬り去った・倒した」の
メッセージ切り替えが、リファクタリング時にすべて「殺した」になってしまっていたので元の
仕様に戻す。

20 months agoMerge pull request #2992 from habu1010/feature/apply-kinsoku-list-to-roff
Habu [Sun, 25 Dec 2022 01:58:15 +0000 (10:58 +0900)]
Merge pull request #2992 from habu1010/feature/apply-kinsoku-list-to-roff

shape_buffer で使用している is_kinsoku 関数を c_roff の折り返し表示にも適用する

20 months agoMerge pull request #2989 from habu1010/feature/fix-mod-virtue-when-make-randart
Habu [Sun, 25 Dec 2022 00:44:41 +0000 (09:44 +0900)]
Merge pull request #2989 from habu1010/feature/fix-mod-virtue-when-make-randart

[Fix] 巻物でアーティファクトを生成した時に得が変化しない事がある

20 months agoMerge pull request #2988 from habu1010/feature/refactor-determine-if-randart
Habu [Sun, 25 Dec 2022 00:44:20 +0000 (09:44 +0900)]
Merge pull request #2988 from habu1010/feature/refactor-determine-if-randart

[Refactor] アイテムがランダムアーティファクトかどうかの判定にメソッドを使用する

20 months agoMerge pull request #2987 from Hourier/Fix-Compilation-Error-Record-Play-Movie
Hourier [Sun, 25 Dec 2022 00:42:22 +0000 (09:42 +0900)]
Merge pull request #2987 from Hourier/Fix-Compilation-Error-Record-Play-Movie

record-play-movie.cpp のコンパイルエラーを修正した

20 months ago[Fix] c_roff 関数の禁則処理に is_kinsoku 関数を適用する
Habu [Sat, 24 Dec 2022 18:15:36 +0000 (03:15 +0900)]
[Fix] c_roff 関数の禁則処理に is_kinsoku 関数を適用する

c_roff 関数で行頭禁則を行う文字は現在句読点のみとなっているが、shape_buffer リファ
クタリング時に作成した禁則文字判定関数 is_kinsoku を適用して、他の行頭禁則するべき
文字でも禁則処理が行われるようにする。

20 months ago[Refactor] is_kinsoku 関数を japanese.cpp/h に移設
Habu [Sat, 24 Dec 2022 18:12:34 +0000 (03:12 +0900)]
[Refactor] is_kinsoku 関数を japanese.cpp/h に移設

shape_buffer からだけでなく他の翻訳単位からも使用できるようにグローバルスコープ関数
にする。

20 months ago[Fix] 巻物でアーティファクトを生成した時に得が変化しない事がある
Habu [Sat, 24 Dec 2022 14:56:12 +0000 (23:56 +0900)]
[Fix] 巻物でアーティファクトを生成した時に得が変化しない事がある

アーティファクト生成の巻物でランダムアーティファクトを生成した時、「秘」と「個」の徳が
上昇するようになっているが、名付けをキャンセルしてランダムな名前を付けた時にこれらの徳
があがらなくなっている。
常に上昇するよう修正する。

20 months ago[Refactor] アイテムがランダムアーティファクトかどうかの判定にメソッドを使用する
Habu [Sat, 24 Dec 2022 14:37:19 +0000 (23:37 +0900)]
[Refactor] アイテムがランダムアーティファクトかどうかの判定にメソッドを使用する

現状、アイテムがランダムアーティファクトかどうかの判定は art_name が 0 かどうか
(art_name は名称が登録された quark_str のインデクスを持つ) で判断しており、それを
ラップするメソッド ItemEntity::is_random_artifact が用意されているがこれが正しく
使用されていない箇所が多数あるので、すべてこのメソッドを使用するように変更する。

20 months agoMerge pull request #2984 from backwardsEric/counts_seek-uninit-write
Habu [Sat, 24 Dec 2022 14:09:10 +0000 (23:09 +0900)]
Merge pull request #2984 from backwardsEric/counts_seek-uninit-write

Initialize all of a buffer in counts_seek().  …

20 months agoInitialize all of a buffer in counts_seek(). Resolves https://github.com/hengband...
Eric Branlund [Sat, 24 Dec 2022 13:52:31 +0000 (06:52 -0700)]
Initialize all of a buffer in counts_seek().  Resolves https://github.com/hengband/hengband/issues/2983 .  Initialize all of temp2 as well to silence bogus Visual Studio 2022 warning.

20 months ago[Refactor] ItemEntity に銘が刻まれているかどうか判定するメソッドを追加
Habu [Sun, 25 Dec 2022 04:35:52 +0000 (13:35 +0900)]
[Refactor] ItemEntity に銘が刻まれているかどうか判定するメソッドを追加

銘が刻まれているかどうかの判定を ItemEntity::inscription の値が非ゼロかどうか比較
することで行っているが、inscription の std::string 化にそなえて
ItemEntity::is_inscribed() を新設し、判定箇所をこのメソッドで置き換える。

20 months agoMerge pull request #2980 from habu1010/feature/refactor-show-killing-monster
Habu [Sat, 24 Dec 2022 06:43:15 +0000 (15:43 +0900)]
Merge pull request #2980 from habu1010/feature/refactor-show-killing-monster

[Fix/Refactor] 殺されたモンスター名を墓石に表示するコード

20 months ago[Refactor] split_max を大文字のSPLIT_MAX に変更した
Hourier [Sat, 24 Dec 2022 06:06:28 +0000 (15:06 +0900)]
[Refactor] split_max を大文字のSPLIT_MAX に変更した

20 months ago[Refactor] send_text_to_chuukei_server() をearly return に変更した
Hourier [Sat, 24 Dec 2022 06:05:35 +0000 (15:05 +0900)]
[Refactor] send_text_to_chuukei_server() をearly return に変更した

20 months ago[Fix] Shift-JISかつ日本語の時にコンパイルエラーが出る箇所を修正した
Hourier [Sat, 24 Dec 2022 06:02:06 +0000 (15:02 +0900)]
[Fix] Shift-JISかつ日本語の時にコンパイルエラーが出る箇所を修正した

20 months agoMerge pull request #2986 from habu1010/feature/fix-signal-handler-for-sigkill
Habu [Sat, 24 Dec 2022 04:42:20 +0000 (13:42 +0900)]
Merge pull request #2986 from habu1010/feature/fix-signal-handler-for-sigkill

[Fix] SIGKILL にシグナルハンドラを設定している

20 months agoMerge pull request #2985 from habu1010/feature/fix-to-not-use-one-ranges-proposal
Habu [Sat, 24 Dec 2022 04:06:03 +0000 (13:06 +0900)]
Merge pull request #2985 from habu1010/feature/fix-to-not-use-one-ranges-proposal

[Fix] std::ranges::transform -> std::transform

20 months agoMerge pull request #2970 from backwardsEric/sprintf-refactor-get_random_name
Hourier [Sat, 24 Dec 2022 04:02:43 +0000 (13:02 +0900)]
Merge pull request #2970 from backwardsEric/sprintf-refactor-get_random_name

Refactor get_table_{name,name_aux,sindarin,sindarin_aux}() to avoid …

20 months agoMerge pull request #2953 from backwardsEric/sprintf-refactor-record-play-movie
Hourier [Sat, 24 Dec 2022 04:00:11 +0000 (13:00 +0900)]
Merge pull request #2953 from backwardsEric/sprintf-refactor-record-play-movie

Refactor record-play-movie.cpp to avoid sprintf().  Does part of the …

20 months ago[Fix] SIGKILL にシグナルハンドラを設定している
Habu [Sat, 24 Dec 2022 03:31:10 +0000 (12:31 +0900)]
[Fix] SIGKILL にシグナルハンドラを設定している

SIGKILL はいかなる手段を用いても捕捉不可能なシグナルであり、シグナルハンドラを設定する
事自体間違いなので削除する。

20 months ago[Fix] std::ranges::transform -> std::transform
Habu [Sat, 24 Dec 2022 02:40:46 +0000 (11:40 +0900)]
[Fix] std::ranges::transform -> std::transform

Apple Clang 14 ではまだ The One Ranges Proposal がサポートされていないので、
C++20 で追加された std::ranges::* のSTLアルゴリズムが使用できない。
したがって従来の通りイテレータペアを受け取る std::transform を使用する。

20 months agoRefactor monster_desc() to avoid sprintf(). To work with the refactored monster_desc...
Eric Branlund [Fri, 23 Dec 2022 20:25:19 +0000 (13:25 -0700)]
Refactor monster_desc() to avoid sprintf().  To work with the refactored monster_desc(), refactor monster_name() and change the prototypes for MonsterDamageProcessor's death_amberites(), dying_scream(), show_bounty_message(), and show_kill_message().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

20 months agoRefactor get_table_{name,name_aux,sindarin,sindarin_aux}() and sindarin_to_kana(...
Eric Branlund [Fri, 23 Dec 2022 15:57:27 +0000 (08:57 -0700)]
Refactor get_table_{name,name_aux,sindarin,sindarin_aux}() and sindarin_to_kana() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

20 months agoRefactor record-play-movie.cpp to avoid sprintf(). Does part of the work of resolvin...
Eric Branlund [Fri, 23 Dec 2022 15:46:39 +0000 (08:46 -0700)]
Refactor record-play-movie.cpp to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

20 months ago[Refactor] 墓石に文字列を表示する処理
Habu [Fri, 23 Dec 2022 15:26:05 +0000 (00:26 +0900)]
[Refactor] 墓石に文字列を表示する処理

墓石に文字列を表示する時、put_str(center_string(…), row, col)としており、
center_string をかますのと col の値は必ず同じなのでラッパー関数 show_tomb_line
を作成してそれを呼び出すようにする。これによりコードの煩雑さがかなり解消される。
center_string は他のパターンでは呼ばれないので show_tomb_line に吸収する。

20 months ago[Refactor] 墓石に表示する情報の表示座標用の定数を定義
Habu [Fri, 23 Dec 2022 14:54:47 +0000 (23:54 +0900)]
[Refactor] 墓石に表示する情報の表示座標用の定数を定義

20 months agoRename put_version() to get_version(); refactor it to avoid sprintf(). Does part...
Eric Branlund [Fri, 23 Dec 2022 14:25:19 +0000 (07:25 -0700)]
Rename put_version() to get_version(); refactor it to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

20 months ago[Fix/Refactor] 殺されたモンスター名を墓石に表示するコード
Habu [Fri, 23 Dec 2022 14:14:03 +0000 (23:14 +0900)]
[Fix/Refactor] 殺されたモンスター名を墓石に表示するコード

プレイヤーが殺されたモンスターの名称を墓石に表示する時、最大2行にわたって表示するが、
2行に収まりきらない場合に残りを省略するコードが意図通りに動作していないので修正する。
また、モンスター名称を墓石に表示する時の仕様について doxygen コメントを追加し、関連
する周辺コードをリファクタリングする。

20 months agoMerge pull request #2979 from habu1010/feature/refactor-shape-buffer
Habu [Fri, 23 Dec 2022 13:37:13 +0000 (22:37 +0900)]
Merge pull request #2979 from habu1010/feature/refactor-shape-buffer

[Refactor] shape_buffer のシグネチャ変更に伴うリファクタリング

20 months ago[Refactor] shape_buffer のシグネチャ変更に伴うリファクタリング
Habu [Fri, 23 Dec 2022 10:39:06 +0000 (19:39 +0900)]
[Refactor] shape_buffer のシグネチャ変更に伴うリファクタリング

shape_buffer のシグネチャを結果を格納するバッファ領域を指すポインタを受け取る方式から
std::string 型文字列の配列を返す方式に変更する。

20 months agoMerge pull request #2975 from backwardsEric/sprintf-refactor-cnv_stat
Hourier [Fri, 23 Dec 2022 10:16:21 +0000 (19:16 +0900)]
Merge pull request #2975 from backwardsEric/sprintf-refactor-cnv_stat

Refactor cnv_stat() to avoid sprintf().  Does part of the work of …

20 months agoMerge pull request #2973 from backwardsEric/sprintf-refactor_get_element_effect_info
Hourier [Fri, 23 Dec 2022 10:12:38 +0000 (19:12 +0900)]
Merge pull request #2973 from backwardsEric/sprintf-refactor_get_element_effect_info

Refactor get_element_effect_info() to avoid sprintf().  Does part of …

20 months agoMerge pull request #2972 from backwardsEric/sprintf-refactor-mindcraft_info
Hourier [Fri, 23 Dec 2022 10:06:49 +0000 (19:06 +0900)]
Merge pull request #2972 from backwardsEric/sprintf-refactor-mindcraft_info

Refactor mindcraft_info() to avoid sprintf().  Does part of the work …

20 months agoMerge pull request #2971 from backwardsEric/sprintf-refactor-mane_info
Hourier [Fri, 23 Dec 2022 10:03:32 +0000 (19:03 +0900)]
Merge pull request #2971 from backwardsEric/sprintf-refactor-mane_info

Refactor mane_info() to avoid sprintf().  Does part of the work of …

20 months agoMerge pull request #2978 from habu1010/feature/language-standard-version-to-c++20
Habu [Fri, 23 Dec 2022 10:02:56 +0000 (19:02 +0900)]
Merge pull request #2978 from habu1010/feature/language-standard-version-to-c++20

[Feature] C++ 言語の標準バージョンを C++20 にする

20 months agoRefactor get_element_effect_info() to avoid sprintf(). Does part of the work of...
Eric Branlund [Thu, 22 Dec 2022 19:17:06 +0000 (12:17 -0700)]
Refactor get_element_effect_info() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

20 months agoRefactor mane_info() to avoid sprintf(). Does part of the work of resolving https...
Eric Branlund [Thu, 22 Dec 2022 19:09:25 +0000 (12:09 -0700)]
Refactor mane_info() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and github.com/hengband/hengband/issues/2859 .

20 months agoRefactor mindcraft_info() to avoid sprintf(). Does part of the work of resolving...
Eric Branlund [Thu, 22 Dec 2022 19:03:08 +0000 (12:03 -0700)]
Refactor mindcraft_info() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

20 months agoRefactor cnv_stat() to avoid sprintf(). Does part of the work of resolving https...
Eric Branlund [Thu, 22 Dec 2022 18:47:40 +0000 (11:47 -0700)]
Refactor cnv_stat() to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

20 months ago[Fix] maid-x11.cpp に残っていた volatile 修飾子を削除
Habu [Thu, 22 Dec 2022 14:33:32 +0000 (23:33 +0900)]
[Fix] maid-x11.cpp に残っていた volatile 修飾子を削除

C++20 では volatile は deprecated なので削除する。

20 months ago[Fix] 言語標準バージョンをチェックする autoconf 用マクロから volatile 削除
Habu [Thu, 22 Dec 2022 14:19:11 +0000 (23:19 +0900)]
[Fix] 言語標準バージョンをチェックする autoconf 用マクロから volatile 削除

C++20 では volatile は deplecated 扱いであり、configure の実行中に volatile
を含むコードで警告が発生する。CI のコンパイルテストで -Werror を指定しているため、
警告がエラー扱いとなり configure がエラー終了してしまい、その結果テストが通らなくなる。
対策として autoconf 用マクロのコードから volatile を削除する。

20 months ago[Feature] C++ 言語の標準バージョンを C++20 にする
Habu [Thu, 22 Dec 2022 13:58:34 +0000 (22:58 +0900)]
[Feature] C++ 言語の標準バージョンを C++20 にする

各プラットフォームで対応の準備が整ったので、C++ 言語の標準バージョンを C++20 にする。
なお、Visual Studio 用プロジェクトの設定は latest (C++23 の機能を含むプレビュー
バージョン)が指定されていたが、こちらも C++20 を指定することとする。

20 months agoMerge pull request #2969 from habu1010/feature/upgrade-workflow-gcc-clang-for-c++20
Habu [Thu, 22 Dec 2022 11:11:44 +0000 (20:11 +0900)]
Merge pull request #2969 from habu1010/feature/upgrade-workflow-gcc-clang-for-c++20

[Fix] CIで使用するコンパイラのバージョンをアップデート

20 months agoMerge pull request #2977 from backwardsEric/character-sheet-Actual-Current-alignment
Habu [Thu, 22 Dec 2022 09:37:40 +0000 (18:37 +0900)]
Merge pull request #2977 from backwardsEric/character-sheet-Actual-Current-alignment

English:  shift "Actual" and "Current" labels two characters to the …

20 months agoEnglish: shift "Actual" and "Current" labels two characters to the right on the...
Eric Branlund [Wed, 21 Dec 2022 21:09:06 +0000 (14:09 -0700)]
English:  shift "Actual" and "Current" labels two characters to the right on the third page of the character sheet; resolves https://github.com/hengband/hengband/issues/2976 .

20 months ago[Fix] CIで使用するコンパイラのバージョンをアップデート
Habu [Wed, 21 Dec 2022 14:34:50 +0000 (23:34 +0900)]
[Fix] CIで使用するコンパイラのバージョンをアップデート

C++20に備えるため、gccのバージョンを11、clangのバージョンを14にする。
また runner をこれらのコンパイラ・ツールチェインがデフォルトでインストールされている
Ubuntu-22.04 にする。
さらに Node.js 12 のサポート終了にともない、 ccache-action のバージョンを 1 から
1.2 にする。

20 months agoMerge pull request #2968 from habu1010/feature/fix-for-github-actions-nodejs-12-deple...
Habu [Wed, 21 Dec 2022 14:33:30 +0000 (23:33 +0900)]
Merge pull request #2968 from habu1010/feature/fix-for-github-actions-nodejs-12-deplecated

[Fix] Workflow ファイルの actions/checkout のバージョン更新

20 months agoMerge pull request #2966 from Hourier/Change-GetRandomLine-Signature
Hourier [Wed, 21 Dec 2022 14:32:52 +0000 (23:32 +0900)]
Merge pull request #2966 from Hourier/Change-GetRandomLine-Signature

get_random_name() の戻り値をvoidからstd::string に変え、char * の引数を削除した

20 months ago[Fix] Workflow ファイルの actions/checkout のバージョン更新
Habu [Wed, 21 Dec 2022 14:25:35 +0000 (23:25 +0900)]
[Fix] Workflow ファイルの actions/checkout のバージョン更新

GitHub Actions の Node.js 12 のサポート終了に伴い、 actions/checkout@v2 が
使用できなくなるので、actions/checkout@v3 に更新する。

20 months ago[Refactor] #2749 get_random_name() の戻り値をvoidからstd::string に変え、char * の引数を削除した
Hourier [Wed, 21 Dec 2022 14:06:24 +0000 (23:06 +0900)]
[Refactor] #2749 get_random_name() の戻り値をvoidからstd::string に変え、char * の引数を削除した

20 months agoMerge pull request #2962 from habu1010/feature/refactor-format-retval-to-string
Habu [Wed, 21 Dec 2022 12:59:34 +0000 (21:59 +0900)]
Merge pull request #2962 from habu1010/feature/refactor-format-retval-to-string

[Refactor] format 関数の戻り値を std::string にする

20 months ago[Refactor] format 関数の戻り値を std::string にする
Habu [Wed, 21 Dec 2022 10:17:04 +0000 (19:17 +0900)]
[Refactor] format 関数の戻り値を std::string にする

既存の format 関数は、結果文字列を関数内部で保持している静的バッファ領域に格納しそれ
に対するポインタを返すという仕様のため、非常に注意深く使用する必要がある。
使いにくくて仕方がないので std::string オブジェクトを返すようにし、format 関数を
呼んだ側が確実に自由に結果文字列を扱えるようにする。

20 months agoMerge pull request #2940 from backwardsEric/sprintf-string-format
Habu [Wed, 21 Dec 2022 10:08:34 +0000 (19:08 +0900)]
Merge pull request #2940 from backwardsEric/sprintf-string-format

Replace sprintf() with std::string and/or format().  Does part of the…

20 months agoReplace sprintf() with std::string and/or format(). Does part of the work of resolvi...
Eric Branlund [Tue, 20 Dec 2022 18:48:50 +0000 (11:48 -0700)]
Replace sprintf() with std::string and/or format().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

20 months agoMerge pull request #2946 from backwardsEric/sprintf-refactor-tombstone-generation
Habu [Tue, 20 Dec 2022 14:15:11 +0000 (23:15 +0900)]
Merge pull request #2946 from backwardsEric/sprintf-refactor-tombstone-generation

Refactor tombstone generation to avoid sprintf().  Does part of the …

20 months agoMerge pull request #2943 from backwardsEric/sprintf-refactor-birth-selections
Habu [Tue, 20 Dec 2022 14:01:40 +0000 (23:01 +0900)]
Merge pull request #2943 from backwardsEric/sprintf-refactor-birth-selections

Refactor birth class/personality/race/sex selection to avoid sprintf()…

20 months agoRefactor tombstone generation to avoid sprintf(). Does part of the work of resolving...
Eric Branlund [Tue, 20 Dec 2022 13:45:38 +0000 (06:45 -0700)]
Refactor tombstone generation to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

20 months agoRefactor birth class/personality/race/sex selection to avoid sprintf(). Does part...
Eric Branlund [Tue, 20 Dec 2022 13:40:04 +0000 (06:40 -0700)]
Refactor birth class/personality/race/sex selection to avoid sprintf().  Does part of the work of resolving https://github.com/hengband/hengband/issues/2858 and https://github.com/hengband/hengband/issues/2859 .

20 months agoMerge pull request #2948 from backwardsEric/sprintf-refactor-item_activation_aux
Habu [Tue, 20 Dec 2022 13:17:15 +0000 (22:17 +0900)]
Merge pull request #2948 from backwardsEric/sprintf-refactor-item_activation_aux

Refactor item_activation_aux() to avoid sprintf().  Does part of the …

20 months agoMerge pull request #2964 from backwardsEric/view-display-util-no-pch
Hourier [Mon, 19 Dec 2022 23:24:18 +0000 (08:24 +0900)]
Merge pull request #2964 from backwardsEric/view-display-util-no-pch

Include <string> to avoid compiler error on MacOS/clang when not …

20 months agoInclude <string> to avoid compiler error on MacOS/clang when not using precompiled...
Eric Branlund [Mon, 19 Dec 2022 19:35:48 +0000 (12:35 -0700)]
Include <string> to avoid compiler error on MacOS/clang when not using precompiled headers.  Resolves https://github.com/hengband/hengband/issues/2963 .

20 months agoMerge pull request #2961 from habu1010/feature/refactor-get_quantity-signature
Habu [Mon, 19 Dec 2022 13:11:56 +0000 (22:11 +0900)]
Merge pull request #2961 from habu1010/feature/refactor-get_quantity-signature

[Refactor] get_quantity 関数のシグネチャ変更

20 months ago[Refactor] get_quantity 関数のシグネチャ変更
Habu [Mon, 19 Dec 2022 12:22:41 +0000 (21:22 +0900)]
[Refactor] get_quantity 関数のシグネチャ変更

他の get_* シリーズと違い、既存の仕様で nullptr が渡された時にデフォルトメッセージを
表示するという仕様があるので単純に std::string_view にできない。
したがって std::optional<std::string_view> にし、std::nullopt で対応する。

20 months agoMerge pull request #2957 from habu1010/feature/refactor-exe_spell-return-value
Habu [Mon, 19 Dec 2022 12:16:02 +0000 (21:16 +0900)]
Merge pull request #2957 from habu1010/feature/refactor-exe_spell-return-value

[Refactor] exe_spell 関数の戻り値の型を変更

20 months agoMerge pull request #2960 from Hourier/Fix-Compilation-Warning-LevelDesc
Hourier [Mon, 19 Dec 2022 12:07:34 +0000 (21:07 +0900)]
Merge pull request #2960 from Hourier/Fix-Compilation-Warning-LevelDesc

引数とローカル変数名の重複を解消した

20 months ago[Fix] 引数とローカル変数名の重複を解消した
Hourier [Mon, 19 Dec 2022 12:01:43 +0000 (21:01 +0900)]
[Fix] 引数とローカル変数名の重複を解消した