- Timestamp:
- Sep 27, 2006, 11:25:43 PM (18 years ago)
- 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 7 7 8 8 ResourceMD2::ResourceMD2(const std::string& modelName, const std::string& skinName, float scale) 9 : NewResource(&ResourceMD2::type)9 : Resource(&ResourceMD2::type) 10 10 { 11 11 Resources::StorePointer* ptr = this->acquireResource(loadString(modelName, skinName, scale)); … … 19 19 { 20 20 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); 23 23 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())); 25 25 } 26 26 -
branches/new_class_id/src/lib/graphics/importer/md2/resource_md2.h
r9846 r9847 12 12 13 13 14 class ResourceMD2 : public MD2Model, public Resources:: NewResource14 class ResourceMD2 : public MD2Model, public Resources::Resource 15 15 { 16 16 public: -
branches/new_class_id/src/lib/graphics/importer/resource_obj.cc
r9831 r9847 7 7 8 8 ResourceOBJ::ResourceOBJ(const std::string& imageName, float scaling) 9 : NewResource(&ResourceOBJ::type)9 : Resource(&ResourceOBJ::type) 10 10 { 11 11 Resources::StorePointer* ptr = this->acquireResource(imageName + ',' + MultiType(scaling).getString()); … … 19 19 { 20 20 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); 22 22 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())); 24 24 } 25 25 } -
branches/new_class_id/src/lib/graphics/importer/resource_obj.h
r9846 r9847 11 11 #include "objModel.h" 12 12 13 class ResourceOBJ : public StaticModel, public Resources:: NewResource13 class ResourceOBJ : public StaticModel, public Resources::Resource 14 14 { 15 15 public: -
branches/new_class_id/src/lib/graphics/importer/resource_texture.cc
r9842 r9847 7 7 8 8 ResourceTexture::ResourceTexture(const std::string& imageName, GLenum target) 9 : NewResource(&ResourceTexture::type)9 : Resource(&ResourceTexture::type) 10 10 { 11 11 Resources::StorePointer* ptr = this->acquireResource(imageName + ',' + MultiType((int)target).getString()); … … 19 19 { 20 20 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); 22 22 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())); 24 24 } 25 25 } -
branches/new_class_id/src/lib/graphics/importer/resource_texture.h
r9846 r9847 12 12 13 13 14 class ResourceTexture : public Texture, public Resources:: NewResource14 class ResourceTexture : public Texture, public Resources::Resource 15 15 { 16 16 public: -
branches/new_class_id/src/lib/graphics/resource_shader.cc
r9823 r9847 5 5 6 6 ResourceShader::ResourceShader(const std::string& vertexShaderName, const std::string& fragmentShaderName) 7 : NewResource(&ResourceShader::type)7 : Resource(&ResourceShader::type) 8 8 { 9 9 Resources::StorePointer* ptr = this->acquireResource(vertexShaderName +','+fragmentShaderName); … … 17 17 { 18 18 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); 20 20 std::string fragmentFileName; 21 21 if (!fragmentShaderName.empty()) 22 fragmentFileName = this-> NewResource::locateFile(fragmentShaderName);22 fragmentFileName = this->Resource::locateFile(fragmentShaderName); 23 23 24 24 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())); 26 26 } 27 27 } -
branches/new_class_id/src/lib/graphics/resource_shader.h
r9846 r9847 12 12 13 13 14 class ResourceShader : public Shader, public Resources:: NewResource14 class ResourceShader : public Shader, public Resources::Resource 15 15 { 16 16 public: -
branches/new_class_id/src/lib/graphics/text_engine/resource_font.cc
r9839 r9847 7 7 8 8 ResourceFont::ResourceFont(const std::string& fontName, unsigned int renderSize) 9 : Font(), NewResource(&ResourceFont::type)9 : Font(), Resource(&ResourceFont::type) 10 10 { 11 11 assert(!fontName.empty()); … … 20 20 { 21 21 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); 23 23 24 24 printf("FONTFILE %s TO %s\n", fontName.c_str(), fileName.c_str()); 25 25 26 26 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())); 28 28 } 29 29 } -
branches/new_class_id/src/lib/graphics/text_engine/resource_font.h
r9846 r9847 12 12 13 13 14 class ResourceFont : public Font, public Resources:: NewResource14 class ResourceFont : public Font, public Resources::Resource 15 15 { 16 16 public: -
branches/new_class_id/src/lib/sound/resource_sound_buffer.cc
r9823 r9847 9 9 10 10 ResourceSoundBuffer::ResourceSoundBuffer(const std::string& soundName) 11 : SoundBuffer(), NewResource(&ResourceSoundBuffer::type)11 : SoundBuffer(), Resource(&ResourceSoundBuffer::type) 12 12 { 13 13 this->registerObject(this, ResourceSoundBuffer::_objectList); … … 23 23 { 24 24 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); 26 26 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())); 28 28 } 29 29 } -
branches/new_class_id/src/lib/sound/resource_sound_buffer.h
r9846 r9847 13 13 namespace OrxSound 14 14 { 15 class ResourceSoundBuffer : public SoundBuffer, public Resources:: NewResource15 class ResourceSoundBuffer : public SoundBuffer, public Resources::Resource 16 16 { 17 17 ObjectListDeclaration(ResourceSoundBuffer); -
branches/new_class_id/src/lib/util/loading/resource.cc
r9846 r9847 24 24 namespace Resources 25 25 { 26 ObjectListDefinition( NewResource);26 ObjectListDefinition(Resource); 27 27 28 28 … … 30 30 * standard constructor 31 31 */ 32 NewResource::NewResource (Type* type)32 Resource::Resource (Type* type) 33 33 : _pointer(NULL), _type(type) 34 34 { 35 this->registerObject(this, NewResource::_objectList);35 this->registerObject(this, Resource::_objectList); 36 36 } 37 37 … … 39 39 * standard deconstructor 40 40 */ 41 NewResource::~NewResource ()41 Resource::~Resource () 42 42 { 43 43 // delete what has to be deleted here … … 45 45 46 46 47 std::string NewResource::locateFile(const std::string& fileName) const47 std::string Resource::locateFile(const std::string& fileName) const 48 48 { 49 49 if ((ResourceManager::getInstance()->mainGlobalPath() + File(fileName)).exists() ) … … 69 69 * @return true on success. 70 70 */ 71 std::string NewResource::locateFileInSubDir(const Directory& directory, const std::string& fileName) const71 std::string Resource::locateFileInSubDir(const Directory& directory, const std::string& fileName) const 72 72 { 73 73 std::vector<Directory>::const_iterator it; … … 84 84 85 85 86 StorePointer* NewResource::acquireResource(const std::string& loadString)86 StorePointer* Resource::acquireResource(const std::string& loadString) 87 87 { 88 88 //const Type* const type = _resourceTypes[this->_type->id()]; … … 98 98 99 99 100 void NewResource::addResource(StorePointer* pointer)100 void Resource::addResource(StorePointer* pointer) 101 101 { 102 102 this->_type->addResource(pointer); -
branches/new_class_id/src/lib/util/loading/resource.h
r9846 r9847 1 1 /*! 2 2 * @file resource.h 3 * @brief Definition of a NewResource.3 * @brief Definition of a Resource. 4 4 */ 5 5 … … 130 130 131 131 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 133 135 /** 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. 135 137 */ 136 class NewResource : virtual public BaseObject138 class Resource : virtual public BaseObject 137 139 { 138 ObjectListDeclaration( NewResource);140 ObjectListDeclaration(Resource); 139 141 140 142 public: 141 NewResource(Resources::Type* type);142 virtual ~ NewResource();143 Resource(Resources::Type* type); 144 virtual ~Resource(); 143 145 144 146 /** @brief reloads the underlying resource */ … … 158 160 private: 159 161 Resources::StorePointer* _pointer; //!< Virtual Pointer to the ResourceData. 160 Resources::Type* _type; //!< Type of the NewResource.162 Resources::Type* _type; //!< Type of the Resource. 161 163 }; 162 164 }
Note: See TracChangeset
for help on using the changeset viewer.