usata-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Usata-commits] Changes to usata2/src/texture.cpp


From: David Lau
Subject: [Usata-commits] Changes to usata2/src/texture.cpp
Date: Thu, 20 Jan 2005 15:20:34 -0500

Index: usata2/src/texture.cpp
diff -u usata2/src/texture.cpp:1.10 usata2/src/texture.cpp:1.11
--- usata2/src/texture.cpp:1.10 Thu Jan 20 02:18:15 2005
+++ usata2/src/texture.cpp      Thu Jan 20 20:20:30 2005
@@ -10,19 +10,19 @@
 // included in the software distribution, or visit
 // http://www.fsf.org/licenses/gpl.html.
 //
-// $Id: texture.cpp,v 1.10 2005/01/20 02:18:15 skunix Exp $
+// $Id: texture.cpp,v 1.11 2005/01/20 20:20:30 skunix Exp $
 
 #include <boost/scoped_array.hpp>
 #include <boost/tuple/tuple.hpp>
 #include <boost/format.hpp>
 #include <boost/bind.hpp>
-
 #include <Magick++.h>
-
 #include <GL/glew.h>
 
 #include "texture.hpp"
 #include "texture-meta.hpp"
+//#include "config.hpp"
+#include "system.hpp"
 #include "log.hpp"
 
 namespace usata
@@ -98,8 +98,16 @@
                case Magick::GrayscaleMatteType:
                        Type=LUMA;mt="RA";
                        break;
+//             case Magick::ColorSeparationType
+               
+               case Magick::BilevelType:
+                       // dont ask, I dont know why not "RA"   
+                       // but that doesnt work
+                       Type=LUMA; mt= "AR";
+                       break;
+       
                default:
-                       throw std::runtime_error("Unsupported image pixel 
layout");
+                       throw std::runtime_error("Unsupported image pixel 
layout" );
        }
        Width = magick->columns();
        Height = magick->rows();
@@ -176,6 +184,8 @@
 void
 TextureMap::finish_load()
 {
+       using namespace system;
+       const video::Capabilities& vcap = video::get_capabilities();
        log::BufferedStream logstream(log::Level::DEBUG);
        if (! m_pixmap.get() )
                return;
@@ -183,6 +193,9 @@
        allocate_gltex();
 
        GLint  internal_gl_format = m_pixmap->type();
+       if (m_meta.compress)
+               internal_gl_format=vcap.compressed_format[m_pixmap->type()];
+       
 
        if (m_pixmap->height() == 1)
                        m_gl_texture_type = GL_TEXTURE_1D;




reply via email to

[Prev in Thread] Current Thread [Next in Thread]