X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=include%2Fmapfile.h;h=02cd360e8bd0dee938a79415389eea9f1ba9130d;hb=a31f4689bf410cd2d9a7b658ece392e96b01e388;hp=e53d79c17a861da56d1374e5c291ecbb54faeb73;hpb=bfc8a12a6b315ae261101a34db8ba1b682c67bb7;p=xonotic%2Fnetradiant.git diff --git a/include/mapfile.h b/include/mapfile.h index e53d79c1..02cd360e 100644 --- a/include/mapfile.h +++ b/include/mapfile.h @@ -1,74 +1,70 @@ /* -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_MAPFILE_H) +#if !defined( INCLUDED_MAPFILE_H ) #define INCLUDED_MAPFILE_H #include #include "iscenegraph.h" -#include "generic/callbackfwd.h" +#include "generic/callback.h" const std::size_t MAPFILE_MAX_CHANGES = std::numeric_limits::max(); class MapFile { public: - STRING_CONSTANT(Name, "MapFile"); +STRING_CONSTANT( Name, "MapFile" ); - virtual void save() = 0; - virtual bool saved() const = 0; - virtual void changed() = 0; - virtual void setChangedCallback(const Callback& changed) = 0; - virtual std::size_t changes() const = 0; +virtual void save() = 0; +virtual bool saved() const = 0; +virtual void changed() = 0; +virtual void setChangedCallback( const Callback& changed ) = 0; +virtual std::size_t changes() const = 0; }; #include "scenelib.h" -inline MapFile* Node_getMapFile(scene::Node& node) -{ - return NodeTypeCast::cast(node); +inline MapFile* Node_getMapFile( scene::Node& node ){ + return NodeTypeCast::cast( node ); } template -inline MapFile* path_find_mapfile(Iterator first, Iterator last) -{ - Iterator i = last; - for(;;) - { - --i; - - MapFile* map = Node_getMapFile(*i); - if(map != 0) - { - return map; - } - - if(i == first) - { - break; - } - } - ERROR_MESSAGE("failed to find parent mapfile for path"); - return 0; +inline MapFile* path_find_mapfile( Iterator first, Iterator last ){ + Iterator i = last; + for (;; ) + { + --i; + + MapFile* map = Node_getMapFile( *i ); + if ( map != 0 ) { + return map; + } + + if ( i == first ) { + break; + } + } + ERROR_MESSAGE( "failed to find parent mapfile for path" ); + return 0; }