Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/core3/src/core/CorePrereqs.h @ 1591

Last change on this file since 1591 was 1591, checked in by landauf, 16 years ago

Again some heavy changes in ObjectList and Iterator:
there are now two types of iterators:

Iterator<ClassName> can iterate through any objectlist, either given by ObjectList<AnyClassName>::begin() or anyidentifier→getObjects()→begin(). Important note Iterator<ClassName> uses dynamic_cast.
And yes, it's possible to do this: Iterator<WorldEntity> it = ObjectList<SpaceShip>::begin()

ObjectList<ClassName>::iterator is the second iterator - it uses the ObjectList in a templated manner and therefore doesn't need dynamic_cast. But the only thing you can do is iterating through exactly the right ObjectList: ObjectList<ClassName>::iterator it = ObjectList<ClassName>::begin(). Anything else fails.

Those changes bring, at my system, something around +12% FPS compared with trunk and +25% FPS compared with the last revision of core3. Although I have to admit the FPS gain is only that high because iterating through objects is the main thing we're doing ingame right now. It would look totally different with physics, sound, AI, scripts, triggers and so on.

  • Property svn:eol-style set to native
File size: 4.2 KB
Line 
1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
3 *                    > www.orxonox.net <
4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
23 *      Reto Grieder
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30  @file
31  @brief Contains all the necessary forward declarations for all classes and structs.
32*/
33
34#ifndef _CorePrereqs_H__
35#define _CorePrereqs_H__
36
37#include "util/OrxonoxPlatform.h"
38
39#include <string>
40
41//-----------------------------------------------------------------------
42// Shared library settings
43//-----------------------------------------------------------------------
44#if (ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32) && !defined( CORE_STATIC_BUILD )
45#  ifdef CORE_SHARED_BUILD
46#    define _CoreExport __declspec(dllexport)
47#  else
48#    if defined( __MINGW32__ )
49#      define _CoreExport
50#    else
51#      define _CoreExport __declspec(dllimport)
52#    endif
53#  endif
54#elif defined ( ORXONOX_GCC_VISIBILITY )
55#  define _CoreExport  __attribute__ ((visibility("default")))
56#else
57#  define _CoreExport
58#endif
59
60
61//-----------------------------------------------------------------------
62// Forward declarations
63//-----------------------------------------------------------------------
64class SignalHandler;
65
66namespace orxonox
67{
68  namespace XMLPort
69  {
70    enum Mode
71    {
72      LoadObject,
73      SaveObject
74    };
75  }
76
77  namespace KeybindMode
78  {
79    enum Enum
80    {
81      OnPress,
82      OnHold,
83      OnRelease,
84      None
85    };
86  };
87
88  typedef std::string LanguageEntryLabel;
89
90  class ArgumentCompleter;
91  class ArgumentCompletionListElement;
92  class BaseFactory;
93  class BaseMetaObjectListElement;
94  class BaseObject;
95  template <class T>
96  class ClassFactory;
97  template <class T>
98  class ClassIdentifier;
99  class ClassTreeMask;
100  class ClassTreeMaskIterator;
101  class ClassTreeMaskNode;
102  class CommandEvaluation;
103  class CommandExecutor;
104  class ConfigFile;
105  class ConfigFileEntry;
106  class ConfigFileEntryComment;
107  class ConfigFileEntryValue;
108  class ConfigFileManager;
109  class ConfigFileSection;
110  class ConfigValueContainer;
111  class ConsoleCommand;
112  class Core;
113  class Error;
114  class Executor;
115  template <class T>
116  class ExecutorMember;
117  class ExecutorStatic;
118  class Factory;
119  class Functor;
120  template <class T>
121  class FunctorMember;
122  class FunctorStatic;
123  class Identifier;
124  class IRC;
125  template <class T>
126  class Iterator;
127  class IteratorBase;
128  class Language;
129  class LanguageEntry;
130  class Level;
131  class Loader;
132  class MetaObjectList;
133  class MetaObjectListElement;
134  class Namespace;
135  class NamespaceNode;
136  template <class T>
137  class ObjectList;
138  class ObjectListBase;
139  class ObjectListBaseElement;
140  template <class T>
141  class ObjectListElement;
142  template <class T>
143  class ObjectListIterator;
144  class OrxonoxClass;
145  class Shell;
146  class ShellListener;
147  template <class T>
148  class SubclassIdentifier;
149  class TclBind;
150  struct TclInterpreterBundle;
151  class TclThreadManager;
152  class Tickable;
153  template <class T, class O>
154  class XMLPortClassObjectContainer;
155  template <class T>
156  class XMLPortClassParamContainer;
157  class XMLPortObjectContainer;
158  class XMLPortParamContainer;
159
160  struct ObjectListBase::Export;
161
162  // input
163  //class GUIInputHandler;
164  class BaseCommand;
165  class BufferedParamCommand;
166  class Button;
167  class CalibratorCallback;
168  class HalfAxis;
169  class InputBuffer;
170  class InputManager;
171  class JoyStickHandler;
172  class MouseHandler;
173  class KeyBinder;
174  class KeyDetector;
175  class KeyHandler;
176  class ParamCommand;
177  class SimpleCommand;
178}
179
180#endif /* _CorePrereqs_H__ */
Note: See TracBrowser for help on using the repository browser.