STATIC RET_T implyMaybePerform( TARGET *targ, TARGET *imptarg, TARGET *cretarg, bool must ) /****************************************************************************************** * perform cmds if targ is older than imptarg || must * * targ is the target to be updated * imptarg is the dependent for target (ie: "targ : imptarg" ) * cretarg is the implicit rule to use * must must we do it? */ { RET_T ret; DEPEND *newdep; time_t max_time; max_time = OLDEST_DATE; if( imptarg->error ) { /* there was an error making imptarg before, so just abort */ return( RET_ERROR ); } if( cretarg->attr.always ) { must = true; } if( isOutOfDate( targ, imptarg, &must ) == RET_ERROR ) { return( RET_ERROR ); } if( !must && USE_AUTO_DEP( cretarg ) ) { if( autoOutOfDate( targ, &max_time ) ) { must = true; } } if( must ) { /* construct a depend for perform */ newdep = DupDepend( cretarg->depend ); newdep->targs = NewTList(); newdep->targs->target = imptarg; /* handle implied attributes (.symb/.prec/.multi) */ TargAttrOrAttr( &targ->attr, cretarg->attr ); ret = perform( targ, newdep, newdep, max_time ); FreeDepend( newdep ); /* don't need depend any more */ if( ret != RET_SUCCESS ) { return( RET_ERROR ); } if( Glob.noexec || Glob.query ) { targ->executed = true; targ->touched = true; } } return( RET_SUCCESS ); }
void RTTLayer::renderToTarget(IRenderTarget* _target, bool _update) { bool outOfDate = mOutOfDate || isOutOfDate(); if (outOfDate || _update) { MyGUI::IRenderTarget* target = mTexture->getRenderTarget(); if (target != nullptr) { target->begin(); for (VectorILayerNode::iterator iter = mChildItems.begin(); iter != mChildItems.end(); ++iter) (*iter)->renderToTarget(target, _update); target->end(); } } mOutOfDate = false; }
STATIC RET_T resolve( TARGET *targ, DEPEND *depend ) /*************************************************** * If there are no dependents, then perform the associated commands, if req'd. * If there are dependents: update them all; compare the date of each dep * to the targ; if any of the deps had an error previously, abort; if targ * is out of date then perform the clist (or attempt to imply). */ { TLIST *tlist; RET_T tmp; bool outofdate; bool exec_cmds; time_t max_time; max_time = OLDEST_DATE; ExpandWildCards( targ, depend ); if( depend->targs == NULL ) { /* make the target if it doesn't exist or it's symbolic */ /* a "::" target with no dependents must be made */ exec_cmds = false; if( !targ->scolon || !targ->existing ) { exec_cmds = true; } if( targ->attr.symbolic || targ->attr.always ) { exec_cmds = true; } /* if all targets must be made, so should this one */ if( Glob.all ) { exec_cmds = true; } if( !exec_cmds && USE_AUTO_DEP( targ ) ) { if( autoOutOfDate( targ, &max_time ) ) { exec_cmds = true; } } if( exec_cmds ) { return( perform( targ, depend, NULL, max_time ) ); } return( RET_SUCCESS ); } MakeList( depend->targs ); getDate( targ ); /* check if out of date with deps */ outofdate = false; for( tlist = depend->targs; tlist != NULL; tlist = tlist->next ) { if( isOutOfDate( targ, tlist->target, &outofdate ) == RET_ERROR ) { return( RET_ERROR ); } } if( targ->attr.always ) { outofdate = true; } if( !outofdate && USE_AUTO_DEP( targ ) ) { if( autoOutOfDate( targ, &max_time ) ) { outofdate = true; } } if( outofdate ) { /* if we get this far, then none of the deps had a previous error, * and at least one of the deps is newer than targ, so we perform */ if( depend->clist != NULL ) { return( perform( targ, depend, NULL, max_time ) ); } else { tmp = tryImply( targ, true ); if( tmp == RET_WARN ) { /* couldn't imply - will do DEFAULT cmds */ return( perform( targ, depend, NULL, max_time ) ); } return( tmp ); } } return( RET_SUCCESS ); }