mirror of
https://github.com/rehlds/rehlds.git
synced 2025-01-03 18:45:46 +03:00
Merge pull request #171 from WPMGPRoSToTeMa/master
Fixed reading and writing custom.hpk (Fixed #114)
This commit is contained in:
commit
f8643ef7b7
@ -2167,8 +2167,8 @@ void COM_CopyFileChunk(FileHandle_t dst, FileHandle_t src, int nSize)
|
||||
|
||||
while (copysize > COM_COPY_CHUNK_SIZE)
|
||||
{
|
||||
FS_Read(copybuf, 1, COM_COPY_CHUNK_SIZE, src);
|
||||
FS_Write(copybuf, 1, COM_COPY_CHUNK_SIZE, dst);
|
||||
FS_Read(copybuf, COM_COPY_CHUNK_SIZE, 1, src);
|
||||
FS_Write(copybuf, COM_COPY_CHUNK_SIZE, 1, dst);
|
||||
copysize -= COM_COPY_CHUNK_SIZE;
|
||||
}
|
||||
|
||||
|
@ -156,13 +156,21 @@ int FS_EndOfFile(FileHandle_t file)
|
||||
/* <25fa9> ../engine/filesystem_internal.cpp:131 */
|
||||
int FS_Read(void *pOutput, int size, int count, FileHandle_t file)
|
||||
{
|
||||
#ifdef REHLDS_FIXES
|
||||
return g_pFileSystem->Read(pOutput, size * count, file);
|
||||
#else // REHLDS_FIXES
|
||||
return g_pFileSystem->Read(pOutput, size, file);
|
||||
#endif // REHLDS_FIXES
|
||||
}
|
||||
|
||||
/* <2641e> ../engine/filesystem_internal.cpp:138 */
|
||||
int FS_Write(const void *pInput, int size, int count, FileHandle_t file)
|
||||
{
|
||||
#ifdef REHLDS_FIXES
|
||||
return g_pFileSystem->Write(pInput, size * count, file);
|
||||
#else // REHLDS_FIXES
|
||||
return g_pFileSystem->Write(pInput, size, file);
|
||||
#endif // REHLDS_FIXES
|
||||
}
|
||||
|
||||
/* <26479> ../engine/filesystem_internal.cpp:145 */
|
||||
|
@ -850,7 +850,7 @@ void HPAK_CreatePak(char *pakname, struct resource_s *pResource, void *pData, Fi
|
||||
|
||||
curpos = FS_Tell(fp);
|
||||
FS_Write(&hash_pack_dir.nEntries, 4, 1, fp);
|
||||
FS_Write(&hash_pack_dir.p_rgEntries, sizeof(hash_pack_entry_t), 1, fp);
|
||||
FS_Write(hash_pack_dir.p_rgEntries, sizeof(hash_pack_entry_t), 1, fp);
|
||||
|
||||
if (hash_pack_dir.p_rgEntries)
|
||||
{
|
||||
|
@ -651,7 +651,7 @@ NOXREF int BuildMapCycleListHints(char **hints)
|
||||
if (length)
|
||||
{
|
||||
pFileList = (char *)malloc(length);
|
||||
if (pFileList && FS_Read(pFileList, length, 0, pFile) != 1)
|
||||
if (pFileList && FS_Read(pFileList, length, 1, pFile) != 1)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user