ported PrtView plugin
authorspog <spog>
Sun, 26 Mar 2006 03:13:17 +0000 (03:13 +0000)
committerspog <spog>
Sun, 26 Mar 2006 03:13:17 +0000 (03:13 +0000)
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@40 8a3a26a2-13c4-0310-b231-cf6edde360e5

50 files changed:
GtkRadiant.sln
SConscript
TODO
contrib/bobtoolz/DPatch.cpp
contrib/prtview/AboutDialog.cpp
contrib/prtview/AboutDialog.h
contrib/prtview/ConfigDialog.cpp
contrib/prtview/ConfigDialog.h
contrib/prtview/LoadPortalFileDialog.cpp
contrib/prtview/LoadPortalFileDialog.h
contrib/prtview/PrtView.def
contrib/prtview/PrtView.rc [deleted file]
contrib/prtview/PrtView.vcproj
contrib/prtview/gtkdlgs.cpp [deleted file]
contrib/prtview/gtkdlgs.h [deleted file]
contrib/prtview/portals.cpp
contrib/prtview/portals.h
contrib/prtview/prtview.cpp
contrib/prtview/prtview.h
contrib/prtview/resource.h [deleted file]
contrib/prtview/stdafx.cpp [deleted file]
contrib/prtview/stdafx.h [deleted file]
include/iglrender.cpp [new file with mode: 0644]
include/iglrender.h [new file with mode: 0644]
include/include.vcproj
include/irender.h
include/qerplugin.h
libs/profile/profile.cpp
libs/profile/profile.h
libs/render.h
plugins/archivepak/archivepak.vcproj
plugins/archivewad/archivewad.vcproj
plugins/archivezip/archivezip.vcproj
plugins/entity/entityq3.vcproj
plugins/image/imageq3.vcproj
plugins/imagehl/imagehl.vcproj
plugins/imagepng/imagepng.vcproj
plugins/imageq2/imageq2.vcproj
plugins/mapq3/mapq3.vcproj
plugins/mapxml/mapxml.vcproj
plugins/md3model/modelmd3.vcproj
plugins/model/modelpico.vcproj
plugins/sample/sample.vcproj
plugins/shaders/shadersq3.vcproj
plugins/vfspk3/vfsq3.vcproj
radiant/GtkRadiant.vcproj
radiant/camwindow.cpp
radiant/plugin.cpp
radiant/renderstate.cpp
radiant/xywindow.cpp

index 179159f..7ee5bd3 100644 (file)
@@ -141,6 +141,11 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "gtkutil", "libs\gtkutil\gtk
        ProjectSection(ProjectDependencies) = postProject\r
        EndProjectSection\r
 EndProject\r
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PrtView", "contrib\prtview\PrtView.vcproj", "{B20364D1-4329-4D4E-B9CE-C9767618FDD6}"\r
+       ProjectSection(ProjectDependencies) = postProject\r
+               {853632F4-6420-40C5-B80B-38B678E472B8} = {853632F4-6420-40C5-B80B-38B678E472B8}\r
+       EndProjectSection\r
+EndProject\r
 Global\r
        GlobalSection(SolutionConfiguration) = preSolution\r
                Debug = Debug\r
@@ -263,6 +268,10 @@ Global
                {68E2C6B6-96CA-4BBD-A485-FEE6F2E65407}.Debug.Build.0 = Debug|Win32\r
                {68E2C6B6-96CA-4BBD-A485-FEE6F2E65407}.Release.ActiveCfg = Release|Win32\r
                {68E2C6B6-96CA-4BBD-A485-FEE6F2E65407}.Release.Build.0 = Release|Win32\r
+               {B20364D1-4329-4D4E-B9CE-C9767618FDD6}.Debug.ActiveCfg = Debug|Win32\r
+               {B20364D1-4329-4D4E-B9CE-C9767618FDD6}.Debug.Build.0 = Debug|Win32\r
+               {B20364D1-4329-4D4E-B9CE-C9767618FDD6}.Release.ActiveCfg = Release|Win32\r
+               {B20364D1-4329-4D4E-B9CE-C9767618FDD6}.Release.Build.0 = Release|Win32\r
        EndGlobalSection\r
        GlobalSection(ExtensibilityGlobals) = postSolution\r
        EndGlobalSection\r
index e6e08fb..46b34f6 100644 (file)
@@ -464,12 +464,13 @@ module_env.Install(INSTALL + '/modules', entity_lib)
 #bob_env.SharedLibrarySafe(target='camera', source=camera_lst)
 #bob_env.Install(INSTALL + '/plugins', 'camera.so')
 
-#prtview_lst = build_list('contrib/prtview', 
-#'AboutDialog.cpp ConfigDialog.cpp LoadPortalFileDialog.cpp portals.cpp prtview.cpp')
-#prtview_env = bob_env.Copy()
-#prtview_env['CXXFLAGS'] += '-DGTK_PLUGIN '
-#prtview_env.SharedLibrarySafe(target='prtview', source=prtview_lst)
-#prtview_env.Install(INSTALL + '/plugins', 'prtview.so')
+prtview_env = module_env.Copy()
+prtview_lst = build_list('contrib/prtview', 'AboutDialog.cpp ConfigDialog.cpp LoadPortalFileDialog.cpp portals.cpp prtview.cpp')
+prtview_env.useGlib2()
+prtview_env.useGtk2()
+prtview_lib = prtview_env.SharedLibrarySafe(target='prtview', source=prtview_lst, LIBS='profile', LIBPATH='libs')
+prtview_env.Depends(prtview_lib, profile_lib)
+prtview_env.Install(INSTALL + '/plugins', prtview_lib)
 
 #gensurf_lst = build_list('contrib/gtkgensurf',
 #'bitmap.cpp dec.cpp face.cpp font.cpp gendlgs.cpp genmap.cpp gensurf.cpp heretic.cpp plugin.cpp view.cpp triangle.c')
diff --git a/TODO b/TODO
index bb6c0e2..1cbf030 100644 (file)
--- a/TODO
+++ b/TODO
@@ -10,7 +10,6 @@ UI: changing resolution in floating-windows mode can screw up window positions.
 HalfLife: half-life maps saved in q1 map format are not supported - currently have to convert them to hammer map format using hammer editor. And vice versa.
 Entity: creating a new entity with all the brushes of another entity selected results in the latter entity having no brushes.
 SConscript: build fails if SETUP=1
-Brush: non-BP auto-texture-fit fails when rotation is 90
 GUI: can't use arrow keys to navigate in camera view when capslock is enabled
 GUI: screensaver causes: gdkgc-win32.c: line 905 (gdk_win32_hdc_get): assertion failed: (win32_gc->hdc == NULL)
 
index 1c0ee38..50bca9f 100644 (file)
@@ -205,7 +205,7 @@ void Build1dArray(vec3_t* array, drawVert_t points[MAX_PATCH_WIDTH][MAX_PATCH_HE
 void Print1dArray(vec3_t* array, int size)
 {
        for(int i = 0; i < size; i++)
-               Sys_Printf("(%.0f %.0f %.0f)\t", array[i][0], array[i][1], array[i][2]);
+               Sys_Printf("(" << array[i][0] << " " << array[i][1] << " " << array[i][2] << ")\t");
        Sys_Printf("\n");
 }
 
index 3bb3a33..5c7ce5f 100644 (file)
@@ -17,21 +17,12 @@ License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-// AboutDialog.cpp : implementation file
-//
+#include "AboutDialog.h"
+#include <gtk/gtk.h>
+#include "version.h"
 
-#include "stdafx.h"
-
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-//static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CAboutDialog dialog
-
-#ifdef GTK_PLUGIN
+#include "PrtView.h"
+#include "ConfigDialog.h"
 
 static void dialog_button_callback (GtkWidget *widget, gpointer data)
 {
@@ -107,33 +98,6 @@ void DoAboutDlg ()
   gtk_widget_destroy (dlg);
 }
 
-#else // GTK_PLUGIN
-
-CAboutDialog::CAboutDialog(CWnd* pParent /*=NULL*/)
-       : CDialog(CAboutDialog::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(CAboutDialog)
-               // NOTE: the ClassWizard will add member initialization here
-       //}}AFX_DATA_INIT
-}
-
-
-void CAboutDialog::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(CAboutDialog)
-               // NOTE: the ClassWizard will add DDX and DDV calls here
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CAboutDialog, CDialog)
-       //{{AFX_MSG_MAP(CAboutDialog)
-               // NOTE: the ClassWizard will add message map macros here
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-#endif // GTK_PLUGIN
 
 /////////////////////////////////////////////////////////////////////////////
 // CAboutDialog message handlers
index 66d8c0d..bf72885 100644 (file)
@@ -17,56 +17,9 @@ License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#if !defined(AFX_ABOUTDIALOG_H__FA3BE6A2_1F1F_11D4_BFF1_204C4F4F5020__INCLUDED_)
-#define AFX_ABOUTDIALOG_H__FA3BE6A2_1F1F_11D4_BFF1_204C4F4F5020__INCLUDED_
+#if !defined(INCLUDED_ABOUTDIALOG_H)
+#define INCLUDED_ABOUTDIALOG_H
 
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-// AboutDialog.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CAboutDialog dialog
-
-#ifdef GTK_PLUGIN
 void DoAboutDlg ();
 
-#else // GTK_PLUGIN
-
-class CAboutDialog : public CDialog
-{
-// Construction
-public:
-       CAboutDialog(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(CAboutDialog)
-       enum { IDD = IDD_ABOUT };
-               // NOTE: the ClassWizard will add data members here
-       //}}AFX_DATA
-
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(CAboutDialog)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(CAboutDialog)
-               // NOTE: the ClassWizard will add member functions here
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-#endif // GTK_PLUGIN
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_ABOUTDIALOG_H__FA3BE6A2_1F1F_11D4_BFF1_204C4F4F5020__INCLUDED_)
+#endif
index 43d5f91..8dbd0b8 100644 (file)
@@ -17,22 +17,14 @@ License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-// ConfigDialog.cpp : implementation file
-//
-
-#include "stdafx.h"
+#include "ConfigDialog.h"
 #include <stdio.h>
+#include <gtk/gtk.h>
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-//static char THIS_FILE[] = __FILE__;
-#endif
-
-/////////////////////////////////////////////////////////////////////////////
-// CConfigDialog dialog
+#include "iscenegraph.h"
 
-#ifdef GTK_PLUGIN
+#include "PrtView.h"
+#include "Portals.h"
 
 static void dialog_button_callback (GtkWidget *widget, gpointer data)
 {
@@ -61,10 +53,10 @@ static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer
 // =============================================================================
 // Color selection dialog
 
-static int DoColor (COLORREF *c)
+static int DoColor (PackedColour *c)
 {
   GtkWidget* dlg;
-  double clr[3];
+  double clr[4];
   int loop = 1, ret = IDCANCEL;
 
   clr[0] = ((double)GetRValue (*c)) / 255.0;
@@ -144,8 +136,8 @@ static void OnScroll2d (GtkAdjustment *adj, gpointer data)
   portals.width_2d = static_cast<float>(adj->value);
   Set2DText (GTK_WIDGET (data));
 
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D);
+  Portals_shadersChanged();
+  SceneChangeNotify();
 }
 
 static void OnScroll3d (GtkAdjustment *adj, gpointer data)
@@ -153,8 +145,7 @@ static void OnScroll3d (GtkAdjustment *adj, gpointer data)
   portals.width_3d = static_cast<float>(adj->value);
   Set3DText (GTK_WIDGET (data));
 
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
+  SceneChangeNotify();
 }
 
 static void OnScrollTrans (GtkAdjustment *adj, gpointer data)
@@ -162,8 +153,7 @@ static void OnScrollTrans (GtkAdjustment *adj, gpointer data)
   portals.trans_3d = static_cast<float>(adj->value);
   Set3DTransText (GTK_WIDGET (data));
 
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
+  SceneChangeNotify();
 }
 
 static void OnScrollClip (GtkAdjustment *adj, gpointer data)
@@ -171,62 +161,58 @@ static void OnScrollClip (GtkAdjustment *adj, gpointer data)
   portals.clip_range = static_cast<float>(adj->value);
   SetClipText (GTK_WIDGET (data));
 
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
+  SceneChangeNotify();
 }
 
 static void OnAntiAlias2d (GtkWidget *widget, gpointer data)
 {
-  portals.aa_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? qtrue : qfalse;
+  portals.aa_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? true : false;
+
+  Portals_shadersChanged();
 
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D);
+  SceneChangeNotify();
 }
 
 static void OnConfig2d (GtkWidget *widget, gpointer data)
 {
-  portals.show_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? qtrue : qfalse;
+  portals.show_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? true : false;
 
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D);
+  SceneChangeNotify();
 }
 
 static void OnColor2d (GtkWidget *widget, gpointer data)
 {
   if (DoColor (&portals.color_2d) == IDOK)
   {
-    portals.FixColors();
+    Portals_shadersChanged();
 
-    if(interfaces_started)
-      g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D);
+    SceneChangeNotify();
   }
 }
 
 static void OnConfig3d (GtkWidget *widget, gpointer data)
 {
-  portals.show_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? qtrue : qfalse;
+  portals.show_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? true : false;
 
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
+  SceneChangeNotify();
 }
 
 
 static void OnAntiAlias3d (GtkWidget *widget, gpointer data)
 {
-  portals.aa_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? qtrue : qfalse;
+  portals.aa_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? true : false;
 
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
+  Portals_shadersChanged();
+  SceneChangeNotify();
 }
 
 static void OnColor3d (GtkWidget *widget, gpointer data)
 {
   if (DoColor (&portals.color_3d) == IDOK)
   {
-    portals.FixColors();
+    Portals_shadersChanged();
 
-    if(interfaces_started)
-      g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
+    SceneChangeNotify();
   }
 }
 
@@ -234,51 +220,47 @@ static void OnColorFog (GtkWidget *widget, gpointer data)
 {
   if (DoColor (&portals.color_fog) == IDOK)
   {
-    portals.FixColors();
+    Portals_shadersChanged();
 
-    if(interfaces_started)
-      g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
+    SceneChangeNotify();
   }
 }
 
 static void OnFog (GtkWidget *widget, gpointer data)
 {
-  portals.fog = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? qtrue : qfalse;
+  portals.fog = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? true : false;
 
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
+  Portals_shadersChanged();
+  SceneChangeNotify();
 }
 
 static void OnSelchangeZbuffer (GtkWidget *widget, gpointer data)
 {
   portals.zbuffer = GPOINTER_TO_INT (data);
 
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
+  Portals_shadersChanged();
+  SceneChangeNotify();
 }
 
 static void OnPoly (GtkWidget *widget, gpointer data)
 {
   portals.polygons = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
 
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
+  SceneChangeNotify();
 }
 
 static void OnLines (GtkWidget *widget, gpointer data)
 {
   portals.lines = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
 
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
+  SceneChangeNotify();
 }
 
 static void OnClip (GtkWidget *widget, gpointer data)
 {
-  portals.clip = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? qtrue : qfalse;
+  portals.clip = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)) ? true : false;
 
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
+  SceneChangeNotify();
 }
 
 void DoConfigDialog ()
@@ -541,385 +523,3 @@ void DoConfigDialog ()
   gtk_widget_destroy (dlg);
 }
 
-#else // GTK_PLUGIN
-
-CConfigDialog::CConfigDialog(CWnd* pParent /*=NULL*/)
-       : CDialog(CConfigDialog::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(CConfigDialog)
-       //}}AFX_DATA_INIT
-}
-
-
-void CConfigDialog::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(CConfigDialog)
-       DDX_Control(pDX, IDC_CLIP, m_clip_ctrl);
-       DDX_Control(pDX, IDC_CUBIC, m_cubic_ctrl);
-       DDX_Control(pDX, IDC_SCROLL_CUBIC, m_scroll_cubic_ctrl);
-       DDX_Control(pDX, IDC_LINES, m_line_ctrl);
-       DDX_Control(pDX, IDC_SCROLL_3D_TRANS, m_scroll_3d_trans_ctrl);
-       DDX_Control(pDX, IDC_3D_TRANS, m_3d_trans_ctrl);
-       DDX_Control(pDX, IDC_POLY, m_poly_ctrl);
-       DDX_Control(pDX, IDC_FOG, m_fog_ctrl);
-       DDX_Control(pDX, IDC_ZBUFFER, m_z_ctrl);
-       DDX_Control(pDX, IDC_SCROLL_3D_WIDTH, m_scroll_3d_width_ctrl);
-       DDX_Control(pDX, IDC_ANTI_ALIAS_3D, m_aa_3d_ctrl);
-       DDX_Control(pDX, IDC_3D_WIDTH, m_3d_width_ctrl);
-       DDX_Control(pDX, IDC_ANTI_ALIAS_2D, m_aa_2d_ctrl);
-       DDX_Control(pDX, IDC_SCROLL_2D_WIDTH, m_scroll_2d_width_ctrl);
-       DDX_Control(pDX, IDC_2D_WIDTH, m_2d_width_ctrl);
-       DDX_Control(pDX, IDC_CONFIG_3D, m_3d_ctrl);
-       DDX_Control(pDX, IDC_CONFIG_2D, m_2d_ctrl);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CConfigDialog, CDialog)
-       //{{AFX_MSG_MAP(CConfigDialog)
-       ON_WM_HSCROLL()
-       ON_BN_CLICKED(IDC_ANTI_ALIAS_2D, OnAntiAlias2d)
-       ON_BN_CLICKED(IDC_CONFIG_2D, OnConfig2d)
-       ON_BN_CLICKED(IDC_CONFIG_3D, OnConfig3d)
-       ON_BN_CLICKED(IDC_COLOR_2D, OnColor2d)
-       ON_BN_CLICKED(IDC_ANTI_ALIAS_3D, OnAntiAlias3d)
-       ON_BN_CLICKED(IDC_COLOR_3D, OnColor3d)
-       ON_BN_CLICKED(IDC_COLOR_FOG, OnColorFog)
-       ON_BN_CLICKED(IDC_FOG, OnFog)
-       ON_CBN_SELCHANGE(IDC_ZBUFFER, OnSelchangeZbuffer)
-       ON_BN_CLICKED(IDC_POLY, OnPoly)
-       ON_BN_CLICKED(IDC_LINES, OnLines)
-       ON_BN_CLICKED(IDC_CLIP, OnClip)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-/////////////////////////////////////////////////////////////////////////////
-// CConfigDialog message handlers
-
-void CConfigDialog::Set2DText()
-{
-       char s[40];
-
-       sprintf(s, "Line Width = %6.3f", portals.width_2d * 0.5f);
-
-       m_2d_width_ctrl.SetWindowText(s);
-}
-
-void CConfigDialog::Set3DText()
-{
-       char s[40];
-
-       sprintf(s, "Line Width = %6.3f", portals.width_3d * 0.5f);
-
-       m_3d_width_ctrl.SetWindowText(s);
-}
-
-void CConfigDialog::Set3DTransText()
-{
-       char s[40];
-
-       sprintf(s, "Polygon transparency = %d%%", (int)portals.trans_3d);
-
-       m_3d_trans_ctrl.SetWindowText(s);
-}
-
-void CConfigDialog::SetClipText()
-{
-       char s[40];
-
-       sprintf(s, "Cubic clip range = %d", (int)portals.clip_range * 64);
-
-       m_cubic_ctrl.SetWindowText(s);
-}
-
-bool CConfigDialog::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-
-       m_2d_ctrl.SetCheck(portals.show_2d);
-       m_aa_2d_ctrl.SetCheck(portals.aa_2d);
-       Set2DText();
-
-       m_scroll_2d_width_ctrl.SetScrollRange(2, 40, FALSE);
-       m_scroll_2d_width_ctrl.SetScrollPos((int)portals.width_2d, TRUE);
-
-       m_3d_ctrl.SetCheck(portals.show_3d);
-       m_fog_ctrl.SetCheck(portals.fog);
-       m_poly_ctrl.SetCheck(portals.polygons);
-       m_line_ctrl.SetCheck(portals.lines);
-       m_aa_3d_ctrl.SetCheck(portals.aa_3d);
-       m_z_ctrl.SetCurSel(portals.zbuffer);
-       m_clip_ctrl.SetCheck(portals.clip);
-
-       Set3DText();
-       Set3DTransText();
-       SetClipText();
-
-       m_scroll_3d_width_ctrl.SetScrollRange(2, 40, FALSE);
-       m_scroll_3d_width_ctrl.SetScrollPos((int)portals.width_3d, TRUE);
-       m_scroll_3d_trans_ctrl.SetScrollRange(0, 100, FALSE);
-       m_scroll_3d_trans_ctrl.SetScrollPos((int)portals.trans_3d, TRUE);
-       m_scroll_cubic_ctrl.SetScrollRange(1, 128, FALSE);
-       m_scroll_cubic_ctrl.SetScrollPos((int)portals.clip_range, TRUE);
-       
-       return true;  // return TRUE unless you set the focus to a control
-                     // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void CConfigDialog::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) 
-{
-       float *adj;
-       float scr_min, scr_max, scr_big;
-
-       if(nSBCode == SB_THUMBPOSITION)
-       {
-               CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
-               return;
-       }
-
-       if(pScrollBar == &m_scroll_2d_width_ctrl)
-       {
-               scr_min = 2.0f;
-               scr_max = 40.0f;
-               scr_big = 4.0f;
-
-               adj = &portals.width_2d;
-       }
-       else if(pScrollBar == &m_scroll_3d_width_ctrl)
-       {
-               scr_min = 2.0f;
-               scr_max = 40.0f;
-               scr_big = 4.0f;
-
-               adj = &portals.width_3d;
-       }
-       else if(pScrollBar == &m_scroll_3d_trans_ctrl)
-       {
-               scr_min = 0.0f;
-               scr_max = 100.0f;
-               scr_big = 10.0f;
-
-               adj = &portals.trans_3d;
-       }
-       else if(pScrollBar == &m_scroll_cubic_ctrl)
-       {
-               scr_min = 1.0f;
-               scr_max = 128.0f;
-               scr_big = 8.0f;
-
-               adj = &portals.clip_range;
-       }
-       else
-       {
-               CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
-               return;
-       }
-
-       switch(nSBCode)
-       {
-       case SB_LEFT:
-               *adj = scr_min;
-               pScrollBar->SetScrollPos((int)scr_min, TRUE);
-               break;
-       case SB_RIGHT:
-               *adj = scr_max;
-               pScrollBar->SetScrollPos((int)scr_max, TRUE);
-               break;
-       case SB_LINELEFT:
-               *adj -= 1.0f;
-               
-               if(*adj < scr_min)
-                       *adj = scr_min;
-
-               pScrollBar->SetScrollPos((int)(*adj), TRUE);
-
-               break;
-       case SB_LINERIGHT:
-               *adj += 1.0f;
-               
-               if(*adj > scr_max)
-                       *adj = scr_max;
-
-               pScrollBar->SetScrollPos((int)(*adj), TRUE);
-
-               break;
-       case SB_PAGELEFT:
-               *adj -= scr_big;
-               
-               if(*adj < scr_min)
-                       *adj = scr_min;
-
-               pScrollBar->SetScrollPos((int)(*adj), TRUE);
-
-               break;
-       case SB_PAGERIGHT:
-               *adj += scr_big;
-               
-               if(*adj > scr_max)
-                       *adj = scr_max;
-
-               pScrollBar->SetScrollPos((int)(*adj), TRUE);
-
-               break;
-       case SB_THUMBTRACK:
-               *adj = (float)nPos;
-
-               break;
-       case SB_ENDSCROLL:
-               pScrollBar->SetScrollPos((int)(*adj), TRUE);
-
-               break;
-       default:
-               CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
-       }
-
-       if(pScrollBar == &m_scroll_2d_width_ctrl)
-       {
-               Set2DText();
-
-               if(interfaces_started)
-                       g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D);
-       }
-       else if(pScrollBar == &m_scroll_3d_width_ctrl)
-       {
-               Set3DText();
-
-               if(interfaces_started)
-                       g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-       }
-       else if(pScrollBar == &m_scroll_3d_trans_ctrl)
-       {
-               Set3DTransText();
-
-               if(interfaces_started)
-                       g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-       }
-       else if(pScrollBar == &m_scroll_cubic_ctrl)
-       {
-               SetClipText();
-
-               if(interfaces_started)
-                       g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-       }
-}
-
-void CConfigDialog::OnAntiAlias2d() 
-{
-       portals.aa_2d = m_aa_2d_ctrl.GetCheck();
-
-       if(interfaces_started)
-               g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D);
-}
-
-void CConfigDialog::OnConfig2d() 
-{
-       portals.show_2d = m_2d_ctrl.GetCheck();
-
-       if(interfaces_started)
-               g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D);
-}
-
-void CConfigDialog::OnColor2d() 
-{
-       CColorDialog dlg(portals.color_2d, CC_ANYCOLOR, this);
-
-       if(dlg.DoModal() == IDOK)
-       {
-               portals.color_2d = dlg.GetColor();
-
-               portals.FixColors();
-
-               if(interfaces_started)
-                       g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D);
-       }
-}
-
-void CConfigDialog::OnConfig3d() 
-{
-       portals.show_3d = m_3d_ctrl.GetCheck();
-
-       if(interfaces_started)
-               g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-
-void CConfigDialog::OnAntiAlias3d() 
-{
-       portals.aa_3d = m_aa_3d_ctrl.GetCheck();
-
-       if(interfaces_started)
-               g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-void CConfigDialog::OnColor3d() 
-{
-       CColorDialog dlg(portals.color_3d, CC_ANYCOLOR, this);
-
-       if(dlg.DoModal() == IDOK)
-       {
-               portals.color_3d = dlg.GetColor();
-
-               portals.FixColors();
-
-               if(interfaces_started)
-                       g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-       }
-}
-
-void CConfigDialog::OnColorFog() 
-{
-       CColorDialog dlg(portals.color_fog, CC_ANYCOLOR, this);
-
-       if(dlg.DoModal() == IDOK)
-       {
-               portals.color_fog = dlg.GetColor();
-
-               portals.FixColors();
-
-               if(interfaces_started)
-                       g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-       }
-}
-
-void CConfigDialog::OnFog() 
-{
-       portals.fog = m_fog_ctrl.GetCheck();
-
-       if(interfaces_started)
-               g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-void CConfigDialog::OnSelchangeZbuffer() 
-{
-       portals.zbuffer = m_z_ctrl.GetCurSel();
-
-       if(interfaces_started)
-               g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-void CConfigDialog::OnPoly() 
-{
-       portals.polygons = m_poly_ctrl.GetCheck();
-
-       if(interfaces_started)
-               g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-void CConfigDialog::OnLines() 
-{
-       portals.lines = m_line_ctrl.GetCheck();
-
-       if(interfaces_started)
-               g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-void CConfigDialog::OnClip() 
-{
-       portals.clip = m_clip_ctrl.GetCheck();
-
-       if(interfaces_started)
-               g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-#endif // GTK_PLUGIN
index 11690fd..ef35db0 100644 (file)
@@ -17,91 +17,9 @@ License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#if !defined(AFX_CONFIGDIALOG_H__E484E672_2088_11D4_BFFA_204C4F4F5020__INCLUDED_)
-#define AFX_CONFIGDIALOG_H__E484E672_2088_11D4_BFFA_204C4F4F5020__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-// ConfigDialog.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CConfigDialog dialog
-
-#ifdef GTK_PLUGIN
+#if !defined(INCLUDED_CONFIGDIALOG_H)
+#define INCLUDED_CONFIGDIALOG_H
 
 void DoConfigDialog ();
 
-#else
-
-class CConfigDialog : public CDialog
-{
-// Construction
-public:
-       CConfigDialog(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(CConfigDialog)
-       enum { IDD = IDD_CONFIG };
-       CButton m_clip_ctrl;
-       CStatic m_cubic_ctrl;
-       CScrollBar      m_scroll_cubic_ctrl;
-       CButton m_line_ctrl;
-       CScrollBar      m_scroll_3d_trans_ctrl;
-       CStatic m_3d_trans_ctrl;
-       CButton m_poly_ctrl;
-       CButton m_fog_ctrl;
-       CComboBox       m_z_ctrl;
-       CScrollBar      m_scroll_3d_width_ctrl;
-       CButton m_aa_3d_ctrl;
-       CStatic m_3d_width_ctrl;
-       CButton m_aa_2d_ctrl;
-       CScrollBar      m_scroll_2d_width_ctrl;
-       CStatic m_2d_width_ctrl;
-       CButton m_3d_ctrl;
-       CButton m_2d_ctrl;
-       //}}AFX_DATA
-
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(CConfigDialog)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       void Set2DText();
-       void Set3DText();
-       void Set3DTransText();
-       void SetClipText();
-
-       // Generated message map functions
-       //{{AFX_MSG(CConfigDialog)
-       virtual qboolean OnInitDialog();
-       afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
-       afx_msg void OnAntiAlias2d();
-       afx_msg void OnConfig2d();
-       afx_msg void OnConfig3d();
-       afx_msg void OnColor2d();
-       afx_msg void OnAntiAlias3d();
-       afx_msg void OnColor3d();
-       afx_msg void OnColorFog();
-       afx_msg void OnFog();
-       afx_msg void OnSelchangeZbuffer();
-       afx_msg void OnPoly();
-       afx_msg void OnLines();
-       afx_msg void OnClip();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-#endif // GTK_PLUGIN
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_CONFIGDIALOG_H__E484E672_2088_11D4_BFFA_204C4F4F5020__INCLUDED_)
+#endif
index 13d780c..4444c3f 100644 (file)
@@ -20,15 +20,16 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 // LoadPortalFileDialog.cpp : implementation file
 //
 
-#include "stdafx.h"
+#include "LoadPortalFileDialog.h"
 
-#ifdef _DEBUG
-#define new DEBUG_NEW
-#undef THIS_FILE
-//static char THIS_FILE[] = __FILE__;
-#endif
+#include <gtk/gtk.h>
+#include "stream/stringstream.h"
+#include "convert.h"
 
-#ifdef GTK_PLUGIN
+#include "qerplugin.h"
+
+#include "PrtView.h"
+#include "Portals.h"
 
 static void dialog_button_callback (GtkWidget *widget, gpointer data)
 {
@@ -165,14 +166,16 @@ int DoLoadPortalFileDialog ()
                      GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK));
   gtk_widget_set_usize (button, 60, -2);
 
-  strcpy (portals.fn, g_FuncTable.m_pfnGetMapName());
+  strcpy (portals.fn, GlobalRadiant().getMapName());
   char* fn = strrchr (portals.fn, '.');
   if (fn != NULL)
   {
     strcpy(fn, ".prt");
   }
 
-  gtk_entry_set_text (GTK_ENTRY (entry), portals.fn);
+  StringOutputStream value(256);
+  value << ConvertLocaleToUTF8(portals.fn);
+  gtk_entry_set_text (GTK_ENTRY (entry), value.c_str());
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check2d), portals.show_2d);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check3d), portals.show_3d);
 
@@ -186,8 +189,8 @@ int DoLoadPortalFileDialog ()
   {
     portals.Purge();
 
-    portals.show_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check3d)) ? qtrue : qfalse;
-    portals.show_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check2d)) ? qtrue : qfalse;
+    portals.show_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check3d)) ? true : false;
+    portals.show_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check2d)) ? true : false;
   }
 
   gtk_grab_remove (dlg);
