Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 3655 in orxonox.OLD for orxonox/trunk/src/lib/graphics/importer


Ignore:
Timestamp:
Mar 26, 2005, 3:28:39 PM (20 years ago)
Author:
bensch
Message:

orxonox/trunk: moved protoclass to folder proto
added protosingleton
added resourceManager
modiefied some stuff to work better

Location:
orxonox/trunk/src/lib/graphics/importer
Files:
5 edited

Legend:

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

    r3590 r3655  
    2323#include <stdlib.h>
    2424#include <string.h>
     25
     26//! \todo check if we are in RESOURCE MANAGER-mode
     27#include "resource_manager.h"
    2528
    2629using namespace std;
     
    104107  this->ambientTextureSet = false;
    105108  this->specularTextureSet = false;
    106 
    107  
    108109}
    109110
     
    333334{
    334335  PRINTF(4)("setting Diffuse Map %s\n", dMap);
    335   diffuseTexture = new Texture();
    336   this->diffuseTextureSet = diffuseTexture->loadImage(dMap);
    337 
     336    diffuseTexture = new Texture();
     337    this->diffuseTextureSet = diffuseTexture->loadImage(dMap);
     338
     339  //! \todo check if RESOURCE MANAGER is availiable
     340  //this->diffuseTextureSet = this->diffuseTexture = (Texture*)ResourceManager::load(dMap, IMAGE);
    338341}
    339342
  • orxonox/trunk/src/lib/graphics/importer/objModel.cc

    r3590 r3655  
    2121
    2222#include "debug.h"
    23 
    24 /**
    25    \brief Crates a 3D-Model and loads in a File.
    26    \param fileName file to parse and load (must be a .obj file)
    27 */
    28 OBJModel::OBJModel(char* fileName)
    29 {
    30   this->initializeOBJ();
    31 
    32   this->importFile (fileName);
    33 
    34   this->importToGL ();
    35 
    36   this->cleanup();
    37 }
    3823
    3924/**
     
    193178      else if (!strncmp(Buffer, "s ", 2)) //! \todo smoothing groups have to be implemented
    194179        {
    195           PRINTF(3)("smoothing groups not supportet yet. line: %s\n", Buffer);
     180          PRINTF(2)("smoothing groups not supportet yet. line: %s\n", Buffer);
    196181        }
    197182    }
  • orxonox/trunk/src/lib/graphics/importer/objModel.h

    r3454 r3655  
    1313{
    1414 public:
    15   OBJModel(char* fileName);
    16   OBJModel(char* fileName, float scaling);
     15  OBJModel(char* fileName, float scaling = 1.0);
    1716  virtual ~OBJModel();
    1817  void initializeOBJ(void);
     
    2827  bool readFromObjFile (void);
    2928  bool readMtlLib (char* matFile);
    30 
    3129};
    3230
  • orxonox/trunk/src/lib/graphics/importer/texture.cc

    r3622 r3655  
    131131
    132132/**
     133   \brief Constructor for a Texture
     134*/
     135Texture::Texture(const char* imageName)
     136{
     137  this->pImage = new Image;
     138  this->pImage->data = NULL;
     139  this->map = NULL;
     140  this->texture = 0;
     141  this->loadImage(imageName);
     142
     143
     144/**
    133145   \brief Destructor of a Texture
    134146   
     
    149161   \returns pathName+texName if texName was found in the pathList. NULL if the Texture is not found.
    150162*/
    151 char* Texture::searchTextureInPaths(char* texName) const
     163char* Texture::searchTextureInPaths(const char* texName) const
    152164{
    153165  char* tmpName = NULL;
     
    215227
    216228#ifdef HAVE_SDL_SDL_IMAGE_H
    217 bool Texture::loadImage(char* imageName)
     229bool Texture::loadImage(const char* imageName)
    218230{
    219231  if (GraphicsEngine::texturesEnabled)
     
    269281   \todo Checks where to find the Image
    270282*/
    271 bool Texture::loadImage(char* imageName)
     283bool Texture::loadImage(const char* imageName)
    272284{
    273285  if (GraphicsEngine::texturesEnabled)
  • orxonox/trunk/src/lib/graphics/importer/texture.h

    r3548 r3655  
    7070  GLuint texture;   //!< The Texture-ID of opengl from this Texture.
    7171  SDL_Surface* map; //!< The map SDL initializes for this element.
    72   char* searchTextureInPaths(char* texName) const;
     72  char* searchTextureInPaths(const char* texName) const;
    7373  inline void swap(unsigned char &a, unsigned char &b);
    7474 public:
    7575  Texture(void);
     76  Texture(const char* imageName);
    7677  ~Texture(void);
    7778  /** \returns The textureID of this texture.  */
     
    7980  bool loadTexToGL (Image* pImage);
    8081
    81   bool loadImage(char* imageName);
     82  bool loadImage(const char* imageName);
    8283#ifndef HAVE_SDL_SDL_IMAGE_H
    8384
Note: See TracChangeset for help on using the changeset viewer.