blob: 50ffbcf645d9183c178fda50f67e936c1a74783c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
static void
IO_WriteToStream(void *Address, uint64 FileSize, SDL_RWops *TestFile)
{
uint64 Size_Written = SDL_RWwrite(TestFile, Address, 1, FileSize);
if (Size_Written != FileSize)
Assert(0);
}
static void
IO_ReadFromStream(void *Address, uint64 SizeToRead, SDL_RWops *File)
{
int64 TotalBytesRead = 0;
uint8 *Address_Playhead = (uint8 *)Address;
while (TotalBytesRead < SizeToRead) {
uint64 BytesRead = SDL_RWread(File, Address, 1, (SizeToRead - TotalBytesRead));
if (BytesRead == 0)
break;
TotalBytesRead += BytesRead;
Address_Playhead += BytesRead;
}
Assert(TotalBytesRead == SizeToRead);
}
|