Hello,
I am attaching a patch which updates Soya to work with new Cal3D 0.10
BTW, the cal3d_wrapper.h file should be removed when Cal3D developers
fix the compilation bugs in theirs. I have sent them a fix as well.
Regards,
Jan
? _ode.c
? _soya.c
? opengl.c
? sdlconst.c
? cal3d/creates.txt
? tutorial/data/shapes/sword.data
Index: cal3d_wrapper.h
===================================================================
RCS file: /cvs/soya/soya/cal3d_wrapper.h,v
retrieving revision 1.2
diff -u -r1.2 cal3d_wrapper.h
--- cal3d_wrapper.h 22 May 2004 09:31:50 -0000 1.2
+++ cal3d_wrapper.h 15 Mar 2005 01:41:15 -0000
@@ -39,19 +39,12 @@
#endif
-#endif
+#else
//****************************************************************************//
-// Defines for Linux, Cygwin, FreeBSD Sun and Mips //
+// Defines for Linux, Cygwin, FreeBSD Sun and Mips... //
//****************************************************************************//
-#if defined(__linux__) \
- || (__CYGWIN__) \
- || (sun) \
- || (mips) \
- || (__FreeBSD__) \
- || defined(__APPLE__)
-
#define CAL3D_WRAPPER_API
#endif
@@ -99,7 +92,6 @@
typedef void *CalUserData;
-typedef int bool;
//****************************************************************************//
// Substitute for the C++ 'bool' type //
@@ -142,9 +134,7 @@
ANIMATION_STATE_OUT
};
- CAL3D_WRAPPER_API enum Boolean CalAnimation_Create(struct CalAnimation *self, struct CalCoreAnimation *pCoreAnimation);
CAL3D_WRAPPER_API void CalAnimation_Delete(struct CalAnimation *self);
- CAL3D_WRAPPER_API void CalAnimation_Destroy(struct CalAnimation *self);
CAL3D_WRAPPER_API struct CalCoreAnimation *CalAnimation_GetCoreAnimation(struct CalAnimation *self);
CAL3D_WRAPPER_API enum CalAnimationState CalAnimation_GetState(struct CalAnimation *self);
CAL3D_WRAPPER_API float CalAnimation_GetTime(struct CalAnimation *self);
@@ -155,11 +145,9 @@
// CalAnimationAction wrapper functions declaration //
//****************************************************************************//
- CAL3D_WRAPPER_API enum Boolean CalAnimationAction_Create(struct CalAnimationAction *self, struct CalCoreAnimation *pCoreAnimation);
CAL3D_WRAPPER_API void CalAnimationAction_Delete(struct CalAnimationAction *self);
- CAL3D_WRAPPER_API void CalAnimationAction_Destroy(struct CalAnimationAction *self);
CAL3D_WRAPPER_API enum Boolean CalAnimationAction_Execute(struct CalAnimationAction *self, float delayIn, float delayOut);
- CAL3D_WRAPPER_API struct CalAnimationAction *CalAnimationAction_New(void);
+ CAL3D_WRAPPER_API struct CalAnimationAction *CalAnimationAction_New(struct CalCoreAnimation *pCoreAnimation);
CAL3D_WRAPPER_API enum Boolean CalAnimationAction_Update(struct CalAnimationAction *self, float deltaTime);
//****************************************************************************//
@@ -167,10 +155,8 @@
//****************************************************************************//
CAL3D_WRAPPER_API enum Boolean CalAnimationCycle_Blend(struct CalAnimationCycle *self, float weight, float delay);
- CAL3D_WRAPPER_API enum Boolean CalAnimationCycle_Create(struct CalAnimationCycle *self, struct CalCoreAnimation *pCoreAnimation);
CAL3D_WRAPPER_API void CalAnimationCycle_Delete(struct CalAnimationCycle *self);
- CAL3D_WRAPPER_API void CalAnimationCycle_Destroy(struct CalAnimationCycle *self);
- CAL3D_WRAPPER_API struct CalAnimationCycle *CalAnimationCycle_New(void);
+ CAL3D_WRAPPER_API struct CalAnimationCycle *CalAnimationCycle_New(struct CalCoreAnimation *pCoreAnimation);
CAL3D_WRAPPER_API void CalAnimationCycle_SetAsync(struct CalAnimationCycle *self, float time, float duration);
CAL3D_WRAPPER_API enum Boolean CalAnimationCycle_Update(struct CalAnimationCycle *self, float deltaTime);
@@ -181,9 +167,7 @@
CAL3D_WRAPPER_API void CalBone_BlendState(struct CalBone *self, float weight, struct CalVector *pTranslation, struct CalQuaternion *pRotation);
CAL3D_WRAPPER_API void CalBone_CalculateState(struct CalBone *self);
CAL3D_WRAPPER_API void CalBone_ClearState(struct CalBone *self);
- CAL3D_WRAPPER_API enum Boolean CalBone_Create(struct CalBone *self, struct CalCoreBone *pCoreBone);
CAL3D_WRAPPER_API void CalBone_Delete(struct CalBone *self);
- CAL3D_WRAPPER_API void CalBone_Destroy(struct CalBone *self);
CAL3D_WRAPPER_API struct CalCoreBone *CalBone_GetCoreBone(struct CalBone *self);
CAL3D_WRAPPER_API struct CalQuaternion *CalBone_GetRotation(struct CalBone *self);
CAL3D_WRAPPER_API struct CalQuaternion *CalBone_GetRotationAbsolute(struct CalBone *self);
@@ -192,7 +176,7 @@
CAL3D_WRAPPER_API struct CalVector *CalBone_GetTranslationAbsolute(struct CalBone *self);
CAL3D_WRAPPER_API struct CalVector *CalBone_GetTranslationBoneSpace(struct CalBone *self);
CAL3D_WRAPPER_API void CalBone_LockState(struct CalBone *self);
- CAL3D_WRAPPER_API struct CalBone *CalBone_New(void);
+ CAL3D_WRAPPER_API struct CalBone *CalBone_New(struct CalCoreBone* coreBone);
CAL3D_WRAPPER_API void CalBone_SetSkeleton(struct CalBone *self, struct CalSkeleton *pSkeleton);
CAL3D_WRAPPER_API void CalBone_SetTranslation(struct CalBone *self, struct CalVector *pTranslation);
CAL3D_WRAPPER_API void CalBone_SetRotation(struct CalBone *self, struct CalQuaternion *pRotation);
@@ -204,14 +188,13 @@
// CalCoreAnimation wrapper functions declaration //
//****************************************************************************//
- CAL3D_WRAPPER_API enum Boolean CalCoreAnimation_AddCoreTrack(struct CalCoreAnimation *self, struct CalCoreTrack *pCoreTrack);
- CAL3D_WRAPPER_API enum Boolean CalCoreAnimation_Create(struct CalCoreAnimation *self);
+ CAL3D_WRAPPER_API struct CalCoreAnimation *CalCoreAnimation_New();
CAL3D_WRAPPER_API void CalCoreAnimation_Delete(struct CalCoreAnimation *self);
- CAL3D_WRAPPER_API void CalCoreAnimation_Destroy(struct CalCoreAnimation *self);
+
+ CAL3D_WRAPPER_API void CalCoreAnimation_AddCoreTrack(struct CalCoreAnimation *self, struct CalCoreTrack *pCoreTrack);
CAL3D_WRAPPER_API struct CalCoreTrack *CalCoreAnimation_GetCoreTrack(struct CalCoreAnimation *self, int coreBoneId);
CAL3D_WRAPPER_API float CalCoreAnimation_GetDuration(struct CalCoreAnimation *self);
// CAL3D_WRAPPER_API std::list<CalCoreTrack *>& CalCoreAnimation_GetListCoreTrack(struct CalCoreAnimation *self);
- CAL3D_WRAPPER_API struct CalCoreAnimation *CalCoreAnimation_New(void);
CAL3D_WRAPPER_API void CalCoreAnimation_SetDuration(struct CalCoreAnimation *self, float duration);
//****************************************************************************//
@@ -220,9 +203,7 @@
CAL3D_WRAPPER_API enum Boolean CalCoreBone_AddChildId(struct CalCoreBone *self, int childId);
CAL3D_WRAPPER_API void CalCoreBone_CalculateState(struct CalCoreBone *self);
- CAL3D_WRAPPER_API enum Boolean CalCoreBone_Create(struct CalCoreBone *self, char *strName);
CAL3D_WRAPPER_API void CalCoreBone_Delete(struct CalCoreBone *self);
- CAL3D_WRAPPER_API void CalCoreBone_Destroy(struct CalCoreBone *self);
// CAL3D_WRAPPER_API std::list<int>& CalCoreBone_GetListChildId(struct CalCoreBone *self);
CAL3D_WRAPPER_API char *CalCoreBone_GetName(struct CalCoreBone *self);
CAL3D_WRAPPER_API int CalCoreBone_GetParentId(struct CalCoreBone *self);
@@ -233,7 +214,7 @@
CAL3D_WRAPPER_API struct CalVector *CalCoreBone_GetTranslationAbsolute(struct CalCoreBone *self);
CAL3D_WRAPPER_API struct CalVector *CalCoreBone_GetTranslationBoneSpace(struct CalCoreBone *self);
CAL3D_WRAPPER_API CalUserData CalCoreBone_GetUserData(struct CalCoreBone *self);
- CAL3D_WRAPPER_API struct CalCoreBone *CalCoreBone_New(void);
+ CAL3D_WRAPPER_API struct CalCoreBone *CalCoreBone_New(const char* name);
CAL3D_WRAPPER_API void CalCoreBone_SetCoreSkeleton(struct CalCoreBone *self, struct CalCoreSkeleton *pCoreSkeleton);
CAL3D_WRAPPER_API void CalCoreBone_SetParentId(struct CalCoreBone *self, int parentId);
CAL3D_WRAPPER_API void CalCoreBone_SetRotation(struct CalCoreBone *self, struct CalQuaternion *pRotation);
@@ -246,13 +227,11 @@
// CalCoreKeyframe wrapper functions declaration //
//****************************************************************************//
- CAL3D_WRAPPER_API enum Boolean CalCoreKeyframe_Create(struct CalCoreKeyframe *self);
CAL3D_WRAPPER_API void CalCoreKeyframe_Delete(struct CalCoreKeyframe *self);
- CAL3D_WRAPPER_API void CalCoreKeyframe_Destroy(struct CalCoreKeyframe *self);
CAL3D_WRAPPER_API struct CalQuaternion *CalCoreKeyframe_GetRotation(struct CalCoreKeyframe *self);
CAL3D_WRAPPER_API float CalCoreKeyframe_GetTime(struct CalCoreKeyframe *self);
CAL3D_WRAPPER_API struct CalVector *CalCoreKeyframe_GetTranslation(struct CalCoreKeyframe *self);
- CAL3D_WRAPPER_API struct CalCoreKeyframe *CalCoreKeyframe_New(void);
+ CAL3D_WRAPPER_API struct CalCoreKeyframe *CalCoreKeyframe_New();
CAL3D_WRAPPER_API void CalCoreKeyframe_SetRotation(struct CalCoreKeyframe *self, struct CalQuaternion *pRotation);
CAL3D_WRAPPER_API void CalCoreKeyframe_SetTime(struct CalCoreKeyframe *self, float time);
CAL3D_WRAPPER_API void CalCoreKeyframe_SetTranslation(struct CalCoreKeyframe *self, struct CalVector *pTranslation);
@@ -261,9 +240,9 @@
// CalCoreMaterial wrapper functions declaration //
//****************************************************************************//
- CAL3D_WRAPPER_API enum Boolean CalCoreMaterial_Create(struct CalCoreMaterial *self);
+ CAL3D_WRAPPER_API struct CalCoreMaterial *CalCoreMaterial_New();
CAL3D_WRAPPER_API void CalCoreMaterial_Delete(struct CalCoreMaterial *self);
- CAL3D_WRAPPER_API void CalCoreMaterial_Destroy(struct CalCoreMaterial *self);
+
// CAL3D_WRAPPER_API CalCoreMaterial::Color *CalCoreMaterial_GetAmbientColor(struct CalCoreMaterial *self);
// CAL3D_WRAPPER_API CalCoreMaterial::Color *CalCoreMaterial_GetDiffuseColor(struct CalCoreMaterial *self);
CAL3D_WRAPPER_API int CalCoreMaterial_GetMapCount(struct CalCoreMaterial *self);
@@ -273,7 +252,6 @@
// CAL3D_WRAPPER_API CalCoreMaterial::Color *CalCoreMaterial_GetSpecularColor(struct CalCoreMaterial *self);
CAL3D_WRAPPER_API CalUserData CalCoreMaterial_GetUserData(struct CalCoreMaterial *self);
// CAL3D_WRAPPER_API std::vector<Map>& CalCoreMaterial_GetVectorMap(struct CalCoreMaterial *self);
- CAL3D_WRAPPER_API struct CalCoreMaterial *CalCoreMaterial_New(void);
CAL3D_WRAPPER_API enum Boolean CalCoreMaterial_Reserve(struct CalCoreMaterial *self, int mapCount);
// CAL3D_WRAPPER_API void CalCoreMaterial_SetAmbientColor(struct CalCoreMaterial *self, struct CalCoreMaterial::Color *pAmbientColor);
// CAL3D_WRAPPER_API void CalCoreMaterial_SetDiffuseColor(struct CalCoreMaterial *self, struct CalCoreMaterial::Color *pDiffuseColor);
@@ -287,14 +265,13 @@
// CalCoreMesh wrapper functions declaration //
//****************************************************************************//
- CAL3D_WRAPPER_API int CalCoreMesh_AddCoreSubmesh(struct CalCoreMesh *self, struct CalCoreSubmesh *pCoreSubmesh);
- CAL3D_WRAPPER_API enum Boolean CalCoreMesh_Create(struct CalCoreMesh *self);
+ CAL3D_WRAPPER_API struct CalCoreMesh *CalCoreMesh_New();
CAL3D_WRAPPER_API void CalCoreMesh_Delete(struct CalCoreMesh *self);
- CAL3D_WRAPPER_API void CalCoreMesh_Destroy(struct CalCoreMesh *self);
+
+ CAL3D_WRAPPER_API int CalCoreMesh_AddCoreSubmesh(struct CalCoreMesh *self, struct CalCoreSubmesh *pCoreSubmesh);
CAL3D_WRAPPER_API struct CalCoreSubmesh *CalCoreMesh_GetCoreSubmesh(struct CalCoreMesh *self, int id);
CAL3D_WRAPPER_API int CalCoreMesh_GetCoreSubmeshCount(struct CalCoreMesh *self);
// CAL3D_WRAPPER_API std::vector<CalCoreSubmesh *>& CalCoreMesh_GetVectorCoreSubmesh(struct CalCoreMesh *self);
- CAL3D_WRAPPER_API struct CalCoreMesh *CalCoreMesh_New(void);
//****************************************************************************//
// CalCoreModel wrapper functions declaration //
@@ -303,10 +280,8 @@
CAL3D_WRAPPER_API int CalCoreModel_AddCoreAnimation(struct CalCoreModel *self, struct CalCoreAnimation *pCoreAnimation);
CAL3D_WRAPPER_API int CalCoreModel_AddCoreMaterial(struct CalCoreModel *self, struct CalCoreMaterial *pCoreMaterial);
CAL3D_WRAPPER_API int CalCoreModel_AddCoreMesh(struct CalCoreModel *self, struct CalCoreMesh *pCoreMesh);
- CAL3D_WRAPPER_API enum Boolean CalCoreModel_Create(struct CalCoreModel *self, char *strName);
CAL3D_WRAPPER_API enum Boolean CalCoreModel_CreateCoreMaterialThread(struct CalCoreModel *self, int coreMaterialThreadId);
CAL3D_WRAPPER_API void CalCoreModel_Delete(struct CalCoreModel *self);
- CAL3D_WRAPPER_API void CalCoreModel_Destroy(struct CalCoreModel *self);
CAL3D_WRAPPER_API struct CalCoreAnimation *CalCoreModel_GetCoreAnimation(struct CalCoreModel *self, int coreAnimationId);
CAL3D_WRAPPER_API int CalCoreModel_GetCoreAnimationCount(struct CalCoreModel *self);
CAL3D_WRAPPER_API struct CalCoreMaterial *CalCoreModel_GetCoreMaterial(struct CalCoreModel *self, int coreMaterialId);
@@ -320,7 +295,7 @@
CAL3D_WRAPPER_API int CalCoreModel_LoadCoreMaterial(struct CalCoreModel *self, char *strFilename);
CAL3D_WRAPPER_API int CalCoreModel_LoadCoreMesh(struct CalCoreModel *self, char *strFilename);
CAL3D_WRAPPER_API enum Boolean CalCoreModel_LoadCoreSkeleton(struct CalCoreModel *self, char *strFilename);
- CAL3D_WRAPPER_API struct CalCoreModel *CalCoreModel_New(void);
+ CAL3D_WRAPPER_API struct CalCoreModel *CalCoreModel_New(const char* name);
CAL3D_WRAPPER_API enum Boolean CalCoreModel_SaveCoreAnimation(struct CalCoreModel *self, char *strFilename, int coreAnimtionId);
CAL3D_WRAPPER_API enum Boolean CalCoreModel_SaveCoreMaterial(struct CalCoreModel *self, char *strFilename, int coreMaterialId);
CAL3D_WRAPPER_API enum Boolean CalCoreModel_SaveCoreMesh(struct CalCoreModel *self, char *strFilename, int coreMeshId);
@@ -333,24 +308,22 @@
// CalCoreSkeleton wrapper functions declaration //
//****************************************************************************//
+ CAL3D_WRAPPER_API struct CalCoreSkeleton *CalCoreSkeleton_New();
+ CAL3D_WRAPPER_API void CalCoreSkeleton_Delete(struct CalCoreSkeleton* self);
+
CAL3D_WRAPPER_API int CalCoreSkeleton_AddCoreBone(struct CalCoreSkeleton *self, struct CalCoreBone *pCoreBone);
CAL3D_WRAPPER_API void CalCoreSkeleton_CalculateState(struct CalCoreSkeleton *self);
- CAL3D_WRAPPER_API enum Boolean CalCoreSkeleton_Create(struct CalCoreSkeleton *self);
- CAL3D_WRAPPER_API void CalCoreSkeleton_Delete(struct CalCoreSkeleton *self);
- CAL3D_WRAPPER_API void CalCoreSkeleton_Destroy(struct CalCoreSkeleton *self);
+// CAL3D_WRAPPER_API void CalCoreSkeleton_Delete(struct CalCoreSkeleton *self);
CAL3D_WRAPPER_API struct CalCoreBone *CalCoreSkeleton_GetCoreBone(struct CalCoreSkeleton *self, int coreBoneId);
CAL3D_WRAPPER_API int CalCoreSkeleton_GetCoreBoneId(struct CalCoreSkeleton *self, char *strName);
// CAL3D_WRAPPER_API std::list<int>& CalCoreSkeleton_GetListRootCoreBoneId(struct CalCoreSkeleton *self);
// CAL3D_WRAPPER_API std::vector<CalCoreBone *>& CalCoreSkeleton_GetVectorCoreBone(struct CalCoreSkeleton *self);
- CAL3D_WRAPPER_API struct CalCoreSkeleton *CalCoreSkeleton_New(void);
//****************************************************************************//
// CalCoreSubmesh wrapper functions declaration //
//****************************************************************************//
- CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_Create(struct CalCoreSubmesh *self);
CAL3D_WRAPPER_API void CalCoreSubmesh_Delete(struct CalCoreSubmesh *self);
- CAL3D_WRAPPER_API void CalCoreSubmesh_Destroy(struct CalCoreSubmesh *self);
CAL3D_WRAPPER_API int CalCoreSubmesh_GetCoreMaterialThreadId(struct CalCoreSubmesh *self);
CAL3D_WRAPPER_API int CalCoreSubmesh_GetFaceCount(struct CalCoreSubmesh *self);
CAL3D_WRAPPER_API int CalCoreSubmesh_GetLodCount(struct CalCoreSubmesh *self);
@@ -361,7 +334,7 @@
// CAL3D_WRAPPER_API std::vector<std::vector<CalCoreSubmesh::TextureCoordinate> >& CalCoreSubmesh_GetVectorVectorTextureCoordinate(struct CalCoreSubmesh *self);
// CAL3D_WRAPPER_API std::vector<CalCoreSubmesh::Vertex>& CalCoreSubmesh_GetVectorVertex(struct CalCoreSubmesh *self);
CAL3D_WRAPPER_API int CalCoreSubmesh_GetVertexCount(struct CalCoreSubmesh *self);
- CAL3D_WRAPPER_API struct CalCoreSubmesh *CalCoreSubmesh_New(void);
+ CAL3D_WRAPPER_API struct CalCoreSubmesh *CalCoreSubmesh_New();
CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_Reserve(struct CalCoreSubmesh *self, int vertexCount, int textureCoordinateCount, int faceCount, int springCount);
CAL3D_WRAPPER_API void CalCoreSubmesh_SetCoreMaterialThreadId(struct CalCoreSubmesh *self, int coreMaterialThreadId);
// CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_SetFace(struct CalCoreSubmesh *self, int faceId, struct CalCoreSubmesh::Face *pFace);
@@ -371,20 +344,18 @@
// CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_SetTextureCoordinate(struct CalCoreSubmesh *self, int vertexId, int textureCoordinateId, struct CalCoreSubmesh::TextureCoordinate *pTextureCoordinate);
// CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_SetVertex(struct CalCoreSubmesh *self, int vertexId, struct CalCoreSubmesh::Vertex *pVertex);
CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_IsTangentsEnabled(struct CalCoreSubmesh *self, int mapId);
-CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_EnableTangents(struct CalCoreSubmesh *self, int mapId, bool enabled);
+CAL3D_WRAPPER_API enum Boolean CalCoreSubmesh_EnableTangents(struct CalCoreSubmesh *self, int mapId, enum Boolean enabled);
//****************************************************************************//
// CalCoreTrack wrapper functions declaration //
//****************************************************************************//
CAL3D_WRAPPER_API enum Boolean CalCoreTrack_AddCoreKeyframe(struct CalCoreTrack *self, struct CalCoreKeyframe *pCoreKeyframe);
- CAL3D_WRAPPER_API enum Boolean CalCoreTrack_Create(struct CalCoreTrack *self);
CAL3D_WRAPPER_API void CalCoreTrack_Delete(struct CalCoreTrack *self);
- CAL3D_WRAPPER_API void CalCoreTrack_Destroy(struct CalCoreTrack *self);
CAL3D_WRAPPER_API int CalCoreTrack_GetCoreBoneId(struct CalCoreTrack *self);
// CAL3D_WRAPPER_API std::map<float, CalCoreKeyframe *>& CalCoreTrack_GetMapCoreKeyframe(struct CalCoreTrack *self);
CAL3D_WRAPPER_API enum Boolean CalCoreTrack_GetState(struct CalCoreTrack *self, float time, struct CalVector *pTranslation, struct CalQuaternion *pRotation);
- CAL3D_WRAPPER_API struct CalCoreTrack *CalCoreTrack_New(void);
+ CAL3D_WRAPPER_API struct CalCoreTrack *CalCoreTrack_New();
CAL3D_WRAPPER_API enum Boolean CalCoreTrack_SetCoreBoneId(struct CalCoreTrack *self, int coreBoneId);
//****************************************************************************//
@@ -414,37 +385,35 @@
ERROR_CODE_MAX_ERROR_CODE
};
- CAL3D_WRAPPER_API enum CalErrorCode CalError_GetLastErrorCode(void);
- CAL3D_WRAPPER_API char *CalError_GetLastErrorDescription(void);
- CAL3D_WRAPPER_API char *CalError_GetLastErrorFile(void);
- CAL3D_WRAPPER_API int CalError_GetLastErrorLine(void);
- CAL3D_WRAPPER_API char *CalError_GetLastErrorText(void);
- CAL3D_WRAPPER_API void CalError_PrintLastError(void);
+ CAL3D_WRAPPER_API enum CalErrorCode CalError_GetLastErrorCode();
+ CAL3D_WRAPPER_API char *CalError_GetLastErrorDescription();
+ CAL3D_WRAPPER_API char *CalError_GetLastErrorFile();
+ CAL3D_WRAPPER_API int CalError_GetLastErrorLine();
+ CAL3D_WRAPPER_API char *CalError_GetLastErrorText();
+ CAL3D_WRAPPER_API void CalError_PrintLastError();
// CAL3D_WRAPPER_API void CalError_SetLastError(enum CalErrorCode code, char *strFile, int line, char *strText);
//****************************************************************************//
// CalLoader wrapper functions declaration //
//****************************************************************************//
+ CAL3D_WRAPPER_API struct CalLoader *CalLoader_New();
CAL3D_WRAPPER_API void CalLoader_Delete(struct CalLoader *self);
CAL3D_WRAPPER_API struct CalCoreAnimation *CalLoader_LoadCoreAnimation(struct CalLoader *self, char *strFilename);
CAL3D_WRAPPER_API struct CalCoreMaterial *CalLoader_LoadCoreMaterial(struct CalLoader *self, char *strFilename);
CAL3D_WRAPPER_API struct CalCoreMesh *CalLoader_LoadCoreMesh(struct CalLoader *self, char *strFilename);
CAL3D_WRAPPER_API struct CalCoreSkeleton *CalLoader_LoadCoreSkeleton(struct CalLoader *self, char *strFilename);
- CAL3D_WRAPPER_API struct CalLoader *CalLoader_New(void);
//****************************************************************************//
// CalMesh wrapper functions declaration //
//****************************************************************************//
- CAL3D_WRAPPER_API enum Boolean CalMesh_Create(struct CalMesh *self, struct CalCoreMesh *pCoreMesh);
CAL3D_WRAPPER_API void CalMesh_Delete(struct CalMesh *self);
- CAL3D_WRAPPER_API void CalMesh_Destroy(struct CalMesh *self);
CAL3D_WRAPPER_API struct CalCoreMesh *CalMesh_GetCoreMesh(struct CalMesh *self);
CAL3D_WRAPPER_API struct CalSubmesh *CalMesh_GetSubmesh(struct CalMesh *self, int id);
CAL3D_WRAPPER_API int CalMesh_GetSubmeshCount(struct CalMesh *self);
// CAL3D_WRAPPER_API std::vector<CalSubmesh *>& CalMesh_GetVectorSubmesh(struct CalMesh *self);
- CAL3D_WRAPPER_API struct CalMesh *CalMesh_New(void);
+ CAL3D_WRAPPER_API struct CalMesh *CalMesh_New(struct CalCoreMesh *pCoreMesh);
CAL3D_WRAPPER_API void CalMesh_SetLodLevel(struct CalMesh *self, float lodLevel);
CAL3D_WRAPPER_API void CalMesh_SetMaterialSet(struct CalMesh *self, int setId);
CAL3D_WRAPPER_API void CalMesh_SetModel(struct CalMesh *self, struct CalModel *pModel);
@@ -455,11 +424,9 @@
CAL3D_WRAPPER_API enum Boolean CalMixer_BlendCycle(struct CalMixer *self, int id, float weight, float delay);
CAL3D_WRAPPER_API enum Boolean CalMixer_ClearCycle(struct CalMixer *self, int id, float delay);
- CAL3D_WRAPPER_API enum Boolean CalMixer_Create(struct CalMixer *self, struct CalModel *pModel);
CAL3D_WRAPPER_API void CalMixer_Delete(struct CalMixer *self);
- CAL3D_WRAPPER_API void CalMixer_Destroy(struct CalMixer *self);
CAL3D_WRAPPER_API enum Boolean CalMixer_ExecuteAction(struct CalMixer *self, int id, float delayIn, float delayOut);
- CAL3D_WRAPPER_API struct CalMixer *CalMixer_New(void);
+ CAL3D_WRAPPER_API struct CalMixer *CalMixer_New(struct CalModel *pModel);
CAL3D_WRAPPER_API void CalMixer_UpdateAnimation(struct CalMixer *self, float deltaTime);
CAL3D_WRAPPER_API void CalMixer_UpdateSkeleton(struct CalMixer *self);
@@ -468,9 +435,7 @@
//****************************************************************************//
CAL3D_WRAPPER_API enum Boolean CalModel_AttachMesh(struct CalModel *self, int coreMeshId);
- CAL3D_WRAPPER_API enum Boolean CalModel_Create(struct CalModel *self, struct CalCoreModel *pCoreModel);
CAL3D_WRAPPER_API void CalModel_Delete(struct CalModel *self);
- CAL3D_WRAPPER_API void CalModel_Destroy(struct CalModel *self);
CAL3D_WRAPPER_API enum Boolean CalModel_DetachMesh(struct CalModel *self, int coreMeshId);
CAL3D_WRAPPER_API struct CalCoreModel *CalModel_GetCoreModel(struct CalModel *self);
CAL3D_WRAPPER_API struct CalMesh *CalModel_GetMesh(struct CalModel *self, int coreMeshId);
@@ -481,7 +446,7 @@
CAL3D_WRAPPER_API struct CalSpringSystem *CalModel_GetSpringSystem(struct CalModel *self);
CAL3D_WRAPPER_API CalUserData CalModel_GetUserData(struct CalModel *self);
// CAL3D_WRAPPER_API std::vector<CalMesh *>& CalModel_GetVectorMesh(struct CalModel *self);
- CAL3D_WRAPPER_API struct CalModel *CalModel_New(void);
+ CAL3D_WRAPPER_API struct CalModel *CalModel_New(struct CalCoreModel* pCoreModel);
CAL3D_WRAPPER_API void CalModel_SetLodLevel(struct CalModel *self, float lodLevel);
CAL3D_WRAPPER_API void CalModel_SetMaterialSet(struct CalModel *self, int setId);
CAL3D_WRAPPER_API void CalModel_SetUserData(struct CalModel *self, CalUserData userData);
@@ -496,10 +461,8 @@
CAL3D_WRAPPER_API int CalPhysique_CalculateVerticesAndNormals(struct CalPhysique *self, struct CalSubmesh *pSubmesh, float *pVertexBuffer);
CAL3D_WRAPPER_API int CalPhysique_CalculateVerticesNormalsAndTexCoords(struct CalPhysique *self, struct CalSubmesh *pSubmesh, float *pVertexBuffer, int NumTexCoords);
CAL3D_WRAPPER_API int CalPhysique_CalculateTangentSpaces(struct CalPhysique *self, struct CalSubmesh *pSubmesh, int mapId, float *pTangentSpaceBuffer);
- CAL3D_WRAPPER_API enum Boolean CalPhysique_Create(struct CalPhysique *self, struct CalModel *pModel);
CAL3D_WRAPPER_API void CalPhysique_Delete(struct CalPhysique *self);
- CAL3D_WRAPPER_API void CalPhysique_Destroy(struct CalPhysique *self);
- CAL3D_WRAPPER_API struct CalPhysique *CalPhysique_New(void);
+ CAL3D_WRAPPER_API struct CalPhysique *CalPhysique_New(struct CalModel* pModel);
CAL3D_WRAPPER_API void CalPhysique_Update(struct CalPhysique *self);
//****************************************************************************//
@@ -518,7 +481,7 @@
CAL3D_WRAPPER_API float *CalQuaternion_Get(struct CalQuaternion *self);
CAL3D_WRAPPER_API void CalQuaternion_Multiply(struct CalQuaternion *self, struct CalQuaternion *pQ);
CAL3D_WRAPPER_API void CalQuaternion_MultiplyVector(struct CalQuaternion *self, struct CalVector *pV);
- CAL3D_WRAPPER_API struct CalQuaternion *CalQuaternion_New(void);
+ CAL3D_WRAPPER_API struct CalQuaternion *CalQuaternion_New();
CAL3D_WRAPPER_API void CalQuaternion_Op_Multiply(struct CalQuaternion *pResult, struct CalQuaternion *pQ, struct CalQuaternion *pR);
CAL3D_WRAPPER_API void CalQuaternion_Set(struct CalQuaternion *self, float qx, float qy, float qz, float qw);
@@ -527,9 +490,7 @@
//****************************************************************************//
CAL3D_WRAPPER_API enum Boolean CalRenderer_BeginRendering(struct CalRenderer *self);
- CAL3D_WRAPPER_API enum Boolean CalRenderer_Create(struct CalRenderer *self, struct CalModel *pModel);
CAL3D_WRAPPER_API void CalRenderer_Delete(struct CalRenderer *self);
- CAL3D_WRAPPER_API void CalRenderer_Destroy(struct CalRenderer *self);
CAL3D_WRAPPER_API void CalRenderer_EndRendering(struct CalRenderer *self);
CAL3D_WRAPPER_API void CalRenderer_GetAmbientColor(struct CalRenderer *self, unsigned char *pColorBuffer);
CAL3D_WRAPPER_API void CalRenderer_GetDiffuseColor(struct CalRenderer *self, unsigned char *pColorBuffer);
@@ -549,7 +510,7 @@
CAL3D_WRAPPER_API int CalRenderer_GetVerticesNormalsAndTexCoords(struct CalRenderer *self, float *pVertexBuffer, int NumTexCoords);
CAL3D_WRAPPER_API int CalRenderer_GetTangentSpaces(struct CalRenderer *self, int mapId, float *pTangentSpaceBuffer);
CAL3D_WRAPPER_API enum Boolean CalRenderer_IsTangentsEnabled(struct CalRenderer *self, int mapId);
- CAL3D_WRAPPER_API struct CalRenderer *CalRenderer_New(void);
+ CAL3D_WRAPPER_API struct CalRenderer *CalRenderer_New(struct CalModel* pModel);
CAL3D_WRAPPER_API enum Boolean CalRenderer_SelectMeshSubmesh(struct CalRenderer *self, int meshId, int submeshId);
//****************************************************************************//
@@ -557,7 +518,7 @@
//****************************************************************************//
CAL3D_WRAPPER_API void CalSaver_Delete(struct CalSaver *self);
- CAL3D_WRAPPER_API struct CalSaver *CalSaver_New(void);
+ CAL3D_WRAPPER_API struct CalSaver *CalSaver_New();
CAL3D_WRAPPER_API enum Boolean CalSaver_SaveCoreAnimation(struct CalSaver *self, char *strFilename, struct CalCoreAnimation *pCoreAnimation);
CAL3D_WRAPPER_API enum Boolean CalSaver_SaveCoreMaterial(struct CalSaver *self, char *strFilename, struct CalCoreMaterial *pCoreMaterial);
CAL3D_WRAPPER_API enum Boolean CalSaver_SaveCoreMesh(struct CalSaver *self, char *strFilename, struct CalCoreMesh *pCoreMesh);
@@ -569,14 +530,12 @@
CAL3D_WRAPPER_API void CalSkeleton_CalculateState(struct CalSkeleton *self);
CAL3D_WRAPPER_API void CalSkeleton_ClearState(struct CalSkeleton *self);
- CAL3D_WRAPPER_API enum Boolean CalSkeleton_Create(struct CalSkeleton *self, struct CalCoreSkeleton *pCoreSkeleton);
CAL3D_WRAPPER_API void CalSkeleton_Delete(struct CalSkeleton *self);
- CAL3D_WRAPPER_API void CalSkeleton_Destroy(struct CalSkeleton *self);
CAL3D_WRAPPER_API struct CalBone *CalSkeleton_GetBone(struct CalSkeleton *self, int boneId);
CAL3D_WRAPPER_API struct CalCoreSkeleton *CalSkeleton_GetCoreSkeleton(struct CalSkeleton *self);
// CAL3D_WRAPPER_API std::vector<CalBone *>& CalSkeleton_GetVectorBone(struct CalSkeleton *self);
CAL3D_WRAPPER_API void CalSkeleton_LockState(struct CalSkeleton *self);
- CAL3D_WRAPPER_API struct CalSkeleton *CalSkeleton_New(void);
+ CAL3D_WRAPPER_API struct CalSkeleton *CalSkeleton_New(struct CalCoreSkeleton* pCoreSkeleton);
// DEBUG-CODE
CAL3D_WRAPPER_API int CalSkeleton_GetBonePoints(struct CalSkeleton *self, float *pPoints);
@@ -590,19 +549,15 @@
CAL3D_WRAPPER_API void CalSpringSystem_CalculateForces(struct CalSpringSystem *self, struct CalSubmesh *pSubmesh, float deltaTime);
CAL3D_WRAPPER_API void CalSpringSystem_CalculateVertices(struct CalSpringSystem *self, struct CalSubmesh *pSubmesh, float deltaTime);
- CAL3D_WRAPPER_API enum Boolean CalSpringSystem_Create(struct CalSpringSystem *self, struct CalModel *pModel);
CAL3D_WRAPPER_API void CalSpringSystem_Delete(struct CalSpringSystem *self);
- CAL3D_WRAPPER_API void CalSpringSystem_Destroy(struct CalSpringSystem *self);
- CAL3D_WRAPPER_API struct CalSpringSystem *CalSpringSystem_New(void);
+ CAL3D_WRAPPER_API struct CalSpringSystem *CalSpringSystem_New(struct CalModel *pModel);
CAL3D_WRAPPER_API void CalSpringSystem_Update(struct CalSpringSystem *self, float deltaTime);
//****************************************************************************//
// CalSubmesh wrapper functions declaration //
//****************************************************************************//
- CAL3D_WRAPPER_API enum Boolean CalSubmesh_Create(struct CalSubmesh *self, struct CalCoreSubmesh *pCoreSubmesh);
CAL3D_WRAPPER_API void CalSubmesh_Delete(struct CalSubmesh *self);
- CAL3D_WRAPPER_API void CalSubmesh_Destroy(struct CalSubmesh *self);
CAL3D_WRAPPER_API struct CalCoreSubmesh *CalSubmesh_GetCoreSubmesh(struct CalSubmesh *self);
CAL3D_WRAPPER_API int CalSubmesh_GetCoreMaterialId(struct CalSubmesh *self);
CAL3D_WRAPPER_API int CalSubmesh_GetFaceCount(struct CalSubmesh *self);
@@ -613,7 +568,7 @@
// CAL3D_WRAPPER_API std::vector<CalVector>& CalSubmesh_GetVectorVertex(struct CalSubmesh *self);
CAL3D_WRAPPER_API int CalSubmesh_GetVertexCount(struct CalSubmesh *self);
CAL3D_WRAPPER_API enum Boolean CalSubmesh_HasInternalData(struct CalSubmesh *self);
- CAL3D_WRAPPER_API struct CalSubmesh *CalSubmesh_New(void);
+ CAL3D_WRAPPER_API struct CalSubmesh *CalSubmesh_New(struct CalCoreSubmesh* coreSubmesh);
CAL3D_WRAPPER_API void CalSubmesh_SetCoreMaterialId(struct CalSubmesh *self, int coreMaterialId);
CAL3D_WRAPPER_API void CalSubmesh_SetLodLevel(struct CalSubmesh *self, float lodLevel);
@@ -629,7 +584,7 @@
CAL3D_WRAPPER_API void CalVector_InverseScale(struct CalVector *self, float d);
CAL3D_WRAPPER_API float *CalVector_Get(struct CalVector *self);
CAL3D_WRAPPER_API float CalVector_Length(struct CalVector *self);
- CAL3D_WRAPPER_API struct CalVector *CalVector_New(void);
+ CAL3D_WRAPPER_API struct CalVector *CalVector_New();
CAL3D_WRAPPER_API float CalVector_Normalize(struct CalVector *self);
CAL3D_WRAPPER_API void CalVector_Op_Add(struct CalVector *pResult, struct CalVector *pV, struct CalVector *pU);
CAL3D_WRAPPER_API void CalVector_Op_Subtract(struct CalVector *pResult, struct CalVector *pV, struct CalVector *pU);
Index: cal3d/cal3d.pxd
===================================================================
RCS file: /cvs/soya/soya/cal3d/cal3d.pxd,v
retrieving revision 1.1
diff -u -r1.1 cal3d.pxd
--- cal3d/cal3d.pxd 24 May 2004 21:50:15 -0000 1.1
+++ cal3d/cal3d.pxd 15 Mar 2005 01:41:16 -0000
@@ -87,33 +87,25 @@
cdef struct CalVector:
int _dummy
- cdef int CalAnimation_Create(CalAnimation *self, CalCoreAnimation *pCoreAnimation)
cdef void CalAnimation_Delete(CalAnimation *self)
- cdef void CalAnimation_Destroy(CalAnimation *self)
cdef CalCoreAnimation *CalAnimation_GetCoreAnimation(CalAnimation *self)
cdef int CalAnimation_GetState(CalAnimation *self)
cdef float CalAnimation_GetTime(CalAnimation *self)
cdef int CalAnimation_GetType(CalAnimation *self)
cdef float CalAnimation_GetWeight(CalAnimation *self)
- cdef int CalAnimationAction_Create(CalAnimationAction *self, CalCoreAnimation *pCoreAnimation)
cdef void CalAnimationAction_Delete(CalAnimationAction *self)
- cdef void CalAnimationAction_Destroy(CalAnimationAction *self)
cdef int CalAnimationAction_Execute(CalAnimationAction *self, float delayIn, float delayOut)
- cdef CalAnimationAction *CalAnimationAction_New()
+ cdef CalAnimationAction *CalAnimationAction_New(CalCoreAnimation *pCoreAnimation)
cdef int CalAnimationAction_Update(CalAnimationAction *self, float deltaTime)
cdef int CalAnimationCycle_Blend(CalAnimationCycle *self, float weight, float delay)
- cdef int CalAnimationCycle_Create(CalAnimationCycle *self, CalCoreAnimation *pCoreAnimation)
cdef void CalAnimationCycle_Delete(CalAnimationCycle *self)
- cdef void CalAnimationCycle_Destroy(CalAnimationCycle *self)
- cdef CalAnimationCycle *CalAnimationCycle_New()
+ cdef CalAnimationCycle *CalAnimationCycle_New(CalCoreAnimation *pCoreAnimation)
cdef void CalAnimationCycle_SetAsync(CalAnimationCycle *self, float time, float duration)
cdef int CalAnimationCycle_Update(CalAnimationCycle *self, float deltaTime)
cdef void CalBone_BlendState(CalBone *self, float weight, CalVector *pTranslation, CalQuaternion *pRotation)
cdef void CalBone_CalculateState(CalBone *self)
cdef void CalBone_ClearState(CalBone *self)
- cdef int CalBone_Create(CalBone *self, CalCoreBone *pCoreBone)
cdef void CalBone_Delete(CalBone *self)
- cdef void CalBone_Destroy(CalBone *self)
cdef CalCoreBone *CalBone_GetCoreBone(CalBone *self)
cdef CalQuaternion *CalBone_GetRotation(CalBone *self)
cdef CalQuaternion *CalBone_GetRotationAbsolute(CalBone *self)
@@ -122,25 +114,21 @@
cdef CalVector *CalBone_GetTranslationAbsolute(CalBone *self)
cdef CalVector *CalBone_GetTranslationBoneSpace(CalBone *self)
cdef void CalBone_LockState(CalBone *self)
- cdef CalBone *CalBone_New()
+ cdef CalBone *CalBone_New(CalCoreBone *pCoreBone)
cdef void CalBone_SetSkeleton(CalBone *self, CalSkeleton *pSkeleton)
cdef void CalBone_SetTranslation(CalBone *self, CalVector *pTranslation)
cdef void CalBone_SetRotation(CalBone *self, CalQuaternion *pRotation)
cdef void CalBone_SetCoreState(CalBone *self)
cdef void CalBone_SetCoreStateRecursive(CalBone *self)
cdef int CalCoreAnimation_AddCoreTrack(CalCoreAnimation *self, CalCoreTrack *pCoreTrack)
- cdef int CalCoreAnimation_Create(CalCoreAnimation *self)
cdef void CalCoreAnimation_Delete(CalCoreAnimation *self)
- cdef void CalCoreAnimation_Destroy(CalCoreAnimation *self)
cdef CalCoreTrack *CalCoreAnimation_GetCoreTrack(CalCoreAnimation *self, int coreBoneId)
cdef float CalCoreAnimation_GetDuration(CalCoreAnimation *self)
cdef CalCoreAnimation *CalCoreAnimation_New()
cdef void CalCoreAnimation_SetDuration(CalCoreAnimation *self, float duration)
cdef int CalCoreBone_AddChildId(CalCoreBone *self, int childId)
cdef void CalCoreBone_CalculateState(CalCoreBone *self)
- cdef int CalCoreBone_Create(CalCoreBone *self, char *strName)
cdef void CalCoreBone_Delete(CalCoreBone *self)
- cdef void CalCoreBone_Destroy(CalCoreBone *self)
cdef char *CalCoreBone_GetName(CalCoreBone *self)
cdef int CalCoreBone_GetParentId(CalCoreBone *self)
cdef CalQuaternion *CalCoreBone_GetRotation(CalCoreBone *self)
@@ -150,7 +138,7 @@
cdef CalVector *CalCoreBone_GetTranslationAbsolute(CalCoreBone *self)
cdef CalVector *CalCoreBone_GetTranslationBoneSpace(CalCoreBone *self)
cdef CalUserData CalCoreBone_GetUserData(CalCoreBone *self)
- cdef CalCoreBone *CalCoreBone_New()
+ cdef CalCoreBone *CalCoreBone_New(char *strName)
cdef void CalCoreBone_SetCoreSkeleton(CalCoreBone *self, CalCoreSkeleton *pCoreSkeleton)
cdef void CalCoreBone_SetParentId(CalCoreBone *self, int parentId)
cdef void CalCoreBone_SetRotation(CalCoreBone *self, CalQuaternion *pRotation)
@@ -158,9 +146,7 @@
cdef void CalCoreBone_SetTranslation(CalCoreBone *self, CalVector *pTranslation)
cdef void CalCoreBone_SetTranslationBoneSpace(CalCoreBone *self, CalVector *pTranslation)
cdef void CalCoreBone_SetUserData(CalCoreBone *self, CalUserData userData)
- cdef int CalCoreKeyframe_Create(CalCoreKeyframe *self)
cdef void CalCoreKeyframe_Delete(CalCoreKeyframe *self)
- cdef void CalCoreKeyframe_Destroy(CalCoreKeyframe *self)
cdef CalQuaternion *CalCoreKeyframe_GetRotation(CalCoreKeyframe *self)
cdef float CalCoreKeyframe_GetTime(CalCoreKeyframe *self)
cdef CalVector *CalCoreKeyframe_GetTranslation(CalCoreKeyframe *self)
@@ -168,9 +154,7 @@
cdef void CalCoreKeyframe_SetRotation(CalCoreKeyframe *self, CalQuaternion *pRotation)
cdef void CalCoreKeyframe_SetTime(CalCoreKeyframe *self, float time)
cdef void CalCoreKeyframe_SetTranslation(CalCoreKeyframe *self, CalVector *pTranslation)
- cdef int CalCoreMaterial_Create(CalCoreMaterial *self)
cdef void CalCoreMaterial_Delete(CalCoreMaterial *self)
- cdef void CalCoreMaterial_Destroy(CalCoreMaterial *self)
cdef int CalCoreMaterial_GetMapCount(CalCoreMaterial *self)
cdef char *CalCoreMaterial_GetMapFilename(CalCoreMaterial *self, int mapId)
cdef CalUserData CalCoreMaterial_GetMapUserData(CalCoreMaterial *self, int mapId)
@@ -182,19 +166,15 @@
cdef void CalCoreMaterial_SetShininess(CalCoreMaterial *self, float shininess)
cdef void CalCoreMaterial_SetUserData(CalCoreMaterial *self, CalUserData userData)
cdef int CalCoreMesh_AddCoreSubmesh(CalCoreMesh *self, CalCoreSubmesh *pCoreSubmesh)
- cdef int CalCoreMesh_Create(CalCoreMesh *self)
cdef void CalCoreMesh_Delete(CalCoreMesh *self)
- cdef void CalCoreMesh_Destroy(CalCoreMesh *self)
cdef CalCoreSubmesh *CalCoreMesh_GetCoreSubmesh(CalCoreMesh *self, int id)
cdef int CalCoreMesh_GetCoreSubmeshCount(CalCoreMesh *self)
cdef CalCoreMesh *CalCoreMesh_New()
cdef int CalCoreModel_AddCoreAnimation(CalCoreModel *self, CalCoreAnimation *pCoreAnimation)
cdef int CalCoreModel_AddCoreMaterial(CalCoreModel *self, CalCoreMaterial *pCoreMaterial)
cdef int CalCoreModel_AddCoreMesh(CalCoreModel *self, CalCoreMesh *pCoreMesh)
- cdef int CalCoreModel_Create(CalCoreModel *self, char *strName)
cdef int CalCoreModel_CreateCoreMaterialThread(CalCoreModel *self, int coreMaterialThreadId)
cdef void CalCoreModel_Delete(CalCoreModel *self)
- cdef void CalCoreModel_Destroy(CalCoreModel *self)
cdef CalCoreAnimation *CalCoreModel_GetCoreAnimation(CalCoreModel *self, int coreAnimationId)
cdef int CalCoreModel_GetCoreAnimationCount(CalCoreModel *self)
cdef CalCoreMaterial *CalCoreModel_GetCoreMaterial(CalCoreModel *self, int coreMaterialId)
@@ -208,7 +188,7 @@
cdef int CalCoreModel_LoadCoreMaterial(CalCoreModel *self, char *strFilename)
cdef int CalCoreModel_LoadCoreMesh(CalCoreModel *self, char *strFilename)
cdef int CalCoreModel_LoadCoreSkeleton(CalCoreModel *self, char *strFilename)
- cdef CalCoreModel *CalCoreModel_New()
+ cdef CalCoreModel *CalCoreModel_New(char *strName)
cdef int CalCoreModel_SaveCoreAnimation(CalCoreModel *self, char *strFilename, int coreAnimtionId)
cdef int CalCoreModel_SaveCoreMaterial(CalCoreModel *self, char *strFilename, int coreMaterialId)
cdef int CalCoreModel_SaveCoreMesh(CalCoreModel *self, char *strFilename, int coreMeshId)
@@ -218,15 +198,11 @@
cdef void CalCoreModel_SetUserData(CalCoreModel *self, CalUserData userData)
cdef int CalCoreSkeleton_AddCoreBone(CalCoreSkeleton *self, CalCoreBone *pCoreBone)
cdef void CalCoreSkeleton_CalculateState(CalCoreSkeleton *self)
- cdef int CalCoreSkeleton_Create(CalCoreSkeleton *self)
cdef void CalCoreSkeleton_Delete(CalCoreSkeleton *self)
- cdef void CalCoreSkeleton_Destroy(CalCoreSkeleton *self)
cdef CalCoreBone *CalCoreSkeleton_GetCoreBone(CalCoreSkeleton *self, int coreBoneId)
cdef int CalCoreSkeleton_GetCoreBoneId(CalCoreSkeleton *self, char *strName)
cdef CalCoreSkeleton *CalCoreSkeleton_New()
- cdef int CalCoreSubmesh_Create(CalCoreSubmesh *self)
cdef void CalCoreSubmesh_Delete(CalCoreSubmesh *self)
- cdef void CalCoreSubmesh_Destroy(CalCoreSubmesh *self)
cdef int CalCoreSubmesh_GetCoreMaterialThreadId(CalCoreSubmesh *self)
cdef int CalCoreSubmesh_GetFaceCount(CalCoreSubmesh *self)
cdef int CalCoreSubmesh_GetLodCount(CalCoreSubmesh *self)
@@ -239,9 +215,7 @@
cdef int CalCoreSubmesh_IsTangentsEnabled(CalCoreSubmesh *self, int mapId)
cdef int CalCoreSubmesh_EnableTangents(CalCoreSubmesh *self, int mapId, int enabled)
cdef int CalCoreTrack_AddCoreKeyframe(CalCoreTrack *self, CalCoreKeyframe *pCoreKeyframe)
- cdef int CalCoreTrack_Create(CalCoreTrack *self)
cdef void CalCoreTrack_Delete(CalCoreTrack *self)
- cdef void CalCoreTrack_Destroy(CalCoreTrack *self)
cdef int CalCoreTrack_GetCoreBoneId(CalCoreTrack *self)
cdef int CalCoreTrack_GetState(CalCoreTrack *self, float time, CalVector *pTranslation, CalQuaternion *pRotation)
cdef CalCoreTrack *CalCoreTrack_New()
@@ -258,29 +232,23 @@
cdef CalCoreMesh *CalLoader_LoadCoreMesh(CalLoader *self, char *strFilename)
cdef CalCoreSkeleton *CalLoader_LoadCoreSkeleton(CalLoader *self, char *strFilename)
cdef CalLoader *CalLoader_New()
- cdef int CalMesh_Create(CalMesh *self, CalCoreMesh *pCoreMesh)
cdef void CalMesh_Delete(CalMesh *self)
- cdef void CalMesh_Destroy(CalMesh *self)
cdef CalCoreMesh *CalMesh_GetCoreMesh(CalMesh *self)
cdef CalSubmesh *CalMesh_GetSubmesh(CalMesh *self, int id)
cdef int CalMesh_GetSubmeshCount(CalMesh *self)
- cdef CalMesh *CalMesh_New()
+ cdef CalMesh *CalMesh_New(CalCoreMesh *pCoreMesh)
cdef void CalMesh_SetLodLevel(CalMesh *self, float lodLevel)
cdef void CalMesh_SetMaterialSet(CalMesh *self, int setId)
cdef void CalMesh_SetModel(CalMesh *self, CalModel *pModel)
cdef int CalMixer_BlendCycle(CalMixer *self, int id, float weight, float delay)
cdef int CalMixer_ClearCycle(CalMixer *self, int id, float delay)
- cdef int CalMixer_Create(CalMixer *self, CalModel *pModel)
cdef void CalMixer_Delete(CalMixer *self)
- cdef void CalMixer_Destroy(CalMixer *self)
cdef int CalMixer_ExecuteAction(CalMixer *self, int id, float delayIn, float delayOut)
- cdef CalMixer *CalMixer_New()
+ cdef CalMixer *CalMixer_New(CalModel *pModel)
cdef void CalMixer_UpdateAnimation(CalMixer *self, float deltaTime)
cdef void CalMixer_UpdateSkeleton(CalMixer *self)
cdef int CalModel_AttachMesh(CalModel *self, int coreMeshId)
- cdef int CalModel_Create(CalModel *self, CalCoreModel *pCoreModel)
cdef void CalModel_Delete(CalModel *self)
- cdef void CalModel_Destroy(CalModel *self)
cdef int CalModel_DetachMesh(CalModel *self, int coreMeshId)
cdef CalCoreModel *CalModel_GetCoreModel(CalModel *self)
cdef CalMesh *CalModel_GetMesh(CalModel *self, int coreMeshId)
@@ -290,7 +258,7 @@
cdef CalSkeleton *CalModel_GetSkeleton(CalModel *self)
cdef CalSpringSystem *CalModel_GetSpringSystem(CalModel *self)
cdef CalUserData CalModel_GetUserData(CalModel *self)
- cdef CalModel *CalModel_New()
+ cdef CalModel *CalModel_New(CalCoreModel *pCoreModel)
cdef void CalModel_SetLodLevel(CalModel *self, float lodLevel)
cdef void CalModel_SetMaterialSet(CalModel *self, int setId)
cdef void CalModel_SetUserData(CalModel *self, CalUserData userData)
@@ -300,10 +268,8 @@
cdef int CalPhysique_CalculateVerticesAndNormals(CalPhysique *self, CalSubmesh *pSubmesh, float *pVertexBuffer)
cdef int CalPhysique_CalculateVerticesNormalsAndTexCoords(CalPhysique *self, CalSubmesh *pSubmesh, float *pVertexBuffer, int NumTexCoords)
cdef int CalPhysique_CalculateTangentSpaces(CalPhysique *self, CalSubmesh *pSubmesh, int mapId, float *pTangentSpaceBuffer)
- cdef int CalPhysique_Create(CalPhysique *self, CalModel *pModel)
cdef void CalPhysique_Delete(CalPhysique *self)
- cdef void CalPhysique_Destroy(CalPhysique *self)
- cdef CalPhysique *CalPhysique_New()
+ cdef CalPhysique *CalPhysique_New(CalModel *pModel)
cdef void CalPhysique_Update(CalPhysique *self)
cdef void CalQuaternion_Blend(CalQuaternion *self, float d, CalQuaternion *pQ)
cdef void CalQuaternion_Clear(CalQuaternion *self)
@@ -317,9 +283,7 @@
cdef void CalQuaternion_Op_Multiply(CalQuaternion *pResult, CalQuaternion *pQ, CalQuaternion *pR)
cdef void CalQuaternion_Set(CalQuaternion *self, float qx, float qy, float qz, float qw)
cdef int CalRenderer_BeginRendering(CalRenderer *self)
- cdef int CalRenderer_Create(CalRenderer *self, CalModel *pModel)
cdef void CalRenderer_Delete(CalRenderer *self)
- cdef void CalRenderer_Destroy(CalRenderer *self)
cdef void CalRenderer_EndRendering(CalRenderer *self)
cdef void CalRenderer_GetAmbientColor(CalRenderer *self, unsigned char *pColorBuffer)
cdef void CalRenderer_GetDiffuseColor(CalRenderer *self, unsigned char *pColorBuffer)
@@ -339,7 +303,7 @@
cdef int CalRenderer_GetVerticesNormalsAndTexCoords(CalRenderer *self, float *pVertexBuffer, int NumTexCoords)
cdef int CalRenderer_GetTangentSpaces(CalRenderer *self, int mapId, float *pTangentSpaceBuffer)
cdef int CalRenderer_IsTangentsEnabled(CalRenderer *self, int mapId)
- cdef CalRenderer *CalRenderer_New()
+ cdef CalRenderer *CalRenderer_New(CalModel* pModel)
cdef int CalRenderer_SelectMeshSubmesh(CalRenderer *self, int meshId, int submeshId)
cdef void CalSaver_Delete(CalSaver *self)
cdef CalSaver *CalSaver_New()
@@ -349,34 +313,28 @@
cdef int CalSaver_SaveCoreSkeleton(CalSaver *self, char *strFilename, CalCoreSkeleton *pCoreSkeleton)
cdef void CalSkeleton_CalculateState(CalSkeleton *self)
cdef void CalSkeleton_ClearState(CalSkeleton *self)
- cdef int CalSkeleton_Create(CalSkeleton *self, CalCoreSkeleton *pCoreSkeleton)
cdef void CalSkeleton_Delete(CalSkeleton *self)
- cdef void CalSkeleton_Destroy(CalSkeleton *self)
cdef CalBone *CalSkeleton_GetBone(CalSkeleton *self, int boneId)
cdef CalCoreSkeleton *CalSkeleton_GetCoreSkeleton(CalSkeleton *self)
cdef void CalSkeleton_LockState(CalSkeleton *self)
- cdef CalSkeleton *CalSkeleton_New()
+ cdef CalSkeleton *CalSkeleton_New(CalCoreSkeleton *pCoreSkeleton)
cdef int CalSkeleton_GetBonePoints(CalSkeleton *self, float *pPoints)
cdef int CalSkeleton_GetBonePointsStatic(CalSkeleton *self, float *pPoints)
cdef int CalSkeleton_GetBoneLines(CalSkeleton *self, float *pLines)
cdef int CalSkeleton_GetBoneLinesStatic(CalSkeleton *self, float *pLines)
cdef void CalSpringSystem_CalculateForces(CalSpringSystem *self, CalSubmesh *pSubmesh, float deltaTime)
cdef void CalSpringSystem_CalculateVertices(CalSpringSystem *self, CalSubmesh *pSubmesh, float deltaTime)
- cdef int CalSpringSystem_Create(CalSpringSystem *self, CalModel *pModel)
cdef void CalSpringSystem_Delete(CalSpringSystem *self)
- cdef void CalSpringSystem_Destroy(CalSpringSystem *self)
- cdef CalSpringSystem *CalSpringSystem_New()
+ cdef CalSpringSystem *CalSpringSystem_New(CalModel *pModel)
cdef void CalSpringSystem_Update(CalSpringSystem *self, float deltaTime)
- cdef int CalSubmesh_Create(CalSubmesh *self, CalCoreSubmesh *pCoreSubmesh)
cdef void CalSubmesh_Delete(CalSubmesh *self)
- cdef void CalSubmesh_Destroy(CalSubmesh *self)
cdef CalCoreSubmesh *CalSubmesh_GetCoreSubmesh(CalSubmesh *self)
cdef int CalSubmesh_GetCoreMaterialId(CalSubmesh *self)
cdef int CalSubmesh_GetFaceCount(CalSubmesh *self)
cdef int CalSubmesh_GetFaces(CalSubmesh *self, int *pFaceBuffer)
cdef int CalSubmesh_GetVertexCount(CalSubmesh *self)
cdef int CalSubmesh_HasInternalData(CalSubmesh *self)
- cdef CalSubmesh *CalSubmesh_New()
+ cdef CalSubmesh *CalSubmesh_New(CalCoreSubmesh *pCoreSubmesh)
cdef void CalSubmesh_SetCoreMaterialId(CalSubmesh *self, int coreMaterialId)
cdef void CalSubmesh_SetLodLevel(CalSubmesh *self, float lodLevel)
cdef void CalVector_Add(CalVector *self, CalVector *pV)
Index: cal3d/shape.pyx
===================================================================
RCS file: /cvs/soya/soya/cal3d/shape.pyx,v
retrieving revision 1.15
diff -u -r1.15 shape.pyx
--- cal3d/shape.pyx 11 Mar 2005 23:55:56 -0000 1.15
+++ cal3d/shape.pyx 15 Mar 2005 01:41:18 -0000
@@ -252,8 +252,8 @@
self._materials = []
self._submeshes = []
self._sphere[3] = -1.0
- self._core_model = CalCoreModel_New()
- if CalCoreModel_Create(self._core_model, "") == 0: raise RuntimeError("CalCoreModel_Create failed: %s" % CalError_GetLastErrorDescription())
+ self._core_model = CalCoreModel_New("")
+ if self._core_model == NULL: raise RuntimeError("CalCoreModel_Create failed: %s" % CalError_GetLastErrorDescription())
self._option = CAL3D_DOUBLE_SIDED
@@ -291,8 +291,7 @@
cdef _Cal3dSubMesh my_submesh
cdef int nb_mesh, nb_submesh, i, j
- cal_model = CalModel_New()
- CalModel_Create(cal_model, self._core_model)
+ cal_model = CalModel_New(self._core_model)
nb_mesh = CalCoreModel_GetCoreMeshCount(self._core_model)
for i from 0 <= i < nb_mesh: CalModel_AttachMesh(cal_model, i)
CalModel_SetMaterialSet(cal_model, 0)
@@ -316,7 +315,6 @@
if my_submesh._material._option & MATERIAL_ALPHA: self._option = self._option | CAL3D_ALPHA
CalRenderer_EndRendering(cal_renderer)
- CalModel_Destroy(cal_model)
CalModel_Delete (cal_model)
self._option = self._option | CAL3D_INITED
@@ -585,7 +583,6 @@
def __dealloc__(self):
- CalCoreModel_Destroy(self._core_model)
CalCoreModel_Delete (self._core_model)
def load_skeleton(self, filename):
Index: cal3d/volume.pyx
===================================================================
RCS file: /cvs/soya/soya/cal3d/volume.pyx,v
retrieving revision 1.11
diff -u -r1.11 volume.pyx
--- cal3d/volume.pyx 11 Mar 2005 23:55:56 -0000 1.11
+++ cal3d/volume.pyx 15 Mar 2005 01:41:18 -0000
@@ -40,8 +40,8 @@
self._attached_coordsysts = cstate[3]
if self._shape:
- self._model = CalModel_New()
- if CalModel_Create(self._model, self._shape._core_model) == 0:
+ self._model = CalModel_New(self._shape._core_model)
+ if self._model == NULL:
print "erreur CalModel_Create", CalError_GetLastErrorDescription()
raise RuntimeError("CalModel_Create failed: %s" % CalError_GetLastErrorDescription())
@@ -84,7 +84,6 @@
def __dealloc__(self):
if self._model != NULL:
- CalModel_Destroy(self._model)
CalModel_Delete (self._model)
if self._vertex_coords != NULL: free(self._vertex_coords)
@@ -94,16 +93,15 @@
def set_shape(self, _Cal3dShape shape, attached_meshes = None):
cdef int i, nb
if not self._shape is None:
- CalModel_Destroy(self._model)
CalModel_Delete (self._model)
self._attached_meshes.__imul__(0)
if shape is None: self._shape = None
else:
self._shape = shape
- self._model = CalModel_New()
- if CalModel_Create(self._model, shape._core_model) == 0:
- print "erreur CalModel_Create", CalError_GetLastErrorDescription()
+ self._model = CalModel_New(shape._core_model)
+ if self._model == NULL:
+ print "error CalModel_Create", CalError_GetLastErrorDescription()
raise RuntimeError("CalModel_Create failed: %s" % CalError_GetLastErrorDescription())
nb = CalCoreModel_GetCoreMeshCount(shape._core_model)
@@ -265,8 +263,10 @@
# XXX Currently we re-create the mixer.
# Probably not the faster way to do that, but Cal3D C binding doesn't expose
# all methods :-(
- CalMixer_Create(CalModel_GetMixer(self._model), self._model)
-
+
+ # this doesn't work anymore - JC
+ #CalMixer_Create(CalModel_GetMixer(self._model), self._model)
+ CalMixer_New(self._model)
def set_lod_level(self, float lod_level):
if self._model != NULL: CalModel_SetLodLevel(self._model, lod_level)