From bb9d734f69f70be641b7db9c8a573fb4fb5b8ee8 Mon Sep 17 00:00:00 2001 From: Ray Date: Sun, 22 Nov 2020 00:10:16 +0100 Subject: Exposing some file access results to user layer #1420 --- src/core.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src/core.c') diff --git a/src/core.c b/src/core.c index 5af90170..a1faa765 100644 --- a/src/core.c +++ b/src/core.c @@ -2299,8 +2299,10 @@ unsigned char *DecompressData(unsigned char *compData, int compDataLength, int * // Save integer value to storage file (to defined position) // NOTE: Storage positions is directly related to file memory layout (4 bytes each integer) -void SaveStorageValue(unsigned int position, int value) +bool SaveStorageValue(unsigned int position, int value) { + bool success = false; + #if defined(SUPPORT_DATA_STORAGE) char path[512] = { 0 }; #if defined(PLATFORM_ANDROID) @@ -2355,7 +2357,7 @@ void SaveStorageValue(unsigned int position, int value) dataPtr[position] = value; } - SaveFileData(path, newFileData, newDataSize); + success = SaveFileData(path, newFileData, newDataSize); RL_FREE(newFileData); } else @@ -2367,10 +2369,12 @@ void SaveStorageValue(unsigned int position, int value) int *dataPtr = (int *)fileData; dataPtr[position] = value; - SaveFileData(path, fileData, dataSize); + success = SaveFileData(path, fileData, dataSize); RL_FREE(fileData); } #endif + + return success; } // Load integer value from storage file (from defined position) -- cgit v1.2.3