@@ -195,92 +198,3 @@ int DoLoadPortalFileDialog ()
 
   return ret;
 }
-
-#else // GTK_PLUGIN
-
-/////////////////////////////////////////////////////////////////////////////
-// CLoadPortalFileDialog dialog
-
-CLoadPortalFileDialog::CLoadPortalFileDialog(CWnd* pParent /*=NULL*/)
-       : CDialog(CLoadPortalFileDialog::IDD, pParent)
-{
-       //{{AFX_DATA_INIT(CLoadPortalFileDialog)
-               // NOTE: the ClassWizard will add member initialization here
-       //}}AFX_DATA_INIT
-}
-
-
-void CLoadPortalFileDialog::DoDataExchange(CDataExchange* pDX)
-{
-       CDialog::DoDataExchange(pDX);
-       //{{AFX_DATA_MAP(CLoadPortalFileDialog)
-       DDX_Control(pDX, IDC_LOAD_3D, m_3d_ctrl);
-       DDX_Control(pDX, IDC_LOAD_2D, m_2d_ctrl);
-       DDX_Control(pDX, IDC_LOAD_FILE_NAME, m_fn_ctrl);
-       //}}AFX_DATA_MAP
-}
-
-
-BEGIN_MESSAGE_MAP(CLoadPortalFileDialog, CDialog)
-       //{{AFX_MSG_MAP(CLoadPortalFileDialog)
-       ON_BN_CLICKED(IDC_LOAD_OTHER, OnLoadOther)
-       //}}AFX_MSG_MAP
-END_MESSAGE_MAP()
-
-
-/////////////////////////////////////////////////////////////////////////////
-// CLoadPortalFileDialog message handlers
-
-bool CLoadPortalFileDialog::OnInitDialog() 
-{
-       CDialog::OnInitDialog();
-
-       char fn_drive[_MAX_DRIVE];
-       char fn_dir[_MAX_DIR];
-       char fn_name[_MAX_FNAME];
-       char fn_ext[_MAX_EXT];
-
-       char *fn = g_IBSPTable.m_pfnGetMapName();
-
-       _fullpath(portals.fn, fn, _MAX_PATH);
-       _splitpath(fn, fn_drive, fn_dir, fn_name, fn_ext);
-
-       strcpy(portals.fn, fn_drive);
-       strcat(portals.fn, fn_dir);
-       strcat(portals.fn, fn_name);
-       strcat(portals.fn, ".prt");
-
-       m_fn_ctrl.SetWindowText(portals.fn);
-
-       m_2d_ctrl.SetCheck(portals.show_2d);
-       m_3d_ctrl.SetCheck(portals.show_3d);
-
-       return true;  // return TRUE unless you set the focus to a control
-                     // EXCEPTION: OCX Property Pages should return FALSE
-}
-
-void CLoadPortalFileDialog::OnOK() 
-{
-       portals.Purge();
-
-       portals.show_3d = m_3d_ctrl.GetCheck();
-       portals.show_2d = m_2d_ctrl.GetCheck();
-       
-       CDialog::OnOK();
-}
-
-void CLoadPortalFileDialog::OnLoadOther() 
-{
-       CFileDialog dlg(TRUE, "prt", portals.fn, OFN_NOCHANGEDIR | OFN_HIDEREADONLY | OFN_LONGNAMES | OFN_FILEMUSTEXIST,
-               "Portal files (*.prt)|*.prt|All Files (*.*)|*.*||", NULL);
-
-       dlg.m_ofn.lpstrTitle = "Locate portal file";
-
-       if(IDOK == dlg.DoModal())
-       {
-               _fullpath(portals.fn, dlg.GetPathName().GetBuffer(1), _MAX_PATH);
-               m_fn_ctrl.SetWindowText(portals.fn);
-       }
-}
-
-#endif // GTK_PLUGIN
index 4540c10..a4a40c6 100644 (file)
@@ -17,61 +17,10 @@ License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#if !defined(AFX_LOADPORTALFILEDIALOG_H__6BEDE392_1FDC_11D4_BFF7_204C4F4F5020__INCLUDED_)
-#define AFX_LOADPORTALFILEDIALOG_H__6BEDE392_1FDC_11D4_BFF7_204C4F4F5020__INCLUDED_
-
-#if _MSC_VER >= 1000
-#pragma once
-#endif // _MSC_VER >= 1000
-// LoadPortalFileDialog.h : header file
-//
-
-/////////////////////////////////////////////////////////////////////////////
-// CLoadPortalFileDialog dialog
-
-#ifdef GTK_PLUGIN
+#if !defined(INCLUDED_LOADPORTALFILEDIALOG_H)
+#define INCLUDED_LOADPORTALFILEDIALOG_H
 
 int DoLoadPortalFileDialog ();
 
-#else
-
-class CLoadPortalFileDialog : public CDialog
-{
-// Construction
-public:
-       CLoadPortalFileDialog(CWnd* pParent = NULL);   // standard constructor
-
-// Dialog Data
-       //{{AFX_DATA(CLoadPortalFileDialog)
-       enum { IDD = IDD_LOAD };
-       CButton m_3d_ctrl;
-       CButton m_2d_ctrl;
-       CStatic m_fn_ctrl;
-       //}}AFX_DATA
-
-
-// Overrides
-       // ClassWizard generated virtual function overrides
-       //{{AFX_VIRTUAL(CLoadPortalFileDialog)
-       protected:
-       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
-       //}}AFX_VIRTUAL
-
-// Implementation
-protected:
-
-       // Generated message map functions
-       //{{AFX_MSG(CLoadPortalFileDialog)
-       virtual qboolean OnInitDialog();
-       virtual void OnOK();
-       afx_msg void OnLoadOther();
-       //}}AFX_MSG
-       DECLARE_MESSAGE_MAP()
-};
-
-#endif // GTK_PLUGIN
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
+#endif
 
-#endif // !defined(AFX_LOADPORTALFILEDIALOG_H__6BEDE392_1FDC_11D4_BFF7_204C4F4F5020__INCLUDED_)
index 24f945d..7c18cf8 100644 (file)
@@ -1,8 +1,7 @@
 ; PrtView.def : Declares the module parameters for the DLL.
 
 LIBRARY      "PrtView"
-; DESCRIPTION  'PrtView Windows Dynamic Link Library'
 
 EXPORTS
     ; Explicit exports can go here
-       Synapse_EnumerateInterfaces @1
+       Radiant_RegisterModules @1
diff --git a/contrib/prtview/PrtView.rc b/contrib/prtview/PrtView.rc
deleted file mode 100644 (file)
index 73f8096..0000000
+++ /dev/null
@@ -1,264 +0,0 @@
-//Microsoft Developer Studio generated resource script.
-//
-#include "resource.h"
-
-#define APSTUDIO_READONLY_SYMBOLS
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 2 resource.
-//
-#include "afxres.h"
-
-/////////////////////////////////////////////////////////////////////////////
-#undef APSTUDIO_READONLY_SYMBOLS
-
-/////////////////////////////////////////////////////////////////////////////
-// English (U.S.) resources
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
-#pragma code_page(1252)
-#endif //_WIN32
-
-#ifdef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// TEXTINCLUDE
-//
-
-1 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "resource.h\0"
-END
-
-2 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "#include ""afxres.h""\r\n"
-    "\0"
-END
-
-3 TEXTINCLUDE DISCARDABLE 
-BEGIN
-    "#define _AFX_NO_SPLITTER_RESOURCES\r\n"
-    "#define _AFX_NO_OLE_RESOURCES\r\n"
-    "#define _AFX_NO_TRACKER_RESOURCES\r\n"
-    "#define _AFX_NO_PROPERTY_RESOURCES\r\n"
-    "\r\n"
-    "#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
-    "#ifdef _WIN32\r\n"
-    "LANGUAGE 9, 1\r\n"
-    "#pragma code_page(1252)\r\n"
-    "#endif\r\n"
-    "#include ""res\\PrtView.rc2""  // non-Microsoft Visual C++ edited resources\r\n"
-    "#include ""afxres.rc""         // Standard components\r\n"
-    "#endif\0"
-END
-
-#endif    // APSTUDIO_INVOKED
-
-
-#ifndef _MAC
-/////////////////////////////////////////////////////////////////////////////
-//
-// Version
-//
-
-VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,0,0,0
- PRODUCTVERSION 0,0,0,0
- FILEFLAGSMASK 0x3fL
-#ifdef _DEBUG
- FILEFLAGS 0x1L
-#else
- FILEFLAGS 0x0L
-#endif
- FILEOS 0x4L
- FILETYPE 0x2L
- FILESUBTYPE 0x0L
-BEGIN
-    BLOCK "StringFileInfo"
-    BEGIN
-        BLOCK "040904b0"
-        BEGIN
-            VALUE "Comments", "\0"
-            VALUE "CompanyName", "\0"
-            VALUE "FileDescription", "Q3Radiant Portal Viewer\0"
-            VALUE "FileVersion", "1.000\0"
-            VALUE "InternalName", "PrtView\0"
-            VALUE "LegalCopyright", "GNU Copyleft (C) 2000\0"
-            VALUE "LegalTrademarks", "\0"
-            VALUE "OriginalFilename", "PrtView.DLL\0"
-            VALUE "PrivateBuild", "\0"
-            VALUE "ProductName", "Q3Radiant Portal Viewer\0"
-            VALUE "ProductVersion", "1.000\0"
-            VALUE "SpecialBuild", "\0"
-        END
-    END
-    BLOCK "VarFileInfo"
-    BEGIN
-        VALUE "Translation", 0x409, 1200
-    END
-END
-
-#endif    // !_MAC
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog
-//
-
-IDD_ABOUT DIALOG DISCARDABLE  0, 0, 186, 52
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "About Portal Viewer"
-FONT 8, "MS Sans Serif"
-BEGIN
-    DEFPUSHBUTTON   "OK",IDOK,129,16,50,14
-    LTEXT           "Version 1.000\r\rWritten by Geoffrey DeWan\rgdewan@prairienet.org",
-                    IDC_STATIC,7,7,116,38
-END
-
-IDD_LOAD DIALOGEX 0, 0, 224, 69
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Load .prt"
-FONT 8, "MS Sans Serif"
-BEGIN
-    DEFPUSHBUTTON   "OK",IDOK,167,48,50,14
-    PUSHBUTTON      "Change",IDC_LOAD_OTHER,167,22,50,14
-    CONTROL         "Show 3D",IDC_LOAD_3D,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,7,23,52,13
-    CONTROL         "Show 2D",IDC_LOAD_2D,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,67,23,61,13
-    PUSHBUTTON      "Cancel",IDCANCEL,113,48,50,14
-    LTEXT           "",IDC_LOAD_FILE_NAME,7,7,209,12,SS_CENTERIMAGE,
-                    WS_EX_CLIENTEDGE
-END
-
-IDD_CONFIG DIALOG DISCARDABLE  0, 0, 262, 260
-STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Portal Viewer Configuration"
-FONT 8, "MS Sans Serif"
-BEGIN
-    DEFPUSHBUTTON   "OK",IDOK,205,239,50,14
-    GROUPBOX        "3D View",IDC_STATIC,7,7,248,149
-    SCROLLBAR       IDC_SCROLL_3D_WIDTH,15,20,144,10
-    LTEXT           "-",IDC_3D_WIDTH,167,20,82,10,SS_CENTERIMAGE
-    PUSHBUTTON      "Color",IDC_COLOR_3D,15,41,50,14
-    CONTROL         "Anti-Alias (May not work on some video cards)",
-                    IDC_ANTI_ALIAS_3D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
-                    81,38,174,17
-    PUSHBUTTON      "Depth Color",IDC_COLOR_FOG,15,60,50,14
-    CONTROL         "Depth Cue",IDC_FOG,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,81,61,57,13
-    CONTROL         "Lines",IDC_LINES,"Button",BS_AUTO3STATE | WS_TABSTOP,
-                    140,61,49,13
-    CONTROL         "Polygons",IDC_POLY,"Button",BS_AUTO3STATE | WS_TABSTOP,
-                    206,61,49,13
-    COMBOBOX        IDC_ZBUFFER,15,85,231,109,CBS_DROPDOWNLIST | WS_TABSTOP
-    SCROLLBAR       IDC_SCROLL_3D_TRANS,15,105,128,10
-    LTEXT           "-",IDC_3D_TRANS,152,105,95,10,SS_CENTERIMAGE
-    CONTROL         "Show",IDC_CONFIG_3D,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,15,137,52,13
-    GROUPBOX        "2D View",IDC_STATIC,7,158,248,72
-    SCROLLBAR       IDC_SCROLL_2D_WIDTH,15,172,144,10
-    LTEXT           "-",IDC_2D_WIDTH,166,172,82,10,SS_CENTERIMAGE
-    PUSHBUTTON      "Color",IDC_COLOR_2D,15,190,50,14
-    CONTROL         "Anti-Alias (May not work on some video cards)",
-                    IDC_ANTI_ALIAS_2D,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,
-                    81,193,174,13
-    CONTROL         "Show",IDC_CONFIG_2D,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,15,212,61,13
-    SCROLLBAR       IDC_SCROLL_CUBIC,15,122,128,10
-    LTEXT           "-",IDC_CUBIC,152,122,95,10,SS_CENTERIMAGE
-    CONTROL         "Portal cubic clipper",IDC_CLIP,"Button",BS_AUTOCHECKBOX | 
-                    WS_TABSTOP,147,137,52,13
-END
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// DESIGNINFO
-//
-
-#ifdef APSTUDIO_INVOKED
-GUIDELINES DESIGNINFO DISCARDABLE 
-BEGIN
-    IDD_ABOUT, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 179
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 45
-    END
-
-    IDD_LOAD, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 217
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 62
-    END
-
-    IDD_CONFIG, DIALOG
-    BEGIN
-        LEFTMARGIN, 7
-        RIGHTMARGIN, 255
-        VERTGUIDE, 15
-        TOPMARGIN, 7
-        BOTTOMMARGIN, 253
-        HORZGUIDE, 21
-        HORZGUIDE, 31
-    END
-END
-#endif    // APSTUDIO_INVOKED
-
-
-/////////////////////////////////////////////////////////////////////////////
-//
-// Dialog Info
-//
-
-IDD_CONFIG DLGINIT
-BEGIN
-    IDC_ZBUFFER, 0x403, 62, 0
-0x2d5a, 0x7542, 0x6666, 0x7265, 0x5420, 0x7365, 0x2074, 0x6e61, 0x2064, 
-0x7257, 0x7469, 0x2065, 0x7228, 0x6365, 0x6d6f, 0x656d, 0x646e, 0x6620, 
-0x726f, 0x7320, 0x6c6f, 0x6469, 0x2020, 0x726f, 0x6e20, 0x206f, 0x6f70, 
-0x796c, 0x6f67, 0x736e, 0x0029, 
-    IDC_ZBUFFER, 0x403, 56, 0
-0x2d5a, 0x7542, 0x6666, 0x7265, 0x5420, 0x7365, 0x2074, 0x6e4f, 0x796c, 
-0x2820, 0x6572, 0x6f63, 0x6d6d, 0x6e65, 0x2064, 0x6f66, 0x2072, 0x7274, 
-0x6e61, 0x7073, 0x7261, 0x6e65, 0x2074, 0x6f70, 0x796c, 0x6f67, 0x736e, 
-0x0029, 
-    IDC_ZBUFFER, 0x403, 13, 0
-0x2d5a, 0x7542, 0x6666, 0x7265, 0x4f20, 0x6666, "\000" 
-    0
-END
-
-#endif    // English (U.S.) resources
-/////////////////////////////////////////////////////////////////////////////
-
-
-
-#ifndef APSTUDIO_INVOKED
-/////////////////////////////////////////////////////////////////////////////
-//
-// Generated from the TEXTINCLUDE 3 resource.
-//
-#define _AFX_NO_SPLITTER_RESOURCES
-#define _AFX_NO_OLE_RESOURCES
-#define _AFX_NO_TRACKER_RESOURCES
-#define _AFX_NO_PROPERTY_RESOURCES
-
-#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
-#ifdef _WIN32
-LANGUAGE 9, 1
-#pragma code_page(1252)
-#endif
-#include "res\PrtView.rc2"  // non-Microsoft Visual C++ edited resources
-#include "afxres.rc"         // Standard components
-#endif
-/////////////////////////////////////////////////////////////////////////////
-#endif    // not APSTUDIO_INVOKED
-
index e68ac6f..79133b0 100644 (file)
@@ -1,8 +1,9 @@
-<?xml version="1.0" encoding = "Windows-1252"?>\r
+<?xml version="1.0" encoding="Windows-1252"?>\r
 <VisualStudioProject\r
        ProjectType="Visual C++"\r
-       Version="7.00"\r
+       Version="7.10"\r
        Name="PrtView"\r
+       ProjectGUID="{B20364D1-4329-4D4E-B9CE-C9767618FDD6}"\r
        Keyword="MFCProj">\r
        <Platforms>\r
                <Platform\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
-                               AdditionalIncludeDirectories="..\..\..\STLport\stlport,..\..\..\libxml2\include,..\..\libs,..\..\include,..\..\..\gtk2-win32\include\glib-2.0,..\..\..\gtk2-win32\lib\glib-2.0\include,..\..\..\gtk2-win32\lib\gtk-2.0\include,..\..\..\gtk2-win32\include\gtk-2.0,..\..\..\gtk2-win32\include\gtk-2.0\gdk,..\..\..\gtk2-win32\include\pango-1.0,..\..\..\gtk2-win32\include\atk-1.0"\r
-                               PreprocessorDefinitions="_DEBUG;GTK_PLUGIN;WIN32;_WINDOWS;_USRDLL"\r
+                               AdditionalIncludeDirectories="../../include;../../libs;&quot;../../../STLPort-4.6/stlport&quot;;&quot;../../../gtk2-2.4/lib/glib-2.0/include&quot;;&quot;../../../gtk2-2.4/include/glib-2.0&quot;;&quot;../../../gtk2-2.4/lib/gtk-2.0/include&quot;;&quot;../../../gtk2-2.4/include/gtk-2.0&quot;;&quot;../../../gtk2-2.4/include/gtk-2.0/gdk&quot;;&quot;../../../gtk2-2.4/include/pango-1.0&quot;;&quot;../../../gtk2-2.4/include/atk-1.0&quot;"\r
+                               PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL"\r
+                               StringPooling="TRUE"\r
+                               MinimalRebuild="TRUE"\r
+                               ExceptionHandling="FALSE"\r
                                RuntimeLibrary="3"\r
-                               UsePrecompiledHeader="3"\r
-                               PrecompiledHeaderThrough="stdafx.h"\r
-                               PrecompiledHeaderFile=".\Debug/PrtView.pch"\r
+                               BufferSecurityCheck="FALSE"\r
+                               UsePrecompiledHeader="0"\r
+                               PrecompiledHeaderThrough=""\r
+                               PrecompiledHeaderFile=" "\r
                                AssemblerListingLocation=".\Debug/"\r
                                ObjectFile=".\Debug/"\r
                                ProgramDataBaseFileName=".\Debug/"\r
-                               BrowseInformation="1"\r
+                               BrowseInformation="0"\r
                                WarningLevel="3"\r
                                SuppressStartupBanner="TRUE"\r
-                               DebugInformationFormat="4"\r
-                               CompileAs="0"/>\r
+                               Detect64BitPortabilityProblems="TRUE"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="2"\r
+                               DisableSpecificWarnings="4610;4510;4512;4505;4100;4127"/>\r
                        <Tool\r
                                Name="VCCustomBuildTool"/>\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalOptions="/MACHINE:I386"\r
-                               AdditionalDependencies="glib-2.0.lib gobject-2.0.lib gdk-win32-2.0.lib gtk-win32-2.0.lib pango-1.0.lib"\r
+                               AdditionalDependencies="glib-2.0.lib gobject-2.0.lib gdk-win32-2.0.lib gtk-win32-2.0.lib pango-1.0.lib profile.lib"\r
                                OutputFile=".\Debug/PrtView.dll"\r
