VFont.cpp (pymol-v1.8.6.0.tar.bz2) | : | VFont.cpp (pymol-v2.1.0.tar.bz2) | ||
---|---|---|---|---|
skipping to change at line 58 | skipping to change at line 58 | |||
for(a = 0; a <= VFONT_MASK; a++) { | for(a = 0; a <= VFONT_MASK; a++) { | |||
I->advance[a] = 0.0F; | I->advance[a] = 0.0F; | |||
I->offset[a] = -1; | I->offset[a] = -1; | |||
} | } | |||
I->pen = VLAlloc(float, 1000); | I->pen = VLAlloc(float, 1000); | |||
return (I); | return (I); | |||
} | } | |||
//#endif | //#endif | |||
int VFontWriteToCGO(PyMOLGlobals * G, int font_id, CGO * cgo, | int VFontWriteToCGO(PyMOLGlobals * G, int font_id, CGO * cgo, | |||
const char *text, float *pos, float *scale, float *matrix) | const char *text, float *pos, float *scale, float *matrix, f loat *color) | |||
{ | { | |||
CVFont *I = G->VFont; | CVFont *I = G->VFont; | |||
VFontRec *fr = NULL; | VFontRec *fr = NULL; | |||
int ok = true; | int ok = true; | |||
float base[3], pen[3]; | float base[3], pen[3]; | |||
float *pc; | float *pc; | |||
unsigned char c; | unsigned char c; | |||
int drawing, stroke; | int drawing, stroke; | |||
float *cgo_verts, *tmp_ptr; | float *cgo_verts, *tmp_ptr; | |||
ov_diff offset; | ov_diff offset; | |||
skipping to change at line 98 | skipping to change at line 98 | |||
pen[0] = (*(pc++)) * scale[0]; | pen[0] = (*(pc++)) * scale[0]; | |||
pen[1] = (*(pc++)) * scale[1]; | pen[1] = (*(pc++)) * scale[1]; | |||
pen[2] = 0.0; | pen[2] = 0.0; | |||
if(matrix) | if(matrix) | |||
transform33f3f(matrix, pen, pen); | transform33f3f(matrix, pen, pen); | |||
add3f(base, pen, pen); | add3f(base, pen, pen); | |||
if(stroke) { | if(stroke) { | |||
CGOEnd(cgo); | CGOEnd(cgo); | |||
} | } | |||
CGOBegin(cgo, GL_LINE_STRIP); | CGOBegin(cgo, GL_LINE_STRIP); | |||
if (color) | ||||
CGOColorv(cgo, color); | ||||
CGOVertexv(cgo, pen); | CGOVertexv(cgo, pen); | |||
stroke = true; | stroke = true; | |||
break; | break; | |||
case 1: /* drawto */ | case 1: /* drawto */ | |||
pen[0] = (*(pc++)) * scale[0]; | pen[0] = (*(pc++)) * scale[0]; | |||
pen[1] = (*(pc++)) * scale[1]; | pen[1] = (*(pc++)) * scale[1]; | |||
pen[2] = 0.0; | pen[2] = 0.0; | |||
if(matrix) | if(matrix) | |||
transform33f3f(matrix, pen, pen); | transform33f3f(matrix, pen, pen); | |||
add3f(base, pen, pen); | add3f(base, pen, pen); | |||
skipping to change at line 144 | skipping to change at line 146 | |||
} | } | |||
return (ok); | return (ok); | |||
} | } | |||
int VFontIndent(PyMOLGlobals * G, int font_id, const char *text, float *pos, flo at *scale, | int VFontIndent(PyMOLGlobals * G, int font_id, const char *text, float *pos, flo at *scale, | |||
float *matrix, float dir) | float *matrix, float dir) | |||
{ | { | |||
CVFont *I = G->VFont; | CVFont *I = G->VFont; | |||
VFontRec *fr = NULL; | VFontRec *fr = NULL; | |||
int ok = true; | int ok = true; | |||
float base[3], pen[3]; | float pen[3]; | |||
float *pc; | ||||
unsigned char c; | unsigned char c; | |||
ov_diff offset; | ov_diff offset; | |||
if((font_id > 0) && (font_id <= I->NFont)) { | if((font_id > 0) && (font_id <= I->NFont)) { | |||
fr = I->Font[font_id]; | fr = I->Font[font_id]; | |||
if(fr) | if(fr) | |||
while(1) { | while(1) { | |||
c = *(text++); | c = *(text++); | |||
if(!c) | if(!c) | |||
break; | break; | |||
offset = fr->offset[c]; | offset = fr->offset[c]; | |||
if(offset >= 0) { | if(offset >= 0) { | |||
pc = fr->pen + offset; | ||||
copy3f(pos, base); | ||||
pen[0] = fr->advance[c] * scale[0] * dir; | pen[0] = fr->advance[c] * scale[0] * dir; | |||
pen[1] = 0.0; | pen[1] = 0.0; | |||
pen[2] = 0.0; | pen[2] = 0.0; | |||
if(matrix) | if(matrix) | |||
transform33f3f(matrix, pen, pen); | transform33f3f(matrix, pen, pen); | |||
add3f(pen, pos, pos); | add3f(pen, pos, pos); | |||
} | } | |||
} | } | |||
} else { | } else { | |||
PRINTFB(G, FB_VFont, FB_Errors) | PRINTFB(G, FB_VFont, FB_Errors) | |||
End of changes. 4 change blocks. | ||||
5 lines changed or deleted | 4 lines changed or added |