Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 9847 in orxonox.OLD for branches


Ignore:
Timestamp:
Sep 27, 2006, 11:25:43 PM (18 years ago)
Author:
bensch
Message:

renamed NewResource to Resource

Location:
branches/new_class_id/src/lib
Files:
14 edited

Legend:

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

    r9825 r9847  
    77
    88ResourceMD2::ResourceMD2(const std::string& modelName, const std::string& skinName, float scale)
    9     : NewResource(&ResourceMD2::type)
     9    : Resource(&ResourceMD2::type)
    1010{
    1111  Resources::StorePointer* ptr = this->acquireResource(loadString(modelName, skinName, scale));
     
    1919  {
    2020    PRINTF(0)("NOT FOUND MD2: %s\n", modelName.c_str());
    21     std::string modelFileName = this->NewResource::locateFile(modelName);
    22     //std::string skinFileName = this->NewResource::locateFile(skinName);
     21    std::string modelFileName = this->Resource::locateFile(modelName);
     22    //std::string skinFileName = this->Resource::locateFile(skinName);
    2323    this->MD2Model::load(modelFileName, skinName, scale);
    24     this->NewResource::addResource(new ResourceMD2::MD2ResourcePointer(loadString(modelName, skinName, scale), Resources::KeepLevel(0), this->MD2Model::dataPointer()));
     24    this->Resource::addResource(new ResourceMD2::MD2ResourcePointer(loadString(modelName, skinName, scale), Resources::KeepLevel(0), this->MD2Model::dataPointer()));
    2525  }
    2626
  • branches/new_class_id/src/lib/graphics/importer/md2/resource_md2.h

    r9846 r9847  
    1212
    1313
    14 class ResourceMD2 : public MD2Model, public Resources::NewResource
     14class ResourceMD2 : public MD2Model, public Resources::Resource
    1515{
    1616public:
  • branches/new_class_id/src/lib/graphics/importer/resource_obj.cc

    r9831 r9847  
    77
    88ResourceOBJ::ResourceOBJ(const std::string& imageName, float scaling)
    9     : NewResource(&ResourceOBJ::type)
     9    : Resource(&ResourceOBJ::type)
    1010{
    1111  Resources::StorePointer* ptr = this->acquireResource(imageName + ',' + MultiType(scaling).getString());
     
    1919  {
    2020    PRINTF(5)("NOT FOUND OBJ: %s\n", imageName.c_str());
    21     std::string fileName = this->NewResource::locateFile(imageName);
     21    std::string fileName = this->Resource::locateFile(imageName);
    2222    this->acquireData(OBJModel(fileName, scaling).dataPointer());
    23     this->NewResource::addResource(new ResourceOBJ::OBJResourcePointer(imageName + ',' + MultiType(scaling).getString(), Resources::KeepLevel(0), this->StaticModel::dataPointer()));
     23    this->Resource::addResource(new ResourceOBJ::OBJResourcePointer(imageName + ',' + MultiType(scaling).getString(), Resources::KeepLevel(0), this->StaticModel::dataPointer()));
    2424  }
    2525}
  • branches/new_class_id/src/lib/graphics/importer/resource_obj.h

    r9846 r9847  
    1111#include "objModel.h"
    1212
    13 class ResourceOBJ : public StaticModel, public Resources::NewResource
     13class ResourceOBJ : public StaticModel, public Resources::Resource
    1414{
    1515public:
  • branches/new_class_id/src/lib/graphics/importer/resource_texture.cc

    r9842 r9847  
    77
    88ResourceTexture::ResourceTexture(const std::string& imageName, GLenum target)
    9     : NewResource(&ResourceTexture::type)
     9    : Resource(&ResourceTexture::type)
    1010{
    1111  Resources::StorePointer* ptr = this->acquireResource(imageName + ',' + MultiType((int)target).getString());
     
    1919  {
    2020    PRINTF(5)("NOT FOUND TEXTURE: %s\n", imageName.c_str());
    21     std::string fileName = this->NewResource::locateFile(imageName);
     21    std::string fileName = this->Resource::locateFile(imageName);
    2222    this->Texture::loadImage(fileName, target);
    23     this->NewResource::addResource(new ResourceTexture::TextureResourcePointer(imageName + ',' + MultiType((int)target).getString(), Resources::KeepLevel(0), this->Texture::dataPointer()));
     23    this->Resource::addResource(new ResourceTexture::TextureResourcePointer(imageName + ',' + MultiType((int)target).getString(), Resources::KeepLevel(0), this->Texture::dataPointer()));
    2424  }
    2525}
  • branches/new_class_id/src/lib/graphics/importer/resource_texture.h

    r9846 r9847  
    1212
    1313
    14 class ResourceTexture : public Texture, public Resources::NewResource
     14class ResourceTexture : public Texture, public Resources::Resource
    1515{
    1616public:
  • branches/new_class_id/src/lib/graphics/resource_shader.cc

    r9823 r9847  
    55
    66ResourceShader::ResourceShader(const std::string& vertexShaderName, const std::string& fragmentShaderName)
    7     : NewResource(&ResourceShader::type)
     7    : Resource(&ResourceShader::type)
    88{
    99  Resources::StorePointer* ptr = this->acquireResource(vertexShaderName +','+fragmentShaderName);
     
    1717  {
    1818    PRINTF(5)("NOT FOUND SHADER: %s\n", vertexShaderName.c_str());
    19     std::string vertexFileName = this->NewResource::locateFile(vertexShaderName);
     19    std::string vertexFileName = this->Resource::locateFile(vertexShaderName);
    2020    std::string fragmentFileName;
    2121    if (!fragmentShaderName.empty())
    22       fragmentFileName = this->NewResource::locateFile(fragmentShaderName);
     22      fragmentFileName = this->Resource::locateFile(fragmentShaderName);
    2323
    2424    this->Shader::load(vertexFileName, fragmentFileName);
    25     this->NewResource::addResource(new ResourceShader::ShaderResourcePointer(vertexShaderName+','+fragmentShaderName, Resources::KeepLevel(0), this->Shader::dataPointer()));
     25    this->Resource::addResource(new ResourceShader::ShaderResourcePointer(vertexShaderName+','+fragmentShaderName, Resources::KeepLevel(0), this->Shader::dataPointer()));
    2626  }
    2727}
  • branches/new_class_id/src/lib/graphics/resource_shader.h

    r9846 r9847  
    1212
    1313
    14 class ResourceShader : public Shader, public Resources::NewResource
     14class ResourceShader : public Shader, public Resources::Resource
    1515{
    1616public:
  • branches/new_class_id/src/lib/graphics/text_engine/resource_font.cc

    r9839 r9847  
    77
    88ResourceFont::ResourceFont(const std::string& fontName, unsigned int renderSize)
    9   : Font(), NewResource(&ResourceFont::type)
     9  : Font(), Resource(&ResourceFont::type)
    1010{
    1111  assert(!fontName.empty());
     
    2020  {
    2121    PRINTF(5)("NOT FOUND FONT: %s\n", fontName.c_str());
    22     std::string fileName = this->NewResource::locateFile(fontName);
     22    std::string fileName = this->Resource::locateFile(fontName);
    2323
    2424    printf("FONTFILE %s TO %s\n", fontName.c_str(), fileName.c_str());
    2525
    2626    this->Font::loadFontFromTTF(fileName, renderSize);
    27     this->NewResource::addResource(new ResourceFont::FontResourcePointer(fontName + ',' + MultiType((int)renderSize).getString(), Resources::KeepLevel(0), this->Font::dataPointer()));
     27    this->Resource::addResource(new ResourceFont::FontResourcePointer(fontName + ',' + MultiType((int)renderSize).getString(), Resources::KeepLevel(0), this->Font::dataPointer()));
    2828  }
    2929}
  • branches/new_class_id/src/lib/graphics/text_engine/resource_font.h

    r9846 r9847  
    1212
    1313
    14 class ResourceFont : public Font, public Resources::NewResource
     14class ResourceFont : public Font, public Resources::Resource
    1515{
    1616public:
  • branches/new_class_id/src/lib/sound/resource_sound_buffer.cc

    r9823 r9847  
    99
    1010  ResourceSoundBuffer::ResourceSoundBuffer(const std::string& soundName)
    11       : SoundBuffer(), NewResource(&ResourceSoundBuffer::type)
     11      : SoundBuffer(), Resource(&ResourceSoundBuffer::type)
    1212  {
    1313    this->registerObject(this, ResourceSoundBuffer::_objectList);
     
    2323    {
    2424      PRINTF(5)("SOUND NOT FOUND: %s\n", soundName.c_str());
    25       std::string fileName = this->NewResource::locateFile(soundName);
     25      std::string fileName = this->Resource::locateFile(soundName);
    2626      this->SoundBuffer::load(fileName);
    27       this->NewResource::addResource(new ResourceSoundBuffer::SoundBufferResourcePointer(soundName, Resources::KeepLevel(0), this->SoundBuffer::dataPointer()));
     27      this->Resource::addResource(new ResourceSoundBuffer::SoundBufferResourcePointer(soundName, Resources::KeepLevel(0), this->SoundBuffer::dataPointer()));
    2828    }
    2929  }
  • branches/new_class_id/src/lib/sound/resource_sound_buffer.h

    r9846 r9847  
    1313namespace OrxSound
    1414{
    15   class ResourceSoundBuffer : public SoundBuffer, public Resources::NewResource
     15  class ResourceSoundBuffer : public SoundBuffer, public Resources::Resource
    1616  {
    1717    ObjectListDeclaration(ResourceSoundBuffer);
  • branches/new_class_id/src/lib/util/loading/resource.cc

    r9846 r9847  
    2424namespace Resources
    2525{
    26   ObjectListDefinition(NewResource);
     26  ObjectListDefinition(Resource);
    2727
    2828
     
    3030   * standard constructor
    3131  */
    32   NewResource::NewResource (Type* type)
     32  Resource::Resource (Type* type)
    3333      : _pointer(NULL), _type(type)
    3434  {
    35     this->registerObject(this, NewResource::_objectList);
     35    this->registerObject(this, Resource::_objectList);
    3636  }
    3737
     
    3939   * standard deconstructor
    4040   */
    41   NewResource::~NewResource ()
     41  Resource::~Resource ()
    4242  {
    4343    // delete what has to be deleted here
     
    4545
    4646
    47   std::string NewResource::locateFile(const std::string& fileName) const
     47  std::string Resource::locateFile(const std::string& fileName) const
    4848  {
    4949    if ((ResourceManager::getInstance()->mainGlobalPath() + File(fileName)).exists() )
     
    6969   * @return true on success.
    7070   */
    71   std::string NewResource::locateFileInSubDir(const Directory& directory, const std::string& fileName) const
     71  std::string Resource::locateFileInSubDir(const Directory& directory, const std::string& fileName) const
    7272  {
    7373    std::vector<Directory>::const_iterator it;
     
    8484
    8585
    86   StorePointer* NewResource::acquireResource(const std::string& loadString)
     86  StorePointer* Resource::acquireResource(const std::string& loadString)
    8787  {
    8888    //const Type* const type = _resourceTypes[this->_type->id()];
     
    9898
    9999
    100   void NewResource::addResource(StorePointer* pointer)
     100  void Resource::addResource(StorePointer* pointer)
    101101  {
    102102    this->_type->addResource(pointer);
  • branches/new_class_id/src/lib/util/loading/resource.h

    r9846 r9847  
    11/*!
    22 * @file resource.h
    3  * @brief Definition of a NewResource.
     3 * @brief Definition of a Resource.
    44*/
    55
     
    130130
    131131
    132   //! A NewResource is an Object, that can be loaded from Disk
     132
     133
     134  //! A Resource is an Object, that can be loaded from Disk
    133135  /**
    134    * The NewResource Hanldes the location and stores pointers to data that can be retrieved.
     136   * The Resource Hanldes the location and stores pointers to data that can be retrieved.
    135137   */
    136   class NewResource : virtual public BaseObject
     138  class Resource : virtual public BaseObject
    137139  {
    138     ObjectListDeclaration(NewResource);
     140    ObjectListDeclaration(Resource);
    139141
    140142  public:
    141     NewResource(Resources::Type* type);
    142     virtual ~NewResource();
     143    Resource(Resources::Type* type);
     144    virtual ~Resource();
    143145
    144146    /** @brief reloads the underlying resource */
     
    158160  private:
    159161    Resources::StorePointer*       _pointer;                         //!< Virtual Pointer to the ResourceData.
    160     Resources::Type*               _type;                            //!< Type of the NewResource.
     162    Resources::Type*               _type;                            //!< Type of the Resource.
    161163  };
    162164}
Note: See TracChangeset for help on using the changeset viewer.