-                               LinkIncremental="2"\r
+                               LinkIncremental="1"\r
                                SuppressStartupBanner="TRUE"\r
-                               AdditionalLibraryDirectories="..\..\..\gtk2-win32\lib"\r
+                               AdditionalLibraryDirectories="&quot;../../../gtk2-2.4/lib&quot;;../../libs/profile/debug"\r
+                               IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile=".\PrtView.def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile=".\Debug/PrtView.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
-                               ImportLibrary=".\Debug/PrtView.lib"/>\r
+                               ImportLibrary=".\Debug/PrtView.lib"\r
+                               TargetMachine="1"/>\r
                        <Tool\r
                                Name="VCMIDLTool"\r
                                PreprocessorDefinitions="_DEBUG"\r
                                TargetEnvironment="1"\r
                                TypeLibraryName=".\Debug/PrtView.tlb"/>\r
                        <Tool\r
-                               Name="VCPostBuildEventTool"/>\r
+                               Name="VCPostBuildEventTool"\r
+                               CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\plugins&quot;\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\plugins&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
                        <Tool\r
                                Name="VCWebServiceProxyGeneratorTool"/>\r
                        <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
                                Name="VCWebDeploymentTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
                </Configuration>\r
                <Configuration\r
                        Name="Release|Win32"\r
                        ATLMinimizesCRunTimeLibraryUsage="FALSE">\r
                        <Tool\r
                                Name="VCCLCompilerTool"\r
-                               InlineFunctionExpansion="1"\r
-                               AdditionalIncludeDirectories="..\..\..\STLport\stlport,..\..\..\libxml2\include,..\..\libs,..\..\include,..\..\..\gtk2-win32\include\glib-2.0,..\..\..\gtk2-win32\lib\glib-2.0\include,..\..\..\gtk2-win32\lib\gtk-2.0\include,..\..\..\gtk2-win32\include\gtk-2.0,..\..\..\gtk2-win32\include\gtk-2.0\gdk,..\..\..\gtk2-win32\include\pango-1.0,..\..\..\gtk2-win32\include\atk-1.0"\r
-                               PreprocessorDefinitions="NDEBUG;GTK_PLUGIN;WIN32;_WINDOWS;_USRDLL"\r
+                               GlobalOptimizations="TRUE"\r
+                               InlineFunctionExpansion="2"\r
+                               EnableIntrinsicFunctions="TRUE"\r
+                               FavorSizeOrSpeed="1"\r
+                               AdditionalIncludeDirectories="../../include;../../libs;&quot;../../../STLPort-4.6/stlport&quot;;&quot;../../../gtk2-2.4/lib/glib-2.0/include&quot;;&quot;../../../gtk2-2.4/include/glib-2.0&quot;;&quot;../../../gtk2-2.4/lib/gtk-2.0/include&quot;;&quot;../../../gtk2-2.4/include/gtk-2.0&quot;;&quot;../../../gtk2-2.4/include/gtk-2.0/gdk&quot;;&quot;../../../gtk2-2.4/include/pango-1.0&quot;;&quot;../../../gtk2-2.4/include/atk-1.0&quot;"\r
+                               PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL"\r
                                StringPooling="TRUE"\r
+                               ExceptionHandling="FALSE"\r
                                RuntimeLibrary="2"\r
+                               BufferSecurityCheck="FALSE"\r
                                EnableFunctionLevelLinking="TRUE"\r
-                               UsePrecompiledHeader="3"\r
-                               PrecompiledHeaderThrough="stdafx.h"\r
-                               PrecompiledHeaderFile=".\Release/PrtView.pch"\r
+                               UsePrecompiledHeader="0"\r
+                               PrecompiledHeaderThrough=""\r
+                               PrecompiledHeaderFile=" "\r
                                AssemblerListingLocation=".\Release/"\r
                                ObjectFile=".\Release/"\r
                                ProgramDataBaseFileName=".\Release/"\r
+                               BrowseInformation="0"\r
                                WarningLevel="3"\r
                                SuppressStartupBanner="TRUE"\r
-                               CompileAs="0"/>\r
+                               Detect64BitPortabilityProblems="TRUE"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="2"\r
+                               DisableSpecificWarnings="4610;4510;4512;4505;4100;4127"/>\r
                        <Tool\r
                                Name="VCCustomBuildTool"/>\r
                        <Tool\r
                                Name="VCLinkerTool"\r
                                AdditionalOptions="/MACHINE:I386"\r
-                               AdditionalDependencies="glib-2.0.lib gobject-2.0.lib gdk-win32-2.0.lib gtk-win32-2.0.lib pango-1.0.lib"\r
+                               AdditionalDependencies="glib-2.0.lib gobject-2.0.lib gdk-win32-2.0.lib gtk-win32-2.0.lib pango-1.0.lib profile.lib"\r
                                OutputFile=".\Release/PrtView.dll"\r
                                LinkIncremental="1"\r
                                SuppressStartupBanner="TRUE"\r
-                               AdditionalLibraryDirectories="..\..\..\gtk2-win32\lib"\r
+                               AdditionalLibraryDirectories="&quot;../../../gtk2-2.4/lib&quot;;../../libs/profile/release"\r
+                               IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile=".\PrtView.def"\r
-                               ProgramDatabaseFile=".\Release/PrtView.pdb"\r
+                               GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
-                               ImportLibrary=".\Release/PrtView.lib"/>\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               ImportLibrary=".\Release/PrtView.lib"\r
+                               TargetMachine="1"/>\r
                        <Tool\r
                                Name="VCMIDLTool"\r
                                PreprocessorDefinitions="NDEBUG"\r
                                TargetEnvironment="1"\r
                                TypeLibraryName=".\Release/PrtView.tlb"/>\r
                        <Tool\r
-                               Name="VCPostBuildEventTool"/>\r
+                               Name="VCPostBuildEventTool"\r
+                               CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\plugins&quot;\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\plugins&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
                        <Tool\r
                                Name="VCWebServiceProxyGeneratorTool"/>\r
                        <Tool\r
+                               Name="VCXMLDataGeneratorTool"/>\r
+                       <Tool\r
                                Name="VCWebDeploymentTool"/>\r
+                       <Tool\r
+                               Name="VCManagedWrapperGeneratorTool"/>\r
+                       <Tool\r
+                               Name="VCAuxiliaryManagedWrapperGeneratorTool"/>\r
                </Configuration>\r
        </Configurations>\r
+       <References>\r
+       </References>\r
        <Files>\r
                <Filter\r
-                       Name="Source Files"\r
+                       Name="src"\r
                        Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat">\r
                        <File\r
                                RelativePath=".\AboutDialog.cpp">\r
                        </File>\r
                        <File\r
-                               RelativePath=".\ConfigDialog.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\LoadPortalFileDialog.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\Portals.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\PrtView.cpp">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\PrtView.def">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\PrtView.rc">\r
-                       </File>\r
-                       <File\r
-                               RelativePath=".\StdAfx.cpp">\r
-                               <FileConfiguration\r
-                                       Name="Debug|Win32">\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                               UsePrecompiledHeader="1"/>\r
-                               </FileConfiguration>\r
-                               <FileConfiguration\r
-                                       Name="Release|Win32">\r
-                                       <Tool\r
-                                               Name="VCCLCompilerTool"\r
-                                               UsePrecompiledHeader="1"/>\r
-                               </FileConfiguration>\r
-                       </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Header Files"\r
-                       Filter="h;hpp;hxx;hm;inl">\r
-                       <File\r
                                RelativePath=".\AboutDialog.h">\r
                        </File>\r
                        <File\r
-                               RelativePath=".\ConfigDialog.h">\r
+                               RelativePath=".\ConfigDialog.cpp">\r
                        </File>\r
                        <File\r
-                               RelativePath=".\LoadPortalFileDialog.h">\r
+                               RelativePath=".\ConfigDialog.h">\r
                        </File>\r
                        <File\r
-                               RelativePath=".\Portals.h">\r
+                               RelativePath=".\LoadPortalFileDialog.cpp">\r
                        </File>\r
                        <File\r
-                               RelativePath=".\PrtView.h">\r
+                               RelativePath=".\LoadPortalFileDialog.h">\r
                        </File>\r
                        <File\r
-                               RelativePath=".\PrtView2.h">\r
+                               RelativePath=".\portals.cpp">\r
                        </File>\r
                        <File\r
-                               RelativePath=".\Resource.h">\r
+                               RelativePath=".\portals.h">\r
                        </File>\r
                        <File\r
-                               RelativePath=".\StdAfx.h">\r
+                               RelativePath=".\prtview.cpp">\r
                        </File>\r
-               </Filter>\r
-               <Filter\r
-                       Name="Resource Files"\r
-                       Filter="ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe">\r
                        <File\r
-                               RelativePath=".\res\PrtView.rc2">\r
+                               RelativePath=".\prtview.h">\r
                        </File>\r
                </Filter>\r
                <File\r
-                       RelativePath=".\ReadMe.txt">\r
+                       RelativePath="..\..\debug.py">\r
+                       <FileConfiguration\r
+                               Name="Debug|Win32">\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\plugins\$(TargetName).pdb&quot;"\r
+                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
+                       </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release|Win32">\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\plugins\$(TargetName).pdb&quot;"\r
+                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
+                       </FileConfiguration>\r
+               </File>\r
+               <File\r
+                       RelativePath=".\PrtView.def">\r
+                       <FileConfiguration\r
+                               Name="Debug|Win32">\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;"\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
+                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
+                       </FileConfiguration>\r
+                       <FileConfiguration\r
+                               Name="Release|Win32">\r
+                               <Tool\r
+                                       Name="VCCustomBuildTool"\r
+                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;"\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
+                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
+                       </FileConfiguration>\r
                </File>\r
        </Files>\r
        <Globals>\r
