Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3069 in orxonox.OLD for orxonox/trunk


Ignore:
Timestamp:
Dec 3, 2004, 6:34:18 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk/importer: fixed Material Problem

Location:
orxonox/trunk/importer
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • orxonox/trunk/importer/framework.cc

    r3068 r3069  
    11#include "framework.h"
    22
    3 int verbose = 4;
     3int verbose = 1;
    44
    55void DrawGLScene()
  • orxonox/trunk/importer/material.cc

    r2850 r3069  
    4444{
    4545  if (verbose >= 2)
    46     printf ("delete Material %s\n", name);
     46    printf ("delete Material %s.\n", name);
    4747  if (nextMat != NULL)
    4848    delete nextMat;
     
    5757{
    5858  if (verbose >=2)
    59     printf ("adding Material %s\n", mtlName);
     59    printf ("adding Material %s.\n", mtlName);
    6060  Material* newMat = new Material(mtlName);
    6161  Material* tmpMat = this;
     
    6464      tmpMat = tmpMat->nextMat;
    6565    }
    66       tmpMat->nextMat = newMat;
    67       return newMat;
     66  tmpMat->nextMat = newMat;
     67  return newMat;
    6868 
    6969}
     
    7575{
    7676  if (verbose >= 3)
    77     printf ("initializing new Material\n");
     77    printf ("initializing new Material.\n");
    7878  nextMat = NULL;
    7979
     
    9393void Material::setName (char* mtlName)
    9494{
    95   if (verbose >= 3)
    96     printf("setting Material Name to %s", mtlName);
     95  //  if (verbose >= 3)
     96    printf("setting Material Name to %s.\n", mtlName);
     97  name = new char [strlen(mtlName)];
    9798  strcpy(name, mtlName);
    9899  //  printf ("adding new Material: %s, %p\n", this->getName(), this);
     
    135136{
    136137  if (verbose >= 3)
    137     printf ("setting Diffuse Color of Material %s to r=%f g=%f b=%f\n", name, r, g, b);
     138    printf ("setting Diffuse Color of Material %s to r=%f g=%f b=%f.\n", name, r, g, b);
    138139  diffuse[0] = r;
    139140  diffuse[1] = g;
     
    162163{
    163164  if (verbose >=3)
    164     printf ("setting Ambient Color of Material %s to r=%f g=%f b=%f\n", name, r, g, b);
     165    printf ("setting Ambient Color of Material %s to r=%f g=%f b=%f.\n", name, r, g, b);
    165166  ambient[0] = r;
    166167  ambient[1] = g;
     
    188189{
    189190  if (verbose >= 3)
    190     printf ("setting Specular Color of Material %s to r=%f g=%f b=%f\n", name, r, g, b);
     191    printf ("setting Specular Color of Material %s to r=%f g=%f b=%f.\n", name, r, g, b);
    191192  specular[0] = r;
    192193  specular[1] = g;
     
    229230{
    230231  if (verbose >= 3)
    231     printf ("setting Transparency of Material %s to %f\n", name, trans);
     232    printf ("setting Transparency of Material %s to %f.\n", name, trans);
    232233  transparency = trans;
    233234}
     
    265266      searcher = searcher->nextMat;
    266267    }
     268  if (verbose >=3)
     269    printf ("not found\n");
    267270  return NULL;
    268271}
  • orxonox/trunk/importer/material.h

    r2842 r3069  
    4848
    4949 private:
    50   char name [50];
     50  char* name;
    5151  int illumModel;
    5252  float diffuse [4];
  • orxonox/trunk/importer/object.cc

    r3068 r3069  
    391391      else if (!strncmp(Buffer, "s ", 2))
    392392        {
    393           if (verbose >= 1)
     393          if (verbose >= 2)
    394394            printf("smoothing groups not supportet yet. line: %s\n", Buffer);
    395395        }
     
    644644              if (verbose >= 2)
    645645                printf ("using material %s for coming Faces.\n", tmpFace->materialString);
    646               material->search(tmpFace->materialString)->select();
     646              Material* tmpMat;
     647              if ((tmpMat = material->search(tmpFace->materialString)) != NULL)
     648                tmpMat->select();
    647649
    648650            }
Note: See TracChangeset for help on using the changeset viewer.