Skip to content

Commit 3f1cf67

Browse files
committed
Update CRenderWareSA.ClothesReplacing
1 parent 43186ea commit 3f1cf67

File tree

3 files changed

+16
-21
lines changed

3 files changed

+16
-21
lines changed

Client/game_sa/CRenderWareSA.ClothesReplacing.cpp

Lines changed: 10 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -136,22 +136,22 @@ bool CRenderWareSA::HasClothesReplacementChanged()
136136
// Add a file to the clothes directory
137137
//
138138
////////////////////////////////////////////////////////////////
139-
bool CRenderWareSA::ClothesAddFile(const char* pFileData, size_t fileSize, const char* pFileName)
139+
bool CRenderWareSA::ClothesAddFile(const char* fileData, std::size_t fileSize, const char* fileName)
140140
{
141-
if (!pFileData || !pFileName)
141+
if (!fileData || !fileName)
142142
return false;
143143

144-
if (MapFind(ms_ClothesFileDataMap, pFileName))
144+
if (MapFind(ms_ClothesFileDataMap, fileName))
145145
return false;
146146

147147
DirectoryInfoSA entry{};
148148
entry.m_streamingSize = GetSizeInBlocks(fileSize);
149-
strncpy(entry.m_name, pFileName, sizeof(entry.m_name));
149+
std::strncpy(entry.m_name, fileName, sizeof(entry.m_name));
150150

151151
if (!g_clothesDirectory->AddEntry(entry))
152152
return false;
153153

154-
MapSet(ms_ClothesFileDataMap, pFileName, (char*)pFileData);
154+
MapSet(ms_ClothesFileDataMap, fileName, (char*)fileData);
155155
bClothesReplacementChanged = true;
156156

157157
return true;
@@ -164,14 +164,14 @@ bool CRenderWareSA::ClothesAddFile(const char* pFileData, size_t fileSize, const
164164
// Remove a file from the clothes directory
165165
//
166166
////////////////////////////////////////////////////////////////
167-
bool CRenderWareSA::ClothesRemoveFile(char* pFileData)
167+
bool CRenderWareSA::ClothesRemoveFile(char* fileData)
168168
{
169-
if (!pFileData)
169+
if (!fileData)
170170
return false;
171171

172172
for (auto iter = ms_ClothesFileDataMap.begin(); iter != ms_ClothesFileDataMap.end();)
173173
{
174-
if (iter->second == pFileData)
174+
if (iter->second == fileData)
175175
{
176176
if (!g_clothesDirectory->RemoveEntry(iter->first.c_str()))
177177
return false;
@@ -191,14 +191,9 @@ bool CRenderWareSA::ClothesRemoveFile(char* pFileData)
191191
// Check if clothe file exits
192192
//
193193
////////////////////////////////////////////////////////////////
194-
bool CRenderWareSA::HasClothesFile(const char* pFileName)
194+
bool CRenderWareSA::HasClothesFile(const char* fileName)
195195
{
196-
if (!pFileName)
197-
{
198-
return false;
199-
}
200-
201-
if (!MapFind(ms_ClothesFileDataMap, pFileName))
196+
if (!fileName || !MapFind(ms_ClothesFileDataMap, fileName))
202197
{
203198
return false;
204199
}

Client/game_sa/CRenderWareSA.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ class CRenderWareSA : public CRenderWare
3535
void ClothesAddReplacement(char* pFileData, size_t fileSize, ushort usFileId);
3636
void ClothesRemoveReplacement(char* pFileData);
3737
bool HasClothesReplacementChanged();
38-
bool ClothesAddFile(const char* pFileData, size_t fileSize, const char* pFileName);
39-
bool ClothesRemoveFile(char* pFileData);
40-
bool HasClothesFile(const char* pFileName);
38+
bool ClothesAddFile(const char* fileData, std::size_t fileSize, const char* fileName);
39+
bool ClothesRemoveFile(char* fileData);
40+
bool HasClothesFile(const char* fileName);
4141

4242
// Reads and parses a TXD file specified by a path (szTXD)
4343
RwTexDictionary* ReadTXD(const SString& strFilename, const SString& buffer);

Client/sdk/game/CRenderWare.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,9 @@ class CRenderWare
7979
virtual void ClothesAddReplacement(char* pFileData, size_t fileSize, ushort usFileId) = 0;
8080
virtual void ClothesRemoveReplacement(char* pFileData) = 0;
8181
virtual bool HasClothesReplacementChanged() = 0;
82-
virtual bool ClothesAddFile(const char* pFileData, size_t fileSize, const char* pFileName) = 0;
83-
virtual bool ClothesRemoveFile(char* pFileData) = 0;
84-
virtual bool HasClothesFile(const char* pFileName) = 0;
82+
virtual bool ClothesAddFile(const char* fileData, std::size_t fileSize, const char* fileName) = 0;
83+
virtual bool ClothesRemoveFile(char* fileData) = 0;
84+
virtual bool HasClothesFile(const char* fileName) = 0;
8585
virtual RwTexDictionary* ReadTXD(const SString& strFilename, const SString& buffer) = 0;
8686
virtual RpClump* ReadDFF(const SString& strFilename, const SString& buffer, unsigned short usModelID, bool bLoadEmbeddedCollisions) = 0;
8787
virtual CColModel* ReadCOL(const SString& buffer) = 0;

0 commit comments

Comments
 (0)