diff --git a/src/starsphere/Starsphere.cpp b/src/starsphere/Starsphere.cpp index c5b11ce9b51c11cf51f60225d5ae9145dd23ed55..0a66c9ef43fca348c12c636fe0b7d20fa305bc6b 100644 --- a/src/starsphere/Starsphere.cpp +++ b/src/starsphere/Starsphere.cpp @@ -659,31 +659,7 @@ void Starsphere::initialize(const int width, const int height, const Resource *f } else { - // create large font instances using font resource (base address + size) - m_FontLogo1 = new OGLFT::TranslucentTexture( - &m_FontResource->data()->at(0), - m_FontResource->data()->size(), - 26, 78 ); - - if ( m_FontLogo1 == 0 || !m_FontLogo1->isValid() ) { - cerr << "Could not construct logo1 font face from in memory resource!" << endl; - return; - } - - m_FontLogo1->setForegroundColor(1.0, 1.0, 0.0, 1.0); - - // create medium font instances using font resource (base address + size) - m_FontLogo2 = new OGLFT::TranslucentTexture( - &m_FontResource->data()->at(0), - m_FontResource->data()->size(), - 12, 72 ); - - if ( m_FontLogo2 == 0 || !m_FontLogo2->isValid() ) { - cerr << "Could not construct logo2 font face from in memory resource!" << endl; - return; - } - - m_FontLogo2->setForegroundColor(0.75, 0.75, 0.75, 1.0); + // note: initialization of logo font instances is done in subclasses! // create medium font instances using font resource (base address + size) m_FontHeader = new OGLFT::TranslucentTexture( @@ -888,9 +864,8 @@ void Starsphere::render(const double timeOfDay) glLoadIdentity(); if (isFeature(LOGO)) { - m_FontLogo1->draw(m_XStartPosLeft, m_YStartPosTop, "Einstein@Home"); - m_FontLogo2->draw(m_XStartPosLeft + 25, m_YStartPosTop - m_YOffsetLarge, "World Year of Physics 2005"); - m_FontLogo2->draw(m_XStartPosLeft, m_YStartPosTop - m_YOffsetLarge - 14, "International Year of Astronomy 2009"); + // call subclass implementation + renderLogo(); } if (isFeature(SEARCHINFO)) renderSearchInformation(); diff --git a/src/starsphere/Starsphere.h b/src/starsphere/Starsphere.h index 8edfb060a3bec837ea7390fe9fda9ef5584de21b..edfb0cca53f1351e5ccdb08fc63e2da8e6c61b67 100644 --- a/src/starsphere/Starsphere.h +++ b/src/starsphere/Starsphere.h @@ -138,6 +138,14 @@ protected: */ Starsphere(string sharedMemoryIdentifier); + /** + * \brief Render science run specific logo + * + * This abtract method is to be defined by derived classes implementing + * the science run specific logo rendering. + */ + inline virtual void renderLogo() = 0; + /** * \brief Render science run specific search information * diff --git a/src/starsphere/StarsphereRadio.cpp b/src/starsphere/StarsphereRadio.cpp index ecd5f6d8e49ea6e5ceb9b582d0c29a5d5ab5d2fd..1312eb2a0bf6843e9539b46c6d04005a69555a3a 100644 --- a/src/starsphere/StarsphereRadio.cpp +++ b/src/starsphere/StarsphereRadio.cpp @@ -72,6 +72,32 @@ void StarsphereRadio::initialize(const int width, const int height, const Resour m_PowerSpectrumLabelYPos = m_PowerSpectrumYPos - m_PowerSpectrumLabelYOffset; } + // create large font instances using font resource (base address + size) + m_FontLogo1 = new OGLFT::TranslucentTexture( + &m_FontResource->data()->at(0), + m_FontResource->data()->size(), + 26, 78 ); + + if ( m_FontLogo1 == 0 || !m_FontLogo1->isValid() ) { + cerr << "Could not construct logo1 font face from in memory resource!" << endl; + return; + } + + m_FontLogo1->setForegroundColor(1.0, 1.0, 0.0, 1.0); + + // create medium font instances using font resource (base address + size) + m_FontLogo2 = new OGLFT::TranslucentTexture( + &m_FontResource->data()->at(0), + m_FontResource->data()->size(), + 12, 72 ); + + if ( m_FontLogo2 == 0 || !m_FontLogo2->isValid() ) { + cerr << "Could not construct logo2 font face from in memory resource!" << endl; + return; + } + + m_FontLogo2->setForegroundColor(0.75, 0.75, 0.75, 1.0); + // prepare power spectrum generatePowerSpectrumCoordSystem(m_PowerSpectrumXPos, m_PowerSpectrumYPos); @@ -410,3 +436,9 @@ void StarsphereRadio::generateObservatories(float dimFactor) glEndList(); } + +void StarsphereRadio::renderLogo() +{ + m_FontLogo1->draw(m_XStartPosLeft, m_YStartPosTop, "Einstein@Home"); + m_FontLogo2->draw(m_XStartPosLeft, m_YStartPosTop - m_YOffsetLarge, "International Year of Astronomy 2009"); +} diff --git a/src/starsphere/StarsphereRadio.h b/src/starsphere/StarsphereRadio.h index be81bb8aa74566ef1079be4836436a00c8349523..7a8b5d36c9ba154685ab19740b55d18713bb966c 100644 --- a/src/starsphere/StarsphereRadio.h +++ b/src/starsphere/StarsphereRadio.h @@ -100,6 +100,14 @@ public: void refreshBOINCInformation(); private: + /** + * \brief Render science run specific logo + * + * This specific implementation shows the usual "Einstein@Home" logo combined + * with "International Year of Astronomy 2009" as subtitle + */ + inline void renderLogo(); + /** * \brief Render science run specific search information * diff --git a/src/starsphere/StarsphereS5R3.cpp b/src/starsphere/StarsphereS5R3.cpp index bc8b5d4ddc9aae7066d7df97109947ab9ad1845e..93cdcba2cb16aef7e07220d482274edabf31d22a 100644 --- a/src/starsphere/StarsphereS5R3.cpp +++ b/src/starsphere/StarsphereS5R3.cpp @@ -51,6 +51,32 @@ void StarsphereS5R3::initialize(const int width, const int height, const Resourc m_Y4StartPosBottom = m_Y3StartPosBottom - m_YOffsetMedium; } + // create large font instances using font resource (base address + size) + m_FontLogo1 = new OGLFT::TranslucentTexture( + &m_FontResource->data()->at(0), + m_FontResource->data()->size(), + 24, 72 ); + + if ( m_FontLogo1 == 0 || !m_FontLogo1->isValid() ) { + cerr << "Could not construct logo1 font face from in memory resource!" << endl; + return; + } + + m_FontLogo1->setForegroundColor(1.0, 1.0, 0.0, 1.0); + + // create medium font instances using font resource (base address + size) + m_FontLogo2 = new OGLFT::TranslucentTexture( + &m_FontResource->data()->at(0), + m_FontResource->data()->size(), + 13, 78 ); + + if ( m_FontLogo2 == 0 || !m_FontLogo2->isValid() ) { + cerr << "Could not construct logo2 font face from in memory resource!" << endl; + return; + } + + m_FontLogo2->setForegroundColor(0.75, 0.75, 0.75, 1.0); + // prepare base class observatories (not dimmed) generateObservatories(1.0); } @@ -149,3 +175,9 @@ void StarsphereS5R3::generateObservatories(float dimFactor) // we don't do anything special here, just call base class Starsphere::generateObservatories(dimFactor); } + +void StarsphereS5R3::renderLogo() +{ + m_FontLogo1->draw(m_XStartPosLeft, m_YStartPosTop, "Einstein@Home"); + m_FontLogo2->draw(m_XStartPosLeft, m_YStartPosTop - m_YOffsetLarge, "World Year of Physics 2005"); +} diff --git a/src/starsphere/StarsphereS5R3.h b/src/starsphere/StarsphereS5R3.h index 1dbcb8fed63367dc804e8dbc5e099672a7c483ea..915dba5d6e998c326206b9b1660b2017bed281f2 100644 --- a/src/starsphere/StarsphereS5R3.h +++ b/src/starsphere/StarsphereS5R3.h @@ -93,6 +93,14 @@ public: void refreshBOINCInformation(); private: + /** + * \brief Render science run specific logo + * + * This specific implementation shows the usual "Einstein@Home" logo combined + * with "World Year of Physics 2005" as subtitle + */ + inline void renderLogo(); + /** * \brief Render science run specific search information *