Mise à jour terminée. Pour connaître les apports de la version 13.8.4 par rapport à notre ancienne version vous pouvez lire les "Release Notes" suivantes :
https://about.gitlab.com/releases/2021/02/11/security-release-gitlab-13-8-4-released/
https://about.gitlab.com/releases/2021/02/05/gitlab-13-8-3-released/

Commit b8d700c2 authored by Jussi Lindgren's avatar Jussi Lindgren

Everything: Towards Ogre 1.9.0 and CEGUI 0.8.4 support

parent 0c67f99d
......@@ -13,6 +13,13 @@ using namespace OpenViBE;
using namespace OpenViBE::Kernel;
using namespace OpenViBESSVEP;
#if !((CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7))
namespace CEGUI
{
typedef CEGUI::UVector2 USize;
};
#endif
CShooterApplication::CShooterApplication()
: CApplication(),
m_bTargetRequest( false ),
......@@ -42,11 +49,15 @@ bool CShooterApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex
m_poInstructionsReady = m_poGUIWindowManager->createWindow("TaharezLook/StaticImage", "InstructionsReady");
m_poInstructionsReady->setPosition(CEGUI::UVector2(cegui_reldim(0.0f), cegui_reldim(0.0f)) );
m_poInstructionsReady->setSize(CEGUI::UVector2(CEGUI::UDim(0.0f, 640.f), CEGUI::UDim(0.0f, 32.f)));
m_poInstructionsReady->setSize(CEGUI::USize(CEGUI::UDim(0.0f, 640.f), CEGUI::UDim(0.0f, 32.f)));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(m_poInstructionsReady);
CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady","InstructionText-Start.png");
#else
m_poSheet->addChildWindow(m_poInstructionsReady);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady","InstructionText-Start.png");
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady", "InstructionText-Start.png");
#endif
m_poInstructionsReady->setProperty("Image","set:InstructionsReady image:full_image");
m_poInstructionsReady->setProperty("FrameEnabled","False");
......
......@@ -46,7 +46,8 @@ CStarShip::CStarShip(CApplication* poApplication, Ogre::SceneNode* poParentNode,
SceneNode* l_poDrawnObjectNode;
MovableObject* l_poDrawnObject;
Ogre::Rectangle l_oWingRectangle = { - rRadius * 0.4f, rRadius * 0.4f, rRadius * 0.4f, -rRadius * 0.4f };
// Ogre::RealRect l_oWingRectangle = { - rRadius * 0.4f, rRadius * 0.4f, rRadius * 0.4f, -rRadius * 0.4f };
Ogre::RealRect l_oWingRectangle(-rRadius * 0.4f, rRadius * 0.4f, rRadius * 0.4f, -rRadius * 0.4f );
// paint the cannon
......
......@@ -12,7 +12,14 @@ using namespace OpenViBE;
using namespace OpenViBE::Kernel;
using namespace OpenViBESSVEP;
CTrainerApplication::CTrainerApplication() :
#if !((CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7))
namespace CEGUI
{
typedef CEGUI::UVector2 USize;
};
#endif
CTrainerApplication::CTrainerApplication() :
CApplication(),
m_bActive( false ),
m_poInstructionsReady( NULL )
......@@ -41,11 +48,15 @@ bool CTrainerApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContex
// draw the initial text
m_poInstructionsReady = m_poGUIWindowManager->createWindow("TaharezLook/StaticImage", "InstructionsReady");
m_poInstructionsReady->setPosition(CEGUI::UVector2(cegui_reldim(0.0f), cegui_reldim(0.0f)) );
m_poInstructionsReady->setSize(CEGUI::UVector2(CEGUI::UDim(0.0f, 640.f), CEGUI::UDim(0.0f, 32.f)));
m_poInstructionsReady->setSize(CEGUI::USize(CEGUI::UDim(0.0f, 640.f), CEGUI::UDim(0.0f, 32.f)));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(m_poInstructionsReady);
CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady","InstructionText-Start.png");
#else
m_poSheet->addChildWindow(m_poInstructionsReady);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady","InstructionText-Start.png");
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady", "InstructionText-Start.png");
#endif
m_poInstructionsReady->setProperty("Image","set:InstructionsReady image:full_image");
m_poInstructionsReady->setProperty("FrameEnabled","False");
......
......@@ -81,7 +81,7 @@ CTrainerFlickeringObject::CTrainerFlickeringObject( OpenViBE::float32 f32PosX, O
m_poObjectNode = m_poElementNode->createChildSceneNode();
l_poPointerNode = m_poElementNode->createChildSceneNode();
Ogre::Rectangle l_oRectangle = { f32PosX - m_f32TargetWidth / 2, f32PosY + m_f32TargetHeight / 2, f32PosX + m_f32TargetWidth / 2, f32PosY - m_f32TargetHeight / 2};
Ogre::RealRect l_oRectangle(f32PosX - m_f32TargetWidth / 2, f32PosY + m_f32TargetHeight / 2, f32PosX + m_f32TargetWidth / 2, f32PosY - m_f32TargetHeight / 2);
l_poLitObject = m_poPainter->paintRectangle( l_oRectangle, oColour );
......
......@@ -209,14 +209,25 @@ void CApplication::initCEGUI(const char *logFilename)
(*m_poLogManager) << LogLevel_Debug << "+ Creating CEGUI Ogre bootstrap\n";
m_roGUIRenderer = &(CEGUI::OgreRenderer::bootstrapSystem(*m_poWindow));
(*m_poLogManager) << LogLevel_Debug << "+ Creating CEGUI Scheme Manager\n";
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
CEGUI::SchemeManager::getSingleton().createFromFile((CEGUI::utf8*)"TaharezLook-ov.scheme");
#else
CEGUI::SchemeManager::getSingleton().create((CEGUI::utf8*)"TaharezLook-ov.scheme");
#endif
(*m_poLogManager) << LogLevel_Debug << "+ Creating CEGUI WindowManager\n";
m_poGUIWindowManager = CEGUI::WindowManager::getSingletonPtr();
m_poSheet = m_poGUIWindowManager->createWindow("DefaultWindow", "Sheet");
(*m_poLogManager) << LogLevel_Debug << "+ Setting CEGUI StyleSheet\n";
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
// @FIXME
#else
CEGUI::System::getSingleton().setGUISheet(m_poSheet);
#endif
}
void CApplication::resizeViewport()
......
......@@ -9,7 +9,11 @@
#include <Ogre.h>
#include <vector>
#include <CEGUI.h>
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
#include <CEGUI/RendererModules/Ogre/Renderer.h>
#else
#include <RendererModules/Ogre/CEGUIOgreRenderer.h>
#endif
#include "ovassvepICommand.h"
#include "ovassvepCBasicPainter.h"
......
......@@ -4,6 +4,9 @@
#include "ovassvepCBasicPainter.h"
#include "ovassvepCApplication.h"
#if (OGRE_VERSION_MAJOR > 1) || ((OGRE_VERSION_MAJOR == 1) && (OGRE_VERSION_MINOR >= 9))
#include "Overlay/OgreOverlayManager.h"
#endif
using namespace Ogre;
using namespace OpenViBESSVEP;
......@@ -32,7 +35,7 @@ using namespace OpenViBE::Kernel;
ManualObject* CBasicPainter::paintRectangle( Ogre::Rectangle oRectangle, Ogre::ColourValue oColour, int iPlane )
ManualObject* CBasicPainter::paintRectangle( Ogre::RealRect oRectangle, Ogre::ColourValue oColour, int iPlane )
{
ManualObject *l_poObject;
......
......@@ -3,6 +3,11 @@
#include <Ogre.h>
#if (OGRE_VERSION_MAJOR > 1) || ((OGRE_VERSION_MAJOR == 1) && (OGRE_VERSION_MINOR >= 9))
#include "Overlay/OgreOverlay.h"
#include "Overlay/OgreOverlayContainer.h"
#endif
#define SSVEP_DEFAULT_COLOUR Ogre::ColourValue(1.0f, 1.0f, 1.0f)
namespace OpenViBESSVEP
......@@ -25,7 +30,7 @@ namespace OpenViBESSVEP
CBasicPainter( CApplication* poApplication );
~CBasicPainter() {};
Ogre::ManualObject* paintRectangle( Ogre::Rectangle oRectangle, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintRectangle( Ogre::RealRect oRectangle, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintTriangle( Point oP1, Point oP2, Point oP3, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintCircle( Ogre::Real rX, Ogre::Real rY, Ogre::Real rR, Ogre::ColourValue = SSVEP_DEFAULT_COLOUR, bool bFilled = true, int iPlane = 1);
......
......@@ -28,7 +28,8 @@ INCLUDE("FindOpenViBEModuleEBML")
INCLUDE("FindOpenViBEModuleFS")
INCLUDE("FindThirdPartyCEGUI") # CEGUI + CEGUIOgreRender included
INCLUDE("FindThirdPartyVRPN")
INCLUDE("FindThirdPartyOgre3DTerrain") # OGRE + OIS included, pulls boost thread
INCLUDE("FindThirdPartyOgre3D")
INCLUDE("FindThirdPartyOgre3DTerrain") # OGRE + OIS included, pulls boost thread
INCLUDE("FindThirdPartyBoost") # Using Ogre headers on Win32 causes dependency to Boost thread library
INCLUDE("FindThirdPartyBoost_Thread") # Note that this is a potential issue on Windows, as the dependencies/ogre/boost and dependencies/boost are not the same at the time of writing this.
......
......@@ -14,7 +14,14 @@ using namespace OpenViBE;
using namespace OpenViBE::Kernel;
using namespace OpenViBESSVEP;
CGenericStimulatorApplication::CGenericStimulatorApplication(CString sScenarioDir) :
#if !((CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7))
namespace CEGUI
{
typedef CEGUI::UVector2 USize;
};
#endif
CGenericStimulatorApplication::CGenericStimulatorApplication(CString sScenarioDir) :
CApplication(sScenarioDir),
m_bActive( false ),
m_poInstructionsReady( NULL )
......@@ -52,11 +59,15 @@ bool CGenericStimulatorApplication::setup(OpenViBE::Kernel::IKernelContext* poKe
// draw the initial text
m_poInstructionsReady = m_poGUIWindowManager->createWindow("TaharezLook/StaticImage", "InstructionsReady");
m_poInstructionsReady->setPosition(CEGUI::UVector2(cegui_reldim(0.0f), cegui_reldim(0.0f)) );
m_poInstructionsReady->setSize(CEGUI::UVector2(CEGUI::UDim(0.0f, 640.f), CEGUI::UDim(0.0f, 32.f)));
m_poInstructionsReady->setSize(CEGUI::USize(CEGUI::UDim(0.0f, 640.f), CEGUI::UDim(0.0f, 32.f)));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(m_poInstructionsReady);
CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady","InstructionText-Start.png");
#else
m_poSheet->addChildWindow(m_poInstructionsReady);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady","InstructionText-Start.png");
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady", "InstructionText-Start.png");
#endif
m_poInstructionsReady->setProperty("Image","set:InstructionsReady image:full_image");
m_poInstructionsReady->setProperty("FrameEnabled","False");
......
......@@ -106,7 +106,7 @@ CGenericStimulatorFlickeringObject::CGenericStimulatorFlickeringObject( OpenViBE
m_poObjectNode = m_poElementNode->createChildSceneNode();
l_poPointerNode = m_poElementNode->createChildSceneNode();
Ogre::Rectangle l_oRectangle = { f32PosX - m_f32TargetWidth / 2, f32PosY + m_f32TargetHeight / 2, f32PosX + m_f32TargetWidth / 2, f32PosY - m_f32TargetHeight / 2};
Ogre::RealRect l_oRectangle( f32PosX - m_f32TargetWidth / 2, f32PosY + m_f32TargetHeight / 2, f32PosX + m_f32TargetWidth / 2, f32PosY - m_f32TargetHeight / 2);
if (strcmp(sMaterial.toASCIIString(), "default") == 0)
{
......
......@@ -29,6 +29,13 @@ using namespace OpenViBESSVEP;
//#define NO_KEYBOARD
//#define NO_VRPN
#if !((CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7))
namespace CEGUI
{
typedef CEGUI::UVector2 USize;
};
#endif
CImpactApplication::CImpactApplication(CString sScenarioDir, CString sApplicationSubtype)
: CApplication(sScenarioDir),
m_poCurrentEnemy( NULL ),
......@@ -121,8 +128,13 @@ bool CImpactApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContext
m_poStatusWindow->setFont("BlueHighway-impact");
m_poStatusWindow->hide();
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(m_poStatusWindow);
m_poSheet->addChild(m_poInstructionWindow);
#else
m_poSheet->addChildWindow(m_poStatusWindow);
m_poSheet->addChildWindow(m_poInstructionWindow);
#endif
// Create commands
......@@ -184,7 +196,7 @@ bool CImpactApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContext
// draw the initial text
m_poInstructionWindow->show();
m_poInstructionWindow->setSize( CEGUI::UVector2( CEGUI::UDim( 0.50f, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setSize( CEGUI::USize( CEGUI::UDim( 0.50f, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.25f, 0 ), CEGUI::UDim( 0.45f, 0 ) ) );
// m_poInstructionWindow->setText("Appuyez sur la touche ESPACE pour commencer le jeu ...");
m_poInstructionWindow->setText("Press SPACE to start the game ...");
......@@ -195,7 +207,7 @@ bool CImpactApplication::setup(OpenViBE::Kernel::IKernelContext* poKernelContext
// draw the initial text
m_poInstructionWindow->show();
m_poInstructionWindow->setSize( CEGUI::UVector2( CEGUI::UDim( 0.50f, 0 ), CEGUI::UDim( 0.15f, 0 ) ) );
m_poInstructionWindow->setSize( CEGUI::USize( CEGUI::UDim( 0.50f, 0 ), CEGUI::UDim( 0.15f, 0 ) ) );
m_poInstructionWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.25f, 0 ), CEGUI::UDim( 0.425f, 0 ) ) );
// m_poInstructionWindow->setText("Le systeme a besoin de faire quelques reglages.\nVeuillez vous concentrer sur les cibles indiques par les instructions.\n\nAppuyez sur la touche ESPACE pour commencer l'entrainement ...");
m_poInstructionWindow->setText("The system needs to calibrate.\nPlease concentrate on the targets as instructed.\n\nPlease press SPACE to start the process ...");
......@@ -474,7 +486,7 @@ void CImpactApplication::addTarget(OpenViBE::uint32 ui32TargetPosition)
break;
}
m_poInstructionWindow->setSize( CEGUI::UVector2( CEGUI::UDim( l_fTextSize, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setSize( CEGUI::USize( CEGUI::UDim( l_fTextSize, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( (1.0f - l_fTextSize) / 2.0f, 0 ), CEGUI::UDim( 0.45f, 0 ) ) );
m_poInstructionWindow->show();
m_ui32DialogHideDelay = DIALOG_CYCLES_TO_REMOVE;
......@@ -541,7 +553,7 @@ void CImpactApplication::startExperiment()
m_poInstructionWindow->hide();
m_ui32DialogHideDelay = 0;
m_poStatusWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( 0.0f, 0 ), CEGUI::UDim( 0.0f, 0 ) ) );
m_poStatusWindow->setSize( CEGUI::UVector2( CEGUI::UDim( 0.15f, 0 ), CEGUI::UDim( 0.05f, 0 ) ) );
m_poStatusWindow->setSize( CEGUI::USize( CEGUI::UDim( 0.15f, 0 ), CEGUI::UDim( 0.05f, 0 ) ) );
m_poStatusWindow->setText("Score: 0");
m_poStatusWindow->show();
m_eGameState = STARTED;
......@@ -566,7 +578,7 @@ void CImpactApplication::stopExperiment()
OpenViBE::float32 l_fTextSize = 0.35f;
// m_poInstructionWindow->setText("L'application va prendre quelque temps pour le calcul, veuillez patienter.\nLe jeu va commencer automatiquement une fois l'application est prete.");
m_poInstructionWindow->setText("The application needs some time to compute, please be patient.\nThe game starts automatically when the application is ready.");
m_poInstructionWindow->setSize( CEGUI::UVector2( CEGUI::UDim( l_fTextSize, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setSize( CEGUI::USize( CEGUI::UDim( l_fTextSize, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( (1.0f - l_fTextSize) / 2.0f, 0 ), CEGUI::UDim( 0.45f, 0 ) ) );
m_poInstructionWindow->show();
......@@ -581,7 +593,7 @@ void CImpactApplication::stopExperiment()
// sprintf(l_sText, "Bravo!\nVous avez obtenu %d points!\nAppuyez sur ECHAP pour fermer le programme", m_iScore);
sprintf(l_sText, "Bravo!\nYou have obtained %d points!\nPress ESC to close the program", m_iScore);
m_poInstructionWindow->setText(l_sText);
m_poInstructionWindow->setSize( CEGUI::UVector2( CEGUI::UDim( l_fTextSize, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setSize( CEGUI::USize( CEGUI::UDim( l_fTextSize, 0 ), CEGUI::UDim( 0.10f, 0 ) ) );
m_poInstructionWindow->setPosition( CEGUI::UVector2( CEGUI::UDim( (1.0f - l_fTextSize) / 2.0f, 0 ), CEGUI::UDim( 0.45f, 0 ) ) );
m_poInstructionWindow->show();
m_bActive = false;
......
......@@ -284,14 +284,23 @@ void CApplication::initCEGUI()
(*m_poLogManager) << LogLevel_Debug << "+ Creating CEGUI Ogre bootstrap\n";
m_roGUIRenderer = &(CEGUI::OgreRenderer::bootstrapSystem(*m_poWindow));
(*m_poLogManager) << LogLevel_Debug << "+ Creating CEGUI Scheme Manager\n";
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
CEGUI::SchemeManager::getSingleton().createFromFile((CEGUI::utf8*)"TaharezLook-ov.scheme");
#else
CEGUI::SchemeManager::getSingleton().create((CEGUI::utf8*)"TaharezLook-ov.scheme");
#endif
(*m_poLogManager) << LogLevel_Debug << "+ Creating CEGUI WindowManager\n";
m_poGUIWindowManager = CEGUI::WindowManager::getSingletonPtr();
m_poSheet = m_poGUIWindowManager->createWindow("DefaultWindow", "RootSheet");
(*m_poLogManager) << LogLevel_Debug << "+ Setting CEGUI StyleSheet\n";
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
// @FIXME
#else
CEGUI::System::getSingleton().setGUISheet(m_poSheet);
#endif
}
void CApplication::resizeViewport()
......
......@@ -9,7 +9,11 @@
#include <Ogre.h>
#include <vector>
#include <CEGUI.h>
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
#include <CEGUI/RendererModules/Ogre/Renderer.h>
#else
#include <RendererModules/Ogre/CEGUIOgreRenderer.h>
#endif
#include "ovassvepICommand.h"
#include "ovassvepCBasicPainter.h"
......
......@@ -4,6 +4,10 @@
#include "ovassvepCBasicPainter.h"
#include "ovassvepCApplication.h"
#if (OGRE_VERSION_MAJOR > 1) || ((OGRE_VERSION_MAJOR == 1) && (OGRE_VERSION_MINOR >= 9))
#include "Overlay/OgreOverlayContainer.h"
#include "Overlay/OgreOverlayElement.h"
#endif
using namespace Ogre;
using namespace OpenViBESSVEP;
......@@ -32,7 +36,7 @@ using namespace OpenViBE::Kernel;
ManualObject* CBasicPainter::paintRectangle( Ogre::Rectangle oRectangle, Ogre::ColourValue oColour, int iPlane )
ManualObject* CBasicPainter::paintRectangle( Ogre::RealRect oRectangle, Ogre::ColourValue oColour, int iPlane )
{
ManualObject *l_poObject;
......@@ -69,7 +73,7 @@ ManualObject* CBasicPainter::paintRectangle( Ogre::Rectangle oRectangle, Ogre::C
return l_poObject;
}
ManualObject* CBasicPainter::paintTexturedRectangle( Ogre::Rectangle oRectangle, Ogre::String sSurface, int iPlane)
ManualObject* CBasicPainter::paintTexturedRectangle( Ogre::RealRect oRectangle, Ogre::String sSurface, int iPlane)
{
ManualObject *l_poObject;
......
......@@ -5,6 +5,10 @@
#include <Ogre.h>
#if (OGRE_VERSION_MAJOR > 1) || ((OGRE_VERSION_MAJOR == 1) && (OGRE_VERSION_MINOR >= 9))
#include "Overlay/OgreOverlayManager.h"
#endif
#define SSVEP_DEFAULT_COLOUR Ogre::ColourValue(1.0f, 1.0f, 1.0f)
namespace OpenViBESSVEP
......@@ -22,8 +26,8 @@ namespace OpenViBESSVEP
return m_poSceneManager;
}
Ogre::ManualObject* paintRectangle( Ogre::Rectangle oRectangle, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintTexturedRectangle( Ogre::Rectangle oRectangle, Ogre::String sSurface, int iPlane = 1 );
Ogre::ManualObject* paintRectangle( Ogre::RealRect oRectangle, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintTexturedRectangle( Ogre::RealRect oRectangle, Ogre::String sSurface, int iPlane = 1 );
Ogre::ManualObject* paintTriangle( Ogre::Vector2 oP1, Ogre::Vector2 oP2, Ogre::Vector2 oP3, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintTriangle( Ogre::Vector3 oP1, Ogre::Vector3 oP2, Ogre::Vector3 oP3, Ogre::ColourValue oColour = SSVEP_DEFAULT_COLOUR, int iPlane = 1 );
Ogre::ManualObject* paintTexturedTriangle( Ogre::Vector2 oP1, Ogre::Vector2 oP2, Ogre::Vector2 oP3, Ogre::String sSurface, int iPlane = 1 );
......
......@@ -32,6 +32,13 @@ static const float g_fOffset = 2.0f;
#define _strcmpi strcasecmp
#endif
#if !( (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7) )
namespace CEGUI
{
typedef CEGUI::UVector2 USize;
};
#endif
CSpaceshipBCI::CSpaceshipBCI(string s_localization) :
COgreVRApplication(OpenViBE::Directories::getDataDir() + "/applications/vr-demo/spaceship")
{
......@@ -128,7 +135,7 @@ void CSpaceshipBCI::loadGUI()
/*CEGUI::Window * l_poWidget = m_poGUIWindowManager->createWindow("TaharezLook/StaticText", "score");
l_poWidget->setPosition(CEGUI::UVector2(cegui_reldim(0.01f), cegui_reldim(0.01f)) );
l_poWidget->setSize(CEGUI::UVector2(CEGUI::UDim(0.2f, 0.f), CEGUI::UDim(0.08f, 0.f)));
l_poWidget->setSize(CEGUI::USize(CEGUI::UDim(0.2f, 0.f), CEGUI::UDim(0.08f, 0.f)));
m_poSheet->addChildWindow(l_poWidget);
l_poWidget->setFont("BlueHighway-24");
l_poWidget->setText("Score: 0\n");
......@@ -137,36 +144,57 @@ void CSpaceshipBCI::loadGUI()
CEGUI::Window * l_poMove = m_poGUIWindowManager->createWindow("TaharezLook/StaticImage", "Move");
l_poMove->setPosition(CEGUI::UVector2(cegui_reldim(0.35f), cegui_reldim(0.8f)) );
l_poMove->setSize(CEGUI::UVector2(CEGUI::UDim(0.3f, 0.f), CEGUI::UDim(0.2f, 0.f)));
m_poSheet->addChildWindow(l_poMove);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("ImageMove",l_sMoveImage);
l_poMove->setSize(CEGUI::USize(CEGUI::UDim(0.3f, 0.f), CEGUI::UDim(0.2f, 0.f)));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(l_poMove);
CEGUI::ImageManager::getSingleton().addFromImageFile("ImageMove",l_sMoveImage);
#else
m_poSheet->addChildWindow(l_poMove);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("ImageMove", l_sMoveImage);
#endif
l_poMove->setProperty("Image","set:ImageMove image:full_image");
l_poMove->setProperty("FrameEnabled","False");
l_poMove->setProperty("BackgroundEnabled","False");
CEGUI::Window * l_poNoMove = m_poGUIWindowManager->createWindow("TaharezLook/StaticImage", "NoMove");
l_poNoMove->setPosition(CEGUI::UVector2(cegui_reldim(0.35f), cegui_reldim(0.8f)) );
l_poNoMove->setSize(CEGUI::UVector2(CEGUI::UDim(0.3f, 0.f), CEGUI::UDim(0.2f, 0.f)));
m_poSheet->addChildWindow(l_poNoMove);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("ImageNoMove",l_sStopImage);
l_poNoMove->setSize(CEGUI::USize(CEGUI::UDim(0.3f, 0.f), CEGUI::UDim(0.2f, 0.f)));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(l_poNoMove);
CEGUI::ImageManager::getSingleton().addFromImageFile("ImageNoMove",l_sStopImage);
#else
m_poSheet->addChildWindow(l_poNoMove);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("ImageNoMove", l_sStopImage);
#endif
l_poNoMove->setProperty("Image","set:ImageNoMove image:full_image");
l_poNoMove->setProperty("FrameEnabled","False");
l_poNoMove->setProperty("BackgroundEnabled","False");
CEGUI::Window * l_poCalibration = m_poGUIWindowManager->createWindow("TaharezLook/StaticImage", "Calibration");
l_poCalibration->setPosition(CEGUI::UVector2(cegui_reldim(0.35f), cegui_reldim(0.8f)) );
l_poCalibration->setSize(CEGUI::UVector2(CEGUI::UDim(0.3f, 0.f), CEGUI::UDim(0.2f, 0.f)));
m_poSheet->addChildWindow(l_poCalibration);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("ImageCalibration",l_sInitImage);
l_poCalibration->setSize(CEGUI::USize(CEGUI::UDim(0.3f, 0.f), CEGUI::UDim(0.2f, 0.f)));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(l_poCalibration);
CEGUI::ImageManager::getSingleton().addFromImageFile("ImageCalibration",l_sInitImage);
#else
m_poSheet->addChildWindow(l_poCalibration);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("ImageCalibration", l_sInitImage);
#endif
l_poCalibration->setProperty("Image","set:ImageCalibration image:full_image");
l_poCalibration->setProperty("FrameEnabled","False");
l_poCalibration->setProperty("BackgroundEnabled","False");
CEGUI::Window * l_poStatsImage = m_poGUIWindowManager->createWindow("TaharezLook/StaticImage", "StatsImage");
l_poStatsImage->setPosition(CEGUI::UVector2(cegui_reldim(0.25f), cegui_reldim(0.2f)) );
l_poStatsImage->setSize(CEGUI::UVector2(CEGUI::UDim(0.5f, 0.f), CEGUI::UDim(0.2f, 0.f)));
m_poSheet->addChildWindow(l_poStatsImage);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("ImageStatistics",l_sEndImage);
l_poStatsImage->setSize(CEGUI::USize(CEGUI::UDim(0.5f, 0.f), CEGUI::UDim(0.2f, 0.f)));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(l_poStatsImage);
CEGUI::ImageManager::getSingleton().addFromImageFile("ImageStatistics",l_sEndImage);
#else
m_poSheet->addChildWindow(l_poStatsImage);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("ImageStatistics", l_sEndImage);
#endif
l_poStatsImage->setProperty("Image","set:ImageStatistics image:full_image");
l_poStatsImage->setProperty("FrameEnabled","False");
l_poStatsImage->setProperty("BackgroundEnabled","False");
......@@ -174,8 +202,13 @@ void CSpaceshipBCI::loadGUI()
CEGUI::Window * l_poStatistics = m_poGUIWindowManager->createWindow("TaharezLook/StaticText", "Statistics");
l_poStatistics->setPosition(CEGUI::UVector2(cegui_reldim(0.25f), cegui_reldim(0.35f)) );
l_poStatistics->setSize(CEGUI::UVector2(CEGUI::UDim(0.5f, 0.f), CEGUI::UDim(0.5f, 0.f)));
l_poStatistics->setSize(CEGUI::USize(CEGUI::UDim(0.5f, 0.f), CEGUI::UDim(0.5f, 0.f)));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(l_poStatistics);
#else
m_poSheet->addChildWindow(l_poStatistics);
#endif
l_poStatistics->setFont("BlueHighway-24");
l_poStatistics->setProperty("HorzFormatting","WordWrapCentred");
l_poStatistics->setProperty("VertFormatting","WordWrapCentred");
......@@ -183,8 +216,12 @@ void CSpaceshipBCI::loadGUI()
CEGUI::Window * l_poThreshold = m_poGUIWindowManager->createWindow("TaharezLook/StaticText", "Threshold");
l_poThreshold->setPosition(CEGUI::UVector2(cegui_reldim(0.01f), cegui_reldim(0.01f)) );
l_poThreshold->setSize(CEGUI::UVector2(CEGUI::UDim(0.15f, 0.f), CEGUI::UDim(0.08f, 0.f)));
l_poThreshold->setSize(CEGUI::USize(CEGUI::UDim(0.15f, 0.f), CEGUI::UDim(0.08f, 0.f)));
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR > 7)
m_poSheet->addChild(l_poThreshold);
#else
m_poSheet->addChildWindow(l_poThreshold);
#endif
l_poThreshold->setFont("BlueHighway-12");
l_poThreshold->setProperty("HorzFormatting","WordWrapCentred");
l_poThreshold->setProperty("VertFormatting","WordWrapCentred");
......@@ -397,23 +434,23 @@ bool CSpaceshipBCI::process(double timeSinceLastProcess)
switch(m_iPhase)
{
case Phase_Rest:
m_poGUIWindowManager->getWindow("Move")->setVisible(false);
m_poGUIWindowManager->getWindow("NoMove")->setVisible(false);
m_poSheet->getChild("Move")->setVisible(false);
m_poSheet->getChild("NoMove")->setVisible(false);
break;
case Phase_Move:
m_poGUIWindowManager->getWindow("Move")->setVisible(true);
m_poGUIWindowManager->getWindow("NoMove")->setVisible(false);
m_poSheet->getChild("Move")->setVisible(true);
m_poSheet->getChild("NoMove")->setVisible(false);
break;
case Phase_NoMove:
m_poGUIWindowManager->getWindow("Move")->setVisible(false);
m_poGUIWindowManager->getWindow("NoMove")->setVisible(true);
m_poSheet->getChild("Move")->setVisible(false);
m_poSheet->getChild("NoMove")->setVisible(true);
break;
default:
m_poGUIWindowManager->getWindow("Move")->setVisible(false);
m_poGUIWindowManager->getWindow("NoMove")->setVisible(false);
m_poSheet->getChild("Move")->setVisible(false);
m_poSheet->getChild("NoMove")->setVisible(false);
break;
}
std::stringstream ss;
......@@ -422,31 +459,31 @@ bool CSpaceshipBCI::process(double timeSinceLastProcess)
switch(m_iStage)
{
case Stage_Baseline:
m_poGUIWindowManager->getWindow("Move")->setVisible(false);
m_poGUIWindowManager->getWindow("NoMove")->setVisible(false);
m_poGUIWindowManager->getWindow("Calibration")->setVisible(true);
m_poGUIWindowManager->getWindow("Statistics")->setVisible(false);
m_poGUIWindowManager->getWindow("StatsImage")->setVisible(false);