Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

変愚「enums/ ディレクトリを作って1つヘッダを移した #4557」のマージ #5497

Merged
merged 2 commits into from
Dec 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Bakabakaband/Bakabakaband/Bakabakaband.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1607,7 +1607,7 @@
<ClInclude Include="..\..\src\object\item-use-flags.h" />
<ClInclude Include="..\..\src\object\object-mark-types.h" />
<ClInclude Include="..\..\src\system\building-type-definition.h" />
<ClInclude Include="..\..\src\system\game-option-types.h" />
<ClInclude Include="..\..\src\system\enums\game-option-page.h" />
<ClInclude Include="..\..\src\system\monster-race-info.h" />
<ClInclude Include="..\..\src\system\item-entity.h" />
<ClInclude Include="..\..\src\object-enchant\old-ego-extra-values.h" />
Expand Down
25 changes: 15 additions & 10 deletions Bakabakaband/Bakabakaband/Bakabakaband.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -2514,6 +2514,9 @@
<ClCompile Include="..\..\src\monster\monster-timed-effects.cpp">
<Filter>monster</Filter>
</ClCompile>
<ClCompile Include="..\..\src\save\monster-entity-writer.cpp">
<Filter>save</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\src\combat\shoot.h">
Expand Down Expand Up @@ -3818,9 +3821,6 @@
<ClInclude Include="..\..\src\monster-floor\monster-summon.h">
<Filter>monster-floor</Filter>
</ClInclude>
<ClInclude Include="..\..\src\system\game-option-types.h">
<Filter>system</Filter>
</ClInclude>
<ClInclude Include="..\..\src\game-option\input-options.h">
<Filter>game-option</Filter>
</ClInclude>
Expand Down Expand Up @@ -5437,13 +5437,15 @@
<ClInclude Include="..\..\src\market\melee-arena.h">
<Filter>market</Filter>
</ClInclude>
<ClInclude Include="..\..\src\util\candidate-selector.h" />
<ClInclude Include="..\..\src\monster-race\race-flags8.h" />
<ClInclude Include="..\..\src\monster-race\race-flags1.h" />
<ClInclude Include="..\..\src\monster-race\race-flags2.h" />
<ClInclude Include="..\..\src\monster-race\race-flags3.h" />
<ClInclude Include="..\..\src\monster-race\race-flags7.h" />
<ClInclude Include="..\..\src\util\stack-trace.h" />
<ClInclude Include="..\..\src\floor\floor-list.h">
<Filter>floor</Filter>
</ClInclude>
<ClInclude Include="..\..\src\save\monster-entity-writer.h">
<Filter>save</Filter>
</ClInclude>
<ClInclude Include="..\..\src\system\enums\game-option-page.h">
<Filter>system\enums</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\src\wall.bmp" />
Expand Down Expand Up @@ -5711,6 +5713,9 @@
<Filter Include="tracking">
<UniqueIdentifier>{a5b8bf13-a675-4500-8b4c-37ea664757eb}</UniqueIdentifier>
</Filter>
<Filter Include="system\enums">
<UniqueIdentifier>{31491e27-d3e4-4605-b68a-c2c00d563479}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="..\..\src\angband.rc" />
Expand Down
3 changes: 2 additions & 1 deletion src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -935,7 +935,6 @@ hengband_SOURCES = \
system/dungeon-info.cpp system/dungeon-info.h \
system/floor-type-definition.cpp system/floor-type-definition.h \
system/grid-type-definition.cpp system/grid-type-definition.h \
system/game-option-types.h \
system/h-basic.h system/h-config.h \
system/h-system.h system/h-type.h \
system/inner-game-data.cpp system/inner-game-data.h \
Expand All @@ -949,6 +948,8 @@ hengband_SOURCES = \
system/terrain-type-definition.cpp system/terrain-type-definition.h \
system/gamevalue.h \
\
system/enums/game-option-page.h \
\
target/grid-selector.cpp target/grid-selector.h \
target/projection-path-calculator.cpp target/projection-path-calculator.h \
target/target-checker.cpp target/target-checker.h \
Expand Down
43 changes: 21 additions & 22 deletions src/birth/auto-roller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#include "player/player-personality.h"
#include "player/player-sex.h"
#include "player/player-status-table.h"
#include "system/game-option-types.h"
#include "system/enums/game-option-page.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"
#include "term/term-color-types.h"
Expand All @@ -36,8 +36,8 @@ static int32_t get_autoroller_prob(int *minval)
/* 1 percent of the valid random space (60^6 && 72<sum<87) */
int32_t tot_rand_1p = 320669745;
int i, j, tmp;
int ii[A_MAX];
int tval[A_MAX];
int ii[6]{};
int tval[6]{};
int tot = 0;

