Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7737 in orxonox.OLD for trunk/src/lib/shell/shell_buffer.cc


Ignore:
Timestamp:
May 19, 2006, 11:38:34 PM (19 years ago)
Author:
bensch
Message:

Using MultiLine-Text in the Shell. This is much faster, and Nicer :)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/lib/shell/shell_buffer.cc

    r7729 r7737  
    1717
    1818#include "shell_buffer.h"
     19
     20#include <stdarg.h>
     21
    1922#include "debug.h"
    2023#include "shell.h"
     24#include "lib/util/threading.h"
    2125
    2226namespace OrxShell
     
    3943
    4044  ShellBuffer* ShellBuffer::singletonRef = NULL;
    41   SDL_mutex* ShellBuffer::bufferMutex = NULL;
     45  std::list<std::string> ShellBuffer::buffer;
    4246
    4347  /**
     
    4852    if (this->shell != NULL)
    4953      delete this->shell;
    50 
    51     this->flush();
    52 
    53     if (ShellBuffer::bufferMutex != NULL)
    54       SDL_DestroyMutex(ShellBuffer::bufferMutex);
    55     ShellBuffer::bufferMutex = NULL;
    5654
    5755    ShellBuffer::singletonRef = NULL;
     
    9997    va_start(arguments, line);
    10098
    101     if (ShellBuffer::bufferMutex == NULL)
    102       ShellBuffer::bufferMutex = SDL_CreateMutex();
     99    static OrxThread::Mutex ShellBuffer__bufferMutex;
    103100
    104     SDL_mutexP(ShellBuffer::bufferMutex);
     101    OrxThread::MutexLock bufferLock(&ShellBuffer__bufferMutex);
    105102#if DEBUG_LEVEL < 3
    106103    if (ShellBuffer::singletonRef == NULL)
     
    113110#endif
    114111      ShellBuffer::singletonRef->addBufferLine(line, arguments);
    115     SDL_mutexV(ShellBuffer::bufferMutex);
    116112    return true;
    117113  }
Note: See TracChangeset for help on using the changeset viewer.