diff --git a/contrib/prtview/gtkdlgs.cpp b/contrib/prtview/gtkdlgs.cpp
deleted file mode 100644 (file)
index f33c79b..0000000
+++ /dev/null
@@ -1,732 +0,0 @@
-/*
-PrtView plugin for GtkRadiant
-Copyright (C) 2001 Geoffrey Dewan, Loki software and qeradiant.com
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-//
-// PrtView dialogs done with GTK+
-//
-
-#include <stdio.h>
-#include "stdafx.h"
-
-// =============================================================================
-// Static functions
-
-static void dialog_button_callback (GtkWidget *widget, gpointer data)
-{
-  GtkWidget *parent;
-  int *loop, *ret;
-
-  parent = gtk_widget_get_toplevel (widget);
-  loop = (int*)g_object_get_data (G_OBJECT (parent), "loop");
-  ret = (int*)g_object_get_data (G_OBJECT (parent), "ret");
-
-  *loop = 0;
-  *ret = (int)data;
-}
-
-static gint dialog_delete_callback (GtkWidget *widget, GdkEvent* event, gpointer data)
-{
-  int *loop;
-
-  gtk_widget_hide (widget);
-  loop = (int*)g_object_get_data (G_OBJECT (widget), "loop");
-  *loop = 0;
-
-  return TRUE;
-}
-
-static void file_sel_callback (GtkWidget *widget, gpointer data)
-{
-  GtkWidget *parent;
-  int *loop;
-  char **filename;
-  parent = gtk_widget_get_toplevel (widget);
-  loop = (int*)g_object_get_data (G_OBJECT (parent), "loop");
-  filename = (char**)g_object_get_data (G_OBJECT (parent), "filename");
-  *loop = 0;
-  if ((int)data == IDOK)
-    *filename = g_strdup (gtk_file_selection_get_filename (GTK_FILE_SELECTION (parent)));
-}
-
-static void change_clicked (GtkWidget *widget, gpointer data)
-{
-  GtkWidget* file_sel;
-  char* filename = NULL;
-  int loop = 1;
-
-  file_sel = gtk_file_selection_new ("Locate portal (.prt) file");
-  gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_sel)->ok_button), "clicked",
-                      GTK_SIGNAL_FUNC (file_sel_callback), GINT_TO_POINTER (IDOK));
-  gtk_signal_connect (GTK_OBJECT (GTK_FILE_SELECTION (file_sel)->cancel_button), "clicked",
-                      GTK_SIGNAL_FUNC (file_sel_callback), GINT_TO_POINTER (IDCANCEL));
-  gtk_signal_connect (GTK_OBJECT (file_sel), "delete_event",
-                      GTK_SIGNAL_FUNC (dialog_delete_callback), NULL);
-  gtk_file_selection_hide_fileop_buttons (GTK_FILE_SELECTION (file_sel));
-
-  g_object_set_data (G_OBJECT (file_sel), "loop", &loop);
-  g_object_set_data (G_OBJECT (file_sel), "filename", &filename);
-  gtk_file_selection_set_filename (GTK_FILE_SELECTION (file_sel), portals.fn);
-
-  gtk_grab_add (file_sel);
-  gtk_widget_show (file_sel);
-
-  while (loop)
-    gtk_main_iteration ();
-
-  gtk_grab_remove (file_sel);
-  gtk_widget_destroy (file_sel);
-
-  if (filename != NULL)
-  {
-    strcpy (portals.fn, filename);
-    gtk_entry_set_text (GTK_ENTRY (data), filename);
-    g_free (filename);
-  }
-}
-
-// =============================================================================
-// LoadPortalFile dialog
-
-int DoLoadPortalFileDialog ()
-{
-  GtkWidget *dlg, *vbox, *hbox, *button, *entry, *check2d, *check3d;
-  int loop = 1, ret = IDCANCEL;
-
-  dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-  gtk_window_set_title (GTK_WINDOW (dlg), "Load .prt");
-  gtk_signal_connect (GTK_OBJECT (dlg), "delete_event",
-                      GTK_SIGNAL_FUNC (dialog_delete_callback), NULL);
-  gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
-                      GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL);
-  g_object_set_data (G_OBJECT (dlg), "loop", &loop);
-  g_object_set_data (G_OBJECT (dlg), "ret", &ret);
-
-  vbox = gtk_vbox_new (FALSE, 5);
-  gtk_widget_show (vbox);
-  gtk_container_add (GTK_CONTAINER (dlg), vbox);
-  gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
-
-  entry = gtk_entry_new ();
-  gtk_widget_show (entry);
-  gtk_entry_set_editable (GTK_ENTRY (entry), FALSE);
-  gtk_box_pack_start (GTK_BOX (vbox), entry, FALSE, FALSE, 0);
-
-  hbox = gtk_hbox_new (FALSE, 5);
-  gtk_widget_show (hbox);
-  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
-
-  check3d = gtk_check_button_new_with_label ("Show 3D");
-  gtk_widget_show (check3d);
-  gtk_box_pack_start (GTK_BOX (hbox), check3d, FALSE, FALSE, 0);
-
-  check2d = gtk_check_button_new_with_label ("Show 2D");
-  gtk_widget_show (check2d);
-  gtk_box_pack_start (GTK_BOX (hbox), check2d, FALSE, FALSE, 0);
-
-  button = gtk_button_new_with_label ("Change");
-  gtk_widget_show (button);
-  gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (change_clicked), entry);
-  gtk_widget_set_usize (button, 60, -2);
-
-  hbox = gtk_hbox_new (FALSE, 5);
-  gtk_widget_show (hbox);
-  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
-
-  button = gtk_button_new_with_label ("Cancel");
-  gtk_widget_show (button);
-  gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked",
-                     GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL));
-  gtk_widget_set_usize (button, 60, -2);
-
-  button = gtk_button_new_with_label ("OK");
-  gtk_widget_show (button);
-  gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked",
-                     GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK));
-  gtk_widget_set_usize (button, 60, -2);
-
-  char *fn = g_IBSPTable.m_pfnGetMapName();
-  strcpy (portals.fn, fn);
-  fn = strrchr (portals.fn, '.');
-  if (fn != NULL)
-  {
-    *fn = '\0';
-    strcat (portals.fn, ".prt");
-  }
-
-  gtk_entry_set_text (GTK_ENTRY (entry), portals.fn);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check2d), portals.show_2d);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (check3d), portals.show_3d);
-
-  gtk_grab_add (dlg);
-  gtk_widget_show (dlg);
-
-  while (loop)
-    gtk_main_iteration ();
-
-  if (ret == IDOK)
-  {
-    portals.Purge();
-
-    portals.show_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check3d));
-    portals.show_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check2d));
-  }
-
-  gtk_grab_remove (dlg);
-  gtk_widget_destroy (dlg);
-
-  return ret;
-}
-
-// =============================================================================
-// About dialog
-
-void DoAboutDlg ()
-{
-  GtkWidget *dlg, *hbox, *vbox, *button, *label;
-  int loop = 1, ret = IDCANCEL;
-
-  dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-  gtk_window_set_title (GTK_WINDOW (dlg), "About Portal Viewer");
-  gtk_signal_connect (GTK_OBJECT (dlg), "delete_event",
-                      GTK_SIGNAL_FUNC (dialog_delete_callback), NULL);
-  gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
-                      GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL);
-  g_object_set_data (G_OBJECT (dlg), "loop", &loop);
-  g_object_set_data (G_OBJECT (dlg), "ret", &ret);
-
-  hbox = gtk_hbox_new (FALSE, 10);
-  gtk_widget_show (hbox);
-  gtk_container_add (GTK_CONTAINER (dlg), hbox);
-  gtk_container_set_border_width (GTK_CONTAINER (hbox), 10);
-
-  label = gtk_label_new ("Version 1.000\n\n"
-                        "Gtk port by Leonardo Zide\nleo@lokigames.com\n\n"
-                        "Written by Geoffrey DeWan\ngdewan@prairienet.org");
-  gtk_widget_show (label);
-  gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0);
-  gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
-
-  vbox = gtk_vbox_new (FALSE, 0);
-  gtk_widget_show (vbox);
-  gtk_box_pack_start (GTK_BOX (hbox), vbox, FALSE, FALSE, 0);
-
-  button = gtk_button_new_with_label ("OK");
-  gtk_widget_show (button);
-  gtk_box_pack_start (GTK_BOX (vbox), button, FALSE, FALSE, 0);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked",
-                     GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK));
-  gtk_widget_set_usize (button, 60, -2);
-
-  gtk_grab_add (dlg);
-  gtk_widget_show (dlg);
-
-  while (loop)
-    gtk_main_iteration ();
-
-  gtk_grab_remove (dlg);
-  gtk_widget_destroy (dlg);
-}
-
-// =============================================================================
-// Config dialog
-
-static int DoColor (COLORREF *c)
-{
-  GtkWidget* dlg;
-  double clr[3];
-  int loop = 1, ret = IDCANCEL;
-
-  clr[0] = ((double)GetRValue (*c)) / 255.0;
-  clr[1] = ((double)GetGValue (*c)) / 255.0;
-  clr[2] = ((double)GetBValue (*c)) / 255.0;
-
-  dlg = gtk_color_selection_dialog_new ("Choose Color");
-  gtk_color_selection_set_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dlg)->colorsel), clr);
-  gtk_signal_connect (GTK_OBJECT (dlg), "delete_event",
-                      GTK_SIGNAL_FUNC (dialog_delete_callback), NULL);
-  gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
-                      GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL);
-  gtk_signal_connect (GTK_OBJECT (GTK_COLOR_SELECTION_DIALOG (dlg)->ok_button), "clicked",
-                     GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK));
-  gtk_signal_connect (GTK_OBJECT (GTK_COLOR_SELECTION_DIALOG (dlg)->cancel_button), "clicked",
-                     GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDCANCEL));
-  g_object_set_data (G_OBJECT (dlg), "loop", &loop);
-  g_object_set_data (G_OBJECT (dlg), "ret", &ret);
-
-  gtk_widget_show(dlg);
-  gtk_grab_add(dlg);
-
-  while (loop)
-    gtk_main_iteration ();
-
-  gtk_color_selection_get_color (GTK_COLOR_SELECTION (GTK_COLOR_SELECTION_DIALOG (dlg)->colorsel), clr);
-
-  gtk_grab_remove (dlg);
-  gtk_widget_destroy (dlg);
-
-  if (ret == IDOK)
-  {
-    *c = RGB (clr[0]*255, clr[1]*255, clr[2]*255);
-  }
-
-  return ret;
-}
-
-static void Set2DText (GtkWidget* label)
-{
-  char s[40];
-
-  sprintf(s, "Line Width = %6.3f", portals.width_2d * 0.5f);
-
-  gtk_label_set_text (GTK_LABEL (label), s);
-}
-
-static void Set3DText (GtkWidget* label)
-{
-  char s[40];
-
-  sprintf(s, "Line Width = %6.3f", portals.width_3d * 0.5f);
-
-  gtk_label_set_text (GTK_LABEL (label), s);
-}
-
-static void Set3DTransText (GtkWidget* label)
-{
-  char s[40];
-
-  sprintf(s, "Polygon transparency = %d%%", (int)portals.trans_3d);
-
-  gtk_label_set_text (GTK_LABEL (label), s);
-}
-
-static void SetClipText (GtkWidget* label)
-{
-  char s[40];
-
-  sprintf(s, "Cubic clip range = %d", (int)portals.clip_range * 64);
-
-  gtk_label_set_text (GTK_LABEL (label), s);
-}
-
-static void OnScroll2d (GtkAdjustment *adj, gpointer data)
-{
-  portals.width_2d = adj->value;
-  Set2DText (GTK_WIDGET (data));
-
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D);
-}
-
-static void OnScroll3d (GtkAdjustment *adj, gpointer data)
-{
-  portals.width_3d = adj->value;
-  Set3DText (GTK_WIDGET (data));
-
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-static void OnScrollTrans (GtkAdjustment *adj, gpointer data)
-{
-  portals.trans_3d = adj->value;
-  Set3DTransText (GTK_WIDGET (data));
-
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-static void OnScrollClip (GtkAdjustment *adj, gpointer data)
-{
-  portals.clip_range = adj->value;
-  SetClipText (GTK_WIDGET (data));
-
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-static void OnAntiAlias2d (GtkWidget *widget, gpointer data)
-{
-  portals.aa_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D);
-}
-
-static void OnConfig2d (GtkWidget *widget, gpointer data)
-{
-  portals.show_2d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D);
-}
-
-static void OnColor2d (GtkWidget *widget, gpointer data)
-{
-  if (DoColor (&portals.color_2d) == IDOK)
-  {
-    portals.FixColors();
-
-    if(interfaces_started)
-      g_FuncTable.m_pfnSysUpdateWindows(UPDATE_2D);
-  }
-}
-
-static void OnConfig3d (GtkWidget *widget, gpointer data)
-{
-  portals.show_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-
-static void OnAntiAlias3d (GtkWidget *widget, gpointer data)
-{
-  portals.aa_3d = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-static void OnColor3d (GtkWidget *widget, gpointer data)
-{
-  if (DoColor (&portals.color_3d) == IDOK)
-  {
-    portals.FixColors();
-
-    if(interfaces_started)
-      g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-  }
-}
-
-static void OnColorFog (GtkWidget *widget, gpointer data)
-{
-  if (DoColor (&portals.color_fog) == IDOK)
-  {
-    portals.FixColors();
-
-    if(interfaces_started)
-      g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-  }
-}
-
-static void OnFog (GtkWidget *widget, gpointer data)
-{
-  portals.fog = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-static void OnSelchangeZbuffer (GtkWidget *widget, gpointer data)
-{
-  portals.zbuffer = GPOINTER_TO_INT (data);
-
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-static void OnPoly (GtkWidget *widget, gpointer data)
-{
-  portals.polygons = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-static void OnLines (GtkWidget *widget, gpointer data)
-{
-  portals.lines = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-static void OnClip (GtkWidget *widget, gpointer data)
-{
-  portals.clip = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget));
-
-  if(interfaces_started)
-    g_FuncTable.m_pfnSysUpdateWindows(UPDATE_3D);
-}
-
-void DoConfigDialog ()
-{
-  GtkWidget *dlg, *hbox, *vbox, *vbox2, *button, *table, *frame;
-  GtkWidget *lw3slider, *lw3label, *lw2slider, *lw2label, *zlist, *menu, *item;
-  GtkWidget *aa2check, *aa3check, *depthcheck, *linescheck, *polyscheck;
-  GtkWidget *transslider, *translabel, *clipslider, *cliplabel;
-  GtkWidget *show2check, *show3check, *portalcheck;
-  int loop = 1, ret = IDCANCEL;
-  GtkObject *adj;
-
-  dlg = gtk_window_new (GTK_WINDOW_TOPLEVEL);
-  gtk_window_set_title (GTK_WINDOW (dlg), "Portal Viewer Configuration");
-  gtk_signal_connect (GTK_OBJECT (dlg), "delete_event",
-                      GTK_SIGNAL_FUNC (dialog_delete_callback), NULL);
-  gtk_signal_connect (GTK_OBJECT (dlg), "destroy",
-                      GTK_SIGNAL_FUNC (gtk_widget_destroy), NULL);
-  g_object_set_data (G_OBJECT (dlg), "loop", &loop);
-  g_object_set_data (G_OBJECT (dlg), "ret", &ret);
-
-  vbox = gtk_vbox_new (FALSE, 5);
-  gtk_widget_show (vbox);
-  gtk_container_add (GTK_CONTAINER (dlg), vbox);
-  gtk_container_set_border_width (GTK_CONTAINER (vbox), 5);
-
-  frame = gtk_frame_new ("3D View");
-  gtk_widget_show (frame);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
-
-  vbox2 = gtk_vbox_new (FALSE, 5);
-  gtk_widget_show (vbox2);
-  gtk_container_add (GTK_CONTAINER (frame), vbox2);
-  gtk_container_set_border_width (GTK_CONTAINER (vbox2), 5);
-
-  hbox = gtk_hbox_new (FALSE, 5);
-  gtk_widget_show (hbox);
-  gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, TRUE, 0);
-
-  adj = gtk_adjustment_new (portals.width_3d, 2, 40, 1, 1, 1);
-  lw3slider = gtk_hscale_new (GTK_ADJUSTMENT (adj));
-  gtk_widget_show (lw3slider);
-  gtk_box_pack_start (GTK_BOX (hbox), lw3slider, TRUE, TRUE, 0);
-  gtk_scale_set_draw_value (GTK_SCALE (lw3slider), FALSE);
-
-  lw3label = gtk_label_new ("");
-  gtk_widget_show (lw3label);
-  gtk_box_pack_start (GTK_BOX (hbox), lw3label, FALSE, TRUE, 0);
-  gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (OnScroll3d), lw3label);
-
-  table = gtk_table_new (2, 4, FALSE);
-  gtk_widget_show (table);
-  gtk_box_pack_start (GTK_BOX (vbox2), table, TRUE, TRUE, 0);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 5);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 5);
-
-  button = gtk_button_new_with_label ("Color");
-  gtk_widget_show (button);
-  gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnColor3d), NULL);
-
-  button = gtk_button_new_with_label ("Depth Color");
-  gtk_widget_show (button);
-  gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnColorFog), NULL);
-
-  aa3check = gtk_check_button_new_with_label ("Anti-Alias (May not work on some video cards)");
-  gtk_widget_show (aa3check);
-  gtk_table_attach (GTK_TABLE (table), aa3check, 1, 4, 0, 1,
-                    (GtkAttachOptions) (GTK_EXPAND|GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_signal_connect (GTK_OBJECT (aa3check), "toggled", GTK_SIGNAL_FUNC (OnAntiAlias3d), NULL);
-
-  depthcheck = gtk_check_button_new_with_label ("Depth Cue");
-  gtk_widget_show (depthcheck);
-  gtk_table_attach (GTK_TABLE (table), depthcheck, 1, 2, 1, 2,
-                    (GtkAttachOptions) (GTK_EXPAND|GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_signal_connect (GTK_OBJECT (depthcheck), "toggled", GTK_SIGNAL_FUNC (OnFog), NULL);
-
-  linescheck = gtk_check_button_new_with_label ("Lines");
-  gtk_widget_show (linescheck);
-  gtk_table_attach (GTK_TABLE (table), linescheck, 2, 3, 1, 2,
-                    (GtkAttachOptions) (GTK_EXPAND|GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_signal_connect (GTK_OBJECT (linescheck), "toggled", GTK_SIGNAL_FUNC (OnLines), NULL);
-
-  polyscheck = gtk_check_button_new_with_label ("Polygons");
-  gtk_widget_show (polyscheck);
-  gtk_table_attach (GTK_TABLE (table), polyscheck, 3, 4, 1, 2,
-                    (GtkAttachOptions) (GTK_EXPAND|GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_signal_connect (GTK_OBJECT (polyscheck), "toggled", GTK_SIGNAL_FUNC (OnPoly), NULL);
-
-  zlist = gtk_option_menu_new ();
-  gtk_widget_show (zlist);
-  gtk_box_pack_start (GTK_BOX (vbox2), zlist, TRUE, FALSE, 0);
-
-  menu = gtk_menu_new ();
-  gtk_widget_show (menu);
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (zlist), menu);
-
-  item = gtk_menu_item_new_with_label ("Z-Buffer Test and Write (recommended for solid or no polygons)");
-  gtk_widget_show (item);
-  gtk_signal_connect (GTK_OBJECT (item), "activate",
-                     GTK_SIGNAL_FUNC (OnSelchangeZbuffer), GINT_TO_POINTER (0));
-  gtk_menu_append (GTK_MENU (menu), item);
-
-  item = gtk_menu_item_new_with_label ("Z-Buffer Test Only (recommended for transparent polygons)");
-  gtk_widget_show (item);
-  gtk_signal_connect (GTK_OBJECT (item), "activate",
-                     GTK_SIGNAL_FUNC (OnSelchangeZbuffer), GINT_TO_POINTER (1));
-  gtk_menu_append (GTK_MENU (menu), item);
-
-  item = gtk_menu_item_new_with_label ("Z-Buffer Off");
-  gtk_widget_show (item);
-  gtk_signal_connect (GTK_OBJECT (item), "activate",
-                     GTK_SIGNAL_FUNC (OnSelchangeZbuffer), GINT_TO_POINTER (2));
-  gtk_menu_append (GTK_MENU (menu), item);
-
-  table = gtk_table_new (2, 2, FALSE);
-  gtk_widget_show (table);
-  gtk_box_pack_start (GTK_BOX (vbox2), table, TRUE, TRUE, 0);
-  gtk_table_set_row_spacings (GTK_TABLE (table), 5);
-  gtk_table_set_col_spacings (GTK_TABLE (table), 5);
-
-  adj = gtk_adjustment_new (portals.trans_3d, 0, 100, 1, 1, 1);
-  transslider = gtk_hscale_new (GTK_ADJUSTMENT (adj));
-  gtk_widget_show (transslider);
-  gtk_table_attach (GTK_TABLE (table), transslider, 0, 1, 0, 1,
-                    (GtkAttachOptions) (GTK_EXPAND|GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_scale_set_draw_value (GTK_SCALE (transslider), FALSE);
-
-  translabel = gtk_label_new ("");
-  gtk_widget_show (translabel);
-  gtk_table_attach (GTK_TABLE (table), translabel, 1, 2, 0, 1,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_misc_set_alignment (GTK_MISC (translabel), 0.0, 0.0);
-  gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (OnScrollTrans), translabel);
-
-  adj = gtk_adjustment_new (portals.clip_range, 1, 128, 1, 1, 1);
-  clipslider = gtk_hscale_new (GTK_ADJUSTMENT (adj));
-  gtk_widget_show (clipslider);
-  gtk_table_attach (GTK_TABLE (table), clipslider, 0, 1, 1, 2,
-                    (GtkAttachOptions) (GTK_EXPAND|GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_scale_set_draw_value (GTK_SCALE (clipslider), FALSE);
-
-  cliplabel = gtk_label_new ("");
-  gtk_widget_show (cliplabel);
-  gtk_table_attach (GTK_TABLE (table), cliplabel, 1, 2, 1, 2,
-                    (GtkAttachOptions) (GTK_FILL),
-                    (GtkAttachOptions) (0), 0, 0);
-  gtk_misc_set_alignment (GTK_MISC (cliplabel), 0.0, 0.0);
-  gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (OnScrollClip), cliplabel);
-
-  hbox = gtk_hbox_new (TRUE, 5);
-  gtk_widget_show (hbox);
-  gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, FALSE, 0);
-
-  show3check = gtk_check_button_new_with_label ("Show");
-  gtk_widget_show (show3check);
-  gtk_box_pack_start (GTK_BOX (hbox), show3check, TRUE, TRUE, 0);
-  gtk_signal_connect (GTK_OBJECT (show3check), "toggled", GTK_SIGNAL_FUNC (OnConfig3d), NULL);
-
-  portalcheck = gtk_check_button_new_with_label ("Portal cubic clipper");
-  gtk_widget_show (portalcheck);
-  gtk_box_pack_start (GTK_BOX (hbox), portalcheck, TRUE, TRUE, 0);
-  gtk_signal_connect (GTK_OBJECT (portalcheck), "toggled", GTK_SIGNAL_FUNC (OnClip), NULL);
-
-  frame = gtk_frame_new ("2D View");
-  gtk_widget_show (frame);
-  gtk_box_pack_start (GTK_BOX (vbox), frame, TRUE, TRUE, 0);
-
-  vbox2 = gtk_vbox_new (FALSE, 5);
-  gtk_widget_show (vbox2);
-  gtk_container_add (GTK_CONTAINER (frame), vbox2);
-  gtk_container_set_border_width (GTK_CONTAINER (vbox2), 5);
-
-  hbox = gtk_hbox_new (FALSE, 5);
-  gtk_widget_show (hbox);
-  gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, FALSE, 0);
-
-  adj = gtk_adjustment_new (portals.width_2d, 2, 40, 1, 1, 1);
-  lw2slider = gtk_hscale_new (GTK_ADJUSTMENT (adj));
-  gtk_widget_show (lw2slider);
-  gtk_box_pack_start (GTK_BOX (hbox), lw2slider, TRUE, TRUE, 0);
-  gtk_scale_set_draw_value (GTK_SCALE (lw2slider), FALSE);
-
-  lw2label = gtk_label_new ("");
-  gtk_widget_show (lw2label);
-  gtk_box_pack_start (GTK_BOX (hbox), lw2label, FALSE, TRUE, 0);
-  gtk_signal_connect (adj, "value_changed", GTK_SIGNAL_FUNC (OnScroll2d), lw2label);
-
-  hbox = gtk_hbox_new (FALSE, 5);
-  gtk_widget_show (hbox);
-  gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, FALSE, 0);
-
-  button = gtk_button_new_with_label ("Color");
-  gtk_widget_show (button);
-  gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 0);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked", GTK_SIGNAL_FUNC (OnColor2d), NULL);
-  gtk_widget_set_usize (button, 60, -2);
-
-  aa2check = gtk_check_button_new_with_label ("Anti-Alias (May not work on some video cards)");
-  gtk_widget_show (aa2check);
-  gtk_box_pack_start (GTK_BOX (hbox), aa2check, TRUE, TRUE, 0);
-  gtk_signal_connect (GTK_OBJECT (aa2check), "toggled", GTK_SIGNAL_FUNC (OnAntiAlias2d), NULL);
-
-  hbox = gtk_hbox_new (FALSE, 5);
-  gtk_widget_show (hbox);
-  gtk_box_pack_start (GTK_BOX (vbox2), hbox, TRUE, FALSE, 0);
-
-  show2check = gtk_check_button_new_with_label ("Show");
-  gtk_widget_show (show2check);
-  gtk_box_pack_start (GTK_BOX (hbox), show2check, FALSE, FALSE, 0);
-  gtk_signal_connect (GTK_OBJECT (show2check), "toggled", GTK_SIGNAL_FUNC (OnConfig2d), NULL);
-
-  hbox = gtk_hbox_new (FALSE, 5);
-  gtk_widget_show (hbox);
-  gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, FALSE, 0);
-
-  button = gtk_button_new_with_label ("OK");
-  gtk_widget_show (button);
-  gtk_box_pack_end (GTK_BOX (hbox), button, FALSE, FALSE, 0);
-  gtk_signal_connect (GTK_OBJECT (button), "clicked",
-                     GTK_SIGNAL_FUNC (dialog_button_callback), GINT_TO_POINTER (IDOK));
-  gtk_widget_set_usize (button, 60, -2);
-
-  // initialize dialog
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show2check), portals.show_2d);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (aa2check), portals.aa_2d);
-  Set2DText (lw2label);
-
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show3check), portals.show_3d);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (depthcheck), portals.fog);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (polyscheck), portals.polygons);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (linescheck), portals.lines);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (aa3check), portals.aa_3d);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (zlist), portals.zbuffer);
-  gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (portalcheck), portals.clip);
-
-  Set3DText (lw3label);
-  Set3DTransText (translabel);
-  SetClipText (cliplabel);
-
-  gtk_grab_add (dlg);
-  gtk_widget_show (dlg);
-
-  while (loop)
-    gtk_main_iteration ();
-
-  gtk_grab_remove (dlg);
-  gtk_widget_destroy (dlg);
-}
diff --git a/contrib/prtview/gtkdlgs.h b/contrib/prtview/gtkdlgs.h
deleted file mode 100644 (file)
index 37ca503..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
-PrtView plugin for GtkRadiant
-Copyright (C) 2001 Geoffrey Dewan, Loki software and qeradiant.com
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#ifndef _GTKDLGS_H_
-#define _GTKDLGS_H_
-
-int DoLoadPortalFileDialog ();
-void DoAboutDlg ();
-void DoConfigDialog ();
-
-#endif // _GTKDLGS_H_
index ec4694f..bc56c19 100644 (file)
@@ -17,7 +17,7 @@ License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-#include "stdafx.h"
+#include "Portals.h"
 #include <string.h>
 #include <stdlib.h>
 #ifndef __APPLE__
@@ -25,6 +25,11 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #endif
 #include <stdio.h>
 
+#include "iglrender.h"
+#include "cullable.h"
+
+#include "PrtView.h"
+
 #define LINE_BUF 1000
 
 CPortals portals;
@@ -67,11 +72,11 @@ bool CBspPortal::Build(char *def)
        else
        {
                sscanf(def, "%u", &point_count);
-               hint = qfalse;
+               hint = false;
        }
 
        if(point_count < 3 || (portals.hint_flags && res_cnt < 4))
-               return qfalse;
+               return false;
 
        point = new CBspPoint[point_count];
        inner_point = new CBspPoint[point_count];
@@ -81,7 +86,7 @@ bool CBspPortal::Build(char *def)
                for(; *c != 0 && *c != '('; c++);
 
                if(*c == 0)
-                       return qfalse;
+                       return false;
 
                c++;
 
@@ -127,7 +132,7 @@ bool CBspPortal::Build(char *def)
        fp_color_random[2] = (float)(rand() & 0xff) / 255.0f;
        fp_color_random[3] = 1.0f;
 
-       return qtrue;
+       return true;
 }
 
 CPortals::CPortals()
@@ -163,7 +168,7 @@ void CPortals::Load()
        
        Purge();
 
-       Sys_Printf(MSG_PREFIX "Loading portal file %s.\n", fn);
+       globalOutputStream() << MSG_PREFIX "Loading portal file " << fn << ".\n";
 
        FILE *in;
 
@@ -171,7 +176,7 @@ void CPortals::Load()
 
        if(in == NULL)
        {
-               Sys_Printf("  ERROR - could not open file.\n");
+               globalOutputStream() << "  ERROR - could not open file.\n";
 
                return;
        }
@@ -180,7 +185,7 @@ void CPortals::Load()
        {
                fclose(in);
 
-               Sys_Printf("  ERROR - File ended prematurely.\n");
+               globalOutputStream() << "  ERROR - File ended prematurely.\n";
 
                return;
        }
@@ -189,7 +194,7 @@ void CPortals::Load()
        {
                fclose(in);
 
-               Sys_Printf("  ERROR - File header indicates wrong file type (should be \"PRT1\").\n");
+               globalOutputStream() << "  ERROR - File header indicates wrong file type (should be \"PRT1\").\n";
 
                return;
        }
@@ -198,7 +203,7 @@ void CPortals::Load()
        {
                fclose(in);
 
-               Sys_Printf("  ERROR - File ended prematurely.\n");
+               globalOutputStream() << "  ERROR - File ended prematurely.\n";
 
                return;
        }
@@ -211,7 +216,7 @@ void CPortals::Load()
 
                node_count = 0;
 
-               Sys_Printf("  ERROR - Extreme number of nodes, aborting.\n");
+               globalOutputStream() << "  ERROR - Extreme number of nodes, aborting.\n";
 
                return;
        }
@@ -223,7 +228,7 @@ void CPortals::Load()
 
                node_count = 0;
 
-               Sys_Printf("  ERROR - File ended prematurely.\n");
+               globalOutputStream() << "  ERROR - File ended prematurely.\n";
 
                return;
        }
@@ -237,7 +242,7 @@ void CPortals::Load()
                portal_count = 0;
                node_count = 0;
 
-               Sys_Printf("  ERROR - Extreme number of portals, aborting.\n");
+               globalOutputStream() << "  ERROR - Extreme number of portals, aborting.\n";
 
                return;
        }
@@ -249,7 +254,7 @@ void CPortals::Load()
                portal_count = 0;
                node_count = 0;
 
-               Sys_Printf("  ERROR - number of portals equals 0, aborting.\n");
+               globalOutputStream() << "  ERROR - number of portals equals 0, aborting.\n";
 
                return;
        }
@@ -259,10 +264,10 @@ void CPortals::Load()
        portal_sort = new int[portal_count];
 
        unsigned int n;
-       bool first = qtrue;
+       bool first = true;
        unsigned test_vals_1, test_vals_2;
 
-       hint_flags = qfalse;
+       hint_flags = false;
 
        for(n = 0; n < portal_count; )
        {
@@ -272,7 +277,7 @@ void CPortals::Load()
 
                        Purge();
 
-                       Sys_Printf("  ERROR - Could not find information for portal number %d of %d.\n", n + 1, portal_count);
+                       globalOutputStream() << "  ERROR - Could not find information for portal number " << n + 1 << " of " << portal_count << ".\n";
 
                        return;
                }
@@ -282,17 +287,17 @@ void CPortals::Load()
                        if(first && sscanf(buf, "%d %d", &test_vals_1, &test_vals_2) == 1) // skip additional counts of later data, not needed
                        {
                                // We can count on hint flags being in the file
-                               hint_flags = qtrue;
+                               hint_flags = true;
                                continue;
                        }
 
-                       first = qfalse;
+                       first = false;
 
                        fclose(in);
 
                        Purge();
 
-                       Sys_Printf("  ERROR - Information for portal number %d of %d is not formatted correctly.\n", n + 1, portal_count);
+                       globalOutputStream() << "  ERROR - Information for portal number " << n + 1 << " of " << portal_count << " is not formatted correctly.\n";
 
                        return;
                }
@@ -302,501 +307,346 @@ void CPortals::Load()
 
        fclose(in);
 
-       Sys_Printf("  %u portals read in.\n", node_count, portal_count);
-}
-
-void CPortals::FixColors()
-{
-       fp_color_2d[0] = (float)GetRValue(color_2d) / 255.0f;
-       fp_color_2d[1] = (float)GetGValue(color_2d) / 255.0f;
-       fp_color_2d[2] = (float)GetBValue(color_2d) / 255.0f;
-       fp_color_2d[3] = 1.0f;
-
-       fp_color_3d[0] = (float)GetRValue(color_3d) / 255.0f;
-       fp_color_3d[1] = (float)GetGValue(color_3d) / 255.0f;
-       fp_color_3d[2] = (float)GetBValue(color_3d) / 255.0f;
-       fp_color_3d[3] = 1.0f;
-
-       fp_color_fog[0] = 0.0f;//(float)GetRValue(color_fog) / 255.0f;
-       fp_color_fog[1] = 0.0f;//(float)GetGValue(color_fog) / 255.0f;
-       fp_color_fog[2] = 0.0f;//(float)GetBValue(color_fog) / 255.0f;
-       fp_color_fog[3] = 1.0f;
-}
-
-CPortalsRender::CPortalsRender()
-{
-       refCount = 1;
+       globalOutputStream() << "  " << node_count << " portals read in.\n";
 }
 
-CPortalsRender::~CPortalsRender()
-{
-}
+#include "math/matrix.h"
 
-void CPortalsRender::Register()
-{
-       g_QglTable.m_pfnHookGL2DWindow( this );
-       g_QglTable.m_pfnHookGL3DWindow( this );
-}
+const char* g_state_solid = "$plugins/prtview/solid";
+const char* g_state_solid_outline = "$plugins/prtview/solid_outline";
+const char* g_state_wireframe = "$plugins/prtview/wireframe";
+Shader* g_shader_solid = 0;
+Shader* g_shader_solid_outline = 0;
+Shader* g_shader_wireframe = 0;
 
-void CPortalsRender::Draw2D( VIEWTYPE vt )
+void Portals_constructShaders()
 {
-       if(!portals.show_2d || portals.portal_count < 1)
-               return;
+  OpenGLState state;
+  GlobalOpenGLStateLibrary().getDefaultState(state);
+  state.m_state = RENDER_COLOURWRITE|RENDER_DEPTHWRITE;
+  state.m_sort = OpenGLState::eSortOverlayFirst;
+  state.m_linewidth = portals.width_2d * 0.5f;
+  state.m_colour[0] = portals.fp_color_2d[0];
+  state.m_colour[1] = portals.fp_color_2d[1];
+  state.m_colour[2] = portals.fp_color_2d[2];
+  state.m_colour[3] = portals.fp_color_2d[3];
+  if(portals.aa_2d)
+  {
+    state.m_state |= RENDER_BLEND|RENDER_LINESMOOTH;
+  }
+  GlobalOpenGLStateLibrary().insert(g_state_wireframe, state);
+
+  GlobalOpenGLStateLibrary().getDefaultState(state);
+  state.m_state = RENDER_FILL|RENDER_BLEND|RENDER_COLOURWRITE|RENDER_COLOURCHANGE|RENDER_SMOOTH|RENDER_POLYGONSMOOTH;
 
-       g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
+       if(portals.aa_3d)
+  {
+               state.m_state |= RENDER_POLYGONSMOOTH;
+  }
 
-       if(portals.aa_2d)
-       {
-               g_QglTable.m_pfn_qglEnable(GL_BLEND);
-               g_QglTable.m_pfn_qglEnable(GL_LINE_SMOOTH);
-       }
-       else
+       switch(portals.zbuffer)
        {
-               g_QglTable.m_pfn_qglDisable(GL_BLEND);
-               g_QglTable.m_pfn_qglEnable(GL_LINE_SMOOTH);
+       case 1:
+               state.m_state |= RENDER_DEPTHTEST;
+               break;
+       case 2:
+               break;
+       default:
+               state.m_state |= RENDER_DEPTHTEST;
+               state.m_state |= RENDER_DEPTHWRITE;
        }
 
-       switch(vt)
+       if(portals.fog)
        {
-       case XY:
-               break;
-       case XZ:
-               g_QglTable.m_pfn_qglRotatef(270.0f, 1.0f, 0.0f, 0.0f);
-               break;
-       case YZ:
-               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;
+               state.m_state |= RENDER_FOG;
+
+               state.m_fog.mode = GL_EXP;
+               state.m_fog.density = 0.001f;
+               state.m_fog.start = 10.0f;
+               state.m_fog.end = 10000.0f;
+               state.m_fog.index = 0;
+               state.m_fog.colour[0] = portals.fp_color_fog[0];
+               state.m_fog.colour[1] = portals.fp_color_fog[1];
+               state.m_fog.colour[2] = portals.fp_color_fog[2];
+               state.m_fog.colour[3] = portals.fp_color_fog[3];
        }
 
-       g_QglTable.m_pfn_qglLineWidth(portals.width_2d * 0.5f);
+  GlobalOpenGLStateLibrary().insert(g_state_solid, state);
 
-       g_QglTable.m_pfn_qglColor4fv(portals.fp_color_2d);
+  GlobalOpenGLStateLibrary().getDefaultState(state);
+  state.m_state = RENDER_COLOURWRITE|RENDER_DEPTHWRITE;
+  state.m_sort = OpenGLState::eSortOverlayFirst;
+       state.m_linewidth = portals.width_3d * 0.5f;
+  state.m_colour[0] = portals.fp_color_3d[0];
+  state.m_colour[1] = portals.fp_color_3d[1];
+  state.m_colour[2] = portals.fp_color_3d[2];
+  state.m_colour[3] = portals.fp_color_3d[3];
 
-       unsigned int n, p;
+       if(portals.aa_3d)
+  {
+               state.m_state |= RENDER_LINESMOOTH;
+  }
 
-       for(n = 0; n < portals.portal_count; n++)
+       switch(portals.zbuffer)
        {
-               g_QglTable.m_pfn_qglBegin(GL_LINE_LOOP);
-
-               for(p = 0; p < portals.portal[n].point_count; p++)
-                       g_QglTable.m_pfn_qglVertex3fv(portals.portal[n].point[p].p);
+       case 1:
+               state.m_state |= RENDER_DEPTHTEST;
+               break;
+       case 2:
+               break;
+       default:
+               state.m_state |= RENDER_DEPTHTEST;
+               state.m_state |= RENDER_DEPTHWRITE;
+       }
 
-               g_QglTable.m_pfn_qglEnd();
+       if(portals.fog)
+       {
+               state.m_state |= RENDER_FOG;
+
+               state.m_fog.mode = GL_EXP;
+               state.m_fog.density = 0.001f;
+               state.m_fog.start = 10.0f;
+               state.m_fog.end = 10000.0f;
+               state.m_fog.index = 0;
+               state.m_fog.colour[0] = portals.fp_color_fog[0];
+               state.m_fog.colour[1] = portals.fp_color_fog[1];
+               state.m_fog.colour[2] = portals.fp_color_fog[2];
+               state.m_fog.colour[3] = portals.fp_color_fog[3];
        }
 
-       g_QglTable.m_pfn_qglPopAttrib();
-}
+  GlobalOpenGLStateLibrary().insert(g_state_solid_outline, state);
 
-/*
- * Transform a point (column vector) by a 4x4 matrix.  I.e.  out = m * in
- * Input:  m - the 4x4 matrix
- *         in - the 4x1 vector
- * Output:  out - the resulting 4x1 vector.
- */
-static void transform_point( GLdouble out[4], const GLdouble m[16],
-                            const GLdouble in[4] )
-{
-#define M(row,col)  m[col*4+row]
-   out[0] = M(0,0) * in[0] + M(0,1) * in[1] + M(0,2) * in[2] + M(0,3) * in[3];
-   out[1] = M(1,0) * in[0] + M(1,1) * in[1] + M(1,2) * in[2] + M(1,3) * in[3];
-   out[2] = M(2,0) * in[0] + M(2,1) * in[1] + M(2,2) * in[2] + M(2,3) * in[3];
-   out[3] = M(3,0) * in[0] + M(3,1) * in[1] + M(3,2) * in[2] + M(3,3) * in[3];
-#undef M
+  g_shader_solid = GlobalShaderCache().capture(g_state_solid);
+  g_shader_solid_outline = GlobalShaderCache().capture(g_state_solid_outline);
+  g_shader_wireframe = GlobalShaderCache().capture(g_state_wireframe);
 }
 
