Changeset 149

Show
Ignore:
Timestamp:
09/03/10 00:25:58 (17 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.
Location:
cafu/trunk
Files:
3 added
22 modified
1 copied

Legend:

Unmodified
Added
Removed
  • cafu/trunk/Ca3DE/AppCafu.cpp

    r146 r149  
    2727#include "ClipSys/CollisionModelMan_impl.hpp" 
    2828#include "ConsoleCommands/ConsoleInterpreterImpl.hpp" 
     29#include "ConsoleCommands/ConsoleComposite.hpp" 
     30#include "ConsoleCommands/ConsoleFile.hpp" 
    2931#include "ConsoleCommands/ConsoleStringBuffer.hpp" 
    3032#include "ConsoleCommands/ConVar.hpp" 
     
    4850// For each interface that is globally available to the application, 
    4951// provide a definition for the pointer instance and have it point to an implementation. 
    50 static cf::ConsoleStringBufferT ConsoleStringBuffer; 
    51 cf::ConsoleI* Console=&ConsoleStringBuffer; 
    52  
    53 // static cf::ConsoleFileT ConsoleFile("console.log"); 
    54 // cf::ConsoleI* Console=&ConsoleFile; 
    55  
    56 static cf::FileSys::FileManImplT FileManImpl; 
    57 cf::FileSys::FileManI* cf::FileSys::FileMan=&FileManImpl; 
    58  
    59 static cf::ClipSys::CollModelManImplT CCM; 
    60 cf::ClipSys::CollModelManI* cf::ClipSys::CollModelMan=&CCM; 
    61  
    62 static ConsoleInterpreterImplT ConInterpreterImpl; 
    63 ConsoleInterpreterI* ConsoleInterpreter=&ConInterpreterImpl;        // TODO: Put it into a proper namespace. 
    64  
    65 static MaterialManagerImplT MaterialManagerImpl; 
    66 MaterialManagerI* MaterialManager=&MaterialManagerImpl;             // TODO: Put it into a proper namespace. 
    67  
    68 static SoundShaderManagerImplT SoundShaderManagerImpl; 
    69 SoundShaderManagerI* SoundShaderManager=&SoundShaderManagerImpl;    // TODO: Put it into a proper namespace. 
     52static cf::CompositeConsoleT s_CompositeConsole; 
     53cf::ConsoleI* Console=&s_CompositeConsole; 
     54 
     55static cf::FileSys::FileManImplT s_FileManImpl; 
     56cf::FileSys::FileManI* cf::FileSys::FileMan=&s_FileManImpl; 
     57 
     58static cf::ClipSys::CollModelManImplT s_CCM; 
     59cf::ClipSys::CollModelManI* cf::ClipSys::CollModelMan=&s_CCM; 
     60 
     61static ConsoleInterpreterImplT s_ConInterpreterImpl; 
     62ConsoleInterpreterI* ConsoleInterpreter=&s_ConInterpreterImpl;      // TODO: Put it into a proper namespace. 
     63 
     64static MaterialManagerImplT s_MaterialManagerImpl; 
     65MaterialManagerI* MaterialManager=&s_MaterialManagerImpl;           // TODO: Put it into a proper namespace. 
     66 
     67static SoundShaderManagerImplT s_SoundShaderManagerImpl; 
     68SoundShaderManagerI* SoundShaderManager=&s_SoundShaderManagerImpl;  // TODO: Put it into a proper namespace. 
    7069 
    7170// static WinSockT WinSock;     // This unfortunately can throw. 
     
    167166AppCafuT::AppCafuT() 
    168167    : wxApp(), 
     168      m_ConBuffer(new cf::ConsoleStringBufferT()), 
     169      m_ConFile(NULL), 
    169170      m_IsCustomVideoMode(false), 
    170171      m_MainFrame(NULL) 
    171172{ 
     173    s_CompositeConsole.Attach(m_ConBuffer); 
     174 
    172175    // All global convars and confuncs have registered themselves in linked lists. 
    173176    // Register them with the console interpreter now. 
     
    184187 
    185188    Console->Print("Cafu Engine, "__DATE__"\n"); 
     189} 
     190 
     191 
     192AppCafuT::~AppCafuT() 
     193{ 
     194    s_CompositeConsole.Detach(m_ConFile); 
     195    delete m_ConFile; 
     196 
     197    s_CompositeConsole.Detach(m_ConBuffer); 
     198    delete m_ConBuffer; 
     199} 
     200 
     201 
     202cf::CompositeConsoleT& AppCafuT::GetConComposite() const 
     203{ 
     204    return s_CompositeConsole; 
    186205} 
    187206 
     
    373392    Parser.AddOption("clPlayerName",   "", "Player name ["+Options_DeathMatchPlayerName.GetValueString()+"].", wxCMD_LINE_VAL_STRING); 
    374393    Parser.AddOption("clModelName",    "", "Name of the players model ["+Options_DeathMatchModelName.GetValueString()+"].", wxCMD_LINE_VAL_STRING); 
     394    Parser.AddOption("log",            "", "Logs all console message into the specified file."); 
    375395    Parser.AddParam("worldname", wxCMD_LINE_VAL_STRING, wxCMD_LINE_PARAM_OPTIONAL); 
    376396 
     
    403423    if (Parser.Found("clModelName",   &s)) Options_DeathMatchModelName=s.ToStdString(); 
    404424 
     425    if (Parser.Found("log", &s) && m_ConFile==NULL) 
     426    { 
     427        m_ConFile=new cf::ConsoleFileT(s.ToStdString()); 
     428        m_ConFile->Print(m_ConBuffer->GetBuffer()); 
     429 
     430        s_CompositeConsole.Attach(m_ConFile); 
     431    } 
     432 
    405433    if (!Parser.Found("svWorld") && Parser.GetParamCount()==1) 
    406434        Options_ServerWorldName=Parser.GetParam(0).ToStdString(); 
  • cafu/trunk/Ca3DE/AppCafu.hpp

    r136 r149  
    3939 
    4040 
     41namespace cf { class CompositeConsoleT; } 
     42namespace cf { class ConsoleFileT; } 
     43namespace cf { class ConsoleStringBufferT; } 
    4144class MainFrameT; 
    4245 
     
    4851 
    4952    AppCafuT(); 
     53    ~AppCafuT(); 
     54 
     55    /// Returns the composite console that is also available via the global Console pointer. 
     56    cf::CompositeConsoleT& GetConComposite() const; 
     57 
     58    /// Returns the console that buffers all output. 
     59    cf::ConsoleStringBufferT& GetConBuffer() const { return *m_ConBuffer; } 
     60 
     61    // /// Returns the console that logs all output into a file (can be NULL if not used). 
     62    // cf::ConsoleFileT& GetConFile() const { return *m_ConFile; } 
    5063 
    5164    /// Returns whether we successfully set a custom video mode (screen resolution) during initialization. 
     
    6881    bool OnCmdLineParsed(wxCmdLineParser& Parser); 
    6982 
    70     bool        m_IsCustomVideoMode;  ///< Whether we successfully set a custom video mode (screen resolution) during initialization. 
    71     wxVideoMode m_CurrentMode;        ///< The video mode that we're currently using. 
    72     MainFrameT* m_MainFrame;          ///< The Cafu application main frame. 
     83    cf::ConsoleStringBufferT* m_ConBuffer;          ///< The console that buffers all output. 
     84    cf::ConsoleFileT*         m_ConFile;            ///< The console that logs all output into a file (can be NULL if not used). 
     85    bool                      m_IsCustomVideoMode;  ///< Whether we successfully set a custom video mode (screen resolution) during initialization. 
     86    wxVideoMode               m_CurrentMode;        ///< The video mode that we're currently using. 
     87    MainFrameT*               m_MainFrame;          ///< The Cafu application main frame. 
    7388}; 
    7489 
  • cafu/trunk/Ca3DE/MainCanvas.cpp

    r136 r149  
    3333#include "ConsoleCommands/Console.hpp" 
    3434#include "ConsoleCommands/ConsoleInterpreter.hpp" 
     35#include "ConsoleCommands/ConsoleComposite.hpp" 
    3536#include "ConsoleCommands/ConsoleStringBuffer.hpp" 
    3637#include "ConsoleCommands/ConVar.hpp" 
     
    119120      m_Server(NULL), 
    120121      m_SvGuiCallback(NULL), 
    121       m_PrevConsole(NULL), 
    122122      m_ConByGuiWin(NULL), 
    123123      m_Timer(), 
     
    136136    m_InitState=INIT_REQUIRED; 
    137137 
    138     if (Console==m_ConByGuiWin) 
    139     { 
    140         Console=m_PrevConsole; 
    141         m_PrevConsole=NULL; 
    142     } 
    143  
     138    wxGetApp().GetConComposite().Detach(m_ConByGuiWin); 
    144139    delete m_ConByGuiWin; 
    145140    m_ConByGuiWin=NULL; 
     
    436431    cf::GuiSys::WindowT* ConsoleWindow=ConsoleGui ? ConsoleGui->GetRootWindow()->Find("ConsoleOutput") : NULL; 
    437432 
     433    // Copy the previously collected console output to the new graphical console. 
    438434    m_ConByGuiWin=new cf::GuiSys::ConsoleByWindowT(ConsoleWindow); 
    439     m_PrevConsole=Console; 
    440     Console=m_ConByGuiWin; 
    441  
    442     // Copy the output to the previous console to the now current console. 
    443     cf::ConsoleStringBufferT* ConsoleSB=dynamic_cast<cf::ConsoleStringBufferT*>(m_PrevConsole); 
    444     if (ConsoleSB) Console->Print(ConsoleSB->GetBuffer()); 
     435    m_ConByGuiWin->Print(wxGetApp().GetConBuffer().GetBuffer()); 
     436    wxGetApp().GetConComposite().Attach(m_ConByGuiWin); 
    445437 
    446438    m_InitState=INIT_SUCCESS; 
  • cafu/trunk/Ca3DE/MainCanvas.hpp

    r136 r149  
    8686    ServerT*      m_Server; 
    8787    SvGuiCallbT*  m_SvGuiCallback; 
    88     cf::ConsoleI* m_PrevConsole; 
    8988    cf::ConsoleI* m_ConByGuiWin;    ///< This points to an instance of cf::GuiSys::ConsoleByWindowT. 
    9089    TimerT        m_Timer; 
  • cafu/trunk/Games/DeathMatch/Code/ScriptState.cpp

    r138 r149  
    2525#include "TypeSys.hpp" 
    2626#include "ConsoleCommands/Console.hpp" 
     27#include "ConsoleCommands/Console_Lua.hpp" 
    2728#include "ConsoleCommands/ConsoleInterpreter.hpp" 
    2829#include "ConsoleCommands/ConFunc.hpp" 
     
    6465 
    6566    // Load the console library. (Adds a global table with name "Console" to the LuaState with the functions of the ConsoleI interface.) 
    66     cf::ConsoleI::RegisterLua(LuaState); 
     67    cf::Console_RegisterLua(LuaState); 
    6768 
    6869    // Load the "ci" (console interpreter) library. (Adds a global table with name "ci" to the LuaState with (some of) the functions of the ConsoleInterpreterI interface.) 
  • cafu/trunk/Libs/ConsoleCommands/Console.cpp

    r36 r149  
    2323 
    2424#include "Console.hpp" 
    25  
    26 extern "C" 
    27 { 
    28     #include <lua.h> 
    29     #include <lauxlib.h> 
    30 } 
     25#include <stdarg.h> 
    3126 
    3227#if defined(_WIN32) && defined (_MSC_VER) 
     
    5247    return Buffer; 
    5348} 
    54  
    55  
    56 static int LuaConsole_Print(lua_State* LuaState) 
    57 { 
    58     const char* s=lua_tostring(LuaState, 1); 
    59  
    60     Console->Print(s!=NULL ? s : "[not a string]\n"); 
    61     return 0; 
    62 } 
    63  
    64  
    65 static int LuaConsole_DevPrint(lua_State* LuaState) 
    66 { 
    67     const char* s=lua_tostring(LuaState, 1); 
    68  
    69     Console->DevPrint(s!=NULL ? s : "[not a string]\n"); 
    70     return 0; 
    71 } 
    72  
    73  
    74 static int LuaConsole_Warning(lua_State* LuaState) 
    75 { 
    76     const char* s=lua_tostring(LuaState, 1); 
    77  
    78     Console->Warning(s!=NULL ? s : "[not a string]\n"); 
    79     return 0; 
    80 } 
    81  
    82  
    83 static int LuaConsole_DevWarning(lua_State* LuaState) 
    84 { 
    85     const char* s=lua_tostring(LuaState, 1); 
    86  
    87     Console->DevWarning(s!=NULL ? s : "[not a string]\n"); 
    88     return 0; 
    89 } 
    90  
    91  
    92 #ifdef _WIN32 
    93     #define WIN32_LEAN_AND_MEAN 
    94     #include <windows.h> 
    95     #undef FindWindow 
    96 #else 
    97     #include <cstring> 
    98     #include <dirent.h> 
    99 #endif 
    100  
    101 /// Returns an array (a table) with the file and directory entries of the given directory. 
    102 /// If the string "f" is passed as a second parameter, only entries of type file are returned, 
    103 /// if the string "d" is passed as a second parameter, only entries of type directory are returned, 
    104 /// all entries are returned in all other cases. 
    105 /// 
    106 /// TODO: This function should be implemented INDEPENDENTLY from the "Console" interface (i.e. elsewhere where 
    107 ///       it is a better topical fit), but for now the "Console" interface is the only interface that is included 
    108 ///       in all of our Lua instances (console interpreter, GUIs, map scripts, ...)! 
    109 /// IDEA: Can we make ConVars and ConFuncs directly available not only in the console Lua instance, but in arbitrary 
    110 ///       many Lua instances?? Then the GUI and map scripts could directly access ConVars and ConFuncs, too...! 
    111 ///       (And GetDir() would be a regular ConFunc.) 
    112 static int GetDir(lua_State* LuaState) 
    113 { 
    114     std::string DirName; 
    115     const char* DirFilter=NULL; 
    116  
    117     // // Support calling this function both as gui.GetDir(...) as well as gui:GetDir(...). 
    118     // if (lua_istable(LuaState, 1)) 
    119     // { 
    120     //     // It's called as gui:GetDir(...). 
    121     //     DirName  =luaL_checkstring(LuaState, 2); 
    122     //     DirFilter=lua_tostring(LuaState, 3); 
    123     // } 
    124     // else 
    125     { 
    126         // It's called as gui.GetDir(...). 
    127         DirName  =luaL_checkstring(LuaState, 1); 
    128         DirFilter=lua_tostring(LuaState, 2); 
    129     } 
    130  
    131     lua_newtable(LuaState); 
    132  
    133     if (DirName=="") return 1; 
    134  
    135 #ifdef _WIN32 
    136     WIN32_FIND_DATA FindFileData; 
    137     HANDLE          FindHandle=FindFirstFile((DirName+"\\*").c_str(), &FindFileData); 
    138     int             EntryCount=1;   // Lua array numbering starts per convention at 1. 
    139  
    140     if (FindHandle==INVALID_HANDLE_VALUE) return 1; 
    141  
    142     do 
    143     { 
    144         if (strcmp(FindFileData.cFileName, "." )==0) continue; 
    145         if (strcmp(FindFileData.cFileName, "..")==0) continue; 
    146  
    147         if (DirFilter!=NULL) 
    148         { 
    149             const bool IsDir=(FindFileData.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)!=0; 
    150  
    151             if (strcmp(DirFilter, "f")==0 &&  IsDir) continue; 
    152             if (strcmp(DirFilter, "d")==0 && !IsDir) continue; 
    153         } 
    154  
    155         lua_pushstring(LuaState, FindFileData.cFileName); 
    156         lua_rawseti(LuaState, -2, EntryCount++); 
    157     } 
    158     while (FindNextFile(FindHandle, &FindFileData)!=0); 
    159  
    160     if (GetLastError()!=ERROR_NO_MORE_FILES) Console->Warning("Error in GetDir() while enumerating directory entries.\n"); 
    161     FindClose(FindHandle); 
    162 #else 
    163     DIR* Dir=opendir(DirName.c_str()); 
    164     int  EntryCount=1;  // Lua array numbering starts per convention at 1. 
    165  
    166     if (!Dir) return 1; 
    167  
    168     for (dirent* DirEnt=readdir(Dir); DirEnt!=NULL; DirEnt=readdir(Dir)) 
    169     { 
    170         if (strcmp(DirEnt->d_name, "." )==0) continue; 
    171         if (strcmp(DirEnt->d_name, "..")==0) continue; 
    172  
    173         if (DirFilter!=NULL) 
    174         { 
    175             DIR* TempDir=opendir((DirName+"/"+DirEnt->d_name).c_str()); 
    176             bool IsDir=(TempDir!=NULL); 
    177  
    178             if (TempDir!=NULL) closedir(TempDir); 
    179  
    180             if (strcmp(DirFilter, "f")==0 &&  IsDir) continue; 
    181             if (strcmp(DirFilter, "d")==0 && !IsDir) continue; 
    182         } 
    183  
    184         // For portability, only the 'd_name' member of a 'dirent' may be accessed. 
    185         lua_pushstring(LuaState, DirEnt->d_name); 
    186         lua_rawseti(LuaState, -2, EntryCount++); 
    187     } 
    188  
    189     closedir(Dir); 
    190 #endif 
    191  
    192     return 1; 
    193 } 
    194  
    195  
    196 void cf::ConsoleI::RegisterLua(lua_State* LuaState) 
    197 { 
    198     static const luaL_Reg ConsoleFunctions[]= 
    199     { 
    200         { "Print",      LuaConsole_Print }, 
    201         { "DevPrint",   LuaConsole_DevPrint }, 
    202         { "Warning",    LuaConsole_Warning }, 
    203         { "DevWarning", LuaConsole_DevWarning }, 
    204         { "GetDir",     GetDir }, 
    205         { NULL, NULL } 
    206     }; 
    207  
    208     luaL_register(LuaState, "Console", ConsoleFunctions); 
    209     lua_pop(LuaState, 1);   // Remove the Console table from the stack (it was left there by the luaL_register() function). 
    210 } 
  • 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 
  • cafu/trunk/Libs/ConsoleCommands/ConsoleInterpreterImpl.cpp

    r136 r149  
    3232#include "ConVar.hpp" 
    3333#include "Console.hpp" 
     34#include "Console_Lua.hpp" 
    3435 
    3536extern "C" 
     
    7172 
    7273    // Load the console library. (Adds a global table with name "Console" to the LuaState with the functions of the ConsoleI interface.) 
    73     cf::ConsoleI::RegisterLua(LuaState); 
     74    cf::Console_RegisterLua(LuaState); 
    7475 
    7576 
  • 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[]= 
  • cafu/trunk/Libs/GuiSys/GuiImpl.cpp

    r136 r149  
    2727#include "WindowCreateParams.hpp" 
    2828#include "ConsoleCommands/Console.hpp" 
     29#include "ConsoleCommands/Console_Lua.hpp" 
    2930#include "ConsoleCommands/ConsoleInterpreter.hpp" 
    3031#include "MaterialSystem/Renderer.hpp" 
     
    8889 
    8990    // Load the console library. (Adds a global table with name "Console" to the LuaState with the functions of the ConsoleI interface.) 
    90     cf::ConsoleI::RegisterLua(LuaState); 
     91    cf::Console_RegisterLua(LuaState); 
    9192 
    9293    // Load the "ci" (console interpreter) library. (Adds a global table with name "ci" to the LuaState with (some of) the functions of the ConsoleInterpreterI interface.) 
  • cafu/trunk/Libs/MaterialSystem/MapComposition.cpp

    r51 r149  
    2727 
    2828#include <math.h> 
    29 #include <stdio.h> 
    3029 
    3130#include "MapComposition.hpp" 
     
    748747 
    749748        case HeightMapToNormalMap: 
    750         { 
    751             char hmScaleString[32]; 
    752  
    753             sprintf(hmScaleString, "%f", HeightScale); 
    754             return std::string("hm2nm(")+Child1->GetString()+", "+hmScaleString+")"; 
    755         } 
     749            return std::string("hm2nm(")+Child1->GetString()+", "+cf::va("%f", HeightScale)+")"; 
    756750 
    757751        case FlipNormalMapYAxis: 
  • cafu/trunk/Libs/MaterialSystem/MaterialManagerImpl.cpp

    r36 r149  
    4646#include "Expression.hpp" 
    4747#include "Material.hpp" 
     48#include "ConsoleCommands/Console.hpp" 
    4849#include "TextParser/TextParser.hpp" 
    4950 
     
    202203                if (!T) 
    203204                { 
    204                     printf("Error parsing %s near %s at input byte %lu.\n", FileName.c_str(), Token.c_str(), TextParser.GetReadPosByte()); 
     205                    Console->Print("Error parsing "+FileName+" near "+Token+cf::va(" at input byte %lu.\n", TextParser.GetReadPosByte())); 
    205206                    break; 
    206207                } 
     
    226227                else 
    227228                { 
    228                     printf("File %s, material \"%s\": duplicate definition (ignored).\n", FileName.c_str(), NewMat->Name.c_str()); 
     229                    Console->Print("File " + FileName + ", material \"" + NewMat->Name + "\": duplicate definition (ignored).\n"); 
    229230                    delete NewMat; 
    230231                } 
     
    234235    catch (const TextParserT::ParseError&) 
    235236    { 
    236         printf("Error parsing %s at input byte %lu.\n", FileName.c_str(), TextParser.GetReadPosByte()); 
     237        Console->Print("Error parsing "+FileName+cf::va(" at input byte %lu.\n", TextParser.GetReadPosByte())); 
    237238    } 
    238239 
     
    339340MaterialT* MaterialManagerImplT::GetMaterial(const std::string& MaterialName) 
    340341{ 
    341     // Note that I'm *not* just writing   return Materials[MaterialName]   here, because that 
     342    // Note that we are *not* just writing   return Materials[MaterialName]   here, because that 
    342343    // would implicitly create a NULL entry for every MaterialName that does not actually exist. 
    343344    std::map<std::string, MaterialT*>::const_iterator It=Materials.find(MaterialName); 
     
    345346    if (It!=Materials.end()) return It->second; 
    346347 
    347     printf("%s (%u): GetMaterial(\"%s\") returns NULL.\n", __FILE__, __LINE__, MaterialName.c_str()); 
     348    Console->Print(cf::va("%s (%u): ", __FILE__, __LINE__)+"GetMaterial(\""+MaterialName+"\") returns NULL.\n"); 
    348349    return NULL; 
    349350} 
  • cafu/trunk/Libs/MaterialSystem/RendererARBprogs/RendererImpl.cpp

    r36 r149  
    4848 
    4949#include "../Common/OpenGLEx.hpp" 
     50#include "ConsoleCommands/Console.hpp" 
    5051#include "Templates/Array.hpp" 
    5152 
     
    115116    { 
    116117#ifdef DEBUG 
    117         printf("\n%s (%u): glGetError() returned error %lu (0x%X).\n", __FILE__, __LINE__, (unsigned long)LastError, LastError); 
     118        Console->Print(cf::va("\n%s (%u): glGetError() returned error %lu (0x%X).\n", __FILE__, __LINE__, (unsigned long)LastError, LastError)); 
    118119#endif 
    119120        return false; 
     
    463464 
    464465    if (Error!=GL_NO_ERROR) 
    465         printf("glGetError()==%i\n", Error); 
     466        Console->Print(cf::va("glGetError()==%i\n", Error)); 
    466467#endif 
    467468} 
     
    472473void RendererImplT::EndFrame() 
    473474{ 
    474     // printf("%4lu", ShaderChangeCounter); 
     475    // Console->Print(cf::va("%4lu", ShaderChangeCounter)); 
    475476    // static int LineWrap=0; 
    476477    // LineWrap++; 
    477     // if (LineWrap==20) { printf("\n"); LineWrap=0; } 
     478    // if (LineWrap==20) { Console->Print("\n"); LineWrap=0; } 
    478479} 
    479480 
     
    549550    } 
    550551 
    551     // printf("%lu textures pre-cached.\n", TexMapRepository.Size()); 
     552    // Console->Print(cf::va("%lu textures pre-cached.\n", TexMapRepository.Size())); 
    552553} 
    553554 
  • cafu/trunk/Libs/MaterialSystem/RendererARBprogs/Shaders/_CommonHelpers.cpp

    r138 r149  
    2828#include "_CommonHelpers.hpp" 
    2929#include "../../Common/OpenGLEx.hpp" 
     30#include "ConsoleCommands/Console.hpp" 
    3031#include <stdio.h> 
    3132#include <string.h> 
     
    6465    if (ErrorID!=GL_NO_ERROR || ErrorPos!=-1 || ErrorStringLen>0) 
    6566    { 
    66         printf("%s\n\nProblem detected:\nglGetError() == %i,\nerror position: %i,\nerror string: %s\n", ProgramCode, ErrorID, ErrorPos, ErrorString); 
     67        Console->Print(cf::va("%s\n\nProblem detected:\nglGetError() == %i,\nerror position: %i,\nerror string: %s\n", ProgramCode, ErrorID, ErrorPos, ErrorString)); 
    6768 
    6869        FILE* ErrorFile=fopen("ProgError.txt", "a"); 
  • cafu/trunk/Libs/MaterialSystem/RendererCgARB1/RendererImpl.cpp

    r42 r149  
    4848 
    4949#include "../Common/OpenGLEx.hpp" 
     50#include "ConsoleCommands/Console.hpp" 
    5051#include "Templates/Array.hpp" 
    5152 
     
    455456 
    456457    if (Error!=GL_NO_ERROR) 
    457         printf("glGetError()==%i\n", Error); 
     458        Console->Print(cf::va("glGetError()==%i\n", Error)); 
    458459#endif 
    459460} 
     
    464465void RendererImplT::EndFrame() 
    465466{ 
    466     // printf("%4lu", ShaderChangeCounter); 
     467    // Console->Print(cf::va("%4lu", ShaderChangeCounter)); 
    467468    // static int LineWrap=0; 
    468469    // LineWrap++; 
    469     // if (LineWrap==20) { printf("\n"); LineWrap=0; } 
     470    // if (LineWrap==20) { Console->Print("\n"); LineWrap=0; } 
    470471} 
    471472 
     
    541542    } 
    542543 
    543     // printf("%lu textures pre-cached.\n", TexMapRepository.Size()); 
     544    // Console->Print(cf::va("%lu textures pre-cached.\n", TexMapRepository.Size())); 
    544545} 
    545546 
  • cafu/trunk/Libs/MaterialSystem/RendererCgARB1/Shaders/_CommonCgHelpers.cpp

    r36 r149  
    2727 
    2828#include "_CommonCgHelpers.hpp" 
     29#include "ConsoleCommands/Console.hpp" 
     30 
    2931#include <stdio.h> 
    3032 
     
    4143        CGerror err      =cgGetError(); 
    4244 
    43         printf("ERROR: Unable to create Cg program: %s\n", cgGetErrorString(err)); 
     45        Console->Print(std::string("ERROR: Unable to create Cg program: ")+cgGetErrorString(err)+"\n"); 
    4446        if (ErrorFile) fprintf(ErrorFile, "ERROR: Unable to create Cg program: %s\n", cgGetErrorString(err)); 
    4547 
    4648        const char* LastListing=cgGetLastListing(CgContext); 
    47         if (LastListing) printf("LAST LISTING:\n%s\n", LastListing); 
     49        if (LastListing) Console->Print(std::string("LAST LISTING:\n")+LastListing+"\n"); 
    4850        if (LastListing && ErrorFile) fprintf(ErrorFile, "LAST LISTING:\n%s\n", LastListing); 
    4951 
     
    5860    { 
    5961        // This should never happen, as we have already made sure elsewhere that the desired profile is supported! 
    60         printf("ERROR: Unable to load Cg program: %s\n", cgGetErrorString(err)); 
     62        Console->Print(std::string("ERROR: Unable to load Cg program: ")+cgGetErrorString(err)+"\n"); 
    6163        return NULL; 
    6264    } 
  • cafu/trunk/Libs/MaterialSystem/RendererCgNV2X/RendererImpl.cpp

    r36 r149  
    441441 
    442442 
    443 // #include <stdio.h> 
    444  
    445443void RendererImplT::EndFrame() 
    446444{ 
    447     // printf("%4lu", ShaderChangeCounter); 
     445    // Console->Print(cf::va("%4lu", ShaderChangeCounter)); 
    448446    // static int LineWrap=0; 
    449447    // LineWrap++; 
    450     // if (LineWrap==20) { printf("\n"); LineWrap=0; } 
     448    // if (LineWrap==20) { Console->Print("\n"); LineWrap=0; } 
    451449} 
    452450 
  • cafu/trunk/Libs/MaterialSystem/RendererCgNV2X/Shaders/_CommonCgHelpers.cpp

    r36 r149  
    2727 
    2828#include "_CommonCgHelpers.hpp" 
     29#include "ConsoleCommands/Console.hpp" 
     30 
    2931#include <stdio.h> 
    3032 
     
    4143        CGerror err      =cgGetError(); 
    4244 
    43         printf("ERROR: Unable to create Cg program: %s\n", cgGetErrorString(err)); 
     45        Console->Print(std::string("ERROR: Unable to create Cg program: ")+cgGetErrorString(err)+"\n"); 
    4446        if (ErrorFile) fprintf(ErrorFile, "ERROR: Unable to create Cg program: %s\n", cgGetErrorString(err)); 
    4547 
    4648        const char* LastListing=cgGetLastListing(CgContext); 
    47         if (LastListing) printf("LAST LISTING:\n%s\n", LastListing); 
     49        if (LastListing) Console->Print(std::string("LAST LISTING:\n")+LastListing+"\n"); 
    4850        if (LastListing && ErrorFile) fprintf(ErrorFile, "LAST LISTING:\n%s\n", LastListing); 
    4951 
     
    5860    { 
    5961        // This should never happen, as we have already made sure elsewhere that the desired profile is supported! 
    60         printf("ERROR: Unable to load Cg program: %s\n", cgGetErrorString(err)); 
     62        Console->Print(std::string("ERROR: Unable to load Cg program: ")+cgGetErrorString(err)+"\n"); 
    6163        return NULL; 
    6264    } 
  • cafu/trunk/Libs/MaterialSystem/RendererOpenGL12/RendererImpl.cpp

    r51 r149  
    4141 
    4242#include "../Common/OpenGLEx.hpp" 
     43#include "ConsoleCommands/Console.hpp" 
    4344#include "Templates/Array.hpp" 
    4445 
     
    8990    // glGetError();   // Clear the error flag manually (will set error GL_INVALID_OPERATION on invalid RC). 
    9091#ifdef DEBUG 
    91     printf("\n%s (%u): Entering RendererImplT::IsSupported().\n", __FILE__, __LINE__); 
     92    Console->Print(cf::va("\n%s (%u): Entering RendererImplT::IsSupported().\n", __FILE__, __LINE__)); 
    9293#endif 
    9394    GLenum LastError=glGetError(); 
     
    9596    { 
    9697#ifdef DEBUG 
    97         printf("%s (%u): glGetError() returned error %lu (0x%X).\n", __FILE__, __LINE__, (unsigned long)LastError, LastError); 
     98        Console->Print(cf::va("%s (%u): glGetError() returned error %lu (0x%X).\n", __FILE__, __LINE__, (unsigned long)LastError, LastError)); 
    9899#endif 
    99100        return false; 
     
    105106 
    106107#ifdef DEBUG 
    107     printf("%s (%u): GL_VERSION string is \"%s\".\n", __FILE__, __LINE__, Version==NULL ? "NULL" : Version); 
     108    Console->Print(cf::va("%s (%u): GL_VERSION string is \"%s\".\n", __FILE__, __LINE__, Version==NULL ? "NULL" : Version)); 
    108109#endif 
    109110    if (Version==NULL) return false;                    // This is another way to see if the RC is valid. 
     
    113114    cf::Init_GL_ARB_multitexture(); 
    114115#ifdef DEBUG 
    115     printf("%s (%u): GL_ARB_multitexture_AVAIL==%u.\n", __FILE__, __LINE__, cf::GL_ARB_multitexture_AVAIL); 
     116    Console->Print(cf::va("%s (%u): GL_ARB_multitexture_AVAIL==%u.\n", __FILE__, __LINE__, cf::GL_ARB_multitexture_AVAIL)); 
    116117#endif 
    117118    if (!cf::GL_ARB_multitexture_AVAIL) return false;       // Require the GL_ARB_multitexture extension. 
  • cafu/trunk/Libs/PlatformAux.cpp

    r36 r149  
    2121================================================================================= 
    2222*/ 
    23  
    24 /********************************/ 
    25 /*** Platform Auxiliary Stuff ***/ 
    26 /********************************/ 
    2723 
    2824#include "PlatformAux.hpp" 
     
    119115            std::string DLLName=Path+"/"+FindFileData.cFileName; 
    120116#ifdef SCONS_BUILD_DIR 
    121             const std::string Suffix =".dll"; 
    122 #else 
    123             const std::string Suffix =GetEnvFileSuffix()+".dll"; // printf("Suffix %s, DLLName %s\n", Suffix.c_str(), DLLName.c_str()); 
     117            const std::string Suffix=".dll"; 
     118#else 
     119            const std::string Suffix=GetEnvFileSuffix()+".dll"; // Console->Print("Suffix "+Suffix+", DLLName "+DLLName+"\n"); 
    124120#endif 
    125121 
     
    178174        // Please refer to the man page of dlopen for more details. 
    179175        OutRendererDLL=dlopen(DLLName.c_str(), RTLD_NOW); 
    180         if (!OutRendererDLL) printf("\"%s\", ", dlerror()); 
    181     #endif 
    182  
    183     if (!OutRendererDLL) { printf("FAILED - could not load the library at %s.\n", DLLName.c_str()); return NULL; } 
     176        if (!OutRendererDLL) Console->Print(std::string(dlerror()) + ", "); 
     177    #endif 
     178 
     179    if (!OutRendererDLL) { Console->Print("FAILED - could not load the library at "+DLLName+".\n"); return NULL; } 
    184180 
    185181 
     
    192188    #endif 
    193189 
    194     if (!GetRendererFunc) { printf("FAILED - could not get the address of the GetRenderer() function.\n"); FreeLibrary(OutRendererDLL); return NULL; } 
     190    if (!GetRendererFunc) { Console->Print("FAILED - could not get the address of the GetRenderer() function.\n"); FreeLibrary(OutRendererDLL); return NULL; } 
    195191 
    196192 
     
    201197    MatSys::RendererI* Renderer=GetRendererFunc(Console, cf::FileSys::FileMan); 
    202198 
    203     if (!Renderer) { printf("FAILED - could not get the renderer.\n"); FreeLibrary(OutRendererDLL); return NULL; } 
    204     if (!Renderer->IsSupported()) { printf("FAILED - renderer says it's not supported.\n"); FreeLibrary(OutRendererDLL); return NULL; } 
     199    if (!Renderer) { Console->Print("FAILED - could not get the renderer.\n"); FreeLibrary(OutRendererDLL); return NULL; } 
     200    if (!Renderer->IsSupported()) { Console->Print("FAILED - renderer says it's not supported.\n"); FreeLibrary(OutRendererDLL); return NULL; } 
    205201 
    206202    return Renderer; 
     
    221217    ArrayT<std::string> DLLNames; 
    222218 
    223     printf("\n"); 
    224     printf("Scanning cwd for all available renderers...\n"); 
     219    Console->Print("\n"); 
     220    Console->Print("Scanning cwd for all available renderers...\n"); 
    225221    GetDLLs(".", "Renderer", DLLNames); 
    226222 
    227223    if (DLLNames.Size()==0) 
    228224    { 
    229         printf("Scanning %s for all available renderers...\n", Path.c_str()); 
     225        Console->Print("Scanning "+Path+" for all available renderers...\n"); 
    230226        GetDLLs(Path, "Renderer", DLLNames); 
    231227    } 
     
    237233    for (unsigned long DLLNr=0; DLLNr<DLLNames.Size(); DLLNr++) 
    238234    { 
    239         printf("%s ... ", DLLNames[DLLNr].c_str()); 
     235        Console->Print(DLLNames[DLLNr]+" ... "); 
    240236 
    241237        HMODULE RendererDLL; 
     
    251247        if (PrefNr<10) 
    252248        { 
    253             // I don't want the Null renderer to be possibly selected for client rendering 
     249            // We don't want the Null renderer to be possibly selected for client rendering 
    254250            // (which can happen in the presence of other errors). 
    255251            // It would only confuse and worry users to sit in front of a black, apparently frozen screen. 
    256             printf("SUCCESS - but excluded from auto-selection (Pref# %i).\n", PrefNr); 
     252            Console->Print(cf::va("SUCCESS - but excluded from auto-selection (Pref# %i).\n", PrefNr)); 
    257253            continue; 
    258254        } 
     
    260256        if (PrefNr>BestPrefNr) 
    261257        { 
    262             printf("SUCCESS - %s renderer (Pref# %i).\n", BestPrefNr<0 ? "first supported" : "higher preference", PrefNr); 
     258            Console->Print(cf::va("SUCCESS - %s renderer (Pref# %i).\n", BestPrefNr<0 ? "first supported" : "higher preference", PrefNr)); 
    263259 
    264260            BestDLLIndex=DLLNr; 
    265261            BestPrefNr  =PrefNr; 
    266262        } 
    267         else printf("SUCCESS - but no higher preference (Pref# %i).\n", PrefNr); 
     263        else Console->Print(cf::va("SUCCESS - but no higher preference (Pref# %i).\n", PrefNr)); 
    268264    } 
    269265 
    270266    if (BestPrefNr==-1) 
    271267    { 
    272         printf("No renderer qualified.\n"); 
     268        Console->Print("No renderer qualified.\n"); 
    273269        return NULL; 
    274270    } 
    275271 
    276     printf("Reloading previously auto-selected renderer %s ... \n", DLLNames[BestDLLIndex].c_str()); 
     272    Console->Print("Reloading previously auto-selected renderer "+DLLNames[BestDLLIndex]+" ...\n"); 
    277273    return GetRenderer(DLLNames[BestDLLIndex], OutRendererDLL); 
    278274} 
     
    289285    #endif 
    290286 
    291     if (!GetTMM) { printf("FAILED - could not get the address of the GetTextureMapManager() function.\n"); return NULL; } 
     287    if (!GetTMM) { Console->Print("FAILED - could not get the address of the GetTextureMapManager() function.\n"); return NULL; } 
    292288 
    293289    return GetTMM(); 
     
    304300        // Please refer to the man page of dlopen for more details. 
    305301        OutSoundSysDLL=dlopen(DLLName.c_str(), RTLD_NOW); 
    306         if (!OutSoundSysDLL) printf("\"%s\", ", dlerror()); 
    307     #endif 
    308  
    309     if (!OutSoundSysDLL) { printf("FAILED - could not load the library at %s.\n", DLLName.c_str()); return NULL; } 
     302        if (!OutSoundSysDLL) Console->Print(std::string(dlerror()) + ", "); 
     303    #endif 
     304 
     305    if (!OutSoundSysDLL) { Console->Print("FAILED - could not load the library at "+DLLName+".\n"); return NULL; } 
    310306 
    311307 
     
    318314    #endif 
    319315 
    320     if (!GetSoundSysFunc) { printf("FAILED - could not get the address of the GetSoundSys() function.\n"); FreeLibrary(OutSoundSysDLL); return NULL; } 
     316    if (!GetSoundSysFunc) { Console->Print("FAILED - could not get the address of the GetSoundSys() function.\n"); FreeLibrary(OutSoundSysDLL); return NULL; } 
    321317 
    322318 
     
    327323    SoundSysI* SoundSys=GetSoundSysFunc(Console, cf::FileSys::FileMan); 
    328324 
    329     if (!SoundSys) { printf("FAILED - could not get the SoundSys.\n"); FreeLibrary(OutSoundSysDLL); return NULL; } 
    330     if (!SoundSys->IsSupported()) { printf("FAILED - SoundSys says it's not supported.\n"); FreeLibrary(OutSoundSysDLL); return NULL; } 
     325    if (!SoundSys) { Console->Print("FAILED - could not get the SoundSys.\n"); FreeLibrary(OutSoundSysDLL); return NULL; } 
     326    if (!SoundSys->IsSupported()) { Console->Print("FAILED - SoundSys says it's not supported.\n"); FreeLibrary(OutSoundSysDLL); return NULL; } 
    331327 
    332328    return SoundSys; 
     
    347343    ArrayT<std::string> DLLNames; 
    348344 
    349     printf("\n"); 
    350     printf("Scanning cwd for all available sound systems...\n"); 
     345    Console->Print("\n"); 
     346    Console->Print("Scanning cwd for all available sound systems...\n"); 
    351347    GetDLLs(".", "SoundSys", DLLNames); 
    352348 
    353349    if (DLLNames.Size()==0) 
    354350    { 
    355         printf("Scanning %s for all available sound systems...\n", Path.c_str()); 
     351        Console->Print("Scanning "+Path+" for all available sound systems...\n"); 
    356352        GetDLLs(Path, "SoundSys", DLLNames); 
    357353    } 
     
    363359    for (unsigned long DLLNr=0; DLLNr<DLLNames.Size(); DLLNr++) 
    364360    { 
    365         printf("%s ... ", DLLNames[DLLNr].c_str()); 
     361        Console->Print(DLLNames[DLLNr]+" ... "); 
    366362 
    367363        HMODULE SoundSysDLL; 
     
    377373        if (PrefNr<10) 
    378374        { 
    379             // I don't want the Null sound system to be possibly selected for client 
     375            // We don't want the Null sound system to be possibly selected for client 
    380376            // (which can happen in the presence of other errors). 
    381377            // It would only confuse and worry users to sit in front of a black, apparently frozen screen. 
    382             printf("SUCCESS - but excluded from auto-selection (Pref# %i).\n", PrefNr); 
     378            Console->Print(cf::va("SUCCESS - but excluded from auto-selection (Pref# %i).\n", PrefNr)); 
    383379            continue; 
    384380        } 
     
    386382        if (PrefNr>BestPrefNr) 
    387383        { 
    388             printf("SUCCESS - %s sound system (Pref# %i).\n", BestPrefNr<0 ? "first supported" : "higher preference", PrefNr); 
     384            Console->Print(cf::va("SUCCESS - %s sound system (Pref# %i).\n", BestPrefNr<0 ? "first supported" : "higher preference", PrefNr)); 
    389385 
    390386            BestDLLIndex=DLLNr; 
    391387            BestPrefNr  =PrefNr; 
    392388        } 
    393         else printf("SUCCESS - but no higher preference (Pref# %i).\n", PrefNr); 
     389        else Console->Print(cf::va("SUCCESS - but no higher preference (Pref# %i).\n", PrefNr)); 
    394390    } 
    395391 
    396392    if (BestPrefNr==-1) 
    397393    { 
    398         printf("No sound system qualified.\n"); 
     394        Console->Print("No sound system qualified.\n"); 
    399395        return NULL; 
    400396    } 
    401397 
    402     printf("Reloading previously auto-selected sound system %s ... \n", DLLNames[BestDLLIndex].c_str()); 
     398    Console->Print("Reloading previously auto-selected sound system "+DLLNames[BestDLLIndex]+" ...\n"); 
    403399    return GetSoundSys(DLLNames[BestDLLIndex], OutSoundSysDLL); 
    404400} 
  • cafu/trunk/Libs/PlatformAux.hpp

    r36 r149  
    2121================================================================================= 
    2222*/ 
    23  
    24 /********************************/ 
    25 /*** Platform Auxiliary Stuff ***/ 
    26 /********************************/ 
    2723 
    2824#ifndef _PLATFORM_AUX_HPP_ 
  • cafu/trunk/Libs/SConscript

    r148 r149  
    99                    ConsoleCommands/ConVar.cpp ConsoleCommands/ConFunc.cpp 
    1010                    ConsoleCommands/ConsoleInterpreterImpl.cpp ConsoleCommands/ConsoleInterpreter_LuaBinding.cpp 
    11                     ConsoleCommands/Console.cpp ConsoleCommands/ConsoleStdout.cpp ConsoleCommands/ConsoleStringBuffer.cpp ConsoleCommands/ConsoleWarningsOnly.cpp ConsoleCommands/ConsoleFile.cpp 
     11                    ConsoleCommands/Console.cpp ConsoleCommands/Console_Lua.cpp ConsoleCommands/ConsoleComposite.cpp ConsoleCommands/ConsoleStdout.cpp ConsoleCommands/ConsoleStringBuffer.cpp ConsoleCommands/ConsoleWarningsOnly.cpp ConsoleCommands/ConsoleFile.cpp 
    1212                    Fonts/Font.cpp Fonts/FontTT.cpp 
    1313                    FileSys/FileManImpl.cpp FileSys/FileSys_LocalPath.cpp FileSys/FileSys_ZipArchive_GV.cpp FileSys/File_local.cpp FileSys/File_memory.cpp FileSys/Password.cpp 
  • cafu/trunk/SConscript

    r148 r149  
    99env.Program('CaBSP/CaBSP',   # I had preferred writing 'CaBSP' instead of 'CaBSP/CaBSP' here, but then under Linux we would get both a directory *and* an executeable with name 'CaBSP' in the build directory, which is not allowed/possible. 
    1010    Split("CaBSP/CaBSP.cpp CaBSP/BspTreeBuilder/BspTreeBuilder.cpp") + CommonWorldObject, 
    11     LIBS=Split("SceneGraph MatSys cfsLib ClipSys cfs_png cfs_jpeg bulletcollision lua minizip lightwave z")) 
     11    LIBS=Split("SceneGraph MatSys ClipSys cfsLib cfs_png cfs_jpeg bulletcollision lua minizip lightwave z")) 
    1212 
    1313env.Program('CaPVS/CaPVS', 
    1414    Split("CaPVS/CaPVS.cpp CaPVS/CaPVSWorld.cpp") + CommonWorldObject, 
    15     LIBS=Split("SceneGraph MatSys cfsLib ClipSys cfs_png cfs_jpeg bulletcollision lua minizip lightwave z")) 
     15    LIBS=Split("SceneGraph MatSys ClipSys cfsLib cfs_png cfs_jpeg bulletcollision lua minizip lightwave z")) 
    1616 
    1717env.Program('CaLight/CaLight', 
    1818    Split("CaLight/CaLight.cpp CaLight/CaLightWorld.cpp") + CommonWorldObject, 
    19     LIBS=Split("SceneGraph MatSys cfsLib ClipSys cfs_png cfs_jpeg bulletcollision lua minizip lightwave z")) 
     19    LIBS=Split("SceneGraph MatSys ClipSys cfsLib cfs_png cfs_jpeg bulletcollision lua minizip lightwave z")) 
    2020 
    2121env.Program('CaSHL/CaSHL', 
    2222    Split("CaSHL/CaSHL.cpp CaSHL/CaSHLWorld.cpp") + CommonWorldObject, 
    23     LIBS=Split("SceneGraph MatSys cfsLib ClipSys cfs_png cfs_jpeg bulletcollision lua minizip lightwave z")) 
     23    LIBS=Split("SceneGraph MatSys ClipSys cfsLib cfs_png cfs_jpeg bulletcollision lua minizip lightwave z")) 
    2424 
    2525 
     
    3131    envTools.Append(LIBPATH=['ExtLibs/DirectX7/lib']) 
    3232    # glu32 is only needed for the TerrainViewerOld... 
    33     envTools.Append(LIBS=Split("SceneGraph MatSys cfsLib ClipSys cfs_png cfs_jpeg bulletcollision lua minizip lightwave z") 
     33    envTools.Append(LIBS=Split("SceneGraph MatSys ClipSys cfsLib cfs_png cfs_jpeg bulletcollision lua minizip lightwave z") 
    3434                       + Split("gdi32 glu32 opengl32 user32") + ['cfsOpenGL', 'dinput', 'dxguid']) 
    3535elif sys.platform=="linux2": 
     
    3737    # GLU is needed for the TerrainViewerOld *and* for e.g. gluBuild2DMipmaps() in the renderers... 
    3838    envTools.Append(CPPPATH=['/usr/include/freetype2'])         # As of 2009-09-10, this line is to become unnecessary in the future, see /usr/include/ftbuild.h for details. 
    39     envTools.Append(LIBS=Split("SceneGraph MatSys cfsOpenGL cfsLib ClipSys cfs_png cfs_jpeg bulletcollision lua minizip lightwave z") 
     39    envTools.Append(LIBS=Split("SceneGraph MatSys cfsOpenGL ClipSys cfsLib cfs_png cfs_jpeg bulletcollision lua minizip lightwave z") 
    4040                       + Split("GL GLU")) 
    4141 
     
    147147envCaWE = wxEnv.Clone() 
    148148envCaWE.Append(CPPPATH=['ExtLibs/lua/src', 'ExtLibs/noise/src']) 
    149 envCaWE.Append(LIBS=Split("SceneGraph MatSys cfsLib ClipSys cfs_png cfs_jpeg bulletcollision noise lua minizip lightwave z")) 
     149envCaWE.Append(LIBS=Split("SceneGraph MatSys ClipSys cfsLib cfs_png cfs_jpeg bulletcollision noise lua minizip lightwave z")) 
    150150 
    151151if sys.platform=="win32":