lds a écrit :
Hi!
It seems like the bug comes from the option menu.
#3 0x08061f81 in Box::Draw (this=0x1e, mouse_x=519, mouse_y=737) at
gui/box.cpp:54
The adress of the box is wrong. I have added some "assert" in the box class,
which shows that a NULL Widget* is in the stdlist (mysteriously added...).
I have already seen that. That's why I have store a pointer to the last
added element of the list (and don't access it by the end() function).
Because, at the beginning of the world, it seems that the list is not
empty, the test empty() say false when inserting the first element and
as I can remember the length is 2... It got me crazy but since I have no
internet connexion nor books when programming it, I was trying to just
go round the problem.
As for the Sprite class, i get the highlight of the main menu button displayed
at a random position after a game. I can see this since i added support of
the "translation" xml option to the sprite class. It's like the translation
variable aren't initialised.. but they are initialised!!
The problem is resolved, see previous mail.
Can you see this as well? Any idea where it comes from?
I fear some memory is corrupted somewhere in the code, and bugs appear in
other parts... valgrind nor gdb have been able to tell something useful..
I hope we are not playing too much with memory...
Matt
Lodesi
Le Samedi 10 Décembre 2005 19:15, Matthieu Fertré a écrit :
Hello,
It seems that there is a bug in class Sprite. Here is the trace :
Couldn't open audio:
[Sound] Error : No sound found for sample menu/clic
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1217472832 (LWP 11038)]
0xb7f1d4e5 in rotozoomSurfaceXY (src=0x8dd0298, angle=-0,
zoomx=-6.8654969628226121, zoomy=0.9375, smooth=0) at SDL_rotozoom.c:630
630 is32bit = (src->format->BitsPerPixel == 32);
Current language: auto; currently c
(gdb) bt
#0 0xb7f1d4e5 in rotozoomSurfaceXY (src=0x8dd0298, angle=-0,
zoomx=-6.8654969628226121, zoomy=0.9375, smooth=0) at SDL_rotozoom.c:630
#1 0x080754d8 in Sprite::Blit (this=0x8debc38, dest=0x81c7280,
pos_x=512, pos_y=718) at graphic/sprite.cpp:531
#2 0x0807576b in Sprite::Draw (this=0x8debc38, pos_x=512, pos_y=718) at
graphic/sprite.cpp:643
#3 0x08061f81 in Box::Draw (this=0x1e, mouse_x=519, mouse_y=737) at
gui/box.cpp:54
#4 0x0808295d in OptionMenu::Lance (this=0x8dd0210) at
menu/options_menu.cpp:446
#5 0x0804fcff in AppWormux::main (this=0x8113fd8, argc=1,
argv=0xbfe45c24) at main.cpp:250
#6 0x0804febe in main (argc=1, argv=0xbfe45c24) at main.cpp:285
(gdb)
The bug appears (but not always) when mouse goes over the ok button of
the options menu.
Matt