Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 22, 2006, 12:19:51 AM (18 years ago)
Author:
bensch
Message:

orxonox/new_class_id: new Resources stuff

Location:
branches/new_class_id/src/lib/graphics/importer
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/new_class_id/src/lib/graphics/importer/resource_texture.cc

    r9781 r9784  
    55
    66
     7ResourceTexture::ResourceTexture(const std::string& imageName, GLenum target)
     8{
     9  Resource::Pointer* ptr = this->acquireResource(ResourceTexture::type, imageName + ',' + "TEST");
    710
    8 ResourceTexture::TextureResourcePointer::TextureResourcePointer(TextureData* data)
    9 {
    10   this->pointer = new TextureData::Pointer(data);
     11  if (ptr)
     12    this->acquireData(static_cast<ResourceTexture::TextureResourcePointer*>(ptr)->ptr());
     13  else
     14  {
     15    this->loadImage(imageName, target);
     16  }
    1117}
    1218
    1319
    1420Resource::Type ResourceTexture::type(Texture::staticClassID());
     21
     22
     23
     24
     25
     26ResourceTexture::TextureResourcePointer::TextureResourcePointer(const std::string& loadString, const Resource::KeepLevel& keepLevel, TextureData* data)
     27    : Resource::Pointer(loadString, keepLevel) , pointer(data)
     28{
     29}
     30
     31
  • branches/new_class_id/src/lib/graphics/importer/resource_texture.h

    r9781 r9784  
    1818
    1919private:
    20   class TextureResourcePointer
     20  class TextureResourcePointer : public Resource::Pointer
    2121  {
    2222  public:
    23     TextureResourcePointer(TextureData* data);
     23    TextureResourcePointer(const std::string& loadString, const Resource::KeepLevel& keepLevel, TextureData* data);
     24    inline const TextureData::Pointer& ptr() const { return pointer; }
    2425  private:
    25     TextureData::Pointer* pointer;
     26    TextureData::Pointer pointer;
    2627  };
    2728
  • branches/new_class_id/src/lib/graphics/importer/texture.h

    r9719 r9784  
    3030  Texture& operator=(const Texture& texture);
    3131  Texture& operator=(const TextureData::Pointer& textureDataPointer);
     32  void acquireData(const TextureData::Pointer& textureDataPointer) { this->data = textureDataPointer; };
     33  const TextureData::Pointer& dataPointer() const { return data; }
    3234
    3335  virtual ~Texture();
Note: See TracChangeset for help on using the changeset viewer.