Ejemplo n.º 1
0
int convert (char *InputFilename, char *OutputFilename) {
  FILE *Fin, *Fout;
  int   i, N;

  Fin= fopen(InputFilename, "r");
  if (!Fin) return 0;

  Fout= fopen(OutputFilename, "w");
  if (!Fout) return 0;

  for (i=0; i<40; i++) {
    fscanf ( Fin, "%s = %s ( %s", OutVar[i], Operation[i], In1Var[i]);
    if (!strcmp(OutVar[i], "*")) break;  // end of file
    if (!strcmp(In1Var[i], ")")) {
      In1Var[i][0]='\0';
      In2Var[i][0]='\0';
      In3Var[i][0]='\0';
    } else {
      fscanf ( Fin, "%s", In2Var[i]);
      if (!strcmp(In2Var[i], ")")) {
        In2Var[i][0]='\0';
        In3Var[i][0]='\0';
      } else {
        fscanf ( Fin, "%s", In3Var[i]);
        if (!strcmp(In3Var[i], ")")) {
          In3Var[i][0]='\0';
        } else
        fscanf ( Fin, ")");
     }
   }
   fgets ( DUMP, 120, Fin);
  }
  N=i;
  fprintf( Fout, "%d  // Total number of instructions\n", N);
  for (i=0; i<N; i++) {
    int s1=0, s2=0, s3=0; 
    if (In1Var[i]) s1 = findInput( In1Var[i], i, N);
    if (In2Var[i]) s2 = findInput( In2Var[i], i, N);
    if (In3Var[i]) s3 = findInput( In3Var[i], i, N);
    fprintf( Fout, "%d, %d, %d, %4s    //", s1, s2, s3, Operation[i]);
    if (In1Var[i])  fprintf( Fout, "%s ", In1Var[i]);
    if (In2Var[i])  fprintf( Fout, "%s ", In2Var[i]);
    if (In3Var[i])  fprintf( Fout, "%s ", In3Var[i]);
    fprintf( Fout, "\n");
  }
  return N;
}
Ejemplo n.º 2
0
void RPDeferredLightingNode::onObjectLoaded()
{
   __super::onObjectLoaded();

   // find input socket
   delete m_normalsInput;
   delete m_specularInput;
   delete m_depthInput;
   delete m_sceneColorInput;
   delete m_materialIndicesInput;
   delete m_materialsDescInput;

   delete m_finalLightColorTargetOutput;
   delete m_shadowDepthTextureOutput;
   delete m_screenSpaceShadowMapOutput;

   m_normalsInput = static_cast< RPTextureInput* >( findInput( "Normals" ) );
   m_specularInput = static_cast< RPTextureInput* >( findInput( "Specular" ) );
   m_depthInput = static_cast< RPTextureInput* >( findInput( "Depth" ) );
   m_sceneColorInput = static_cast< RPTextureInput* >( findInput( "SceneColor" ) );
   m_materialIndicesInput = static_cast< RPTextureInput* >( findInput( "MaterialsIndices" ) );
   m_materialsDescInput = static_cast< RPTextureInput* >( findInput( "MaterialsDescr" ) );

   m_finalLightColorTargetOutput = static_cast< RPTextureOutput* >( findOutput( "LitScene"  ) );
   m_shadowDepthTextureOutput = static_cast< RPTextureOutput* >( findOutput( "ShadowDepthBuffer" ) );
   m_screenSpaceShadowMapOutput = static_cast< RPTextureOutput* >( findOutput( "SS_ShadowMap" ) );
}
Ejemplo n.º 3
0
void MNTexture::onObjectLoaded()
{
   MaterialNode::onObjectLoaded();

   // find the existing inputs
   m_uvInput = static_cast< MSVec2Input* >( findInput( "UV" ) );
   m_output = static_cast< MSColorOutput* >( findOutput( "Color" ) );

   if ( m_texture )
   {
      m_renderableTexture->setTexture( m_texture );
   }
}
Ejemplo n.º 4
0
MNTexture::MNTexture( const MNTexture& rhs )
   : MaterialNode( rhs )
   , m_texture( rhs.m_texture )
   , m_samplerSettings( rhs.m_samplerSettings )
   , m_output( NULL )
   , m_renderableTexture( new RenderableTexture() )
{
   m_uvInput = static_cast< MSVec2Input* >( findInput( "UV" ) );
   m_output = static_cast< MSColorOutput* >( findOutput( "Color" ) );

   if ( m_texture )
   {
      m_renderableTexture->setTexture( m_texture );
   }
}
Ejemplo n.º 5
0
/*--------------------*/ void DOrcfg(void *tag, void *bmsg, int *size)  {
// bmsg: binary message TDAQInfo
TDAQInfo *dain; int rc; unsigned int rundec; char pname[40];
//printf("INFO DOrcfg len:%d %lu\n", *size,sizeof(TDAQInfo));
if(*size != sizeof(TDAQInfo)){
 char emsg[ERRMSGL];
 sprintf(emsg, "DOrcfg: Structure dim size different from command size.");
 infolog_trg(LOG_FATAL, emsg);
 printf("ERROR %s\n", emsg);
 return ;
} 
dain= (TDAQInfo *)bmsg;
//printTDAQInfo(dain);
printf("INFO DOrcfg msg:%s", dain->run1msg); 
rc= getname_rn(dain->run1msg, pname, &rundec);
if(check_xcounters()) return;
if(rc==0) {
  //printf("INFO effiout:0x%x\n", effiout);
  /*new from aug2015:
  effiout: bit pattern of inp. detectors effectively filtered out
  not used: prepared if DAQ wants in future 'per cluster' -in that 
    case 'per cluster' info
   -should by passed in TDAQInfo structure from ctp proxy (now it is not) or
   -somehow, pydimserver.py should deliver 'per cluster' (now delivering 'per partition')
  red_update_detsinrun() invoked also in following call
  */
  rc= daqlogbook_update_clusters(rundec, pname, dain, ignoreDAQLOGBOOK); //, effiout);
  printf("INFO Dorcfg rc=%i \n",rc);
  //printf("%s",dain->run1msg); fflush(stdout);  moved down
  if(rc==0) { // inputs -> DAQ
    int level,maxinp,ix,ind,rcu;
    for(level=0; level<3; level++) {
      if(level==2) {maxinp=12; }
      else         {maxinp=24; }
      for(ix=0; ix<maxinp; ix++) {
        ind= findInput(level, ix+1);
        if(ind==-1) continue;
        if(ignoreDAQLOGBOOK) { rcu=0;
          //printf("INFO L%d.%d %s\n", level, ix+1, validCTPINPUTs[ind].name);
        } else {
          rcu= daqlogbook_insert_triggerInput(rundec,   
            ix+1, validCTPINPUTs[ind].name, level);
          printf("INFO L%d.%d %s\n", level, ix+1, validCTPINPUTs[ind].name);
        };
        if(rcu != 0) {
          char emsg[ERRMSGL];
          sprintf(emsg, "daqlogbook_insert_triggerInput(%d,%d,%s,%d) rc:%d",
            rundec,ix+1, validCTPINPUTs[ind].name, level, rcu);
          infolog_trg(LOG_FATAL, emsg);
          printf("ERROR %s\n", emsg);
          break;
        };
      }; 
    };
    printf("%s",dain->run1msg); fflush(stdout);
  } else {
    char emsg[ERRMSGL];
    sprintf(emsg,"DAQlogbook_update_cluster failed. rc:%d", rc);
    infolog_trgboth(LOG_FATAL, emsg);
  };
};
}