Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 5319 in orxonox.OLD for trunk


Ignore:
Timestamp:
Oct 8, 2005, 3:10:38 PM (19 years ago)
Author:
bensch
Message:

orxonox/trunk: some minor file-handling

Location:
trunk/src/lib
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/graphics/importer/objModel.cc

    r5300 r5319  
    176176  Material* tmpMat = NULL;
    177177
    178   while(fgets(buffer, PARSELINELENGTH, stream))
     178  while(fgets(buffer, PARSELINELENGTH, stream) != NULL)
    179179    {
    180180      PRINTF(5)("found line in mtlFile: %s\n", buffer);
  • trunk/src/lib/graphics/shader.cc

    r5318 r5319  
    9191bool Shader::loadShaderProgramm(SHADER_TYPE type, const char* fileName)
    9292{
    93   GLenum shader = 0;
     93  GLhandleARB shader = 0;
    9494
    9595  if (type != SHADER_VERTEX && type != SHADER_FRAGMENT)
     
    119119
    120120  if (shader != 0)
    121     {
    122       glShaderSourceARB(shader, program->getCount(), (const GLcharARB**)program->getArray(), NULL);
    123         glCompileShaderARB(shader);
    124           this->printError(shader);
    125       glAttachObjectARB(this->shaderProgram, shader);
    126     }
    127     delete program;
     121  {
     122    glShaderSourceARB(shader, program->getCount(), (const GLcharARB**)program->getArray(), NULL);
     123      glCompileShaderARB(shader);
     124        this->printError(shader);
     125    glAttachObjectARB(this->shaderProgram, shader);
     126  }
     127  for (unsigned int i=0; i< program->getCount(); i++)
     128    delete[] program->getArray()[i];
     129  delete program;
    128130}
    129131
     
    218220
    219221
    220 void Shader::printError(GLenum program)
     222void Shader::printError(GLhandleARB program)
    221223{
    222224  if (program == 0)
  • trunk/src/lib/graphics/shader.h

    r5318 r5319  
    4545
    4646
    47   void printError(GLenum program);
     47  void printError(GLhandleARB program);
    4848  void debug() const;
    4949
     
    5353   char*                  fragmentShaderFile;
    5454   char*                  vertexShaderFile;
    55    GLenum                 shaderProgram;
    56    GLenum                 vertexShader;
    57    GLenum                 fragmentShader;
     55   GLhandleARB            shaderProgram;
     56   GLhandleARB            vertexShader;
     57   GLhandleARB            fragmentShader;
    5858
    5959   static Shader*         storedShader;
  • trunk/src/lib/gui/gtk_gui/gui_exec.h

    r5024 r5319  
    2424  char* confDir;               //!< The directory of the orxonox-configuration-files.
    2525  char* confFile;              //!< The name of the .orxonox.conf(ig)-file.
    26   FILE* CONFIG_FILE;           //!< Filehandler for reading and writing.
    2726
    2827  //! A struct that holds informations about variables.
  • trunk/src/lib/util/ini_parser.cc

    r5169 r5319  
    119119    char* ptr;
    120120
    121     while( !feof( stream))
    122     {
    123       // get next line
    124       fgets (lineBuffer, PARSELINELENGHT, stream);
     121    while( fgets (lineBuffer, PARSELINELENGHT, stream))
     122    {
    125123      lineBegin = lineBuffer;
    126124      // remove newline char, and \0-terminate
Note: See TracChangeset for help on using the changeset viewer.