src/Engine.hh
author morasa@smirgeline.hut.fi
Fri, 11 Sep 2009 16:45:04 +0300
branchnew-physics
changeset 447 fc9e4305fddf
parent 419 9cd4e54693b6
permissions -rw-r--r--
create new physics branch
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     1
#ifndef ENGINE_HH
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     2
#define ENGINE_HH
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     3
218
86d22fe82b30 add static Engine::graphicsEnabled function and disable player graphics loading when false
terom
parents: 186
diff changeset
     4
// forward-declare
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     5
class Engine;
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     6
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
     7
#include "GameState.hh"
417
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
     8
#include "Configuration.hh"
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
     9
#include "Logger.hh"
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    10
417
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    11
// forward-declare component pointer types
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    12
// XXX: move to some kind of Components.hh file?
419
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
    13
namespace graphics { class Graphics; class GameView; }
417
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    14
class NetworkServer;
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    15
class NetworkClientConnect;
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    16
class NetworkClient;
419
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
    17
class NetworkClientController;
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    18
283
7540b0859579 start adding some documentation, most core classes (outside of Network) are now doxygen-enabled
terom
parents: 233
diff changeset
    19
/**
7540b0859579 start adding some documentation, most core classes (outside of Network) are now doxygen-enabled
terom
parents: 233
diff changeset
    20
 * This is the core class that glues all the other components together and runs the main loop
7540b0859579 start adding some documentation, most core classes (outside of Network) are now doxygen-enabled
terom
parents: 233
diff changeset
    21
 */
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    22
class Engine {
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    23
    private:
418
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    24
        /** The game's terrain */
408
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
    25
        Terrain *terrain;
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    26
418
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    27
        /** The game's state */
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    28
        GameState *game_state;
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    29
        
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    30
        /** The graphics+input component */
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    31
        graphics::Graphics *graphics;
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    32
        
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    33
        /** Network server */
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    34
        NetworkServer *net_server;
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    35
418
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    36
        /** Network client connector */
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    37
        NetworkClientConnect *net_client_connect;
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    38
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    39
        /** Network client, currently unused */
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    40
        NetworkClient *net_client;
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    41
419
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
    42
        /** The GameView, if open */
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
    43
        graphics::GameView *game_view;
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
    44
418
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    45
        /** Is the mainloop still running? */
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    46
        bool is_running;
418
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    47
        
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    48
        /** Used to load ClanLib resources */
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    49
        CL_ResourceManager resources;
218
86d22fe82b30 add static Engine::graphicsEnabled function and disable player graphics loading when false
terom
parents: 186
diff changeset
    50
418
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    51
        /** *Global* log level */
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    52
        static LogLevel log_level;
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    53
    
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    54
    public:    
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    55
        // default constructor
418
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
    56
        Engine (const EngineConfig &config);
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    57
408
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
    58
        /**
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
    59
         * Setup game world using the given terrain, returning the new GameState
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
    60
         */
419
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
    61
        void setupGame (Terrain *terrain);
408
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
    62
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
    63
        /**
409
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    64
         * Setup game world using given terrain configuration
408
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
    65
         */
409
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    66
        void setupGame (const TerrainConfig &config);
408
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
    67
409
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    68
        /**
417
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    69
         * Enable graphics. 
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    70
         *
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    71
         * Requires: GRAPHICS_ENABLED
409
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    72
         */
417
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    73
        void setupGraphics (const DisplayConfig &config);
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    74
        
409
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    75
        /**
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    76
         * Setup server, must call setupGame first
417
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    77
         *
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    78
         * Requires: NETWORK_ENABLED
409
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    79
         */
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    80
        void setupNetworkServer (const std::string &listen_port);
409
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    81
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    82
        /**
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    83
         * Setup client, do *not* call setupGame, configuration comes from the server
417
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    84
         *
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
    85
         * Requires: NETWORK_ENABLED
409
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    86
         */
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    87
        void setupNetworkClient (const std::string &connect_host, const std::string &connect_port);
409
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    88
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    89
        /**
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    90
         * Setup singleplayer, must call setupGame first
1a03ff151abc add --terrain-seed and --terrain-size arguments, plus bugfixes
Tero Marttila <terom@fixme.fi>
parents: 408
diff changeset
    91
         */
447
fc9e4305fddf create new physics branch
morasa@smirgeline.hut.fi
parents: 419
diff changeset
    92
        void setupSinglePlayer (void);
fc9e4305fddf create new physics branch
morasa@smirgeline.hut.fi
parents: 419
diff changeset
    93
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    94
        
408
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
    95
        /**
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
    96
         * Run the game main loop. This will not return until the game aborts due to an error, or someone calls stop().
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
    97
         */
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
    98
        void run (void);
408
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
    99
        
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
   100
        /**
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
   101
         * Terminate the main loop, causing run() to return once this loop iteration is finished
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
   102
         */
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
   103
        void stop (void);
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
   104
408
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
   105
    private:
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
   106
        /**
417
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
   107
         * Puts graphics into GameView mode, using our GameState and the given player
408
e6cfc44266af reorganize Terrain/PhysicsWorld/GameState/Engine to use NetworkClientConnect, and hence handle the connection process asynchronously, and finally properly implement receiving the terrain data from the server
Tero Marttila <terom@fixme.fi>
parents: 389
diff changeset
   108
         */
417
c503e0c6a740 support for building without Network/Graphics, although the disable-graphics case is kind of hackish still
Tero Marttila <terom@fixme.fi>
parents: 411
diff changeset
   109
        void startGameView (LocalPlayer *player);
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
   110
419
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   111
    protected:
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   112
        friend class NetworkClientConnect;
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   113
        friend class NetworkClientController;
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   114
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   115
        /**
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   116
         * Interface for NetworkClient to use once it has connected
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   117
         */
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   118
        GameState& onNetworkClientConnected (Terrain *terrain);
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   119
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   120
        /**
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   121
         * Interface for NetworkClient to use once it has set up the player
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   122
         */
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   123
        void onNetworkClientPlayer (LocalPlayer *player);
9cd4e54693b6 fix Engine <-> NetworkClient interaction
Tero Marttila <terom@fixme.fi>
parents: 418
diff changeset
   124
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
   125
    public:
418
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   126
        /**
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   127
         * Get a pointer to our resource manager, please don't break it.
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   128
         *
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   129
         * Guaranteed to never be NULL
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   130
         */
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   131
        CL_ResourceManager* getResourceManager (void) { return &resources; }
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   132
        
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   133
        /**
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   134
         * Log output, see Logger for more info
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   135
         *
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   136
         * @see Logger
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   137
         */
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   138
        static inline Logger log (LogLevel level, const char *type) {
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   139
            return Logger(level <= WARN ? std::cerr : std::cout, level, type, log_level);
194bc810a570 add --log-level option, improve Config/Logger documentation, fix NETWORK_EANBLED typos in Engine
Tero Marttila <terom@fixme.fi>
parents: 417
diff changeset
   140
        }
185
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
   141
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
   142
};
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
   143
25becd2cb026 that's not a prototype anymore... at least it shouldn't be
terom
parents:
diff changeset
   144
#endif /* ENGINE_HH */