Commit f6525443 authored by zmoelnig's avatar zmoelnig
Browse files

simplified printout a bit (and tried to use error() when appropriate)


git-svn-id: https://pd-gem.svn.sourceforge.net/svnroot/pd-gem/trunk/Gem@2429 49b2a0ca-c541-4d49-a7ef-d785e4371512
parent 722cf68d
......@@ -86,7 +86,7 @@ void GemGluObj :: typeMess(t_symbol *type)
m_drawType = GL_POINT;
break;
default:
error ("GEM: GemGluObj draw style");
error ("unknown draw style");
return;
}
setModified();
......
......@@ -37,7 +37,7 @@ GemPathBase :: GemPathBase(int argc, t_atom *argv)
if (m_numDimens < 1) m_numDimens = 1;
if (m_numDimens > 64)
{
error("GEM: GemPathBase: Too many dimensions, must be below 64");
error("too many dimensions, must be below 64");
m_numDimens = 64;
}
}
......@@ -61,7 +61,7 @@ void GemPathBase :: openMess(t_symbol *arrayname)
m_array = (t_garray *)pd_findbyclass(arrayname, garray_class);
if (!m_array)
{
error("GEM: GemPathBase: unable to find array %s", arrayname->s_name);
error("unable to find array %s", arrayname->s_name);
return;
}
}
......
......@@ -152,7 +152,7 @@ void curve3d :: typeMess(t_symbol *type){
else if (!strcmp(type->s_name, "default"))
m_drawType = 1;
else {
error ("GEM : invalid draw style for curve3d?");
error ("unknown draw style");
return;
}
setModified();
......
......@@ -54,7 +54,7 @@ disk :: disk(int argc, t_atom *argv)
case 0:
break;
default:
error("GEM: disk: needs 1, 2 or 3 arguments (%d)", argc);
error("needs 1, 2 or 3 arguments (%d)", argc);
}
sizeMess(size);
......
......@@ -223,7 +223,7 @@ void imageVert :: processGrayPix(imageStruct &image, int texture)
/////////////////////////////////////////////////////////
void imageVert :: processYUVPix(imageStruct &image, int texture)
{
post("GEM:imageVert: YUV not yet implemented :-(");
error("YUV not yet implemented :-(");
/* float Y, Y2, U, U2, V, V2;
const int ySize = image.ysize;
......
......@@ -178,12 +178,10 @@ void model :: buildList()
// m_flags = GLM_SMOOTH | GLM_MATERIAL;
if (!m_group){
// post("model: drawing all groups");
m_dispList = glmList(m_model, m_flags);
}
else
{
// post("model: drawing group %d",m_group);
m_dispList = glmListGroup(m_model, m_flags,m_group);
}
}
......@@ -199,7 +197,6 @@ void model :: render(GemState *state)
currentW = state->texCoordY(1);
if(m_model)glmLinearTexture(m_model,currentH,currentW);
// post("model: resizing texcoords");
buildList();
}
......
......@@ -79,7 +79,7 @@ void multimodel :: cleanMultimodel()
}
else {
while (ptr && ptr->next != m_loadedCache) ptr = ptr->next;
if (!ptr) error("GEM: multimodel: Unable to find model cache!");
if (!ptr) error("unable to find model cache!");
else {
ptr->next = m_loadedCache->next;
delete m_loadedCache;
......@@ -101,11 +101,11 @@ void multimodel :: openMess(t_symbol *filename, int baseModel, int topModel, int
cleanMultimodel();
if (!topModel) {
post("GEM: multimodel: requires an int for number of models");
error("requires an int for number of models");
return;
}
if (baseModel > topModel) {
post("GEM: multimodel: Top range less than base model");
error("top range less than base model");
return;
}
if (skipRate < 1) skipRate = 1;
......@@ -127,7 +127,7 @@ void multimodel :: openMess(t_symbol *filename, int baseModel, int topModel, int
m_loadedCache->refCount++;
m_curModel = 0;
m_numModels = m_loadedCache->numModels;
post("GEM: multimodel: loaded models: %s from %d to %d skipping %d",
post("loaded models: %s from %d to %d skipping %d",
filename->s_name, baseModel, topModel, skipRate);
return;
}
......@@ -145,7 +145,7 @@ void multimodel :: openMess(t_symbol *filename, int baseModel, int topModel, int
}
if (!strPtr[i]) {
post("GEM: multimodel: Unable to find * in file name");
error("unable to find * in file name");
return;
}
......@@ -209,7 +209,7 @@ void multimodel :: openMess(t_symbol *filename, int baseModel, int topModel, int
ptr->next = newCache;
}
post("GEM: multimodel: loaded models: %s %s from %d to %d skipping %d",
post("loaded models: %s %s from %d to %d skipping %d",
bufName, postName, baseModel, topModel, skipRate);
this->setModified();
}
......@@ -262,12 +262,12 @@ void multimodel :: changeModel(int modelNum)
{
if (modelNum >= m_numModels)
{
error("GEM: multimodel: selection number too high: %d (max num is %d)", modelNum, m_numModels-1);
error("selection number too high: %d (max num is %d)", modelNum, m_numModels-1);
return;
}
else if (modelNum < 0)
{
error("GEM: multimodel: selection number must be > 0");
error("selection number must be > 0");
return;
}
m_curModel = modelNum;
......
......@@ -52,7 +52,7 @@ newWave :: newWave( int argc, t_atom*argv)//t_floatarg widthX, t_floatarg widthY
switch(argc){
default:
post("newWave: ignoring some arguments");
error("ignoring extra arguments");
case 3:
m_height=atom_getfloat(argv+2);
case 2:
......@@ -119,7 +119,7 @@ void newWave :: forceMess(float posX, float posY, float valforce)
void newWave :: textureMess(int mode)
{
if(mode<0){
error("newWave: textureMode must be >= 0");
error("textureMode must be >= 0");
return;
}
m_textureMode = mode;
......@@ -137,8 +137,6 @@ void newWave :: render(GemState *state)
int i, j;
if(m_drawType==GL_DEFAULT_GEM)m_drawType=GL_TRIANGLE_STRIP;
// post("m_size=%f", m_size);
GLfloat sizeX = 2.*m_size / (GLfloat)(gridX-1);
GLfloat sizeY = 2.*m_size / (GLfloat)(gridY-1);
......@@ -161,14 +159,6 @@ void newWave :: render(GemState *state)
(ysize != state->texCoords[2].t-ysize0))
alreadyInit = 0;
/*
post("S\t%f=%f\t%f=%f", xsize0,state->texCoords[0].s, xsize,state->texCoords[1].s-xsize0);
post("T\t%f=%f\t%f=%f", ysize0,state->texCoords[1].t, ysize,state->texCoords[2].t-ysize0);
*/
// for (int II=0; II<4; II++)post("%d: %fx%f", II, state->texCoords[II].s, state->texCoords[II].t);
if (!alreadyInit)
{
xsize0 = state->texCoords[0].s;
......@@ -190,9 +180,6 @@ void newWave :: render(GemState *state)
glNormal3fv( vertNorms[i][j] );
glTexCoord2fv( texCoords[i][j] );
glVertex3f( i*sizeX - 1, j*sizeY -1 , posit[i][j]*m_height);
/*
post("(%f\t%f)\t(%f\t%f)", (i-grid/2)*size, (j-grid/2)*size, (i+1-grid/2)*size, (j-grid/2)*size);
*/
glNormal3fv( vertNorms[i+1][j] );
glTexCoord2fv( texCoords[i+1][j] );
......@@ -214,8 +201,6 @@ void newWave :: render(GemState *state)
alreadyInit = 1;
}
// post("size=%f", size);
for ( i = 0; i<gridX -1; ++i)
{
glBegin(m_drawType);
......@@ -260,7 +245,7 @@ void newWave :: typeMess(t_symbol *type)
case 'f': case 'F': m_drawType = GL_TRIANGLE_STRIP; break;
case 'p': case 'P': m_drawType = GL_POINTS; break;
default:
error ("GEM: newWave draw style");
error ("unknown draw style");
return;
}
setModified();
......@@ -472,14 +457,12 @@ void newWave :: getposition()
/////////////////////////////////////////////////////////
void newWave :: getTexCoords(void)
{
// post("getTexCoords: x=%f\ty=%f %f", xsize, ysize0, ysize);
for ( int i = 0; i < gridX; ++i)
{
for ( int j = 0; j < gridY; ++j)
{
texCoords[i][j][0] = ((xsize*(float)i/(float)(gridX-1)) + xsize0 );
texCoords[i][j][1] = ((ysize*(float)j/(float)(gridY-1)) + ysize0 );
//post("texCoords[%d][%d] = %f\t%f",i,j,texCoords[i][j][0],texCoords[i][j][1]);
}
}
}
......
......@@ -135,7 +135,7 @@ void primTri :: typeMess(t_symbol *type)
m_drawType = GL_POINTS;
else
{
error ("GEM: primTri: draw style");
error ("unknown draw style");
return;
}
setModified();
......
......@@ -390,7 +390,7 @@ void ripple :: ripple_bang()
{
if ( grab == -1 ){
//grab = ripple_grab();
// post("ripple: grab = %d\n",grab);
// post("grab = %d\n",grab);
}else{
grab = -1;
}
......@@ -440,7 +440,7 @@ void ripple :: typeMess(t_symbol *type)
m_drawType = GL_POLYGON;
else
{
error ("GEM: no ripple draw style?");
error ("unknown draw style?");
return;
}
setModified();
......
......@@ -74,7 +74,7 @@ void rubber :: rubber_init()
m_mass = new MASS[m_grid_sizeX*m_grid_sizeY];
if (m_mass == NULL) {
post("rubber: Can't allocate memory for masses.\n");
error("can't allocate memory for masses.\n");
return;
}
......@@ -104,7 +104,7 @@ void rubber :: rubber_init()
m_spring=new SPRING[m_spring_count];
if (m_spring == NULL) {
post("rubber: Can't allocate memory for springs.\n");
error("can't allocate memory for springs.\n");
return;
}
......@@ -350,7 +350,7 @@ void rubber :: typeMess(t_symbol *type)
case 'f': case 'F': m_drawType = GL_POLYGON; break;
case 'p': case 'P': m_drawType = GL_POINTS; break;
default:
error ("GEM: square draw style");
error ("unknown draw style");
return;
}
setModified();
......
......@@ -210,7 +210,7 @@ void slideSquares :: typeMess(t_symbol *type)
m_drawType = GL_POINTS;
else
{
error ("GEM: slideSquares draw style");
error ("unknown draw style");
return;
}
setModified();
......
......@@ -50,7 +50,7 @@ void sphere3d :: createSphere3d()
GLfloat rho=90.f, drho=0.f, theta=0.f, dtheta=0.f;
GLint i, j;
post("creating sphere %d %d", slices, stacks);
// post("creating sphere %d %d", slices, stacks);
if(m_drawType==GL_DEFAULT_GEM)m_drawType=GL_FILL;
......@@ -98,14 +98,12 @@ void sphere3d :: setMess(int i, int j,
GLfloat x, GLfloat y, GLfloat z)
{
int index=0;
post("setmess @ %d %d", i, j);
if(i<0||i>=m_numSlices){
error("[sphere3d]: slice-index must be within 0..%d", m_numSlices-1);
error("slice-index must be within 0..%d", m_numSlices-1);
return;
}
if(j<0||j>m_numStacks){
error("[sphere3d]: stack-index must be within 0..%d", m_numStacks);
error("stack-index must be within 0..%d", m_numStacks);
return;
}
......
......@@ -54,7 +54,7 @@ torus :: torus(int argc, t_atom *argv)
case 0:
break;
default:
error("GEM: torus: needs 1, 2 or 3 arguments (%d)", argc);
error("needs 1, 2 or 3 arguments (%d)", argc);
}
sizeMess(size);
......
......@@ -298,7 +298,7 @@ void tube :: rotY2Mess(float rotY2){
void tube :: slicesMess(int slices){
#ifndef __GNUC__
if(slices>TUBE_NUMPTS){
error("tube: number of slices (%d) clamped to %d", slices, TUBE_NUMPTS);
error("number of slices (%d) clamped to %d", slices, TUBE_NUMPTS);
slices=TUBE_NUMPTS;
}
#endif
......@@ -341,7 +341,7 @@ void tube :: typeMess(t_symbol *type){
case 'f': case 'F': m_drawType = GL_TRIANGLE_STRIP; break;
case 'p': case 'P': m_drawType = GL_POINTS; break;
default:
error("GEM: tube draw style");
error("unknown draw style");
return;
}
setModified();
......
......@@ -40,7 +40,7 @@ accumrotate :: accumrotate(int argc, t_atom *argv)
{ }
else
{
error("GEM: accumrotate: needs 0 or 3 arguments");
error("needs 0 or 3 arguments");
}
// create the new inlets
......
......@@ -35,7 +35,7 @@ ambient :: ambient(int argc, t_atom *argv)
else if (argc == 0) ambientMess(0.2f, 0.2f, 0.2f, 1.f);
else
{
error("GEM: ambient: needs 0, 3, or 4 arguments");
error("needs 0, 3, or 4 arguments");
ambientMess(0.2f, 0.2f, 0.2f, 1.f);
}
......
......@@ -51,7 +51,7 @@ ambientRGB :: ambientRGB(int argc, t_atom *argv)
}
else
{
error("GEM: ambientRGB: needs 0 or 3 arguments");
error("needs 0 or 3 arguments");
m_vector[0] = 0.2f;
m_vector[1] = 0.2f;
m_vector[2] = 0.2f;
......
......@@ -35,7 +35,7 @@ color :: color(int argc, t_atom *argv)
else if (argc == 0) colorMess(1.f, 1.f, 1.f, 1.f);
else
{
error("GEM: color: needs 0, 3, or 4 arguments");
error("needs 0, 3, or 4 arguments");
colorMess(1.f, 1.f, 1.f, 1.f);
}
......
......@@ -51,7 +51,7 @@ colorRGB :: colorRGB(int argc, t_atom *argv)
}
else
{
error("GEM: colorRGB: needs 0 or 3 arguments");
error("needs 0 or 3 arguments");
m_vector[0] = 1.f;
m_vector[1] = 1.f;
m_vector[2] = 1.f;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment