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, { a, c }, ny, nx);
+ const auto symbol = bolt_pict(y, x, ny, nx, typ);
+ print_rel(player_ptr, symbol, ny, nx);
}
/*!
#include "system/system-variables.h"
#include "term/term-color-types.h"
#include "util/string-processor.h"
+#include "view/colored-char.h"
#include <span>
#include <unordered_map>
* If the distance is not "one", we (may) return "*".
* </pre>
*/
-std::pair<TERM_COLOR, char> bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, AttributeType typ)
+DisplaySymbol bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, AttributeType typ)
{
- int base;
-
- byte k;
-
- TERM_COLOR a;
-
/* No motion (*) */
+ int base;
if ((ny == y) && (nx == x)) {
base = 0x30;
}
}
/* Basic spell color */
- k = spell_color(typ);
+ const auto k = spell_color(typ);
/* Obtain attr/char */
- a = misc_to_attr[base + k];
- auto c = misc_to_char[base + k];
+ const auto a = misc_to_attr[base + k];
+ const auto c = misc_to_char[base + k];
/* Create pict */
return { a, c };
extern TERM_COLOR color_char_to_attr(char c);
extern const std::unordered_map<std::string_view, TERM_COLOR> color_list;
-std::pair<TERM_COLOR, char> bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, AttributeType typ);
+
+class DisplayDymbol;
+DisplaySymbol bolt_pict(POSITION y, POSITION x, POSITION ny, POSITION nx, AttributeType typ);