From 23bde477e56714c4d10e017abad00401207c1a12 Mon Sep 17 00:00:00 2001 From: Ray Date: Thu, 27 Feb 2020 13:18:15 +0100 Subject: REDESIGN: LoadStorageValue()/SaveStorageValue() Using new file I/O ABI --- examples/core/core_storage_values.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'examples') 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++; -- cgit v1.2.3