Пример #1
0
void DetailList::SaveMaterials()
{
	//----------------------------------------------------------------
   // Write out the material list:
   //

   if( fnTSMats )
      {
      TSMaterialList * ml = new TSMaterialList( fnTSMats );
      if( ml )
         {
         // install materials in list:
         for( int i = 0; i < fnTSMats; i++ )
            (*ml)[i] = faTSMats[i];

         // get filename and write material list:
	   	char outFile[256];
		   sprintf(outFile, "%s.%s", fBaseName, MAT_LIST_EXT);
         StatusPrintf( "Writing material list: %s", outFile );
         remove( outFile );
         FileWStream ost( outFile );
         ml->writeItem( ost );

         // we no longer need the material list:
         delete ml;
         }
      else
         StatusPrintf( "Not enough memory to write material list!" );
      }
}
Пример #2
0
static void DisplayDeadl(void)
{
    struct p_i_object *pip;
    char            string[LINEMAX], buf[LINEMAX];
    int             sumtok = 0;
	int 			prevdim,dim;
	
	/*	StatusPrintf("SEE Deadlocks with LEFT button"); */
    string[0]='\0';
	prevdim =0;
    for (pip = p_invars->i_l; pip != NULL; pip = pip->next) 
	{
		HighlightDeadl(pip->p_p);
		if (pip != p_invars->i_l)
			strcat(string, " + ");
		strcat(string, pip->p_p->tag);
		if (pip->p_p->mpar == NULL)
			sumtok += (pip->p_p->m0);
		else
			sumtok += (pip->p_p->mpar->value);
		dim = (strlen(string)) / 60;
		if (dim > prevdim) 
		{
		    strcat(string, "\n");
			prevdim =dim;
		}
    }
    highlight_list(p_i_list, (int) (place_radius + place_radius), FALSE, NULL);
    sprintf(buf, " = %d", sumtok);
    strcat(string, buf);
	StatusPrintf(string);
	ShowShowDialog(string);
}
Пример #3
0
void ShowDeadl(XButtonEvent *ie)
{
    struct p_i_l_type *from;
    struct p_i_object *pip;
    int             first = TRUE;
    char            string[LINEMAX];
	
    if (figure_modified)
		ClearDeadl();
    if (p_invars == NULL)
	{
		ShowInfoDialog("Sorry, no up-to-date Deadlocks available",mainwin);
		return;
    }
    DehighlightDeadl();
    fix_x = event_x(ie) / zoom_level;
    fix_y = event_y(ie) / zoom_level;
    if ((cur_place = near_place_obj(fix_x, fix_y)) == NULL) 
	{
		StatusPrintf("");
		ShowShowDialog("");
		return;
    }
    for (from = p_invars = p_invars->next; first || (p_invars != from);
	 first = FALSE, p_invars = p_invars->next) {
		for (pip = p_invars->i_l; pip != NULL; pip = pip->next)
			if (pip->p_p == cur_place)
				goto found;
    }
    sprintf(string,"place %s is not contained in any minimal deadlock",cur_place->tag);
	StatusPrintf(string);
	ShowShowDialog(string);
    return;
	found:
		DisplayDeadl();
}
Пример #4
0
void Material::Dump()
{
	static char s[200];

   // write out a summary of the material:
   sprintf( s, "Add Material: %-18s  \r\n", fName );
   if( fUnlit )
      strcat( s, "unlit " );
   if( fSmooth )
      strcat( s, "smooth " );
   else
      strcat( s, "flat   " );

   if( fTextured )
      {
      if( fTransparent )
         strcat( s, "transparent " );
      if( fPerspectiveCorrect )
         strcat( s, "perspective-correct " );
      if( fTextureHasAlpha )
         strcat( s, "alpha " );
      strcat( s, "texture: " );
      strcat( s, fRawTextureFile );
      }
   else if( fUsePaletteIndex )
      {
      char r[100];
      sprintf( r, "Palette: %d", fPaletteIndex );
      strcat( s, r );
      }
	else
      {
      char r[100];
      sprintf( r, "RGB: %d %d %d", fR, fG, fB );
      strcat( s, r );
      }
   sprintf( s + strlen( s ), " translucency: %f", fTranslucency );
   StatusPrintf( s );
}