*/
#include "StdAfx.h"
-
-#include "gtkr_list.h"
-#include "str.h"
-
#include "DPoint.h"
-#include "DPlane.h"
-#include "DBrush.h"
-#include "DEPair.h"
-#include "DPatch.h"
-#include "DEntity.h"
+
#include "DTrainDrawer.h"
+#include "DEPair.h"
#include "misc.h"
#include "funchandlers.h"
}
void DTrainDrawer::Register() {
- __QGLTABLENAME.m_pfnHookGL2DWindow( this );
- __QGLTABLENAME.m_pfnHookGL3DWindow( this );
+ g_QglTable.m_pfnHookGL2DWindow( this );
+ g_QglTable.m_pfnHookGL3DWindow( this );
m_bHooked = TRUE;
}
void DTrainDrawer::UnRegister() {
- __QGLTABLENAME.m_pfnUnHookGL2DWindow( this );
- __QGLTABLENAME.m_pfnUnHookGL3DWindow( this );
+ g_QglTable.m_pfnUnHookGL2DWindow( this );
+ g_QglTable.m_pfnUnHookGL3DWindow( this );
m_bHooked = FALSE;
}
return;
}
- __QGLTABLENAME.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
+ g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
- __QGLTABLENAME.m_pfn_qglDisable(GL_BLEND);
- __QGLTABLENAME.m_pfn_qglDisable(GL_LINE_SMOOTH);
+ g_QglTable.m_pfn_qglDisable(GL_BLEND);
+ g_QglTable.m_pfn_qglDisable(GL_LINE_SMOOTH);
- __QGLTABLENAME.m_pfn_qglPushMatrix();
+ g_QglTable.m_pfn_qglPushMatrix();
- __QGLTABLENAME.m_pfn_qglLineWidth(2.0f);
- __QGLTABLENAME.m_pfn_qglColor4f(1.0f, 1.0f, 1.0f, 1.0f);
+ g_QglTable.m_pfn_qglLineWidth(2.0f);
+ g_QglTable.m_pfn_qglColor4f(1.0f, 1.0f, 1.0f, 1.0f);
- __QGLTABLENAME.m_pfn_qglEnable(GL_BLEND);
- __QGLTABLENAME.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- __QGLTABLENAME.m_pfn_qglDisable(GL_POLYGON_SMOOTH);
+ g_QglTable.m_pfn_qglEnable(GL_BLEND);
+ g_QglTable.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ g_QglTable.m_pfn_qglDisable(GL_POLYGON_SMOOTH);
- __QGLTABLENAME.m_pfn_qglDepthFunc(GL_ALWAYS);
+ g_QglTable.m_pfn_qglDepthFunc(GL_ALWAYS);
for(list<splinePoint_t* >::const_iterator sp = m_splineList.begin(); sp != m_splineList.end(); sp++) {
splinePoint_t* pSP = (*sp);
- __QGLTABLENAME.m_pfn_qglBegin(GL_LINE_STRIP);
+ g_QglTable.m_pfn_qglBegin(GL_LINE_STRIP);
for(list<DPoint >::const_iterator v = pSP->m_vertexList.begin(); v != pSP->m_vertexList.end(); v++) {
- __QGLTABLENAME.m_pfn_qglVertex3fv((*v)._pnt);
+ g_QglTable.m_pfn_qglVertex3fv((*v)._pnt);
}
- __QGLTABLENAME.m_pfn_qglEnd();
+ g_QglTable.m_pfn_qglEnd();
}
- __QGLTABLENAME.m_pfn_qglPopMatrix();
- __QGLTABLENAME.m_pfn_qglPopAttrib();
+ g_QglTable.m_pfn_qglPopMatrix();
+ g_QglTable.m_pfn_qglPopAttrib();
}
void DTrainDrawer::Draw2D(VIEWTYPE vt) {
return;
}
- __QGLTABLENAME.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
+ g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
- __QGLTABLENAME.m_pfn_qglDisable(GL_BLEND);
- __QGLTABLENAME.m_pfn_qglDisable(GL_LINE_SMOOTH);
+ g_QglTable.m_pfn_qglDisable(GL_BLEND);
+ g_QglTable.m_pfn_qglDisable(GL_LINE_SMOOTH);
- __QGLTABLENAME.m_pfn_qglPushMatrix();
+ g_QglTable.m_pfn_qglPushMatrix();
switch(vt)
{
case XY:
break;
case XZ:
- __QGLTABLENAME.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f);
+ g_QglTable.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f);
break;
case YZ:
- __QGLTABLENAME.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f);
- __QGLTABLENAME.m_pfn_qglRotatef(270.0f, 0.0f, 0.0f, 1.0f);
+ g_QglTable.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f);
+ g_QglTable.m_pfn_qglRotatef(270.0f, 0.0f, 0.0f, 1.0f);
break;
}
- __QGLTABLENAME.m_pfn_qglLineWidth(1.0f);
- __QGLTABLENAME.m_pfn_qglColor4f(1.0f, 0.0f, 0.0f, 0.5f);
+ g_QglTable.m_pfn_qglLineWidth(1.0f);
+ g_QglTable.m_pfn_qglColor4f(1.0f, 0.0f, 0.0f, 0.5f);
- __QGLTABLENAME.m_pfn_qglEnable(GL_BLEND);
- __QGLTABLENAME.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
- __QGLTABLENAME.m_pfn_qglDisable(GL_POLYGON_SMOOTH);
+ g_QglTable.m_pfn_qglEnable(GL_BLEND);
+ g_QglTable.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
+ g_QglTable.m_pfn_qglDisable(GL_POLYGON_SMOOTH);
- __QGLTABLENAME.m_pfn_qglDepthFunc(GL_ALWAYS);
+ g_QglTable.m_pfn_qglDepthFunc(GL_ALWAYS);
- __QGLTABLENAME.m_pfn_qglColor4f(1.f, 0.f, 0.f, 1.f);
+ g_QglTable.m_pfn_qglColor4f(1.f, 0.f, 0.f, 1.f);
for(list<splinePoint_t* >::const_iterator sp = m_splineList.begin(); sp != m_splineList.end(); sp++) {
splinePoint_t* pSP = (*sp);
- __QGLTABLENAME.m_pfn_qglBegin(GL_LINE_STRIP);
+ g_QglTable.m_pfn_qglBegin(GL_LINE_STRIP);
for(list<DPoint >::const_iterator v = pSP->m_vertexList.begin(); v != pSP->m_vertexList.end(); v++) {
- __QGLTABLENAME.m_pfn_qglVertex3fv((*v)._pnt);
+ g_QglTable.m_pfn_qglVertex3fv((*v)._pnt);
}
- __QGLTABLENAME.m_pfn_qglEnd();
+ g_QglTable.m_pfn_qglEnd();
}
- __QGLTABLENAME.m_pfn_qglPopMatrix();
- __QGLTABLENAME.m_pfn_qglPopAttrib();
+ g_QglTable.m_pfn_qglPopMatrix();
+ g_QglTable.m_pfn_qglPopAttrib();
}
void AddSplineControl(const char* control, splinePoint_t* pSP) {
}
void DTrainDrawer::BuildPaths() {
-#if 0
int count = g_FuncTable.m_pfnGetEntityCount();
DEntity e;
pSP->m_vertexList.push_front(out);
}
-#endif
+
}
void DTrainDrawer::AddControlPoint(const char* name, vec_t* origin)