From d549cd09c549361402f5472b229c21633d76eb61 Mon Sep 17 00:00:00 2001 From: spog Date: Tue, 21 Feb 2006 21:06:40 +0000 Subject: [PATCH] fixed eol-style git-svn-id: svn://svn.icculus.org/gtkradiant/GtkRadiant/trunk@21 8a3a26a2-13c4-0310-b231-cf6edde360e5 --- contrib/bkgrnd2d/bkgrnd2d.h | 164 +++++++++--------- contrib/bkgrnd2d/dialog.h | 70 ++++---- contrib/bkgrnd2d/plugin.h | 158 ++++++++--------- libs/container/stack.h | 2 +- libs/modulesystem/modulesmap.h | 304 ++++++++++++++++----------------- 5 files changed, 349 insertions(+), 349 deletions(-) diff --git a/contrib/bkgrnd2d/bkgrnd2d.h b/contrib/bkgrnd2d/bkgrnd2d.h index 4b8da7f2..3874cb19 100644 --- a/contrib/bkgrnd2d/bkgrnd2d.h +++ b/contrib/bkgrnd2d/bkgrnd2d.h @@ -1,82 +1,82 @@ -/* -Copyright (C) 2003 Reed Mideke. - -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 -*/ - -// -// bkgrnd2d Plugin -// -// Code by reyalP aka Reed Mideke -// -// Based on spritemodel source code by hydra -// - -#include "plugin.h" - -class CBackgroundImage { -private: - qtexture_t *m_tex; - VIEWTYPE m_vt; - -// which components of a vec3_t correspond to x and y in the image - unsigned m_ix,m_iy; - -public: - CBackgroundImage(VIEWTYPE vt); -// ~CBackgroundImage(); - - float m_alpha; // vertex alpha - bool m_bActive; - -// x and y axis are in relation to the screen, not world, making rendering -// the same for each view type. Whoever sets them is responsible for -// shuffling. -// units are world units. -// TODO should be private - float m_xmin,m_ymin,m_xmax,m_ymax; - -// load file, create new tex, cleanup old tex, set new tex - bool Load(const char *filename); - void Cleanup(); // free texture, free tex, set make tex NULL - bool SetExtentsMM(); // set extents by ET mapcoordsmaxs/mapcoordsmins - bool SetExtentsSel(); // set extents by selection - void Render(); - bool Valid() { return (m_tex && (m_xmin != m_xmax) && (m_ymin != m_ymax)); } -}; - -class CBackgroundRender : public IGL2DWindow { -public: - - CBackgroundRender(); - virtual ~CBackgroundRender(); - -protected: - int refCount; - -public: - - // IGL2DWindow IGL3DWindow interface - void IncRef() { refCount++; } - void DecRef() { refCount--; if (refCount <= 0) delete this; } - void Draw2D( VIEWTYPE vt ); - void Register(); -}; - -extern CBackgroundImage backgroundXY,backgroundXZ,backgroundYZ; -extern CBackgroundRender render; - +/* +Copyright (C) 2003 Reed Mideke. + +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 +*/ + +// +// bkgrnd2d Plugin +// +// Code by reyalP aka Reed Mideke +// +// Based on spritemodel source code by hydra +// + +#include "plugin.h" + +class CBackgroundImage { +private: + qtexture_t *m_tex; + VIEWTYPE m_vt; + +// which components of a vec3_t correspond to x and y in the image + unsigned m_ix,m_iy; + +public: + CBackgroundImage(VIEWTYPE vt); +// ~CBackgroundImage(); + + float m_alpha; // vertex alpha + bool m_bActive; + +// x and y axis are in relation to the screen, not world, making rendering +// the same for each view type. Whoever sets them is responsible for +// shuffling. +// units are world units. +// TODO should be private + float m_xmin,m_ymin,m_xmax,m_ymax; + +// load file, create new tex, cleanup old tex, set new tex + bool Load(const char *filename); + void Cleanup(); // free texture, free tex, set make tex NULL + bool SetExtentsMM(); // set extents by ET mapcoordsmaxs/mapcoordsmins + bool SetExtentsSel(); // set extents by selection + void Render(); + bool Valid() { return (m_tex && (m_xmin != m_xmax) && (m_ymin != m_ymax)); } +}; + +class CBackgroundRender : public IGL2DWindow { +public: + + CBackgroundRender(); + virtual ~CBackgroundRender(); + +protected: + int refCount; + +public: + + // IGL2DWindow IGL3DWindow interface + void IncRef() { refCount++; } + void DecRef() { refCount--; if (refCount <= 0) delete this; } + void Draw2D( VIEWTYPE vt ); + void Register(); +}; + +extern CBackgroundImage backgroundXY,backgroundXZ,backgroundYZ; +extern CBackgroundRender render; + diff --git a/contrib/bkgrnd2d/dialog.h b/contrib/bkgrnd2d/dialog.h index 9da7b721..03af2078 100644 --- a/contrib/bkgrnd2d/dialog.h +++ b/contrib/bkgrnd2d/dialog.h @@ -1,35 +1,35 @@ -/* -Copyright (C) 2003 Reed Mideke. - -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 -*/ - -// -// bkgrnd2d Plugin dialog box -// -// Code by reyalP aka Reed Mideke -// -// - -#ifndef _BKGRND2D_DIALOG_H_ -#define _BKGRND2D_DIALOG_H_ - -void InitBackgroundDialog(); -void ShowBackgroundDialog(); -void ShowBackgroundDialogPG(int page); - -#endif // _BKGRND2D_DIALOG_H_ +/* +Copyright (C) 2003 Reed Mideke. + +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 +*/ + +// +// bkgrnd2d Plugin dialog box +// +// Code by reyalP aka Reed Mideke +// +// + +#ifndef _BKGRND2D_DIALOG_H_ +#define _BKGRND2D_DIALOG_H_ + +void InitBackgroundDialog(); +void ShowBackgroundDialog(); +void ShowBackgroundDialogPG(int page); + +#endif // _BKGRND2D_DIALOG_H_ diff --git a/contrib/bkgrnd2d/plugin.h b/contrib/bkgrnd2d/plugin.h index 9a72f966..30b0ca7d 100644 --- a/contrib/bkgrnd2d/plugin.h +++ b/contrib/bkgrnd2d/plugin.h @@ -1,79 +1,79 @@ -/* -Copyright (C) 2003 Reed Mideke. - -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 -*/ - -// -// bkgrnd2d Plugin -// -// Code by reyalP aka Reed Mideke -// -// Based on spritemodel source code by hydra -// - -#ifndef _PLUGIN_H_ -#define _PLUGIN_H_ - -/*! -\todo need general notice about lib purpose etc. -and the external dependencies (such as GLib, STL, mathlib etc.) -*/ - -#include -// for CPtrArray for idata.h -#include "missing.h" - -#include "synapse.h" -#include "iplugin.h" -#include "itoolbar.h" -#define USE_QERTABLE_DEFINE -#include "qerplugin.h" -#include "igl.h" -#include "ifilesystem.h" -#include "ientity.h" -#include "idata.h" - -// verbose messages -#define BKGRND2D_DEBUG - -extern _QERFuncTable_1 g_FuncTable; -extern _QERQglTable g_QglTable; -extern _QERFileSystemTable g_FileSystemTable; -extern _QEREntityTable g_EntityTable; -extern _QERAppDataTable g_DataTable; -extern void *g_pMainWidget; - -extern CSynapseServer* g_pSynapseServer; - -class CSynapseClientBkgrnd2d : public CSynapseClient -{ -public: - // CSynapseClient API - bool RequestAPI(APIDescriptor_t *pAPI); - const char* GetInfo(); - const char* GetName(); - - CSynapseClientBkgrnd2d() { } - virtual ~CSynapseClientBkgrnd2d() { } -}; -#define MSG_PREFIX "bkgrnd2d: " -#define MSG_WARN "bkgrnd2d WARNING: " -#define BKGRND2D_MINOR "bkgrnd2d" -#define FILETYPE_KEY "bkgrnd2d" - -#endif // _PLUGIN_H_ +/* +Copyright (C) 2003 Reed Mideke. + +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 +*/ + +// +// bkgrnd2d Plugin +// +// Code by reyalP aka Reed Mideke +// +// Based on spritemodel source code by hydra +// + +#ifndef _PLUGIN_H_ +#define _PLUGIN_H_ + +/*! +\todo need general notice about lib purpose etc. +and the external dependencies (such as GLib, STL, mathlib etc.) +*/ + +#include +// for CPtrArray for idata.h +#include "missing.h" + +#include "synapse.h" +#include "iplugin.h" +#include "itoolbar.h" +#define USE_QERTABLE_DEFINE +#include "qerplugin.h" +#include "igl.h" +#include "ifilesystem.h" +#include "ientity.h" +#include "idata.h" + +// verbose messages +#define BKGRND2D_DEBUG + +extern _QERFuncTable_1 g_FuncTable; +extern _QERQglTable g_QglTable; +extern _QERFileSystemTable g_FileSystemTable; +extern _QEREntityTable g_EntityTable; +extern _QERAppDataTable g_DataTable; +extern void *g_pMainWidget; + +extern CSynapseServer* g_pSynapseServer; + +class CSynapseClientBkgrnd2d : public CSynapseClient +{ +public: + // CSynapseClient API + bool RequestAPI(APIDescriptor_t *pAPI); + const char* GetInfo(); + const char* GetName(); + + CSynapseClientBkgrnd2d() { } + virtual ~CSynapseClientBkgrnd2d() { } +}; +#define MSG_PREFIX "bkgrnd2d: " +#define MSG_WARN "bkgrnd2d WARNING: " +#define BKGRND2D_MINOR "bkgrnd2d" +#define FILETYPE_KEY "bkgrnd2d" + +#endif // _PLUGIN_H_ diff --git a/libs/container/stack.h b/libs/container/stack.h index a5cefb1a..85b3d078 100644 --- a/libs/container/stack.h +++ b/libs/container/stack.h @@ -236,4 +236,4 @@ namespace std } } -#endif +#endif diff --git a/libs/modulesystem/modulesmap.h b/libs/modulesystem/modulesmap.h index 3af2f972..44b62bdb 100644 --- a/libs/modulesystem/modulesmap.h +++ b/libs/modulesystem/modulesmap.h @@ -1,152 +1,152 @@ -/* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. - -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 -*/ - -#if !defined(INCLUDED_MODULESYSTEM_MODULESMAP_H) -#define INCLUDED_MODULESYSTEM_MODULESMAP_H - -#include "modulesystem.h" -#include "string/string.h" -#include -#include - -template -class ModulesMap : public Modules -{ - typedef std::map modules_t; - modules_t m_modules; -public: - ~ModulesMap() - { - for(modules_t::iterator i = m_modules.begin(); i != m_modules.end(); ++i) - { - (*i).second->release(); - } - } - - typedef modules_t::const_iterator iterator; - - iterator begin() const - { - return m_modules.begin(); - } - iterator end() const - { - return m_modules.end(); - } - - void insert(const char* name, Module& module) - { - module.capture(); - if(globalModuleServer().getError()) - { - module.release(); - globalModuleServer().setError(false); - } - else - { - m_modules.insert(modules_t::value_type(name, &module)); - } - } - - Type* find(const char* name) - { - modules_t::iterator i = m_modules.find(name); - if(i != m_modules.end()) - { - return static_cast(Module_getTable(*(*i).second)); - } - return 0; - } - - Type* findModule(const char* name) - { - return find(name); - } - void foreachModule(typename Modules::Visitor& visitor) - { - for(modules_t::iterator i = m_modules.begin(); i != m_modules.end(); ++i) - { - visitor.visit((*i).first.c_str(), *static_cast(Module_getTable(*(*i).second))); - } - } -}; - -template -class InsertModules : public ModuleServer::Visitor -{ - ModulesMap& m_modules; -public: - InsertModules(ModulesMap& modules) - : m_modules(modules) - { - } - void visit(const char* name, Module& module) - { - m_modules.insert(name, module); - } -}; - -template -class ModulesRef -{ - ModulesMap m_modules; -public: - ModulesRef(const char* names) - { - if(!globalModuleServer().getError()) - { - if(string_equal(names, "*")) - { - InsertModules visitor(m_modules); - globalModuleServer().foreachModule(typename Type::Name(), typename Type::Version(), visitor); - } - else - { - StringTokeniser tokeniser(names); - for(;;) - { - const char* name = tokeniser.getToken(); - if(string_empty(name)) - { - break; - } - Module* module = globalModuleServer().findModule(typename Type::Name(), typename Type::Version(), name); - if(module == 0) - { - globalModuleServer().setError(true); - globalErrorStream() << "ModulesRef::initialise: type=" << makeQuoted(typename Type::Name()) << " version=" << makeQuoted(typename Type::Version()) << " name=" << makeQuoted(name) << " - not found\n"; - break; - } - else - { - m_modules.insert(name, *module); - } - } - } - } - } - ModulesMap& get() - { - return m_modules; - } -}; - -#endif +/* +Copyright (C) 2001-2006, William Joseph. +All Rights Reserved. + +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 +*/ + +#if !defined(INCLUDED_MODULESYSTEM_MODULESMAP_H) +#define INCLUDED_MODULESYSTEM_MODULESMAP_H + +#include "modulesystem.h" +#include "string/string.h" +#include +#include + +template +class ModulesMap : public Modules +{ + typedef std::map modules_t; + modules_t m_modules; +public: + ~ModulesMap() + { + for(modules_t::iterator i = m_modules.begin(); i != m_modules.end(); ++i) + { + (*i).second->release(); + } + } + + typedef modules_t::const_iterator iterator; + + iterator begin() const + { + return m_modules.begin(); + } + iterator end() const + { + return m_modules.end(); + } + + void insert(const char* name, Module& module) + { + module.capture(); + if(globalModuleServer().getError()) + { + module.release(); + globalModuleServer().setError(false); + } + else + { + m_modules.insert(modules_t::value_type(name, &module)); + } + } + + Type* find(const char* name) + { + modules_t::iterator i = m_modules.find(name); + if(i != m_modules.end()) + { + return static_cast(Module_getTable(*(*i).second)); + } + return 0; + } + + Type* findModule(const char* name) + { + return find(name); + } + void foreachModule(typename Modules::Visitor& visitor) + { + for(modules_t::iterator i = m_modules.begin(); i != m_modules.end(); ++i) + { + visitor.visit((*i).first.c_str(), *static_cast(Module_getTable(*(*i).second))); + } + } +}; + +template +class InsertModules : public ModuleServer::Visitor +{ + ModulesMap& m_modules; +public: + InsertModules(ModulesMap& modules) + : m_modules(modules) + { + } + void visit(const char* name, Module& module) + { + m_modules.insert(name, module); + } +}; + +template +class ModulesRef +{ + ModulesMap m_modules; +public: + ModulesRef(const char* names) + { + if(!globalModuleServer().getError()) + { + if(string_equal(names, "*")) + { + InsertModules visitor(m_modules); + globalModuleServer().foreachModule(typename Type::Name(), typename Type::Version(), visitor); + } + else + { + StringTokeniser tokeniser(names); + for(;;) + { + const char* name = tokeniser.getToken(); + if(string_empty(name)) + { + break; + } + Module* module = globalModuleServer().findModule(typename Type::Name(), typename Type::Version(), name); + if(module == 0) + { + globalModuleServer().setError(true); + globalErrorStream() << "ModulesRef::initialise: type=" << makeQuoted(typename Type::Name()) << " version=" << makeQuoted(typename Type::Version()) << " name=" << makeQuoted(name) << " - not found\n"; + break; + } + else + { + m_modules.insert(name, *module); + } + } + } + } + } + ModulesMap& get() + { + return m_modules; + } +}; + +#endif -- 2.39.2