mirror of
https://github.com/TTimo/GtkRadiant.git
synced 2024-11-10 07:11:54 +00:00
from nxn
git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant.ab@188 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
parent
2b5ef55c7c
commit
beb511aadb
10 changed files with 168 additions and 1335 deletions
|
@ -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
|
||||
|
|
1174
radiant.sln.ref
1174
radiant.sln.ref
File diff suppressed because it is too large
Load diff
|
@ -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 ) );
|
||||
}
|
||||
|
||||
void CDbgDlg::Init ()
|
||||
{
|
||||
DropHighlight();
|
||||
|
||||
void CDbgDlg::ClearFeedbackArray() {
|
||||
// free all the ISAXHandler*, clean it
|
||||
while (m_pFeedbackElements->len)
|
||||
{
|
||||
delete static_cast<ISAXHandler *>(g_ptr_array_index (m_pFeedbackElements, 0));
|
||||
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 );
|
||||
}
|
||||
|
||||
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
|
||||
g_ptr_array_add( m_pFeedbackElements, (void *)pHandler );
|
||||
|
||||
if (m_pWidget == NULL)
|
||||
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)
|
||||
{
|
||||
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 );
|
||||
|
|
|
@ -107,7 +107,7 @@ class CDbgDlg : public Dialog
|
|||
ISAXHandler *m_pHighlight;
|
||||
public:
|
||||
CDbgDlg() { m_pFeedbackElements = g_ptr_array_new(); m_pHighlight = NULL; }
|
||||
virtual ~CDbgDlg() { }
|
||||
virtual ~CDbgDlg() { ClearFeedbackArray(); }
|
||||
// refresh items
|
||||
void Push( ISAXHandler * );
|
||||
// clean the debug window, release all ISAXHanlders we have
|
||||
|
@ -115,9 +115,9 @@ public:
|
|||
ISAXHandler *GetElement(gint row);
|
||||
void SetHighlight(gint row);
|
||||
void DropHighlight();
|
||||
// void HideDlg();
|
||||
protected:
|
||||
void BuildDialog();
|
||||
void ClearFeedbackArray();
|
||||
};
|
||||
|
||||
extern CDbgDlg g_DbgDlg;
|
||||
|
|
|
@ -48,6 +48,9 @@ public:
|
|||
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
|
||||
|
|
|
@ -145,33 +145,29 @@ static void saxStartElement(message_info_t *data, const xmlChar *name, const xml
|
|||
data->recurse++;
|
||||
}
|
||||
|
||||
static void saxEndElement(message_info_t *data, const xmlChar *name)
|
||||
{
|
||||
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)
|
||||
{
|
||||
if ( data->recurse == data->ignore_depth ) {
|
||||
data->ignore_depth = 0;
|
||||
return;
|
||||
}
|
||||
if (data->bGeometry)
|
||||
{
|
||||
if ( data->bGeometry ) {
|
||||
data->pGeometry->saxEndElement( data, name );
|
||||
// we add the object to the debug window
|
||||
if (!data->bGeometry)
|
||||
{
|
||||
if ( !data->bGeometry ) {
|
||||
g_DbgDlg.Push( data->pGeometry );
|
||||
}
|
||||
}
|
||||
if (data->recurse == data->stop_depth)
|
||||
{
|
||||
if ( data->recurse == data->stop_depth ) {
|
||||
#ifdef _DEBUG
|
||||
Sys_Printf ("Received error msg .. shutting down..\n");
|
||||
#endif
|
||||
g_pParentWnd->GetWatchBSP()->Reset();
|
||||
// tell there has been an error
|
||||
if (g_pParentWnd->GetWatchBSP()->HasBSPPlugin ())
|
||||
if ( g_pParentWnd->GetWatchBSP()->HasBSPPlugin() ) {
|
||||
g_BSPFrontendTable.m_pfnEndListen( 2 );
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
@ -317,11 +313,9 @@ bool CWatchBSP::SetupListening()
|
|||
return true;
|
||||
}
|
||||
|
||||
void CWatchBSP::DoEBeginStep()
|
||||
{
|
||||
void CWatchBSP::DoEBeginStep() {
|
||||
Reset();
|
||||
if (SetupListening() == false)
|
||||
{
|
||||
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 );
|
||||
|
@ -332,12 +326,10 @@ void CWatchBSP::DoEBeginStep()
|
|||
g_timer_reset( 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 ) );
|
||||
|
||||
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;
|
||||
msg = "Failed to execute the following command: ";
|
||||
msg += (char *)g_ptr_array_index( m_pCmd, m_iCurrentStep );
|
||||
|
@ -347,9 +339,10 @@ void CWatchBSP::DoEBeginStep()
|
|||
return;
|
||||
}
|
||||
// re-initialise the debug window
|
||||
if (m_iCurrentStep == 0)
|
||||
if ( m_iCurrentStep == 0 ) {
|
||||
g_DbgDlg.Init();
|
||||
}
|
||||
}
|
||||
m_eState = EBeginStep;
|
||||
}
|
||||
|
||||
|
|
|
@ -50,6 +50,7 @@ public:
|
|||
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
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue