Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 17c13fa3d5 | |||
| de40ae8715 | |||
| be623e01de | |||
| df6a9a7541 | |||
| cc13ca4a4b | |||
| fe117631f2 | |||
| a417f6cb3d | |||
| 61d6338c8d | |||
| fb322f7e7b |
1
.gitignore
vendored
1
.gitignore
vendored
@@ -1,6 +1,7 @@
|
|||||||
.vscode/*
|
.vscode/*
|
||||||
.DS_Store
|
.DS_Store
|
||||||
thumbs.db
|
thumbs.db
|
||||||
|
dektop.ini
|
||||||
*debug*
|
*debug*
|
||||||
*.psd
|
*.psd
|
||||||
*.zip
|
*.zip
|
||||||
|
|||||||
13
Makefile
13
Makefile
@@ -1,6 +1,15 @@
|
|||||||
|
executable = volcano_2016
|
||||||
|
source = source/*.cpp
|
||||||
|
|
||||||
|
windows:
|
||||||
|
@echo off
|
||||||
|
if not exist bin\ (mkdir bin)
|
||||||
|
g++ $(source) -std=c++11 -Wall -O2 -lmingw32 -lSDL2main -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -static-libstdc++ -Wl,-subsystem,windows -o bin/$(executable).exe
|
||||||
|
strip -s -R .comment -R .gnu.version bin/$(executable).exe --strip-unneeded
|
||||||
macos:
|
macos:
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
g++ source/*.cpp -std=c++11 -Wall -O2 -lSDL2 -o bin/volcano_macos
|
g++ $(source) -std=c++11 -Wall -O2 -lSDL2 -ffunction-sections -fdata-sections -o bin/$(executable)_macos
|
||||||
linux:
|
linux:
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
g++ source/*.cpp -std=c++11 -Wall -O2 -lSDL2 -o bin/volcano_linux
|
g++ $(source) -std=c++11 -Wall -Os -lSDL2 -ffunction-sections -fdata-sections -Wl,--gc-sections -o bin/$(executable)_linux
|
||||||
|
strip -s -R .comment -R .gnu.version bin/$(executable)_linux --strip-unneeded
|
||||||
13
README.md
13
README.md
@@ -3,3 +3,16 @@
|
|||||||
Volcano es un juego de plataformas y aventuras que transcurre en una isla. Se empezó a programar en Pascal en 2016 y acabó abandonado debido a la magnitud del proyecto por aquel entonces y a la falta de una idea clara de cómo afrontar el diseño final del juego.
|
Volcano es un juego de plataformas y aventuras que transcurre en una isla. Se empezó a programar en Pascal en 2016 y acabó abandonado debido a la magnitud del proyecto por aquel entonces y a la falta de una idea clara de cómo afrontar el diseño final del juego.
|
||||||
|
|
||||||
Esta es la versión inacabada de 2016 tal y como se quedó, pero portada a C++.
|
Esta es la versión inacabada de 2016 tal y como se quedó, pero portada a C++.
|
||||||
|
|
||||||
|
## Teclas
|
||||||
|
* Cursores: Mueve al jugador
|
||||||
|
* F: Cambia a pantalla completa
|
||||||
|
* ESC: Sale al menu o sale del juego
|
||||||
|
* F1: Activa el modo debug
|
||||||
|
* F2: Activa el filtro de imagen
|
||||||
|
* T: Cambia a varias habitaciones, incluída la habitación de test
|
||||||
|
* H: Otorga 255 vidas y activa/desactiva la invencibilidad
|
||||||
|
* G: Modifica la gravedad
|
||||||
|
* Z: Mueve al jugador un pixel hacia arriba (util si la gravedad está desactivada)
|
||||||
|
* X: Mueve al jugador un pixel hacia abajo (util si la gravedad está desactivada)
|
||||||
|
* W,A,S,D: Para moverse por las habitaciones
|
||||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 1.3 KiB |
@@ -1,3 +1,4 @@
|
|||||||
|
#ifndef __MIPSEL__
|
||||||
#include "jail_audio.h"
|
#include "jail_audio.h"
|
||||||
#include "stb_vorbis.c"
|
#include "stb_vorbis.c"
|
||||||
|
|
||||||
@@ -77,7 +78,7 @@ void JA_Init(const int freq, const SDL_AudioFormat format, const int channels) {
|
|||||||
|
|
||||||
JA_Music JA_LoadMusic(const char* filename) {
|
JA_Music JA_LoadMusic(const char* filename) {
|
||||||
int chan, samplerate;
|
int chan, samplerate;
|
||||||
JA_Music music = (JA_Music)SDL_malloc(sizeof(JA_Music_t));
|
JA_Music music = new JA_Music_t();
|
||||||
music->samples = stb_vorbis_decode_filename(filename, &chan, &samplerate, &music->output);
|
music->samples = stb_vorbis_decode_filename(filename, &chan, &samplerate, &music->output);
|
||||||
|
|
||||||
SDL_AudioCVT cvt;
|
SDL_AudioCVT cvt;
|
||||||
@@ -129,8 +130,8 @@ JA_Music_state JA_GetMusicState() {
|
|||||||
|
|
||||||
void JA_DeleteMusic(JA_Music music) {
|
void JA_DeleteMusic(JA_Music music) {
|
||||||
if (current_music == music) current_music = NULL;
|
if (current_music == music) current_music = NULL;
|
||||||
free(music->output);
|
SDL_free(music->output);
|
||||||
free(music);
|
delete music;
|
||||||
}
|
}
|
||||||
|
|
||||||
JA_Sound JA_LoadSound(const char* filename) {
|
JA_Sound JA_LoadSound(const char* filename) {
|
||||||
@@ -144,7 +145,7 @@ JA_Sound JA_LoadSound(const char* filename) {
|
|||||||
cvt.buf = (Uint8 *) SDL_malloc(cvt.len * cvt.len_mult);
|
cvt.buf = (Uint8 *) SDL_malloc(cvt.len * cvt.len_mult);
|
||||||
SDL_memcpy(cvt.buf, sound->buffer, sound->length);
|
SDL_memcpy(cvt.buf, sound->buffer, sound->length);
|
||||||
SDL_ConvertAudio(&cvt);
|
SDL_ConvertAudio(&cvt);
|
||||||
free(sound->buffer);
|
SDL_FreeWAV(sound->buffer);
|
||||||
sound->buffer = cvt.buf;
|
sound->buffer = cvt.buf;
|
||||||
sound->length = cvt.len_cvt;
|
sound->length = cvt.len_cvt;
|
||||||
|
|
||||||
@@ -167,7 +168,7 @@ void JA_DeleteSound(JA_Sound sound) {
|
|||||||
for (int i = 0; i < JA_MAX_SIMULTANEOUS_CHANNELS; i++) {
|
for (int i = 0; i < JA_MAX_SIMULTANEOUS_CHANNELS; i++) {
|
||||||
if (channels[i].sound == sound) JA_StopChannel(i);
|
if (channels[i].sound == sound) JA_StopChannel(i);
|
||||||
}
|
}
|
||||||
SDL_FreeWAV(sound->buffer);
|
SDL_free(sound->buffer);
|
||||||
delete sound;
|
delete sound;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -209,4 +210,4 @@ JA_Channel_state JA_GetChannelState(const int channel) {
|
|||||||
if (channel < 0 || channel >= JA_MAX_SIMULTANEOUS_CHANNELS) return JA_CHANNEL_INVALID;
|
if (channel < 0 || channel >= JA_MAX_SIMULTANEOUS_CHANNELS) return JA_CHANNEL_INVALID;
|
||||||
return channels[channel].state;
|
return channels[channel].state;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
#include "ifdefs.h"
|
#include <SDL2/SDL.h>
|
||||||
|
|
||||||
enum JA_Channel_state { JA_CHANNEL_INVALID, JA_CHANNEL_FREE, JA_CHANNEL_PLAYING, JA_CHANNEL_PAUSED };
|
enum JA_Channel_state { JA_CHANNEL_INVALID, JA_CHANNEL_FREE, JA_CHANNEL_PLAYING, JA_CHANNEL_PAUSED };
|
||||||
enum JA_Music_state { JA_MUSIC_INVALID, JA_MUSIC_PLAYING, JA_MUSIC_PAUSED, JA_MUSIC_STOPPED };
|
enum JA_Music_state { JA_MUSIC_INVALID, JA_MUSIC_PLAYING, JA_MUSIC_PAUSED, JA_MUSIC_STOPPED };
|
||||||
|
|||||||
@@ -267,188 +267,188 @@ void CreateActor(Tactor &a, Uint8 kind, Uint8 id, Sint16 dstx, Sint16 dsty, Sint
|
|||||||
void setExecutablePath(std::string path)
|
void setExecutablePath(std::string path)
|
||||||
{
|
{
|
||||||
executablePath = path.substr(0, path.find_last_of("\\/"));
|
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;
|
std::string p;
|
||||||
SDL_RWops *file;
|
SDL_RWops *file;
|
||||||
|
|
||||||
p = FILE_MAP_VOLCANO = executablePath + "/../data/volcano.map.bak1";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_TILES_VOLCANO = executablePath + "/../media/gfx/tiles_volcano.png";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_TILES_SURFACE = executablePath + "/../media/gfx/tiles_surface.png";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_BKG_SURFACE = executablePath + "/../media/gfx/bkg_surface.png";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_MENU = executablePath + "/../media/gfx/menu.png";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_MENU_ANIMATION = executablePath + "/../media/gfx/menu_animation.png";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_ACTORS = executablePath + "/../media/gfx/actors.png";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_PLAYER = executablePath + "/../media/gfx/player.png";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_HUD = executablePath + "/../media/gfx/hud.png";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_FILTER = executablePath + "/../media/gfx/filter.png";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_SOUND_JUMP = executablePath + "/../media/sound/sound_player_jump.wav";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_SOUND_DEATH = executablePath + "/../media/sound/sound_player_death.wav";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_SOUND_COIN = executablePath + "/../media/sound/sound_player_coin.wav";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_SOUND_MENU_LOGO = executablePath + "/../media/sound/sound_menu_logo.wav";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_SOUND_MENU_START = executablePath + "/../media/sound/sound_menu_start.wav";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_SOUND_DROP_ENEMY = executablePath + "/../media/sound/sound_drop_enemy.wav";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_SOUND_DROP_SPLAT = executablePath + "/../media/sound/sound_drop_splat.wav";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_MUSIC_SURFACE = executablePath + "/../media/music/music_surface.ogg";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_MUSIC_VOLCANO = executablePath + "/../media/music/music_volcano.ogg";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
|
|
||||||
p = FILE_MUSIC_MENU = executablePath + "/../media/music/music_menu.ogg";
|
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");
|
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);
|
SDL_RWclose(file);
|
||||||
}
|
}
|
||||||
@@ -476,10 +476,10 @@ void LoadMap()
|
|||||||
map.tile = new Uint8[size];
|
map.tile = new Uint8[size];
|
||||||
map.actor = new Uint8[size];
|
map.actor = new Uint8[size];
|
||||||
|
|
||||||
for (Uint32 i = 0; i < size; i++)
|
for (Uint32 i = 0; i < (Uint32)size; ++i)
|
||||||
SDL_RWread(file, &map.tile[i], sizeof(Uint8), 1);
|
SDL_RWread(file, &map.tile[i], sizeof(Uint8), 1);
|
||||||
|
|
||||||
for (Uint32 i = 0; i < size; i++)
|
for (Uint32 i = 0; i < (Uint32)size; ++i)
|
||||||
SDL_RWread(file, &map.actor[i], sizeof(Uint8), 1);
|
SDL_RWread(file, &map.actor[i], sizeof(Uint8), 1);
|
||||||
|
|
||||||
SDL_RWclose(file);
|
SDL_RWclose(file);
|
||||||
@@ -874,7 +874,7 @@ void IniPlayer()
|
|||||||
player.jump_pressed_now = false;
|
player.jump_pressed_now = false;
|
||||||
player.jump_pressed_before = false;
|
player.jump_pressed_before = false;
|
||||||
player.standing = true;
|
player.standing = true;
|
||||||
player.invulnerable = true;
|
player.invulnerable = false;
|
||||||
player.jumpforce = 10;
|
player.jumpforce = 10;
|
||||||
player.active_animation = 0;
|
player.active_animation = 0;
|
||||||
player.enabled = true;
|
player.enabled = true;
|
||||||
@@ -1962,9 +1962,9 @@ void IniProgram()
|
|||||||
event = new SDL_Event();
|
event = new SDL_Event();
|
||||||
|
|
||||||
prog.music_enabled = true;
|
prog.music_enabled = true;
|
||||||
prog.filter = false;
|
prog.filter = true;
|
||||||
SetProgSection(SECTION_MENU);
|
SetProgSection(SECTION_MENU);
|
||||||
prog.debug = true;
|
prog.debug = false;
|
||||||
|
|
||||||
/*if (prog.music_enabled) // [TODO] Jail_Audio encara no permet canviar el volum
|
/*if (prog.music_enabled) // [TODO] Jail_Audio encara no permet canviar el volum
|
||||||
Mix_VolumeMusic(100);
|
Mix_VolumeMusic(100);
|
||||||
@@ -1997,18 +1997,18 @@ int main(int argc, char *args[])
|
|||||||
fullscreen = false;
|
fullscreen = false;
|
||||||
|
|
||||||
// Inicializa SDL
|
// Inicializa SDL
|
||||||
printf("Init SDL..\n");
|
//printf("Init SDL..\n");
|
||||||
SDL_Init(SDL_INIT_VIDEO | SDL_INIT_JOYSTICK | SDL_INIT_AUDIO | SDL_INIT_HAPTIC);
|
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);
|
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);
|
renderer = SDL_CreateRenderer(window, -1, SDL_RENDERER_ACCELERATED | SDL_RENDERER_PRESENTVSYNC);
|
||||||
SDL_RenderSetLogicalSize(renderer, 320, 240);
|
SDL_RenderSetLogicalSize(renderer, 320, 240);
|
||||||
|
|
||||||
// Inicia las variables con las rutas de los ficheros
|
// Inicia las variables con las rutas de los ficheros
|
||||||
printf("Init paths..\n");
|
//printf("Init paths..\n");
|
||||||
setExecutablePath(args[0]);
|
setExecutablePath(args[0]);
|
||||||
|
|
||||||
// Inicializa el audio
|
// Inicializa el audio
|
||||||
JA_Init(22050, AUDIO_S16SYS, 2);
|
JA_Init(44100, AUDIO_S16, 2);
|
||||||
|
|
||||||
allocatePointers();
|
allocatePointers();
|
||||||
|
|
||||||
|
|||||||
36
sync.sh
36
sync.sh
@@ -1,36 +0,0 @@
|
|||||||
#!/bin/bash
|
|
||||||
readonly PROJECT=volcano_old
|
|
||||||
|
|
||||||
readonly USAGE="
|
|
||||||
USAGE:
|
|
||||||
$(basename "$0") [UPLOAD or DOWNLOAD]"
|
|
||||||
|
|
||||||
function help_message() {
|
|
||||||
echo "$USAGE"
|
|
||||||
}
|
|
||||||
|
|
||||||
PARAMETERS="UPLOAD DOWNLOAD upload download"
|
|
||||||
|
|
||||||
# check if there are all the parameters
|
|
||||||
if [ "$#" -ne 1 ]; then
|
|
||||||
help_message
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# check if the systems parameter is valid
|
|
||||||
if ! echo "$PARAMETERS" | grep -w "$1" >/dev/null; then
|
|
||||||
help_message
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
# UPLOAD
|
|
||||||
if [ "$1" = upload ] || [ "$1" = UPLOAD ]; then
|
|
||||||
printf "\n%s\n" "uploading $PROJECT"
|
|
||||||
rsync -azmPu --delete -e 'ssh -p 4545' . sergio@sustancia.synology.me:/home/sergio/backup/code/$PROJECT/
|
|
||||||
rsync -azmPu -e 'ssh -p 4545' . sergio@sustancia.synology.me:/home/sergio/backup/code/$PROJECT.all/
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [ "$1" = download ] || [ "$1" = DOWNLOAD ]; then
|
|
||||||
printf "%s\n" "downloading $PROJECT"
|
|
||||||
rsync -azmP --delete -e 'ssh -p 4545' sergio@sustancia.synology.me:/home/sergio/backup/code/$PROJECT/* .
|
|
||||||
fi
|
|
||||||
Reference in New Issue
Block a user