eol style

git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/branches/ZeroRadiant.ab@184 8a3a26a2-13c4-0310-b231-cf6edde360e5
This commit is contained in:
TTimo
2007-11-04 03:47:06 +00:00
parent d59e1dc131
commit ab3a99dbbe
475 changed files with 193668 additions and 193668 deletions

View File

@@ -1,94 +1,94 @@
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _CPICOMODEL_H_
#define _CPICOMODEL_H_
#include "plugin.h"
#include "picomodel.h"
#include "gtkr_vector.h"
class CPicoParent
{
public:
virtual void UpdateShaders( void ) = 0;
};
class CModelManager; // forward declaration
//typedef std::pair<Str, int> PicoModelKey;
typedef pair<Str, int> PicoModelKey;
class CPicoModel : public IRender, public ISelect
{
friend class CModelManager;
public:
CPicoModel(const PicoModelKey& key);
CPicoModel(const Str& name);
CPicoModel(const Str& name, const int frame);
CPicoModel(const char *name, const int frame);
~CPicoModel();
void CPicoModel::load(const char *name, const int frame);
void IncRef()
{
++m_refcount;
}
void DecRef()
{
if(--m_refcount == 0)
delete this;
}
void AddParent( CPicoParent *parent );
void RemoveParent( CPicoParent *parent );
void Reload( void );
void Draw(int state, vector<IShader*> shaders, int rflags) const;
//IRender
virtual void Draw( int state, int rflags ) const;
virtual const aabb_t *GetAABB() const { return &m_BBox; }
//ISelect
virtual bool TestRay( const ray_t *ray, vec_t *dist ) const;
int GetNumSurfaces( void );
char *GetShaderNameForSurface( const unsigned int surf );
private:
void AccumulateBBox();
char *m_name;
int m_frame;
picoModel_t *m_pModel;
unsigned int m_refcount;
aabb_t m_BBox;
GPtrArray *m_children; // array of CPicoSurface
GPtrArray *m_parents; // array of CPicoParent
GPtrArray* m_shaders;
bool m_bReloaded; // managed by CModelManager
};
#endif // _CPICOMODEL_H_
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _CPICOMODEL_H_
#define _CPICOMODEL_H_
#include "plugin.h"
#include "picomodel.h"
#include "gtkr_vector.h"
class CPicoParent
{
public:
virtual void UpdateShaders( void ) = 0;
};
class CModelManager; // forward declaration
//typedef std::pair<Str, int> PicoModelKey;
typedef pair<Str, int> PicoModelKey;
class CPicoModel : public IRender, public ISelect
{
friend class CModelManager;
public:
CPicoModel(const PicoModelKey& key);
CPicoModel(const Str& name);
CPicoModel(const Str& name, const int frame);
CPicoModel(const char *name, const int frame);
~CPicoModel();
void CPicoModel::load(const char *name, const int frame);
void IncRef()
{
++m_refcount;
}
void DecRef()
{
if(--m_refcount == 0)
delete this;
}
void AddParent( CPicoParent *parent );
void RemoveParent( CPicoParent *parent );
void Reload( void );
void Draw(int state, vector<IShader*> shaders, int rflags) const;
//IRender
virtual void Draw( int state, int rflags ) const;
virtual const aabb_t *GetAABB() const { return &m_BBox; }
//ISelect
virtual bool TestRay( const ray_t *ray, vec_t *dist ) const;
int GetNumSurfaces( void );
char *GetShaderNameForSurface( const unsigned int surf );
private:
void AccumulateBBox();
char *m_name;
int m_frame;
picoModel_t *m_pModel;
unsigned int m_refcount;
aabb_t m_BBox;
GPtrArray *m_children; // array of CPicoSurface
GPtrArray *m_parents; // array of CPicoParent
GPtrArray* m_shaders;
bool m_bReloaded; // managed by CModelManager
};
#endif // _CPICOMODEL_H_

View File

@@ -1,55 +1,55 @@
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "plugin.h"
#include "picomodel.h"
/*! Largest (potentially) selectable leaf of a Pico model */
class CPicoSurface
{
public:
CPicoSurface(picoSurface_t *surf); // creates a new surface from a picoSurface_t
~CPicoSurface();
void IncRef() { refCount++; }
void DecRef() { if(--refCount == 0) delete this; }
void Draw(int state, IShader *pShader, int rflags);
//IRender
void Draw(int state, int rflags);
const aabb_t *GetAABB() const { return &m_BBox; }
//ISelect
bool TestRay (const ray_t *ray, vec_t *dist) const;
char *GetShaderName( void )
{
return PicoGetShaderName(m_pSurface->shader);
}
private:
int refCount;
aabb_t m_BBox;
picoSurface_t *m_pSurface;
IShader* m_shader;
void AccumulateBBox(); // accumulate local bbox.. generally created from control handles
};
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#include "plugin.h"
#include "picomodel.h"
/*! Largest (potentially) selectable leaf of a Pico model */
class CPicoSurface
{
public:
CPicoSurface(picoSurface_t *surf); // creates a new surface from a picoSurface_t
~CPicoSurface();
void IncRef() { refCount++; }
void DecRef() { if(--refCount == 0) delete this; }
void Draw(int state, IShader *pShader, int rflags);
//IRender
void Draw(int state, int rflags);
const aabb_t *GetAABB() const { return &m_BBox; }
//ISelect
bool TestRay (const ray_t *ray, vec_t *dist) const;
char *GetShaderName( void )
{
return PicoGetShaderName(m_pSurface->shader);
}
private:
int refCount;
aabb_t m_BBox;
picoSurface_t *m_pSurface;
IShader* m_shader;
void AccumulateBBox(); // accumulate local bbox.. generally created from control handles
};

