Skip to content
This repository
Browse code

Fix bbutil render_text indices (saves memory).

  • Loading branch information...
commit aec2bbf95de218e45e914b9e678e6c46e897cc68 1 parent dbdc977
Marc Lepage authored May 30, 2012 anhu committed July 27, 2012
4  CubeRotate/bbutil.c
@@ -483,7 +483,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
483 483
     int i, c;
484 484
     GLfloat *vertices;
485 485
     GLfloat *texture_coords;
486  
-    GLshort* indices;
  486
+    GLushort* indices;
487 487
 
488 488
     float pen_x = 0.0f;
489 489
 
@@ -506,7 +506,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
506 506
     vertices = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
507 507
     texture_coords = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
508 508
 
509  
-    indices = (GLshort*) malloc(sizeof(GLfloat) * 6 * msg_len);
  509
+    indices = (GLushort*) malloc(sizeof(GLushort) * 6 * msg_len);
510 510
 
511 511
     for(i = 0; i < msg_len; ++i) {
512 512
         c = msg[i];
4  FallingBlocks/bbutil.c
@@ -483,7 +483,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
483 483
     int i, c;
484 484
     GLfloat *vertices;
485 485
     GLfloat *texture_coords;
486  
-    GLshort* indices;
  486
+    GLushort* indices;
487 487
 
488 488
     float pen_x = 0.0f;
489 489
 
@@ -506,7 +506,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
506 506
     vertices = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
507 507
     texture_coords = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
508 508
 
509  
-    indices = (GLshort*) malloc(sizeof(GLfloat) * 6 * msg_len);
  509
+    indices = (GLushort*) malloc(sizeof(GLushort) * 6 * msg_len);
510 510
 
511 511
     for(i = 0; i < msg_len; ++i) {
512 512
         c = msg[i];
4  GLES11Template/bbutil.c
@@ -483,7 +483,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
483 483
     int i, c;
484 484
     GLfloat *vertices;
485 485
     GLfloat *texture_coords;
486  
-    GLshort* indices;
  486
+    GLushort* indices;
487 487
 
488 488
     float pen_x = 0.0f;
489 489
 
@@ -506,7 +506,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
506 506
     vertices = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
507 507
     texture_coords = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
508 508
 
509  
-    indices = (GLshort*) malloc(sizeof(GLfloat) * 6 * msg_len);
  509
+    indices = (GLushort*) malloc(sizeof(GLushort) * 6 * msg_len);
510 510
 
511 511
     for(i = 0; i < msg_len; ++i) {
512 512
         c = msg[i];
4  GLES20Template/bbutil.c
@@ -483,7 +483,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
483 483
     int i, c;
484 484
     GLfloat *vertices;
485 485
     GLfloat *texture_coords;
486  
-    GLshort* indices;
  486
+    GLushort* indices;
487 487
 
488 488
     float pen_x = 0.0f;
489 489
 
@@ -506,7 +506,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
506 506
     vertices = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
507 507
     texture_coords = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
508 508
 
509  
-    indices = (GLshort*) malloc(sizeof(GLfloat) * 6 * msg_len);
  509
+    indices = (GLushort*) malloc(sizeof(GLushort) * 6 * msg_len);
510 510
 
511 511
     for(i = 0; i < msg_len; ++i) {
512 512
         c = msg[i];
4  GoodCitizen/bbutil.c
@@ -483,7 +483,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
483 483
     int i, c;
484 484
     GLfloat *vertices;
485 485
     GLfloat *texture_coords;
486  
-    GLshort* indices;
  486
+    GLushort* indices;
487 487
 
488 488
     float pen_x = 0.0f;
489 489
 
@@ -506,7 +506,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
506 506
     vertices = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
507 507
     texture_coords = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
508 508
 
509  
-    indices = (GLshort*) malloc(sizeof(GLfloat) * 6 * msg_len);
  509
+    indices = (GLushort*) malloc(sizeof(GLushort) * 6 * msg_len);
510 510
 
511 511
     for(i = 0; i < msg_len; ++i) {
512 512
         c = msg[i];
4  HelloWorldDisplay/bbutil.c
@@ -483,7 +483,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
483 483
     int i, c;
484 484
     GLfloat *vertices;
485 485
     GLfloat *texture_coords;
486  
-    GLshort* indices;
  486
+    GLushort* indices;
487 487
 
488 488
     float pen_x = 0.0f;
489 489
 
@@ -506,7 +506,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
506 506
     vertices = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
507 507
     texture_coords = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
508 508
 
509  
-    indices = (GLshort*) malloc(sizeof(GLfloat) * 6 * msg_len);
  509
+    indices = (GLushort*) malloc(sizeof(GLushort) * 6 * msg_len);
510 510
 
511 511
     for(i = 0; i < msg_len; ++i) {
512 512
         c = msg[i];
4  Keyboard/bbutil.c
@@ -483,7 +483,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
483 483
     int i, c;
484 484
     GLfloat *vertices;
485 485
     GLfloat *texture_coords;
486  
-    GLshort* indices;
  486
+    GLushort* indices;
487 487
 
488 488
     float pen_x = 0.0f;
489 489
 
@@ -506,7 +506,7 @@ void bbutil_render_text(font_t* font, const char* msg, float x, float y, float r
506 506
     vertices = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
507 507
     texture_coords = (GLfloat*) malloc(sizeof(GLfloat) * 8 * msg_len);
508 508
 
509  
-    indices = (GLshort*) malloc(sizeof(GLfloat) * 6 * msg_len);
  509
+    indices = (GLushort*) malloc(sizeof(GLushort) * 6 * msg_len);
510 510
 
511 511
     for(i = 0; i < msg_len; ++i) {
512 512
         c = msg[i];

0 notes on commit aec2bbf

Please sign in to comment.
Something went wrong with that request. Please try again.