Changeset 4165 in orxonox.OLD for orxonox/branches/heightMap/src/lib/graphics
- Timestamp:
- May 11, 2005, 2:23:54 PM (20 years ago)
- Location:
- orxonox/branches/heightMap/src/lib/graphics
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
orxonox/branches/heightMap/src/lib/graphics/Makefile.in
r4122 r4165 113 113 PACKAGE_VERSION = @PACKAGE_VERSION@ 114 114 PATH_SEPARATOR = @PATH_SEPARATOR@ 115 PKG_CONFIG = @PKG_CONFIG@ 115 116 RANLIB = @RANLIB@ 116 117 SET_MAKE = @SET_MAKE@ … … 176 177 esac; \ 177 178 done; \ 178 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/graphics/Makefile'; \179 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/graphics/Makefile'; \ 179 180 cd $(top_srcdir) && \ 180 $(AUTOMAKE) -- gnusrc/lib/graphics/Makefile181 $(AUTOMAKE) --foreign src/lib/graphics/Makefile 181 182 .PRECIOUS: Makefile 182 183 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
orxonox/branches/heightMap/src/lib/graphics/graphics_engine.cc
r4122 r4165 31 31 { 32 32 this->setClassName ("GraphicsEngine"); 33 34 this->fullscreen = false; 35 33 36 this->initVideo(); 34 37 … … 140 143 int GraphicsEngine::setResolution(int width, int height, int bpp) 141 144 { 145 Uint32 fullscreenFlag; 142 146 this->resolutionX = width; 143 147 this->resolutionY = height; 144 148 this->bitsPerPixel = bpp; 149 if (this->fullscreen) 150 fullscreenFlag = SDL_FULLSCREEN; 151 else 152 fullscreenFlag = 0; 145 153 146 154 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) 148 156 { 149 157 PRINTF(1)("Could not SDL_SetVideoMode(%d, %d, %d, %d): %s\n", this->resolutionX, this->resolutionY, this->bitsPerPixel, this->videoFlags, SDL_GetError()); … … 151 159 // return -1; 152 160 } 153 161 } 162 163 void GraphicsEngine::setFullscreen(bool fullscreen) 164 { 165 this->fullscreen = fullscreen; 166 this->setResolution(this->resolutionX, this->resolutionY, this->bitsPerPixel); 154 167 } 155 168 … … 257 270 /* Check if our resolution is restricted */ 258 271 if(this->videoModes == (SDL_Rect **)-1){ 259 PRINTF( 1)("All resolutions available.\n");272 PRINTF(2)("All resolutions available.\n"); 260 273 } 261 274 else{ … … 263 276 PRINT(0)("Available Resoulution Modes are\n"); 264 277 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); 266 279 } 267 280 -
orxonox/branches/heightMap/src/lib/graphics/graphics_engine.h
r3844 r4165 26 26 int setGLattribs(void); 27 27 int setResolution(int width, int height, int bpp); 28 void setFullscreen(bool fullscreen = false); 28 29 /** \returns the x resolution */ 29 30 inline int getResolutionX(void) {return this->resolutionX;} -
orxonox/branches/heightMap/src/lib/graphics/importer/Makefile.in
r4122 r4165 150 150 PACKAGE_VERSION = @PACKAGE_VERSION@ 151 151 PATH_SEPARATOR = @PATH_SEPARATOR@ 152 PKG_CONFIG = @PKG_CONFIG@ 152 153 RANLIB = @RANLIB@ 153 154 SET_MAKE = @SET_MAKE@ … … 247 248 esac; \ 248 249 done; \ 249 echo ' cd $(top_srcdir) && $(AUTOMAKE) -- gnusrc/lib/graphics/importer/Makefile'; \250 echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/lib/graphics/importer/Makefile'; \ 250 251 cd $(top_srcdir) && \ 251 $(AUTOMAKE) -- gnusrc/lib/graphics/importer/Makefile252 $(AUTOMAKE) --foreign src/lib/graphics/importer/Makefile 252 253 .PRECIOUS: Makefile 253 254 Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status -
orxonox/branches/heightMap/src/lib/graphics/importer/material.cc
r4111 r4165 45 45 this->setTransparency(1.0); 46 46 47 48 47 this->diffuseTexture = NULL; 49 48 this->ambientTexture = NULL; 50 49 this->specularTexture = NULL; 51 52 this->diffuseTextureSet = false;53 this->ambientTextureSet = false;54 this->specularTextureSet = false;55 50 56 51 this->setName(mtlName); … … 107 102 glShadeModel(GL_SMOOTH); 108 103 109 if (this->diffuseTexture Set)104 if (this->diffuseTexture) 110 105 { 111 106 glEnable(GL_TEXTURE_2D); … … 300 295 { 301 296 PRINTF(4)("setting Diffuse Map %s\n", dMap); 302 // diffuseTexture = new Texture();303 // this->diffuseTextureSet = diffuseTexture->loadImage(dMap);304 297 305 298 //! \todo check if RESOURCE MANAGER is availiable 306 299 //! \todo Textures from .mtl-file need special care. 307 this->diffuseTexture Set = this->diffuseTexture= (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE);300 this->diffuseTexture = (Texture*)ResourceManager::getInstance()->load(dMap, IMAGE); 308 301 } 309 302 -
orxonox/branches/heightMap/src/lib/graphics/importer/material.h
r3914 r4165 67 67 Texture* ambientTexture; //!< The ambient texture of the Material. 68 68 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 74 69 }; 75 70 #endif -
orxonox/branches/heightMap/src/lib/graphics/particles/particle_system.cc
r4122 r4165 40 40 this->particleType = type; 41 41 this->particles = NULL; 42 this->deadList = NULL; 42 43 this->setConserve(.8); 43 44 this->setLifeSpan(.1); … … 57 58 // delete what has to be deleted here 58 59 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 } 59 76 } 60 77 … … 199 216 { 200 217 prevPart->next = tickPart->next; 201 delete tickPart; 218 tickPart->next = this->deadList; 219 this->deadList = tickPart; 202 220 tickPart = prevPart->next; 203 221 } … … 206 224 prevPart = NULL; 207 225 this->particles = tickPart->next; 208 delete tickPart; 226 tickPart->next = this->deadList; 227 this->deadList = tickPart; 209 228 tickPart = this->particles; 210 229 } … … 266 285 if (unlikely(particles == NULL)) 267 286 { 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; 269 294 this->particles->next = NULL; 270 295 } … … 272 297 else 273 298 { 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; 275 307 tmpPart->next = this->particles; 276 308 this->particles = tmpPart; … … 300 332 PRINT(0)(" ParticleSystem %s\n", this->name); 301 333 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 92 92 Material* material; //!< A Material for all the Particles. 93 93 Particle* particles; //!< A list of particles of this System. 94 Particle* deadList; //!< A list of dead Particles in the System. 94 95 95 96 GLuint* glID; //!< A List of different gl-List-ID's
Note: See TracChangeset
for help on using the changeset viewer.