Well this is weird. I have just included mikmod.h and added the sample code from the MikMod documentation and all the problems with the game when compiled in Open2x have gone away. My WAV sound effects, played through SDL_Mixer, play at an increased pitch and speed now, so I guess MikMod is messing with the sample rate of SDL_Mixer, but that's not a problem I can just convert the samples.
So here's where I'm at. My game now compiles under Open2x and runs as efficiently as the Dev-C++ version. I can now compile in MikMod with no errors, which is further than I got with Dev-C++. However, I can't actually here the music playing. Here's my MikMod code:
CODE
#include <mikmod.h>
MODULE *module;
int main( int argc, char* args[] )
{
MikMod_RegisterAllDrivers();
MikMod_RegisterLoader(&load_mod);
md_mode |= DMODE_SOFT_MUSIC;
MikMod_Init("");
module = Player_Load("snd/game.mod", 4, 0 );
if (module) {
Player_Start(module);
}
else
{
printf("impossible de lire le module\n");
}
while( loop )
{
MikMod_Update();
//Game's main loop here
}
}
Can anyone see what's wrong here?