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:
parent
7a8d4523f1
commit
d074dedcd7
45 changed files with 125 additions and 1528 deletions
|
|
@ -98,6 +98,7 @@
|
|||
#include "Resource/Sprites/ImfResource.h"
|
||||
#include "Resource/Bitmap/PaletteResource.h"
|
||||
#include "Contents/Jobs/JobInheritance.h"
|
||||
#include "Utility/Cipher/LocalEncryptedName.h"
|
||||
|
||||
#include "Resource/MSGSTRINGID.h"
|
||||
// GLOBAL: gl_25153
|
||||
|
|
@ -109,36 +110,6 @@ static const std::string s_messageBoxItemLinkClosing = "</ITEML>";
|
|||
namespace {
|
||||
constexpr char prefix[] = "유저인터페이스\\";
|
||||
|
||||
template <std::size_t Length, std::uint64_t Key>
|
||||
class EncryptedName {
|
||||
public:
|
||||
// INLINED
|
||||
explicit EncryptedName(const char (&source)[Length]) : 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;
|
||||
};
|
||||
|
||||
// INLINED
|
||||
int TileCount(int length, int tile) {
|
||||
const std::div_t tiles = std::div(length, tile);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue