Changeset 188
- Timestamp:
- 11/03/07 22:59:18 (8 months ago)
- Files:
-
- GtkRadiant/branches/ZeroRadiant.ab/radiant.sln (modified) (1 diff)
- GtkRadiant/branches/ZeroRadiant.ab/radiant.sln.ref (deleted)
- GtkRadiant/branches/ZeroRadiant.ab/radiant/feedback.cpp (modified) (1 diff)
- GtkRadiant/branches/ZeroRadiant.ab/radiant/feedback.h (modified) (1 diff)
- GtkRadiant/branches/ZeroRadiant.ab/radiant/points.h (modified) (1 diff)
- GtkRadiant/branches/ZeroRadiant.ab/radiant/watchbsp.cpp (modified) (6 diffs)
- GtkRadiant/branches/ZeroRadiant.ab/radiant/xmlstuff.h (modified) (2 diffs)
- GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/mesh.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
GtkRadiant/branches/ZeroRadiant.ab/radiant.sln
r177 r188 57 57 EndProject 58 58 Project("{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 59 62 EndProject 60 63 Project("{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 61 67 EndProject 62 68 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vfspk3", "plugins\vfspk3\vfspk3.vcproj", "{DEFCF433-3A47-40EB-BBF7-861211C3A941}" GtkRadiant/branches/ZeroRadiant.ab/radiant/feedback.cpp
r186 r188 291 291 } 292 292 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(); 293 ISAXHandler *CDbgDlg::GetElement( gint row ) { 294 return static_cast<ISAXHandler *>( g_ptr_array_index( m_pFeedbackElements, row ) ); 295 } 296 297 void 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 309 void CDbgDlg::Init() { 310 DropHighlight(); 311 312 ClearFeedbackArray(); 313 314 if ( m_clist != NULL ) { 315 gtk_list_store_clear( m_clist ); 316 } 317 } 318 319 void 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(); 330 336 } 331 337 GtkRadiant/branches/ZeroRadiant.ab/radiant/feedback.h
r184 r188 107 107 ISAXHandler *m_pHighlight; 108 108 public: 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(); } 111 111 // refresh items 112 void Push (ISAXHandler *);112 void Push( ISAXHandler * ); 113 113 // 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(); 119 118 protected: 120 void BuildDialog (); 119 void BuildDialog(); 120 void ClearFeedbackArray(); 121 121 }; 122 122 GtkRadiant/branches/ZeroRadiant.ab/radiant/points.h
r184 r188 40 40 { 41 41 public: 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; } 51 54 }; 52 55 GtkRadiant/branches/ZeroRadiant.ab/radiant/watchbsp.cpp
r186 r188 111 111 data->bGeometry = true; 112 112 data->pGeometry = &g_pointfile; 113 data->pGeometry->saxStartElement (data, name, attrs);113 data->pGeometry->saxStartElement( data, name, attrs ); 114 114 } 115 115 else if (strcmp ((char *)name, "select") == 0) … … 118 118 data->bGeometry = true; 119 119 data->pGeometry = pSelect; 120 data->pGeometry->saxStartElement (data, name, attrs);120 data->pGeometry->saxStartElement( data, name, attrs ); 121 121 } 122 122 else if (strcmp ((char *)name, "pointmsg") == 0) … … 125 125 data->bGeometry = true; 126 126 data->pGeometry = pPoint; 127 data->pGeometry->saxStartElement (data, name, attrs);127 data->pGeometry->saxStartElement( data, name, attrs ); 128 128 } 129 129 else if (strcmp ((char *)name, "windingmsg") == 0) … … 132 132 data->bGeometry = true; 133 133 data->pGeometry = pWinding; 134 data->pGeometry->saxStartElement (data, name, attrs);134 data->pGeometry->saxStartElement( data, name, attrs ); 135 135 } 136 136 else … … 146 146 } 147 147 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 { 148 static 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 ) { 168 163 #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 } 177 173 } 178 174 … … 318 314 } 319 315 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; 316 void 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; 354 347 } 355 348 GtkRadiant/branches/ZeroRadiant.ab/radiant/xmlstuff.h
r184 r188 45 45 { 46 46 public: 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; 50 50 virtual char *getName() { return NULL; } 51 51 virtual void Highlight() { } 52 52 virtual void DropHighlight() { } 53 virtual bool ShouldDelete() { return true; } // should the handler be deleted when the feedback dialog is cleared? 53 54 }; 54 55 … … 60 61 // unkown nodes are ignored, we use ignore_depth to track the level we start ignoring from 61 62 typedef 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 end66 bool bGeometry;// are we parsing some geometry information (i.e. do we forward the SAX calls?)67 ISAXHandler *pGeometry;// the handler63 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 68 69 } message_info_t; 69 70 GtkRadiant/branches/ZeroRadiant.ab/tools/quake3/q3map2/mesh.c
r184 r188 382 382 mesh_t out; 383 383 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]; 386 385 387 386 … … 549 548 mesh_t out; 550 549 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 ]; 553 551 554 552 … … 655 653 mesh_t out; 656 654 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]; 659 656 660 657 … … 732 729 float length, maxLength, amount; 733 730 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]; 735 733 736 734 out.width = in->width;
