From: Morten Kjeldgaard Subject: modification to source code --- a/src/Mol.cpp +++ b/src/Mol.cpp @@ -16,7 +16,7 @@ #include "Mol.h" #include "HardSettings.h" -#include "Progress.h" +#include "progress.h" #include "AtomColor.h" #include "MyCanvas.h" @@ -112,12 +112,12 @@ // assign texture positions - for (int i=0; i2000; - if (showprogress) StartProgress("Locating Bonds",atom.size() ); + if (showprogress) StartProgress((char *)"Locating Bonds",atom.size() ); // Sort atoms per x coordinate std::sort( atom.begin(), atom.end() ); int st=0; // start interval - for (int i=0; i px ) break; // no more atoms else { @@ -300,7 +300,7 @@ if (showprogress) EndProgress(); - printf("%d bonds detected!\n",bond.size() ); + printf("%d bonds detected!\n", (int)bond.size() ); } void Mol::SetSpaceFill(){ @@ -309,7 +309,7 @@ ReassignTextureAutosize(); - for (int i=0; i &t, int texsize){ - for (int i=0; i0 && (startAtom-1)6+i*5+4 && isdigit(st[6+i*5+4])) + while((int)st.size() > 6+i*5+4 && isdigit(st[6+i*5+4])) { // printf("'%s' -> '%s' (%c)\n",st.substr(6,5).c_str(),st.substr(6+i*5,5).c_str(),st[6+i*5+4]); int secondAtom=atoi( st.substr(6+i*5,5).c_str()); @@ -427,7 +427,7 @@ if (fseek(f, 0, SEEK_END)==0) size=ftell (f); fseek (f, 0, SEEK_SET); bool showprogress=(size==0) || (size>1000000); - if (showprogress) StartProgress("Reading file", size); + if (showprogress) StartProgress((char *)"Reading file", size); char buf[82]; buf[81]=0; @@ -464,7 +464,7 @@ //printf("Found %d atoms!\n", atom.size() ); nhetatm=0; natm=0; - for (int i=0; i0) + if (atom.size() < 1) + return; x0=x1=atom[0].px; y0=y1=atom[0].py; z0=z1=atom[0].pz; - for (int i=1; iatom[i].px) x1=atom[i].px; if (y1>atom[i].py) y1=atom[i].py; if (z1>atom[i].pz) z1=atom[i].pz; @@ -591,12 +592,12 @@ } void Mol::UpdateColors(){ - for (int i=0; i