-#include <math.h>
-
-
-/*
- * Perform a 4x4 matrix multiplication  (product = a x b).
- * Input:  a, b - matrices to multiply
- * Output:  product - product of a and b
- */
-static void matmul( GLdouble *product, const GLdouble *a, const GLdouble *b )
+void Portals_destroyShaders()
 {
-   /* This matmul was contributed by Thomas Malik */
-   GLdouble temp[16];
-   GLint i;
-
-#define A(row,col)  a[(col<<2)+row]
-#define B(row,col)  b[(col<<2)+row]
-#define T(row,col)  temp[(col<<2)+row]
-
-   /* i-te Zeile */
-   for (i = 0; i < 4; i++)
-     {
-       T(i, 0) = A(i, 0) * B(0, 0) + A(i, 1) * B(1, 0) + A(i, 2) * B(2, 0) + A(i, 3) * B(3, 0);
-       T(i, 1) = A(i, 0) * B(0, 1) + A(i, 1) * B(1, 1) + A(i, 2) * B(2, 1) + A(i, 3) * B(3, 1);
-       T(i, 2) = A(i, 0) * B(0, 2) + A(i, 1) * B(1, 2) + A(i, 2) * B(2, 2) + A(i, 3) * B(3, 2);
-       T(i, 3) = A(i, 0) * B(0, 3) + A(i, 1) * B(1, 3) + A(i, 2) * B(2, 3) + A(i, 3) * B(3, 3);
-     }
-
-#undef A
-#undef B
-#undef T
-   memcpy ( product, temp, 16*sizeof(GLdouble) );
+  GlobalShaderCache().release(g_state_solid);
+  GlobalShaderCache().release(g_state_solid_outline);
+  GlobalShaderCache().release(g_state_wireframe);
+  GlobalOpenGLStateLibrary().erase(g_state_solid);
+  GlobalOpenGLStateLibrary().erase(g_state_solid_outline);
+  GlobalOpenGLStateLibrary().erase(g_state_wireframe);
 }
 
-
-
-/*
- * Compute inverse of 4x4 transformation matrix.
- * Code contributed by Jacques Leroy jle@star.be
- * Return GL_TRUE for success, GL_FALSE for failure (singular matrix)
- */
-static GLboolean invert_matrix( const GLdouble *m, GLdouble *out )
+void Portals_shadersChanged()
 {
-/* NB. OpenGL Matrices are COLUMN major. */
-#define SWAP_ROWS(a, b) { GLdouble *_tmp = a; (a)=(b); (b)=_tmp; }
-#define MAT(m,r,c) (m)[(c)*4+(r)]
-
- GLdouble wtmp[4][8];
- GLdouble m0, m1, m2, m3, s;
- GLdouble *r0, *r1, *r2, *r3;
-
- r0 = wtmp[0], r1 = wtmp[1], r2 = wtmp[2], r3 = wtmp[3];
-
- r0[0] = MAT(m,0,0), r0[1] = MAT(m,0,1),
- r0[2] = MAT(m,0,2), r0[3] = MAT(m,0,3),
- r0[4] = 1.0, r0[5] = r0[6] = r0[7] = 0.0,
-
- r1[0] = MAT(m,1,0), r1[1] = MAT(m,1,1),
- r1[2] = MAT(m,1,2), r1[3] = MAT(m,1,3),
- r1[5] = 1.0, r1[4] = r1[6] = r1[7] = 0.0,
-
- r2[0] = MAT(m,2,0), r2[1] = MAT(m,2,1),
- r2[2] = MAT(m,2,2), r2[3] = MAT(m,2,3),
- r2[6] = 1.0, r2[4] = r2[5] = r2[7] = 0.0,
-
- r3[0] = MAT(m,3,0), r3[1] = MAT(m,3,1),
- r3[2] = MAT(m,3,2), r3[3] = MAT(m,3,3),
- r3[7] = 1.0, r3[4] = r3[5] = r3[6] = 0.0;
-
- /* choose pivot - or die */
- if (fabs(r3[0])>fabs(r2[0])) SWAP_ROWS(r3, r2);
- if (fabs(r2[0])>fabs(r1[0])) SWAP_ROWS(r2, r1);
- if (fabs(r1[0])>fabs(r0[0])) SWAP_ROWS(r1, r0);
- if (0.0 == r0[0])  return GL_FALSE;
-
- /* eliminate first variable     */
- m1 = r1[0]/r0[0]; m2 = r2[0]/r0[0]; m3 = r3[0]/r0[0];
- s = r0[1]; r1[1] -= m1 * s; r2[1] -= m2 * s; r3[1] -= m3 * s;
- s = r0[2]; r1[2] -= m1 * s; r2[2] -= m2 * s; r3[2] -= m3 * s;
- s = r0[3]; r1[3] -= m1 * s; r2[3] -= m2 * s; r3[3] -= m3 * s;
- s = r0[4];
- if (s != 0.0) { r1[4] -= m1 * s; r2[4] -= m2 * s; r3[4] -= m3 * s; }
- s = r0[5];
- if (s != 0.0) { r1[5] -= m1 * s; r2[5] -= m2 * s; r3[5] -= m3 * s; }
- s = r0[6];
- if (s != 0.0) { r1[6] -= m1 * s; r2[6] -= m2 * s; r3[6] -= m3 * s; }
- s = r0[7];
- if (s != 0.0) { r1[7] -= m1 * s; r2[7] -= m2 * s; r3[7] -= m3 * s; }
-
- /* choose pivot - or die */
- if (fabs(r3[1])>fabs(r2[1])) SWAP_ROWS(r3, r2);
- if (fabs(r2[1])>fabs(r1[1])) SWAP_ROWS(r2, r1);
- if (0.0 == r1[1])  return GL_FALSE;
-
- /* eliminate second variable */
- m2 = r2[1]/r1[1]; m3 = r3[1]/r1[1];
- r2[2] -= m2 * r1[2]; r3[2] -= m3 * r1[2];
- r2[3] -= m2 * r1[3]; r3[3] -= m3 * r1[3];
- s = r1[4]; if (0.0 != s) { r2[4] -= m2 * s; r3[4] -= m3 * s; }
- s = r1[5]; if (0.0 != s) { r2[5] -= m2 * s; r3[5] -= m3 * s; }
- s = r1[6]; if (0.0 != s) { r2[6] -= m2 * s; r3[6] -= m3 * s; }
- s = r1[7]; if (0.0 != s) { r2[7] -= m2 * s; r3[7] -= m3 * s; }
-
- /* choose pivot - or die */
- if (fabs(r3[2])>fabs(r2[2])) SWAP_ROWS(r3, r2);
- if (0.0 == r2[2])  return GL_FALSE;
-
- /* eliminate third variable */
- m3 = r3[2]/r2[2];
- r3[3] -= m3 * r2[3], r3[4] -= m3 * r2[4],
- r3[5] -= m3 * r2[5], r3[6] -= m3 * r2[6],
- r3[7] -= m3 * r2[7];
-
- /* last check */
- if (0.0 == r3[3]) return GL_FALSE;
-
- s = 1.0/r3[3];              /* now back substitute row 3 */
- r3[4] *= s; r3[5] *= s; r3[6] *= s; r3[7] *= s;
-
- m2 = r2[3];                 /* now back substitute row 2 */
- s  = 1.0/r2[2];
- r2[4] = s * (r2[4] - r3[4] * m2), r2[5] = s * (r2[5] - r3[5] * m2),
- r2[6] = s * (r2[6] - r3[6] * m2), r2[7] = s * (r2[7] - r3[7] * m2);
- m1 = r1[3];
- r1[4] -= r3[4] * m1, r1[5] -= r3[5] * m1,
- r1[6] -= r3[6] * m1, r1[7] -= r3[7] * m1;
- m0 = r0[3];
- r0[4] -= r3[4] * m0, r0[5] -= r3[5] * m0,
- r0[6] -= r3[6] * m0, r0[7] -= r3[7] * m0;
-
- m1 = r1[2];                 /* now back substitute row 1 */
- s  = 1.0/r1[1];
- r1[4] = s * (r1[4] - r2[4] * m1), r1[5] = s * (r1[5] - r2[5] * m1),
- r1[6] = s * (r1[6] - r2[6] * m1), r1[7] = s * (r1[7] - r2[7] * m1);
- m0 = r0[2];
- r0[4] -= r2[4] * m0, r0[5] -= r2[5] * m0,
- r0[6] -= r2[6] * m0, r0[7] -= r2[7] * m0;
-
- m0 = r0[1];                 /* now back substitute row 0 */
- s  = 1.0/r0[0];
- r0[4] = s * (r0[4] - r1[4] * m0), r0[5] = s * (r0[5] - r1[5] * m0),
- r0[6] = s * (r0[6] - r1[6] * m0), r0[7] = s * (r0[7] - r1[7] * m0);
-
- MAT(out,0,0) = r0[4]; MAT(out,0,1) = r0[5],
- MAT(out,0,2) = r0[6]; MAT(out,0,3) = r0[7],
- MAT(out,1,0) = r1[4]; MAT(out,1,1) = r1[5],
- MAT(out,1,2) = r1[6]; MAT(out,1,3) = r1[7],
- MAT(out,2,0) = r2[4]; MAT(out,2,1) = r2[5],
- MAT(out,2,2) = r2[6]; MAT(out,2,3) = r2[7],
- MAT(out,3,0) = r3[4]; MAT(out,3,1) = r3[5],
- MAT(out,3,2) = r3[6]; MAT(out,3,3) = r3[7]; 
-
- return GL_TRUE;
-
-#undef MAT
-#undef SWAP_ROWS
+  Portals_destroyShaders();
+  portals.FixColors();
+  Portals_constructShaders();
 }
 
-GLint UnProject(GLdouble winx,GLdouble winy,GLdouble winz,
-               const GLdouble model[16],const GLdouble proj[16],
-               const GLint viewport[4],
-               GLdouble *objx,GLdouble *objy,GLdouble *objz)
+void CPortals::FixColors()
 {
-    /* matrice de transformation */
-    GLdouble m[16], A[16];
-    GLdouble in[4],out[4];
-
-    /* transformation coordonnees normalisees entre -1 et 1 */
-    in[0]=(winx-viewport[0])*2/viewport[2] - 1.0;
-    in[1]=(winy-viewport[1])*2/viewport[3] - 1.0;
-    in[2]=2*winz - 1.0;
-    in[3]=1.0;
-
-    /* calcul transformation inverse */
-    matmul(A,proj,model);
-    invert_matrix(A,m);
-
-    /* d'ou les coordonnees objets */
-    transform_point(out,m,in);
-    if (out[3]==0.0)
-       return GL_FALSE;
-    *objx=out[0]/out[3];
-    *objy=out[1]/out[3];
-    *objz=out[2]/out[3];
-    return GL_TRUE;
+       fp_color_2d[0] = (float)GetRValue(color_2d) / 255.0f;
+       fp_color_2d[1] = (float)GetGValue(color_2d) / 255.0f;
+       fp_color_2d[2] = (float)GetBValue(color_2d) / 255.0f;
+       fp_color_2d[3] = 1.0f;
+
+       fp_color_3d[0] = (float)GetRValue(color_3d) / 255.0f;
+       fp_color_3d[1] = (float)GetGValue(color_3d) / 255.0f;
+       fp_color_3d[2] = (float)GetBValue(color_3d) / 255.0f;
+       fp_color_3d[3] = 1.0f;
+
+       fp_color_fog[0] = 0.0f;//(float)GetRValue(color_fog) / 255.0f;
+       fp_color_fog[1] = 0.0f;//(float)GetGValue(color_fog) / 255.0f;
+       fp_color_fog[2] = 0.0f;//(float)GetBValue(color_fog) / 255.0f;
+       fp_color_fog[3] = 1.0f;
 }
 
-void CPortalsRender::Draw3D()
+void CPortalsRender::renderWireframe(Renderer& renderer, const VolumeTest& volume) const
 {
-       if(!portals.show_3d || portals.portal_count < 1)
+       if(!portals.show_2d || portals.portal_count < 1)
                return;
 
-       g_QglTable.m_pfn_qglPushAttrib(GL_ALL_ATTRIB_BITS);
+  renderer.SetState(g_shader_wireframe, Renderer::eWireframeOnly);
 
-       double cam[3];
-       double proj_m[16];
-       double model_m[16];
-       float min_check[3];
-       float max_check[3];
-       float trans = (100.0f - portals.trans_3d) / 100.0f;
-       int view[4];
+  renderer.addRenderable(m_drawWireframe, g_matrix4_identity);
+}
 
-       g_QglTable.m_pfn_qglGetDoublev(GL_PROJECTION_MATRIX, proj_m);
-       g_QglTable.m_pfn_qglGetDoublev(GL_MODELVIEW_MATRIX, model_m);
-       g_QglTable.m_pfn_qglGetIntegerv(GL_VIEWPORT, view);
+void CPortalsDrawWireframe::render(RenderStateFlags state) const
+{
+       unsigned int n, p;
 
-       UnProject(0.5 * (double)view[2], 0.5 * (double)view[3], 0.0, model_m, proj_m, view, cam, cam+1, cam+2);
+       for(n = 0; n < portals.portal_count; n++)
+       {
+               glBegin(GL_LINE_LOOP);
 
-       min_check[0] = (float)cam[0] + (portals.clip_range * 64.0f);
-       min_check[1] = (float)cam[1] + (portals.clip_range * 64.0f);
-       min_check[2] = (float)cam[2] + (portals.clip_range * 64.0f);
-       max_check[0] = (float)cam[0] - (portals.clip_range * 64.0f);
-       max_check[1] = (float)cam[1] - (portals.clip_range * 64.0f);
-       max_check[2] = (float)cam[2] - (portals.clip_range * 64.0f);
+               for(p = 0; p < portals.portal[n].point_count; p++)
+                       glVertex3fv(portals.portal[n].point[p].p);
 
-       g_QglTable.m_pfn_qglHint(GL_FOG_HINT, GL_NICEST);
-       
-       g_QglTable.m_pfn_qglDisable(GL_CULL_FACE);
+               glEnd();
+       }
+}
 
-       g_QglTable.m_pfn_qglDisable(GL_LINE_SMOOTH);
-       g_QglTable.m_pfn_qglDisable(GL_POLYGON_SMOOTH);
+CubicClipVolume calculateCubicClipVolume(const Matrix4& viewproj)
+{
+  CubicClipVolume clip;
+  clip.cam = vector4_projected(
+    matrix4_transformed_vector4(
+      matrix4_full_inverse(viewproj),
+      Vector4(0, 0, -1, 1)
+    )
+  );
+       clip.min[0] = clip.cam[0] + (portals.clip_range * 64.0f);
+       clip.min[1] = clip.cam[1] + (portals.clip_range * 64.0f);
+       clip.min[2] = clip.cam[2] + (portals.clip_range * 64.0f);
+       clip.max[0] = clip.cam[0] - (portals.clip_range * 64.0f);
+       clip.max[1] = clip.cam[1] - (portals.clip_range * 64.0f);
+       clip.max[2] = clip.cam[2] - (portals.clip_range * 64.0f);
+  return clip;
+}
 
-       g_QglTable.m_pfn_qglPolygonMode(GL_FRONT_AND_BACK, GL_FILL);
+void CPortalsRender::renderSolid(Renderer& renderer, const VolumeTest& volume) const
+{
+       if(!portals.show_3d || portals.portal_count < 1)
+               return;
 
-       g_QglTable.m_pfn_qglShadeModel(GL_SMOOTH);
+  CubicClipVolume clip = calculateCubicClipVolume(matrix4_multiplied_by_matrix4(volume.GetProjection(), volume.GetModelview()));
 
-       g_QglTable.m_pfn_qglEnable(GL_BLEND);
-       g_QglTable.m_pfn_qglBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
-       g_QglTable.m_pfn_qglEnable(GL_POLYGON_SMOOTH);
+       if(portals.polygons)
+       {
+    renderer.SetState(g_shader_solid, Renderer::eWireframeOnly);
+    renderer.SetState(g_shader_solid, Renderer::eFullMaterials);
 
-       if(portals.aa_3d)
-               g_QglTable.m_pfn_qglEnable(GL_LINE_SMOOTH);
-       else
-               g_QglTable.m_pfn_qglDisable(GL_LINE_SMOOTH);
+    m_drawSolid.clip = clip;
+    renderer.addRenderable(m_drawSolid, g_matrix4_identity);
+  }
 
-       if(portals.fog)
-       {
-               g_QglTable.m_pfn_qglEnable(GL_FOG);
-
-               g_QglTable.m_pfn_qglFogi(GL_FOG_MODE, GL_EXP);
-               g_QglTable.m_pfn_qglFogf(GL_FOG_DENSITY, 0.001f);
-               g_QglTable.m_pfn_qglFogf(GL_FOG_START, 10.0f);
-               g_QglTable.m_pfn_qglFogf(GL_FOG_END, 10000.0f);
-               g_QglTable.m_pfn_qglFogi(GL_FOG_INDEX, 0);
-               g_QglTable.m_pfn_qglFogfv(GL_FOG_COLOR, portals.fp_color_fog);
-       }
-       else
+       if(portals.lines)
        {
-               g_QglTable.m_pfn_qglDisable(GL_FOG);
-       }
+    renderer.SetState(g_shader_solid_outline, Renderer::eWireframeOnly);
+    renderer.SetState(g_shader_solid_outline, Renderer::eFullMaterials);
 
-       switch(portals.zbuffer)
-       {
-       case 1:
-               g_QglTable.m_pfn_qglEnable(GL_DEPTH_TEST);
-               g_QglTable.m_pfn_qglDepthMask(GL_FALSE);
-               break;
-       case 2:
-               g_QglTable.m_pfn_qglDisable(GL_DEPTH_TEST);
-               break;
-       default:
-               g_QglTable.m_pfn_qglEnable(GL_DEPTH_TEST);
-               g_QglTable.m_pfn_qglDepthMask(GL_TRUE);
-       }
+    m_drawSolidOutline.clip = clip;
+    renderer.addRenderable(m_drawSolidOutline, g_matrix4_identity);
+  }
+}
 
-       g_QglTable.m_pfn_qglLineWidth(portals.width_3d * 0.5f);
+void CPortalsDrawSolid::render(RenderStateFlags state) const
+{
+       float trans = (100.0f - portals.trans_3d) / 100.0f;
 
        unsigned int n, p;
 
-       if(portals.polygons)
+       if(portals.zbuffer != 0)
        {
-               if(portals.zbuffer != 0)
+               float d;
+
+               for(n = 0; n < portals.portal_count; n++)
                {
-                       float d;
+                       d = (float)clip.cam[0] - portals.portal[n].center.p[0];
+                       portals.portal[n].dist = d * d;
 
-                       for(n = 0; n < portals.portal_count; n++)
-                       {
-                               d = (float)cam[0] - portals.portal[n].center.p[0];
-                               portals.portal[n].dist = d * d;
+                       d = (float)clip.cam[1] - portals.portal[n].center.p[1];
+                       portals.portal[n].dist += d * d;
 
-                               d = (float)cam[1] - portals.portal[n].center.p[1];
-                               portals.portal[n].dist += d * d;
+                       d = (float)clip.cam[2] - portals.portal[n].center.p[2];
+                       portals.portal[n].dist += d * d;
 
-                               d = (float)cam[2] - portals.portal[n].center.p[2];
-                               portals.portal[n].dist += d * d;
+                       portals.portal_sort[n] = n;
+               }
 
-                               portals.portal_sort[n] = n;
-                       }
+               qsort(portals.portal_sort, portals.portal_count, 4, compare);
+                               
+               for(n = 0; n < portals.portal_count; n++)
+               {
+                       if(portals.polygons == 2 && !portals.portal[portals.portal_sort[n]].hint)
+                               continue;
 
-                       qsort(portals.portal_sort, portals.portal_count, 4, compare);
-                                       
-                       for(n = 0; n < portals.portal_count; n++)
+                       if(portals.clip)
                        {
-                               if(portals.polygons == 2 && !portals.portal[portals.portal_sort[n]].hint)
+                               if(clip.min[0] < portals.portal[portals.portal_sort[n]].min[0])
                                        continue;
-       
-                               if(portals.clip)
-                               {
-                                       if(min_check[0] < portals.portal[portals.portal_sort[n]].min[0])
-                                               continue;
-                                       else if(min_check[1] < portals.portal[portals.portal_sort[n]].min[1])
-                                               continue;
-                                       else if(min_check[2] < portals.portal[portals.portal_sort[n]].min[2])
-                                               continue;
-                                       else if(max_check[0] > portals.portal[portals.portal_sort[n]].max[0])
-                                               continue;
-                                       else if(max_check[1] > portals.portal[portals.portal_sort[n]].max[1])
-                                               continue;
-                                       else if(max_check[2] > portals.portal[portals.portal_sort[n]].max[2])
-                                               continue;
-                               }
-
-                               g_QglTable.m_pfn_qglColor4f(portals.portal[portals.portal_sort[n]].fp_color_random[0], portals.portal[portals.portal_sort[n]].fp_color_random[1],
-                                       portals.portal[portals.portal_sort[n]].fp_color_random[2], trans);
-
-                               g_QglTable.m_pfn_qglBegin(GL_POLYGON);
-
-                                       for(p = 0; p < portals.portal[portals.portal_sort[n]].point_count; p++)
-                                               g_QglTable.m_pfn_qglVertex3fv(portals.portal[portals.portal_sort[n]].point[p].p);
-
-                               g_QglTable.m_pfn_qglEnd();
-                       }
-               }
-               else
-               {
-                       for(n = 0; n < portals.portal_count; n++)
-                       {
-                               if(portals.polygons == 2 && !portals.portal[n].hint)
+                               else if(clip.min[1] < portals.portal[portals.portal_sort[n]].min[1])
+                                       continue;
+                               else if(clip.min[2] < portals.portal[portals.portal_sort[n]].min[2])
+                                       continue;
+                               else if(clip.max[0] > portals.portal[portals.portal_sort[n]].max[0])
+                                       continue;
+                               else if(clip.max[1] > portals.portal[portals.portal_sort[n]].max[1])
+                                       continue;
+                               else if(clip.max[2] > portals.portal[portals.portal_sort[n]].max[2])
                                        continue;
-
-                               if(portals.clip)
-                               {
-                                       if(min_check[0] < portals.portal[n].min[0])
-                                               continue;
-                                       else if(min_check[1] < portals.portal[n].min[1])
-                                               continue;
-                                       else if(min_check[2] < portals.portal[n].min[2])
-                                               continue;
-                                       else if(max_check[0] > portals.portal[n].max[0])
-                                               continue;
-                                       else if(max_check[1] > portals.portal[n].max[1])
-                                               continue;
-                                       else if(max_check[2] > portals.portal[n].max[2])
-                                               continue;
-                               }
-
-                               g_QglTable.m_pfn_qglColor4f(portals.portal[n].fp_color_random[0], portals.portal[n].fp_color_random[1],
-                                       portals.portal[n].fp_color_random[2], trans);
-
-                               g_QglTable.m_pfn_qglBegin(GL_POLYGON);
-
-                                       for(p = 0; p < portals.portal[n].point_count; p++)
-                                               g_QglTable.m_pfn_qglVertex3fv(portals.portal[n].point[p].p);
-
-                               g_QglTable.m_pfn_qglEnd();
                        }
+
+                       glColor4f(portals.portal[portals.portal_sort[n]].fp_color_random[0], portals.portal[portals.portal_sort[n]].fp_color_random[1],
+                               portals.portal[portals.portal_sort[n]].fp_color_random[2], trans);
+
+                       glBegin(GL_POLYGON);
+
+                               for(p = 0; p < portals.portal[portals.portal_sort[n]].point_count; p++)
+                                       glVertex3fv(portals.portal[portals.portal_sort[n]].point[p].p);
+
+                       glEnd();
                }
        }
-
-       if(portals.lines)
+       else
        {
-               g_QglTable.m_pfn_qglColor4fv(portals.fp_color_3d);
-
                for(n = 0; n < portals.portal_count; n++)
                {
-                       if(portals.lines == 2 && !portals.portal[n].hint)
+                       if(portals.polygons == 2 && !portals.portal[n].hint)
                                continue;
 
                        if(portals.clip)
                        {
-                               if(min_check[0] < portals.portal[n].min[0])
+                               if(clip.min[0] < portals.portal[n].min[0])
                                        continue;
-                               else if(min_check[1] < portals.portal[n].min[1])
+                               else if(clip.min[1] < portals.portal[n].min[1])
                                        continue;
-                               else if(min_check[2] < portals.portal[n].min[2])
+                               else if(clip.min[2] < portals.portal[n].min[2])
                                        continue;
-                               else if(max_check[0] > portals.portal[n].max[0])
+                               else if(clip.max[0] > portals.portal[n].max[0])
                                        continue;
-                               else if(max_check[1] > portals.portal[n].max[1])
+                               else if(clip.max[1] > portals.portal[n].max[1])
                                        continue;
-                               else if(max_check[2] > portals.portal[n].max[2])
+                               else if(clip.max[2] > portals.portal[n].max[2])
                                        continue;
                        }
 
-                       g_QglTable.m_pfn_qglBegin(GL_LINE_LOOP);
+                       glColor4f(portals.portal[n].fp_color_random[0], portals.portal[n].fp_color_random[1],
+                               portals.portal[n].fp_color_random[2], trans);
+
+                       glBegin(GL_POLYGON);
 
-                       for(p = 0; p < portals.portal[n].point_count; p++)
-                               g_QglTable.m_pfn_qglVertex3fv(portals.portal[n].inner_point[p].p);
+                               for(p = 0; p < portals.portal[n].point_count; p++)
+                                       glVertex3fv(portals.portal[n].point[p].p);
 
-                       g_QglTable.m_pfn_qglEnd();
+                       glEnd();
                }
        }
-
-       g_QglTable.m_pfn_qglPopAttrib();
 }
 
