#include "system/monster-type-definition.h"
#include "system/player-type-definition.h"
#include "target/projection-path-calculator.h"
-#include "term/gameterm.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
if (delay_factor > 0) {
if (!blind && !(flag & (PROJECT_HIDE | PROJECT_FAST))) {
if (panel_contains(ny, nx) && player_has_los_bold(player_ptr, ny, nx)) {
- uint16_t p;
- TERM_COLOR a;
- p = bolt_pict(oy, ox, ny, nx, typ);
- a = PICT_A(p);
- auto c = PICT_C(p);
- print_rel(player_ptr, c, a, ny, nx);
+ print_bolt_pict(player_ptr, oy, ox, ny, nx, typ);
move_cursor_relative(ny, nx);
term_fresh();
term_xtra(TERM_XTRA_DELAY, delay_factor);
lite_spot(player_ptr, ny, nx);
term_fresh();
if (flag & (PROJECT_BEAM)) {
- p = bolt_pict(ny, nx, ny, nx, typ);
- a = PICT_A(p);
- c = PICT_C(p);
- print_rel(player_ptr, c, a, ny, nx);
+ print_bolt_pict(player_ptr, ny, nx, ny, nx, typ);
}
visual = true;
auto y = gy[i];
auto x = gx[i];
if (panel_contains(y, x) && player_has_los_bold(player_ptr, y, x)) {
- uint16_t p;
- TERM_COLOR a;
drawn = true;
- p = bolt_pict(y, x, y, x, typ);
- a = PICT_A(p);
- auto c = PICT_C(p);
- print_rel(player_ptr, c, a, y, x);
+ print_bolt_pict(player_ptr, y, x, y, x, typ);
}
}
#include "system/monster-type-definition.h"
#include "system/object-type-definition.h"
#include "system/player-type-definition.h"
+#include "term/gameterm.h"
#include "term/term-color-types.h"
#include "util/bit-flags-calculator.h"
#include "util/enum-converter.h"
}
}
+void print_bolt_pict(PlayerType *player_ptr, POSITION y, POSITION x, POSITION ny, POSITION nx, AttributeType typ)
+{
+ const auto [a, c] = bolt_pict(y, x, ny, nx, typ);
+ print_rel(player_ptr, c, a, ny, nx);
+}
+
/*!
* @todo ここにPlayerType を追加した時のコンパイルエラーに対処できなかったので保留
* Memorize interesting viewable object/features in the given grid
#include "spell/spells-util.h"
#include "system/angband.h"
+enum class AttributeType;
+
/* A structure type for terrain template of saving dungeon floor */
struct grid_template_type {
BIT_FLAGS info;
void update_local_illumination(PlayerType *player_ptr, POSITION y, POSITION x);
bool no_lite(PlayerType *player_ptr);
void print_rel(PlayerType *player_ptr, char c, TERM_COLOR a, POSITION y, POSITION x);
+void print_bolt_pict(PlayerType *player_ptr, POSITION y, POSITION x, POSITION ny, POSITION nx, AttributeType typ);
void note_spot(PlayerType *player_ptr, POSITION y, POSITION x);
void lite_spot(PlayerType *player_ptr, POSITION y, POSITION x);
void update_flow(PlayerType *player_ptr);
#include "target/grid-selector.h"
#include "target/projection-path-calculator.h"
#include "target/target-getter.h"
-#include "term/gameterm.h"
#include "util/bit-flags-calculator.h"
#include "view/display-messages.h"
#include "world/world.h"
if (centersign * ((point_x[0] - x) * (point_y[1] - y) - (point_y[0] - y) * (point_x[1] - x)) >= 0 && centersign * ((point_x[1] - x) * (point_y[2] - y) - (point_y[1] - y) * (point_x[2] - x)) >= 0 && centersign * ((point_x[2] - x) * (point_y[0] - y) - (point_y[2] - y) * (point_x[0] - x)) >= 0) {
if (player_has_los_bold(player_ptr, y, x) && projectable(player_ptr, player_ptr->y, player_ptr->x, y, x)) {
if (!(player_ptr->blind) && panel_contains(y, x)) {
- uint16_t p = bolt_pict(y, x, y, x, AttributeType::MANA);
- print_rel(player_ptr, PICT_C(p), PICT_A(p), y, x);
+ print_bolt_pict(player_ptr, y, x, y, x, AttributeType::MANA);
move_cursor_relative(y, x);
term_fresh();
term_xtra(TERM_XTRA_DELAY, delay_factor);
#include "target/grid-selector.h"
#include "target/projection-path-calculator.h"
#include "target/target-checker.h"
-#include "term/gameterm.h"
#include "timed-effect/player-hallucination.h"
#include "timed-effect/timed-effects.h"
#include "util/bit-flags-calculator.h"
if (delay_factor > 0 && !blind) {
if (panel_contains(ny, nx) && player_has_los_bold(this->player_ptr, ny, nx)) {
- auto p = bolt_pict(oy, ox, ny, nx, typ);
- auto a = PICT_A(p);
- auto c = PICT_C(p);
- print_rel(this->player_ptr, c, a, ny, nx);
+ print_bolt_pict(this->player_ptr, oy, ox, ny, nx, typ);
move_cursor_relative(ny, nx);
term_fresh();
term_xtra(TERM_XTRA_DELAY, delay_factor);
lite_spot(this->player_ptr, ny, nx);
term_fresh();
- p = bolt_pict(ny, nx, ny, nx, typ);
- a = PICT_A(p);
- c = PICT_C(p);
- print_rel(this->player_ptr, c, a, ny, nx);
+ print_bolt_pict(this->player_ptr, ny, nx, ny, nx, typ);
visual = true;
} else if (visual) {
for (const auto &[ny, nx] : path_g) {
if (delay_factor > 0) {
if (panel_contains(ny, nx) && player_has_los_bold(this->player_ptr, ny, nx)) {
- auto p = bolt_pict(oy, ox, ny, nx, typ);
- auto a = PICT_A(p);
- auto c = PICT_C(p);
- print_rel(this->player_ptr, c, a, ny, nx);
+ print_bolt_pict(this->player_ptr, oy, ox, ny, nx, typ);
move_cursor_relative(ny, nx);
term_fresh();
term_xtra(TERM_XTRA_DELAY, delay_factor);
lite_spot(this->player_ptr, ny, nx);
term_fresh();
- p = bolt_pict(ny, nx, ny, nx, typ);
- a = PICT_A(p);
- c = PICT_C(p);
- print_rel(this->player_ptr, c, a, ny, nx);
+ print_bolt_pict(this->player_ptr, ny, nx, ny, nx, typ);
visual = true;
} else if (visual) {
for (const auto &[ny, nx] : second_path_g) {
if (delay_factor > 0) {
if (panel_contains(ny, nx) && player_has_los_bold(this->player_ptr, ny, nx)) {
- auto p = bolt_pict(oy, ox, ny, nx, typ);
- auto a = PICT_A(p);
- auto c = PICT_C(p);
- print_rel(this->player_ptr, c, a, ny, nx);
+ print_bolt_pict(this->player_ptr, oy, ox, ny, nx, typ);
move_cursor_relative(ny, nx);
term_fresh();
term_xtra(TERM_XTRA_DELAY, delay_factor);
lite_spot(this->player_ptr, ny, nx);
term_fresh();
- p = bolt_pict(ny, nx, ny, nx, typ);
- a = PICT_A(p);
- c = PICT_C(p);
- print_rel(this->player_ptr, c, a, ny, nx);
+ print_bolt_pict(this->player_ptr, ny, nx, ny, nx, typ);
visual = true;
} else if (visual) {
* If the distance is not "one", we (may) return "*".
* </pre>
*/
-uint16_t bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, AttributeType typ)
+std::pair<TERM_COLOR, char> bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, AttributeType typ)
{
int base;
auto c = misc_to_char[base + k];
/* Create pict */
- return PICT(a, c);
+ return { a, c };
}
/*!
#include "system/angband.h"
#include <map>
-
-/*
- * Convert a "pict" (P) into an "attr" (A)
- */
-#define PICT_A(P) \
- ((byte)((P) >> 8))
-
-/*
- * Convert a "pict" (P) into an "char" (C)
- */
-#define PICT_C(P) \
- ((char)((byte)(P)))
+#include <utility>
extern const concptr color_names[16];
extern const concptr window_flag_desc[32];
extern std::map<AttributeType, ushort> gf_colors;
extern TERM_COLOR color_char_to_attr(char c);
-uint16_t bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, AttributeType typ);
+std::pair<TERM_COLOR, char> bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, AttributeType typ);