by Rorakin » Fri Nov 02, 2012 12:53 am
Hello,
I'm trying to integrate 2d version of this to a simple 2.5d game engine (IndieLib). My program crashes when I try to set the state of the current emitter. Can anyone tell if I'm making a simple mistake or if I need to modify any of the files I'm using from core, and wrapper/dx ?
Here is what the beginning of my main looks like:
CIndieLib *mI = CIndieLib::Instance();
if (!mI->Init ()) return 0;
GUI *GUI = GUI::Instance();
GUI->Init();
MP_Device_WRAP device(mI->Window->GetWidth(), mI->Window->GetHeight(), mI->Window->GetWnd());
device.Create();
MP_Manager& MP=MP_Manager::GetInstance();
MP_Platform* platform = new MP_Platform_WINDOWS;
MP.Initialization(platform, MAGIC_INTERPOLATION_ENABLE, MAGIC_NOLOOP, MAGIC_CHANGE_EMITTER_DEFAULT, mI->Window->GetWidth(), mI->Window->GetHeight(), 1, 1.f, 0.1f, true);
//MP.LoadAllEmitters();
MP.LoadEmittersFromFile("matrix.ptc");
MP.CloseFiles();
MP.Stop();
HM_EMITTER cur=0;
MP_Emitter* emitter;
emitter = MP.GetEmitter(cur);
emitter->SetState(MAGIC_STATE_UPDATE);
//float cx=((float)mI->Window->GetWidth())/2.f;
//float cy=((float)mI->Window->GetHeight())/2.f;
//HM_EMITTER hmEmitter=MP.GetFirstEmitter();
//while (hmEmitter)
//{
// emitter=MP.GetEmitter(hmEmitter);
// MP_POSITION pos;