]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - contrib/bobtoolz/DTrainDrawer.cpp
misc project file fixes from trunk (e.g. rev 345). fixes the 'missing MSVCR90.DLL...
[xonotic/netradiant.git] / contrib / bobtoolz / DTrainDrawer.cpp
index 35ee494d4ba00319456b641ca80ca7c62dd54f0d..f5796c809b66e6a1ac72fd78fd2cf1b76de1cd4f 100644 (file)
@@ -18,17 +18,10 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
 #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"
@@ -70,14 +63,14 @@ void DTrainDrawer::ClearPoints() {
 }
 
 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;
 }
 
@@ -112,35 +105,35 @@ void DTrainDrawer::Draw3D() {
                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) {
@@ -149,50 +142,50 @@ 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) {
@@ -203,7 +196,6 @@ void AddSplineControl(const char* control, splinePoint_t* pSP) {
 }
 
 void DTrainDrawer::BuildPaths() {
-#if 0
        int count = g_FuncTable.m_pfnGetEntityCount();
 
        DEntity e;
@@ -323,7 +315,7 @@ void DTrainDrawer::BuildPaths() {
                pSP->m_vertexList.push_front(out);
        }
 
-#endif
+
 }
 
 void DTrainDrawer::AddControlPoint(const char* name, vec_t* origin)