X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=include%2Fibrush.h;h=1171f8a7199980cada591c7fbe0a1597737465b5;hb=refs%2Fheads%2FTimePath%2FMakefile;hp=187ebcc4a02e7b2284b855616a192a0cb8663356;hpb=6ee91d153ea09f2dafa62ed2f022f4183c090168;p=xonotic%2Fnetradiant.git diff --git a/include/ibrush.h b/include/ibrush.h index 187ebcc4..1171f8a7 100644 --- a/include/ibrush.h +++ b/include/ibrush.h @@ -1,99 +1,98 @@ /* -Copyright (C) 2001-2006, William Joseph. -All Rights Reserved. + Copyright (C) 2001-2006, William Joseph. + All Rights Reserved. -This file is part of GtkRadiant. + 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 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. + 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 -*/ + 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_IBRUSH_H) +#if !defined( INCLUDED_IBRUSH_H ) #define INCLUDED_IBRUSH_H #include "generic/constant.h" #include "generic/callback.h" -#include "math/vector.h" +#include "generic/vector.h" #include "itexdef.h" namespace scene { - class Node; +class Node; } #if 0 class IBrushFace { public: - virtual const char* GetShader() const = 0; - virtual void SetShader(const char* name) = 0; - virtual const TextureProjection& GetTexdef() const = 0; - virtual void GetTexdef(TextureProjection& projection) const = 0; - virtual void SetTexdef(const TextureProjection& projection) = 0; - virtual void GetFlags(ContentsFlagsValue& flags) const = 0; - virtual void SetFlags(const ContentsFlagsValue& flags) = 0; - virtual void ShiftTexdef(float s, float t) = 0; - virtual void ScaleTexdef(float s, float t) = 0; - virtual void RotateTexdef(float angle) = 0; - virtual void FitTexture(float s_repeat, float t_repeat) = 0; - virtual bool isDetail() const = 0; - virtual void setDetail(bool detail) = 0; +virtual const char* GetShader() const = 0; +virtual void SetShader( const char* name ) = 0; +virtual const TextureProjection& GetTexdef() const = 0; +virtual void GetTexdef( TextureProjection& projection ) const = 0; +virtual void SetTexdef( const TextureProjection& projection ) = 0; +virtual void GetFlags( ContentsFlagsValue& flags ) const = 0; +virtual void SetFlags( const ContentsFlagsValue& flags ) = 0; +virtual void ShiftTexdef( float s, float t ) = 0; +virtual void ScaleTexdef( float s, float t ) = 0; +virtual void RotateTexdef( float angle ) = 0; +virtual void FitTexture( float s_repeat, float t_repeat ) = 0; +virtual bool isDetail() const = 0; +virtual void setDetail( bool detail ) = 0; }; class IBrush { public: - STRING_CONSTANT(Name, "IBrush"); - virtual void reserve(std::size_t count) = 0; - virtual void clear() = 0; - virtual void copy(const IBrush& other) = 0; - virtual IBrushFace* addPlane(const Vector3& p0, const Vector3& p1, const Vector3& p2, const char* shader, const TextureProjection& projection) = 0; - virtual const AABB& localAABB() const = 0; - virtual void removeEmptyFaces() = 0; +STRING_CONSTANT( Name, "IBrush" ); +virtual void reserve( std::size_t count ) = 0; +virtual void clear() = 0; +virtual void copy( const IBrush& other ) = 0; +virtual IBrushFace* addPlane( const Vector3& p0, const Vector3& p1, const Vector3& p2, const char* shader, const TextureProjection& projection ) = 0; +virtual const AABB& localAABB() const = 0; +virtual void removeEmptyFaces() = 0; }; class IBrushFaceInstance { public: - virtual IBrushFace& getFace() = 0; - virtual const IBrushFace& getFace() const = 0; - virtual bool isSelected() const = 0; - virtual void setSelected(SelectionSystem::EComponentMode mode, bool select) const = 0; +virtual IBrushFace& getFace() = 0; +virtual const IBrushFace& getFace() const = 0; +virtual bool isSelected() const = 0; +virtual void setSelected( SelectionSystem::EComponentMode mode, bool select ) const = 0; }; class IBrushInstance { public: - STRING_CONSTANT(Name, "IBrushInstance"); - virtual void forEachFaceInstance(const BrushInstanceVisitor& visitor) = 0; +STRING_CONSTANT( Name, "IBrushInstance" ); +virtual void forEachFaceInstance( const BrushInstanceVisitor& visitor ) = 0; }; #endif class _QERFaceData { public: - _QERFaceData() : contents(0), flags(0), value(0), m_shader("") - { - } - Vector3 m_p0; - Vector3 m_p1; - Vector3 m_p2; - texdef_t m_texdef; - const char* m_shader; - int contents; - int flags; - int value; +_QERFaceData() : m_shader( "" ), contents( 0 ), flags( 0 ), value( 0 ){ +} +Vector3 m_p0; +Vector3 m_p1; +Vector3 m_p2; +texdef_t m_texdef; +const char* m_shader; +int contents; +int flags; +int value; }; typedef Callback1 BrushFaceDataCallback; @@ -101,12 +100,12 @@ typedef Callback1 BrushFaceDataCallback; class BrushCreator { public: - INTEGER_CONSTANT(Version, 1); - STRING_CONSTANT(Name, "brush"); - virtual scene::Node& createBrush() = 0; - virtual bool useAlternativeTextureProjection() const = 0; - virtual void forEachBrushFace(scene::Node& brush, const BrushFaceDataCallback& callback) = 0; - virtual bool addBrushFace(scene::Node& brush, const _QERFaceData& faceData) = 0; +INTEGER_CONSTANT( Version, 1 ); +STRING_CONSTANT( Name, "brush" ); +virtual scene::Node& createBrush() = 0; +virtual bool useAlternativeTextureProjection() const = 0; +virtual void Brush_forEachFace( scene::Node& brush, const BrushFaceDataCallback& callback ) = 0; +virtual bool Brush_addFace( scene::Node& brush, const _QERFaceData& faceData ) = 0; }; #include "modulesystem.h" @@ -119,9 +118,8 @@ template class GlobalModuleRef; typedef GlobalModuleRef GlobalBrushModuleRef; -inline BrushCreator& GlobalBrushCreator() -{ - return GlobalBrushModule::getTable(); +inline BrushCreator& GlobalBrushCreator(){ + return GlobalBrushModule::getTable(); } #endif