/* success count */
Expand Down Expand Up @@ -365,8 +365,6 @@ void initialize_chara_limit(chara_limit_type *chara_limit_ptr)
*/
bool get_chara_limits(PlayerType *player_ptr, chara_limit_type *chara_limit_ptr)
{
#define MAXITEMS 8

concptr itemname[] = { _("年齢", "age"), _("身長(cm)", "height"), _("体重(kg)", "weight"), _("威信", "prestige") };

clear_from(10);
Expand All @@ -385,9 +383,10 @@ bool get_chara_limits(PlayerType *player_ptr, chara_limit_type *chara_limit_ptr)

put_str(_("体格/地位の最小値/最大値を設定して下さい。", "Set minimum/maximum attribute."), 10, 10);
put_str(_(" 項 目 最小値 最大値", " Parameter Min Max"), 13, 20);
int mval[MAXITEMS];
int cval[MAXITEMS];
for (int i = 0; i < MAXITEMS; i++) {
constexpr auto max_items = 8;
int mval[max_items]{};
int cval[max_items]{};
for (int i = 0; i < max_items; i++) {
int m;
switch (i) {
case 0: /* Minimum age */
Expand Down Expand Up @@ -445,7 +444,7 @@ bool get_chara_limits(PlayerType *player_ptr, chara_limit_type *chara_limit_ptr)
mval[4] = lb_to_kg(mval[4]);
mval[5] = lb_to_kg(mval[5]);
#endif
for (auto i = 0; i < MAXITEMS; i++) {
for (auto i = 0; i < max_items; i++) {
cval[i] = mval[i];
}

Expand All @@ -460,17 +459,17 @@ bool get_chara_limits(PlayerType *player_ptr, chara_limit_type *chara_limit_ptr)

std::string cur;
int cs = 0;
int os = MAXITEMS;
int os = max_items;
while (true) {
if (cs != os) {
constexpr auto accept = _("決定する", "Accept");
if (os == MAXITEMS) {
if (os == max_items) {
c_put_str(TERM_WHITE, accept, 19, 35);
} else {
c_put_str(TERM_WHITE, cur, 14 + os / 2, 45 + 8 * (os % 2));
}

if (cs == MAXITEMS) {
if (cs == max_items) {
c_put_str(TERM_YELLOW, accept, 19, 35);
} else {
cur = format(" %3d", cval[cs]);
Expand All @@ -492,7 +491,7 @@ bool get_chara_limits(PlayerType *player_ptr, chara_limit_type *chara_limit_ptr)
case ' ':
case '\r':
case '\n':
if (cs == MAXITEMS) {
if (cs == max_items) {
break;
}
cs++;
Expand All @@ -506,11 +505,11 @@ bool get_chara_limits(PlayerType *player_ptr, chara_limit_type *chara_limit_ptr)
break;
case '2':
case 'j':
if (cs < MAXITEMS) {
if (cs < max_items) {
cs += 2;
}
if (cs > MAXITEMS) {
cs = MAXITEMS;
if (cs > max_items) {
cs = max_items;
}
break;
case '4':
Expand All @@ -521,13 +520,13 @@ bool get_chara_limits(PlayerType *player_ptr, chara_limit_type *chara_limit_ptr)
break;
case '6':
case 'l':
if (cs < MAXITEMS) {
if (cs < max_items) {
cs++;
}
break;
case '-':
case '<':
if (cs != MAXITEMS) {
if (cs != max_items) {
if (cs % 2) {
if (cval[cs] > cval[cs - 1]) {
cval[cs]--;
Expand All @@ -544,7 +543,7 @@ bool get_chara_limits(PlayerType *player_ptr, chara_limit_type *chara_limit_ptr)
break;
case '+':
case '>':
if (cs != MAXITEMS) {
if (cs != max_items) {
if (cs % 2) {
if (cval[cs] < mval[cs]) {
cval[cs]++;
Expand All @@ -560,7 +559,7 @@ bool get_chara_limits(PlayerType *player_ptr, chara_limit_type *chara_limit_ptr)

break;
case 'm':
if (cs != MAXITEMS) {
if (cs != max_items) {
if (cs % 2) {
if (cval[cs] < mval[cs]) {
cval[cs] = mval[cs];
Expand All @@ -576,7 +575,7 @@ bool get_chara_limits(PlayerType *player_ptr, chara_limit_type *chara_limit_ptr)

break;
case 'n':
if (cs != MAXITEMS) {
if (cs != max_items) {
if (cs % 2) {
if (cval[cs] > cval[cs - 1]) {
cval[cs] = cval[cs - 1];
Expand Down Expand Up @@ -608,7 +607,7 @@ bool get_chara_limits(PlayerType *player_ptr, chara_limit_type *chara_limit_ptr)
break;
}

if (c == ESCAPE || ((c == ' ' || c == '\r' || c == '\n') && cs == MAXITEMS)) {
if (c == ESCAPE || ((c == ' ' || c == '\r' || c == '\n') && cs == max_items)) {
break;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/birth/birth-util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#include "cmd-io/cmd-gameoption.h"
#include "core/show-file.h"
#include "main/sound-of-music.h"
#include "system/game-option-types.h"
#include "system/enums/game-option-page.h"
#include "system/player-type-definition.h"
#include "term/screen-processor.h"

Expand Down
22 changes: 9 additions & 13 deletions src/birth/birth-wizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include "player/player-status-table.h"
#include "player/player-status.h"
#include "player/process-name.h"
#include "system/game-option-types.h"
#include "system/enums/game-option-page.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
#include "term/screen-processor.h"
Expand All @@ -47,16 +47,6 @@
#include "world/world.h"
#include <sstream>

/*!
* オートローラーの内容を描画する間隔 /
* How often the autoroller will update the display and pause
* to check for user interuptions.
* Bigger values will make the autoroller faster, but slower
* system may have problems because the user can't stop the
* autoroller for this number of rolls.
*/
#define AUTOROLLER_STEP 54321L

static void display_initial_birth_message(PlayerType *player_ptr)
{
term_clear();
Expand Down Expand Up @@ -273,7 +263,7 @@ static bool let_player_build_character(PlayerType *player_ptr)
static void display_initial_options(PlayerType *player_ptr)
{
const auto expfact_mod = static_cast<int>(get_expfact(player_ptr)) - 100;
int16_t adj[A_MAX];
int16_t adj[A_MAX]{};
for (int i = 0; i < A_MAX; i++) {
adj[i] = rp_ptr->r_adj[i] + cp_ptr->c_adj[i] + ap_ptr->a_adj[i];
}
Expand Down Expand Up @@ -398,7 +388,13 @@ static bool decide_body_spec(PlayerType *player_ptr, chara_limit_type chara_limi

static bool display_auto_roller_count(PlayerType *player_ptr, const int col)
{
if ((auto_round % AUTOROLLER_STEP) != 0) {
/*!
* @details ここで指定された回数だけロールする度にその時の結果を画面に表示する
* @todo この定数を定義した時代に比べて、CPUパワーが相当に上がっている.
* 表示部で足を引っ張っているので、タイマで数えて0.1秒/表示 くらいで良いと思われる.
*/
constexpr auto roll_results_per_display = 54321;
if ((auto_round % roll_results_per_display) != 0) {
return false;
}

Expand Down
17 changes: 9 additions & 8 deletions src/cmd-io/cmd-gameoption.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
#include "io/input-key-acceptor.h"
#include "io/write-diary.h"
#include "main/sound-of-music.h"
#include "system/game-option-types.h"
#include "system/enums/game-option-page.h"
#include "system/player-type-definition.h"
#include "system/redrawing-flags-updater.h"
#include "term/gameterm.h"
Expand All @@ -26,16 +26,16 @@
#include "view/display-messages.h"
#include "view/display-symbol.h"
#include "world/world.h"
#include <string>

#define OPT_NUM 15

namespace {
struct opts {
char key;
concptr name;
std::string name;
int row;
};

static opts option_fields[OPT_NUM] = {
const std::vector<opts> option_fields = {
{ '1', _(" キー入力 オプション", "Input Options"), 3 },
{ '2', _(" マップ画面 オプション", "Map Screen Options"), 4 },
{ '3', _(" テキスト表示 オプション", "Text Display Options"), 5 },
Expand All @@ -54,6 +54,7 @@ static opts option_fields[OPT_NUM] = {
{ 'b', _(" 初期 オプション (参照のみ)", "Birth Options (Browse Only)"), 18 },
{ 'c', _(" 詐欺 オプション", "Cheat Options"), 19 },
};
}

/*!
* @brief セーブ頻度ターンの次の値を返す
Expand Down Expand Up @@ -446,7 +447,7 @@ void do_cmd_options(PlayerType *player_ptr)
screen_save();
const auto &world = AngbandWorld::get_instance();
while (true) {
int n = OPT_NUM;
auto n = std::ssize(option_fields);
if (!world.noscore && !allow_debug_opts) {
n--;
}
Expand All @@ -459,7 +460,7 @@ void do_cmd_options(PlayerType *player_ptr)
if (i == y) {
a = TERM_L_BLUE;
}
term_putstr(5, option_fields[i].row, -1, a, format("(%c) %s", toupper(option_fields[i].key), option_fields[i].name));
term_putstr(5, option_fields[i].row, -1, a, format("(%c) %s", toupper(option_fields[i].key), option_fields[i].name.data()));
}

prt(_("<方向>で移動, Enterで決定, ESCでキャンセル, ?でヘルプ: ", "Move to <dir>, Select to Enter, Cancel to ESC, ? to help: "), 21, 0);
Expand Down Expand Up @@ -653,7 +654,7 @@ void do_cmd_options(PlayerType *player_ptr)
* @param page オプションページ番号
* @param info 表示メッセージ
*/
void do_cmd_options_aux(PlayerType *player_ptr, game_option_types page, concptr info)
void do_cmd_options_aux(PlayerType *player_ptr, game_option_page page, concptr info)
{
char ch;
int i, k = 0, n = 0, l;
Expand Down
6 changes: 3 additions & 3 deletions src/cmd-io/cmd-gameoption.h
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#pragma once

#include "system/angband.h"
#include "system/game-option-types.h"

enum game_option_page : int;
class PlayerType;
void extract_option_vars(void);
void do_cmd_options_aux(PlayerType *player_ptr, game_option_types page, concptr info);
void extract_option_vars();
void do_cmd_options_aux(PlayerType *player_ptr, game_option_page page, concptr info);
void do_cmd_options(PlayerType *player_ptr);
2 changes: 1 addition & 1 deletion src/game-option/option-types-table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
#include "game-option/play-record-options.h"
#include "game-option/special-options.h"
#include "game-option/text-display-options.h"
#include "system/game-option-types.h"
#include "system/enums/game-option-page.h"

/*!
* @brief オプションテーブル /
Expand Down
Loading
Loading