Browse Source

file texture were not really linear

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

+ 6 - 2
rendering/FileTexture.cpp

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

+ 3 - 1
rendering/FileTexture.h

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