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
EndProject
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
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
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vfspk3", "plugins\vfspk3\vfspk3.vcproj", "{DEFCF433-3A47-40EB-BBF7-861211C3A941}"
ProjectSection(ProjectDependencies) = postProject

File diff suppressed because it is too large Load diff

View file

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

View file

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

View file

@ -39,15 +39,18 @@ void Pointfile_Load( void );
class CPointfile : public ISAXHandler
{
public:
CPointfile() { }
void Init();
void PushPoint (vec3_t v);
void GenerateDisplayList();
// SAX interface
void saxStartElement (message_info_t *ctx, const xmlChar *name, const xmlChar **attrs);
void saxEndElement (message_info_t *ctx, const xmlChar *name);
void saxCharacters (message_info_t *ctx, const xmlChar *ch, int len);
char *getName();
CPointfile() { }
void Init();
void PushPoint( vec3_t v );
void GenerateDisplayList();
// SAX interface
void saxStartElement( message_info_t *ctx, const xmlChar *name, const xmlChar **attrs );
void saxEndElement( message_info_t *ctx, const xmlChar *name );
void saxCharacters( message_info_t *ctx, const xmlChar *ch, int len );
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

View file

@ -110,28 +110,28 @@ static void saxStartElement(message_info_t *data, const xmlChar *name, const xml
{
data->bGeometry = true;
data->pGeometry = &g_pointfile;
data->pGeometry->saxStartElement (data, name, attrs);
data->pGeometry->saxStartElement( data, name, attrs );
}
else if (strcmp ((char *)name, "select") == 0)
{
CSelectMsg *pSelect = new CSelectMsg();
data->bGeometry = true;
data->pGeometry = pSelect;
data->pGeometry->saxStartElement (data, name, attrs);
data->pGeometry->saxStartElement( data, name, attrs );
}
else if (strcmp ((char *)name, "pointmsg") == 0)
{
CPointMsg *pPoint = new CPointMsg();
data->bGeometry = true;
data->pGeometry = pPoint;
data->pGeometry->saxStartElement (data, name, attrs);
data->pGeometry->saxStartElement( data, name, attrs );
}
else if (strcmp ((char *)name, "windingmsg") == 0)
{
CWindingMsg *pWinding = new CWindingMsg();
data->bGeometry = true;
data->pGeometry = pWinding;
data->pGeometry->saxStartElement (data, name, attrs);
data->pGeometry->saxStartElement( data, name, attrs );
}
else
{
@ -145,35 +145,31 @@ static void saxStartElement(message_info_t *data, const xmlChar *name, const xml
data->recurse++;
}
static void saxEndElement(message_info_t *data, const xmlChar *name)
{
data->recurse--;
// we are out of an ignored chunk
if (data->recurse == data->ignore_depth)
{
data->ignore_depth = 0;
return;
}
if (data->bGeometry)
{
data->pGeometry->saxEndElement (data, name);
// we add the object to the debug window
if (!data->bGeometry)
{
g_DbgDlg.Push (data->pGeometry);
}
}
if (data->recurse == data->stop_depth)
{
static void saxEndElement(message_info_t *data, const xmlChar *name) {
data->recurse--;
// we are out of an ignored chunk
if ( data->recurse == data->ignore_depth ) {
data->ignore_depth = 0;
return;
}
if ( data->bGeometry ) {
data->pGeometry->saxEndElement( data, name );
// we add the object to the debug window
if ( !data->bGeometry ) {
g_DbgDlg.Push( data->pGeometry );
}
}
if ( data->recurse == data->stop_depth ) {
#ifdef _DEBUG
Sys_Printf ("Received error msg .. shutting down..\n");
Sys_Printf ("Received error msg .. shutting down..\n");
#endif
g_pParentWnd->GetWatchBSP()->Reset();
// tell there has been an error
if (g_pParentWnd->GetWatchBSP()->HasBSPPlugin ())
g_BSPFrontendTable.m_pfnEndListen(2);
return;
}
g_pParentWnd->GetWatchBSP()->Reset();
// tell there has been an error
if ( g_pParentWnd->GetWatchBSP()->HasBSPPlugin() ) {
g_BSPFrontendTable.m_pfnEndListen( 2 );
}
return;
}
}
static void saxCharacters(message_info_t *data, const xmlChar *ch, int len)
@ -317,40 +313,37 @@ bool CWatchBSP::SetupListening()
return true;
}
void CWatchBSP::DoEBeginStep()
{
Reset();
if (SetupListening() == false)
{
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";
Sys_Printf (msg);
gtk_MessageBox (g_pParentWnd->m_pWidget, msg, "BSP monitoring", MB_OK | MB_ICONERROR);
return;
}
// set the timer for timeouts and step cancellation
g_timer_reset( m_pTimer );
g_timer_start( m_pTimer );
void CWatchBSP::DoEBeginStep() {
Reset();
if ( !SetupListening() ) {
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";
Sys_Printf( msg );
gtk_MessageBox( g_pParentWnd->m_pWidget, msg, "BSP monitoring", MB_OK | MB_ICONERROR );
return;
}
// set the timer for timeouts and step cancellation
g_timer_reset( m_pTimer );
g_timer_start( m_pTimer );
if (!m_bBSPPlugin)
{
Sys_Printf("=== running BSP command ===\n%s\n", g_ptr_array_index( m_pCmd, m_iCurrentStep ) );
if ( !m_bBSPPlugin ) {
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 ))
{
CString msg;
msg = "Failed to execute the following command: ";
msg += (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep );
msg += "\nCheck that the file exists and that you don't run out of system resources.\n";
Sys_Printf(msg);
gtk_MessageBox(g_pParentWnd->m_pWidget, msg, "BSP monitoring", MB_OK | MB_ICONERROR );
return;
}
// re-initialise the debug window
if (m_iCurrentStep == 0)
g_DbgDlg.Init();
}
m_eState = EBeginStep;
if ( !Q_Exec( NULL, (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep ), NULL, true ) ) {
CString msg;
msg = "Failed to execute the following command: ";
msg += (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep );
msg += "\nCheck that the file exists and that you don't run out of system resources.\n";
Sys_Printf( msg );
gtk_MessageBox( g_pParentWnd->m_pWidget, msg, "BSP monitoring", MB_OK | MB_ICONERROR );
return;
}
// re-initialise the debug window
if ( m_iCurrentStep == 0 ) {
g_DbgDlg.Init();
}
}
m_eState = EBeginStep;
}
void CWatchBSP::RoutineProcessing()

View file

@ -44,12 +44,13 @@ struct message_info_s;
class ISAXHandler
{
public:
virtual void saxStartElement (struct message_info_s *ctx, const xmlChar *name, const xmlChar **attrs) = 0;
virtual void saxEndElement (struct message_info_s *ctx, const xmlChar *name) = 0;
virtual void saxCharacters (struct message_info_s *ctx, const xmlChar *ch, int len) = 0;
virtual void saxStartElement( struct message_info_s *ctx, const xmlChar *name, const xmlChar **attrs ) = 0;
virtual void saxEndElement( struct message_info_s *ctx, const xmlChar *name ) = 0;
virtual void saxCharacters( struct message_info_s *ctx, const xmlChar *ch, int len ) = 0;
virtual char *getName() { return NULL; }
virtual void Highlight() { }
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
@ -59,12 +60,12 @@ public:
// the level for stopping the feed is stored in stop_depth
// unkown nodes are ignored, we use ignore_depth to track the level we start ignoring from
typedef struct message_info_s {
int msg_level; // current message level (SYS_MSG, SYS_WRN, SYS_ERR)
int recurse; // current recursion depth (used to track various things)
int ignore_depth; // the ignore depth limit when we are jumping over unknown nodes (0 means we are not ignoring)
int stop_depth; // the depth we need to stop at the end
bool bGeometry; // are we parsing some geometry information (i.e. do we forward the SAX calls?)
ISAXHandler *pGeometry; // the handler
int msg_level; // current message level (SYS_MSG, SYS_WRN, SYS_ERR)
int recurse; // current recursion depth (used to track various things)
int ignore_depth; // the ignore depth limit when we are jumping over unknown nodes (0 means we are not ignoring)
int stop_depth; // the depth we need to stop at the end
bool bGeometry; // are we parsing some geometry information (i.e. do we forward the SAX calls?)
ISAXHandler *pGeometry; // the handler
} message_info_t;
#endif

View file

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