-
Stumper...
Can anyone tell me why the statements in bold will not execute?
Code:
...
RESULT EFFECTS_API ConstructParticleSystem(HANDLE emitter,INT numParts, UpdateFunction* uFunc, HANDLE texture, HANDLE attach, DWORD param, HANDLE* PSys)
{
RESULT r;
IEmitter* em = NULL;
GetObjectPointer(mod, emitter, OBJ_EMITTER, (CObject**)&em);
if(em == NULL)
return INVALIDEMITTER;
if(em->EmitterType == IEmitter::_3D)
...
em is never set to NULL. Also, the parameter "emitter" in the function call shown is not preserved (it should be 0x440d001b, and it becomes 0x0000000a). The only reason I can imagine that this is happening is that, since this is in a DLL, it is getting loaded incorrectly... I have cleaned, and rebuilt several times, as well as rebuilding all of the DLLs that use this one. I can only imagine that somehow, some memory is getting overwritten, somehow...
Z.
-
what does the asm listings for the function look like?
shouldn't you pass a pointer/reference to emitter?
-
emitter is just a HANDLE to an object in another object. GetObjectPointer() actually returns the Object. I dont know about the assembly, because I just deleted the thing, and am going to start over =).
Z.
-
-
It does seem that I was overwriting memory somewhere incorrectly, and I think that I have figured it out =).
Z.