|
From: SourceForge.net <no...@so...> - 2004-06-06 22:17:27
|
Bugs item #967190, was opened at 2004-06-05 12:27 Message generated for change (Comment added) made by raving You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442052&aid=967190&group_id=45158 Category: None Group: None Status: Open Resolution: None Priority: 5 Submitted By: Lane Roathe (raving) Assigned to: Nobody/Anonymous (nobody) Summary: Quesa Fails loading objects Initial Comment: The version of Quesa that is in CVS fails to load objects in Bugdom. I am using an older (much older!) version of Quesa in Bugdom now that loads these files correctly. I'd really like to update to the latest Quesa due to the speed improvements, but have not been able to sort out why the files do not load. I've attached the items that fail to load before the project crashes to this report. My working copy of Quesa is here in case anyone needs it again: ftp://ftp.ifd.com/pub/Quesa_Bugdom.zip Here is the function used to load the files: /***************** READ 3DMF MODEL ************************/ // // Reads the 3DMF file and saves into new struct OpaqueTQ3Object*. // // INPUT: file = File Object containing reference to 3DMF file // // OUTPUT: model =object containing all the important data in the 3DMF file // // static TQ3Status MyRead3DMFModel(TQ3FileObject file, struct OpaqueTQ3Object* *model) { struct OpaqueTQ3Object* myGroup; struct OpaqueTQ3Object* myObject; /* INIT MODEL TO BE RETURNED */ *model = 0; // assume return nothing myGroup = myObject = 0; /* OPEN THE FILE OBJECT & EXIT GRACEFULLY IF UNSUCCESSFUL */ if (Q3File_OpenRead(file,0) != kQ3Success) // open the file DoFatalAlert("Reading 3DMF file failed!"); /**************************************/ /* READ ALL THE OBJECTS FROM THE FILE */ /**************************************/ do { /* READ A METAFILE OBJECT FROM THE FILE OBJECT */ myObject = Q3File_ReadObject(file); if (myObject == 0) { if (myGroup) Q3Object_Dispose(myGroup); DoAlert("MyRead3DMFModel: Q3File_ReadObject Failed!"); QD3D_ShowRecentError(); break; } /* ADD ANY DRAWABLE OBJECTS TO A GROUP */ if (Q3Object_IsDrawable(myObject)) // see if is a drawable object { if (myGroup) // if group exists Q3Group_AddObject(myGroup,myObject); // add object to group else if (*model == 0) // if no model data yet / this is first { *model = myObject; // set model to this object myObject = 0; // clear this object } else // this isn't the first & only object, so add to group { myGroup = Q3DisplayGroup_New(); // make new group if (myGroup == 0) DoFatalAlert("MyRead3DMFModel: Q3DisplayGroup_New failed!"); Q3Group_AddObject(myGroup,*model); // add existing model to group Q3Group_AddObject(myGroup,myObject); // add object to group Q3Object_Dispose(*model); // dispose extra ref *model = myGroup; // set return value to the new group } } if (myObject != 0) // dispose extra ref Q3Object_Dispose(myObject); } while(!Q3File_IsEndOfFile(file)); /* SEE IF ANYTHING WENT WRONG */ if (Q3Error_Get(0) != kQ3ErrorNone) { if (*model != 0) { Q3Object_Dispose(*model); *model = 0; } return(kQ3Failure); } return(kQ3Success); } ---------------------------------------------------------------------- >Comment By: Lane Roathe (raving) Date: 2004-06-06 17:17 Message: Logged In: YES user_id=48487 Well...sample code is just that, and I'll stick with doing things the "right" way since ignoring errors just leads to hidden problems, as below. I tested this by replacing the error code after the NULL with "continue;" and that allows some objects to load; however they are not correct (for instance, the leave cursor is upside down and the webbing doesn't even draw). A game can not be loaded because objects are not read correctly and cause the game to bomb out. Again, the version of Quesa from Burger that I compiled for Bugdom a long time ago loads all of the game objects correctly, so it would seem that something in it fixes the toc problem. QD3D reads all of these objects correctly, and Q3File_ReadObject never returns null on any of the objects. ---------------------------------------------------------------------- Comment By: James W. Walker (jwwalker) Date: 2004-06-06 03:09 Message: Logged In: YES user_id=433183 The difference between your code and that in Qut.c (Qut_ReadModel) is that you quit when Q3File_ReadObject returns NULL. You could argue that this is valid, since the documentation says that Q3File_ReadObject returning NULL indicates an error. However, the sample code on p. 1026 of the QD3D manual also continues if Q3File_ReadObject returns NULL. The specific reason that Q3File_ReadObject returns NULL is that e3fformat_3dmf_bin_readobject does not know what to do about a table of contents, which e3fformat_3dmf_bin_read_toc has already dealt with. ---------------------------------------------------------------------- Comment By: Lane Roathe (raving) Date: 2004-06-06 01:01 Message: Logged In: YES user_id=48487 For some reason SF will not accept my attachments; probably requires that I use IE on Windows XP or some ... Anyway, I put the archive of the files that Quesa fails on online: <ftp://ftp.ifd.com/pub/Bugdom_3dmfs.zip> ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=442052&aid=967190&group_id=45158 |