Line |
Branch |
Exec |
Source |
1 |
|
|
/* |
2 |
|
|
* Filename: system_reload_config.c |
3 |
|
|
* Path: sources/System |
4 |
|
|
* Created Date: Tuesday, March 21st 2023, 5:09:16 pm |
5 |
|
|
* Author: Thomas |
6 |
|
|
* |
7 |
|
|
* Copyright (c) 2023 our_rpg |
8 |
|
|
*/ |
9 |
|
|
|
10 |
|
|
#include "raylib.h" |
11 |
|
|
#include "system.h" |
12 |
|
|
#include "systems.h" |
13 |
|
|
#include "world.h" |
14 |
|
|
#include "world_system.h" |
15 |
|
|
|
16 |
|
✗ |
int system_reload_config_constructor(system_t *system) |
17 |
|
|
{ |
18 |
|
✗ |
system->run = system_reload_config_run; |
19 |
|
✗ |
system->type = S_RELOAD_CONFIG; |
20 |
|
✗ |
system->active = true; |
21 |
|
✗ |
return 0; |
22 |
|
|
} |
23 |
|
|
|
24 |
|
✗ |
int system_reload_config_run(void *ptr) |
25 |
|
|
{ |
26 |
|
|
world_t *world = ptr; |
27 |
|
✗ |
system_t system = {0}; |
28 |
|
|
|
29 |
|
✗ |
if (IsKeyPressed(KEY_R)) { |
30 |
|
✗ |
system_load_scene_constructor(&system); |
31 |
|
✗ |
world_add_system(world, &system); |
32 |
|
|
} |
33 |
|
✗ |
return 0; |
34 |
|
|
} |
35 |
|
|
|