blob: 9671a00d21cd892edab3e91073b2c559ece5bb71 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
#include "assets.h"
const char textureAssetPaths[TEXTURE_ASSET_COUNT][ASSET_PATH_MAX] = {
"../assets/icon.png",
"../assets/icon128.png",
"../assets/icon64.png"
};
const char modelAssetPaths[MODEL_ASSET_COUNT][ASSET_PATH_MAX] = {
"../assets/antifaShip.obj",
"../assets/soldato.obj",
"../assets/caporale.obj",
"../assets/sergente.obj",
"../assets/maresciallo.obj",
"../assets/generale.obj",
"../assets/mussolini.obj",
"../assets/guidedMissile.obj"
};
void LoadAssets(Assets * assets) {
int i;
// Textures.
for (i = 0; i < TEXTURE_ASSET_COUNT; ++i)
assets->textures[i] = LoadTexture(textureAssetPaths[i]);
// Models.
for (i = 0; i < MODEL_ASSET_COUNT; ++i)
assets->models[i] = LoadModel(modelAssetPaths[i]);
TraceLog(LOG_INFO, "Assets loaded");
}
void unloadAssets(Assets * assets) {
int i;
// Textures.
for (i = 0; i < TEXTURE_ASSET_COUNT; ++i)
UnloadTexture(assets->textures[i]);
// Models.
for (i = 0; i < MODEL_ASSET_COUNT; ++i)
UnloadModel(assets->models[i]);
TraceLog(LOG_INFO, "Assets unloaded");
}
|