git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant.ab@188 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
TTimo 2007-11-04 03:59:18 +00:00
parent 2b5ef55c7c
commit beb511aadb
10 changed files with 168 additions and 1335 deletions

View file

@ -56,8 +56,14 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "model", "plugins\model\mode
EndProjectSection EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders", "plugins\shaders\shaders.vcproj", "{AEBCB950-AB67-48BB-9AF5-FCFB042824E8}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "shaders", "plugins\shaders\shaders.vcproj", "{AEBCB950-AB67-48BB-9AF5-FCFB042824E8}"
ProjectSection(ProjectDependencies) = postProject
{E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF}
EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "surface", "plugins\surface\surface.vcproj", "{6FDF6CFE-52FF-4E8C-A6F6-C0392DAE4DB7}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "surface", "plugins\surface\surface.vcproj", "{6FDF6CFE-52FF-4E8C-A6F6-C0392DAE4DB7}"
ProjectSection(ProjectDependencies) = postProject
{E13CCFB0-A366-4EF3-A66F-C374B563E4DF} = {E13CCFB0-A366-4EF3-A66F-C374B563E4DF}
EndProjectSection
EndProject EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vfspk3", "plugins\vfspk3\vfspk3.vcproj", "{DEFCF433-3A47-40EB-BBF7-861211C3A941}" Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vfspk3", "plugins\vfspk3\vfspk3.vcproj", "{DEFCF433-3A47-40EB-BBF7-861211C3A941}"
ProjectSection(ProjectDependencies) = postProject ProjectSection(ProjectDependencies) = postProject

File diff suppressed because it is too large Load diff

View file

@ -290,37 +290,43 @@ void CDbgDlg::SetHighlight(gint row)
} }
} }
ISAXHandler *CDbgDlg::GetElement (gint row) ISAXHandler *CDbgDlg::GetElement( gint row ) {
{
return static_cast<ISAXHandler *>( g_ptr_array_index( m_pFeedbackElements, row ) ); return static_cast<ISAXHandler *>( g_ptr_array_index( m_pFeedbackElements, row ) );
} }
void CDbgDlg::Init () void CDbgDlg::ClearFeedbackArray() {
{
DropHighlight();
// free all the ISAXHandler*, clean it // free all the ISAXHandler*, clean it
while (m_pFeedbackElements->len) while ( m_pFeedbackElements->len ) {
{ // some ISAXHandler are static and passed around but should never be deleted
delete static_cast<ISAXHandler *>(g_ptr_array_index (m_pFeedbackElements, 0)); ISAXHandler *handler = static_cast< ISAXHandler * >( g_ptr_array_index( m_pFeedbackElements, 0 ) );
if ( handler->ShouldDelete() ) {
delete handler;
}
g_ptr_array_remove_index( m_pFeedbackElements, 0 ); g_ptr_array_remove_index( m_pFeedbackElements, 0 );
} }
if (m_clist != NULL)
gtk_list_store_clear (m_clist);
} }
void CDbgDlg::Push (ISAXHandler *pHandler) void CDbgDlg::Init() {
{ DropHighlight();
ClearFeedbackArray();
if ( m_clist != NULL ) {
gtk_list_store_clear( m_clist );
}
}
void CDbgDlg::Push( ISAXHandler *pHandler ) {
// push in the list // push in the list
g_ptr_array_add( m_pFeedbackElements, (void *)pHandler ); g_ptr_array_add( m_pFeedbackElements, (void *)pHandler );
if (m_pWidget == NULL) if ( m_pWidget == NULL ) {
Create(); Create();
}
// put stuff in the list // put stuff in the list
gtk_list_store_clear( m_clist ); gtk_list_store_clear( m_clist );
for(unsigned int i = 0; i < m_pFeedbackElements->len; ++i) unsigned int i;
{ for ( i = 0; i < m_pFeedbackElements->len; i++ ) {
GtkTreeIter iter; GtkTreeIter iter;
gtk_list_store_append( m_clist, &iter ); gtk_list_store_append( m_clist, &iter );
gtk_list_store_set( m_clist, &iter, 0, GetElement(i)->getName(), -1 ); gtk_list_store_set( m_clist, &iter, 0, GetElement(i)->getName(), -1 );

View file

@ -107,7 +107,7 @@ class CDbgDlg : public Dialog
ISAXHandler *m_pHighlight; ISAXHandler *m_pHighlight;
public: public:
CDbgDlg() { m_pFeedbackElements = g_ptr_array_new(); m_pHighlight = NULL; } CDbgDlg() { m_pFeedbackElements = g_ptr_array_new(); m_pHighlight = NULL; }
virtual ~CDbgDlg() { } virtual ~CDbgDlg() { ClearFeedbackArray(); }
// refresh items // refresh items
void Push( ISAXHandler * ); void Push( ISAXHandler * );
// clean the debug window, release all ISAXHanlders we have // clean the debug window, release all ISAXHanlders we have
@ -115,9 +115,9 @@ public:
ISAXHandler *GetElement(gint row); ISAXHandler *GetElement(gint row);
void SetHighlight(gint row); void SetHighlight(gint row);
void DropHighlight(); void DropHighlight();
// void HideDlg();
protected: protected:
void BuildDialog(); void BuildDialog();
void ClearFeedbackArray();
}; };
extern CDbgDlg g_DbgDlg; extern CDbgDlg g_DbgDlg;

View file

@ -48,6 +48,9 @@ public:
void saxEndElement( message_info_t *ctx, const xmlChar *name ); void saxEndElement( message_info_t *ctx, const xmlChar *name );
void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len ); void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len );
char *getName(); char *getName();
// class is only used for g_pointfile and we should not attempt to free it
bool ShouldDelete() { return false; }
}; };
// instead of using Pointfile_Load you can do it by hand through g_pointfile // instead of using Pointfile_Load you can do it by hand through g_pointfile