+void CPortalsDrawSolidOutline::render(RenderStateFlags state) const
+{
+  for(int n = 0; n < portals.portal_count; n++)
+       {
+               if(portals.lines == 2 && !portals.portal[n].hint)
+                       continue;
+
+               if(portals.clip)
+               {
+                       if(clip.min[0] < portals.portal[n].min[0])
+                               continue;
+                       else if(clip.min[1] < portals.portal[n].min[1])
+                               continue;
+                       else if(clip.min[2] < portals.portal[n].min[2])
+                               continue;
+                       else if(clip.max[0] > portals.portal[n].max[0])
+                               continue;
+                       else if(clip.max[1] > portals.portal[n].max[1])
+                               continue;
+                       else if(clip.max[2] > portals.portal[n].max[2])
+                               continue;
+               }
+
+               glBegin(GL_LINE_LOOP);
+
+               for(int p = 0; p < portals.portal[n].point_count; p++)
+                       glVertex3fv(portals.portal[n].inner_point[p].p);
+
+               glEnd();
+       }
+}
index 23950ab..5e61fe9 100644 (file)
@@ -20,6 +20,12 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #ifndef _PORTALS_H_
 #define _PORTALS_H_
 
+#include <glib.h>
+#include "irender.h"
+#include "renderable.h"
+#include "math/vector.h"
+
+
 class CBspPoint {
 public:
        float p[3];
@@ -46,6 +52,14 @@ public:
        bool Build(char *def);
 };
 
+#define PATH_MAX 260
+typedef guint32 PackedColour;
+#define RGB(r, g, b) ((guint32)(((guint8) (r) | ((guint16) (g) << 8))|(((guint32) (guint8) (b)) << 16)))
+#define GetRValue(rgb)      ((guint8)(rgb))
+#define GetGValue(rgb)      ((guint8)(((guint16)(rgb)) >> 8))
+#define GetBValue(rgb)      ((guint8)((rgb)>>16))
+
+
 class CPortals {
 public:
 
@@ -70,10 +84,10 @@ public:
        bool show_3d;
        bool aa_3d;
        bool fog;
-       COLORREF color_3d;
+       PackedColour color_3d;
        float width_3d;  // in 8'ths
        float fp_color_3d[4];
-       COLORREF color_fog;
+       PackedColour color_fog;
        float fp_color_fog[4];
        float trans_3d;
        float clip_range;
@@ -81,7 +95,7 @@ public:
 
        bool show_2d;
        bool aa_2d;
-       COLORREF color_2d;
+       PackedColour color_2d;
        float width_2d;  // in 8'ths
        float fp_color_2d[4];
 
@@ -94,29 +108,50 @@ public:
        unsigned int portal_count;
 };
 
-class CPortalsRender : public IGL2DWindow, public IGL3DWindow {
+class CubicClipVolume
+{
 public:
+  Vector3 cam, min, max;
+};
 
-  CPortalsRender();
-  virtual ~CPortalsRender();
+class CPortalsDrawSolid : public OpenGLRenderable
+{
+public:
+  mutable CubicClipVolume clip;
+  void render(RenderStateFlags state) const;
+};
 
-protected:
+class CPortalsDrawSolidOutline : public OpenGLRenderable
+{
+public:
+  mutable CubicClipVolume clip;
+  void render(RenderStateFlags state) const;
+};
 
-       int refCount;
+class CPortalsDrawWireframe : public OpenGLRenderable
+{
+public:
+  void render(RenderStateFlags state) const;
+};
 
+class CPortalsRender : public Renderable
+{
 public:
+  CPortalsDrawSolid m_drawSolid;
+  CPortalsDrawSolidOutline m_drawSolidOutline;
+  CPortalsDrawWireframe m_drawWireframe;
 
-  // IGL2DWindow IGL3DWindow interface
-       void IncRef() { refCount++; }
-       void DecRef() { refCount--; if (refCount <= 0) delete this; }
-       void Draw2D( VIEWTYPE vt );
-       void Draw3D();
-       void Register();
+  void renderSolid(Renderer& renderer, const VolumeTest& volume) const;
+  void renderWireframe(Renderer& renderer, const VolumeTest& volume) const;
 };
 
-// void Sys_Printf (char *text, ...);
-
 extern CPortals portals;
 extern CPortalsRender render;
 
+void Portals_constructShaders();
+void Portals_destroyShaders();
+
+void Portals_shadersChanged();
+
+
 #endif // _PORTALS_H_
index 3497ba2..9593e4a 100644 (file)
@@ -17,13 +17,22 @@ License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-// PrtView.cpp : Defines the initialization routines for the DLL.
-//
 
-#include "stdafx.h"
+#include "PrtView.h"
 #include <stdio.h>
 #include <stdlib.h>
-#include "missing.h"
+
+#include "profile/profile.h"
+
+#include "qerplugin.h"
+#include "iscenegraph.h"
+#include "iglrender.h"
+#include "iplugin.h"
+
+#include "Portals.h"
+#include "AboutDialog.h"
+#include "ConfigDialog.h"
+#include "LoadPortalFileDialog.h"
 
 #define Q3R_CMD_SPLITTER "-"
 #define Q3R_CMD_ABOUT "About Portal Viewer"
@@ -56,52 +65,34 @@ static char INIfn[PATH_MAX];
 #define CLIP_RANGE "ClipRange"
 #define CLIP "Clip"
 
-void InitInstance () 
+
+void PrtView_construct()
 {
-#ifdef WIN32
-  char fn[_MAX_PATH];
-  char fn_drive[_MAX_DRIVE];
-  char fn_dir[_MAX_DIR];
-  char fn_name[_MAX_FNAME];
-  char fn_ext[_MAX_EXT];
-
-  GetModuleFileName(GetModuleHandle("PrtView.dll"), fn, _MAX_PATH);
-
-  _splitpath(fn, fn_drive, fn_dir, fn_name, fn_ext);
-
-  strcpy(INIfn, fn_drive);
-  strcat(INIfn, fn_dir);
-  strcat(INIfn, fn_name);
-  strcat(INIfn, ".ini");
-#else // if def __linux__
-  strcpy (INIfn, g_get_home_dir ());
-  strcat (INIfn, "/.radiant/");
-  strcat (INIfn, RADIANT_VERSION);
-  strcat (INIfn, "/prtview.ini");
-#endif
-
-  portals.show_2d = INIGetInt(RENDER_2D, FALSE) ? qtrue : qfalse;
-  portals.aa_2d = INIGetInt(AA_2D, FALSE) ? qtrue : qfalse;
+  strcpy(INIfn, GlobalRadiant().getSettingsPath());
+  strcat(INIfn, "prtview.ini");
+
+  portals.show_2d = INIGetInt(RENDER_2D, FALSE) ? true : false;
+  portals.aa_2d = INIGetInt(AA_2D, FALSE) ? true : false;
   portals.width_2d = (float)INIGetInt(WIDTH_2D, 10);
-  portals.color_2d = (COLORREF)INIGetInt(COLOR_2D, RGB(0, 0, 255)) & 0xFFFFFF;
+  portals.color_2d = (PackedColour)INIGetInt(COLOR_2D, RGB(0, 0, 255)) & 0xFFFFFF;
 
   if (portals.width_2d > 40.0f)
     portals.width_2d = 40.0f;
   else if (portals.width_2d < 2.0f)
     portals.width_2d = 2.0f;
 
-  portals.show_3d = INIGetInt(RENDER_3D, TRUE) ? qtrue : qfalse;
+  portals.show_3d = INIGetInt(RENDER_3D, TRUE) ? true : false;
 
   portals.zbuffer = INIGetInt(ZBUFFER, 1);
-  portals.fog = INIGetInt(FOG, FALSE) ? qtrue : qfalse;
+  portals.fog = INIGetInt(FOG, FALSE) ? true : false;
   portals.polygons = INIGetInt(POLYGON, TRUE);
   portals.lines = INIGetInt(LINE, TRUE);
-  portals.aa_3d = INIGetInt(AA_3D, FALSE) ? qtrue : qfalse;
+  portals.aa_3d = INIGetInt(AA_3D, FALSE) ? true : false;
   portals.width_3d = (float)INIGetInt(WIDTH_3D, 4);
-  portals.color_3d = (COLORREF)INIGetInt(COLOR_3D, RGB(255, 255, 0)) & 0xFFFFFF;
-  portals.color_fog = (COLORREF)INIGetInt(COLOR_FOG, RGB(127, 127, 127)) & 0xFFFFFF;
+  portals.color_3d = (PackedColour)INIGetInt(COLOR_3D, RGB(255, 255, 0)) & 0xFFFFFF;
+  portals.color_fog = (PackedColour)INIGetInt(COLOR_FOG, RGB(127, 127, 127)) & 0xFFFFFF;
   portals.trans_3d = (float)INIGetInt(TRANS_3D, 50);
-  portals.clip = INIGetInt(CLIP, FALSE) ? qtrue : qfalse;
+  portals.clip = INIGetInt(CLIP, FALSE) ? true : false;
   portals.clip_range = (float)INIGetInt(CLIP_RANGE, 16);
 
   if (portals.clip_range < 1)
@@ -127,6 +118,15 @@ void InitInstance ()
   SaveConfig();
 
   portals.FixColors();
+  
+  Portals_constructShaders();
+  GlobalShaderCache().attachRenderable(render);
+}
+
+void PrtView_destroy()
+{
+  GlobalShaderCache().detachRenderable(render);
+  Portals_destroyShaders();
 }
 
 void SaveConfig () 
@@ -150,180 +150,17 @@ void SaveConfig ()
   INISetInt(CLIP_RANGE, (int)portals.clip_range, "Portal viewer cubic clip distance (in units of 64)");
 }
 
-// Radiant function table
-// use to access what Radiant provides
-_QERFuncTable_1 g_FuncTable;
-_QERQglTable g_QglTable;
 
 #define CONFIG_SECTION "Configuration"
 
-#if defined(__linux__) || defined(__APPLE__)
-
-static bool read_var (const char *filename, const char *section, const char *key, char *value)
-{
-  char line[1024], *ptr;
-  FILE *rc;
-  
-  rc = fopen (filename, "rt");
-  
-  if (rc == NULL)
-    return false;
-  
-  while (fgets (line, 1024, rc) != 0)
-  {
-    // First we find the section
-    if (line[0] != '[')
-      continue;
-    
-    ptr = strchr (line, ']');
-    *ptr = '\0';
-    
-    if (strcmp (&line[1], section) == 0)
-    {
-      while (fgets (line, 1024, rc) != 0)
-      {
-        ptr = strchr (line, '=');
-        
-        if (ptr == NULL)
-        {
-          // reached the end of the section
-          fclose (rc);
-          return false;
-        }
-        *ptr = '\0';
-        
-        if (strcmp (line, key) == 0)
-        {
-          strcpy (value, ptr+1);
-          fclose (rc);
-          
-          while (value[strlen (value)-1] == 10 || 
-            value[strlen (value)-1] == 13 ||
-            value[strlen (value)-1] == 32)
-            value[strlen (value)-1] = 0; 
-          return true;
-        }
-      }
-    }
-  }
-
-  fclose (rc);
-  return false;
-}
-
-static bool save_var (const char *filename, const char *section, const char *key, const char *value)
-{
-  char line[1024], *ptr;
-  FILE *old_rc = NULL, *rc;
-  bool found;
-
-  rc = fopen (filename, "rb");
-
-  if (rc != NULL)
-  {
-    guint32 len;
-    void *buf;
-
-    char *tmpname = g_strdup_printf ("%s.tmp", filename);
-    old_rc = fopen (tmpname, "w+b");
-    g_free (tmpname);
-
-    fseek (rc, 0, SEEK_END);
-    len = ftell (rc);
-    rewind (rc);
-    buf = g_malloc (len);
-    fread (buf, len, 1, rc);
-    fwrite (buf, len, 1, old_rc);
-    g_free (buf);
-    fclose (rc);
-    rewind (old_rc);
-  }
-
-  rc = fopen (filename, "wb");
-
-  if (rc == NULL)
-    return false;
-
-  // First we need to find the section
-  found = false;
-  if (old_rc != NULL)
-  while (fgets (line, 1024, old_rc) != NULL)
-  {
-    fputs (line, rc);
-
-    if (line[0] == '[')
-    {
-      ptr = strchr (line, ']');
-      *ptr = '\0';
-
-      if (strcmp (&line[1], section) == 0)
-      {
-        found = true;
-        break;
-      }
-    }
-  } 
-
-  if (!found)
-  {
-    fputs ("\n", rc);
-    fprintf (rc, "[%s]\n", section);
-  }
-
-  fprintf (rc, "%s=%s\n", key, value);
-
-  if (old_rc != NULL)
-  {
-    while (fgets (line, 1024, old_rc) != NULL)
-    {
-      ptr = strchr (line, '=');
-
-      if (ptr != NULL)
-      {
-        *ptr = '\0';
-
-        if (strcmp (line, key) == 0)
-          break;
-        *ptr = '=';
-        fputs (line, rc);
-      }
-      else
-      {
-        fputs (line, rc);
-        break;
-      }
-    }
-
-    while (fgets (line, 1024, old_rc) != NULL)
-      fputs (line, rc);
-    
-    fclose (old_rc);
-
-    char *tmpname = g_strdup_printf ("%s.tmp", filename);
-    remove (tmpname);
-    g_free (tmpname);
-  }
-
-  fclose (rc);
-
-  return true;
-}
-
-#endif
-
 int INIGetInt(char *key, int def)
 {
-#if defined(__linux__) || defined(__APPLE__)
   char value[1024];
 
   if (read_var (INIfn, CONFIG_SECTION, key, value))
     return atoi (value);
   else
     return def;
-#else
-  return GetPrivateProfileInt(CONFIG_SECTION, key, def, INIfn);
-#endif
 }
 
 void INISetInt(char *key, int val, char *comment /* = NULL */)
@@ -334,11 +171,7 @@ void INISetInt(char *key, int val, char *comment /* = NULL */)
     sprintf(s, "%d        ; %s", val, comment);
   else
     sprintf(s, "%d", val);
-#if defined(__linux__) || defined(__APPLE__)
   save_var (INIfn, CONFIG_SECTION, key, s);
-#else
-  WritePrivateProfileString(CONFIG_SECTION, key, s, INIfn);
-#endif
 }
 
 
@@ -356,60 +189,33 @@ static const char *PLUGIN_COMMANDS =
        Q3R_CMD_RELEASE ";"
        Q3R_CMD_LOAD;
 
-extern "C" LPVOID WINAPI QERPlug_GetFuncTable()
-{
-  return &g_FuncTable;
-}
 
 
-//extern "C" LPCSTR WINAPI QERPlug_Init (HMODULE hApp, GtkWidget* hwndMain)
-extern "C" const char* QERPlug_Init (void *hApp, void* pMainWidget)
+const char* QERPlug_Init (void *hApp, void* pMainWidget)
 {  
-  // Setup defaults & load config
-  InitInstance();
-  
   return "Portal Viewer for Q3Radiant";
 }
 
-extern "C" const char* QERPlug_GetName()
-{
-  return (char*)PLUGIN_NAME;
-}
-
-extern "C" const char* QERPlug_GetCommandList()
+const char* QERPlug_GetName()
 {
-  return (char*)PLUGIN_COMMANDS;
+  return PLUGIN_NAME;
 }
 
-/*
-void Sys_Printf (char *text, ...)
+const char* QERPlug_GetCommandList()
 {
-  va_list argptr;
-  char buf[32768];
-
-  va_start (argptr,text);
-  vsprintf (buf, text, argptr);
-  va_end (argptr);
-
-  g_FuncTable.m_pfnSysMsg (buf);
+  return PLUGIN_COMMANDS;
 }
-*/
 
-bool interfaces_started = false;
 
-static void CheckInterfaces()
+const char* QERPlug_GetCommandTitleList()
 {
-  if (interfaces_started)
-    return;
-
-  render.Register();
-
-  interfaces_started = true;
+  return "";
 }
 
