Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 8, 2013, 7:30:20 PM (11 years ago)
Author:
landauf
Message:

adjusted code to compile with cegui 0.8 and 0.7. see www.cegui.org.uk/wiki/index.php/Changes_and_Porting_Tips_for_0.8.0

doesn't run yet (lua scripts fail)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/libs/src/orxonox/chat/ChatInputHandler.cc

    r8858 r9671  
    3131#include <cassert>
    3232#include <string>
    33 #include <CEGUIWindow.h>
    34 #include <CEGUIWindowManager.h>
    35 #include <elements/CEGUIListbox.h>
    36 #include <elements/CEGUIListboxItem.h>
    37 #include <elements/CEGUIListboxTextItem.h>
     33
     34#if CEGUI_VERSION >= 0x000800
     35#   include <CEGUI/Window.h>
     36#   include <CEGUI/WindowManager.h>
     37#   include <CEGUI/widgets/Listbox.h>
     38#   include <CEGUI/widgets/ListboxItem.h>
     39#   include <CEGUI/widgets/ListboxTextItem.h>
     40#else
     41#   include <CEGUIWindow.h>
     42#   include <CEGUIWindowManager.h>
     43#   include <elements/CEGUIListbox.h>
     44#   include <elements/CEGUIListboxItem.h>
     45#   include <elements/CEGUIListboxTextItem.h>
     46#endif
    3847
    3948#include "util/ScopedSingletonManager.h"
     
    118127
    119128    /* GET WINDOW POINTERS */
     129#if CEGUI_VERSION >= 0x000800
     130    input = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/input" );
     131    inputonly = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox-inputonly/input" );
     132    CEGUI::Window *history = CEGUI::System::getSingleton().getDefaultGUIContext().getRootWindow()->getChild( "orxonox/ChatBox/history" );
     133#else
    120134    input = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/input" );
    121135    inputonly = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox-inputonly/input" );
    122 
    123     /* get pointer to the history window */
    124136    CEGUI::Window *history = CEGUI::WindowManager::getSingleton().getWindow( "orxonox/ChatBox/history" );
     137#endif
    125138
    126139    /* cast it to a listbox */
     
    141154    // reds
    142155    for( i = 0; i < NumberOfColors/3; ++i )
    143     { this->text_colors[ i ] = CEGUI::colour( red, green, blue );
     156    { this->text_colors[ i ] = CEGUIColour( red, green, blue );
    144157      green += 0.2f, blue += 0.2f;
    145158    }
     
    148161    red = 0.5, green = 1, blue = 0.5;
    149162    for( ; i < NumberOfColors*2/3; ++i )
    150     { this->text_colors[ i ] = CEGUI::colour( red, green, blue );
     163    { this->text_colors[ i ] = CEGUIColour( red, green, blue );
    151164      red += 0.2f, blue += 0.2f;
    152165    }
     
    155168    red = 0.5, green = 0.5, blue = 1;
    156169    for( ; i < NumberOfColors; ++i )
    157     { this->text_colors[ i ] = CEGUI::colour( red, green, blue );
     170    { this->text_colors[ i ] = CEGUIColour( red, green, blue );
    158171      red += 0.2f, green += 0.2f;
    159172    }
     
    272285    {
    273286      /* adjust curser position - magic number 5 for font width */
    274       sub_adjust_dispoffset( (int)(this->input->getUnclippedInnerRect().getWidth()/6),
    275         cursorpos, assembled.length() );
     287#if CEGUI_VERSION >= 0x000800
     288      sub_adjust_dispoffset( (int)(this->input->getUnclippedInnerRect().get().getWidth()/6), cursorpos, assembled.length() );
     289#else
     290      sub_adjust_dispoffset( (int)(this->input->getUnclippedInnerRect().getWidth()/6), cursorpos, assembled.length() );
     291#endif
    276292      this->input->setProperty( "Text", assembled.substr( disp_offset ) );
    277293    }
     
    279295    {
    280296      /* adjust curser position - magic number 5 for font width */
    281       sub_adjust_dispoffset( (int)(this->inputonly->getUnclippedInnerRect().getWidth()/6),
    282         cursorpos, assembled.length() );
     297#if CEGUI_VERSION >= 0x000800
     298      sub_adjust_dispoffset( (int)(this->inputonly->getUnclippedInnerRect().get().getWidth()/6), cursorpos, assembled.length() );
     299#else
     300      sub_adjust_dispoffset( (int)(this->inputonly->getUnclippedInnerRect().getWidth()/6), cursorpos, assembled.length() );
     301#endif
    283302      this->inputonly->setProperty( "Text", assembled.substr( disp_offset) );
    284303    }
Note: See TracChangeset for help on using the changeset viewer.