View file

@ -145,33 +145,29 @@ static void saxStartElement(message_info_t *data, const xmlChar *name, const xml
data->recurse++; data->recurse++;
} }
static void saxEndElement(message_info_t *data, const xmlChar *name) static void saxEndElement(message_info_t *data, const xmlChar *name) {
{
data->recurse--; data->recurse--;
// we are out of an ignored chunk // we are out of an ignored chunk
if (data->recurse == data->ignore_depth) if ( data->recurse == data->ignore_depth ) {
{
data->ignore_depth = 0; data->ignore_depth = 0;
return; return;
} }
if (data->bGeometry) if ( data->bGeometry ) {
{
data->pGeometry->saxEndElement( data, name ); data->pGeometry->saxEndElement( data, name );
// we add the object to the debug window // we add the object to the debug window
if (!data->bGeometry) if ( !data->bGeometry ) {
{
g_DbgDlg.Push( data->pGeometry ); g_DbgDlg.Push( data->pGeometry );
} }
} }
if (data->recurse == data->stop_depth) if ( data->recurse == data->stop_depth ) {
{
#ifdef _DEBUG #ifdef _DEBUG
Sys_Printf ("Received error msg .. shutting down..\n"); Sys_Printf ("Received error msg .. shutting down..\n");
#endif #endif
g_pParentWnd->GetWatchBSP()->Reset(); g_pParentWnd->GetWatchBSP()->Reset();
// tell there has been an error // tell there has been an error
if (g_pParentWnd->GetWatchBSP()->HasBSPPlugin ()) if ( g_pParentWnd->GetWatchBSP()->HasBSPPlugin() ) {
g_BSPFrontendTable.m_pfnEndListen( 2 ); g_BSPFrontendTable.m_pfnEndListen( 2 );
}
return; return;
} }
} }
@ -317,11 +313,9 @@ bool CWatchBSP::SetupListening()
return true; return true;
} }
void CWatchBSP::DoEBeginStep() void CWatchBSP::DoEBeginStep() {
{
Reset(); Reset();
if (SetupListening() == false) if ( !SetupListening() ) {
{
CString msg; CString msg;
msg = "Failed to get a listening socket on port 39000.\nTry running with BSP monitoring disabled if you can't fix this.\n"; msg = "Failed to get a listening socket on port 39000.\nTry running with BSP monitoring disabled if you can't fix this.\n";
Sys_Printf( msg ); Sys_Printf( msg );
@ -332,12 +326,10 @@ void CWatchBSP::DoEBeginStep()
g_timer_reset( m_pTimer ); g_timer_reset( m_pTimer );
g_timer_start( m_pTimer ); g_timer_start( m_pTimer );
if (!m_bBSPPlugin) if ( !m_bBSPPlugin ) {
{
Sys_Printf( "=== running BSP command ===\n%s\n", g_ptr_array_index( m_pCmd, m_iCurrentStep ) ); Sys_Printf( "=== running BSP command ===\n%s\n", g_ptr_array_index( m_pCmd, m_iCurrentStep ) );
if (!Q_Exec(NULL, (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep ), NULL, true )) if ( !Q_Exec( NULL, (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep ), NULL, true ) ) {
{
CString msg; CString msg;
msg = "Failed to execute the following command: "; msg = "Failed to execute the following command: ";
msg += (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep ); msg += (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep );
@ -347,9 +339,10 @@ void CWatchBSP::DoEBeginStep()
return; return;
} }
// re-initialise the debug window // re-initialise the debug window
if (m_iCurrentStep == 0) if ( m_iCurrentStep == 0 ) {
g_DbgDlg.Init(); g_DbgDlg.Init();
} }
}
m_eState = EBeginStep; m_eState = EBeginStep;
} }

View file

@ -50,6 +50,7 @@ public:
virtual char *getName() { return NULL; } virtual char *getName() { return NULL; }
virtual void Highlight() { } virtual void Highlight() { }
virtual void DropHighlight() { } virtual void DropHighlight() { }
virtual bool ShouldDelete() { return true; } // should the handler be deleted when the feedback dialog is cleared?
}; };
// a 'user data' structure we pass along in the SAX callbacks to represent the current state // a 'user data' structure we pass along in the SAX callbacks to represent the current state

