//-----------------------------------------------------------------------------------
 void CompositorWorkspaceDef::connectExternal( uint32 externalIdx, IdString inNode,
                                               uint32 inChannel )
 {
     checkInputChannelIsEmpty( inNode, inChannel, "connect_external / connect_output", externalIdx );
     createImplicitAlias( inNode );
     mExternalChannelRoutes.push_back( ChannelRoute( externalIdx, IdString(),
                                                     inChannel, inNode ) );
 }
/** 
 * Dump the Watchdog information
 * 
 * @param dump address of the log
 * 
 **/
void NewSimulatorWatchdog::Dump( NewSimulatorLog &dump ) const {
   char str[256];
   IdString().GetAscii( str, 256 );

   dump << "Watchdog: " << m_wdt_rec.WatchdogNum << " " << str << "\n";
   dump << "Oem:      " << m_wdt_rec.Oem << "\n";
   dump << "Watchdog data:\n";
   dump << "Log:                " << m_wdt_data.Log << "\n";
   dump << "Running:            " << m_wdt_data.Running << "\n";
   dump << "TimerUse:           " << m_wdt_data.TimerUse << "\n";
   dump << "TimerAction:        " << m_wdt_data.TimerAction << "\n";
   dump << "PretimerInterrupt:  " << m_wdt_data.PretimerInterrupt << "\n";
   dump << "PreTimeoutInterval: " << m_wdt_data.PreTimeoutInterval << "\n";
   dump << "TimerUseExpFlags:   " << m_wdt_data.TimerUseExpFlags << "\n";
   dump << "InitialCount:       " << m_wdt_data.InitialCount << "\n";
   dump << "PresentCount:       " << m_wdt_data.PresentCount << "\n";
   
}
Beispiel #3
0
    CompositorPass::CompositorPass( const CompositorPassDef *definition, const CompositorChannel &target,
                                    CompositorNode *parentNode ) :
            mDefinition( definition ),
            mTarget( 0 ),
            mViewport( 0 ),
            mNumPassesLeft( definition->mNumInitialPasses ),
            mParentNode( parentNode ),
            mTargetTexture( IdString(), &target.textures ),
            mNumValidResourceTransitions( 0 )
    {
        assert( definition->mNumInitialPasses && "Definition is broken, pass will never execute!" );

        mTarget = calculateRenderTarget( mDefinition->getRtIndex(), target );

        //TODO: Merging RenderTarget & Texture in a refactor would get rid of these missmatches
        //between a "target" and a "texture" in mTargetTexture.
        if( !target.textures.empty() )
            mTargetTexture.name = IdString( target.textures[0]->getName() );

        const Real EPSILON = 1e-6f;

        CompositorWorkspace *workspace = mParentNode->getWorkspace();
        uint8 workspaceVpMask = workspace->getViewportModifierMask();

        bool applyModifier = (workspaceVpMask & mDefinition->mViewportModifierMask) != 0;
        Vector4 vpModifier = applyModifier ? workspace->getViewportModifier() : Vector4( 0, 0, 1, 1 );

        Real left   = mDefinition->mVpLeft      + vpModifier.x;
        Real top    = mDefinition->mVpTop       + vpModifier.y;
        Real width  = mDefinition->mVpWidth     * vpModifier.z;
        Real height = mDefinition->mVpHeight    * vpModifier.w;

        Real scLeft   = mDefinition->mVpScissorLeft     + vpModifier.x;
        Real scTop    = mDefinition->mVpScissorTop      + vpModifier.y;
        Real scWidth  = mDefinition->mVpScissorWidth    * vpModifier.z;
        Real scHeight = mDefinition->mVpScissorHeight   * vpModifier.w;

        const unsigned short numViewports = mTarget->getNumViewports();
        for( unsigned short i=0; i<numViewports && !mViewport; ++i )
        {
            Viewport *vp = mTarget->getViewport(i);
            if( Math::Abs( vp->getLeft() - left )   < EPSILON &&
                Math::Abs( vp->getTop() - top )     < EPSILON &&
                Math::Abs( vp->getWidth() - width ) < EPSILON &&
                Math::Abs( vp->getHeight() - height )<EPSILON &&
                Math::Abs( vp->getScissorLeft() - scLeft )   < EPSILON &&
                Math::Abs( vp->getScissorTop() - scTop )     < EPSILON &&
                Math::Abs( vp->getScissorWidth() - scWidth ) < EPSILON &&
                Math::Abs( vp->getScissorHeight() - scHeight )<EPSILON &&
                vp->getColourWrite() == mDefinition->mColourWrite &&
                vp->getReadOnlyDepth() == mDefinition->mReadOnlyDepth &&
                vp->getReadOnlStencil() == mDefinition->mReadOnlyStencil &&
                vp->getOverlaysEnabled() == mDefinition->mIncludeOverlays )
            {
                mViewport = vp;
            }
        }

        if( !mViewport )
        {
            mViewport = mTarget->addViewport( left, top, width, height );
            mViewport->setScissors( scLeft, scTop, scWidth, scHeight );
            mViewport->setColourWrite( mDefinition->mColourWrite );
            mViewport->setReadOnly( mDefinition->mReadOnlyDepth, mDefinition->mReadOnlyStencil );
            mViewport->setOverlaysEnabled( mDefinition->mIncludeOverlays );
        }

        populateTextureDependenciesFromExposedTextures();
    }
/** 
 * Dump the sensor information
 * 
 * @param dump Address of the log
 * 
 **/
void NewSimulatorSensor::Dump( NewSimulatorLog &dump ) const {
  char str[256];
  IdString().GetAscii( str, 256 );

  dump << "Sensor: " << m_sensor_record.Num << " " << str << "\n";
}