changeset 36245:081cb3fca68f

Use only one single texture.
author reimar
date Wed, 12 Jun 2013 18:54:19 +0000
parents ca4ce05e1930
children b474a1e925c0
files libvo/matrixview.c libvo/matrixview_font.h
diffstat 2 files changed, 9 insertions(+), 32 deletions(-) [+]
line wrap: on
line diff
--- a/libvo/matrixview.c	Wed Jun 12 18:54:18 2013 +0000
+++ b/libvo/matrixview.c	Wed Jun 12 18:54:19 2013 +0000
@@ -34,13 +34,6 @@
 static float matrix_contrast   = 1.5;
 static float matrix_brightness = 1.0;
 
-static const uint8_t flare[4][4] = {
-    {  0,   0,   0,   0},
-    {  0, 180,   0,   0},
-    {  0,   0,   0,   0},
-    {  0,   0,   0,   0}
-};
-
 #define MAX_TEXT_X 0x4000
 #define MAX_TEXT_Y 0x4000
 static int text_x = 0;
@@ -109,13 +102,13 @@
 {
     mpglColor4ub(204, 204, 204, 255);        // Basic polygon color
 
-    mpglTexCoord2f(0, 0);
+    mpglTexCoord2f(1.0 - 4.0/128, 1.0 - 4.0/64);
     mpglVertex3f(x - 1, y + 1, z);
-    mpglTexCoord2f(0.75, 0);
+    mpglTexCoord2f(1.0 - 1.0/128, 1.0 - 4.0/64);
     mpglVertex3f(x + 2, y + 1, z);
-    mpglTexCoord2f(0.75, 0.75);
+    mpglTexCoord2f(1.0 - 1.0/128, 1.0 - 1.0/64);
     mpglVertex3f(x + 2, y - 2, z);
-    mpglTexCoord2f(0, 0.75);
+    mpglTexCoord2f(1.0 - 4.0/128, 1.0 - 1.0/64);
     mpglVertex3f(x - 1, y - 2, z);
 }
 
@@ -248,17 +241,6 @@
                    font_texture);
     mpglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
     mpglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
-    mpglBindTexture(GL_TEXTURE_2D, 1);
-    mpglTexImage2D(GL_TEXTURE_2D, 0, 1, 4, 4, 0, GL_LUMINANCE, GL_UNSIGNED_BYTE,
-                   flare);
-    mpglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
-    mpglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
-
-    // Some pretty standard settings for wrapping and filtering.
-    mpglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT);
-    mpglTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT);
-    mpglBindTexture(GL_TEXTURE_2D, 0);
 }
 
 void matrixview_init(int w, int h)
@@ -308,13 +290,8 @@
     // OK, let's start drawing our planer quads.
     mpglBegin(GL_QUADS);
     draw_text(data);
-    mpglEnd();
-
-    mpglBindTexture(GL_TEXTURE_2D, 1);
-    mpglBegin(GL_QUADS);
     draw_flares();
     mpglEnd();
-    mpglBindTexture(GL_TEXTURE_2D, 0);
 
     make_change(currentTime);
 }
--- a/libvo/matrixview_font.h	Wed Jun 12 18:54:18 2013 +0000
+++ b/libvo/matrixview_font.h	Wed Jun 12 18:54:19 2013 +0000
@@ -563,7 +563,7 @@
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
-      5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5
+      5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   0,   0,   0,   0,   0
     }, {
       6,  25, 191, 220, 242, 255, 243, 222, 220, 221, 139,   5,   5,   5,  64, 246,
     244,  63,   7,   7,   6,   7,   6,   6,   8,   6,   6,   7,   6,  26, 211, 255,
@@ -572,7 +572,7 @@
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
-      5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5
+      5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   0,   0,   0,   0,   0
     }, {
       5,   9,  23,  27, 165, 255, 140,  26,  26,  26,  18,   5,   5,   5,   8, 111,
     245, 219,  57,   6,   6,   6,   5,   7,   7,   6,   6,   6,   6,   6,  52, 211,
@@ -581,7 +581,7 @@
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
-      5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5
+      5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   0,   0, 180,   0,   0
     }, {
       6,   6,   6,   6, 186, 255,  95,   5,   5,   5,   5,   5,   5,   5,   5,   8,
      73, 197, 236, 155,  88,  82,  44,   7,   6,   6,   7,   7,   6,   7,   6,  31,
@@ -590,7 +590,7 @@
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
-      5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5
+      5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   0,   0,   0,   0,   0
     }, {
       5,   6,   5,   8,  84, 107,  28,   5,   5,   5,   5,   5,   5,   5,   5,   6,
       5,  17,  52,  99, 103,  90,  35,   6,   5,   5,   6,   5,   6,   6,   6,   5,
@@ -599,7 +599,7 @@
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
       5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,
-      5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5
+      5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   0,   0,   0,   0,   0
     }
 };