RepDistLabel.cpp (pymol-open-source-2.2.0) | : | RepDistLabel.cpp (pymol-open-source-2.3.0) | ||
---|---|---|---|---|
skipping to change at line 57 | skipping to change at line 57 | |||
DistSet *ds; | DistSet *ds; | |||
int OutlineColor; | int OutlineColor; | |||
CGO *shaderCGO; | CGO *shaderCGO; | |||
int texture_font_size; | int texture_font_size; | |||
} RepDistLabel; | } RepDistLabel; | |||
#define SHADERCGO I->shaderCGO | #define SHADERCGO I->shaderCGO | |||
#include"ObjectDist.h" | #include"ObjectDist.h" | |||
void RepDistLabelFree(RepDistLabel * I); | static | |||
void RepDistLabelFree(RepDistLabel * I) | void RepDistLabelFree(RepDistLabel * I) | |||
{ | { | |||
if (I->shaderCGO){ | if (I->shaderCGO){ | |||
CGOFree(I->shaderCGO); | CGOFree(I->shaderCGO); | |||
} | } | |||
VLAFreeP(I->V); | VLAFreeP(I->V); | |||
VLAFreeP(I->L); | VLAFreeP(I->L); | |||
RepPurge(&I->R); | RepPurge(&I->R); | |||
OOFreeP(I); | OOFreeP(I); | |||
} | } | |||
static void RepDistLabelRender(RepDistLabel * I, RenderInfo * info) | static void RepDistLabelRender(RepDistLabel * I, RenderInfo * info) | |||
{ | { | |||
CRay *ray = info->ray; | CRay *ray = info->ray; | |||
Picking **pick = info->pick; | auto pick = info->pick; | |||
PyMOLGlobals *G = I->R.G; | PyMOLGlobals *G = I->R.G; | |||
float *v = I->V; | float *v = I->V; | |||
int c = I->N; | int c = I->N; | |||
DistLabel *l = I->L; | DistLabel *l = I->L; | |||
int n = 0; | int n = 0; | |||
int color; | int color; | |||
int font_id = SettingGet_i(G, NULL, I->Obj->Setting, cSetting_label_font_id); | int font_id = SettingGet_i(G, NULL, I->Obj->Setting, cSetting_label_font_id); | |||
float font_size = SettingGet_f(G, NULL, I->Obj->Setting, cSetting_label_size); | float font_size = SettingGet_f(G, NULL, I->Obj->Setting, cSetting_label_size); | |||
int float_text = SettingGet_i(G, NULL, I->Obj->Setting, cSetting_float_labels) ; | int float_text = SettingGet_i(G, NULL, I->Obj->Setting, cSetting_float_labels) ; | |||
int ok = true; | int ok = true; | |||
skipping to change at line 127 | skipping to change at line 126 | |||
CGORenderGLPicking(I->shaderCGO, info, &I->R.context, NULL, NULL); | CGORenderGLPicking(I->shaderCGO, info, &I->R.context, NULL, NULL); | |||
if(float_text) | if(float_text) | |||
glEnable(GL_DEPTH_TEST); | glEnable(GL_DEPTH_TEST); | |||
return; | return; | |||
} else { | } else { | |||
Pickable *p = I->R.P; | Pickable *p = I->R.P; | |||
unsigned int i; | unsigned int i; | |||
TextSetIsPicking(G, true); | TextSetIsPicking(G, true); | |||
SceneSetupGLPicking(G); | SceneSetupGLPicking(G); | |||
if(c) { | if(c) { | |||
if(float_text) | if(float_text) | |||
glDisable(GL_DEPTH_TEST); | glDisable(GL_DEPTH_TEST); | |||
i = (*pick)->src.index; | i = pick->begin()->src.index; | |||
while(c--) { | while(c--) { | |||
if(*l) { | if(*l) { | |||
TextSetPos(G, v); | TextSetPos(G, v); | |||
p++; | p++; | |||
AssignNewPickColor(NULL, i, pick, &I->R.context, TextGetColorUChar 4uv(G), p->index, p->bond); | AssignNewPickColor(NULL, i, pick, &I->R.context, TextGetColorUChar 4uv(G), p->index, p->bond); | |||
TextSetColorFromUColor(G); | TextSetColorFromUColor(G); | |||
TextSetLabelBkgrdInfo(G, 1.f, 1.2f, NULL); | TextSetLabelBkgrdInfo(G, 1.f, 1.2f, NULL); | |||
TextSetLabelPosIsSet(G, 0); | TextSetLabelPosIsSet(G, 0); | |||
if (!TextRenderOpenGL(G, info, font_id, l[n], font_size, v + 3, fal se, 0, 1, 0)){ | if (!TextRenderOpenGL(G, info, font_id, l[n], font_size, v + 3, fal se, 0, 1, 0)){ | |||
TextSetIsPicking(G, false); | TextSetIsPicking(G, false); | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added |