-extern "C" void QERPlug_Dispatch(const char* p, vec3_t vMin, vec3_t vMax, bool bSingleBrush)
+
+void QERPlug_Dispatch(const char* p, float* vMin, float* vMax, bool bSingleBrush)
 {
-  Sys_Printf (MSG_PREFIX "Command \"%s\"\n",p);
+  globalOutputStream() << MSG_PREFIX "Command \"" << p << "\"\n";
 
   if (!strcmp(p,Q3R_CMD_ABOUT))
   {
@@ -417,130 +223,107 @@ extern "C" void QERPlug_Dispatch(const char* p, vec3_t vMin, vec3_t vMax, bool b
   }
   else if (!strcmp(p,Q3R_CMD_LOAD))
   {
-    CheckInterfaces();
-
-    if (interfaces_started)
+    if (DoLoadPortalFileDialog () == IDOK)
+    {
+      portals.Load();
+      SceneChangeNotify();
+    }
+    else
     {
-      if (DoLoadPortalFileDialog () == IDOK)
-      {
-        portals.Load();
-        g_FuncTable.m_pfnSysUpdateWindows(UPDATE_ALL);
-      }
-      else
-      {
-        Sys_Printf(MSG_PREFIX "Portal file load aborted.\n", portals.fn);
-      }
+      globalOutputStream() << MSG_PREFIX "Portal file load aborted.\n", portals.fn;
     }
   }
   else if (!strcmp(p,Q3R_CMD_RELEASE))
   {
     portals.Purge();
 
-    if (interfaces_started)
-      g_FuncTable.m_pfnSysUpdateWindows(UPDATE_ALL);
+    SceneChangeNotify();
 
-    Sys_Printf(MSG_PREFIX "Portals unloaded.\n");
+    globalOutputStream() << MSG_PREFIX "Portals unloaded.\n";
   }
   else if (!strcmp(p,Q3R_CMD_SHOW_2D))
   {
     portals.show_2d = !portals.show_2d;
 
-    if(interfaces_started)
-      g_FuncTable.m_pfnSysUpdateWindows(UPDATE_ALL);
+    SceneChangeNotify();
     SaveConfig();
 
     if(portals.show_2d)
-      Sys_Printf(MSG_PREFIX "Portals will be rendered in 2D view.\n");
+      globalOutputStream() << MSG_PREFIX "Portals will be rendered in 2D view.\n";
     else
-      Sys_Printf(MSG_PREFIX "Portals will NOT be rendered in 2D view.\n");
+      globalOutputStream() << MSG_PREFIX "Portals will NOT be rendered in 2D view.\n";
   }
   else if (!strcmp(p,Q3R_CMD_SHOW_3D))
   {
     portals.show_3d = !portals.show_3d;
     SaveConfig();
 
-    if (interfaces_started)
-      g_FuncTable.m_pfnSysUpdateWindows(UPDATE_ALL);
+    SceneChangeNotify();
 
     if (portals.show_3d)
-      Sys_Printf(MSG_PREFIX "Portals will be rendered in 3D view.\n");
+      globalOutputStream() << MSG_PREFIX "Portals will be rendered in 3D view.\n";
     else
-      Sys_Printf(MSG_PREFIX "Portals will NOT be rendered in 3D view.\n");
+      globalOutputStream() << MSG_PREFIX "Portals will NOT be rendered in 3D view.\n";
   }
   else if (!strcmp(p,Q3R_CMD_OPTIONS))
   {
     DoConfigDialog ();
     SaveConfig();
 
-    if (interfaces_started)
-      g_FuncTable.m_pfnSysUpdateWindows(UPDATE_ALL);
+    SceneChangeNotify();
   }
 }
 
 
+#include "modulesystem/singletonmodule.h"
 
-// =============================================================================
-// SYNAPSE
-
-#include "synapse.h"
-
-class CSynapseClientPrtView : public CSynapseClient
+class PrtViewPluginDependencies :
+  public GlobalSceneGraphModuleRef,
+  public GlobalRadiantModuleRef,
+  public GlobalShaderCacheModuleRef,
+  public GlobalOpenGLModuleRef, 
+  public GlobalOpenGLStateLibraryModuleRef
 {
-public:
-  // CSynapseClient API
-  bool RequestAPI(APIDescriptor_t *pAPI);
-  const char* GetInfo();
-  
-  CSynapseClientPrtView() { }
-  virtual ~CSynapseClientPrtView() { }
 };
 
+class PrtViewPluginModule
+{
+  _QERPluginTable m_plugin;
+public:
+  typedef _QERPluginTable Type;
+  STRING_CONSTANT(Name, "prtview");
 
-CSynapseServer* g_pSynapseServer = NULL;
-CSynapseClientPrtView g_SynapseClient;
+  PrtViewPluginModule()
+  {
+    m_plugin.m_pfnQERPlug_Init = QERPlug_Init;
+    m_plugin.m_pfnQERPlug_GetName = QERPlug_GetName;
+    m_plugin.m_pfnQERPlug_GetCommandList = QERPlug_GetCommandList;
+    m_plugin.m_pfnQERPlug_GetCommandTitleList = QERPlug_GetCommandTitleList;
+    m_plugin.m_pfnQERPlug_Dispatch = QERPlug_Dispatch;
 
-extern "C" CSynapseClient* SYNAPSE_DLL_EXPORT Synapse_EnumerateInterfaces (const char *version, CSynapseServer *pServer)
-{
-  if (strcmp(version, SYNAPSE_VERSION))
+    PrtView_construct();
+  }
+  ~PrtViewPluginModule()
   {
-    Syn_Printf("ERROR: synapse API version mismatch: should be '" SYNAPSE_VERSION "', got '%s'\n", version);
-    return NULL;
+    PrtView_destroy();
   }
-  g_pSynapseServer = pServer;
-  g_pSynapseServer->IncRef();
-  Set_Syn_Printf(g_pSynapseServer->Get_Syn_Printf());
-    
-  g_SynapseClient.AddAPI(PLUGIN_MAJOR, PRTVIEW_MINOR, sizeof(_QERPluginTable));
-
-  g_SynapseClient.AddAPI(RADIANT_MAJOR, NULL, sizeof(g_FuncTable), SYN_REQUIRE, &g_FuncTable);
-  g_SynapseClient.AddAPI(QGL_MAJOR, NULL, sizeof(g_QglTable), SYN_REQUIRE, &g_QglTable);
-
-  return &g_SynapseClient;
-}
-
-bool CSynapseClientPrtView::RequestAPI(APIDescriptor_t *pAPI)
-{
-  if( !strcmp(pAPI->major_name, PLUGIN_MAJOR) )
+  _QERPluginTable* getTable()
   {
-    if( !strcmp(pAPI->minor_name, PRTVIEW_MINOR) )
-    {
-      _QERPluginTable* pTable= static_cast<_QERPluginTable*>(pAPI->mpTable);
-
-      pTable->m_pfnQERPlug_Init = QERPlug_Init;
-      pTable->m_pfnQERPlug_GetName = QERPlug_GetName;
-      pTable->m_pfnQERPlug_GetCommandList = QERPlug_GetCommandList;
-      pTable->m_pfnQERPlug_Dispatch = QERPlug_Dispatch;
-      return true;
-    }
+    return &m_plugin;
   }
+};
 
-  Syn_Printf("ERROR: RequestAPI( '%s' ) not found in '%s'\n", pAPI->major_name, GetInfo());
-  return false;
-}
+typedef SingletonModule<PrtViewPluginModule, PrtViewPluginDependencies> SingletonPrtViewPluginModule;
 
-#include "version.h"
+SingletonPrtViewPluginModule g_PrtViewPluginModule;
 
-const char* CSynapseClientPrtView::GetInfo()
+
+extern "C" void RADIANT_DLLEXPORT Radiant_RegisterModules(ModuleServer& server)
 {
-  return "PrtView module built " __DATE__ " " RADIANT_VERSION;
+  GlobalErrorStream::instance().setOutputStream(server.getErrorStream());
+  GlobalOutputStream::instance().setOutputStream(server.getOutputStream());
+  GlobalDebugMessageHandler::instance().setHandler(server.getDebugMessageHandler());
+  GlobalModuleServer::instance().set(server);
+
+  g_PrtViewPluginModule.selfRegister();
 }
index 468df3f..472b028 100644 (file)
@@ -17,13 +17,19 @@ License along with this library; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 */
 
-// PrtView.h : main header file for the PRTVIEW DLL
-//
+#if !defined(INCLUDED_PRTVIEW_H)
+#define INCLUDED_PRTVIEW_H
 
-#if !defined(AFX_PRTVIEW_H__234356A6_1D66_11D4_BFEB_204C4F4F5020__INCLUDED_)
-#define AFX_PRTVIEW_H__234356A6_1D66_11D4_BFEB_204C4F4F5020__INCLUDED_
+#define MSG_PREFIX "Portal Viewer plugin: "
 
 void InitInstance ();
 void SaveConfig ();
 
-#endif // !defined(AFX_PRTVIEW_H__234356A6_1D66_11D4_BFEB_204C4F4F5020__INCLUDED_)
+int INIGetInt(char *key, int def);
+void INISetInt(char *key, int val, char *comment = 0);
+
+#define IDOK                1
+#define IDCANCEL            2
+
+
+#endif
diff --git a/contrib/prtview/resource.h b/contrib/prtview/resource.h
deleted file mode 100644 (file)
index 5fdce40..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by PrtView.rc
-//
-#define IDD_ABOUT                       129
-#define IDD_LOAD                        130
-#define IDD_CONFIG                      131
-#define IDC_LOAD_2D                     1000
-#define IDC_LOAD_3D                     1001
-#define IDC_LOAD_FILE_NAME              1002
-#define IDC_LOAD_OTHER                  1003
-#define IDC_CONFIG_3D                   1004
-#define IDC_CONFIG_2D                   1005
-#define IDC_SCROLL_2D_WIDTH             1006
-#define IDC_2D_WIDTH                    1007
-#define IDC_ANTI_ALIAS_2D               1008
-#define IDC_COLOR_2D                    1009
-#define IDC_ZBUFFER                     1010
-#define IDC_SCROLL_3D_WIDTH             1011
-#define IDC_3D_WIDTH                    1012
-#define IDC_ANTI_ALIAS_3D               1013
-#define IDC_COLOR_3D                    1014
-#define IDC_COLOR_FOG                   1015
-#define IDC_FOG                         1016
-#define IDC_SCROLL_3D_TRANS             1017
-#define IDC_POLY                        1018
-#define IDC_3D_TRANS                    1019
-#define IDC_LINES                       1020
-#define IDC_SCROLL_CUBIC                1021
-#define IDC_CUBIC                       1022
-#define IDC_CLIP                        1023
-
-// Next default values for new objects
-// 
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE        133
-#define _APS_NEXT_COMMAND_VALUE         32771
-#define _APS_NEXT_CONTROL_VALUE         1011
-#define _APS_NEXT_SYMED_VALUE           101
-#endif
-#endif
diff --git a/contrib/prtview/stdafx.cpp b/contrib/prtview/stdafx.cpp
deleted file mode 100644 (file)
index 06ae853..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
-PrtView plugin for GtkRadiant
-Copyright (C) 2001 Geoffrey Dewan, Loki software and qeradiant.com
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-// stdafx.cpp : source file that includes just the standard includes
-//     PrtView.pch will be the pre-compiled header
-//     stdafx.obj will contain the pre-compiled type information
-
-#include "stdafx.h"
-
diff --git a/contrib/prtview/stdafx.h b/contrib/prtview/stdafx.h
deleted file mode 100644 (file)
index b7c872f..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
-PrtView plugin for GtkRadiant
-Copyright (C) 2001 Geoffrey Dewan, Loki software and qeradiant.com
-
-This library is free software; you can redistribute it and/or
-modify it under the terms of the GNU Lesser General Public
-License as published by the Free Software Foundation; either
-version 2.1 of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-Lesser General Public License for more details.
-
-You should have received a copy of the GNU Lesser General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
-*/
-
-#ifndef __PRTVIEW_AFX_H__
-#define __PRTVIEW_AFX_H__
-
-#include "mathlib.h"
-#include <string.h>
-#include "qertypes.h"
-#include <stdio.h>
-
-#include "iscenegraph.h"
-#define USE_QERTABLE_DEFINE
-#include "qerplugin.h"
-extern _QERFuncTable_1 g_FuncTable;
-
-// plugin
-#include "iplugin.h"
-#include "ibspfrontend.h"
-#include "igl.h"
-#include "version.h"
-
-
-#include <gtk/gtk.h>
-
-#ifdef WIN32
-#include <windows.h>
-#endif
-
-#if defined(__linux__) || defined(__APPLE__)
-#include <GL/glx.h>
-
-typedef guint32 COLORREF;
-typedef void* LPVOID;
-typedef char* LPCSTR;
-typedef void* HMODULE;
-typedef int   BOOL;
-
-#define RGB(r, g, b) ((guint32)(((guint8) (r) | ((guint16) (g) << 8))|(((guint32) (guint8) (b)) << 16)))
-#define GetRValue(rgb)      ((guint8)(rgb))
-#define GetGValue(rgb)      ((guint8)(((guint16)(rgb)) >> 8))
-#define GetBValue(rgb)      ((guint8)((rgb)>>16))
-
-#define IDOK                1
-#define IDCANCEL            2
-
-#endif // __linux__
-
-#define PATH_MAX 260
-
-// PrtView
-#include "gtkdlgs.h"
-#include "prtview.h"
-#include "portals.h"
-
-#define MSG_PREFIX "Portal Viewer plugin: "
-#define PRTVIEW_MINOR "prtview"
-
-#define UPDATE_2D (W_XY | W_XZ | W_YZ)
-#define UPDATE_3D (W_CAMERA)
-#define UPDATE_ALL (UPDATE_2D | UPDATE_3D)
-
-int INIGetInt(char *key, int def);
-void INISetInt(char *key, int val, char *comment = NULL);
-
-extern bool interfaces_started;
-
-extern _QERFuncTable_1 g_FuncTable;
-extern _QERQglTable g_QglTable;
-
-#endif
diff --git a/include/iglrender.cpp b/include/iglrender.cpp
new file mode 100644 (file)
index 0000000..26d66ae
--- /dev/null
@@ -0,0 +1,3 @@
+
+#include "iglrender.h"
+
diff --git a/include/iglrender.h b/include/iglrender.h
new file mode 100644 (file)
index 0000000..d5b3684
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+Copyright (C) 2001-2006, William Joseph.
+All Rights Reserved.
+
+This file is part of GtkRadiant.
+
+GtkRadiant is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+GtkRadiant is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with GtkRadiant; if not, write to the Free Software
+Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
+*/
+
+#if !defined(INCLUDED_IGLRENDER_H)
+#define INCLUDED_IGLRENDER_H
+
+#include "igl.h"
+#include "math/vector.h"
+class AABB;
+class Matrix4;
+
+
+class GLProgram
+{
+public:
+  virtual void enable() = 0;
+  virtual void disable() = 0;
+  virtual void setParameters(const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light) = 0;
+};
+
+class OpenGLFogState
+{
+public:
+  OpenGLFogState() : mode(GL_EXP), density(0), start(0), end(0), index(0), colour(1, 1, 1, 1)
+  {
+  }
+  GLenum mode;
+  GLfloat density;
+  GLfloat start;
+  GLfloat end;
+  GLint index;
+  Vector4 colour;
+};
+
+//! A collection of opengl state information.
+class OpenGLState
+{
+public:
+  enum ESort
+  {
+    eSortFirst = 0,
+    eSortOpaque = 1,
+    eSortMultiFirst = 2,
+    eSortMultiLast = 1023,
+    eSortOverbrighten = 1024,
+    eSortFullbright = 1025,
+    eSortHighlight = 1026,
+    eSortTranslucent = 1027,
+    eSortOverlayFirst = 1028,
+    eSortOverlayLast = 2047,
+    eSortControlFirst = 2048,
+    eSortControlLast = 3071,
+    eSortGUI0 = 3072,
+    eSortGUI1 = 3073,
+    eSortLast = 4096,
+  };
+
+  unsigned int m_state;
+  std::size_t m_sort;
+  GLint m_texture;
+  GLint m_texture1;
+  GLint m_texture2;
+  GLint m_texture3;
+  GLint m_texture4;
+  GLint m_texture5;
+  GLint m_texture6;
+  GLint m_texture7;
+  Vector4 m_colour;
+  GLenum m_blend_src, m_blend_dst;
+  GLenum m_depthfunc;
+  GLenum m_alphafunc;
+  GLfloat m_alpharef;
+  GLfloat m_linewidth;
+  GLfloat m_pointsize;
+  GLint m_linestipple_factor;
+  GLushort m_linestipple_pattern;
+  OpenGLFogState m_fog;
+  GLProgram* m_program;
+
+  OpenGLState() : m_program(0)
+  {
+  }
+};
+
+class OpenGLStateLibrary
+{
+public:
+  INTEGER_CONSTANT(Version, 1);
+  STRING_CONSTANT(Name, "openglshaderlibrary");
+
+  virtual void getDefaultState(OpenGLState& state) const = 0;
+
+  virtual void insert(const char* name, const OpenGLState& state) = 0;
+  virtual void erase(const char* name) = 0;
+};
+
+#include "modulesystem.h"
+
+template<typename Type>
+class GlobalModule;
+typedef GlobalModule<OpenGLStateLibrary> GlobalOpenGLStateLibraryModule;
+
+template<typename Type>
+class GlobalModuleRef;
+typedef GlobalModuleRef<OpenGLStateLibrary> GlobalOpenGLStateLibraryModuleRef;
+
+inline OpenGLStateLibrary& GlobalOpenGLStateLibrary()
+{
+  return GlobalOpenGLStateLibraryModule::getTable();
+}
+
+#endif
index 80acc03..bc88f8d 100644 (file)
                        RelativePath=".\igl.h">\r
                </File>\r
                <File\r
+                       RelativePath=".\iglrender.cpp">\r
+               </File>\r
+               <File\r
+                       RelativePath=".\iglrender.h">\r
+               </File>\r
+               <File\r
                        RelativePath=".\igtkgl.cpp">\r
                </File>\r
                <File\r
index d3166aa..77cdf0e 100644 (file)
@@ -30,24 +30,28 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 
 const unsigned int RENDER_DEFAULT = 0;
 const unsigned int RENDER_LINESTIPPLE = 1 << 0; // glEnable(GL_LINE_STIPPLE)
-const unsigned int RENDER_POLYGONSTIPPLE = 1 << 1; // glEnable(GL_POLYGON_STIPPLE)
-const unsigned int RENDER_ALPHATEST = 1 << 2; // glEnable(GL_ALPHA_TEST)
-const unsigned int RENDER_DEPTHTEST = 1 << 3; // glEnable(GL_DEPTH_TEST)
-const unsigned int RENDER_DEPTHWRITE = 1 << 4; // glDepthMask(GL_TRUE)
-const unsigned int RENDER_COLOURWRITE = 1 << 5; // glColorMask(GL_TRUE; GL_TRUE; GL_TRUE; GL_TRUE)
-const unsigned int RENDER_CULLFACE = 1 << 6; // glglEnable(GL_CULL_FACE)
-const unsigned int RENDER_SCALED = 1 << 7; // glEnable(GL_NORMALIZE)
-const unsigned int RENDER_SMOOTH = 1 << 8; // glShadeModel
-const unsigned int RENDER_LIGHTING = 1 << 9; // glEnable(GL_LIGHTING)
-const unsigned int RENDER_BLEND = 1 << 10; // glEnable(GL_BLEND)
-const unsigned int RENDER_OFFSETLINE = 1 << 11; // glEnable(GL_POLYGON_OFFSET_LINE)
-const unsigned int RENDER_FILL = 1 << 12; // glPolygonMode
-const unsigned int RENDER_COLOUR = 1 << 13; // glEnableClientState(GL_COLOR_ARRAY)
-const unsigned int RENDER_TEXTURE = 1 << 14; // glEnable(GL_TEXTURE_2D)
-const unsigned int RENDER_BUMP = 1 << 15;
-const unsigned int RENDER_PROGRAM = 1 << 16;
-const unsigned int RENDER_SCREEN = 1 << 17;
-const unsigned int RENDER_OVERRIDE = 1 << 18;
+const unsigned int RENDER_LINESMOOTH = 1 << 1; // glEnable(GL_LINE_SMOOTH)
+const unsigned int RENDER_POLYGONSTIPPLE = 1 << 2; // glEnable(GL_POLYGON_STIPPLE)
+const unsigned int RENDER_POLYGONSMOOTH = 1 << 3; // glEnable(GL_POLYGON_SMOOTH)
+const unsigned int RENDER_ALPHATEST = 1 << 4; // glEnable(GL_ALPHA_TEST)
+const unsigned int RENDER_DEPTHTEST = 1 << 5; // glEnable(GL_DEPTH_TEST)
+const unsigned int RENDER_DEPTHWRITE = 1 << 6; // glDepthMask(GL_TRUE)
+const unsigned int RENDER_COLOURWRITE = 1 << 7; // glColorMask(GL_TRUE; GL_TRUE; GL_TRUE; GL_TRUE)
+const unsigned int RENDER_CULLFACE = 1 << 8; // glglEnable(GL_CULL_FACE)
+const unsigned int RENDER_SCALED = 1 << 9; // glEnable(GL_NORMALIZE)
+const unsigned int RENDER_SMOOTH = 1 << 10; // glShadeModel
+const unsigned int RENDER_FOG = 1 << 11; // glEnable(GL_FOG)
+const unsigned int RENDER_LIGHTING = 1 << 12; // glEnable(GL_LIGHTING)
+const unsigned int RENDER_BLEND = 1 << 13; // glEnable(GL_BLEND)
+const unsigned int RENDER_OFFSETLINE = 1 << 14; // glEnable(GL_POLYGON_OFFSET_LINE)
+const unsigned int RENDER_FILL = 1 << 15; // glPolygonMode
+const unsigned int RENDER_COLOURARRAY = 1 << 16; // glEnableClientState(GL_COLOR_ARRAY)
+const unsigned int RENDER_COLOURCHANGE = 1 << 17; // render() is allowed to call glColor*()
+const unsigned int RENDER_TEXTURE = 1 << 18; // glEnable(GL_TEXTURE_2D)
+const unsigned int RENDER_BUMP = 1 << 19;
+const unsigned int RENDER_PROGRAM = 1 << 20;
+const unsigned int RENDER_SCREEN = 1 << 21;
+const unsigned int RENDER_OVERRIDE = 1 << 22;
 typedef unsigned int RenderStateFlags;
 
 
index fe581e8..1a45919 100644 (file)
@@ -106,6 +106,8 @@ struct _QERFuncTable_1
   const char* (*getGameName)();
   const char* (*getGameMode)();
 
+  const char* (*getMapName)();
+
   const char* (*getGameDescriptionKeyValue)(const char* key);
   const char* (*getRequiredGameDescriptionKeyValue)(const char* key);
 
index 3c5b0bc..7fcedbb 100644 (file)
@@ -105,7 +105,7 @@ bool read_var (const char *filename, const char *section, const char *key, char
   return false;
 }
 
-static bool save_var (const char *filename, const char *section, const char *key, const char *value)
+bool save_var (const char *filename, const char *section, const char *key, const char *value)
 {
   char line[1024], *ptr;
   MemStream old_rc;
index ecd8b2b..1974d04 100644 (file)
@@ -44,5 +44,6 @@ float profile_load_float (const char *filename, const char *section, const char
 char* profile_load_string (const char *filename, const char *section, const char *key, const char *default_value);
 // used in the command map code
 bool read_var (const char *filename, const char *section, const char *key, char *value);
+bool save_var (const char *filename, const char *section, const char *key, const char *value);
 
 #endif
index 9d55aa7..71b94b7 100644 (file)
@@ -1045,7 +1045,7 @@ public:
     glDrawElements(m_mode, GLsizei(m_indices.size()), RenderIndexTypeID, m_indices.data());
 #else
     glBegin(m_mode);
-    if(state & RENDER_COLOUR != 0)
+    if(state & RENDER_COLOURARRAY != 0)
     {
       for(std::size_t i = 0; i < m_indices.size(); ++i)
       {
index 4ef1ad1..bbae8fb 100644 (file)
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/archivepak.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/archivepak.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                ImportLibrary="$(OutDir)/archivepak.lib"\r
                                TargetMachine="1"/>\r
@@ -52,7 +53,8 @@
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -102,9 +104,11 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/archivepak.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
@@ -116,7 +120,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -162,43 +167,45 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        </File>\r
                </Filter>\r
                <File\r
-                       RelativePath="..\..\debug.py">\r
+                       RelativePath=".\archivepak.def">\r
                        <FileConfiguration\r
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
-                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
-                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
+                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;\r
+"\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
+                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
                        </FileConfiguration>\r
                        <FileConfiguration\r
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
-                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
-                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
+                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;\r
+"\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
+                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
                        </FileConfiguration>\r
                </File>\r
                <File\r
-                       RelativePath=".\archivepak.def">\r
+                       RelativePath="..\..\debug.py">\r
                        <FileConfiguration\r
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
 "\r
-                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
-                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
+                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
                        <FileConfiguration\r
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
 "\r
-                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
-                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
+                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
                </File>\r
        </Files>\r
index a9b7f81..94578ff 100644 (file)
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/archivewad.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/archivewad.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                ImportLibrary="$(OutDir)/archivewad.lib"\r
                                TargetMachine="1"/>\r
@@ -52,7 +53,8 @@
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -102,9 +104,11 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/archivewad.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
@@ -116,7 +120,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -162,43 +167,45 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        </File>\r
                </Filter>\r
                <File\r
-                       RelativePath="..\..\debug.py">\r
+                       RelativePath=".\archivewad.def">\r
                        <FileConfiguration\r
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
-                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
-                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
+                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;\r
+"\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
+                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
                        </FileConfiguration>\r
                        <FileConfiguration\r
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
-                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
-                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
+                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;\r
+"\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
+                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
                        </FileConfiguration>\r
                </File>\r
                <File\r
-                       RelativePath=".\archivewad.def">\r
+                       RelativePath="..\..\debug.py">\r
                        <FileConfiguration\r
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
 "\r
-                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
-                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
+                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
                        <FileConfiguration\r
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
 "\r
-                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
-                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
+                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
                </File>\r
        </Files>\r
index bd6507c..41772d7 100644 (file)
                                AdditionalDependencies="zdll.lib"\r
                                OutputFile="$(OutDir)/archivezip.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="../../../zlib1-1.2/lib"\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/archivezip.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                ImportLibrary="$(OutDir)/archivezip.lib"\r
                                TargetMachine="1"/>\r
@@ -55,7 +56,8 @@
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -106,10 +108,12 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                AdditionalDependencies="zdll.lib"\r
                                OutputFile="$(OutDir)/archivezip.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="../../../zlib1-1.2/lib"\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
@@ -121,7 +125,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -173,43 +178,45 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        </File>\r
                </Filter>\r
                <File\r
-                       RelativePath="..\..\debug.py">\r
+                       RelativePath=".\archivezip.def">\r
                        <FileConfiguration\r
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
-                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
-                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
+                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;\r
+"\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
+                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
                        </FileConfiguration>\r
                        <FileConfiguration\r
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
-                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
-                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
+                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;\r
+"\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
+                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
                        </FileConfiguration>\r
                </File>\r
                <File\r
-                       RelativePath=".\archivezip.def">\r
+                       RelativePath="..\..\debug.py">\r
                        <FileConfiguration\r
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
 "\r
-                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
-                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
+                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
                        <FileConfiguration\r
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot; &quot;$(TargetPath)&quot;\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
 "\r
-                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
-                                       Outputs="&quot;$(TargetPath)&quot;"/>\r
+                                       AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
+                                       Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
                </File>\r
        </Files>\r
index f6e200e..9da1826 100644 (file)
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/entityq3.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/entityq3.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                ImportLibrary="$(OutDir)/entityq3.lib"\r
                                TargetMachine="1"/>\r
@@ -104,9 +105,11 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/entityq3.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
index 85bc2db..8c98b74 100644 (file)
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/imageq3.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories=""\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/imageq3.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                ImportLibrary="$(OutDir)/imageq3.lib"\r
                                TargetMachine="1"/>\r
@@ -53,7 +54,8 @@
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -103,10 +105,12 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/imageq3.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories=""\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
@@ -118,7 +122,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -191,7 +196,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
@@ -199,7 +205,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
index ad481d5..ffd0a7a 100644 (file)
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/imagehl.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories=""\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/imagehl.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                ImportLibrary="$(OutDir)/imagehl.lib"\r
                                TargetMachine="1"/>\r
@@ -53,7 +54,8 @@
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules\&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules\&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules\&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -103,10 +105,12 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/imagehl.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories=""\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
@@ -118,7 +122,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules\&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules\&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules\&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
index b280040..70a34a7 100644 (file)
                                AdditionalDependencies="glib-2.0.lib libpng13.lib"\r
                                OutputFile="$(OutDir)/imagepng.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="&quot;../../../gtk2-2.4/lib&quot;;&quot;../../../libpng-1.2/lib&quot;"\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/imagepng.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                ImportLibrary="$(OutDir)/imagepng.lib"\r
                                TargetMachine="1"/>\r
@@ -54,7 +55,8 @@
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -105,10 +107,12 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                AdditionalDependencies="glib-2.0.lib libpng13.lib"\r
                                OutputFile="$(OutDir)/imagepng.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="&quot;../../../gtk2-2.4/lib&quot;;&quot;../../../libpng-1.2/lib&quot;"\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
@@ -120,7 +124,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -159,7 +164,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
@@ -167,7 +173,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
index f13fa2f..5997a60 100644 (file)
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/imageq2.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories=""\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/imageq2.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                ImportLibrary="$(OutDir)/imageq2.lib"\r
                                TargetMachine="1"/>\r
@@ -53,7 +54,8 @@
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -103,10 +105,12 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/imageq2.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories=""\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
@@ -118,7 +122,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -173,7 +178,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
@@ -181,7 +187,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
index ebedeeb..92b6a77 100644 (file)
@@ -40,6 +40,7 @@
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/mapq3.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
@@ -52,7 +53,8 @@
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -102,6 +104,7 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/mapq3.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
@@ -116,7 +119,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -171,7 +175,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
@@ -179,7 +184,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
index c8f1224..1ce719a 100644 (file)
                                AdditionalDependencies="libxml2.lib glib-2.0.lib"\r
                                OutputFile="$(OutDir)/mapxml.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="&quot;../../../libxml2-2.6/win32/lib&quot;;&quot;../../../gtk2-2.4/lib&quot;"\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/mapxml.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                ImportLibrary="$(OutDir)/mapxml.lib"\r
                                TargetMachine="1"/>\r
@@ -54,7 +55,8 @@
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -105,10 +107,12 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                AdditionalDependencies="libxml2.lib glib-2.0.lib"\r
                                OutputFile="$(OutDir)/mapxml.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="&quot;../../../libxml2-2.6/win32/lib&quot;;&quot;../../../gtk2-2.4/lib&quot;"\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
@@ -120,7 +124,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -176,7 +181,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
@@ -184,7 +190,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
index 5f1676d..dff7eb2 100644 (file)
@@ -33,6 +33,7 @@
                                WarningLevel="3"\r
                                Detect64BitPortabilityProblems="TRUE"\r
                                DebugInformationFormat="3"\r
+                               CompileAs="2"\r
                                DisableSpecificWarnings="4610;4510;4512;4505;4100;4127"/>\r
                        <Tool\r
                                Name="VCCustomBuildTool"/>\r
                                AdditionalDependencies="glib-2.0.lib"\r
                                OutputFile="$(OutDir)/modelmd3.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="&quot;../../../gtk2-2.4/lib&quot;"\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/modelmd3.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                ImportLibrary="$(OutDir)/modelmd3.lib"\r
                                TargetMachine="1"/>\r
@@ -54,7 +56,8 @@
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -97,6 +100,7 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                WarningLevel="4"\r
                                Detect64BitPortabilityProblems="TRUE"\r
                                DebugInformationFormat="3"\r
+                               CompileAs="2"\r
                                DisableSpecificWarnings="4610;4510;4512;4505;4100;4127"/>\r
                        <Tool\r
                                Name="VCCustomBuildTool"/>\r
@@ -105,10 +109,12 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                AdditionalDependencies="glib-2.0.lib"\r
                                OutputFile="$(OutDir)/modelmd3.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="&quot;../../../gtk2-2.4/lib&quot;"\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
@@ -120,7 +126,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -230,7 +237,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
@@ -238,7 +246,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
index 0f8e1df..0e1e4d8 100644 (file)
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/modelpico.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories=""\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/modelpico.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                ImportLibrary="$(OutDir)/modelpico.lib"\r
                                TargetMachine="1"/>\r
@@ -53,7 +54,8 @@
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -93,6 +95,7 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                BufferSecurityCheck="FALSE"\r
                                ForceConformanceInForLoopScope="TRUE"\r
                                UsePrecompiledHeader="0"\r
+                               BrowseInformation="0"\r
                                WarningLevel="4"\r
                                Detect64BitPortabilityProblems="TRUE"\r
                                DebugInformationFormat="3"\r
@@ -103,10 +106,12 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="VCLinkerTool"\r
                                OutputFile="$(OutDir)/modelpico.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories=""\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
@@ -118,7 +123,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -168,7 +174,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
@@ -176,7 +183,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
index 55f0ace..38d9322 100644 (file)
                                Name="VCLinkerTool"
                                OutputFile="$(OutDir)/sample.dll"
                                LinkIncremental="1"
+                               SuppressStartupBanner="TRUE"
                                IgnoreDefaultLibraryNames="msvcprtd.lib"
                                ModuleDefinitionFile="$(ProjectName).def"
                                GenerateDebugInformation="TRUE"
-                               ProgramDatabaseFile="$(OutDir)/sample.pdb"
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
                                SubSystem="2"
                                ImportLibrary="$(OutDir)/sample.lib"
                                TargetMachine="1"/>
                                Name="VCLinkerTool"
                                OutputFile="$(OutDir)/sample.dll"
                                LinkIncremental="1"
+                               SuppressStartupBanner="TRUE"
                                IgnoreDefaultLibraryNames="msvcprt.lib"
                                ModuleDefinitionFile="$(ProjectName).def"
                                GenerateDebugInformation="TRUE"
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"
                                SubSystem="2"
                                OptimizeReferences="2"
                                EnableCOMDATFolding="2"
                                Name="Debug|Win32">
                                <Tool
                                        Name="VCCustomBuildTool"
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;
+"
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>
                        </FileConfiguration>
                                Name="Release|Win32">
                                <Tool
                                        Name="VCCustomBuildTool"
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;
+"
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>
                        </FileConfiguration>
index 8f6d6d6..e485374 100644 (file)
                                AdditionalDependencies="glib-2.0.lib"\r
                                OutputFile="$(OutDir)/shadersq3.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="&quot;../../../gtk2-2.4/lib&quot;"\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/shadersq3.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                ImportLibrary="$(OutDir)/shadersq3.lib"\r
                                TargetMachine="1"/>\r
@@ -54,7 +55,8 @@
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -105,10 +107,12 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                AdditionalDependencies="glib-2.0.lib"\r
                                OutputFile="$(OutDir)/shadersq3.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="&quot;../../../gtk2-2.4/lib&quot;"\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
@@ -120,7 +124,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -169,7 +174,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
@@ -177,7 +183,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
index e5c60c6..35a3b12 100644 (file)
                                AdditionalDependencies="glib-2.0.lib"\r
                                OutputFile="$(OutDir)/vfsq3.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="&quot;../../../gtk2-2.4/lib&quot;"\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
-                               ProgramDatabaseFile="$(OutDir)/vfsq3.pdb"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                ImportLibrary="$(OutDir)/vfsq3.lib"\r
                                TargetMachine="1"/>\r
@@ -54,7 +55,8 @@
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -105,10 +107,12 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                AdditionalDependencies="glib-2.0.lib"\r
                                OutputFile="$(OutDir)/vfsq3.dll"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="&quot;../../../gtk2-2.4/lib&quot;"\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
                                ModuleDefinitionFile="$(ProjectName).def"\r
                                GenerateDebugInformation="TRUE"\r
+                               ProgramDatabaseFile="$(OutDir)/$(ProjectName).pdb"\r
                                SubSystem="2"\r
                                OptimizeReferences="2"\r
                                EnableCOMDATFolding="2"\r
@@ -120,7 +124,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                        <Tool\r
                                Name="VCPostBuildEventTool"\r
                                CommandLine="copy &quot;$(TargetPath)&quot; &quot;$(SolutionDir)install\modules&quot;\r
-copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;"/>\r
+copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modules&quot;\r
+"/>\r
                        <Tool\r
                                Name="VCPreBuildEventTool"/>\r
                        <Tool\r
@@ -176,7 +181,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Debug|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
@@ -184,7 +190,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                Name="Release|Win32">\r
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
-                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)debug.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetName).pdb&quot;"\r
                                        Outputs="&quot;$(TargetDir)$(TargetName).pdb&quot;"/>\r
                        </FileConfiguration>\r
@@ -196,7 +203,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
                                        Description="Performing Custom Build Step"\r
-                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
                                        Outputs="&quot;$(TargetPath)&quot;"/>\r
                        </FileConfiguration>\r
@@ -205,7 +213,8 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot; &quot;$(SolutionDir)install\modul
                                <Tool\r
                                        Name="VCCustomBuildTool"\r
                                        Description="Performing Custom Build Step"\r
-                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot;"\r
+                                       CommandLine="python &quot;$(SolutionDir)touch.py&quot;\r
+"\r
                                        AdditionalDependencies="&quot;$(SolutionDir)install\modules\$(TargetFileName)&quot;"\r
                                        Outputs="&quot;$(TargetPath)&quot;"/>\r
                        </FileConfiguration>\r
index 461793e..1264a5b 100644 (file)
@@ -42,6 +42,7 @@
                                AdditionalDependencies="msvcrtd.lib oldnames.lib winmm.lib kernel32.lib user32.lib gdi32.lib shfolder.lib wsock32.lib dbghelp.lib glib-2.0.lib gobject-2.0.lib gdk-win32-2.0.lib gdk_pixbuf-2.0.lib gtk-win32-2.0.lib pango-1.0.lib gtkglext-win32-1.0.lib gdkglext-win32-1.0.lib opengl32.lib libxml2.lib profile.lib"\r
                                OutputFile="$(OutDir)/$(ProjectName).exe"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="&quot;../../gtk2-2.4/lib&quot;;&quot;../../libxml2-2.6/win32/lib&quot;;&quot;../libs/profile/debug/&quot;"\r
                                IgnoreAllDefaultLibraries="TRUE"\r
                                IgnoreDefaultLibraryNames="msvcprtd.lib"\r
@@ -111,6 +112,7 @@ copy &quot;$(TargetDir)$(TargetName).pdb&quot;  &quot;$(SolutionDir)install&quot
                                AdditionalDependencies="msvcrt.lib oldnames.lib winmm.lib kernel32.lib user32.lib gdi32.lib shfolder.lib wsock32.lib dbghelp.lib glib-2.0.lib gobject-2.0.lib gdk-win32-2.0.lib gdk_pixbuf-2.0.lib gtk-win32-2.0.lib pango-1.0.lib gtkglext-win32-1.0.lib gdkglext-win32-1.0.lib opengl32.lib libxml2.lib profile.lib"\r
                                OutputFile="$(OutDir)/$(ProjectName).exe"\r
                                LinkIncremental="1"\r
+                               SuppressStartupBanner="TRUE"\r
                                AdditionalLibraryDirectories="&quot;../../gtk2-2.4/lib&quot;;&quot;../../libxml2-2.6/win32/lib&quot;;&quot;../libs/profile/release/&quot;"\r
                                IgnoreAllDefaultLibraries="TRUE"\r
                                IgnoreDefaultLibraryNames="msvcprt.lib"\r
index ed8ec13..04de6b4 100644 (file)
@@ -1532,7 +1532,7 @@ void CamWnd::Cam_Draw()
   }
 
 
-  unsigned int globalstate = RENDER_DEPTHTEST|RENDER_COLOURWRITE|RENDER_DEPTHWRITE|RENDER_ALPHATEST|RENDER_BLEND|RENDER_CULLFACE|RENDER_COLOUR|RENDER_OFFSETLINE;
+  unsigned int globalstate = RENDER_DEPTHTEST|RENDER_COLOURWRITE|RENDER_DEPTHWRITE|RENDER_ALPHATEST|RENDER_BLEND|RENDER_CULLFACE|RENDER_COLOURARRAY|RENDER_OFFSETLINE|RENDER_POLYGONSMOOTH|RENDER_LINESMOOTH|RENDER_FOG|RENDER_COLOURCHANGE;
   switch (m_Camera.draw_mode)
   {
   case cd_wire:
index 3cf5311..cd85e2a 100644 (file)
@@ -93,6 +93,11 @@ const char* GameDescription_getRequiredKeyValue(const char* key)
   return g_pGameDescription->getRequiredKeyValue(key);
 }
 
+const char* mapname_get()
+{
+  return Map_Name(g_map);
+}
+
 class RadiantCoreAPI
 {
   _QERFuncTable_1 m_radiantcore;
@@ -110,6 +115,8 @@ public:
     m_radiantcore.getGameName = &gamename_get;
     m_radiantcore.getGameMode = &gamemode_get;
 
+    m_radiantcore.getMapName = &mapname_get;
+
     m_radiantcore.getGameDescriptionKeyValue = &GameDescription_getKeyValue;
     m_radiantcore.getRequiredGameDescriptionKeyValue = &GameDescription_getRequiredKeyValue;
 
index d3c01de..b648c92 100644 (file)
@@ -28,6 +28,7 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 #include "irender.h"
 #include "itextures.h"
 #include "igl.h"
+#include "iglrender.h"
 #include "renderable.h"
 #include "qerplugin.h"
 
@@ -219,14 +220,6 @@ void GLSLProgram_validate(GLhandleARB program)
 bool g_bumpGLSLPass_enabled = false;
 bool g_depthfillPass_enabled = false;
 
-class GLProgram
-{
-public:
-  virtual void enable() = 0;
-  virtual void disable() = 0;
-  virtual void setParameters(const Vector3& viewer, const Matrix4& localToWorld, const Vector3& origin, const Vector3& colour, const Matrix4& world2light) = 0;
-};
-
 class GLSLBumpProgram : public GLProgram
 {
 public:
@@ -826,55 +819,6 @@ bool g_normalArray_enabled = false;
 bool g_texcoordArray_enabled = false;
 bool g_colorArray_enabled = false;
 
-//! A collection of opengl state information.
-class OpenGLState
-{
-public:
-  enum ESort
-  {
-    eSortFirst = 0,
-    eSortOpaque = 1,
-    eSortMultiFirst = 2,
-    eSortMultiLast = 1023,
-    eSortOverbrighten = 1024,
-    eSortFullbright = 1025,
-    eSortHighlight = 1026,
-    eSortTranslucent = 1027,
-    eSortOverlayFirst = 1028,
-    eSortOverlayLast = 2047,
-    eSortControlFirst = 2048,
-    eSortControlLast = 3071,
-    eSortGUI0 = 3072,
-    eSortGUI1 = 3073,
-    eSortLast = 4096,
-  };
-
-  unsigned int m_state;
-  std::size_t m_sort;
-  GLint m_texture;
-  GLint m_texture1;
-  GLint m_texture2;
-  GLint m_texture3;
-  GLint m_texture4;
-  GLint m_texture5;
-  GLint m_texture6;
-  GLint m_texture7;
-  Vector4 m_colour;
-  GLenum m_blend_src, m_blend_dst;
-  GLenum m_depthfunc;
-  GLenum m_alphafunc;
-  GLfloat m_alpharef;
-  GLfloat m_linewidth;
-  GLfloat m_pointsize;
-  GLint m_linestipple_factor;
-  GLushort m_linestipple_pattern;
-  GLProgram* m_program;
-
-  OpenGLState() : m_program(0)
-  {
-  }
-};
-
 inline bool OpenGLState_less(const OpenGLState& self, const OpenGLState& other)
 {
   //! Sort by sort-order override.
@@ -955,6 +899,8 @@ void OpenGLState_constructDefault(OpenGLState& state)
 
   state.m_linestipple_factor = 1;
   state.m_linestipple_pattern = 0xaaaa;
+
+  state.m_fog = OpenGLFogState();
 }
 
 
@@ -1284,6 +1230,16 @@ public:
   }
 };
 
+inline void setFogState(const OpenGLFogState& state)
+{
+       glFogi(GL_FOG_MODE, state.mode);
+       glFogf(GL_FOG_DENSITY, state.density);
+       glFogf(GL_FOG_START, state.start);
+       glFogf(GL_FOG_END, state.end);
+       glFogi(GL_FOG_INDEX, state.index);
+       glFogfv(GL_FOG_COLOR, vector4_to_array(state.colour));
+}
+
 #define DEBUG_SHADERS 0
 
 class OpenGLShaderCache : public ShaderCache, public TexturesCacheObserver, public ModuleObserver
@@ -1459,6 +1415,10 @@ public:
     glLineWidth(1);
     glPointSize(1);
 
+         glHint(GL_FOG_HINT, GL_NICEST);
+    glDisable(GL_FOG);
+    setFogState(OpenGLFogState());
+
     GlobalOpenGL_debugAssertNoErrors();
 
     debug_string("begin rendering");
@@ -1796,6 +1756,20 @@ inline void setTextureState(GLint& current, const GLint& texture)
   }
 }
 