View File

@@ -1,76 +1,76 @@
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _PLUGIN_H_
#define _PLUGIN_H_
/*!
\todo need general notice about lib purpose etc.
and the external dependencies (such as GLib, STL, mathlib etc.)
*/
/*!
\todo not sure about what should be used for common data structures, GLib or STL
I think STL would be better since I intend on using STL in synapse
*/
#include <stdio.h>
#include "synapse.h"
#include "iplugin.h"
#define USE_QERTABLE_DEFINE
#include "qerplugin.h"
#include "imodel.h"
#include "igl.h"
#include "ifilesystem.h"
#include "ishaders.h"
#include "itoolbar.h"
extern _QERFuncTable_1 g_FuncTable;
extern _QERQglTable g_QglTable;
extern _QERShadersTable g_ShadersTable;
extern _QERFileSystemTable g_FileSystemTable;
#define vfsLoadFile g_FileSystemTable.m_pfnLoadFile
#define vfsFreeFile g_FileSystemTable.m_pfnFreeFile
#define vfsBasePromptPath g_FileSystemTable.m_pfnBasePromptPath
#define QERApp_Shader_ForName g_ShadersTable.m_pfnShader_ForName
void DoFlushReloadSelected();
void DoFlushReloadAll();
void LoadModel(entity_interfaces_t *model, const char *name);
extern CSynapseServer* g_pSynapseServer;
class CSynapseClientModel : public CSynapseClient
{
public:
// CSynapseClient API
bool RequestAPI(APIDescriptor_t *pAPI);
const char* GetInfo();
const char* GetName();
CSynapseClientModel() { }
virtual ~CSynapseClientModel() { }
};
#endif // _PLUGIN_H_
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _PLUGIN_H_
#define _PLUGIN_H_
/*!
\todo need general notice about lib purpose etc.
and the external dependencies (such as GLib, STL, mathlib etc.)
*/
/*!
\todo not sure about what should be used for common data structures, GLib or STL
I think STL would be better since I intend on using STL in synapse
*/
#include <stdio.h>
#include "synapse.h"
#include "iplugin.h"
#define USE_QERTABLE_DEFINE
#include "qerplugin.h"
#include "imodel.h"
#include "igl.h"
#include "ifilesystem.h"
#include "ishaders.h"
#include "itoolbar.h"
extern _QERFuncTable_1 g_FuncTable;
extern _QERQglTable g_QglTable;
extern _QERShadersTable g_ShadersTable;
extern _QERFileSystemTable g_FileSystemTable;
#define vfsLoadFile g_FileSystemTable.m_pfnLoadFile
#define vfsFreeFile g_FileSystemTable.m_pfnFreeFile
#define vfsBasePromptPath g_FileSystemTable.m_pfnBasePromptPath
#define QERApp_Shader_ForName g_ShadersTable.m_pfnShader_ForName
void DoFlushReloadSelected();
void DoFlushReloadAll();
void LoadModel(entity_interfaces_t *model, const char *name);
extern CSynapseServer* g_pSynapseServer;
class CSynapseClientModel : public CSynapseClient
{
public:
// CSynapseClient API
bool RequestAPI(APIDescriptor_t *pAPI);
const char* GetInfo();
const char* GetName();
CSynapseClientModel() { }
virtual ~CSynapseClientModel() { }
};
#endif // _PLUGIN_H_

View File

@@ -1,38 +1,38 @@
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class CSurface : public ISurface
{
public:
CSurface() { refCount = 0; aabb_clear(&m_BBox); m_pShader = NULL; }
~CSurface() { if(m_pShader != NULL) m_pShader->DecRef(); }
void IncRef() { refCount++; }
void DecRef() { if ( --refCount <= 0 ) delete this; }
const aabb_t *getBBox() const { return &m_BBox; }
IShader *getShader() const { return m_pShader; }
void setShader(const char *name) { if (getShader()) getShader()->DecRef(); m_pShader = QERApp_Shader_ForName(name); getShader()->IncRef(); }
protected:
int refCount;
aabb_t m_BBox;
IShader *m_pShader;
/*
Copyright (C) 1999-2007 id Software, Inc. and contributors.
For a list of contributors, see the accompanying CONTRIBUTORS file.
This file is part of GtkRadiant.
GtkRadiant is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
GtkRadiant is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GtkRadiant; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
class CSurface : public ISurface
{
public:
CSurface() { refCount = 0; aabb_clear(&m_BBox); m_pShader = NULL; }
~CSurface() { if(m_pShader != NULL) m_pShader->DecRef(); }
void IncRef() { refCount++; }
void DecRef() { if ( --refCount <= 0 ) delete this; }
const aabb_t *getBBox() const { return &m_BBox; }
IShader *getShader() const { return m_pShader; }
void setShader(const char *name) { if (getShader()) getShader()->DecRef(); m_pShader = QERApp_Shader_ForName(name); getShader()->IncRef(); }
protected:
int refCount;
aabb_t m_BBox;
IShader *m_pShader;
};