Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 167 vs 168 for /trunk/Source Code/Core/Resources/ConcreteLoaders/TextureLoaderImpl.cpp

Diff revisions: vs.
  @@ -1,7 +1,10 @@
1 1 #include "Core/Resources/Headers/ResourceLoader.h"
2 2 #include "Core/Resources/Headers/ResourceCache.h"
3 - #include "Hardware/Video/Textures/Headers/Texture.h"
3 +
4 4 #include "Hardware/Video/Headers/GFXDevice.h"
5 + #include "Hardware/Video/Textures/Headers/Texture.h"
6 + #include "Hardware/Video/Textures/Headers/TextureDescriptor.h"
7 +
5 8
6 9 Texture* ImplResourceLoader<Texture>::operator()(){
7 10 Texture* ptr = NULL;
  @@ -11,15 +14,16 @@
11 14 }else{
12 15 ptr = GFX_DEVICE.newTexture2D(_descriptor.getFlag());
13 16 }
17 +
14 18 ptr->enableThreadedLoading(_descriptor.getThreaded());
15 - if(_descriptor.getMask().b.b0 == 1){ //disable mip-maps
16 - ptr->enableGenerateMipmaps(false);
17 - }else{
18 - if(_descriptor.getId() != RAND_MAX){
19 - ptr->setAnisotrophyLevel(_descriptor.getId());
20 - }
21 - }
22 19
20 + //Add the specified sampler, if any o
21 + if(_descriptor.hasPropertyDescriptor()){
22 + //cast back to a SamplerDescriptor from a PropertyDescriptor
23 + const SamplerDescriptor* sampler = dynamic_cast<const SamplerDescriptor*>(_descriptor.getPropertyDescriptor<SamplerDescriptor>());
24 + ptr->setCurrentSampler(*sampler);
25 + }
26 +
23 27 if(!load(ptr,_descriptor.getResourceLocation())){
24 28 ERROR_FN(Locale::get("ERROR_TEXTURE_LOADER_FILE"),_descriptor.getResourceLocation().c_str(), _descriptor.getName().c_str());
25 29 SAFE_DELETE(ptr)