Jump to content
  • Advertisement
Sign in to follow this  
  • entries
    686
  • comments
    1952
  • views
    387446

Of interest...Okay I lied!

Sign in to follow this  
Stompy9999

79 views

Menu screenshot:



I finally took advantage of AllegroFont, which is an extremely easy to use library. I still need to get a font that is easier to read, but the point is made.

I seem to have isolated the exact line of code that is crashing my game when it exits. I have clearly marked it within the method that it is taking place:


void CApp::m_End()
{

destroy_bitmap(m_Sglobals.buffer);
destroy_bitmap(m_Sglobals.player);
destroy_bitmap(m_Sglobals.bg);
destroy_bitmap(m_Sglobals.enemy[0]);
destroy_bitmap(m_Sglobals.enemy[1]);
destroy_bitmap(m_Sglobals.shot);
destroy_bitmap(m_Sglobals.title);
destroy_bitmap(m_Sglobals.otherproducts);
destroy_bitmap(m_Sglobals.explode);
destroy_bitmap(m_Sglobals.coin);
destroy_bitmap(m_Sglobals.rifle);
destroy_bitmap(m_Sglobals.shotgun);
destroy_bitmap(m_Sglobals.health_pack);
destroy_bitmap(m_Sglobals.magnum);
destroy_bitmap(m_Sglobals.smg);

alfont_destroy_font(m_Sglobals.Stompy_font);

// Crash! ///////////////////////////
unload_datafile(m_Sglobals.GameRes);
/////////////////////////////////////

fprintf(log, "Resource memory freed...\n");

}



This is a pretty bad situation, although, at least the BITMAP pointers are being deleted.

Now I've gotta implement FMOD into the mix. I've tried this twice already with results that made the program crash. After looking at some FMOD tutorials, I determined that I was passing some weird values to the functions, which is probably what is crashing the program. I'd rather just use AllegroMp3, but the documentation for that is very poor. Does anyone know any good AllegroMp3 tutorials? An imaginary cookie for anyone who tells me where to find one!
Sign in to follow this  


2 Comments


Recommended Comments

I would try again with FMOD if I where you, once you get it working it does everything you need. If you download the FMOD zip off their website it comes with quite a good help file.

You probably need FSOUND_Stream_Open to use MP3s. don't forget to use F_SOUND_Init too.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!