Changeset 188

Show
Ignore:
Timestamp:
11/03/07 22:59:18 (8 months ago)
Author:
timo
Message:

from nxn

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • GtkRadiant/branches/ZeroRadiant.ab/radiant.sln

    r177 r188  
    5757EndProject 
    5858Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders", "plugins\shaders\shaders.vcproj", "{AEBCB950-AB67-48BB-9AF5-FCFB042824E8}" 
     59        ProjectSection(ProjectDependencies) = postProject 
     60                {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} 
     61        EndProjectSection 
    5962EndProject 
    6063Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "surface", "plugins\surface\surface.vcproj", "{6FDF6CFE-52FF-4E8C-A6F6-C0392DAE4DB7}" 
     64        ProjectSection(ProjectDependencies) = postProject 
     65                {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF} 
     66        EndProjectSection 
    6167EndProject 
    6268Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vfspk3", "plugins\vfspk3\vfspk3.vcproj", "{DEFCF433-3A47-40EB-BBF7-861211C3A941}" 
  • GtkRadiant/branches/ZeroRadiant.ab/radiant/feedback.cpp

    r186 r188  
    291291} 
    292292 
    293 ISAXHandler *CDbgDlg::GetElement (gint row) 
    294 
    295   return static_cast<ISAXHandler *>(g_ptr_array_index(m_pFeedbackElements, row)); 
    296 
    297  
    298 void CDbgDlg::Init () 
    299 
    300   DropHighlight(); 
    301  
    302   // free all the ISAXHandler*, clean it 
    303   while (m_pFeedbackElements->len) 
    304   { 
    305     delete static_cast<ISAXHandler *>(g_ptr_array_index (m_pFeedbackElements, 0)); 
    306     g_ptr_array_remove_index (m_pFeedbackElements, 0); 
    307   } 
    308  
    309   if (m_clist != NULL) 
    310     gtk_list_store_clear (m_clist); 
    311 
    312  
    313 void CDbgDlg::Push (ISAXHandler *pHandler) 
    314 
    315   // push in the list 
    316   g_ptr_array_add (m_pFeedbackElements, (void *)pHandler); 
    317  
    318   if (m_pWidget == NULL) 
    319     Create(); 
    320   // put stuff in the list 
    321   gtk_list_store_clear (m_clist); 
    322   for(unsigned int i = 0; i < m_pFeedbackElements->len; ++i) 
    323   { 
    324     GtkTreeIter iter; 
    325     gtk_list_store_append(m_clist, &iter); 
    326     gtk_list_store_set(m_clist, &iter, 0, GetElement(i)->getName(), -1); 
    327   } 
    328  
    329   ShowDlg(); 
     293ISAXHandler *CDbgDlg::GetElement( gint row ) { 
     294        return static_cast<ISAXHandler *>( g_ptr_array_index( m_pFeedbackElements, row ) ); 
     295
     296 
     297void CDbgDlg::ClearFeedbackArray() { 
     298        // free all the ISAXHandler*, clean it 
     299        while ( m_pFeedbackElements->len ) { 
     300                // some ISAXHandler are static and passed around but should never be deleted 
     301                ISAXHandler *handler = static_cast< ISAXHandler * >( g_ptr_array_index( m_pFeedbackElements, 0 ) ); 
     302                if ( handler->ShouldDelete() ) { 
     303                        delete handler; 
     304                } 
     305                g_ptr_array_remove_index( m_pFeedbackElements, 0 ); 
     306        } 
     307
     308 
     309void CDbgDlg::Init() { 
     310        DropHighlight(); 
     311 
     312        ClearFeedbackArray(); 
     313 
     314        if ( m_clist != NULL ) { 
     315                gtk_list_store_clear( m_clist ); 
     316        } 
     317
     318 
     319void CDbgDlg::Push( ISAXHandler *pHandler ) { 
     320        // push in the list 
     321        g_ptr_array_add( m_pFeedbackElements, (void *)pHandler ); 
     322 
     323        if ( m_pWidget == NULL ) { 
     324                Create(); 
     325        } 
     326        // put stuff in the list 
     327        gtk_list_store_clear( m_clist ); 
     328        unsigned int i; 
     329        for ( i = 0; i < m_pFeedbackElements->len; i++ ) { 
     330                GtkTreeIter iter; 
     331                gtk_list_store_append( m_clist, &iter ); 
     332                gtk_list_store_set( m_clist, &iter, 0, GetElement(i)->getName(), -1 ); 
     333        } 
     334 
     335        ShowDlg(); 
    330336} 
    331337 
  • GtkRadiant/branches/ZeroRadiant.ab/radiant/feedback.h

    r184 r188  
    107107  ISAXHandler *m_pHighlight; 
    108108public: 
    109   CDbgDlg() { m_pFeedbackElements = g_ptr_array_new (); m_pHighlight = NULL; } 
    110   virtual ~CDbgDlg() {
     109  CDbgDlg() { m_pFeedbackElements = g_ptr_array_new(); m_pHighlight = NULL; } 
     110  virtual              ~CDbgDlg() { ClearFeedbackArray();
    111111  // refresh items 
    112   void Push (ISAXHandler *); 
     112  void                 Push( ISAXHandler * ); 
    113113  // clean the debug window, release all ISAXHanlders we have 
    114   void Init(); 
    115   ISAXHandler *GetElement(gint row); 
    116   void SetHighlight(gint row); 
    117   void DropHighlight(); 
    118 //  void HideDlg(); 
     114  void                  Init(); 
     115  ISAXHandler   *GetElement(gint row); 
     116  void                  SetHighlight(gint row); 
     117  void                  DropHighlight(); 
    119118protected: 
    120   void BuildDialog (); 
     119  void                  BuildDialog(); 
     120  void                  ClearFeedbackArray(); 
    121121}; 
    122122 
  • GtkRadiant/branches/ZeroRadiant.ab/radiant/points.h

    r184 r188  
    4040{ 
    4141public: 
    42   CPointfile() { } 
    43   void Init(); 
    44   void PushPoint (vec3_t v); 
    45   void GenerateDisplayList(); 
    46   // SAX interface 
    47   void saxStartElement (message_info_t *ctx, const xmlChar *name, const xmlChar **attrs); 
    48   void saxEndElement (message_info_t *ctx, const xmlChar *name); 
    49   void saxCharacters (message_info_t *ctx, const xmlChar *ch, int len); 
    50   char *getName(); 
     42        CPointfile() { } 
     43        void Init(); 
     44        void PushPoint( vec3_t v ); 
     45        void GenerateDisplayList(); 
     46        // SAX interface 
     47        void saxStartElement( message_info_t *ctx, const xmlChar *name, const xmlChar **attrs ); 
     48        void saxEndElement( message_info_t *ctx, const xmlChar *name ); 
     49        void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len ); 
     50        char *getName(); 
     51 
     52        // class is only used for g_pointfile and we should not attempt to free it 
     53        bool ShouldDelete() { return false; } 
    5154}; 
    5255 
  • GtkRadiant/branches/ZeroRadiant.ab/radiant/watchbsp.cpp

    r186 r188  
    111111        data->bGeometry = true; 
    112112        data->pGeometry = &g_pointfile; 
    113         data->pGeometry->saxStartElement (data, name, attrs);   
     113        data->pGeometry->saxStartElement( data, name, attrs ); 
    114114      } 
    115115      else if (strcmp ((char *)name, "select") == 0) 
     
    118118        data->bGeometry = true; 
    119119        data->pGeometry = pSelect; 
    120         data->pGeometry->saxStartElement (data, name, attrs); 
     120        data->pGeometry->saxStartElement( data, name, attrs ); 
    121121      } 
    122122      else if (strcmp ((char *)name, "pointmsg") == 0) 
     
    125125        data->bGeometry = true; 
    126126        data->pGeometry = pPoint; 
    127         data->pGeometry->saxStartElement (data, name, attrs); 
     127        data->pGeometry->saxStartElement( data, name, attrs ); 
    128128      } 
    129129      else if (strcmp ((char *)name, "windingmsg") == 0) 
     
    132132        data->bGeometry = true; 
    133133        data->pGeometry = pWinding; 
    134         data->pGeometry->saxStartElement (data, name, attrs); 
     134        data->pGeometry->saxStartElement( data, name, attrs ); 
    135135      } 
    136136      else 
     
    146146} 
    147147 
    148 static void saxEndElement(message_info_t *data, const xmlChar *name)  
    149 
    150   data->recurse--; 
    151   // we are out of an ignored chunk 
    152   if (data->recurse == data->ignore_depth) 
    153   { 
    154     data->ignore_depth = 0; 
    155     return; 
    156   } 
    157   if (data->bGeometry) 
    158   { 
    159     data->pGeometry->saxEndElement (data, name); 
    160     // we add the object to the debug window 
    161     if (!data->bGeometry) 
    162     { 
    163       g_DbgDlg.Push (data->pGeometry); 
    164     } 
    165   } 
    166   if (data->recurse == data->stop_depth) 
    167   { 
     148static void saxEndElement(message_info_t *data, const xmlChar *name)  { 
     149        data->recurse--; 
     150        // we are out of an ignored chunk 
     151        if ( data->recurse == data->ignore_depth ) { 
     152                data->ignore_depth = 0; 
     153                return; 
     154        } 
     155        if ( data->bGeometry ) { 
     156                data->pGeometry->saxEndElement( data, name ); 
     157                // we add the object to the debug window 
     158                if ( !data->bGeometry ) { 
     159                        g_DbgDlg.Push( data->pGeometry ); 
     160                } 
     161        } 
     162        if ( data->recurse == data->stop_depth ) { 
    168163#ifdef _DEBUG 
    169     Sys_Printf ("Received error msg .. shutting down..\n"); 
    170 #endif 
    171     g_pParentWnd->GetWatchBSP()->Reset(); 
    172     // tell there has been an error 
    173     if (g_pParentWnd->GetWatchBSP()->HasBSPPlugin ()) 
    174       g_BSPFrontendTable.m_pfnEndListen(2); 
    175     return; 
    176   } 
     164                Sys_Printf ("Received error msg .. shutting down..\n"); 
     165#endif 
     166                g_pParentWnd->GetWatchBSP()->Reset(); 
     167                // tell there has been an error 
     168                if ( g_pParentWnd->GetWatchBSP()->HasBSPPlugin() ) { 
     169                        g_BSPFrontendTable.m_pfnEndListen( 2 ); 
     170                } 
     171                return; 
     172        } 
    177173} 
    178174 
     
    318314} 
    319315 
    320 void CWatchBSP::DoEBeginStep() 
    321 
    322   Reset(); 
    323   if (SetupListening() == false) 
    324   { 
    325     CString msg; 
    326     msg = "Failed to get a listening socket on port 39000.\nTry running with BSP monitoring disabled if you can't fix this.\n"; 
    327     Sys_Printf (msg); 
    328     gtk_MessageBox (g_pParentWnd->m_pWidget, msg, "BSP monitoring", MB_OK | MB_ICONERROR); 
    329     return; 
    330   } 
    331   // set the timer for timeouts and step cancellation 
    332   g_timer_reset( m_pTimer ); 
    333   g_timer_start( m_pTimer ); 
    334  
    335   if (!m_bBSPPlugin) 
    336   { 
    337     Sys_Printf("=== running BSP command ===\n%s\n", g_ptr_array_index( m_pCmd, m_iCurrentStep ) ); 
    338      
    339     if (!Q_Exec(NULL, (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep ), NULL, true )) 
    340     { 
    341       CString msg; 
    342       msg = "Failed to execute the following command: "; 
    343       msg += (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep ); 
    344       msg += "\nCheck that the file exists and that you don't run out of system resources.\n"; 
    345       Sys_Printf(msg); 
    346       gtk_MessageBox(g_pParentWnd->m_pWidget,  msg, "BSP monitoring", MB_OK | MB_ICONERROR ); 
    347       return; 
    348     } 
    349     // re-initialise the debug window 
    350     if (m_iCurrentStep == 0) 
    351       g_DbgDlg.Init(); 
    352   } 
    353   m_eState = EBeginStep; 
     316void CWatchBSP::DoEBeginStep() { 
     317        Reset(); 
     318        if ( !SetupListening() ) { 
     319                CString msg; 
     320                msg = "Failed to get a listening socket on port 39000.\nTry running with BSP monitoring disabled if you can't fix this.\n"; 
     321                Sys_Printf( msg ); 
     322                gtk_MessageBox( g_pParentWnd->m_pWidget, msg, "BSP monitoring", MB_OK | MB_ICONERROR ); 
     323                return; 
     324        } 
     325        // set the timer for timeouts and step cancellation 
     326        g_timer_reset( m_pTimer ); 
     327        g_timer_start( m_pTimer ); 
     328 
     329        if ( !m_bBSPPlugin ) { 
     330                Sys_Printf( "=== running BSP command ===\n%s\n", g_ptr_array_index( m_pCmd, m_iCurrentStep ) ); 
     331 
     332                if ( !Q_Exec( NULL, (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep ), NULL, true ) ) { 
     333                        CString msg; 
     334                        msg = "Failed to execute the following command: "; 
     335                        msg += (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep ); 
     336                        msg += "\nCheck that the file exists and that you don't run out of system resources.\n"; 
     337                        Sys_Printf( msg ); 
     338                        gtk_MessageBox( g_pParentWnd->m_pWidget,  msg, "BSP monitoring", MB_OK | MB_ICONERROR ); 
     339                        return; 
     340                } 
     341                // re-initialise the debug window 
     342                if ( m_iCurrentStep == 0 ) { 
     343                        g_DbgDlg.Init(); 
     344                } 
     345        } 
     346        m_eState = EBeginStep; 
    354347} 
    355348 
  • GtkRadiant/branches/ZeroRadiant.ab/radiant/xmlstuff.h

    r184 r188  
    4545{ 
    4646public: 
    47   virtual void saxStartElement (struct message_info_s *ctx, const xmlChar *name, const xmlChar **attrs) = 0; 
    48   virtual void saxEndElement (struct message_info_s *ctx, const xmlChar *name) = 0; 
    49   virtual void saxCharacters (struct message_info_s *ctx, const xmlChar *ch, int len) = 0; 
     47  virtual void saxStartElement( struct message_info_s *ctx, const xmlChar *name, const xmlChar **attrs ) = 0; 
     48  virtual void saxEndElement( struct message_info_s *ctx, const xmlChar *name ) = 0; 
     49  virtual void saxCharacters( struct message_info_s *ctx, const xmlChar *ch, int len ) = 0; 
    5050  virtual char *getName() { return NULL; } 
    5151  virtual void Highlight() { } 
    5252  virtual void DropHighlight() { } 
     53  virtual bool ShouldDelete() { return true; } // should the handler be deleted when the feedback dialog is cleared? 
    5354}; 
    5455 
     
    6061// unkown nodes are ignored, we use ignore_depth to track the level we start ignoring from 
    6162typedef struct message_info_s { 
    62   int msg_level; // current message level (SYS_MSG, SYS_WRN, SYS_ERR) 
    63   int recurse; // current recursion depth (used to track various things) 
    64   int ignore_depth; // the ignore depth limit when we are jumping over unknown nodes (0 means we are not ignoring) 
    65   int stop_depth; // the depth we need to stop at the end 
    66   bool bGeometry; // are we parsing some geometry information (i.e. do we forward the SAX calls?) 
    67   ISAXHandler *pGeometry; // the handler 
     63  int                          msg_level;              // current message level (SYS_MSG, SYS_WRN, SYS_ERR) 
     64  int                          recurse;                // current recursion depth (used to track various things) 
     65  int                          ignore_depth;   // the ignore depth limit when we are jumping over unknown nodes (0 means we are not ignoring) 
     66  int                          stop_depth;             // the depth we need to stop at the end 
     67  bool                         bGeometry;              // are we parsing some geometry information (i.e. do we forward the SAX calls?) 
     68  ISAXHandler          *pGeometry;             // the handler 
    6869} message_info_t; 
    6970 
  • GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/mesh.c

    r184 r188  
    382382        mesh_t                                          out; 
    383383         
    384         /* ydnar: static for os x */ 
    385         MAC_STATIC bspDrawVert_t        expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; 
     384        static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; 
    386385         
    387386         
     
    549548        mesh_t                                          out; 
    550549         
    551         /* ydnar: static for os x */ 
    552         MAC_STATIC bspDrawVert_t        expand[ MAX_EXPANDED_AXIS ][ MAX_EXPANDED_AXIS ]; 
     550        static bspDrawVert_t expand[ MAX_EXPANDED_AXIS ][ MAX_EXPANDED_AXIS ]; 
    553551         
    554552         
     
    655653        mesh_t                                          out; 
    656654         
    657         /* ydnar: static for os x */ 
    658         MAC_STATIC bspDrawVert_t        expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; 
     655        static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; 
    659656         
    660657 
     
    732729        float                   length, maxLength, amount; 
    733730        mesh_t                  out; 
    734         bspDrawVert_t   expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; 
     731 
     732        static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS]; 
    735733 
    736734        out.width = in->width;