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)

Location:
code/branches/libs/src/orxonox/chat
Files:
2 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    }
  • code/branches/libs/src/orxonox/chat/ChatInputHandler.h

    r8858 r9671  
    3333
    3434#include <string>
    35 #include <CEGUIForwardRefs.h>
    36 #include <CEGUIcolour.h>
     35
     36#if CEGUI_VERSION >= 0x000800
     37#   include <CEGUI/ForwardRefs.h>
     38#   include <CEGUI/Colour.h>
     39#else
     40#   include <CEGUIForwardRefs.h>
     41#   include <CEGUIcolour.h>
     42#endif
    3743
    3844#include "util/Singleton.h"
     
    4147namespace orxonox // tolua_export
    4248{ // tolua_export
     49
     50#if CEGUI_VERSION >= 0x000800
     51  typedef CEGUI::Colour CEGUIColour;
     52#else
     53  typedef CEGUI::colour CEGUIColour;
     54#endif
     55
    4356  /* class to handle chat using an InputBuffer */
    4457  class _OrxonoxExport ChatInputHandler  // tolua_export
     
    5568      /* colors for nickname coloring */
    5669      static const int NumberOfColors = 10;
    57       CEGUI::colour text_colors[ NumberOfColors ];
     70      CEGUIColour text_colors[ NumberOfColors ];
    5871
    5972      /** input state */
Note: See TracChangeset for help on using the changeset viewer.