Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Jul 13, 2009, 6:03:24 PM (15 years ago)
Author:
rgrieder
Message:

Move resource allocation to the corresponding thread and made compiler directives clearer.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/netp6/src/orxonox/gamestates/GSDedicated.cc

    r3283 r3284  
    4242#include <boost/bind.hpp>
    4343
    44 #ifndef ORXONOX_PLATFORM_WINDOWS
     44#ifdef ORXONOX_PLATFORM_UNIX
    4545#include <termios.h>
    4646#endif
     
    6565        , cursorY_(0)
    6666    {
    67         this->commandLine_ = new unsigned char[MAX_COMMAND_LENGTH];
    68 //         memset( this->commandLine_, 0, MAX_COMMAND_LENGTH );
    6967    }
    7068
     
    9694       
    9795        closeThread_ = true;
    98 #ifndef ORXONOX_PLATFORM_WINDOWS
     96#ifdef ORXONOX_PLATFORM_UNIX
    9997        std::cout << "\033[0G\033[K";
    10098        std::cout.flush();
     
    105103        inputThread_->join();
    106104        delete this->inputThread_;
    107 
    108         if (this->commandLine_ )
    109           delete[] this->commandLine_;
    110105
    111106        GameMode::setHasServer(false);
     
    132127    void GSDedicated::inputThread()
    133128    {
     129        this->commandLine_ = new unsigned char[MAX_COMMAND_LENGTH];
     130//         memset( this->commandLine_, 0, MAX_COMMAND_LENGTH );
    134131        unsigned char c;
    135132        unsigned int  escapeChar=0;
     
    213210            }
    214211        }
     212
     213        delete[] this->commandLine_;
    215214    }
    216215   
    217216    void GSDedicated::printLine()
    218217    {
    219 #ifndef ORXONOX_PLATFORM_WINDOWS
     218#ifdef ORXONOX_PLATFORM_UNIX
    220219        // set cursor to the begining of the line and erase the line
    221220        std::cout << "\033[0G\033[K";
     
    257256    void GSDedicated::setTerminalMode()
    258257    {
    259 #ifndef ORXONOX_PLATFORM_WINDOWS
     258#ifdef ORXONOX_PLATFORM_UNIX
    260259        termios new_settings;
    261260     
     
    274273    void GSDedicated::resetTerminalMode()
    275274    {
    276 #ifndef ORXONOX_PLATFORM_WINDOWS
     275#ifdef ORXONOX_PLATFORM_UNIX
    277276        tcsetattr(0, TCSANOW, GSDedicated::originalTerminalSettings_);
    278277#endif
Note: See TracChangeset for help on using the changeset viewer.