diff options
Diffstat (limited to 'raylib/examples/core')
| -rw-r--r-- | raylib/examples/core/core_2d_camera.c | 2 | ||||
| -rw-r--r-- | raylib/examples/core/core_2d_camera_platformer.c | 2 | ||||
| -rw-r--r-- | raylib/examples/core/core_2d_camera_split_screen.c | 8 | ||||
| -rw-r--r-- | raylib/examples/core/core_3d_camera_free.c | 12 | ||||
| -rw-r--r-- | raylib/examples/core/core_3d_camera_free.png | bin | 25317 -> 25956 bytes | |||
| -rw-r--r-- | raylib/examples/core/core_automation_events.c | 334 | ||||
| -rw-r--r-- | raylib/examples/core/core_automation_events.png | bin | 0 -> 20515 bytes | |||
| -rw-r--r-- | raylib/examples/core/core_drop_files.c | 4 | ||||
| -rw-r--r-- | raylib/examples/core/core_input_gamepad_info.c | 45 | ||||
| -rw-r--r-- | raylib/examples/core/core_loading_thread.c | 2 | ||||
| -rw-r--r-- | raylib/examples/core/core_random_values.c | 2 | ||||
| -rw-r--r-- | raylib/examples/core/core_smooth_pixelperfect.c | 2 | ||||
| -rw-r--r-- | raylib/examples/core/core_storage_values.c | 4 |
13 files changed, 379 insertions, 38 deletions
diff --git a/raylib/examples/core/core_2d_camera.c b/raylib/examples/core/core_2d_camera.c index 24cca69..759c099 100644 --- a/raylib/examples/core/core_2d_camera.c +++ b/raylib/examples/core/core_2d_camera.c @@ -1,6 +1,6 @@ /******************************************************************************************* * -* raylib [core] example - 2d camera +* raylib [core] example - 2D Camera system * * Example originally created with raylib 1.5, last time updated with raylib 3.0 * diff --git a/raylib/examples/core/core_2d_camera_platformer.c b/raylib/examples/core/core_2d_camera_platformer.c index b149ea8..72b1ee1 100644 --- a/raylib/examples/core/core_2d_camera_platformer.c +++ b/raylib/examples/core/core_2d_camera_platformer.c @@ -1,6 +1,6 @@ /******************************************************************************************* * -* raylib [core] example - 2d camera platformer +* raylib [core] example - 2D Camera platformer * * Example originally created with raylib 2.5, last time updated with raylib 3.0 * diff --git a/raylib/examples/core/core_2d_camera_split_screen.c b/raylib/examples/core/core_2d_camera_split_screen.c index 57a0dfd..60b5a2e 100644 --- a/raylib/examples/core/core_2d_camera_split_screen.c +++ b/raylib/examples/core/core_2d_camera_split_screen.c @@ -85,12 +85,12 @@ int main(void) // Draw full scene with first camera for (int i = 0; i < screenWidth/PLAYER_SIZE + 1; i++) { - DrawLineV((Vector2){PLAYER_SIZE*i, 0}, (Vector2){PLAYER_SIZE*i, screenHeight}, LIGHTGRAY); + DrawLineV((Vector2){(float)PLAYER_SIZE*i, 0}, (Vector2){ (float)PLAYER_SIZE*i, (float)screenHeight}, LIGHTGRAY); } for (int i = 0; i < screenHeight/PLAYER_SIZE + 1; i++) { - DrawLineV((Vector2){0, PLAYER_SIZE*i}, (Vector2){screenWidth, PLAYER_SIZE*i}, LIGHTGRAY); + DrawLineV((Vector2){0, (float)PLAYER_SIZE*i}, (Vector2){ (float)screenWidth, (float)PLAYER_SIZE*i}, LIGHTGRAY); } for (int i = 0; i < screenWidth/PLAYER_SIZE; i++) @@ -118,12 +118,12 @@ int main(void) // Draw full scene with second camera for (int i = 0; i < screenWidth/PLAYER_SIZE + 1; i++) { - DrawLineV((Vector2){PLAYER_SIZE*i, 0}, (Vector2){PLAYER_SIZE*i, screenHeight}, LIGHTGRAY); + DrawLineV((Vector2){ (float)PLAYER_SIZE*i, 0}, (Vector2){ (float)PLAYER_SIZE*i, (float)screenHeight}, LIGHTGRAY); } for (int i = 0; i < screenHeight/PLAYER_SIZE + 1; i++) { - DrawLineV((Vector2){0, PLAYER_SIZE*i}, (Vector2){screenWidth, PLAYER_SIZE*i}, LIGHTGRAY); + DrawLineV((Vector2){0, (float)PLAYER_SIZE*i}, (Vector2){ (float)screenWidth, (float)PLAYER_SIZE*i}, LIGHTGRAY); } for (int i = 0; i < screenWidth/PLAYER_SIZE; i++) diff --git a/raylib/examples/core/core_3d_camera_free.c b/raylib/examples/core/core_3d_camera_free.c index 78200a6..3c30a42 100644 --- a/raylib/examples/core/core_3d_camera_free.c +++ b/raylib/examples/core/core_3d_camera_free.c @@ -47,7 +47,7 @@ int main(void) //---------------------------------------------------------------------------------- UpdateCamera(&camera, CAMERA_FREE); - if (IsKeyDown('Z')) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; + if (IsKeyPressed('Z')) camera.target = (Vector3){ 0.0f, 0.0f, 0.0f }; //---------------------------------------------------------------------------------- // Draw @@ -65,15 +65,13 @@ int main(void) EndMode3D(); - DrawRectangle( 10, 10, 320, 133, Fade(SKYBLUE, 0.5f)); - DrawRectangleLines( 10, 10, 320, 133, BLUE); + DrawRectangle( 10, 10, 320, 93, Fade(SKYBLUE, 0.5f)); + DrawRectangleLines( 10, 10, 320, 93, BLUE); DrawText("Free camera default controls:", 20, 20, 10, BLACK); DrawText("- Mouse Wheel to Zoom in-out", 40, 40, 10, DARKGRAY); DrawText("- Mouse Wheel Pressed to Pan", 40, 60, 10, DARKGRAY); - DrawText("- Alt + Mouse Wheel Pressed to Rotate", 40, 80, 10, DARKGRAY); - //DrawText("- Alt + Ctrl + Mouse Wheel Pressed for Smooth Zoom", 40, 100, 10, DARKGRAY); - DrawText("- Z to zoom to (0, 0, 0)", 40, 120, 10, DARKGRAY); + DrawText("- Z to zoom to (0, 0, 0)", 40, 80, 10, DARKGRAY); EndDrawing(); //---------------------------------------------------------------------------------- @@ -85,4 +83,4 @@ int main(void) //-------------------------------------------------------------------------------------- return 0; -}
\ No newline at end of file +} diff --git a/raylib/examples/core/core_3d_camera_free.png b/raylib/examples/core/core_3d_camera_free.png Binary files differindex 7874eed..71dfc1c 100644 --- a/raylib/examples/core/core_3d_camera_free.png +++ b/raylib/examples/core/core_3d_camera_free.png diff --git a/raylib/examples/core/core_automation_events.c b/raylib/examples/core/core_automation_events.c new file mode 100644 index 0000000..b58d572 --- /dev/null +++ b/raylib/examples/core/core_automation_events.c @@ -0,0 +1,334 @@ +/******************************************************************************************* +* +* raylib [core] example - automation events +* +* Example originally created with raylib 5.0, last time updated with raylib 5.0 +* +* Example based on 2d_camera_platformer example by arvyy (@arvyy) +* +* Example licensed under an unmodified zlib/libpng license, which is an OSI-certified, +* BSD-like license that allows static linking with closed source software +* +* Copyright (c) 2023 Ramon Santamaria (@raysan5) +* +********************************************************************************************/ + +#include "raylib.h" +#include "raymath.h" + +#define GRAVITY 400 +#define PLAYER_JUMP_SPD 350.0f +#define PLAYER_HOR_SPD 200.0f + +#define MAX_ENVIRONMENT_ELEMENTS 5 + +typedef struct Player { + Vector2 position; + float speed; + bool canJump; +} Player; + +typedef struct EnvElement { + Rectangle rect; + int blocking; + Color color; +} EnvElement; + + +//------------------------------------------------------------------------------------ +// Program main entry point +//------------------------------------------------------------------------------------ +int main(void) +{ + // Initialization + //-------------------------------------------------------------------------------------- + const int screenWidth = 800; + const int screenHeight = 450; + + InitWindow(screenWidth, screenHeight, "raylib [core] example - automation events"); + + // Define player + Player player = { 0 }; + player.position = (Vector2){ 400, 280 }; + player.speed = 0; + player.canJump = false; + + // Define environment elements (platforms) + EnvElement envElements[MAX_ENVIRONMENT_ELEMENTS] = { + {{ 0, 0, 1000, 400 }, 0, LIGHTGRAY }, + {{ 0, 400, 1000, 200 }, 1, GRAY }, + {{ 300, 200, 400, 10 }, 1, GRAY }, + {{ 250, 300, 100, 10 }, 1, GRAY }, + {{ 650, 300, 100, 10 }, 1, GRAY } + }; + + // Define camera + Camera2D camera = { 0 }; + camera.target = player.position; + camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f }; + camera.rotation = 0.0f; + camera.zoom = 1.0f; + + // Automation events + AutomationEventList aelist = LoadAutomationEventList(0); // Initialize list of automation events to record new events + SetAutomationEventList(&aelist); + bool eventRecording = false; + bool eventPlaying = false; + + unsigned int frameCounter = 0; + unsigned int playFrameCounter = 0; + unsigned int currentPlayFrame = 0; + + SetTargetFPS(60); + //-------------------------------------------------------------------------------------- + + // Main game loop + while (!WindowShouldClose()) + { + // Update + //---------------------------------------------------------------------------------- + float deltaTime = 0.015f;//GetFrameTime(); + + // Dropped files logic + //---------------------------------------------------------------------------------- + if (IsFileDropped()) + { + FilePathList droppedFiles = LoadDroppedFiles(); + + // Supports loading .rgs style files (text or binary) and .png style palette images + if (IsFileExtension(droppedFiles.paths[0], ".txt;.rae")) + { + UnloadAutomationEventList(&aelist); + aelist = LoadAutomationEventList(droppedFiles.paths[0]); + + eventRecording = false; + + // Reset scene state to play + eventPlaying = true; + playFrameCounter = 0; + currentPlayFrame = 0; + + player.position = (Vector2){ 400, 280 }; + player.speed = 0; + player.canJump = false; + + camera.target = player.position; + camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f }; + camera.rotation = 0.0f; + camera.zoom = 1.0f; + } + + UnloadDroppedFiles(droppedFiles); // Unload filepaths from memory + } + //---------------------------------------------------------------------------------- + + // Update player + //---------------------------------------------------------------------------------- + if (IsKeyDown(KEY_LEFT)) player.position.x -= PLAYER_HOR_SPD*deltaTime; + if (IsKeyDown(KEY_RIGHT)) player.position.x += PLAYER_HOR_SPD*deltaTime; + if (IsKeyDown(KEY_SPACE) && player.canJump) + { + player.speed = -PLAYER_JUMP_SPD; + player.canJump = false; + } + + int hitObstacle = 0; + for (int i = 0; i < MAX_ENVIRONMENT_ELEMENTS; i++) + { + EnvElement *element = &envElements[i]; + Vector2 *p = &(player.position); + if (element->blocking && + element->rect.x <= p->x && + element->rect.x + element->rect.width >= p->x && + element->rect.y >= p->y && + element->rect.y <= p->y + player.speed*deltaTime) + { + hitObstacle = 1; + player.speed = 0.0f; + p->y = element->rect.y; + } + } + + if (!hitObstacle) + { + player.position.y += player.speed*deltaTime; + player.speed += GRAVITY*deltaTime; + player.canJump = false; + } + else player.canJump = true; + + camera.zoom += ((float)GetMouseWheelMove()*0.05f); + + if (camera.zoom > 3.0f) camera.zoom = 3.0f; + else if (camera.zoom < 0.25f) camera.zoom = 0.25f; + + if (IsKeyPressed(KEY_R)) + { + // Reset game state + player.position = (Vector2){ 400, 280 }; + player.speed = 0; + player.canJump = false; + + camera.target = player.position; + camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f }; + camera.rotation = 0.0f; + camera.zoom = 1.0f; + } + //---------------------------------------------------------------------------------- + + // Update camera + //---------------------------------------------------------------------------------- + camera.target = player.position; + camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f }; + float minX = 1000, minY = 1000, maxX = -1000, maxY = -1000; + + for (int i = 0; i < MAX_ENVIRONMENT_ELEMENTS; i++) + { + EnvElement *element = &envElements[i]; + minX = fminf(element->rect.x, minX); + maxX = fmaxf(element->rect.x + element->rect.width, maxX); + minY = fminf(element->rect.y, minY); + maxY = fmaxf(element->rect.y + element->rect.height, maxY); + } + + Vector2 max = GetWorldToScreen2D((Vector2){ maxX, maxY }, camera); + Vector2 min = GetWorldToScreen2D((Vector2){ minX, minY }, camera); + + if (max.x < screenWidth) camera.offset.x = screenWidth - (max.x - screenWidth/2); + if (max.y < screenHeight) camera.offset.y = screenHeight - (max.y - screenHeight/2); + if (min.x > 0) camera.offset.x = screenWidth/2 - min.x; + if (min.y > 0) camera.offset.y = screenHeight/2 - min.y; + //---------------------------------------------------------------------------------- + + // Toggle events recording + if (IsKeyPressed(KEY_S)) + { + if (!eventPlaying) + { + if (eventRecording) + { + StopAutomationEventRecording(); + eventRecording = false; + + ExportAutomationEventList(aelist, "automation.rae"); + + TraceLog(LOG_INFO, "RECORDED FRAMES: %i", aelist.count); + } + else + { + SetAutomationEventBaseFrame(180); + StartAutomationEventRecording(); + eventRecording = true; + } + } + } + else if (IsKeyPressed(KEY_A)) + { + if (!eventRecording && (aelist.count > 0)) + { + // Reset scene state to play + eventPlaying = true; + playFrameCounter = 0; + currentPlayFrame = 0; + + player.position = (Vector2){ 400, 280 }; + player.speed = 0; + player.canJump = false; + + camera.target = player.position; + camera.offset = (Vector2){ screenWidth/2.0f, screenHeight/2.0f }; + camera.rotation = 0.0f; + camera.zoom = 1.0f; + } + } + + if (eventPlaying) + { + // NOTE: Multiple events could be executed in a single frame + while (playFrameCounter == aelist.events[currentPlayFrame].frame) + { + TraceLog(LOG_INFO, "PLAYING: PlayFrameCount: %i | currentPlayFrame: %i | Event Frame: %i, param: %i", + playFrameCounter, currentPlayFrame, aelist.events[currentPlayFrame].frame, aelist.events[currentPlayFrame].params[0]); + + PlayAutomationEvent(aelist.events[currentPlayFrame]); + currentPlayFrame++; + + if (currentPlayFrame == aelist.count) + { + eventPlaying = false; + currentPlayFrame = 0; + playFrameCounter = 0; + + TraceLog(LOG_INFO, "FINISH PLAYING!"); + break; + } + } + + playFrameCounter++; + } + + if (eventRecording || eventPlaying) frameCounter++; + else frameCounter = 0; + //---------------------------------------------------------------------------------- + + // Draw + //---------------------------------------------------------------------------------- + BeginDrawing(); + + ClearBackground(LIGHTGRAY); + + BeginMode2D(camera); + + // Draw environment elements + for (int i = 0; i < MAX_ENVIRONMENT_ELEMENTS; i++) + { + DrawRectangleRec(envElements[i].rect, envElements[i].color); + } + + // Draw player rectangle + DrawRectangleRec((Rectangle){ player.position.x - 20, player.position.y - 40, 40, 40 }, RED); + + EndMode2D(); + + // Draw game controls + DrawRectangle(10, 10, 290, 145, Fade(SKYBLUE, 0.5f)); + DrawRectangleLines(10, 10, 290, 145, Fade(BLUE, 0.8f)); + + DrawText("Controls:", 20, 20, 10, BLACK); + DrawText("- RIGHT | LEFT: Player movement", 30, 40, 10, DARKGRAY); + DrawText("- SPACE: Player jump", 30, 60, 10, DARKGRAY); + DrawText("- R: Reset game state", 30, 80, 10, DARKGRAY); + + DrawText("- S: START/STOP RECORDING INPUT EVENTS", 30, 110, 10, BLACK); + DrawText("- A: REPLAY LAST RECORDED INPUT EVENTS", 30, 130, 10, BLACK); + + // Draw automation events recording indicator + if (eventRecording) + { + DrawRectangle(10, 160, 290, 30, Fade(RED, 0.3f)); + DrawRectangleLines(10, 160, 290, 30, Fade(MAROON, 0.8f)); + DrawCircle(30, 175, 10, MAROON); + + if (((frameCounter/15)%2) == 1) DrawText(TextFormat("RECORDING EVENTS... [%i]", aelist.count), 50, 170, 10, MAROON); + } + else if (eventPlaying) + { + DrawRectangle(10, 160, 290, 30, Fade(LIME, 0.3f)); + DrawRectangleLines(10, 160, 290, 30, Fade(DARKGREEN, 0.8f)); + DrawTriangle((Vector2){ 20, 155 + 10 }, (Vector2){ 20, 155 + 30 }, (Vector2){ 40, 155 + 20 }, DARKGREEN); + + if (((frameCounter/15)%2) == 1) DrawText(TextFormat("PLAYING RECORDED EVENTS... [%i]", currentPlayFrame), 50, 170, 10, DARKGREEN); + } + + + EndDrawing(); + //---------------------------------------------------------------------------------- + } + + // De-Initialization + //-------------------------------------------------------------------------------------- + CloseWindow(); // Close window and OpenGL context + //-------------------------------------------------------------------------------------- + + return 0; +} diff --git a/raylib/examples/core/core_automation_events.png b/raylib/examples/core/core_automation_events.png Binary files differnew file mode 100644 index 0000000..ac8cb3b --- /dev/null +++ b/raylib/examples/core/core_automation_events.png diff --git a/raylib/examples/core/core_drop_files.c b/raylib/examples/core/core_drop_files.c index 9f62203..d4ddd9e 100644 --- a/raylib/examples/core/core_drop_files.c +++ b/raylib/examples/core/core_drop_files.c @@ -53,7 +53,7 @@ int main(void) { FilePathList droppedFiles = LoadDroppedFiles(); - for (int i = 0, offset = filePathCounter; i < droppedFiles.count; i++) + for (int i = 0, offset = filePathCounter; i < (int)droppedFiles.count; i++) { if (filePathCounter < (MAX_FILEPATH_RECORDED - 1)) { @@ -77,7 +77,7 @@ int main(void) { DrawText("Dropped files:", 100, 40, 20, DARKGRAY); - for (unsigned int i = 0; i < filePathCounter; i++) + for (int i = 0; i < filePathCounter; i++) { if (i%2 == 0) DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.5f)); else DrawRectangle(0, 85 + 40*i, screenWidth, 40, Fade(LIGHTGRAY, 0.3f)); diff --git a/raylib/examples/core/core_input_gamepad_info.c b/raylib/examples/core/core_input_gamepad_info.c index 55f0354..9aebb81 100644 --- a/raylib/examples/core/core_input_gamepad_info.c +++ b/raylib/examples/core/core_input_gamepad_info.c @@ -31,40 +31,49 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [core] example - gamepad information"); SetTargetFPS(60); // Set our game to run at 60 frames-per-second + //-------------------------------------------------------------------------------------- // Main game loop - while (!WindowShouldClose()) // Detect window close button or ESC key + while (!WindowShouldClose()) // Detect window close button or ESC key { - int y = 10; + // Update + //---------------------------------------------------------------------------------- + // TODO: Update your variables here + //---------------------------------------------------------------------------------- + // Draw + //---------------------------------------------------------------------------------- BeginDrawing(); - ClearBackground(RAYWHITE); + ClearBackground(RAYWHITE); - for (int i = 0; i < 4; i++) // by default rcore.h has a MAX_GAMEPADS of 4 so mimmic that here. - { - if (IsGamepadAvailable(i)) + for (int i = 0, y = 10; i < 4; i++) // MAX_GAMEPADS = 4 { - DrawText(TextFormat("Gamepad name: %s", GetGamepadName(i)), 10, y, 20, BLACK); - y += 30; - DrawText(TextFormat("\tAxis count: %d", GetGamepadAxisCount(i)), 10, y, 20, BLACK); - y += 30; - for (int axis = 0; axis < GetGamepadAxisCount(i); axis++) + if (IsGamepadAvailable(i)) { - DrawText(TextFormat("\tAxis %d = %f", axis, GetGamepadAxisMovement(i, axis)), 10, y, 20, BLACK); + DrawText(TextFormat("Gamepad name: %s", GetGamepadName(i)), 10, y, 20, BLACK); y += 30; - } - for (int button = 0; button < 32; button++) - { - DrawText(TextFormat("\tButton %d = %d", button, IsGamepadButtonDown(i, button)), 10, y, 20, BLACK); + DrawText(TextFormat("\tAxis count: %d", GetGamepadAxisCount(i)), 10, y, 20, BLACK); y += 30; + + for (int axis = 0; axis < GetGamepadAxisCount(i); axis++) + { + DrawText(TextFormat("\tAxis %d = %f", axis, GetGamepadAxisMovement(i, axis)), 10, y, 20, BLACK); + y += 30; + } + + for (int button = 0; button < 32; button++) + { + DrawText(TextFormat("\tButton %d = %d", button, IsGamepadButtonDown(i, button)), 10, y, 20, BLACK); + y += 30; + } } } - } - DrawFPS(GetScreenWidth() - 100, 100); + DrawFPS(GetScreenWidth() - 100, 100); EndDrawing(); + //---------------------------------------------------------------------------------- } // De-Initialization diff --git a/raylib/examples/core/core_loading_thread.c b/raylib/examples/core/core_loading_thread.c index 0538dce..8451ff0 100644 --- a/raylib/examples/core/core_loading_thread.c +++ b/raylib/examples/core/core_loading_thread.c @@ -41,7 +41,7 @@ int main(void) InitWindow(screenWidth, screenHeight, "raylib [core] example - loading thread"); - pthread_t threadId; // Loading data thread id + pthread_t threadId = { 0 }; // Loading data thread id enum { STATE_WAITING, STATE_LOADING, STATE_FINISHED } state = STATE_WAITING; int framesCounter = 0; diff --git a/raylib/examples/core/core_random_values.c b/raylib/examples/core/core_random_values.c index c2225bc..bec1de2 100644 --- a/raylib/examples/core/core_random_values.c +++ b/raylib/examples/core/core_random_values.c @@ -29,7 +29,7 @@ int main(void) int randValue = GetRandomValue(-8, 5); // Get a random integer number between -8 and 5 (both included) - int framesCounter = 0; // Variable used to count frames + unsigned int framesCounter = 0; // Variable used to count frames SetTargetFPS(60); // Set our game to run at 60 frames-per-second //-------------------------------------------------------------------------------------- diff --git a/raylib/examples/core/core_smooth_pixelperfect.c b/raylib/examples/core/core_smooth_pixelperfect.c index 776706c..3d5ed94 100644 --- a/raylib/examples/core/core_smooth_pixelperfect.c +++ b/raylib/examples/core/core_smooth_pixelperfect.c @@ -1,6 +1,6 @@ /******************************************************************************************* * -* raylib [core] example - smooth pixel-perfect camera +* raylib [core] example - Smooth Pixel-perfect camera * * Example originally created with raylib 3.7, last time updated with raylib 4.0 * diff --git a/raylib/examples/core/core_storage_values.c b/raylib/examples/core/core_storage_values.c index 1273991..c7fd7d9 100644 --- a/raylib/examples/core/core_storage_values.c +++ b/raylib/examples/core/core_storage_values.c @@ -104,7 +104,7 @@ int main(void) bool SaveStorageValue(unsigned int position, int value) { bool success = false; - unsigned int dataSize = 0; + int dataSize = 0; unsigned int newDataSize = 0; unsigned char *fileData = LoadFileData(STORAGE_DATA_FILE, &dataSize); unsigned char *newFileData = NULL; @@ -172,7 +172,7 @@ bool SaveStorageValue(unsigned int position, int value) int LoadStorageValue(unsigned int position) { int value = 0; - unsigned int dataSize = 0; + int dataSize = 0; unsigned char *fileData = LoadFileData(STORAGE_DATA_FILE, &dataSize); if (fileData != NULL) |
