Show
Ignore:
Timestamp:
09/03/10 00:25:58 (21 months ago)
Author:
Carsten
Message:

Revision of Console code:

  • New "composite console" is the new default console, making it easy to add logging into a file and the graphical console during init, and making it unnecessary to reset the console pointer in DLLs that have been initialized before the graphical console.
  • Replaced several old/obsolete printf-statements (in the renderer DLLs) with their proper Console->Print() counterparts.
  • Put the Lua bindings to the global Console into separate files. This way the DLLs can include Console.hpp without being forced to link the Lua libraries in.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • cafu/trunk/Libs/ConsoleCommands/Console.hpp

    r136 r149  
    2222*/ 
    2323 
    24 /***************/ 
    25 /*** Console ***/ 
    26 /***************/ 
    27  
    2824#ifndef _CF_CONSOLE_HPP_ 
    2925#define _CF_CONSOLE_HPP_ 
    3026 
    3127#include <string> 
    32  
    33 struct lua_State; 
    3428 
    3529 
     
    4741 
    4842        // Methods for console output. 
    49         // TODO: These methods could also have a signature like (const char* s="", ...) directly, see GuiSys/Gui.hpp for an example!! 
    50         //       Much better of course would be to implement operator <<, as with std::cout. 
    5143        virtual void Print(const std::string& s)=0;      ///< Print message to console. 
    5244        virtual void DevPrint(const std::string& s)=0;   ///< Print dev message to console. 
    5345        virtual void Warning(const std::string& s)=0;    ///< Print warning to console. 
    5446        virtual void DevWarning(const std::string& s)=0; ///< Print dev warning to console. 
    55  
    56  
    57         /// Registers the methods of this interface with LuaState as a Lua module as described in the PiL2 book, chapter 26.2. 
    58         /// The key idea is that all methods are called via the global Console variable defined below, 
    59         /// and therefore we may consider them as a collection of C-style functions (no OO involved), 
    60         /// so that putting them in a Lua table as described in chapter 26 of the PiL2 book is straightforward. 
    61         static void RegisterLua(lua_State* LuaState); 
    6247    }; 
    6348