summaryrefslogtreecommitdiffstats
path: root/hacks/glx/molecule.c
diff options
context:
space:
mode:
Diffstat (limited to 'hacks/glx/molecule.c')
-rw-r--r--hacks/glx/molecule.c30
1 files changed, 17 insertions, 13 deletions
diff --git a/hacks/glx/molecule.c b/hacks/glx/molecule.c
index 94d7dd3..c173c6b 100644
--- a/hacks/glx/molecule.c
+++ b/hacks/glx/molecule.c
@@ -27,15 +27,13 @@
#define DEFAULTS "*delay: 10000 \n" \
"*showFPS: False \n" \
"*wireframe: False \n" \
- "*atomFont: -*-helvetica-medium-r-normal-*-*-240-*-*-*-*-*-*\n" \
- "*titleFont: -*-helvetica-medium-r-normal-*-*-180-*-*-*-*-*-*\n" \
+ "*atomFont: sans-serif 24\n" \
+ "*titleFont: sans-serif 18\n" \
"*noLabelThreshold: 150 \n" \
"*wireframeThreshold: 150 \n" \
"*suppressRotationAnimation: True\n" \
# define release_molecule 0
-#undef countof
-#define countof(x) (sizeof((x))/sizeof((*x)))
#include "xlockmore.h"
#include "colors.h"
@@ -702,10 +700,7 @@ parse_pdb_data (molecule *m, const char *data, const char *filename, int line)
{
char *name = calloc (1, 100);
char *n2 = name;
- int L = strlen(s);
- if (L > 99) L = 99;
-
- strncpy (n2, s, L);
+ sprintf (n2, "%.99s", s);
n2 += 7;
while (isspace(*n2)) n2++;
@@ -1212,13 +1207,12 @@ reshape_molecule (ModeInfo *mi, int width, int height)
0.0, 0.0, 0.0,
0.0, 1.0, 0.0);
-# ifdef HAVE_MOBILE /* Keep it the same relative size when rotated. */
{
- int o = (int) current_device_rotation();
- if (o != 0 && o != 180 && o != -180)
- glScalef (1/h, 1/h, 1/h);
+ GLfloat s = (MI_WIDTH(mi) < MI_HEIGHT(mi)
+ ? (MI_WIDTH(mi) / (GLfloat) MI_HEIGHT(mi))
+ : 1);
+ glScalef (s, s, s);
}
-# endif
glClear(GL_COLOR_BUFFER_BIT);
}
@@ -1243,9 +1237,11 @@ startup_blurb (ModeInfo *mi)
{
molecule_configuration *mc = &mcs[MI_SCREEN(mi)];
const char *s = "Constructing molecules...";
+#ifndef HAVE_ANDROID /* Doesn't work -- causes whole scene to be black */
print_texture_label (mi->dpy, mc->title_font,
mi->xgwa.width, mi->xgwa.height,
0, s);
+#endif
glFinish();
glXSwapBuffers(MI_DISPLAY(mi), MI_WINDOW(mi));
}
@@ -1346,6 +1342,10 @@ init_molecule (ModeInfo *mi)
mc->trackball = gltrackball_init (True);
}
+#ifdef HAVE_ANDROID /* Doesn't work -- not transparent */
+ do_shells = False;
+#endif
+
orig_do_labels = do_labels;
orig_do_atoms = do_atoms;
orig_do_bonds = do_bonds;
@@ -1447,7 +1447,9 @@ draw_labels (ModeInfo *mi)
s *= 0.8; /* Shrink a bit */
glScalef (s, s, 1);
glTranslatef (-w/2, -h/2, 0);
+#ifndef HAVE_ANDROID /* Doesn't work -- causes whole scene to be black */
print_texture_string (mc->atom_font, a->label);
+#endif
}
glPopMatrix();
@@ -1647,9 +1649,11 @@ draw_molecule (ModeInfo *mi)
if (do_titles && m->label && *m->label)
{
set_atom_color (mi, 0, True, 1);
+#ifndef HAVE_ANDROID /* Doesn't work -- causes whole scene to be black */
print_texture_label (mi->dpy, mc->title_font,
mi->xgwa.width, mi->xgwa.height,
1, m->label);
+#endif
}
}
glPopMatrix();