|
|
|
@ -5,7 +5,7 @@
|
|
|
|
#include <SDL_image.h>
|
|
|
|
#include <SDL_image.h>
|
|
|
|
|
|
|
|
|
|
|
|
// Fanta <fanta@56k.es> 2026
|
|
|
|
// Fanta <fanta@56k.es> 2026
|
|
|
|
// Presentator 0.1
|
|
|
|
// Presentator 0.2
|
|
|
|
|
|
|
|
|
|
|
|
// Variables
|
|
|
|
// Variables
|
|
|
|
int modPlaying;
|
|
|
|
int modPlaying;
|
|
|
|
@ -13,7 +13,7 @@ char * modName = NULL;
|
|
|
|
int modVolume = 100;
|
|
|
|
int modVolume = 100;
|
|
|
|
int iv;
|
|
|
|
int iv;
|
|
|
|
char *imgVol[] = {"res/vol100.png","res/vol090.png","res/vol080.png","res/vol070.png","res/vol060.png","res/vol050.png","res/vol040.png","res/vol030.png","res/vol020.png","res/vol010.png","res/vol000.png"};
|
|
|
|
char *imgVol[] = {"res/vol100.png","res/vol090.png","res/vol080.png","res/vol070.png","res/vol060.png","res/vol050.png","res/vol040.png","res/vol030.png","res/vol020.png","res/vol010.png","res/vol000.png"};
|
|
|
|
char windowTitle[16] = "Presentator 0.1";
|
|
|
|
char windowTitle[16] = "Presentator 0.2";
|
|
|
|
int windowWidth = 1024;
|
|
|
|
int windowWidth = 1024;
|
|
|
|
int windowHeight = 768;
|
|
|
|
int windowHeight = 768;
|
|
|
|
char * slidesIndex = "slides/index.txt";
|
|
|
|
char * slidesIndex = "slides/index.txt";
|
|
|
|
@ -27,6 +27,8 @@ SDL_Texture *textureSlide = NULL;
|
|
|
|
SDL_Texture *textureProgressRect = NULL;
|
|
|
|
SDL_Texture *textureProgressRect = NULL;
|
|
|
|
SDL_Event evento;
|
|
|
|
SDL_Event evento;
|
|
|
|
xmp_context ctx;
|
|
|
|
xmp_context ctx;
|
|
|
|
|
|
|
|
int transition_active = 0;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Functions
|
|
|
|
// Functions
|
|
|
|
int createWindow(void){
|
|
|
|
int createWindow(void){
|
|
|
|
@ -105,6 +107,23 @@ int loadSlide(int nslide){
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int transition_BackToBlack(void){
|
|
|
|
|
|
|
|
SDL_SetRenderDrawBlendMode(render, SDL_BLENDMODE_BLEND);
|
|
|
|
|
|
|
|
SDL_Rect barra = { 0, 0, windowWidth, windowHeight };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int z;
|
|
|
|
|
|
|
|
for (z = 250; z > 0; z = z -10) {
|
|
|
|
|
|
|
|
loadSlide(actualNSlide);
|
|
|
|
|
|
|
|
refreshVolumeArea(iv);
|
|
|
|
|
|
|
|
SDL_SetRenderDrawColor(render, 0, 0, 0, z);
|
|
|
|
|
|
|
|
SDL_RenderFillRect(render, &barra);
|
|
|
|
|
|
|
|
SDL_RenderPresent(render);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int renderAll(void){
|
|
|
|
int renderAll(void){
|
|
|
|
loadSlide(actualNSlide);
|
|
|
|
loadSlide(actualNSlide);
|
|
|
|
refreshVolumeArea(iv);
|
|
|
|
refreshVolumeArea(iv);
|
|
|
|
@ -112,6 +131,8 @@ int renderAll(void){
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Main
|
|
|
|
// Main
|
|
|
|
int main(int argc, char ** argv) {
|
|
|
|
int main(int argc, char ** argv) {
|
|
|
|
createWindow();
|
|
|
|
createWindow();
|
|
|
|
@ -120,6 +141,10 @@ int main(int argc, char ** argv) {
|
|
|
|
refreshVolumeArea(0);
|
|
|
|
refreshVolumeArea(0);
|
|
|
|
SDL_RenderPresent(render);
|
|
|
|
SDL_RenderPresent(render);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
while (!quit) {
|
|
|
|
while (!quit) {
|
|
|
|
SDL_WaitEvent(&evento);
|
|
|
|
SDL_WaitEvent(&evento);
|
|
|
|
|
|
|
|
|
|
|
|
@ -184,12 +209,21 @@ int main(int argc, char ** argv) {
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SDLK_RIGHT:
|
|
|
|
case SDLK_RIGHT:
|
|
|
|
actualNSlide = actualNSlide + 1;
|
|
|
|
actualNSlide = actualNSlide + 1;
|
|
|
|
|
|
|
|
if (transition_active == 1 ){ transition_BackToBlack(); };
|
|
|
|
renderAll();
|
|
|
|
renderAll();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case SDLK_LEFT:
|
|
|
|
case SDLK_LEFT:
|
|
|
|
actualNSlide = actualNSlide - 1;
|
|
|
|
actualNSlide = actualNSlide - 1;
|
|
|
|
|
|
|
|
if (transition_active == 1 ){ transition_BackToBlack(); };
|
|
|
|
renderAll();
|
|
|
|
renderAll();
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case SDLK_F1:
|
|
|
|
|
|
|
|
if (transition_active == 0){
|
|
|
|
|
|
|
|
transition_active = 1;
|
|
|
|
|
|
|
|
}else{
|
|
|
|
|
|
|
|
transition_active = 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|