mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 15:21:48 +00:00
I think this fixes readarrayfromfile and writearraytofile
git-svn-id: https://svn.eduke32.com/eduke32@6385 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
d9c43bb560
commit
769b1255f6
1 changed files with 4 additions and 4 deletions
|
@ -4387,7 +4387,7 @@ finish_qsprintf:
|
||||||
if (kFile < 0)
|
if (kFile < 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
int const numElements = Gv_GetArrayElementSize(arrayNum) ? kfilelength(kFile) / Gv_GetArrayElementSize(arrayNum) : 1;
|
int const numElements = Gv_GetArrayElementSize(arrayNum) ? kfilelength(kFile) / min(Gv_GetArrayElementSize(arrayNum), sizeof(uint32_t)) : 1;
|
||||||
|
|
||||||
if (numElements > 0)
|
if (numElements > 0)
|
||||||
{
|
{
|
||||||
|
@ -4457,7 +4457,7 @@ finish_qsprintf:
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
int const numBytes = Gv_GetArrayAllocSize(arrayNum);
|
int const numBytes = Gv_GetArrayAllocSize(arrayNum);
|
||||||
|
|
||||||
switch (aGameArrays[arrayNum].flags & GAMEARRAY_TYPE_MASK)
|
switch (aGameArrays[arrayNum].flags & GAMEARRAY_TYPE_MASK)
|
||||||
{
|
{
|
||||||
|
@ -4465,12 +4465,12 @@ finish_qsprintf:
|
||||||
#ifdef BITNESS64
|
#ifdef BITNESS64
|
||||||
{
|
{
|
||||||
int const numElements = aGameArrays[arrayNum].size;
|
int const numElements = aGameArrays[arrayNum].size;
|
||||||
int32_t *const pArray = (int32_t *)Xmalloc(numBytes);
|
int32_t *const pArray = (int32_t *)Xmalloc(numBytes >> 1);
|
||||||
|
|
||||||
for (bssize_t k = 0; k < numElements; k++)
|
for (bssize_t k = 0; k < numElements; k++)
|
||||||
pArray[k] = Gv_GetArrayValue(arrayNum, k);
|
pArray[k] = Gv_GetArrayValue(arrayNum, k);
|
||||||
|
|
||||||
Bfwrite(pArray, 1, numBytes, fil);
|
Bfwrite(pArray, 1, numBytes >> 1, fil);
|
||||||
Bfree(pArray);
|
Bfree(pArray);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue