Mercurial > molko
comparison src/examples/example-battle/registry.h @ 320:8f9937403749
misc: improve loading of data
author | David Demelier <markand@malikania.fr> |
---|---|
date | Fri, 01 Oct 2021 20:30:00 +0200 |
parents | examples/example-battle/registry.h@d01e83210ca2 |
children |
comparison
equal
deleted
inserted
replaced
319:b843eef4cc35 | 320:8f9937403749 |
---|---|
1 /* | |
2 * registry.h -- registry of resources | |
3 * | |
4 * Copyright (c) 2020-2021 David Demelier <markand@malikania.fr> | |
5 * | |
6 * Permission to use, copy, modify, and/or distribute this software for any | |
7 * purpose with or without fee is hereby granted, provided that the above | |
8 * copyright notice and this permission notice appear in all copies. | |
9 * | |
10 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
11 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
12 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR | |
13 * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES | |
14 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN | |
15 * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF | |
16 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. | |
17 */ | |
18 | |
19 #ifndef EXAMPLES_BATTLE_REGISTRY_H | |
20 #define EXAMPLES_BATTLE_REGISTRY_H | |
21 | |
22 #include <core/sound.h> | |
23 #include <core/sprite.h> | |
24 #include <core/texture.h> | |
25 | |
26 enum registry_texture { | |
27 /* UI. */ | |
28 REGISTRY_TEXTURE_CURSOR, | |
29 | |
30 /* Animations. */ | |
31 REGISTRY_TEXTURE_EXPLOSION, | |
32 | |
33 /* Characters. */ | |
34 REGISTRY_TEXTURE_JOHN_WALK, | |
35 REGISTRY_TEXTURE_JOHN_SWORD, | |
36 | |
37 /* Enemies. */ | |
38 REGISTRY_TEXTURE_HAUNTED_WOOD, | |
39 REGISTRY_TEXTURE_BLACK_CAT, | |
40 | |
41 /* Unused.*/ | |
42 REGISTRY_TEXTURE_NUM | |
43 }; | |
44 | |
45 enum registry_image { | |
46 REGISTRY_IMAGE_BATTLE_BACKGROUND, | |
47 REGISTRY_IMAGE_NUM | |
48 }; | |
49 | |
50 enum registry_sound { | |
51 REGISTRY_SOUND_FIRE, | |
52 REGISTRY_SOUND_NUM | |
53 }; | |
54 | |
55 extern struct texture registry_images[REGISTRY_IMAGE_NUM]; | |
56 extern struct texture registry_textures[REGISTRY_TEXTURE_NUM]; | |
57 extern struct sprite registry_sprites[REGISTRY_TEXTURE_NUM]; | |
58 extern struct sound registry_sounds[REGISTRY_SOUND_NUM]; | |
59 | |
60 void | |
61 registry_init(void); | |
62 | |
63 void | |
64 registry_finish(void); | |
65 | |
66 #endif /* !EXAMPLES_BATTLE_REGISTRY_H */ |