Changeset 9785 in orxonox.OLD for branches/new_class_id/src/lib/graphics
- Timestamp:
- Sep 22, 2006, 3:40:06 PM (18 years ago)
- Location:
- branches/new_class_id/src/lib/graphics/importer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new_class_id/src/lib/graphics/importer/material.cc
r9718 r9785 25 25 #include "loading/load_param.h" 26 26 27 #include "util/loading/resource_manager.h" 27 #include "resource_texture.h" 28 //#include "util/loading/resource_manager.h" 28 29 29 30 ObjectListDefinition(Material); … … 91 92 { 92 93 PRINTF(5)("delete Material %s.\n", this->getCName()); 93 94 if (this->ambientTexture != NULL)95 ResourceManager::getInstance()->unload(this->ambientTexture);96 if (this->specularTexture != NULL)97 ResourceManager::getInstance()->unload(this->specularTexture);98 94 99 95 if (this == Material::selectedMaterial) … … 297 293 void Material::addTexturePath(const std::string& pathName) 298 294 { 299 ResourceManager::getInstance()->addImageDir(pathName); 295 printf("HUPS\n"); 296 //ResourceManager::getInstance()->addImageDir(pathName); 300 297 } 301 298 … … 351 348 if (!dMap.empty()) 352 349 { 353 Texture* tex = dynamic_cast<Texture*>(ResourceManager::getInstance()->load(dMap, IMAGE, RP_GAME, (int)target)); 354 if (tex != NULL) 355 this->textures[textureNumber] = *tex; 350 this->textures[textureNumber] = ResourceTexture(dMap); 351 //dynamic_cast<Texture*>(ResourceManager::getInstance()->load(dMap, IMAGE, RP_GAME, (int)target)); 352 /* if (tex != NULL) 353 this->textures[textureNumber] = tex; 356 354 else 357 this->textures[textureNumber] = Texture(); 355 this->textures[textureNumber] = Texture();*/ 358 356 } 359 357 else -
branches/new_class_id/src/lib/graphics/importer/resource_texture.cc
r9784 r9785 6 6 7 7 ResourceTexture::ResourceTexture(const std::string& imageName, GLenum target) 8 : Resource(&ResourceTexture::type) 8 9 { 9 Resource::Pointer* ptr = this->acquireResource( ResourceTexture::type,imageName + ',' + "TEST");10 Resource::Pointer* ptr = this->acquireResource(imageName + ',' + "TEST"); 10 11 11 12 if (ptr) … … 13 14 else 14 15 { 15 this->loadImage(imageName, target); 16 std::string fileName = this->Resource::locateFile(imageName); 17 this->Texture::loadImage(fileName, target); 18 this->Resource::addResource(new ResourceTexture::TextureResourcePointer(imageName + ',' + "TEST", KeepLevel(), this->Texture::dataPointer())); 16 19 } 17 20 } … … 24 27 25 28 26 ResourceTexture::TextureResourcePointer::TextureResourcePointer(const std::string& loadString, const Resource::KeepLevel& keepLevel, TextureData*data)29 ResourceTexture::TextureResourcePointer::TextureResourcePointer(const std::string& loadString, const Resource::KeepLevel& keepLevel, const TextureData::Pointer& data) 27 30 : Resource::Pointer(loadString, keepLevel) , pointer(data) 28 { 29 } 31 {} 30 32 31 33 -
branches/new_class_id/src/lib/graphics/importer/resource_texture.h
r9784 r9785 14 14 class ResourceTexture : public Texture, public Resource 15 15 { 16 public: 16 17 ResourceTexture(const std::string& imageName, GLenum target = GL_TEXTURE_2D); 17 18 18 19 19 20 private: 20 21 class TextureResourcePointer : public Resource::Pointer 21 22 { 22 23 public: 23 TextureResourcePointer(const std::string& loadString, const Resource::KeepLevel& keepLevel, TextureData*data);24 TextureResourcePointer(const std::string& loadString, const Resource::KeepLevel& keepLevel, const TextureData::Pointer& data); 24 25 inline const TextureData::Pointer& ptr() const { return pointer; } 25 26 private: … … 27 28 }; 28 29 29 30 30 private: 31 static Resource::Type type; 31 32 }; 32 33
Note: See TracChangeset
for help on using the changeset viewer.