Release L'Abbaye des Morts


I have some problem with my port to GPH handhelds (Caanoo and F200 for the moment) .

I have created a new project with your/nevat latest code changes (from SVN) ...and adapted to run on Caanoo (with button controls), it run correctly on intro 1 and 2 but when i press the button used to switch to game (stage 3) it exit to menu. The same appen to the GP2X version.

The funny thing is that the same code (so 320x240 NOT UPSCALED ) recompiled for Pandora run correctly.

Let me say that i use Codeblock to port for GPH devices, and i have made some port with it, so i know that it works good.

This is how have modified your code to let run (apart from button controls):

Code:
ON main.c

/* Iniciar SDL */
  iniciar_sdl ();
	SDL_WM_SetCaption("Abbaye des Morts - v1.00", "Abbaye des Morts - v1.00");
#ifdef _RENDER_320_240
    #ifdef GPH
    pantalla = SDL_SetVideoMode(320,240,8,SDL_SWSURFACE);
    #else
    pantalla = SDL_SetVideoMode(320,240,8,SDL_HWSURFACE|SDL_DOUBLEBUF);
    #endif
#else
  pantalla = SDL_SetVideoMode(640,480,8,SDL_HWSURFACE|SDL_DOUBLEBUF);
#endif


.....

void iniciar_sdl () {

  #ifdef GPH
  if (SDL_Init(SDL_INIT_VIDEO|SDL_INIT_JOYSTICK)<0) {
	printf("No se puede inicializar SDL: %s\n",SDL_GetError());
	exit(1);
  }
  atexit(SDL_Quit);
  SDL_JoystickEventState(SDL_ENABLE);
  SDL_JoystickOpen(0);

  #else
  if (SDL_Init(SDL_INIT_VIDEO)<0) {
	printf("No se puede inicializar SDL: %s\n",SDL_GetError());
	exit(1);
  }
  atexit(SDL_Quit);
 
When you say it exits to menu, you mean it exits to the game menu (intro1) or it exits to the console menu?

Are you building with -D_RUTAS_RELATIVAS? What are the build flags? Maybe you should try modifying/removing the optimization flags (in case you are using them).
 
It exit to console menu.

Yes i built with :

-Wall -O2

-D_RENDER_320_240

-DCAANOO

-DGPH

-D_RUTAS_RELATIVAS
 
I don't know much about GamePark consoles but... they don't support HWSurfaces & Double Buffering ? That can be the problem.
 
Thanks for your help.

Just try it without -O2 and nothing changed :(

I think HW_SURFACE is supported (but it will be slow ...i have learned that GPH devices are most performant using SW_SURFACE) i don't know about Double buffer..

it worth a try.
 
Just tried with HW_SURFACE and SDL_DOUBLEBUF but the game exit to console menu like did before and also the screen flicker too much.
 
Ouch. This consoles have a terminal aplication ? You can run the program from the terminal and look if you got a message when the program crashes.

If you don't got a message, you can add a printf in the start of routine called "juego" (it's game routine) to look if the game crashes when enters here. The line is like this:

printf ("I'm in game routine \n");
 
This game is amazing it has so much playability, what would be nice would be 16bit sound to go with the 16bit visuals (when using the 16bit sprite set).

Also what we need next is a port of "you have to win the game" http://kotaku.com/5908873/you-have-to-win-the-game-even-though-i-didnt'>http://kotaku.com/5908873/you-have-to-win-the-game-even-though-i-didnt.

There is already a commodore 64 port http://www.google.co.uk/url?sa=t&rct=j&q=you%20have%20to%20win%20the%20game%20commodore%2064&source=web&cd=1&cad=rja&ved=0CDAQFjAA&url=http%3A%2F%2Fwww.lemon64.com%2Fforum%2Fviewtopic.php%3Fp%3D548295%26sid%3D6d184513b9d861eb694c0e3f67adef6f&ei=8P7iUKapKoaR0AWp74HwAQ&usg=AFQjCNF8Fas956RIO9amTdQjt-2yhEh0Cw&bvm=bv.1355534169,d.d2k'>http://www.google.co.uk/url?sa=t&rct=j&q=you%20have%20to%20win%20the%20game%20commodore%2064&source=web&cd=1&cad=rja&ved=0CDAQFjAA&url=http%3A%2F%2Fwww.lemon64.com%2Fforum%2Fviewtopic.php%3Fp%3D548295%26sid%3D6d184513b9d861eb694c0e3f67adef6f&ei=8P7iUKapKoaR0AWp74HwAQ&usg=AFQjCNF8Fas956RIO9amTdQjt-2yhEh0Cw&bvm=bv.1355534169,d.d2k.

Sent from my Nexus 7 using Tapatalk HD
 
I have dedicated some time to debug this game but without luck..
I have added some printf to the juego function like this:

void juego (SDL_Surface *pantalla, int *estadoj, int *cambiot) {

SDL_Surface *ventana = NULL;
SDL_Surface *tiles = NULL;
SDL_Surface *temp = NULL;
#ifdef _RENDER_320_240
SDL_Rect desventana = {32,24,0,0};
SDL_Rect srcventana = {0,0,256,192};
#else
SDL_Surface *doble = NULL;
SDL_Rect desventana = {64,48,0,0};
SDL_Rect srcventana = {0,0,512,384};
#endif
SDL_Surface *fondomd = NULL;
TTF_Font *fuente = NULL;
SDL_Event evento;

Mix_Music *sonido = NULL;

int fase[25][22][32];
int datosenem[25][7][15];
int habitacion = 5;
int prehabitacion = 5;
int coordx = 0;
int coordy = 0;
int salir = 0;
int frate1 = 0;
int tecla = 0;
int cambio = 1;
int ciclo[3] = {0,0,0};
float proyec[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int n = 0;
int pergamino = 0;
int teclap = 0;

struct enem enemigos = {
.tipo = {0,0,0,0,0,0,0},
.x = {0,0,0,0,0,0,0},
.y = {0,0,0,0,0,0,0},
.direccion = {0,0,0,0,0,0,0},
.tilex = {0,0,0,0,0,0,0},
.tiley = {0,0,0,0,0,0,0},
.animacion = {0,0,0,0,0,0,0},
.limizq = {0,0,0,0,0,0,0},
.limder = {0,0,0,0,0,0,0},
.velocidad = {0,0,0,0,0,0,0},
.disparo = {0,0,0,0,0,0,0},
.ajustex1 = {0,0,0,0,0,0,0},
.ajustex2 = {0,0,0,0,0,0,0},
.ajustey1 = {0,0,0,0,0,0,0},
.ajustey2 = {0,0,0,0,0,0,0}
};

struct protagonista jean = {
.x = 72,
.y = 136,
.direccion = 1,
.salto = 0,
.altura = 0,
.animacion = 0,
.gravedad = 1.9,
.puntos = {0,0,0,0,0,0,0,0},
.suelo = 0,
.colision = {0,0,0,0},
.agachado = 0,
.checkpoint = {5,72,136,5},
.estado = {9,0},
.flags = {0,0,0,0,0,0,0},
.muerte = 0,
.pulsa = {0,0,0,0},
.temp = 0
};
printf("begin of juego function \n");
temp = IMG_Load(RUTA_GRA_TEMP);
ventana = SDL_DisplayFormat(temp);
SDL_FreeSurface(temp);
if (*cambiot == 0)
temp = IMG_Load(RUTA_GRA_TILES);
else
temp = IMG_Load(RUTA_GRA_TILES_MD);
tiles = SDL_DisplayFormat(temp);
SDL_FreeSurface(temp);
SDL_SetColorKey(tiles, SDL_SRCCOLORKEY, SDL_MapRGB(tiles->format, 0, 0, 0) );

cargardatos (fase, datosenem);
printf("Maps and data loaded \n");

while (salir != 1) {
and also i redirect output messages to stderr files with this .sh file
 


#! /bin/sh
#

./abbaye_c >stdout.txt 2>stderr.txt

sync

cd /usr/gp2x
exec ./gp2xmenu
but the result of stderr.txt is only one line : Segmentation fault
The file stdout.txt is empty.
 
I don't know how to solve this.
 
Last edited by a moderator:
whats wrong with the game?

never mind your referring to gph ports?
 
Last edited by a moderator:
whats wrong with the game?

never mind your referring to gph ports?
Yes sorry for the off topic...but i like so much this game that i want to contribute also with ports for GPH consoles...but without luck.
 
Segmentation fault... The path to the files (graphics, fonts, data) is correct ?
 
Segmentation fault... The path to the files (graphics, fonts, data) is correct ?
I think yes...i never touched it (declared on comun.h)

and structure on my sd card is :

abbaye_c ( the bin executable)

abbaye.gpe ( is the sh script)

fonts dir

mapa dir

graphics dir with a subdir fondosmd

music dir

sound dir
 
@farox - you might want to add fflush(stdout); after your printfs
 
@farox: In line 150 of main.c change (estadoj = 3) to (estadoj = 4). With this change after the second intro you go directly to game over screen. With this change we test if intro2 load and exit correctly (so the problem is in the beginning of the "juego" fuction).
 
Thanks a lot crow_riot fflush did the trick :)

@nevat

With this change we test if intro2 load and exit correctly (so the problem is in the beginning of the "juego" fuction).
Yes i already changed fases and the only segfault fase is the juego function the others works good.

Now i have some output on stdout.txt....

FB_OpenMouse()
Using tslib touchscreen
begin of juego function
basic tiles loaded
Maps and data loaded
Framerate 1 is: 14071
dibujarfase 1
barraestado 1
jean tile a
dibujarjean 1
dibujar sparo
 
and this is the modified juego function with added printf+fflush

void juego (SDL_Surface *pantalla, int *estadoj, int *cambiot) {

SDL_Surface *ventana = NULL;
SDL_Surface *tiles = NULL;
SDL_Surface *temp = NULL;
#ifdef _RENDER_320_240
SDL_Rect desventana = {32,24,0,0};
SDL_Rect srcventana = {0,0,256,192};
#else
SDL_Surface *doble = NULL;
SDL_Rect desventana = {64,48,0,0};
SDL_Rect srcventana = {0,0,512,384};
#endif
SDL_Surface *fondomd = NULL;
TTF_Font *fuente = NULL;
SDL_Event evento;

Mix_Music *sonido = NULL;

int fase[25][22][32];
int datosenem[25][7][15];
int habitacion = 5;
int prehabitacion = 5;
int coordx = 0;
int coordy = 0;
int salir = 0;
int frate1 = 0;
int tecla = 0;
int cambio = 1;
int ciclo[3] = {0,0,0};
float proyec[24] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
int n = 0;
int pergamino = 0;
int teclap = 0;

struct enem enemigos = {
.tipo = {0,0,0,0,0,0,0},
.x = {0,0,0,0,0,0,0},
.y = {0,0,0,0,0,0,0},
.direccion = {0,0,0,0,0,0,0},
.tilex = {0,0,0,0,0,0,0},
.tiley = {0,0,0,0,0,0,0},
.animacion = {0,0,0,0,0,0,0},
.limizq = {0,0,0,0,0,0,0},
.limder = {0,0,0,0,0,0,0},
.velocidad = {0,0,0,0,0,0,0},
.disparo = {0,0,0,0,0,0,0},
.ajustex1 = {0,0,0,0,0,0,0},
.ajustex2 = {0,0,0,0,0,0,0},
.ajustey1 = {0,0,0,0,0,0,0},
.ajustey2 = {0,0,0,0,0,0,0}
};

struct protagonista jean = {
.x = 72,
.y = 136,
.direccion = 1,
.salto = 0,
.altura = 0,
.animacion = 0,
.gravedad = 1.9,
.puntos = {0,0,0,0,0,0,0,0},
.suelo = 0,
.colision = {0,0,0,0},
.agachado = 0,
.checkpoint = {5,72,136,5},
.estado = {9,0},
.flags = {0,0,0,0,0,0,0},
.muerte = 0,
.pulsa = {0,0,0,0},
.temp = 0
};
printf("begin of juego function \n");
fflush(stdout);
temp = IMG_Load(RUTA_GRA_TEMP);
ventana = SDL_DisplayFormat(temp);
SDL_FreeSurface(temp);
if (*cambiot == 0){
temp = IMG_Load(RUTA_GRA_TILES);
printf("basic tiles loaded \n");
fflush(stdout);
}
else {
temp = IMG_Load(RUTA_GRA_TILES_MD);
printf("SMD tiles loaded \n");
fflush(stdout);
}
tiles = SDL_DisplayFormat(temp);
SDL_FreeSurface(temp);
SDL_SetColorKey(tiles, SDL_SRCCOLORKEY, SDL_MapRGB(tiles->format, 0, 0, 0) );

cargardatos (fase, datosenem);
printf("Maps and data loaded \n");
fflush(stdout);

while (salir != 1) {

frate1 = framerate (1,0);

printf("Framerate 1 is: %i\n",frate1);
fflush(stdout);
#ifndef GPH //not used on gph devices
/* Pantalla completa o ventana */
if (tecla == 6)
#ifdef _OPENPANDORA
cambiarFiltroPandora(); // En OpenPandora cambiamos el filtro en lugar de ventana/pantalla
#else
SDL_WM_ToggleFullScreen (pantalla);
printf("Try to go fullscreen \n");
fflush(stdout);
#endif
#endif
/* Cambio de graficos */
if (tecla == 9) {
switch (*cambiot) {
case 0: *cambiot = 1;
SDL_FreeSurface (tiles);
temp = IMG_Load(RUTA_GRA_TILES_MD);
tiles = SDL_DisplayFormat(temp);
SDL_FreeSurface(temp);
SDL_SetColorKey(tiles, SDL_SRCCOLORKEY, SDL_MapRGB(tiles->format, 0, 0, 0) );
printf("GFX case 0 \n");
fflush(stdout);
if (habitacion != 4) {
SDL_FreeSurface(fondomd);
if (habitacion == 1)
temp = IMG_Load(RUTA_GRA_FONDO01_MD);
printf("abitacion 1 \n");
fflush(stdout);
if (habitacion == 2)
temp = IMG_Load(RUTA_GRA_FONDO02_MD);
if (habitacion == 3)
temp = IMG_Load(RUTA_GRA_FONDO03_MD);
if (habitacion == 5)
temp = IMG_Load(RUTA_GRA_FONDO05_MD);
if (habitacion == 6)
temp = IMG_Load(RUTA_GRA_FONDO06_MD);
if (habitacion == 7)
temp = IMG_Load(RUTA_GRA_FONDO07_MD);
if (habitacion == 8)
temp = IMG_Load(RUTA_GRA_FONDO08_MD);
if (habitacion == 9)
temp = IMG_Load(RUTA_GRA_FONDO09_MD);
if (habitacion == 10)
temp = IMG_Load(RUTA_GRA_FONDO10_MD);
if (habitacion == 11)
temp = IMG_Load(RUTA_GRA_FONDO11_MD);
if (habitacion == 12)
temp = IMG_Load(RUTA_GRA_FONDO12_MD);
if (habitacion == 13)
temp = IMG_Load(RUTA_GRA_FONDO13_MD);
if (habitacion == 14)
temp = IMG_Load(RUTA_GRA_FONDO14_MD);
if (habitacion == 15)
temp = IMG_Load(RUTA_GRA_FONDO15_MD);
if (habitacion == 16)
temp = IMG_Load(RUTA_GRA_FONDO16_MD);
if (habitacion == 17)
temp = IMG_Load(RUTA_GRA_FONDO17_MD);
if (habitacion == 18)
temp = IMG_Load(RUTA_GRA_FONDO18_MD);
if (habitacion == 19)
temp = IMG_Load(RUTA_GRA_FONDO19_MD);
if (habitacion == 20)
temp = IMG_Load(RUTA_GRA_FONDO20_MD);
if (habitacion == 21)
temp = IMG_Load(RUTA_GRA_FONDO21_MD);
if (habitacion == 22)
temp = IMG_Load(RUTA_GRA_FONDO22_MD);
if (habitacion == 23)
temp = IMG_Load(RUTA_GRA_FONDO23_MD);
if (habitacion == 24)
temp = IMG_Load(RUTA_GRA_FONDO24_MD);
fondomd = SDL_DisplayFormat(temp);
SDL_FreeSurface(temp);
}
break;
case 1: *cambiot = 0;
SDL_FreeSurface (tiles);
temp = IMG_Load(RUTA_GRA_TILES);
tiles = SDL_DisplayFormat(temp);
SDL_FreeSurface(temp);
SDL_SetColorKey(tiles, SDL_SRCCOLORKEY, SDL_MapRGB(tiles->format, 0, 0, 0) );
printf("GFX case 1 \n");
fflush(stdout);
break;
}
}

/* Contadores */
if (ciclo[0] < 29)
ciclo[0] ++;
else
ciclo[0] = 0;
if (ciclo[1] < 90)
ciclo[1] ++;
else
ciclo[1] = 0;
if (ciclo[2] < 8)
ciclo[2] ++;
else
ciclo[2] = 0;
SDL_FillRect(pantalla, NULL, SDL_MapRGB(ventana->format, 0, 0, 0));
animitems (fase, habitacion, ciclo);
dibujarfase (ventana, fase, tiles, habitacion, ciclo, *cambiot, fondomd);
printf("dibujarfase 1 \n");
fflush(stdout);
if (habitacion != 4)
barradeestado (ventana, tiles, habitacion, jean.estado[0], jean.estado[1]);
printf("barraestado 1 \n");
fflush(stdout);
if (jean.flags[6] < 8)
dibujarjean (ventana, tiles, &jean, ciclo);
printf("dibujarjean 1 \n");
fflush(stdout);
/* Gestion de enemigos */
if (enemigos.tipo[0] > 0) {
if (habitacion != 4)
moverenemigos (&enemigos, fase, ciclo, proyec, jean);
printf("mover enemigos \n");
fflush(stdout);
if ((habitacion == 5) || (habitacion == 6))
cruzados (&enemigos, ventana, tiles, ciclo, habitacion);
if (habitacion == 10)
dragon (&enemigos, ventana, tiles, ciclo, proyec);
if (habitacion == 11)
bolafuego (&enemigos, ventana, tiles, ciclo, jean, fase);
if (habitacion == 14)
plantas (&enemigos, ventana, tiles, ciclo, proyec);
if (habitacion == 9)
dibujarcuerda (enemigos, ventana, tiles);
if (habitacion == 18)
muerte (&enemigos, ventana, tiles, ciclo, proyec, fase);
if ((habitacion == 24) && (enemigos.tipo[0] == 18))
satan (&enemigos, ventana, tiles, ciclo, proyec);
if ((habitacion == 24) && (jean.flags[6] == 5))
cruzados (&enemigos, ventana, tiles, ciclo, habitacion);
dibujarenemigos (&enemigos, ventana, tiles);
printf("dibujar enemigos \n");
fflush(stdout);
}
/* Gestion de disparos */
if ((proyec[0] > 0) && ((habitacion == 17) || (habitacion == 20) || (habitacion == 21) || (habitacion == 22)))
dibujardisparo (proyec, tiles, ventana, &enemigos);
printf("dibujar sparo \n");
fflush(stdout);
/* Gestion de Jean */
if (jean.muerte == 0) {
if (jean.flags[6] < 5) {
if (jean.temp == 0)
tecladoj(&jean, &tecla);
if (jean.temp == 1)
jean.temp = 0;
colisiones (&jean, fase, habitacion);
printf("colisiones \n");
fflush(stdout);
moverjean (&jean);
printf("mover jean \n");
fflush(stdout);
}
if (habitacion != 4) {
tocarobjetos (&jean, fase, &habitacion, &pergamino, &cambio, &enemigos, proyec);
printf("tocar objectos \n");
fflush(stdout);
contacto (&jean, enemigos, proyec, habitacion);
}
eventos (&jean, fase, habitacion, ciclo, &enemigos);
printf("eventos \n");
fflush(stdout);
}
if (jean.muerte == 98) { /* Pasos a realizar cuando se pierde una vida */
if (habitacion != 4) {
habitacion = jean.checkpoint[0];
jean.x = jean.checkpoint[1];
jean.y = jean.checkpoint[2];
jean.salto = 0;
jean.altura = 0;
jean.pulsa[0] = 0;
jean.pulsa[1] = 0;
jean.pulsa[2] = 0;
jean.pulsa[3] = 0;
cambio = 2;
jean.estado[0] --;
jean.muerte = 0;
jean.temp = 1;
musica (habitacion, sonido, &cambio, prehabitacion, jean.flags[6]);
Mix_ResumeMusic ();
printf("una vita in meno \n");
fflush(stdout);
}
else {
jean.muerte = 0;
jean.flags[6] = 8;
printf("jean morto \n");
fflush(stdout);
}
}
/* Usar el flag 6 como contador, para hacer tiempo */
if (jean.flags[6] > 7)
jean.flags[6] ++;
/* Al llegar a 15, que salte la pantalla final */
if (jean.flags[6] == 15) {
*estadoj = 5;
salir = 1;
}
cambiopantalla (&jean, &habitacion, &cambio, &prehabitacion);
printf("cambio pantalla \n");
fflush(stdout);
if (cambio > 0) {
buscarenemigos (habitacion, &enemigos, &cambio, datosenem);
printf("buscar enemigos \n");
fflush(stdout);
musica (habitacion, sonido, &cambio, prehabitacion, jean.flags[6]);
for (n=0; n<24; n++) {
proyec[n] = 0;
}
if (habitacion != 4) {
SDL_FreeSurface(fondomd);
if (habitacion == 1)
temp = IMG_Load(RUTA_GRA_FONDO01_MD);
printf("abitacion 1 _second time\n");
fflush(stdout);
if (habitacion == 2)
temp = IMG_Load(RUTA_GRA_FONDO02_MD);
if (habitacion == 3)
temp = IMG_Load(RUTA_GRA_FONDO03_MD);
if (habitacion == 5)
temp = IMG_Load(RUTA_GRA_FONDO05_MD);
if (habitacion == 6)
temp = IMG_Load(RUTA_GRA_FONDO06_MD);
if (habitacion == 7)
temp = IMG_Load(RUTA_GRA_FONDO07_MD);
if (habitacion == 8)
temp = IMG_Load(RUTA_GRA_FONDO08_MD);
if (habitacion == 9)
temp = IMG_Load(RUTA_GRA_FONDO09_MD);
if (habitacion == 10)
temp = IMG_Load(RUTA_GRA_FONDO10_MD);
if (habitacion == 11)
temp = IMG_Load(RUTA_GRA_FONDO11_MD);
if (habitacion == 12)
temp = IMG_Load(RUTA_GRA_FONDO12_MD);
if (habitacion == 13)
temp = IMG_Load(RUTA_GRA_FONDO13_MD);
if (habitacion == 14)
temp = IMG_Load(RUTA_GRA_FONDO14_MD);
if (habitacion == 15)
temp = IMG_Load(RUTA_GRA_FONDO15_MD);
if (habitacion == 16)
temp = IMG_Load(RUTA_GRA_FONDO16_MD);
if (habitacion == 17)
temp = IMG_Load(RUTA_GRA_FONDO17_MD);
if (habitacion == 18)
temp = IMG_Load(RUTA_GRA_FONDO18_MD);
if (habitacion == 19)
temp = IMG_Load(RUTA_GRA_FONDO19_MD);
if (habitacion == 20)
temp = IMG_Load(RUTA_GRA_FONDO20_MD);
if (habitacion == 21)
temp = IMG_Load(RUTA_GRA_FONDO21_MD);
if (habitacion == 22)
temp = IMG_Load(RUTA_GRA_FONDO22_MD);
if (habitacion == 23)
temp = IMG_Load(RUTA_GRA_FONDO23_MD);
if (habitacion == 24)
temp = IMG_Load(RUTA_GRA_FONDO24_MD);
fondomd = SDL_DisplayFormat(temp);
SDL_FreeSurface(temp);
}
ciclo[0] = 0;
cambio = 0;
}
/* Pergaminos */
if (pergamino > 0)
mostrarpergamino (ventana, &pergamino);
if (jean.flags[6] == 3)
pergaminorojo (ventana, &jean);
if (jean.flags[6] == 6)
pergaminoazul (ventana, &jean);
#ifndef _RENDER_320_240
/* Zoom 2x */
doble = zoomSurface (ventana, 2, 2, 0);
SDL_BlitSurface(doble, &srcventana, pantalla, &desventana);
#else
SDL_BlitSurface(ventana, &srcventana, pantalla, &desventana);
#endif

SDL_Flip (pantalla);
printf("sdlflip pantalla \n");
fflush(stdout);

if (pergamino > 0) {
sonidos(3);
Mix_PauseMusic ();
/* Esperamos la pulsacion de una tecla */
while (teclap == 0)
tecladop (&teclap);
jean.pulsa[2] = 0;
jean.pulsa[3] = 0;
teclap = 0;
Mix_ResumeMusic ();
pergamino = 0;
}
if (jean.flags[6] == 4) {
sonidos(3);
sleep(5);
jean.flags[6] = 5;
jean.direccion = 0;
musica (habitacion, sonido, &cambio, prehabitacion, jean.flags[6]);
}
if (jean.flags[6] == 6) {
sleep(5);
jean.muerte = 0;
cambio = 1;
habitacion = 4;
jean.flags[6] = 7;
jean.x = 125;
jean.y = 115;
jean.salto = 1;
}
/* Cambio de fase */
SDL_FreeSurface (pantalla);
#ifndef _RENDER_320_240
SDL_FreeSurface (doble);
#endif
framerate (2, frate1);
printf("Framerate 2 \n");
fflush(stdout);

if (jean.estado[0] == 0) {
Mix_HaltMusic();
/* Mix_FreeMusic(sonido); */
*estadoj = 4;
salir = 1;
}

}

}
the line jean tile a is from this function


void dibujarjean (SDL_Surface *ventana, SDL_Surface *tiles, struct protagonista *jean, int ciclo[]) {

SDL_Rect srctile = {320,88,16,24};
SDL_Rect destile = {0,0,16,24};
SDL_Rect agatile = {448,88,18,13};
SDL_Rect desagatile = {0,0,18,13};
int r = 0;

if (jean->muerte == 0) {
if (jean->salto > 0) {
r = 1;
jean->animacion = 0;
}

if (jean->agachado == 0) {
srctile.x += (64 * jean->direccion) + ((jean->animacion / 7) * 16) + (r * 32);
destile.y = jean->y;
destile.x = jean->x;
if (jean->y > 152)
srctile.h = (176 - jean->y);
SDL_BlitSurface(tiles, &srctile, ventana, &destile);
printf("jean tile a \n");
fflush(stdout);
}
else {
agatile.x += (jean->direccion * 36) + ((jean->animacion / 7) * 18);
desagatile.y = jean->y + 11;
desagatile.x = jean->x;
SDL_BlitSurface(tiles, &agatile, ventana, &desagatile);
printf("jean tile b \n");
fflush(stdout);
}
}

/* Animacion de muerte */
if (jean->muerte > 0) {
jean->muerte += 1;
destile.x = jean->x;
destile.y = jean->y;
Mix_PauseMusic ();
if (jean->muerte == 2)
sonidos(7);
if ((jean->muerte < 8) || ((jean->muerte > 23) && (jean->muerte < 32)) || ((jean->muerte > 47) && (jean->muerte < 56))) {
srctile.x = 368 + (jean->direccion * 64);
SDL_BlitSurface(tiles, &srctile, ventana, &destile);
}
if (((jean->muerte > 7) && (jean->muerte < 16)) || ((jean->muerte > 31) && (jean->muerte < 40)) || ((jean->muerte > 55) && (jean->muerte < 64))) {
srctile.x = 536;
srctile.y = 87;
SDL_BlitSurface(tiles, &srctile, ventana, &destile);
}
if (((jean->muerte > 15) && (jean->muerte < 24)) || ((jean->muerte > 39) && (jean->muerte < 48)) || ((jean->muerte > 63) && (jean->muerte < 73))) {
srctile.x = 520;
srctile.y = 87;
SDL_BlitSurface(tiles, &srctile, ventana, &destile);
}
}

/* Animacion hab. 24 */
if ((jean->flags[6] == 5) && (ciclo[1] == 45)) {
switch (jean->direccion) {
case 0: jean->direccion = 1;
break;
case 1: jean->direccion = 0;
break;
}
}

}

Thank's a lot for the help on this port...and sorry for the long post

Edit ...added spoiler
 
Last edited by a moderator:
No problem for me, help others in his project is (at least for me) one of the most important thing in open source world.

If this post has become "offtopic" and this is a problem for moderators, we can continue to help in private email (dvlara at gmail).

If the last line of the stdout.txt is "dibujar sparo", the problem can be in function that controls the keyboard ("tecladoj"). Try to uncoment the call to this fuction (line is "tecladoj(&jean, &tecla);"). Jean will not move, but you can see if this is the problem.
 
Just found that my button controls is broken, is the cause of segfault...your code is right...i need to fix it. Huge thanks for the help and patience :)
 
Back
Top