/[gzz]/gzz/gfx/jni/GzzGL-jni.cxx
ViewVC logotype

Diff of /gzz/gfx/jni/GzzGL-jni.cxx

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.43 by tjl, Fri Oct 4 22:16:34 2002 UTC revision 1.44 by tjl, Sun Oct 6 17:37:46 2002 UTC
# Line 39  struct RealFont { Line 39  struct RealFont {
39     RealFont(Text::Font *f) : f(f) {     RealFont(Text::Font *f) : f(f) {
40         rend = new Renderables::TextRenderer(f);         rend = new Renderables::TextRenderer(f);
41     }     }
42     int getGlyphWidth(int c) { return rend->g.getGlyphWidth(c); }     float getGlyphWidth(int c) { return rend->g.getGlyphWidth(c); }
43  };  };
44    
45  typedef std::vector<GLubyte> ByteVector;  typedef std::vector<GLubyte> ByteVector;
# Line 671  JNIEXPORT void JNICALL Java_gzz_gfx_gl_G Line 671  JNIEXPORT void JNICALL Java_gzz_gfx_gl_G
671    }    }
672    
673  JNIEXPORT void JNICALL Java_gzz_gfx_gl_GL_putFontWidths  JNIEXPORT void JNICALL Java_gzz_gfx_gl_GL_putFontWidths
674   (JNIEnv *env, jclass, jint fontId, jshortArray widths) {   (JNIEnv *env, jclass, jint fontId, jfloatArray widths) {
675    
676       int arrayLength = env->GetArrayLength(widths);       int arrayLength = env->GetArrayLength(widths);
677       jshort *w = env->GetShortArrayElements(widths, 0);       jfloat *w = env->GetFloatArrayElements(widths, 0);
678       RealFont *font = fonts.get(fontId);       RealFont *font = fonts.get(fontId);
679    
680       for(int i=0; i<arrayLength; i++) {       for(int i=0; i<arrayLength; i++) {
681           w[i] = font->getGlyphWidth(i);           w[i] = font->getGlyphWidth(i);
682       }       }
683    
684       env->ReleaseShortArrayElements(widths, w, 0);       env->ReleaseFloatArrayElements(widths, w, 0);
685   }   }
686    
687    

Legend:
Removed from v.1.43  
changed lines
  Added in v.1.44

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26