Maintenance: Centralize EncryptedName: delete 44 per-unit copies (incl. GameModeEncryptedName) and 4 EncryptedSource copies; units in

Batch #16852 by ragnarok-clanker: no function's compiled code changes; checked with 44 compiled unit(s), including every includer of Source/Utility/Cipher/LocalEncryptedName.h.
This commit is contained in:
ragnarok-clanker 2026-11-11 10:05:15 +00:00
commit d074dedcd7
45 changed files with 125 additions and 1528 deletions

View file

@ -15,6 +15,7 @@
#include "Contents/Skills/SkillInfo.h"
#include "Utility/Cipher/XorBytes.h"
#include "Utility/Math/Vector3d.h"
#include "Utility/Cipher/LocalEncryptedName.h"
#include <algorithm>
#include <array>
@ -24,49 +25,6 @@
#include <string>
#include <string_view>
namespace {
template <std::size_t Length, std::uint64_t Key>
class EncryptedName {
public:
// INLINED
template <typename Byte>
explicit EncryptedName(const Byte (&source)[Length]) : m_encrypted(true) {
for (std::uint64_t index = 0; index < Length; ++index) {
this->m_text[index] = source[index];
}
}
// INLINED
template <typename Byte>
explicit EncryptedName(const std::array<Byte, Length>& source) : m_encrypted(true) {
for (std::uint64_t index = 0; index < Length; ++index) {
this->m_text[index] = source[index];
}
}
~EncryptedName() {
for (std::uint64_t index = 0; index < Length; ++index) {
this->m_text[index] = 0;
}
}
const char* Text() {
if (this->m_encrypted) {
utility::XorBytes(this->m_text, Length, Key);
this->m_encrypted = false;
}
return reinterpret_cast<const char*>(this->m_text);
}
private:
std::uint8_t m_text[Length];
bool m_encrypted;
};
}
class CSkillAction_AnimalForm : public CSkillAction {
public:
bool CanUse(CGameActor* actor);
@ -2039,7 +1997,6 @@ void __stdcall OnSkillObjectCreate(int a, int b, int c) {
void __stdcall OnSkillObjectRemove(int a) {
}
// OFFSET: 0x005AF4E0
// FUNCTION: fn_03326
int CSkillAction_AT_PRIMAL_CLAW::GetSkillAttackMotion() {