Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 8903 in orxonox.OLD


Ignore:
Timestamp:
Jun 29, 2006, 1:37:36 PM (18 years ago)
Author:
hdavid
Message:

branches/mountain_lake

Location:
branches/mountain_lake/src
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/mountain_lake/src/lib/graphics/effects/cloud_effect.cc

    r8902 r8903  
    7575{
    7676  PRINTF(0)("Initializing CloudEffect\n");
    77  
     77
    7878  this->offsetZ = 0;
    7979  this->animationSpeed = 2;
     
    183183    this->shader->activateShader();
    184184    this->offset->set(0.0f, 0.0f, offsetZ);
    185    
     185
    186186    if(cloudColor != newCloudColor)
    187187    {
    188188      if(fadeCloud)
    189       { 
     189      {
    190190        this->cloudColorFadeX = new tAnimation<CloudEffect>(this, &CloudEffect::setColorCloudX);
    191191        this->cloudColorFadeX->setInfinity(ANIM_INF_CONSTANT);
     
    194194        this->cloudColorFadeZ = new tAnimation<CloudEffect>(this, &CloudEffect::setColorCloudZ);
    195195        this->cloudColorFadeZ->setInfinity(ANIM_INF_CONSTANT);
    196        
     196
    197197        this->cloudColorFadeX->addKeyFrame(cloudColor.x, fadeTime, ANIM_LINEAR);
    198198        this->cloudColorFadeX->addKeyFrame(newCloudColor.x, 0, ANIM_LINEAR);
    199  
     199
    200200        this->cloudColorFadeY->addKeyFrame(cloudColor.y, fadeTime, ANIM_LINEAR);
    201201        this->cloudColorFadeY->addKeyFrame(newCloudColor.y, 0, ANIM_LINEAR);
    202  
     202
    203203        this->cloudColorFadeZ->addKeyFrame(cloudColor.z, fadeTime, ANIM_LINEAR);
    204204        this->cloudColorFadeZ->addKeyFrame(newCloudColor.z, 0, ANIM_LINEAR);
    205        
     205
    206206        fadeCloud = false;
    207        
     207
    208208        this->cloudColorFadeX->replay();
    209209        this->cloudColorFadeY->replay();
    210210        this->cloudColorFadeZ->replay();
    211211      }
    212      
     212
    213213      this->cloudcolor->set(this->cloudColor.x, this->cloudColor.y, this->cloudColor.z);
    214214    }
    215215
    216216    if(skyColor != newSkyColor)
    217     { 
     217    {
    218218      if(fadeSky)
    219       { 
     219      {
    220220        this->skyColorFadeX = new tAnimation<CloudEffect>(this, &CloudEffect::setColorSkyX);
    221221        this->skyColorFadeX->setInfinity(ANIM_INF_CONSTANT);
     
    224224        this->skyColorFadeZ = new tAnimation<CloudEffect>(this, &CloudEffect::setColorSkyZ);
    225225        this->skyColorFadeZ->setInfinity(ANIM_INF_CONSTANT);
    226        
     226
    227227        this->skyColorFadeX->addKeyFrame(skyColor.x, fadeTime, ANIM_LINEAR);
    228228        this->skyColorFadeX->addKeyFrame(newSkyColor.x, 0, ANIM_LINEAR);
    229  
     229
    230230        this->skyColorFadeY->addKeyFrame(skyColor.y, fadeTime, ANIM_LINEAR);
    231231        this->skyColorFadeY->addKeyFrame(newSkyColor.y, 0, ANIM_LINEAR);
    232  
     232
    233233        this->skyColorFadeZ->addKeyFrame(skyColor.z, fadeTime, ANIM_LINEAR);
    234234        this->skyColorFadeZ->addKeyFrame(newSkyColor.z, 0, ANIM_LINEAR);
    235        
     235
    236236        fadeSky = false;
    237        
     237
    238238        this->skyColorFadeX->replay();
    239239        this->skyColorFadeY->replay();
    240240        this->skyColorFadeZ->replay();
    241241      }
    242      
     242
    243243      this->skycolor->set(this->skyColor.x, this->skyColor.y, this->skyColor.z);
    244244    }
    245    
     245
    246246    this->shader->deactivateShader();
    247247  }
  • branches/mountain_lake/src/world_entities/skydome.cc

    r8800 r8903  
    11/*
    22   orxonox - the future of 3D-vertical-scrollers
    3 
     3 
    44   Copyright (C) 2006 orx
    5 
     5 
    66   This program is free software; you can redistribute it and/or modify
    77   it under the terms of the GNU General Public License as published by
    88   the Free Software Foundation; either version 2, or (at your option)
    99   any later version.
    10 
     10 
    1111### File Specific:
    1212   main-programmer: hdavid, amaechler
     
    4343{
    4444  PRINTF(0)("Skydome init\n");
    45  
     45
    4646  this->setClassID(CL_SKYDOME, "Skydome");
    4747  this->toList(OM_BACKGROUND);
    48   this->toReflectionList(); 
    49  
     48  this->toReflectionList();
     49
    5050}
    5151
     
    5757{
    5858  PRINTF(0)("Deleting Skydome\n");
    59  
     59
    6060  if (glIsTexture(texture))
    6161    glDeleteTextures(1, &texture);
     
    8888  glPushMatrix();
    8989  glTranslatef(0.0f,pRadius,0.0f);
    90  
     90
    9191
    9292  glBegin(GL_TRIANGLES);
     
    115115
    116116  // Make sure our vertex array is clear
    117 //   if (planeVertices)
    118 //   {
    119 //     delete planeVertices;
    120 //     planeVertices = NULL;
    121 //   }
     117  if (planeVertices)
     118  {
     119    delete planeVertices;
     120    planeVertices = NULL;
     121  }
    122122
    123123  // Make sure our index array is clear
    124 //   if (indices)
    125 //   {
    126 //     delete indices;
    127 //     indices = NULL;
    128 //   }
     124  if (indices)
     125  {
     126    delete indices;
     127    indices = NULL;
     128  }
    129129
    130130  // Set the number of divisions into a valid range
    131131  int divs = divisions;
    132   if (divisions < 1) 
     132  if (divisions < 1)
    133133    divs = 1;
    134134
    135   if (divisions > 256) 
    136     divs = 256; 
     135  if (divisions > 256)
     136    divs = 256;
    137137
    138138  pRadius = planetRadius;
     
    152152  float delta = plane_size/(float)divs;
    153153  float tex_delta = 2.0f/(float)divs;
    154  
     154
    155155  // Variables we'll use during the dome's generation
    156156  float x_dist   = 0.0f;
     
    193193      int startvert = (i*(divs+1) + j);
    194194
    195         // tri 1
     195      // tri 1
    196196      indices[index++] = startvert;
    197197      indices[index++] = startvert+1;
     
    203203      indices[index++] = startvert+divs+1;
    204204    }
    205   } 
    206 }
     205  }
     206}
Note: See TracChangeset for help on using the changeset viewer.