summaryrefslogtreecommitdiffhomepage
path: root/src/core.c
diff options
context:
space:
mode:
authorRay <[email protected]>2020-11-22 00:10:16 +0100
committerRay <[email protected]>2020-11-22 00:10:16 +0100
commitbb9d734f69f70be641b7db9c8a573fb4fb5b8ee8 (patch)
tree2af4f7faf367999c71c7e612a60537604a37c6fd /src/core.c
parent36dc302c25fc8143f2c8c45d6d101c7043e15872 (diff)
downloadraylib-bb9d734f69f70be641b7db9c8a573fb4fb5b8ee8.tar.gz
raylib-bb9d734f69f70be641b7db9c8a573fb4fb5b8ee8.zip
Exposing some file access results to user layer #1420
Diffstat (limited to 'src/core.c')
-rw-r--r--src/core.c10
1 files changed, 7 insertions, 3 deletions
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)