/*
- Copyright (C) 1999-2007 id Software, Inc. and contributors.
+ Copyright (C) 1999-2006 Id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
// Certainly better ways to do this, but this lets
// me get underway quickly with ents that need spline
// targets.
-#define MAX_CAMERAS 64
+const int MAX_CAMERAS = 64;
idCameraDef camera[MAX_CAMERAS];
idVec3 idSplineList::zero( 0,0,0 );
void glLabeledPoint( idVec3 &color, idVec3 &point, float size, const char *label ) {
- qglColor3fv( color );
- qglPointSize( size );
- qglBegin( GL_POINTS );
- qglVertex3fv( point );
- qglEnd();
+ glColor3fv( color );
+ glPointSize( size );
+ glBegin( GL_POINTS );
+ glVertex3fv( point );
+ glEnd();
idVec3 v = point;
v.x += 1;
v.y += 1;
v.z += 1;
- qglRasterPos3fv( v );
- qglCallLists( strlen( label ), GL_UNSIGNED_BYTE, label );
+ glRasterPos3fv( v );
+ glCallLists( strlen( label ), GL_UNSIGNED_BYTE, label );
}
maxs[0] += size;
maxs[1] -= size;
maxs[2] += size;
- qglColor3fv( color );
- qglBegin( GL_LINE_LOOP );
- qglVertex3f( mins[0],mins[1],mins[2] );
- qglVertex3f( maxs[0],mins[1],mins[2] );
- qglVertex3f( maxs[0],maxs[1],mins[2] );
- qglVertex3f( mins[0],maxs[1],mins[2] );
- qglEnd();
- qglBegin( GL_LINE_LOOP );
- qglVertex3f( mins[0],mins[1],maxs[2] );
- qglVertex3f( maxs[0],mins[1],maxs[2] );
- qglVertex3f( maxs[0],maxs[1],maxs[2] );
- qglVertex3f( mins[0],maxs[1],maxs[2] );
- qglEnd();
-
- qglBegin( GL_LINES );
- qglVertex3f( mins[0],mins[1],mins[2] );
- qglVertex3f( mins[0],mins[1],maxs[2] );
- qglVertex3f( mins[0],maxs[1],maxs[2] );
- qglVertex3f( mins[0],maxs[1],mins[2] );
- qglVertex3f( maxs[0],mins[1],mins[2] );
- qglVertex3f( maxs[0],mins[1],maxs[2] );
- qglVertex3f( maxs[0],maxs[1],maxs[2] );
- qglVertex3f( maxs[0],maxs[1],mins[2] );
- qglEnd();
+ glColor3fv( color );
+ glBegin( GL_LINE_LOOP );
+ glVertex3f( mins[0],mins[1],mins[2] );
+ glVertex3f( maxs[0],mins[1],mins[2] );
+ glVertex3f( maxs[0],maxs[1],mins[2] );
+ glVertex3f( mins[0],maxs[1],mins[2] );
+ glEnd();
+ glBegin( GL_LINE_LOOP );
+ glVertex3f( mins[0],mins[1],maxs[2] );
+ glVertex3f( maxs[0],mins[1],maxs[2] );
+ glVertex3f( maxs[0],maxs[1],maxs[2] );
+ glVertex3f( mins[0],maxs[1],maxs[2] );
+ glEnd();
+
+ glBegin( GL_LINES );
+ glVertex3f( mins[0],mins[1],mins[2] );
+ glVertex3f( mins[0],mins[1],maxs[2] );
+ glVertex3f( mins[0],maxs[1],maxs[2] );
+ glVertex3f( mins[0],maxs[1],mins[2] );
+ glVertex3f( maxs[0],mins[1],mins[2] );
+ glVertex3f( maxs[0],mins[1],maxs[2] );
+ glVertex3f( maxs[0],maxs[1],maxs[2] );
+ glVertex3f( maxs[0],maxs[1],mins[2] );
+ glEnd();
}
}
- qglColor3fv( controlColor );
- qglPointSize( 5 );
+ glColor3fv( controlColor );
+ glPointSize( 5 );
- qglBegin( GL_POINTS );
+ glBegin( GL_POINTS );
for ( i = 0; i < controlPoints.Num(); i++ ) {
- qglVertex3fv( *controlPoints[i] );
+ glVertex3fv( *controlPoints[i] );
}
- qglEnd();
+ glEnd();
if ( editMode ) {
for ( i = 0; i < controlPoints.Num(); i++ ) {
}
//Draw the curve
- qglColor3fv( pathColor );
- qglBegin( GL_LINE_STRIP );
+ glColor3fv( pathColor );
+ glBegin( GL_LINE_STRIP );
int count = splinePoints.Num();
for ( i = 0; i < count; i++ ) {
- qglVertex3fv( *splinePoints[i] );
+ glVertex3fv( *splinePoints[i] );
}
- qglEnd();
+ glEnd();
if ( editMode ) {
- qglColor3fv( segmentColor );
- qglPointSize( 3 );
- qglBegin( GL_POINTS );
+ glColor3fv( segmentColor );
+ glPointSize( 3 );
+ glBegin( GL_POINTS );
for ( i = 0; i < count; i++ ) {
- qglVertex3fv( *splinePoints[i] );
+ glVertex3fv( *splinePoints[i] );
}
- qglEnd();
+ glEnd();
}
if ( count > 0 ) {
//assert(activeSegment >=0 && activeSegment < count);
}
-#define NUM_CCELERATION_SEGS 10
-#define CELL_AMT 5
+const int NUM_CCELERATION_SEGS = 10;
+const int CELL_AMT = 5;
void idCameraDef::buildCamera() {
int i;
for ( i = 0; i < events.Num(); i++ ) {
events[i]->setTriggered( false );
switch ( events[i]->getType() ) {
+ default: break;
case idCameraEvent::EVENT_TARGET: {
targets.Append( i );
break;
Com_UngetToken();
idStr key = Com_ParseOnLine( text );
- const char *token = Com_Parse( text );
+ Com_Parse( text );
if ( Q_stricmp( key.c_str(), "pos" ) == 0 ) {
Com_UngetToken();
Com_Parse1DMatrix( text, 3, pos );
Com_UngetToken();
idCameraPosition::parseToken( key.c_str(), text );
}
- token = Com_Parse( text );
+ Com_Parse( text );
} while ( 1 );
Com_UngetToken();
idStr key = Com_ParseOnLine( text );
- const char *token = Com_Parse( text );
+ Com_Parse( text );
if ( Q_stricmp( key.c_str(), "startPos" ) == 0 ) {
Com_UngetToken();
Com_Parse1DMatrix( text, 3, startPos );
Com_UngetToken();
idCameraPosition::parseToken( key.c_str(), text );
}
- token = Com_Parse( text );
+ Com_Parse( text );
} while ( 1 );
Com_UngetToken();
idStr key = Com_ParseOnLine( text );
- const char *token = Com_Parse( text );
+ Com_Parse( text );
if ( Q_stricmp( key.c_str(), "target" ) == 0 ) {
target.parse( text );
}
Com_UngetToken();
idCameraPosition::parseToken( key.c_str(), text );
}
- token = Com_Parse( text );
+ Com_Parse( text );
} while ( 1 );