Remove Win32 types from StringTable

This commit is contained in:
notmatthewbeshay 2026-03-10 00:02:43 +11:00
parent 1687568ff7
commit e38e7c1fc0
2 changed files with 15 additions and 13 deletions

View file

@ -7,9 +7,9 @@ StringTable::StringTable(void)
} }
// Load string table from a binary blob, filling out with the current localisation data only // Load string table from a binary blob, filling out with the current localisation data only
StringTable::StringTable(PBYTE pbData, DWORD dwSize) StringTable::StringTable(uint8_t *pbData, unsigned int dataSize)
{ {
src = byteArray(pbData, dwSize); src = byteArray(pbData, dataSize);
ByteArrayInputStream bais(src); ByteArrayInputStream bais(src);
DataInputStream dis(&bais); DataInputStream dis(&bais);
@ -31,7 +31,7 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize)
bool foundLang = false; bool foundLang = false;
__int64 bytesToSkip = 0; __int64 bytesToSkip = 0;
int dataSize = 0; int selectedDataSize = 0;
// //
for( AUTO_VAR(it_locales, locales.begin()); for( AUTO_VAR(it_locales, locales.begin());
@ -46,7 +46,7 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize)
if(it->first.compare(*it_locales) == 0) if(it->first.compare(*it_locales) == 0)
{ {
app.DebugPrintf("StringTable:: Found language '%ls'.\n", it_locales->c_str()); app.DebugPrintf("StringTable:: Found language '%ls'.\n", it_locales->c_str());
dataSize = it->second; selectedDataSize = it->second;
foundLang = true; foundLang = true;
break; break;
} }
@ -62,7 +62,7 @@ StringTable::StringTable(PBYTE pbData, DWORD dwSize)
{ {
dis.skip(bytesToSkip); dis.skip(bytesToSkip);
byteArray langData(dataSize); byteArray langData(selectedDataSize);
dis.read(langData); dis.read(langData);
dis.close(); dis.close();
@ -119,13 +119,13 @@ StringTable::~StringTable(void)
// delete src.data; TODO 4J-JEV: ? // delete src.data; TODO 4J-JEV: ?
} }
void StringTable::getData(PBYTE *ppData, UINT *pSize) void StringTable::getData(uint8_t **ppData, unsigned int *pSize)
{ {
*ppData = src.data; *ppData = src.data;
*pSize = src.length; *pSize = src.length;
} }
LPCWSTR StringTable::getString(const std::wstring &id) const wchar_t *StringTable::getString(const std::wstring &id)
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
if (isStatic) if (isStatic)
@ -147,7 +147,7 @@ LPCWSTR StringTable::getString(const std::wstring &id)
} }
} }
LPCWSTR StringTable::getString(int id) const wchar_t *StringTable::getString(int id)
{ {
#ifndef _CONTENT_PACKAGE #ifndef _CONTENT_PACKAGE
if (!isStatic) if (!isStatic)
@ -159,7 +159,7 @@ LPCWSTR StringTable::getString(int id)
if (id < m_stringsVec.size()) if (id < m_stringsVec.size())
{ {
LPCWSTR pwchString=m_stringsVec.at(id).c_str(); const wchar_t *pwchString = m_stringsVec.at(id).c_str();
return pwchString; return pwchString;
} }
else else

View file

@ -1,5 +1,7 @@
#pragma once #pragma once
#include <cstdint>
#if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__ #if defined(__PS3__) || defined(__ORBIS__) || defined __PSVITA__
@ -59,13 +61,13 @@ public:
// }; // };
StringTable(void); StringTable(void);
StringTable(PBYTE pbData, DWORD dwSize); StringTable(uint8_t *pbData, unsigned int dataSize);
~StringTable(void); ~StringTable(void);
void getData(PBYTE *ppbData, UINT *pdwSize); void getData(uint8_t **ppData, unsigned int *pSize);
LPCWSTR getString(const std::wstring &id); const wchar_t *getString(const std::wstring &id);
LPCWSTR getString(int id); const wchar_t *getString(int id);
//static LPCWSTR m_wchLocaleCode[LOCALE_COUNT]; //static LPCWSTR m_wchLocaleCode[LOCALE_COUNT];