Commit 7b6a89ed authored by MONSEIGNE Thibaut's avatar MONSEIGNE Thibaut

Fix: Coding Rules Useless Typedef (u)int(8|16|32|64)

parent 254ee860
...@@ -58,7 +58,7 @@ bool CShooterApplication::setup(IKernelContext* poKernelContext) ...@@ -58,7 +58,7 @@ bool CShooterApplication::setup(IKernelContext* poKernelContext)
CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady", "InstructionText-Start.png"); CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady", "InstructionText-Start.png");
m_poInstructionsReady->setProperty("Image", "InstructionsReady"); m_poInstructionsReady->setProperty("Image", "InstructionsReady");
#else #else
m_poSheet->addChildWindow(m_poInstructionsReady); m_sheet->addChildWindow(m_poInstructionsReady);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady", "InstructionText-Start.png"); CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady", "InstructionText-Start.png");
m_poInstructionsReady->setProperty("Image", "set:InstructionsReady image:full_image"); m_poInstructionsReady->setProperty("Image", "set:InstructionsReady image:full_image");
#endif #endif
......
...@@ -11,120 +11,102 @@ ...@@ -11,120 +11,102 @@
using namespace OpenViBESSVEP; using namespace OpenViBESSVEP;
using namespace Ogre; using namespace Ogre;
CStarShip::CStarShip(CApplication* poApplication, SceneNode* poParentNode, Real rRadius, std::vector<std::pair<uint32_t, uint32_t>>* pFrequencies) : CStarShip::CStarShip(CApplication* poApplication, SceneNode* poParentNode, Real radius, std::vector<std::pair<uint32_t, uint32_t>>* pFrequencies) :
m_rCurrentAngle(0), m_rCurrentAngle(0),
m_iCurrentRotationCount(0), m_iCurrentRotationCount(0),
m_bIsShooting(false) m_bIsShooting(false)
{ {
// get configuration and controlling objects // get configuration and controlling objects
OpenViBE::Kernel::IConfigurationManager* l_poConfigurationManager = poApplication->getConfigurationManager(); OpenViBE::Kernel::IConfigurationManager* l_poConfigurationManager = poApplication->getConfigurationManager();
CBasicPainter* l_poPainter = poApplication->getPainter(); CBasicPainter* painter = poApplication->getPainter();
m_rAngularSpeed = (Real)l_poConfigurationManager->expandAsFloat("${SSVEP_ShipAngularSpeed}", Math::PI / 60.0f); m_rAngularSpeed = (Real)l_poConfigurationManager->expandAsFloat("${SSVEP_ShipAngularSpeed}", Math::PI / 60.0f);
poApplication->getLogManager() << OpenViBE::Kernel::LogLevel_Info << "Ship Angluar Speed : " << m_rAngularSpeed << "\n"; poApplication->getLogManager() << OpenViBE::Kernel::LogLevel_Info << "Ship Angluar Speed : " << m_rAngularSpeed << "\n";
ColourValue l_oLightColour = ColourValue( ColourValue lightColor = ColourValue(
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourRed}", 1.0f)), float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourRed}", 1.0f)),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourGreen}", 1.0f)), float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourGreen}", 1.0f)),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourBlue}", 1.0f))); float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourBlue}", 1.0f)));
ColourValue l_oDarkColour = ColourValue( ColourValue darkColor = ColourValue(
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourRed}", 0.0f)), float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourRed}", 0.0f)),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourGreen}", 0.0f)), float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourGreen}", 0.0f)),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourBlue}", 0.0f))); float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourBlue}", 0.0f)));
// draw the ship scene objects // draw the ship scene objects
m_poShipNode = poParentNode->createChildSceneNode(); m_poShipNode = poParentNode->createChildSceneNode();
m_poShotNode = m_poShipNode->createChildSceneNode(); m_poShotNode = m_poShipNode->createChildSceneNode();
MovableObject* l_poShipHull; MovableObject* shipHull;
l_poShipHull = l_poPainter->paintCircle(0.0f, 0.0f, rRadius, SSVEP_SHIP_HULL_COLOUR, false, 2); shipHull = painter->paintCircle(0.0f, 0.0f, radius, SSVEP_SHIP_HULL_COLOUR, false, 2);
m_poShipNode->attachObject(l_poShipHull); m_poShipNode->attachObject(shipHull);
l_poShipHull->setVisible(true); shipHull->setVisible(true);
SceneNode* l_poDrawnObjectNode; SceneNode* drawnObjectNode;
MovableObject* l_poDrawnObject; MovableObject* drawnObject;
// Ogre::RealRect l_oWingRectangle = { - rRadius * 0.4f, rRadius * 0.4f, rRadius * 0.4f, -rRadius * 0.4f }; // Ogre::RealRect l_oWingRectangle = { - radius * 0.4f, radius * 0.4f, radius * 0.4f, -radius * 0.4f };
RealRect l_oWingRectangle(-rRadius * 0.4f, rRadius * 0.4f, rRadius * 0.4f, -rRadius * 0.4f); RealRect wingRectangle(-radius * 0.4f, radius * 0.4f, radius * 0.4f, -radius * 0.4f);
// paint the cannon // paint the cannon
l_poDrawnObjectNode = m_poShipNode->createChildSceneNode(); drawnObjectNode = m_poShipNode->createChildSceneNode();
l_poDrawnObject = l_poPainter->paintTriangle( drawnObject = painter->paintTriangle(Point(0.0f, radius * 0.4f), Point(- radius * 0.4f, -radius * 0.4f), Point(radius * 0.4f, -radius * 0.4f), lightColor);
Point(0.0f, rRadius * 0.4f), drawnObject->setVisible(true);
Point(- rRadius * 0.4f, -rRadius * 0.4f), drawnObjectNode->attachObject(drawnObject);
Point(rRadius * 0.4f, -rRadius * 0.4f),
l_oLightColour
);
l_poDrawnObject->setVisible(true);
l_poDrawnObjectNode->attachObject(l_poDrawnObject);
l_poDrawnObject = l_poPainter->paintTriangle( drawnObject = painter->paintTriangle(Point(0.0f, radius * 0.4f), Point(- radius * 0.4f, -radius * 0.4f), Point(radius * 0.4f, -radius * 0.4f), darkColor);
Point(0.0f, rRadius * 0.4f), drawnObject->setVisible(false);
Point(- rRadius * 0.4f, -rRadius * 0.4f), drawnObjectNode->attachObject(drawnObject);
Point(rRadius * 0.4f, -rRadius * 0.4f),
l_oDarkColour
);
l_poDrawnObject->setVisible(false);
l_poDrawnObjectNode->attachObject(l_poDrawnObject);
l_poDrawnObjectNode->setPosition(0.0, rRadius, 0.0); drawnObjectNode->setPosition(0.0, radius, 0.0);
m_poShipCannon = new CSSVEPFlickeringObject(l_poDrawnObjectNode, (*pFrequencies)[1].first, (*pFrequencies)[1].second); m_poShipCannon = new CSSVEPFlickeringObject(drawnObjectNode, (*pFrequencies)[1].first, (*pFrequencies)[1].second);
// paint the left wing // paint the left wing
l_poDrawnObjectNode = m_poShipNode->createChildSceneNode(); drawnObjectNode = m_poShipNode->createChildSceneNode();
l_poDrawnObject = l_poPainter->paintRectangle(l_oWingRectangle, l_oLightColour); drawnObject = painter->paintRectangle(wingRectangle, lightColor);
l_poDrawnObject->setVisible(true); drawnObject->setVisible(true);
l_poDrawnObjectNode->attachObject(l_poDrawnObject); drawnObjectNode->attachObject(drawnObject);
l_poDrawnObject = l_poPainter->paintRectangle(l_oWingRectangle, l_oDarkColour); drawnObject = painter->paintRectangle(wingRectangle, darkColor);
l_poDrawnObject->setVisible(false); drawnObject->setVisible(false);
l_poDrawnObjectNode->attachObject(l_poDrawnObject); drawnObjectNode->attachObject(drawnObject);
l_poDrawnObjectNode->setPosition(-rRadius * 0.875f, -rRadius * 0.875f, 0.0); drawnObjectNode->setPosition(-radius * 0.875f, -radius * 0.875f, 0.0);
m_poShipLeftWing = new CSSVEPFlickeringObject(l_poDrawnObjectNode, (*pFrequencies)[2].first, (*pFrequencies)[2].second); m_poShipLeftWing = new CSSVEPFlickeringObject(drawnObjectNode, (*pFrequencies)[2].first, (*pFrequencies)[2].second);
// paint the right wing // paint the right wing
l_poDrawnObjectNode = m_poShipNode->createChildSceneNode(); drawnObjectNode = m_poShipNode->createChildSceneNode();
l_poDrawnObject = l_poPainter->paintRectangle(l_oWingRectangle, l_oLightColour); drawnObject = painter->paintRectangle(wingRectangle, lightColor);
l_poDrawnObject->setVisible(true); drawnObject->setVisible(true);
l_poDrawnObjectNode->attachObject(l_poDrawnObject); drawnObjectNode->attachObject(drawnObject);
l_poDrawnObject = l_poPainter->paintRectangle(l_oWingRectangle, l_oDarkColour); drawnObject = painter->paintRectangle(wingRectangle, darkColor);
l_poDrawnObject->setVisible(false); drawnObject->setVisible(false);
l_poDrawnObjectNode->attachObject(l_poDrawnObject); drawnObjectNode->attachObject(drawnObject);
l_poDrawnObjectNode->setPosition(rRadius * 0.875f, -rRadius * 0.875f, 0.0f); drawnObjectNode->setPosition(radius * 0.875f, -radius * 0.875f, 0.0f);
m_poShipRightWing = new CSSVEPFlickeringObject(l_poDrawnObjectNode, (*pFrequencies)[3].first, (*pFrequencies)[3].second); m_poShipRightWing = new CSSVEPFlickeringObject(drawnObjectNode, (*pFrequencies)[3].first, (*pFrequencies)[3].second);
// create the shot // create the shot
l_poDrawnObject = l_poPainter->paintTriangle( drawnObject = painter->paintTriangle(Point(0.0f, radius * 0.25f), Point(-radius * 0.125f, 0.0f), Point(radius * 0.125f, 0.0f), ColourValue(1.0f, 1.0f, 0.0f));
Point(0.0f, rRadius * 0.25f), drawnObject->setVisible(false);
Point(-rRadius * 0.125f, 0.0f),
Point(rRadius * 0.125f, 0.0f),
ColourValue(1.0f, 1.0f, 0.0f));
l_poDrawnObject->setVisible(false);
m_poShotNode->attachObject(l_poDrawnObject); m_poShotNode->attachObject(drawnObject);
l_poDrawnObject = l_poPainter->paintTriangle( drawnObject = painter->paintTriangle(Point(-radius * 0.125f, 0.0f), Point(0.0f, -radius * 0.75f), Point(radius * 0.125f, 0.0f), ColourValue(1.0f, 1.0f, 0.0f));
Point(-rRadius * 0.125f, 0.0f), drawnObject->setVisible(false);
Point(0.0f, -rRadius * 0.75f),
Point(rRadius * 0.125f, 0.0f),
ColourValue(1.0f, 1.0f, 0.0f));
l_poDrawnObject->setVisible(false);
m_poShotNode->attachObject(l_poDrawnObject); m_poShotNode->attachObject(drawnObject);
} }
void CStarShip::processFrame(uint32_t ui32CurrentFrame) void CStarShip::processFrame(uint32_t ui32CurrentFrame)
...@@ -136,9 +118,7 @@ void CStarShip::processFrame(uint32_t ui32CurrentFrame) ...@@ -136,9 +118,7 @@ void CStarShip::processFrame(uint32_t ui32CurrentFrame)
if (m_iCurrentRotationCount != 0) if (m_iCurrentRotationCount != 0)
{ {
m_poShipNode->roll(Radian(m_rAngularSpeed * SIGN( m_iCurrentRotationCount ))); m_poShipNode->roll(Radian(m_rAngularSpeed * SIGN( m_iCurrentRotationCount )));
m_rCurrentAngle += Radian(m_rAngularSpeed * SIGN( m_iCurrentRotationCount )); m_rCurrentAngle += Radian(m_rAngularSpeed * SIGN( m_iCurrentRotationCount ));
m_iCurrentRotationCount -= SIGN( m_iCurrentRotationCount ); m_iCurrentRotationCount -= SIGN( m_iCurrentRotationCount );
} }
......
...@@ -14,7 +14,7 @@ namespace OpenViBESSVEP ...@@ -14,7 +14,7 @@ namespace OpenViBESSVEP
class CStarShip class CStarShip
{ {
public: public:
CStarShip(CApplication* poApplication, Ogre::SceneNode* poParentNode, Ogre::Real rRadius, std::vector<std::pair<uint32_t, uint32_t>>* pFrequencies); CStarShip(CApplication* poApplication, Ogre::SceneNode* poParentNode, Ogre::Real radius, std::vector<std::pair<uint32_t, uint32_t>>* pFrequencies);
void processFrame(uint32_t ui32CurrentFrame); void processFrame(uint32_t ui32CurrentFrame);
void rotate(int iRotationCount); void rotate(int iRotationCount);
......
...@@ -52,7 +52,7 @@ bool CTrainerApplication::setup(IKernelContext* poKernelContext) ...@@ -52,7 +52,7 @@ bool CTrainerApplication::setup(IKernelContext* poKernelContext)
CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady", "InstructionText-Start.png"); CEGUI::ImageManager::getSingleton().addFromImageFile("InstructionsReady", "InstructionText-Start.png");
m_poInstructionsReady->setProperty("Image", "InstructionsReady"); m_poInstructionsReady->setProperty("Image", "InstructionsReady");
#else #else
m_poSheet->addChildWindow(m_poInstructionsReady); m_sheet->addChildWindow(m_poInstructionsReady);
CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady", "InstructionText-Start.png"); CEGUI::ImagesetManager::getSingleton().createFromImageFile("InstructionsReady", "InstructionText-Start.png");
m_poInstructionsReady->setProperty("Image", "set:InstructionsReady image:full_image"); m_poInstructionsReady->setProperty("Image", "set:InstructionsReady image:full_image");
#endif #endif
......
...@@ -6,55 +6,55 @@ ...@@ -6,55 +6,55 @@
using namespace Ogre; using namespace Ogre;
using namespace OpenViBESSVEP; using namespace OpenViBESSVEP;
SceneNode* CTrainerFlickeringObject::m_poParentNode = nullptr; SceneNode* CTrainerFlickeringObject::m_parentNode = nullptr;
CBasicPainter* CTrainerFlickeringObject::m_poPainter = nullptr; CBasicPainter* CTrainerFlickeringObject::m_painter = nullptr;
ColourValue CTrainerFlickeringObject::m_oLightColour = ColourValue(1.0f, 1.0f, 1.0f); ColourValue CTrainerFlickeringObject::m_lightColor = ColourValue(1.0f, 1.0f, 1.0f);
ColourValue CTrainerFlickeringObject::m_oDarkColour = ColourValue(0.0f, 0.0f, 0.0f); ColourValue CTrainerFlickeringObject::m_darkColor = ColourValue(0.0f, 0.0f, 0.0f);
float CTrainerFlickeringObject::m_f32TargetWidth = 0.2f; float CTrainerFlickeringObject::m_targetWidth = 0.2f;
float CTrainerFlickeringObject::m_f32TargetHeight = 0.2f; float CTrainerFlickeringObject::m_targetHeight = 0.2f;
CTrainerApplication* CTrainerFlickeringObject::m_poApplication = nullptr; CTrainerApplication* CTrainerFlickeringObject::m_application = nullptr;
void CTrainerFlickeringObject::initialize(CTrainerApplication* poApplication) void CTrainerFlickeringObject::initialize(CTrainerApplication* poApplication)
{ {
m_poApplication = poApplication; m_application = poApplication;
OpenViBE::Kernel::IConfigurationManager* l_poConfigurationManager = poApplication->getConfigurationManager(); OpenViBE::Kernel::IConfigurationManager* l_poConfigurationManager = poApplication->getConfigurationManager();
m_poPainter = poApplication->getPainter(); m_painter = poApplication->getPainter();
m_poParentNode = poApplication->getSceneNode(); m_parentNode = poApplication->getSceneNode();
m_f32TargetWidth = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetWidth}")); m_targetWidth = float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetWidth}"));
m_f32TargetHeight = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetHeight}")); m_targetHeight = float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetHeight}"));
m_oLightColour = ColourValue( m_lightColor = ColourValue(
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourRed}")), float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourRed}")),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourGreen}")), float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourGreen}")),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourBlue}"))); float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetLightColourBlue}")));
m_oDarkColour = ColourValue( m_darkColor = ColourValue(
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourRed}")), float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourRed}")),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourGreen}")), float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourGreen}")),
(float)(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourBlue}"))); float(l_poConfigurationManager->expandAsFloat("${SSVEP_TargetDarkColourBlue}")));
} }
CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObject(uint32_t l_i32TargetId) CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObject(uint32_t l_i32TargetId)
{ {
OpenViBE::Kernel::IConfigurationManager* l_poConfigurationManager = m_poApplication->getConfigurationManager(); OpenViBE::Kernel::IConfigurationManager* l_poConfigurationManager = m_application->getConfigurationManager();
if (m_poPainter != nullptr) if (m_painter != nullptr)
{ {
ColourValue l_oCurrentTargetColour = (l_i32TargetId == 0) ? m_oDarkColour : m_oLightColour; ColourValue l_oCurrentTargetColour = (l_i32TargetId == 0) ? m_darkColor : m_lightColor;
char l_sTargetIdString[255]; char l_sTargetIdString[255];
sprintf(l_sTargetIdString, "%d", l_i32TargetId); sprintf(l_sTargetIdString, "%d", l_i32TargetId);
OpenViBE::CIdentifier l_oTargetId = l_poConfigurationManager->createConfigurationToken("SSVEPTarget_Id", OpenViBE::CString(l_sTargetIdString)); OpenViBE::CIdentifier l_oTargetId = l_poConfigurationManager->createConfigurationToken("SSVEPTarget_Id", OpenViBE::CString(l_sTargetIdString));
float l_f32TargetX = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_Target_X_${SSVEPTarget_Id}}")); float l_f32TargetX = float(l_poConfigurationManager->expandAsFloat("${SSVEP_Target_X_${SSVEPTarget_Id}}"));
float l_f32TargetY = (float)(l_poConfigurationManager->expandAsFloat("${SSVEP_Target_Y_${SSVEPTarget_Id}}")); float l_f32TargetY = float(l_poConfigurationManager->expandAsFloat("${SSVEP_Target_Y_${SSVEPTarget_Id}}"));
uint32_t l_ui32FramesL = (*(m_poApplication->getFrequencies()))[l_i32TargetId].first; uint32_t l_ui32FramesL = (*(m_application->getFrequencies()))[l_i32TargetId].first;
uint32_t l_ui32FramesD = (*(m_poApplication->getFrequencies()))[l_i32TargetId].second; uint32_t l_ui32FramesD = (*(m_application->getFrequencies()))[l_i32TargetId].second;
m_poApplication->getLogManager() << OpenViBE::Kernel::LogLevel_Info << "New trainer object : id=" << l_i32TargetId << " litFrames=" << l_ui32FramesL << " darkFrames=" << l_ui32FramesD << "\n"; m_application->getLogManager() << OpenViBE::Kernel::LogLevel_Info << "New trainer object : id=" << l_i32TargetId << " litFrames=" << l_ui32FramesL << " darkFrames=" << l_ui32FramesD << "\n";
l_poConfigurationManager->releaseConfigurationToken(l_oTargetId); l_poConfigurationManager->releaseConfigurationToken(l_oTargetId);
...@@ -62,12 +62,12 @@ CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObjec ...@@ -62,12 +62,12 @@ CTrainerFlickeringObject* CTrainerFlickeringObject::createTrainerFlickeringObjec
} }
else else
{ {
m_poApplication->getLogManager() << OpenViBE::Kernel::LogLevel_Fatal << "TrainerTarget object was not properly initialized\n"; m_application->getLogManager() << OpenViBE::Kernel::LogLevel_Fatal << "TrainerTarget object was not properly initialized\n";
return nullptr; return nullptr;
} }
} }
CTrainerFlickeringObject::CTrainerFlickeringObject(float f32PosX, float f32PosY, ColourValue oColour, OpenViBE::uint8 ui8LitFrames, uint8_t ui8DarkFrames) : CTrainerFlickeringObject::CTrainerFlickeringObject(float f32PosX, float f32PosY, ColourValue oColour, uint8_t ui8LitFrames, uint8_t ui8DarkFrames) :
CSSVEPFlickeringObject(nullptr, ui8LitFrames, ui8DarkFrames) CSSVEPFlickeringObject(nullptr, ui8LitFrames, ui8DarkFrames)
{ {
SceneNode* l_poPointerNode; SceneNode* l_poPointerNode;
...@@ -75,26 +75,22 @@ CTrainerFlickeringObject::CTrainerFlickeringObject(float f32PosX, float f32PosY, ...@@ -75,26 +75,22 @@ CTrainerFlickeringObject::CTrainerFlickeringObject(float f32PosX, float f32PosY,
MovableObject* l_poLitObject; MovableObject* l_poLitObject;
MovableObject* l_poDarkObject; MovableObject* l_poDarkObject;
m_poElementNode = m_poParentNode->createChildSceneNode(); m_poElementNode = m_parentNode->createChildSceneNode();
m_poObjectNode = m_poElementNode->createChildSceneNode(); m_poObjectNode = m_poElementNode->createChildSceneNode();
l_poPointerNode = m_poElementNode->createChildSceneNode(); l_poPointerNode = m_poElementNode->createChildSceneNode();
RealRect l_oRectangle(f32PosX - m_f32TargetWidth / 2, f32PosY + m_f32TargetHeight / 2, f32PosX + m_f32TargetWidth / 2, f32PosY - m_f32TargetHeight / 2); RealRect l_oRectangle(f32PosX - m_targetWidth / 2, f32PosY + m_targetHeight / 2, f32PosX + m_targetWidth / 2, f32PosY - m_targetHeight / 2);
l_poLitObject = m_poPainter->paintRectangle(l_oRectangle, oColour); l_poLitObject = m_painter->paintRectangle(l_oRectangle, oColour);
m_poObjectNode->attachObject(l_poLitObject); m_poObjectNode->attachObject(l_poLitObject);
l_poLitObject->setVisible(true); l_poLitObject->setVisible(true);
l_poDarkObject = m_poPainter->paintRectangle(l_oRectangle, m_oDarkColour); l_poDarkObject = m_painter->paintRectangle(l_oRectangle, m_darkColor);
m_poObjectNode->attachObject(l_poDarkObject); m_poObjectNode->attachObject(l_poDarkObject);
l_poDarkObject->setVisible(false); l_poDarkObject->setVisible(false);
m_poPointer = m_poPainter->paintTriangle( m_poPointer = m_painter->paintTriangle(Point(f32PosX - 0.05f, f32PosY + m_targetHeight), Point(f32PosX, f32PosY + m_targetHeight - 0.05f), Point(f32PosX + 0.05f, f32PosY + m_targetHeight), ColourValue(1, 1, 0));
Point(f32PosX - 0.05f, f32PosY + m_f32TargetHeight),
Point(f32PosX, f32PosY + m_f32TargetHeight - 0.05f),
Point(f32PosX + 0.05f, f32PosY + m_f32TargetHeight),
ColourValue(1, 1, 0));
l_poPointerNode->attachObject(m_poPointer); l_poPointerNode->attachObject(m_poPointer);
m_poPointer->setVisible(false); m_poPointer->setVisible(false);
......
...@@ -29,15 +29,15 @@ namespace OpenViBESSVEP ...@@ -29,15 +29,15 @@ namespace OpenViBESSVEP
} }
private: private:
static CTrainerApplication* m_poApplication; static CTrainerApplication* m_application;
static Ogre::SceneNode* m_poParentNode; static Ogre::SceneNode* m_parentNode;
static CBasicPainter* m_poPainter; static CBasicPainter* m_painter;
static float m_f32TargetWidth; static float m_targetWidth;
static float m_f32TargetHeight; static float m_targetHeight;
static Ogre::ColourValue m_oLightColour; static Ogre::ColourValue m_lightColor;
static Ogre::ColourValue m_oDarkColour; static Ogre::ColourValue m_darkColor;
CTrainerFlickeringObject(float f32PosX, float f32PosY, Ogre::ColourValue oColour, OpenViBE::uint8 ui8LitFrames, uint8_t ui8DarkFrames); CTrainerFlickeringObject(float f32PosX, float f32PosY, Ogre::ColourValue oColour, uint8_t ui8LitFrames, uint8_t ui8DarkFrames);
Ogre::SceneNode* m_poElementNode; Ogre::SceneNode* m_poElementNode;
......
...@@ -23,7 +23,7 @@ CApplication::~CApplication() ...@@ -23,7 +23,7 @@ CApplication::~CApplication()
{ {
if (m_poPainter != nullptr) if (m_poPainter != nullptr)
{ {
(*m_poLogManager) << LogLevel_Debug << "- m_poPainter\n"; (*m_poLogManager) << LogLevel_Debug << "- m_painter\n";
delete m_poPainter; delete m_poPainter;
m_poPainter = nullptr; m_poPainter = nullptr;
} }
...@@ -40,7 +40,7 @@ CApplication::~CApplication() ...@@ -40,7 +40,7 @@ CApplication::~CApplication()
} }
(*m_poLogManager) << LogLevel_Debug << "- m_poRoot\n"; (*m_poLogManager) << LogLevel_Debug << "- m_root\n";
if (m_poRoot != nullptr) if (m_poRoot != nullptr)
{ {
delete m_poRoot; delete m_poRoot;
...@@ -73,7 +73,7 @@ bool CApplication::setup(IKernelContext* poKernelContext) ...@@ -73,7 +73,7 @@ bool CApplication::setup(IKernelContext* poKernelContext)
// Root creation // Root creation
CString l_sOgreCfg = l_poConfigurationManager->expand("${Path_UserData}") + "/openvibe-ssvep-demo-ogre.cfg"; CString l_sOgreCfg = l_poConfigurationManager->expand("${Path_UserData}") + "/openvibe-ssvep-demo-ogre.cfg";
(*m_poLogManager) << LogLevel_Debug << "+ m_poRoot = new Ogre::Root(...)\n"; (*m_poLogManager) << LogLevel_Debug << "+ m_root = new Ogre::Root(...)\n";
(*m_poLogManager) << LogLevel_Info << "Ogre cfg file : " << l_sOgreCfg << "\n"; (*m_poLogManager) << LogLevel_Info << "Ogre cfg file : " << l_sOgreCfg << "\n";
m_poRoot = new Ogre::Root(l_sPluginsPath.toASCIIString(), l_sOgreCfg.toASCIIString(), l_sOgreLog.toASCIIString()); m_poRoot = new Ogre::Root(l_sPluginsPath.toASCIIString(), l_sOgreCfg.toASCIIString(), l_sOgreLog.toASCIIString());
...@@ -87,7 +87,7 @@ bool CApplication::setup(IKernelContext* poKernelContext) ...@@ -87,7 +87,7 @@ bool CApplication::setup(IKernelContext* poKernelContext)
return false; return false;
} }
// m_poWindow = m_poRoot->initialise(true); // m_window = m_root->initialise(true);
Ogre::NameValuePairList l_oOptionList; Ogre::NameValuePairList l_oOptionList;
...@@ -108,14 +108,14 @@ bool CApplication::setup(IKernelContext* poKernelContext) ...@@ -108,14 +108,14 @@ bool CApplication::setup(IKernelContext* poKernelContext)
m_poViewport = m_poWindow->addViewport(m_poCamera, 1); m_poViewport = m_poWindow->addViewport(m_poCamera, 1);
this->resizeViewport(); this->resizeViewport();
// m_poViewport->setBackgroundColour(Ogre::ColourValue(0.0, 0.5, 0.5)); // m_viewport->setBackgroundColour(Ogre::ColourValue(0.0, 0.5, 0.5));
m_poCamera->setAspectRatio(Ogre::Real(m_poViewport->getActualWidth()) / Ogre::Real(m_poViewport->getActualHeight())); m_poCamera->setAspectRatio(Ogre::Real(m_poViewport->getActualWidth()) / Ogre::Real(m_poViewport->getActualHeight()));
m_poSceneNode = m_poSceneManager->getRootSceneNode()->createChildSceneNode("SSVEPApplicationNode"); m_poSceneNode = m_poSceneManager->getRootSceneNode()->createChildSceneNode("SSVEPApplicationNode");
// initialize the painter object // initialize the painter object
(*m_poLogManager) << LogLevel_Debug << "+ m_poPainter = new CBasicPainter(...)\n"; (*m_poLogManager) << LogLevel_Debug << "+ m_painter = new CBasicPainter(...)\n";
m_poPainter = new CBasicPainter(this); m_poPainter = new CBasicPainter(this);
(*m_poLogManager) << LogLevel_Debug << " * initializing CEGUI\n"; (*m_poLogManager) << LogLevel_Debug << " * initializing CEGUI\n";
...@@ -185,7 +185,7 @@ bool CApplication::configure() ...@@ -185,7 +185,7 @@ bool CApplication::configure()
// Set hard-coded parameters, VSync in particular // Set hard-coded parameters, VSync in particular
m_poRoot->getRenderSystem()->setConfigOption("VSync", "True"); m_poRoot->getRenderSystem()->setConfigOption("VSync", "True");
// m_poRoot->getRenderSystem()->setConfigOption("Full Screen", "Yes"); // m_root->getRenderSystem()->setConfigOption("Full Screen", "Yes");
m_poRoot->getRenderSystem()->setConfigOption("Video Mode", "640 x 480 @ 16-bit colour"); m_poRoot->getRenderSystem()->setConfigOption("Video Mode", "640 x 480 @ 16-bit colour");
...@@ -222,7 +222,7 @@ void CApplication::initCEGUI(const char* logFilename) ...@@ -222,7 +222,7 @@ void CApplication::initCEGUI(const char* logFilename)
#if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR >= 8) #if (CEGUI_VERSION_MAJOR > 0) || (CEGUI_VERSION_MINOR >= 8)
CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(m_poSheet); CEGUI::System::getSingleton().getDefaultGUIContext().setRootWindow(m_poSheet);
#else #else
CEGUI::System::getSingleton().setGUISheet(m_poSheet); CEGUI::System::getSingleton().setGUISheet(m_sheet);
#endif #endif
} }
...@@ -230,14 +230,14 @@ void CApplication::resizeViewport() ...@@ -230,14 +230,14 @@ void CApplication::resizeViewport()
{ {
(*m_poLogManager) << LogLevel_Trace << "Creating a new viewport\n"; (*m_poLogManager) << LogLevel_Trace << "Creating a new viewport\n";