From 4273ae84f4ad5859fa7d9160a4ebebf5133a9539 Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Wed, 27 Dec 2023 18:26:01 -0800 Subject: [PATCH] document Change Name option --- src/PlayerSubordinates.cc | 4 ++-- src/PlayerSubordinates.hh | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/PlayerSubordinates.cc b/src/PlayerSubordinates.cc index fca44136..e78ceb02 100644 --- a/src/PlayerSubordinates.cc +++ b/src/PlayerSubordinates.cc @@ -33,8 +33,8 @@ PlayerInventoryItem::PlayerInventoryItem(const ItemData& item, bool equipped) uint32_t PlayerVisualConfig::compute_name_color_checksum(uint32_t name_color) { uint8_t x = (random_object() % 0xFF) + 1; uint8_t y = (random_object() % 0xFF) + 1; - // name_color = ABCDEFGHabcdefghIJKLMNOPijklmnop - // name_color_checksum = ---------ijklmabcdeIJKLM-------- ^ (xxxxxxxxyyyyyyyyxxxxxxxxyyyyyyyy) + // name_color (ARGB) = ABCDEFGHabcdefghIJKLMNOPijklmnop + // name_color_checksum = 000000000ijklmabcdeIJKLM00000000 ^ xxxxxxxxyyyyyyyyxxxxxxxxyyyyyyyy uint32_t xbrgx95558 = ((name_color << 15) & 0x007C0000) | ((name_color >> 6) & 0x0003E000) | ((name_color >> 3) & 0x00001F00); uint32_t mask = (x << 24) | (y << 16) | (x << 8) | y; return xbrgx95558 ^ mask; diff --git a/src/PlayerSubordinates.hh b/src/PlayerSubordinates.hh index 28066e5c..2f3dd54d 100644 --- a/src/PlayerSubordinates.hh +++ b/src/PlayerSubordinates.hh @@ -116,8 +116,11 @@ struct PlayerVisualConfig { /* 18 */ le_uint32_t name_color = 0xFFFFFFFF; // ARGB /* 1C */ uint8_t extra_model = 0; /* 1D */ parray unused; - // See compute_name_color_checksum for details on how this is computed. This - // field is ignored on V3. + // See compute_name_color_checksum for details on how this is computed. If the + // value is incorrect, V1 and V2 will ignore the name_color field and use the + // default color instead. This field is ignored on GC; on BB (and presumably + // Xbox), if this has a nonzero value, the "Change Name" option appears in the + // character selection menu. /* 2C */ le_uint32_t name_color_checksum = 0; /* 30 */ uint8_t section_id = 0; /* 31 */ uint8_t char_class = 0;