1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152
|
From: Morten Kjeldgaard <mok@bioxray.au.dk>
Subject: modification to source code
--- a/src/Common.cpp
+++ b/src/Common.cpp
@@ -136,8 +136,8 @@ void drawFrame(); // def later...
Byte* GetSnapshot(int sx, int sy, bool alpha){
- static uint textureSnap = 666;
- static uint frameSnap;
+ //static uint textureSnap = 666;
+ //static uint frameSnap;
// set offline rendering
mainCanvas.RedirectToMemory();
@@ -448,7 +448,7 @@ void Mol::DrawHalos(){
);
glBegin(GL_QUADS);
- for (int i=0; i<atom.size(); i++) atom[i].DrawHalo();
+ for (int i=0; i < (int)atom.size(); i++) atom[i].DrawHalo();
glEnd();
/*
@@ -496,7 +496,7 @@ void Mol::DrawShadowmap(bool invert){
shadowSettings.BindShaders();
glBegin(GL_QUADS);
- for (int i=0; i<atom.size(); i++) atom[i].DrawShadowmap();
+ for (int i=0; i < (int)atom.size(); i++) atom[i].DrawShadowmap();
glEnd();
if (sticks) {
@@ -507,7 +507,7 @@ void Mol::DrawShadowmap(bool invert){
glBegin(GL_QUADS);
- for (int i=0; i<bond.size(); i++) bond[i].DrawShadowmap();
+ for (int i=0; i < (int)bond.size(); i++) bond[i].DrawShadowmap();
glEnd();
}
glPopMatrix();
@@ -559,7 +559,7 @@ void Mol::Draw(){
if (draw_balls) {
if (draw_wireframe_balls) {
glDisable(GL_FRAGMENT_PROGRAM_ARB);
- for (int i=0; i<atom.size(); i++) {
+ for (int i=0; i < (int)atom.size(); i++) {
glColor3f(0,0,1);
glBegin(GL_LINE_LOOP);
atom[i].Draw();
@@ -571,7 +571,7 @@ void Mol::Draw(){
//if (DL_atoms==666) glGenD
glBegin(GL_QUADS);
- for (int i=0; i<atom.size(); i++) atom[i].Draw();
+ for (int i=0; i < (int)atom.size(); i++) atom[i].Draw();
glEnd();
glDisable(GL_VERTEX_PROGRAM_ARB);
@@ -604,7 +604,7 @@ void Mol::Draw(){
glColor3f(1,1,1);
if (draw_wireframe_sticks) {
glDisable(GL_FRAGMENT_PROGRAM_ARB);
- for (int i=0; i<bond.size(); i++) {
+ for (int i=0; i < (int)bond.size(); i++) {
glColor3f(0,0.6,0.3);
glBegin(GL_LINE_LOOP);
bond[i].Draw();
@@ -613,7 +613,7 @@ void Mol::Draw(){
}
else {
glBegin(GL_QUADS);
- for (int i=0; i<bond.size(); i++) bond[i].Draw();
+ for (int i=0; i < (int)bond.size(); i++) bond[i].Draw();
glEnd();
}
cgSettings.BindShaders();
@@ -703,12 +703,12 @@ bool Mol::DoingAO(){
if (!ready) return false;
if (cgSettings.P_texture==0) return false;
if (DirV.size()==0) return true;
- return AOdoneLvl<DirV.size();
+ return AOdoneLvl< (int)DirV.size();
}
bool Mol::DecentAO(){
float k=1;
- if (AOdoneLvl>=DirV.size()) return true;
+ if (AOdoneLvl >= (int)DirV.size()) return true;
if (atom.size()<10) return (AOdoneLvl>6*k);
if (atom.size()<100) return (AOdoneLvl>4*k);
if (atom.size()<1000) return (AOdoneLvl>2*k);
@@ -751,15 +751,15 @@ void Mol::PrepareAOstart(){
}
// for testing purposes
-bool Mol::PrepareAOSingleView(){
+void Mol::PrepareAOSingleView(){
static int i=0;
PrepareAOstart();
AOgpu2::Bind();
AOgpu2 ao(DirV[i], *this, 4 );
- i++; if (i>DirV.size()) i=0;
+ i++; if (i > (int)DirV.size()) i=0;
AOgpu2::UnBind();
AOdoneLvl=DirV.size();
-}
+}
bool Mol::PrepareAOstep(int nsteps){
@@ -772,7 +772,7 @@ bool Mol::PrepareAOstep(int nsteps){
AOdoneLvl++;
- return (AOdoneLvl>=DirV.size()) ;
+ return (AOdoneLvl >= (int)DirV.size()) ;
}
void Mol::PrepareAOallAtOnce(){
@@ -786,12 +786,12 @@ void Mol::PrepareAOallAtOnce(){
//refresh();
FILE *f = fopen("res.txt", "w");
- long int w=TakeTime(f,"sampled");
+ long int w=TakeTime(f, (char *)"sampled");
- fprintf(f," %d views done in %d msec (%.2f views x sec), with %d atoms & %d sticks.\n",
- DirV.size(), w,
- DirV.size()*1000.0/w, this->atom.size(),
- this->sticks?(this->bond.size()):0 );
+ fprintf(f," %d views done in %ld msec (%.2f views x sec), with %d atoms & %d sticks.\n",
+ (int)DirV.size(), w,
+ (int)DirV.size()*1000.0/w, (int)this->atom.size(),
+ (int)(this->sticks?(this->bond.size()):0) );
fclose(f);
AOready=true;
@@ -822,7 +822,7 @@ Point3f getDirFromTrackball(vcg::Trackball &tb){
tb.GetView();
tb.Apply(false);
- float pos[4]={0.0f,0.0f,-1.0f,0.0f};
+ //float pos[4]={0.0f,0.0f,-1.0f,0.0f};
float d[16];
glGetFloatv(GL_MODELVIEW_MATRIX,d);
glPopMatrix();
diff --git a/src/CubeMapSamp.h b/src/CubeMapSamp.h
index 5c19d8e..1290b9d 100644
|