#include "CRM32Pro.h"
#define EXAMPLE_VERSION "Example 5: Video player"
#define GFX_RESOURCE "data/gfx.dpf" // DPF with graphic resources
int ChangeFX(int kPressed,SDL_Surface *sFrame,SDL_Rect *rDst);
void PrintHelp(char *sErrMsg = NULL);
int main(int argc,char *argv[])
{
Uint8 done = 0;
if(argc < 2)
{
PrintHelp();
ILogSystem.
Msg(
LOG_LOW,
" · [LOG] - We need the .mpg video to play, try with \"VideoPlayer.exe your.mpg\"\n\n");
return 1;
}
if(CRM32Pro.
Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO | SDL_INIT_TIMER) < 0)
{
ILogSystem.
Msg(
LOG_NORMAL,
" · [LOG] - Couldnīt initialize CRM32Pro: %s\n",SDL_GetError());
return 1;
}
CRM32Pro.
Config.
Title = EXAMPLE_VERSION;
CRM32Pro.Config.
Icon = IImage->
Load(GFX_RESOURCE,
"icono");
{
return 1;
}
return 0;
}
int ChangeFX(int kPressed,SDL_Surface *sFrame,SDL_Rect *rDst)
{
if(kPressed == SDLK_LEFT)
{
if(fx > 0) fx--;
}
else if(kPressed == SDLK_RIGHT)
{
}
else if(kPressed == SDLK_s)
{
return 0;
}
if(CRM32Pro.
IsGL()) SDL_BlitSurface(sFrame,NULL,CRM32Pro.
screen,rDst);
return 1;
}
void PrintHelp(char *sErrMsg)
{
printf("-----------------------------------------------------------\n");
printf(" CRM32Pro SDK - HelpScreen\n %s\n",EXAMPLE_VERSION);
printf("-----------------------------------------------------------\n\n");
printf(" Use:\n");
printf(" - 'VideoPlayer your_video.mpg' to play the video.\n\n");
printf(" During the playback, you can use next keys:\n");
printf(" [ESCAPE] to abort and exit.\n");
printf(" [RIGHT CURSOR] to select the next FX effect.\n");
printf(" [LEFT CURSOR] to select the previous FX effect.\n");
if(sErrMsg != NULL) printf("%s",sErrMsg);
else printf("\n");
puts("Press [ENTER] key to continue.");
getchar();
}