summaryrefslogtreecommitdiff
path: root/src/game/assets.cpp
blob: e8ad153a9e3c378f1162dee0929ee0e29051e5dc (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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
/*
This file is part of Minitrem.

Minitrem is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.

Minitrem is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with Minitrem.  If not, see <http://www.gnu.org/licenses/>.
*/

#include "game.hpp"

namespace game::assets {

soldier_assets_t soldier;
spider_assets_t spider;
nest_assets_t nest;
repl_assets_t repl;
fx_assets_t fx;
deco_assets_t deco;
audio::ambient_t ambients[AMBIENT_COUNT];

render::animated_texture_t unit_selected;
render::animated_texture_t unit_selected_halo;
render::animated_texture_t move_marker, aim_marker;

void load(void)
{
	soldier.head_idle.load("assets/units/soldier/head_idle", 1, 1, 1);
	soldier.body_idle.load("assets/units/soldier/body_idle", 2, 2, 2);
	soldier.body_aiming.load("assets/units/soldier/body_aiming", 2, 2, 2);
	soldier.body_firing.load("assets/units/soldier/body_firing", 2, 2, 2);
	soldier.legs_idle.load("assets/units/soldier/legs_idle", 2, 2);
	soldier.legs_walking.load("assets/units/soldier/legs_walking", 2, 2);
	soldier.dead.load("assets/units/soldier/dead_", 1);
	soldier.gibbing.load("assets/units/soldier/gibbing_", 3);

	soldier.fire.load("assets/units/soldier/fire.ogg");
	soldier.fire.volume = 4.0f;
	soldier.pain.load("assets/units/soldier/pain.ogg");
	soldier.death.load("assets/units/soldier/death1.ogg");
	soldier.death.load("assets/units/soldier/death2.ogg");
	soldier.gib_sound.load("assets/units/soldier/gibbing.ogg");

	soldier.step_stone.load("assets/units/soldier/step_stone_1.ogg");
	soldier.step_stone.load("assets/units/soldier/step_stone_2.ogg");
	soldier.step_stone.load("assets/units/soldier/step_stone_3.ogg");
	soldier.step_stone.load("assets/units/soldier/step_stone_4.ogg");
	soldier.step_stone.load("assets/units/soldier/step_stone_5.ogg");
	soldier.step_stone.volume = 1.0f;

	spider.idle.load("assets/units/spider/idle", 2, 2, 2);
	spider.walking.load("assets/units/spider/walking", 2, 2, 2);
	spider.dead.load("assets/units/spider/dead_", 1);
	spider.sounds.load("assets/units/spider/sound1.ogg");
	spider.sounds.load("assets/units/spider/sound2.ogg");
	spider.sounds.load("assets/units/spider/sound3.ogg");
	spider.sounds.load("assets/units/spider/sound4.ogg");
	spider.sounds.load("assets/units/spider/sound5.ogg");
	spider.sounds.load("assets/units/spider/sound6.ogg");
	spider.sounds.load("assets/units/spider/sound7.ogg");
	spider.bite.load("assets/units/spider/bite.ogg");

	nest.idle.load("assets/units/nest/idle_", 5);
	nest.dead.load("assets/units/nest/dead_", 1);
	nest.spawn.load("assets/units/nest/spawn.ogg");
	nest.pain.load("assets/units/nest/pain.ogg");
	nest.death.load("assets/units/nest/death.ogg");

	repl.idle.load("assets/units/repl/idle_", 1);
	repl.dead.load("assets/units/repl/dead_", 1);
	repl.sound.load("assets/units/repl/sound.ogg");
	repl.damage.load("assets/units/repl/damage1.ogg");
	repl.damage.load("assets/units/repl/damage2.ogg");
	repl.damage.load("assets/units/repl/damage3.ogg");

	fx.blood.load("assets/units/blood_", 4);
	fx.flash.load("assets/units/flash_", 1);

	fx.explosion.load("assets/fx/explosion_", 7);
	fx.explosion_sound.load("assets/fx/explosion.ogg");
	fx.explosion_sound.volume = 3.0f;

	deco.stone.load("assets/deco/stone_", 1);
	deco.stone_cracked.load("assets/deco/stone_cracked_", 1);
	deco.eyething.load("assets/deco/eyething_", 2);
	deco.eyething_dead.load("assets/deco/eyething_dead_", 2);
	deco.spike.load("assets/deco/spike_", 1);
	deco.spike_broken.load("assets/deco/spike_broken_", 1);
	deco.spike_small.load("assets/deco/spike_small_", 1); 
	deco.wart.load("assets/deco/wart_", 1);

	unit_selected.load("assets/units/selected_", 1);
	unit_selected_halo.load("assets/units/selected_halo_", 1);
	move_marker.load("assets/units/move_marker_", 8);
	aim_marker.load("assets/units/aim_marker_", 5);

	world::register_tile(TILE_DIRT, 0);
	render::register_tile(TILE_DIRT, "assets/tiles/dirt.png", NULL, 0.0f, render::LAYER_FLAT);
	world::register_tile(TILE_DIRT_RED, 0);
	render::register_tile(TILE_DIRT_RED, "assets/tiles/dirt_red.png", NULL, 0.0f, render::LAYER_FLAT);
	world::register_tile(TILE_STONE, CF_SOLID);
	render::register_tile(TILE_STONE, "assets/tiles/stone.png", "assets/tiles/stone_side.png", 1.0f, render::LAYER_NORMAL);
	world::register_tile(TILE_STONE_RED, CF_SOLID);
	render::register_tile(TILE_STONE_RED, "assets/tiles/stone_red.png", "assets/tiles/stone_red_side.png", 1.4f, render::LAYER_NORMAL);
	world::register_tile(TILE_WATER, CF_WATER);
	render::register_tile(TILE_WATER, "assets/tiles/water.png", NULL, 0.0f, render::LAYER_FLAT);
	world::register_tile(TILE_GRAVEL, 0);
	render::register_tile(TILE_GRAVEL, "assets/tiles/gravel.png", NULL, 0.0f, render::LAYER_FLAT);

	ambients[AMBIENT_NEXUS].load("assets/ambience/nexus.ogg");
	ambients[AMBIENT_CHASM].load("assets/ambience/chasm.ogg");
	ambients[AMBIENT_CHASM].volume = 12.0f;
	ambients[AMBIENT_WIND].load("assets/ambience/wind.ogg");
	ambients[AMBIENT_WIND].volume = 3.0f;
	ambients[AMBIENT_WATER].load("assets/ambience/water.ogg");
	ambients[AMBIENT_WATER].volume = 0.1f;
}

} // namespace game::assets