I been trying to run a game I write under Windows on Debian Jessie. The Game is not truly finished but it should already display some basic mechanics. Game compiles and gets segmentation fault while running.
So what I know about the problem:
Program stops at first try of bitmap usage, while I'm trying to convert it's mask to alpha, so probably i mess up something with bitmap loading.
The informations I get while running the game in gdb:
Program received signal SIGSEGV, Segmentation fault.
al_lock_bitmap (bitmap=bitmap@entry=0x0, format=format@entry=0, flags=flags@entry=0)
95 return al_lock_bitmap_region(bitmap, 0, 0, bitmap->w, bitmap->h, format, flags);
So i enter backtrace command to get the current method and and value:
#0 al_lock_bitmap (bitmap=bitmap@entry=0x0, format=format@entry=0, flags=flags@entry=0)
#1 0x00007ffff6eff7f9 in al_convert_mask_to_alpha (bitmap=0x0, mask_color=...)
#2 0x0000000000402458 in main (argc=1, argv=0x7fffffffdd78) at precompiled/main.cpp:90
After examination i find out that 0x7ffff6eff7f9, so the function that crash, has value 0x0fc08548. That tells me absolute nothing.
In the code the initialization of bitmap seems to be good.
I declared it and then initialized as so:
And then covert its background to alpha (thats line 90 of mine main.cpp file. There where gdb stops the program and declare segmentation fault).
al_convert_mask_to_alpha( ball_image, al_map_rgb(255, 0, 255) );
Only thing i change since moving the game from windows was location of graphics. But the path looks good. I attached main.cpp to this thread for review.
I'm grateful for any response. Thanks, Siery.
Ps. I write this code over a year ago so i plan to rewrite a lot. Sorry if it looks chaotic .