convertit Asset i Audio
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
#include <algorithm> // Para find_if
|
||||
#include <stdexcept> // Para runtime_error
|
||||
#include "asset.h" // Para Asset, AssetType
|
||||
#include "jail_audio.h" // Para JA_DeleteMusic, JA_DeleteSound, JA_LoadMusic
|
||||
#include "jail_audio.h" // Para JA_DeleteMusic, JA_DeleteSound, JA_LoadMusic
|
||||
#include "lang.h" // Para getText
|
||||
#include "screen.h" // Para Screen
|
||||
#include "text.h" // Para Text, loadTextFile
|
||||
@@ -180,7 +180,7 @@ DemoData &Resource::getDemoData(int index)
|
||||
void Resource::loadSounds()
|
||||
{
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "\n>> SOUND FILES");
|
||||
auto list = Asset::get()->getListByType(AssetType::SOUND);
|
||||
auto list = Asset::get().getListByType(AssetType::SOUND);
|
||||
sounds_.clear();
|
||||
|
||||
for (const auto &l : list)
|
||||
@@ -195,7 +195,7 @@ void Resource::loadSounds()
|
||||
void Resource::loadMusics()
|
||||
{
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "\n>> MUSIC FILES");
|
||||
auto list = Asset::get()->getListByType(AssetType::MUSIC);
|
||||
auto list = Asset::get().getListByType(AssetType::MUSIC);
|
||||
musics_.clear();
|
||||
|
||||
for (const auto &l : list)
|
||||
@@ -210,7 +210,7 @@ void Resource::loadMusics()
|
||||
void Resource::loadTextures()
|
||||
{
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "\n>> TEXTURES");
|
||||
auto list = Asset::get()->getListByType(AssetType::BITMAP);
|
||||
auto list = Asset::get().getListByType(AssetType::BITMAP);
|
||||
textures_.clear();
|
||||
|
||||
for (const auto &l : list)
|
||||
@@ -224,7 +224,7 @@ void Resource::loadTextures()
|
||||
void Resource::loadTextFiles()
|
||||
{
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "\n>> TEXT FILES");
|
||||
auto list = Asset::get()->getListByType(AssetType::FONT);
|
||||
auto list = Asset::get().getListByType(AssetType::FONT);
|
||||
text_files_.clear();
|
||||
|
||||
for (const auto &l : list)
|
||||
@@ -238,7 +238,7 @@ void Resource::loadTextFiles()
|
||||
void Resource::loadAnimations()
|
||||
{
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "\n>> ANIMATIONS");
|
||||
auto list = Asset::get()->getListByType(AssetType::ANIMATION);
|
||||
auto list = Asset::get().getListByType(AssetType::ANIMATION);
|
||||
animations_.clear();
|
||||
|
||||
for (const auto &l : list)
|
||||
@@ -252,8 +252,8 @@ void Resource::loadAnimations()
|
||||
void Resource::loadDemoData()
|
||||
{
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "\n>> DEMO FILES");
|
||||
demos_.emplace_back(loadDemoDataFromFile(Asset::get()->get("demo1.bin")));
|
||||
demos_.emplace_back(loadDemoDataFromFile(Asset::get()->get("demo2.bin")));
|
||||
demos_.emplace_back(loadDemoDataFromFile(Asset::get().get("demo1.bin")));
|
||||
demos_.emplace_back(loadDemoDataFromFile(Asset::get().get("demo2.bin")));
|
||||
}
|
||||
|
||||
// Añade paletas a las texturas
|
||||
@@ -262,17 +262,17 @@ void Resource::addPalettes()
|
||||
SDL_LogInfo(SDL_LOG_CATEGORY_APPLICATION, "\n>> PALETTES");
|
||||
|
||||
// Jugador 1
|
||||
getTexture("player1.gif")->addPaletteFromFile(Asset::get()->get("player1_1_coffee_palette.gif"));
|
||||
getTexture("player1.gif")->addPaletteFromFile(Asset::get()->get("player1_2_coffee_palette.gif"));
|
||||
getTexture("player1.gif")->addPaletteFromFile(Asset::get()->get("player1_invencible_palette.gif"));
|
||||
getTexture("player1.gif")->addPaletteFromFile(Asset::get().get("player1_1_coffee_palette.gif"));
|
||||
getTexture("player1.gif")->addPaletteFromFile(Asset::get().get("player1_2_coffee_palette.gif"));
|
||||
getTexture("player1.gif")->addPaletteFromFile(Asset::get().get("player1_invencible_palette.gif"));
|
||||
|
||||
// Jugador 2
|
||||
getTexture("player2.gif")->addPaletteFromFile(Asset::get()->get("player2_1_coffee_palette.gif"));
|
||||
getTexture("player2.gif")->addPaletteFromFile(Asset::get()->get("player2_2_coffee_palette.gif"));
|
||||
getTexture("player2.gif")->addPaletteFromFile(Asset::get()->get("player2_invencible_palette.gif"));
|
||||
getTexture("player2.gif")->addPaletteFromFile(Asset::get().get("player2_1_coffee_palette.gif"));
|
||||
getTexture("player2.gif")->addPaletteFromFile(Asset::get().get("player2_2_coffee_palette.gif"));
|
||||
getTexture("player2.gif")->addPaletteFromFile(Asset::get().get("player2_invencible_palette.gif"));
|
||||
|
||||
// Fuentes
|
||||
getTexture("smb2.gif")->addPaletteFromFile(Asset::get()->get("smb2_palette1.pal"));
|
||||
getTexture("smb2.gif")->addPaletteFromFile(Asset::get().get("smb2_palette1.pal"));
|
||||
}
|
||||
|
||||
// Crea texturas
|
||||
|
||||
Reference in New Issue
Block a user