Actualizado jail_audio

This commit is contained in:
2022-08-23 13:10:49 +02:00
parent cc13ca4a4b
commit df6a9a7541
3 changed files with 71 additions and 70 deletions

View File

@@ -267,188 +267,188 @@ void CreateActor(Tactor &a, Uint8 kind, Uint8 id, Sint16 dstx, Sint16 dsty, Sint
void setExecutablePath(std::string path)
{
executablePath = path.substr(0, path.find_last_of("\\/"));
printf("path: %s\n", executablePath.c_str());
//printf("path: %s\n", executablePath.c_str());
std::string p;
SDL_RWops *file;
p = FILE_MAP_VOLCANO = executablePath + "/../data/volcano.map.bak1";
printf("%s\n",p.c_str());
// printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_TILES_VOLCANO = executablePath + "/../media/gfx/tiles_volcano.png";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_TILES_SURFACE = executablePath + "/../media/gfx/tiles_surface.png";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_BKG_SURFACE = executablePath + "/../media/gfx/bkg_surface.png";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_MENU = executablePath + "/../media/gfx/menu.png";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_MENU_ANIMATION = executablePath + "/../media/gfx/menu_animation.png";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_ACTORS = executablePath + "/../media/gfx/actors.png";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_PLAYER = executablePath + "/../media/gfx/player.png";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_HUD = executablePath + "/../media/gfx/hud.png";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_FILTER = executablePath + "/../media/gfx/filter.png";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_SOUND_JUMP = executablePath + "/../media/sound/sound_player_jump.wav";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_SOUND_DEATH = executablePath + "/../media/sound/sound_player_death.wav";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_SOUND_COIN = executablePath + "/../media/sound/sound_player_coin.wav";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_SOUND_MENU_LOGO = executablePath + "/../media/sound/sound_menu_logo.wav";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_SOUND_MENU_START = executablePath + "/../media/sound/sound_menu_start.wav";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_SOUND_DROP_ENEMY = executablePath + "/../media/sound/sound_drop_enemy.wav";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_SOUND_DROP_SPLAT = executablePath + "/../media/sound/sound_drop_splat.wav";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_MUSIC_SURFACE = executablePath + "/../media/music/music_surface.ogg";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_MUSIC_VOLCANO = executablePath + "/../media/music/music_volcano.ogg";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
p = FILE_MUSIC_MENU = executablePath + "/../media/music/music_menu.ogg";
printf("%s\n",p.c_str());
//printf("%s\n",p.c_str());
file = SDL_RWFromFile(p.c_str(), "r+b");
if (file == NULL)
if (file != NULL)
{
printf("Checking file %-20s [OK]\n", p.c_str());
//printf("Checking file %-20s [OK]\n", p.c_str());
}
SDL_RWclose(file);
}
@@ -1997,14 +1997,14 @@ int main(int argc, char *args[])
fullscreen = false;
// Inicializa SDL
printf("Init SDL..\n");
//printf("Init SDL..\n");
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO | SDL_INIT_HAPTIC);
window = SDL_CreateWindow((WINDOW_TITLE + BUILD).c_str(), SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, 640, 480, SDL_WINDOW_SHOWN);
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
SDL_RenderSetLogicalSize(renderer, 320, 240);
// Inicia las variables con las rutas de los ficheros
printf("Init paths..\n");
//printf("Init paths..\n");
setExecutablePath(args[0]);
// Inicializa el audio