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 copied

Legend:

Unmodified
Added
Removed
  • cafu/trunk/Libs/ConsoleCommands/Console_Lua.cpp

    r36 r149  
    2222*/ 
    2323 
     24#include "Console_Lua.hpp" 
    2425#include "Console.hpp" 
    2526 
     
    2829    #include <lua.h> 
    2930    #include <lauxlib.h> 
    30 } 
    31  
    32 #if defined(_WIN32) && defined (_MSC_VER) 
    33     #if (_MSC_VER<1300) 
    34         #define vsnprintf _vsnprintf 
    35         #define for if (false) ; else for 
    36     #endif 
    37 #endif 
    38  
    39  
    40 std::string cf::va(const char* FormatString, ...) 
    41 { 
    42     va_list ArgList; 
    43     char    Buffer[1024]; 
    44  
    45     if (!FormatString) return ""; 
    46  
    47     va_start(ArgList, FormatString); 
    48     vsnprintf(Buffer, 1024-1, FormatString, ArgList); 
    49     Buffer[1024-1]=0; 
    50     va_end(ArgList); 
    51  
    52     return Buffer; 
    5331} 
    5432 
     
    194172 
    195173 
    196 void cf::ConsoleI::RegisterLua(lua_State* LuaState) 
     174void cf::Console_RegisterLua(lua_State* LuaState) 
    197175{ 
    198176    static const luaL_Reg ConsoleFunctions[]=