View file

@ -381,8 +381,7 @@ mesh_t *SubdivideMesh( mesh_t in, float maxError, float minLength )
float len; float len;
mesh_t out; mesh_t out;
/* ydnar: static for os x */ static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS];
MAC_STATIC bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS];
out.width = in.width; out.width = in.width;
@ -548,8 +547,7 @@ mesh_t *SubdivideMesh2( mesh_t in, int iterations )
bspDrawVert_t prev, next, mid; bspDrawVert_t prev, next, mid;
mesh_t out; mesh_t out;
/* ydnar: static for os x */ static bspDrawVert_t expand[ MAX_EXPANDED_AXIS ][ MAX_EXPANDED_AXIS ];
MAC_STATIC bspDrawVert_t expand[ MAX_EXPANDED_AXIS ][ MAX_EXPANDED_AXIS ];
/* initial setup */ /* initial setup */
@ -654,8 +652,7 @@ mesh_t *RemoveLinearMeshColumnsRows( mesh_t *in ) {
vec3_t proj, dir; vec3_t proj, dir;
mesh_t out; mesh_t out;
/* ydnar: static for os x */ static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS];
MAC_STATIC bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS];
out.width = in->width; out.width = in->width;
@ -731,7 +728,8 @@ mesh_t *SubdivideMeshQuads( mesh_t *in, float minLength, int maxsize, int *width
vec3_t dir; vec3_t dir;
float length, maxLength, amount; float length, maxLength, amount;
mesh_t out; mesh_t out;
bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS];
static bspDrawVert_t expand[MAX_EXPANDED_AXIS][MAX_EXPANDED_AXIS];
out.width = in->width; out.width = in->width;
out.height = in->height; out.height = in->height;