Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 4165 in orxonox.OLD for orxonox/branches/heightMap/src/lib/graphics


Ignore:
Timestamp:
May 11, 2005, 2:23:54 PM (20 years ago)
Author:
bensch
Message:

orxonox/branches/heightMap: merged trunk back to the heightMap branche
merged with command:
svn merge trunk/ branches/heightMap/ -r 4122:HEAD

Location:
orxonox/branches/heightMap/src/lib/graphics
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • orxonox/branches/heightMap/src/lib/graphics/Makefile.in

    r4122 r4165  
    113113PACKAGE_VERSION = @PACKAGE_VERSION@
    114114PATH_SEPARATOR = @PATH_SEPARATOR@
     115PKG_CONFIG = @PKG_CONFIG@
    115116RANLIB = @RANLIB@
    116117SET_MAKE = @SET_MAKE@
     
    176177          esac; \
    177178        done; \
    178         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/graphics/Makefile'; \
     179        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/graphics/Makefile'; \
    179180        cd $(top_srcdir) && \
    180           $(AUTOMAKE) --gnu  src/lib/graphics/Makefile
     181          $(AUTOMAKE) --foreign  src/lib/graphics/Makefile
    181182.PRECIOUS: Makefile
    182183Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • orxonox/branches/heightMap/src/lib/graphics/graphics_engine.cc

    r4122 r4165  
    3131{
    3232  this->setClassName ("GraphicsEngine");
     33
     34  this->fullscreen = false;
     35
    3336  this->initVideo();
    3437
     
    140143int GraphicsEngine::setResolution(int width, int height, int bpp)
    141144{
     145  Uint32 fullscreenFlag;
    142146  this->resolutionX = width;
    143147  this->resolutionY = height;
    144148  this->bitsPerPixel = bpp;
     149  if (this->fullscreen)
     150    fullscreenFlag = SDL_FULLSCREEN;
     151  else
     152    fullscreenFlag = 0;
    145153 
    146154  printf ("ok\n");
    147   if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags)) == NULL)
     155  if((this->screen = SDL_SetVideoMode(this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags | fullscreenFlag)) == NULL)
    148156    {
    149157      PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError());
     
    151159      //    return -1;
    152160    }
    153 
     161}
     162
     163void GraphicsEngine::setFullscreen(bool fullscreen)
     164{
     165  this->fullscreen = fullscreen;
     166  this->setResolution(this->resolutionX, this->resolutionY, this->bitsPerPixel);
    154167}
    155168
     
    257270  /* Check if our resolution is restricted */
    258271  if(this->videoModes == (SDL_Rect **)-1){
    259     PRINTF(1)("All resolutions available.\n");
     272    PRINTF(2)("All resolutions available.\n");
    260273  }
    261274  else{
     
    263276    PRINT(0)("Available Resoulution Modes are\n");
    264277    for(int i = 0; this->videoModes[i]; ++i)
    265       PRINT(0)(" |  %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h);
     278      PRINT(4)(" |  %d x %d\n", this->videoModes[i]->w, this->videoModes[i]->h);
    266279  }
    267280 
  • orxonox/branches/heightMap/src/lib/graphics/graphics_engine.h

    r3844 r4165  
    2626  int setGLattribs(void);
    2727  int setResolution(int width, int height, int bpp);
     28  void setFullscreen(bool fullscreen = false);
    2829  /** \returns the x resolution */
    2930  inline int getResolutionX(void) {return this->resolutionX;}
  • orxonox/branches/heightMap/src/lib/graphics/importer/Makefile.in

    r4122 r4165  
    150150PACKAGE_VERSION = @PACKAGE_VERSION@
    151151PATH_SEPARATOR = @PATH_SEPARATOR@
     152PKG_CONFIG = @PKG_CONFIG@
    152153RANLIB = @RANLIB@
    153154SET_MAKE = @SET_MAKE@
     
    247248          esac; \
    248249        done; \
    249         echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu  src/lib/graphics/importer/Makefile'; \
     250        echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  src/lib/graphics/importer/Makefile'; \
    250251        cd $(top_srcdir) && \
    251           $(AUTOMAKE) --gnu  src/lib/graphics/importer/Makefile
     252          $(AUTOMAKE) --foreign  src/lib/graphics/importer/Makefile
    252253.PRECIOUS: Makefile
    253254Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
  • orxonox/branches/heightMap/src/lib/graphics/importer/material.cc

    r4111 r4165  
    4545  this->setTransparency(1.0);
    4646
    47 
    4847  this->diffuseTexture = NULL;
    4948  this->ambientTexture = NULL;
    5049  this->specularTexture = NULL;
    51 
    52   this->diffuseTextureSet = false;
    53   this->ambientTextureSet = false;
    54   this->specularTextureSet = false;
    5550
    5651  this->setName(mtlName);
     
    107102    glShadeModel(GL_SMOOTH);
    108103
    109   if (this->diffuseTextureSet)
     104  if (this->diffuseTexture)
    110105    {
    111106      glEnable(GL_TEXTURE_2D);
     
    300295{
    301296  PRINTF(4)("setting Diffuse Map %s\n", dMap);
    302   //    diffuseTexture = new Texture();
    303   //    this->diffuseTextureSet = diffuseTexture->loadImage(dMap);
    304297
    305298  //! \todo check if RESOURCE MANAGER is availiable
    306299  //! \todo Textures from .mtl-file need special care.
    307   this->diffuseTextureSet = this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE);
     300  this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE);
    308301}
    309302
  • orxonox/branches/heightMap/src/lib/graphics/importer/material.h

    r3914 r4165  
    6767  Texture* ambientTexture; //!< The ambient texture of the Material.
    6868  Texture* specularTexture;//!< The specular texture of the Material.
    69  
    70   bool diffuseTextureSet; //!< Chekcs if the diffuse texture is Set.
    71   bool ambientTextureSet; //!< Chekcs if the ambient texture is Set.
    72   bool specularTextureSet;//!< Chekcs if the specular texture is Set.
    73 
    7469};
    7570#endif
  • orxonox/branches/heightMap/src/lib/graphics/particles/particle_system.cc

    r4122 r4165  
    4040   this->particleType = type;
    4141   this->particles = NULL;
     42   this->deadList = NULL;
    4243   this->setConserve(.8);
    4344   this->setLifeSpan(.1);
     
    5758  // delete what has to be deleted here
    5859   ParticleEngine::getInstance()->removeSystem(this);
     60
     61   // deleting all the living Particles
     62   while (this->particles)
     63     {
     64       Particle* tmpDelPart = this->particles;
     65       this->particles = this->particles->next;
     66       delete tmpDelPart;
     67     }
     68
     69   // deleting all the dead particles
     70   while (this->deadList)
     71     {
     72       Particle* tmpDelPart = this->deadList;
     73       this->deadList = this->deadList->next;
     74       delete tmpDelPart;
     75     }
    5976}
    6077
     
    199216            {
    200217              prevPart->next = tickPart->next;
    201               delete tickPart;
     218              tickPart->next = this->deadList;
     219              this->deadList = tickPart;
    202220              tickPart = prevPart->next;
    203221            }
     
    206224              prevPart = NULL;
    207225              this->particles = tickPart->next;
    208               delete tickPart;
     226              tickPart->next = this->deadList;
     227              this->deadList = tickPart;
    209228              tickPart = this->particles;
    210229            }
     
    266285      if (unlikely(particles == NULL))
    267286        {
    268           this->particles = new Particle;
     287          if (likely(deadList != NULL))
     288            {
     289              this->particles = this->deadList;
     290              deadList = deadList->next;
     291            }
     292          else
     293            this->particles = new Particle;
    269294          this->particles->next = NULL;
    270295        }
     
    272297      else
    273298        {
    274           Particle* tmpPart = new Particle;
     299          Particle* tmpPart;
     300          if (likely(deadList != NULL))
     301            {
     302              tmpPart = this->deadList;
     303              deadList = deadList->next;
     304            }
     305          else
     306            tmpPart = new Particle;
    275307          tmpPart->next = this->particles;
    276308          this->particles = tmpPart;
     
    300332  PRINT(0)("  ParticleSystem %s\n", this->name);
    301333  PRINT(0)("  ParticleCount: %d, maximumCount: %d :: filled %d%%\n", this->count, this->maxCount, 100*this->count/this->maxCount);
    302 }
     334  if (deadList)
     335    {
     336      PRINT(0)("  - ParticleDeadList is used: ");
     337      int i = 1;
     338      Particle* tmpPart = this->deadList;
     339      while (tmpPart = tmpPart->next) ++i;
     340      PRINT(0)("count: %d\n", i);
     341    }
     342}
  • orxonox/branches/heightMap/src/lib/graphics/particles/particle_system.h

    r4122 r4165  
    9292  Material* material;        //!< A Material for all the Particles.
    9393  Particle* particles;       //!< A list of particles of this System.
     94  Particle* deadList;        //!< A list of dead Particles in the System.
    9495
    9596  GLuint* glID;              //!< A List of different gl-List-ID's
Note: See TracChangeset for help on using the changeset viewer.