summaryrefslogtreecommitdiffhomepage
path: root/examples/core
diff options
context:
space:
mode:
authorRay <[email protected]>2020-02-27 13:18:15 +0100
committerRay <[email protected]>2020-02-27 13:18:15 +0100
commit23bde477e56714c4d10e017abad00401207c1a12 (patch)
treee58f679936a17680912c6278fe18a637dcb35257 /examples/core
parent229494766068e9bfb518e596e18d6f8413df3ff5 (diff)
downloadraylib-23bde477e56714c4d10e017abad00401207c1a12.tar.gz
raylib-23bde477e56714c4d10e017abad00401207c1a12.zip
REDESIGN: LoadStorageValue()/SaveStorageValue()
Using new file I/O ABI
Diffstat (limited to 'examples/core')
-rw-r--r--examples/core/core_storage_values.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/examples/core/core_storage_values.c b/examples/core/core_storage_values.c
index df757a4f..02e4c262 100644
--- a/examples/core/core_storage_values.c
+++ b/examples/core/core_storage_values.c
@@ -12,7 +12,10 @@
#include "raylib.h"
// NOTE: Storage positions must start with 0, directly related to file memory layout
-typedef enum { STORAGE_SCORE = 0, STORAGE_HISCORE } StorageData;
+typedef enum {
+ STORAGE_POSITION_SCORE = 0,
+ STORAGE_POSITION_HISCORE = 1
+} StorageData;
int main(void)
{
@@ -43,14 +46,14 @@ int main(void)
if (IsKeyPressed(KEY_ENTER))
{
- SaveStorageValue(STORAGE_SCORE, score);
- SaveStorageValue(STORAGE_HISCORE, hiscore);
+ SaveStorageValue(STORAGE_POSITION_SCORE, score);
+ SaveStorageValue(STORAGE_POSITION_HISCORE, hiscore);
}
else if (IsKeyPressed(KEY_SPACE))
{
// NOTE: If requested position could not be found, value 0 is returned
- score = LoadStorageValue(STORAGE_SCORE);
- hiscore = LoadStorageValue(STORAGE_HISCORE);
+ score = LoadStorageValue(STORAGE_POSITION_SCORE);
+ hiscore = LoadStorageValue(STORAGE_POSITION_HISCORE);
}
framesCounter++;