Hi all ! I started a new project just for testing the NGC dll in GDK , but after a while i have found some really confusing incompatible variable-type functions in both GDK and NGC. I hope someone can help me :
1 dbLoadDLL uses a DWORD as filename ? (well i have fixed this simply changing DWORD to char* as type in DarkSDKSystem.h and it seems now works fine)
2 dbGetMemblockPtr returns a DWORD instead of a pointer ?
after this i decided not using the GDK's dll functions so i started searching for a c++ solution.Finally i found a this code
#ifndef _NGLORY_H_
#define _NGLORY_H_
#include <windows.h>
struct NGCPfl_VEC3
{
float fX, fY, fZ;
};
struct NGCP_VEC3
{
float fX, fY, fZ;
};
typedef void (WINAPI * StartCollisionPRO_fn) ( DWORD keycode1, DWORD keycode2, DWORD keycode3 );
typedef void (WINAPI * StartCollisionDebugPRO_fn) ();
typedef void (WINAPI * StopCollisionDebugPRO_fn) ();
typedef void (WINAPI * StopCollisionPRO_fn) ();
typedef void (WINAPI * SetCollisionsPRO_fn) (DWORD src_type, DWORD dest_type, DWORD coll_method, DWORD coll_response, DWORD dyn_mesh_response );
typedef void (WINAPI * CollisionTypePRO_fn) ( DWORD object, int coll_type );
typedef void (WINAPI * ActivateObjPRO_fn) ( DWORD object );
typedef void (WINAPI * DeActivateObjPRO_fn) ( DWORD object );
typedef DWORD (WINAPI * ObjectExistPRO_fn) ( DWORD object );
typedef void (WINAPI * SetObjOffsetPRO_fn) ( DWORD object, NGCPfl_VEC3 inoff );
... and so on ....
Another confusing code ...
whats interesting in the code above is the last 2 typedefs :
Anywhere in the code where a function returns an object number ,returns a DWORD instead of an int as GDK uses int as object numbers... also some functions return DWORD instead of a float...
and the last typedef passes a structure to the dll (NGCPfl_VEC3)
but in the dbpro version (NGCollision.dba) it passes 3 floats as 3 different parameters...
Anyway i have implemented the whole NGC dll in a class CCollision
following exacly the NGCollision.dba functions and i can compile it without any errors
Which is again a littlebit confusing... the NGC function returns a DWORD as object number then i use this DWORD for dbObjectExist() where is an int expected instead of a DWORD , nevertheless the exe runs fine without any errors. ???
So i wrapped one of the NGC examples to test it , the exe runs fine but there's no collision detection at all.I`m pretty shure the problem is somewhere in this "DWORD or not DWORD" nonsense but i can`t find any good starting point anywhere to resolve this or find out the exact variable types returned by the NGC DLL functions .
If enyone have any experience with NGC in c++ and would be kind enough to help me (and others too) , please post here youre code/experience or idea .Any help appreciated .
Thanks in advance! Regards