Add sound in asset info
parent
0c540d5053
commit
e39e549cd0
|
@ -44,18 +44,12 @@ int main(void)
|
||||||
#endif
|
#endif
|
||||||
init_item_creation(&engine.assets);
|
init_item_creation(&engine.assets);
|
||||||
|
|
||||||
add_sound(&engine.assets, "snd_jump", "res/jump.ogg");
|
|
||||||
add_sound(&engine.assets, "snd_land", "res/land.ogg");
|
|
||||||
add_sound(&engine.assets, "snd_wdrop", "res/water_land.ogg");
|
|
||||||
add_sound(&engine.assets, "snd_bland", "res/boulder_move.ogg");
|
|
||||||
add_sound(&engine.assets, "snd_bubble", "res/bubble.ogg");
|
|
||||||
load_sfx(&engine, "snd_jump", PLAYER_JMP_SFX);
|
load_sfx(&engine, "snd_jump", PLAYER_JMP_SFX);
|
||||||
load_sfx(&engine, "snd_land", PLAYER_LAND_SFX);
|
load_sfx(&engine, "snd_land", PLAYER_LAND_SFX);
|
||||||
load_sfx(&engine, "snd_wdrop", WATER_IN_SFX);
|
load_sfx(&engine, "snd_wdrop", WATER_IN_SFX);
|
||||||
load_sfx(&engine, "snd_bland", BOULDER_LAND_SFX);
|
load_sfx(&engine, "snd_bland", BOULDER_LAND_SFX);
|
||||||
load_sfx(&engine, "snd_bubble", BUBBLE_SFX);
|
load_sfx(&engine, "snd_bubble", BUBBLE_SFX);
|
||||||
|
|
||||||
|
|
||||||
LevelScene_t scene;
|
LevelScene_t scene;
|
||||||
scene.scene.engine = &engine;
|
scene.scene.engine = &engine;
|
||||||
init_sandbox_scene(&scene);
|
init_sandbox_scene(&scene);
|
||||||
|
|
|
@ -6,6 +6,8 @@ typedef enum AssetInfoType
|
||||||
{
|
{
|
||||||
TEXTURE_INFO,
|
TEXTURE_INFO,
|
||||||
SPRITE_INFO,
|
SPRITE_INFO,
|
||||||
|
SOUND_INFO,
|
||||||
|
EMITTER_INFO,
|
||||||
LEVELPACK_INFO,
|
LEVELPACK_INFO,
|
||||||
INVALID_INFO
|
INVALID_INFO
|
||||||
}AssetInfoType_t;
|
}AssetInfoType_t;
|
||||||
|
@ -186,6 +188,10 @@ bool load_from_infofile(const char* file, Assets_t* assets)
|
||||||
{
|
{
|
||||||
info_type = SPRITE_INFO;
|
info_type = SPRITE_INFO;
|
||||||
}
|
}
|
||||||
|
else if (strcmp(tmp, "Sound") == 0)
|
||||||
|
{
|
||||||
|
info_type = SOUND_INFO;
|
||||||
|
}
|
||||||
else if (strcmp(tmp, "LevelPack") == 0)
|
else if (strcmp(tmp, "LevelPack") == 0)
|
||||||
{
|
{
|
||||||
info_type = LEVELPACK_INFO;
|
info_type = LEVELPACK_INFO;
|
||||||
|
@ -213,7 +219,16 @@ bool load_from_infofile(const char* file, Assets_t* assets)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
printf("Added texture %s as %s\n", info_str, name);
|
printf("Added texture %s as %s\n", info_str, name);
|
||||||
//strcpy(tmp2, name);
|
}
|
||||||
|
break;
|
||||||
|
case SOUND_INFO:
|
||||||
|
{
|
||||||
|
if (add_sound(assets, name, info_str) == NULL)
|
||||||
|
{
|
||||||
|
printf("Unable to add texture at line %lu\n", line_num);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
printf("Added sound %s as %s\n", info_str, name);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case LEVELPACK_INFO:
|
case LEVELPACK_INFO:
|
||||||
|
|
Loading…
Reference in New Issue