76 lines
1.4 KiB
C++
76 lines
1.4 KiB
C++
#include "jgame.h"
|
|
#include "jdraw8.h"
|
|
#include "jsound.h"
|
|
#include "jfile.h"
|
|
#include "info.h"
|
|
#include "modules.h"
|
|
#include "time.h"
|
|
|
|
#ifndef WIN32
|
|
#include <libgen.h>
|
|
#endif
|
|
|
|
int main( int argc, char* args[] ) {
|
|
|
|
#ifdef WIN32
|
|
JF_SetResourceFile("data.jrf");
|
|
#else
|
|
char res_file[255] = "";
|
|
strcpy(res_file, dirname(args[0]));
|
|
#ifdef __APPLE__
|
|
strcat(res_file, "/../Resources/data.jrf");
|
|
#else
|
|
strcat(res_file, "/data.jrf");
|
|
#endif
|
|
printf("ARXIU DE RECURSOS: %s\n", res_file);
|
|
JF_SetResourceFile(res_file);
|
|
#endif
|
|
|
|
srand( unsigned(time(NULL)) );
|
|
|
|
JG_Init();
|
|
JD8_Init("Pepe El Pintor");
|
|
JS_Init();
|
|
|
|
info::estat_joc = ESTAT_ICEKAS; // ESTAT_SEQUENCIA; // ESTAT_ICEKAS;
|
|
info::rosita_enabled = false;
|
|
info::job_enabled = false;
|
|
info::dificultat = MODE_FACIL;
|
|
info::personatge = PERSONATGE_PEPE;
|
|
|
|
FILE* ini = fopen("trick.ini", "rb");
|
|
if (ini != NULL) {
|
|
unsigned char contingut = 0;
|
|
fread(&contingut, 1, 1, ini);
|
|
fclose(ini);
|
|
if (contingut > 0) info::rosita_enabled = true;
|
|
if (contingut > 1) info::job_enabled = true;
|
|
}
|
|
|
|
while (info::estat_joc != ESTAT_EIXIR) {
|
|
switch (info::estat_joc) {
|
|
case ESTAT_ICEKAS:
|
|
case ESTAT_LOGO:
|
|
module::staticScreen::go();
|
|
break;
|
|
case ESTAT_MENU:
|
|
module::menu::go();
|
|
break;
|
|
case ESTAT_SELECT:
|
|
module::select::go();
|
|
break;
|
|
case ESTAT_SEQUENCIA:
|
|
module::sequence::go();
|
|
break;
|
|
}
|
|
}
|
|
|
|
JF_Quit();
|
|
JS_Finalize();
|
|
JD8_Quit();
|
|
JG_Finalize();
|
|
|
|
return 0;
|
|
}
|
|
|