+inline void setState(unsigned int state, unsigned int delta, unsigned int flag, GLenum glflag)
+{
+  if(delta & state & flag)
+  {
+    glEnable(glflag);
+    GlobalOpenGL_debugAssertNoErrors();
+  }
+  else if(delta & ~state & flag)
+  {
+    glDisable(glflag);
+    GlobalOpenGL_debugAssertNoErrors();
+  }
+}
+
 void OpenGLState_apply(const OpenGLState& self, OpenGLState& current, unsigned int globalstate)
 {
   debug_int("sort", int(self.m_sort));
@@ -1847,14 +1821,7 @@ void OpenGLState_apply(const OpenGLState& self, OpenGLState& current, unsigned i
     GlobalOpenGL_debugAssertNoErrors();
   }
 
-  if(delta & state & RENDER_OFFSETLINE)
-  {
-    glEnable(GL_POLYGON_OFFSET_LINE);
-  }
-  else if(delta & ~state & RENDER_OFFSETLINE)
-  {
-    glDisable(GL_POLYGON_OFFSET_LINE);
-  }
+  setState(state, delta, RENDER_OFFSETLINE, GL_POLYGON_OFFSET_LINE);
 
   if(delta & state & RENDER_LIGHTING)
   {
@@ -1937,16 +1904,7 @@ void OpenGLState_apply(const OpenGLState& self, OpenGLState& current, unsigned i
     GlobalOpenGL_debugAssertNoErrors();
   }
 
-  if(delta & state & RENDER_CULLFACE)
-  {
-    glEnable(GL_CULL_FACE);
-    GlobalOpenGL_debugAssertNoErrors();
-  }
-  else if(delta & ~state & RENDER_CULLFACE)
-  {
-    glDisable(GL_CULL_FACE);
-    GlobalOpenGL_debugAssertNoErrors();
-  }
+  setState(state, delta, RENDER_CULLFACE, GL_CULL_FACE);
 
   if(delta & state & RENDER_SMOOTH)
   {
@@ -1959,29 +1917,9 @@ void OpenGLState_apply(const OpenGLState& self, OpenGLState& current, unsigned i
     GlobalOpenGL_debugAssertNoErrors();
   }
 
-  if(delta & state & RENDER_SCALED)
-  {
-    //qglEnable(GL_RESCALE_NORMAL);
-    glEnable(GL_NORMALIZE);
-    GlobalOpenGL_debugAssertNoErrors();
-  }
-  else if(delta & ~state & RENDER_SCALED)
-  {
-    //qglDisable(GL_RESCALE_NORMAL);
-    glDisable(GL_NORMALIZE);
-    GlobalOpenGL_debugAssertNoErrors();
-  }
+  setState(state, delta, RENDER_SCALED, GL_NORMALIZE); // not GL_RESCALE_NORMAL
 
-  if(delta & state & RENDER_DEPTHTEST)
-  {
-    glEnable(GL_DEPTH_TEST);
-    GlobalOpenGL_debugAssertNoErrors();
-  }
-  else if(delta & ~state & RENDER_DEPTHTEST)
-  {
-    glDisable(GL_DEPTH_TEST);
-    GlobalOpenGL_debugAssertNoErrors();
-  }
+  setState(state, delta, RENDER_DEPTHTEST, GL_DEPTH_TEST);
 
   if(delta & state & RENDER_DEPTHWRITE)
   {
@@ -2021,25 +1959,16 @@ void OpenGLState_apply(const OpenGLState& self, OpenGLState& current, unsigned i
     GlobalOpenGL_debugAssertNoErrors();
   }
 
-  if(delta & state & RENDER_ALPHATEST)
-  {
-    glEnable(GL_ALPHA_TEST);
-    GlobalOpenGL_debugAssertNoErrors();
-  }
-  else if(delta & ~state & RENDER_ALPHATEST)
-  {
-    glDisable(GL_ALPHA_TEST);
-    GlobalOpenGL_debugAssertNoErrors();
-  }
+  setState(state, delta, RENDER_ALPHATEST, GL_ALPHA_TEST);
   
-  if(delta & state & RENDER_COLOUR)
+  if(delta & state & RENDER_COLOURARRAY)
   {
     glEnableClientState(GL_COLOR_ARRAY);
     GlobalOpenGL_debugAssertNoErrors();
     debug_colour("enabling color_array");
     g_colorArray_enabled = true;
   }
-  else if(delta & ~state & RENDER_COLOUR)
+  else if(delta & ~state & RENDER_COLOURARRAY)
   {
     glDisableClientState(GL_COLOR_ARRAY);
     glColor4fv(vector4_to_array(self.m_colour));
@@ -2048,26 +1977,25 @@ void OpenGLState_apply(const OpenGLState& self, OpenGLState& current, unsigned i
     g_colorArray_enabled = false;
   }
 
-  if(delta & state & RENDER_LINESTIPPLE)
-  {
-    glEnable(GL_LINE_STIPPLE);
-    GlobalOpenGL_debugAssertNoErrors();
-  }
-  else if(delta & ~state & RENDER_LINESTIPPLE)
+  if(delta & ~state & RENDER_COLOURCHANGE)
   {
-    glDisable(GL_LINE_STIPPLE);
+    glColor4fv(vector4_to_array(self.m_colour));
     GlobalOpenGL_debugAssertNoErrors();
   }
 
-  if(delta & state & RENDER_POLYGONSTIPPLE)
-  {
-    glEnable(GL_POLYGON_STIPPLE);
-    GlobalOpenGL_debugAssertNoErrors();
-  }
-  else if(delta & ~state & RENDER_POLYGONSTIPPLE)
+  setState(state, delta, RENDER_LINESTIPPLE, GL_LINE_STIPPLE);
+  setState(state, delta, RENDER_LINESMOOTH, GL_LINE_SMOOTH);
+
+  setState(state, delta, RENDER_POLYGONSTIPPLE, GL_POLYGON_STIPPLE);
+  setState(state, delta, RENDER_POLYGONSMOOTH, GL_POLYGON_SMOOTH);
+
+  setState(state, delta, RENDER_FOG, GL_FOG);
+
+  if((state & RENDER_FOG) != 0)
   {
-    glDisable(GL_POLYGON_STIPPLE);
+    setFogState(self.m_fog);
     GlobalOpenGL_debugAssertNoErrors();
+    current.m_fog = self.m_fog;
   }
 
   if(state & RENDER_DEPTHTEST && self.m_depthfunc != current.m_depthfunc)
@@ -2293,6 +2221,51 @@ void OpenGLStateBucket::render(OpenGLState& current, unsigned int globalstate, c
   }
 }
 
+
+class OpenGLStateMap : public OpenGLStateLibrary
+{
+  typedef std::map<CopiedString, OpenGLState> States;
+  States m_states;
+public:
+  ~OpenGLStateMap()
+  {
+    ASSERT_MESSAGE(m_states.empty(), "OpenGLStateMap::~OpenGLStateMap: not empty");
+  }
+
+  typedef States::iterator iterator;
+  iterator begin()
+  {
+    return m_states.begin();
+  }
+  iterator end()
+  {
+    return m_states.end();
+  }
+
+  void getDefaultState(OpenGLState& state) const
+  {
+    OpenGLState_constructDefault(state);
+  }
+
+  void insert(const char* name, const OpenGLState& state)
+  {
+    bool inserted = m_states.insert(States::value_type(name, state)).second;
+    ASSERT_MESSAGE(inserted, "OpenGLStateMap::insert: " << name << " already exists");
+  }
+  void erase(const char* name)
+  {
+    std::size_t count = m_states.erase(name);
+    ASSERT_MESSAGE(count == 1, "OpenGLStateMap::erase: " << name << " does not exist");
+  }
+
+  iterator find(const char* name)
+  {
+    return m_states.find(name);
+  }
+};
+
+OpenGLStateMap* g_openglStates = 0;
+
 inline GLenum convertBlendFactor(BlendFactor factor)
 {
   switch(factor)
@@ -2354,33 +2327,41 @@ void OpenGLShader::construct(const char* name)
     break;
 
   case '$':
+    {
+      OpenGLStateMap::iterator i = g_openglStates->find(name);
+      if(i != g_openglStates->end())
+      {
+        state = (*i).second;
+        break;
+      }
+    }
     if(string_equal(name+1, "POINT"))
     {
-      state.m_state = RENDER_COLOUR|RENDER_COLOURWRITE|RENDER_DEPTHWRITE;
+      state.m_state = RENDER_COLOURARRAY|RENDER_COLOURWRITE|RENDER_DEPTHWRITE;
       state.m_sort = OpenGLState::eSortControlFirst;
       state.m_pointsize = 4;
     }
     else if(string_equal(name+1, "SELPOINT"))
     {
-      state.m_state = RENDER_COLOUR|RENDER_COLOURWRITE|RENDER_DEPTHWRITE;
+      state.m_state = RENDER_COLOURARRAY|RENDER_COLOURWRITE|RENDER_DEPTHWRITE;
       state.m_sort = OpenGLState::eSortControlFirst + 1;
       state.m_pointsize = 4;
     }
     else if(string_equal(name+1, "BIGPOINT"))
     {
-      state.m_state = RENDER_COLOUR|RENDER_COLOURWRITE|RENDER_DEPTHWRITE;
+      state.m_state = RENDER_COLOURARRAY|RENDER_COLOURWRITE|RENDER_DEPTHWRITE;
       state.m_sort = OpenGLState::eSortControlFirst;
       state.m_pointsize = 6;
     }
     else if(string_equal(name+1, "PIVOT"))
     {
-      state.m_state = RENDER_COLOUR|RENDER_COLOURWRITE|RENDER_DEPTHTEST|RENDER_DEPTHWRITE;
+      state.m_state = RENDER_COLOURARRAY|RENDER_COLOURWRITE|RENDER_DEPTHTEST|RENDER_DEPTHWRITE;
       state.m_sort = OpenGLState::eSortGUI1;
       state.m_linewidth = 2;
       state.m_depthfunc = GL_LEQUAL;
 
       OpenGLState& hiddenLine = appendDefaultPass();
-      hiddenLine.m_state = RENDER_COLOUR|RENDER_COLOURWRITE|RENDER_DEPTHTEST|RENDER_LINESTIPPLE;
+      hiddenLine.m_state = RENDER_COLOURARRAY|RENDER_COLOURWRITE|RENDER_DEPTHTEST|RENDER_LINESTIPPLE;
       hiddenLine.m_sort = OpenGLState::eSortGUI0;
       hiddenLine.m_linewidth = 2;
       hiddenLine.m_depthfunc = GL_GREATER;
@@ -2443,7 +2424,7 @@ void OpenGLShader::construct(const char* name)
     }
     else if(string_equal(name+1, "DEBUG_CLIPPED"))
     {
-      state.m_state = RENDER_COLOUR | RENDER_COLOURWRITE | RENDER_DEPTHWRITE;
+      state.m_state = RENDER_COLOURARRAY | RENDER_COLOURWRITE | RENDER_DEPTHWRITE;
       state.m_sort = OpenGLState::eSortLast;
     }
     else if(string_equal(name+1, "POINTFILE"))
@@ -2481,27 +2462,27 @@ void OpenGLShader::construct(const char* name)
     else if(string_equal(name+1, "WIRE_OVERLAY"))
     {
 #if 0
-      state.m_state = RENDER_COLOUR | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE;
+      state.m_state = RENDER_COLOURARRAY | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE;
       state.m_sort = OpenGLState::eSortOverlayFirst;
 #else
-      state.m_state = RENDER_COLOUR | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE;
+      state.m_state = RENDER_COLOURARRAY | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE;
       state.m_sort = OpenGLState::eSortGUI1;
       state.m_depthfunc = GL_LEQUAL;
 
       OpenGLState& hiddenLine = appendDefaultPass();
-      hiddenLine.m_state = RENDER_COLOUR | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE | RENDER_LINESTIPPLE;
+      hiddenLine.m_state = RENDER_COLOURARRAY | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE | RENDER_LINESTIPPLE;
       hiddenLine.m_sort = OpenGLState::eSortGUI0;
       hiddenLine.m_depthfunc = GL_GREATER;
 #endif
     }
     else if(string_equal(name+1, "FLATSHADE_OVERLAY"))
     {
-      state.m_state = RENDER_CULLFACE | RENDER_LIGHTING | RENDER_SMOOTH | RENDER_SCALED | RENDER_COLOUR | RENDER_FILL | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE;
+      state.m_state = RENDER_CULLFACE | RENDER_LIGHTING | RENDER_SMOOTH | RENDER_SCALED | RENDER_COLOURARRAY | RENDER_FILL | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE;
       state.m_sort = OpenGLState::eSortGUI1;
       state.m_depthfunc = GL_LEQUAL;
 
       OpenGLState& hiddenLine = appendDefaultPass();
-      hiddenLine.m_state = RENDER_CULLFACE | RENDER_LIGHTING | RENDER_SMOOTH | RENDER_SCALED | RENDER_COLOUR | RENDER_FILL | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE | RENDER_POLYGONSTIPPLE;
+      hiddenLine.m_state = RENDER_CULLFACE | RENDER_LIGHTING | RENDER_SMOOTH | RENDER_SCALED | RENDER_COLOURARRAY | RENDER_FILL | RENDER_COLOURWRITE | RENDER_DEPTHWRITE | RENDER_DEPTHTEST | RENDER_OVERRIDE | RENDER_POLYGONSTIPPLE;
       hiddenLine.m_sort = OpenGLState::eSortGUI0;
       hiddenLine.m_depthfunc = GL_GREATER;
     }
@@ -2683,3 +2664,29 @@ public:
 typedef SingletonModule<ShaderCacheAPI, ShaderCacheDependencies> ShaderCacheModule;
 typedef Static<ShaderCacheModule> StaticShaderCacheModule;
 StaticRegisterModule staticRegisterShaderCache(StaticShaderCacheModule::instance());
+
+
+class OpenGLStateLibraryAPI
+{
+  OpenGLStateMap m_stateMap;
+public:
+  typedef OpenGLStateLibrary Type;
+  STRING_CONSTANT(Name, "*");
+
+  OpenGLStateLibraryAPI()
+  {
+    g_openglStates = &m_stateMap;
+  }
+  ~OpenGLStateLibraryAPI()
+  {
+    g_openglStates = 0;
+  }
+  OpenGLStateLibrary* getTable()
+  {
+    return &m_stateMap;
+  }
+};
+
+typedef SingletonModule<OpenGLStateLibraryAPI> OpenGLStateLibraryModule;
+typedef Static<OpenGLStateLibraryModule> StaticOpenGLStateLibraryModule;
+StaticRegisterModule staticRegisterOpenGLStateLibrary(StaticOpenGLStateLibraryModule::instance());
index 50dbf87..3951cbb 100644 (file)
@@ -2222,7 +2222,7 @@ void XYWnd::XY_Draw()
 
   glLoadMatrixf(reinterpret_cast<const float*>(&m_modelview));
 
-  unsigned int globalstate = RENDER_COLOUR | RENDER_COLOURWRITE;
+  unsigned int globalstate = RENDER_COLOURARRAY | RENDER_COLOURWRITE | RENDER_POLYGONSMOOTH | RENDER_LINESMOOTH;
   if(!g_xywindow_globals.m_bNoStipple)
   {
     globalstate |= RENDER_LINESTIPPLE;