Browse Source

file textures can be linear

Kajetan Johannes Hammerle 3 years ago
parent
commit
3a2a155e60
2 changed files with 3 additions and 3 deletions
  1. 2 2
      rendering/FileTexture.cpp
  2. 1 1
      rendering/FileTexture.h

+ 2 - 2
rendering/FileTexture.cpp

@@ -2,7 +2,7 @@
 #include "images/PNGReader.h"
 #include "utils/List.h"
 
-FileTexture::FileTexture(const char* path, int maxMipMaps)
+FileTexture::FileTexture(const char* path, int maxMipMaps, bool linear)
     : texture(maxMipMaps) {
     PNGReader png(path);
     if(png.hasError()) {
@@ -11,7 +11,7 @@ FileTexture::FileTexture(const char* path, int maxMipMaps)
     List<ColorChannel> buffer;
     buffer.resize(png.getBufferSize());
     if(!png.readData(buffer.begin())) {
-        texture.setFormat(TextureFormat::color8(png.getChannels()));
+        texture.setFormat(TextureFormat::color8(png.getChannels(), linear));
         texture.setData(png.getWidth(), png.getHeight(), buffer.begin());
     }
 }

+ 1 - 1
rendering/FileTexture.h

@@ -7,7 +7,7 @@ class FileTexture final {
     Texture texture;
 
 public:
-    FileTexture(const char* path, int maxMipMaps = 0);
+    FileTexture(const char* path, int maxMipMaps = 0, bool linear = false);
 
     void bindTo(int index) const;
 };