|
From: Stefan H. <st...@to...> - 2005-10-02 19:57:41
|
I have tried to improve writing viewhints. 1. I have partly rewritten E3IOData.c: e3viewhints_new (see below) in order to - always initialize all variables properly - support ImageDimensions - correctly write the default attribute set of the view 2. A few lines have been changed in E3FFW_3DMFBin_Writer: e3ffw_3DMF_write_objects, line 541... (see below) in order to support 3DMF v1.6 compability of the light data (see mail Roger Holmes, Re: Lights I/O, 23.06.2005) The recently released Geo3D X 2.5.2b1 (http://www.topoi.ch) includes the modified viewhint behaviour. The written viewhints are exacly the same as under QD3D (with only one exception: Quesa IR and WR renderers do not write themselves out). Stefan ________________________________________ E3IOData.c: e3viewhints_new ________________________________________ TQ3Status e3viewhints_new ( E3ViewHints* theObject, void *privateData, const void *paramData ) { // Initialise our instance data #pragma unused(privateData) // initialize the draw context related data here because Q3View_GetDrawContext could fail theObject->clearMethod = kQ3ClearMethodNone ; Q3ColorARGB_Set ( &theObject->clearImageColor, 1.0f, 1.0f, 1.0f, 1.0f ) ; theObject->isValidSetMaskState = kQ3False ; theObject->isValidSetDimensions = kQ3False ; theObject->widthDimensions = 0 ; theObject->heightDimensions = 0 ; if ( paramData ) { const TQ3ViewObject theView = (const TQ3ViewObject) paramData ; Q3View_GetRenderer ( theView , &theObject->renderer ) ; Q3View_GetCamera ( theView , &theObject->camera ) ; Q3View_GetLightGroup ( theView , &theObject->lightGroup ) ; Q3View_GetDefaultAttributeSet ( theView , &theObject->attributeSet ) ; TQ3DrawContextObject drawContext ; if ( Q3View_GetDrawContext ( theView , &drawContext ) != kQ3Failure ) { Q3DrawContext_GetClearImageMethod ( drawContext , &theObject->clearMethod ) ; Q3DrawContext_GetClearImageColor ( drawContext , &theObject->clearImageColor ) ; theObject->isValidSetMaskState = ( Q3DrawContext_GetMask ( drawContext , &theObject->mask ) != kQ3Failure ) ? kQ3True : kQ3False ; Q3DrawContext_GetPaneState (drawContext, &theObject->isValidSetDimensions) ; TQ3Area area ; Q3DrawContext_GetPane (drawContext, &area) ; theObject->widthDimensions = area.max.x - area.min.x ; theObject->heightDimensions = area.max.y - area.min.y ; } } else { theObject->renderer = NULL ; theObject->camera = NULL ; theObject->lightGroup = NULL ; theObject->attributeSet = NULL ; } // currently not supported theObject->mask.image = NULL ; theObject->mask.width = 0 ; theObject->mask.height = 0 ; theObject->mask.rowBytes = 0 ; theObject->mask.bitOrder = kQ3EndianBig ; return kQ3Success ; } ________________________________________ E3FFW_3DMFBin_Writer: e3ffw_3DMF_write_objects, line 541... ________________________________________ if(qd3dStatus == kQ3Success) { if ( instanceData->stack[i].objectType == kQ3LightData ) qd3dStatus = Q3Uns32_Write ( kQ3ShapeTypeLight, theFile ) ; else qd3dStatus = Q3Uns32_Write(instanceData->stack[i].objectType,theFile); } |