[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gzz-commits] gzz ./TODO gfx/libcallgl/callgl.cxx
From: |
Janne V. Kujala |
Subject: |
[Gzz-commits] gzz ./TODO gfx/libcallgl/callgl.cxx |
Date: |
Wed, 04 Dec 2002 06:33:25 -0500 |
CVSROOT: /cvsroot/gzz
Module name: gzz
Changes by: Janne V. Kujala <address@hidden> 02/12/04 06:33:25
Modified files:
. : TODO
gfx/libcallgl : callgl.cxx
Log message:
make callgl complain on broken stuff
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/TODO.diff?tr1=1.434&tr2=1.435&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gzz/gzz/gfx/libcallgl/callgl.cxx.diff?tr1=1.37&tr2=1.38&r1=text&r2=text
Patches:
Index: gzz/TODO
diff -u gzz/TODO:1.434 gzz/TODO:1.435
--- gzz/TODO:1.434 Wed Dec 4 04:47:08 2002
+++ gzz/TODO Wed Dec 4 06:33:25 2002
@@ -18,9 +18,6 @@
0.8alpha4: Cleanup release after crucial demos; make it possible for anyone to
get *THE* demo up and running
jvk:
- - make callgl complain on broken stuff such as
- the string "%(texid)s" in place of a number !!!!
- ARGH ARGH ARGH
+ irregu: precomputed angles for 2D-texture slices (sprinkled edge)
+ update irregu renderbale
+ libpaper NV2x combined passes
Index: gzz/gfx/libcallgl/callgl.cxx
diff -u gzz/gfx/libcallgl/callgl.cxx:1.37 gzz/gfx/libcallgl/callgl.cxx:1.38
--- gzz/gfx/libcallgl/callgl.cxx:1.37 Mon Nov 11 05:25:32 2002
+++ gzz/gfx/libcallgl/callgl.cxx Wed Dec 4 06:33:25 2002
@@ -84,7 +84,7 @@
vector<GLfloat> u;
u.reserve(reserve);
for (; i < v.size(); i++)
- u.insert(u.end(), (GLfloat)atof(v[i].c_str()));
+ u.insert(u.end(), (GLfloat)getTokenf(v[i]));
return u;
}
@@ -92,7 +92,7 @@
vector<GLdouble> u;
u.reserve(reserve);
for (; i < v.size(); i++)
- u.insert(u.end(), (GLdouble)atof(v[i].c_str()));
+ u.insert(u.end(), (GLdouble)getTokenf(v[i]));
return u;
}
@@ -100,7 +100,7 @@
vector<Int> u;
u.reserve(reserve);
for (; i < v.size(); i++)
- u.insert(u.end(), (GLint)atoi(v[i].c_str()));
+ u.insert(u.end(), (GLint)getToken(v[i]));
return u;
}
@@ -155,47 +155,47 @@
vector<GLdouble> params = getdv(v, 1, 16);
glMultMatrixd(¶ms[0]);
} else if (checkfunc(v, "Rotate", 4)) {
- glRotated(atof(v[1].c_str()), atof(v[2].c_str()),
- atof(v[3].c_str()), atof(v[4].c_str()));
+ glRotated(getTokenf(v[1]), getTokenf(v[2]),
+ getTokenf(v[3]), getTokenf(v[4]));
} else if (checkfunc(v, "Scale", 3)) {
- glScaled(atof(v[1].c_str()), atof(v[2].c_str()),
- atof(v[3].c_str()));
+ glScaled(getTokenf(v[1]), getTokenf(v[2]),
+ getTokenf(v[3]));
} else if (checkfunc(v, "Translate", 3)) {
- glTranslated(atof(v[1].c_str()), atof(v[2].c_str()),
- atof(v[3].c_str()));
+ glTranslated(getTokenf(v[1]), getTokenf(v[2]),
+ getTokenf(v[3]));
} else if (checkfunc(v, "BindTexture", 2)) {
- glBindTexture(getToken(v[1]), (GLuint)atoi(v[2].c_str()));
+ glBindTexture(getToken(v[1]), (GLuint)getToken(v[2]));
} else if (checkfunc(v, "DepthMask", 1)) {
- glDepthMask(atoi(v[1].c_str()));
+ glDepthMask(getToken(v[1]));
} else if (checkfunc(v, "ColorMask", 4)) {
- glColorMask(atoi(v[1].c_str()),
- atoi(v[2].c_str()),
- atoi(v[3].c_str()),
- atoi(v[4].c_str())
+ glColorMask(getToken(v[1]),
+ getToken(v[2]),
+ getToken(v[3]),
+ getToken(v[4])
);
} else if (checkfunc(v, "AlphaFunc", 2)) {
- glAlphaFunc(getToken(v[1]), atof(v[2].c_str()));
+ glAlphaFunc(getToken(v[1]), getTokenf(v[2]));
} else if (checkfunc(v, "DepthFunc", 1)) {
glDepthFunc(getToken(v[1]));
} else if (checkfunc(v, "BlendFunc", 2)) {
glBlendFunc(getToken(v[1]), getToken(v[2]));
} else if (checkfunc(v, "StencilFunc", 3)) {
- glStencilFunc(getToken(v[1]), atoi(v[2].c_str()), atoi(v[3].c_str()));
+ glStencilFunc(getToken(v[1]), getToken(v[2]), getToken(v[3]));
} else if (checkfunc(v, "StencilOp", 3)) {
glStencilOp(getToken(v[1]), getToken(v[2]), getToken(v[3]));
} else if (checkfunc(v, "StencilMask", 1)) {
- glStencilMask(atoi(v[1].c_str()));
+ glStencilMask(getToken(v[1]));
} else if (checkfunc(v, "PolygonMode", 2)) {
glPolygonMode(getToken(v[1]), getToken(v[2]));
} else if (checkfunc(v, "BlendEquation", 1)) {
glBlendEquation(getToken(v[1]));
} else if (checkfunc(v, "BlendColor", 4)) {
- glBlendColor(atof(v[1].c_str()), atof(v[2].c_str()),
- atof(v[3].c_str()), atof(v[4].c_str()));
+ glBlendColor(getTokenf(v[1]), getTokenf(v[2]),
+ getTokenf(v[3]), getTokenf(v[4]));
} else if (checkfunc(v, "SecondaryColorEXT", 3)) {
#ifdef GL_EXT_secondary_color
- glSecondaryColor3dEXT(atof(v[1].c_str()), atof(v[2].c_str()),
- atof(v[3].c_str()));
+ glSecondaryColor3dEXT(getTokenf(v[1]), getTokenf(v[2]),
+ getTokenf(v[3]));
#else
cerr << "Warning: SecondaryColorEXT attempted but support\n"
"was not compiled in because GL_EXT_secondary_color\n"
@@ -209,26 +209,26 @@
glFogf(getToken(v[1]), getTokenf(v[2]));
}
} else if (checkfunc(v, "TexImage2D", 8, true)) {
- int w = atoi(v[4].c_str());
- int h = atoi(v[5].c_str());
+ int w = getToken(v[4]);
+ int h = getToken(v[5]);
vector<GLfloat> pixels = getfv(v, 8, w * h);
if (pixels.size() % (unsigned)(w * h)) {
cerr << "TexImage2D dimensions " << w << "x" << h << " do not match
the size " << pixels.size() << " of data\n";
return false;
}
- glTexImage2D(getToken(v[1]), atoi(v[2].c_str()), getToken(v[3]),
- w, h, atoi(v[6].c_str()), getToken(v[7]),
+ glTexImage2D(getToken(v[1]), getToken(v[2]), getToken(v[3]),
+ w, h, getToken(v[6]), getToken(v[7]),
GL_FLOAT, &pixels[0]);
} else if (checkfunc(v, "TexImage2D_ushort", 8, true)) {
- int w = atoi(v[4].c_str());
- int h = atoi(v[5].c_str());
+ int w = getToken(v[4]);
+ int h = getToken(v[5]);
vector<GLushort> pixels = getiv<GLushort>(v, 8, w * h);
if (pixels.size() % (unsigned)(w * h)) {
cerr << "TexImage2D dimensions " << w << "x" << h << " do not match
the size " << pixels.size() << " of data\n";
return false;
}
- glTexImage2D(getToken(v[1]), atoi(v[2].c_str()), getToken(v[3]),
- w, h, atoi(v[6].c_str()), getToken(v[7]),
+ glTexImage2D(getToken(v[1]), getToken(v[2]), getToken(v[3]),
+ w, h, getToken(v[6]), getToken(v[7]),
GL_UNSIGNED_SHORT, &pixels[0]);
} else if (checkfunc(v, "ColorTable", 5, true) ||
checkfunc(v, "ColorTableEXT", 5, true)
@@ -236,13 +236,13 @@
vector<GLfloat> pixels = getfv(v, 5);
glColorTableEXT(
getToken(v[1]), getToken(v[2]),
- atoi(v[3].c_str()),
+ getToken(v[3]),
getToken(v[4]),
GL_FLOAT, &pixels[0]);
} else if (checkfunc(v, "SeparableFilter2D", 6, true)) {
vector<GLfloat> filters = getfv(v, 6);
- int w = atoi(v[3].c_str());
- int h = atoi(v[4].c_str());
+ int w = getToken(v[3]);
+ int h = getToken(v[4]);
glSeparableFilter2D(
getToken(v[1]),
@@ -255,8 +255,8 @@
} else if (checkfunc(v, "ConvolutionFilter2D", 6, true)) {
vector<GLfloat> filters = getfv(v, 6);
- int w = atoi(v[3].c_str());
- int h = atoi(v[4].c_str());
+ int w = getToken(v[3]);
+ int h = getToken(v[4]);
glConvolutionFilter2D(
getToken(v[1]),
@@ -311,12 +311,12 @@
mask |= getToken(v[i]);
glClear(mask);
} else if (checkfunc(v, "ClearDepth", 1)) {
- glClearDepth(atof(v[1].c_str()));
+ glClearDepth(getTokenf(v[1]));
} else if (checkfunc(v, "ClearColor", 4)) {
- glClearColor(atof(v[1].c_str()),
- atof(v[2].c_str()),
- atof(v[3].c_str()),
- atof(v[4].c_str()));
+ glClearColor(getTokenf(v[1]),
+ getTokenf(v[2]),
+ getTokenf(v[3]),
+ getTokenf(v[4]));
} else if (checkfunc(v, "ActiveTextureARB", 1)) {
glActiveTextureARB(getToken(v[1]));
} else if (checkfunc(v, "ActiveTexture", 1)) {
@@ -329,72 +329,72 @@
Begin = false;
} else if (checkfunc(v, "Vertex", 2, true)) {
switch (v.size()) {
- case 3: glVertex2d(atof(v[1].c_str()),
- atof(v[2].c_str())); break;
- case 4: glVertex3d(atof(v[1].c_str()),
- atof(v[2].c_str()),
- atof(v[3].c_str())); break;
+ case 3: glVertex2d(getTokenf(v[1]),
+ getTokenf(v[2])); break;
+ case 4: glVertex3d(getTokenf(v[1]),
+ getTokenf(v[2]),
+ getTokenf(v[3])); break;
default:
cerr << "Ignoring extra arguments to Vertex\n";
- case 5: glVertex4d(atof(v[1].c_str()),
- atof(v[2].c_str()),
- atof(v[3].c_str()),
- atof(v[4].c_str())); break;
+ case 5: glVertex4d(getTokenf(v[1]),
+ getTokenf(v[2]),
+ getTokenf(v[3]),
+ getTokenf(v[4])); break;
}
} else if (checkfunc(v, "TexCoord", 1, true)) {
switch (v.size()) {
- case 2: glTexCoord1d(atof(v[1].c_str())); break;
- case 3: glTexCoord2d(atof(v[1].c_str()),
- atof(v[2].c_str())); break;
- case 4: glTexCoord3d(atof(v[1].c_str()),
- atof(v[2].c_str()),
- atof(v[3].c_str())); break;
+ case 2: glTexCoord1d(getTokenf(v[1])); break;
+ case 3: glTexCoord2d(getTokenf(v[1]),
+ getTokenf(v[2])); break;
+ case 4: glTexCoord3d(getTokenf(v[1]),
+ getTokenf(v[2]),
+ getTokenf(v[3])); break;
default:
cerr << "Ignoring extra arguments to TexCoord\n";
- case 5: glTexCoord4d(atof(v[1].c_str()),
- atof(v[2].c_str()),
- atof(v[3].c_str()),
- atof(v[4].c_str())); break;
+ case 5: glTexCoord4d(getTokenf(v[1]),
+ getTokenf(v[2]),
+ getTokenf(v[3]),
+ getTokenf(v[4])); break;
}
} else if (checkfunc(v, "MultiTexCoord", 2, true)) {
GLenum tex = getToken(v[1]);
switch (v.size()) {
- case 3: glMultiTexCoord1d(tex, atof(v[2].c_str())); break;
+ case 3: glMultiTexCoord1d(tex, getTokenf(v[2])); break;
case 4: glMultiTexCoord2d(tex,
- atof(v[2].c_str()),
- atof(v[3].c_str())); break;
+ getTokenf(v[2]),
+ getTokenf(v[3])); break;
case 5: glMultiTexCoord3d(tex,
- atof(v[2].c_str()),
- atof(v[3].c_str()),
- atof(v[4].c_str())); break;
+ getTokenf(v[2]),
+ getTokenf(v[3]),
+ getTokenf(v[4])); break;
default:
cerr << "Ignoring extra arguments to MultiTexCoord\n";
case 6: glMultiTexCoord4d(tex,
- atof(v[2].c_str()),
- atof(v[3].c_str()),
- atof(v[4].c_str()),
- atof(v[5].c_str())); break;
+ getTokenf(v[2]),
+ getTokenf(v[3]),
+ getTokenf(v[4]),
+ getTokenf(v[5])); break;
}
} else if (checkfunc(v, "Color", 3, true)) {
switch (v.size()) {
- case 4: glColor3d(atof(v[1].c_str()),
- atof(v[2].c_str()),
- atof(v[3].c_str())); break;
+ case 4: glColor3d(getTokenf(v[1]),
+ getTokenf(v[2]),
+ getTokenf(v[3])); break;
default:
cerr << "Ignoring extra arguments to Color\n";
- case 5: glColor4d(atof(v[1].c_str()),
- atof(v[2].c_str()),
- atof(v[3].c_str()),
- atof(v[4].c_str())); break;
+ case 5: glColor4d(getTokenf(v[1]),
+ getTokenf(v[2]),
+ getTokenf(v[3]),
+ getTokenf(v[4])); break;
}
} else if (checkfunc(v, "Normal", 3)) {
- glNormal3d(atof(v[1].c_str()),
- atof(v[2].c_str()),
- atof(v[3].c_str()));
+ glNormal3d(getTokenf(v[1]),
+ getTokenf(v[2]),
+ getTokenf(v[3]));
} else if (checkfunc(v, "LineWidth", 1)) {
- glLineWidth(atof(v[1].c_str()));
+ glLineWidth(getTokenf(v[1]));
} else if (checkfunc(v, "PointSize", 1)) {
- glPointSize(atof(v[1].c_str()));
+ glPointSize(getTokenf(v[1]));
#ifdef GL_REGISTER_COMBINERS_NV
@@ -415,7 +415,7 @@
cerr << "Inv num params CombinerParameterNV\n";
return false;
}
- glCombinerParameterfNV(pname, atof(v[2].c_str()));
+ glCombinerParameterfNV(pname, getTokenf(v[2]));
} else {
cerr << "Invalid CombinerParameterNV first param:
"<<pname<<"\n";
return false;
@@ -465,9 +465,9 @@
// type, stride, vstride, packed not used
vector<GLfloat> params = getfv(v, 5, v.size());
GLenum target = getToken(v[1]);
- int index = atoi(v[2].c_str());
- int uorder = atoi(v[3].c_str());
- int vorder = atoi(v[4].c_str());
+ int index = getToken(v[2]);
+ int uorder = getToken(v[3]);
+ int vorder = getToken(v[4]);
glMapControlPointsNV(
target,
index,
@@ -491,20 +491,20 @@
#ifdef GL_VERTEX_PROGRAM_NV
} else if (checkfunc(v, "BindProgramNV", 2)) {
- glBindProgramNV(getToken(v[1]), (GLuint)atoi(v[2].c_str()));
+ glBindProgramNV(getToken(v[1]), (GLuint)getToken(v[2]));
} else if (checkfunc(v, "TrackMatrixNV", 4)) {
glTrackMatrixNV(getToken(v[1]),
- atoi(v[2].c_str()),
+ getToken(v[2]),
getToken(v[3]),
getToken(v[4]));
} else if (checkfunc(v, "ProgramParameterNV", 6)) {
glProgramParameter4fNV(
getToken(v[1]),
- atoi(v[2].c_str()),
- atof(v[3].c_str()),
- atof(v[4].c_str()),
- atof(v[5].c_str()),
- atof(v[6].c_str()));
+ getToken(v[2]),
+ getTokenf(v[3]),
+ getTokenf(v[4]),
+ getTokenf(v[5]),
+ getTokenf(v[6]));
#endif
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Gzz-commits] gzz ./TODO gfx/libcallgl/callgl.cxx,
Janne V. Kujala <=