Beispiel #1
0
void Engine::drawGame()
{
    drawMap();
    drawItems();
    drawPlayer();
    drawMonsters();
    drawStatus();
    drawMessageQue();
}
void display(void)
{
    glClear(GL_COLOR_BUFFER_BIT);
    glLoadIdentity();

    glPointSize(10.0);
    drawStatus();
    //Sleep(100);
    usleep(100000);

    glFlush();
    glutSwapBuffers();
}
void BoltzmannInfoWidget::paintEvent(QPaintEvent *event) {
    QPainter painter(this);
    painter.setRenderHint(QPainter::Antialiasing);
    QPen pen;
    pen.setColor(QColor(0xEE, 0xEE, 0xEE));
    pen.setWidth(3);
    painter.setPen(pen);
    painter.fillRect(event->rect(), QBrush(QColor(0x30, 0x30, 0x30)));
    drawCoords(&painter);
    drawLabels(&painter);
    drawChart(&painter);
    drawStatus(&painter);
}
Beispiel #4
0
static bool internalUpdate()
{
	int refresh;

	Emgui_begin();
	drawStatus();
	drawHorizonalSlider();
	drawVerticalSlider();

	refresh = TrackView_render(getTrackViewInfo(), getTrackData()); 
	Emgui_end();

	return !!refresh; 
}
// draw
//---------------------------------------------------------------------------
void View::draw(Surface& surface)
{
    assert(this != 0);

    if (!getVisible())
        return;

    currentscreen = &surface; // hack
    Surface* viewArea = getViewArea(surface);
    Surface* clientArea = getClientArea(surface);

    if ( backgroundColor != NoColor )
    {
        viewArea->fill( backgroundColor );
    }

    if (getShowStatus())
    {
        drawStatus(*clientArea);
    }

    // Draw all non-selected components.
    ComponentsIterator i;
    for ( i=components.begin(); i != components.end(); i++)
    {
        if (*i != focusComponent)
        {
            (*i)->draw(*clientArea);
        }
    }

    // Now draw the selected component.
    if (focusComponent != 0)
    {
        focusComponent->draw(*clientArea);
    }

    if (getBordered())
    {
        drawTitle(*viewArea);
        drawBorder(*viewArea);
    }

    delete viewArea;
    delete clientArea;
} // end draw
Beispiel #6
0
void
ConsoleWindow::drawWindow() { 
    //XXX
    //contentwindow shouldn't scale,
    
    //   _baseWindow.print();
    clean();  //take care of any updates to buffer state
    
    if ( _iconified ) {  drawIconified(); return; } 
    
//    if ( AudicleWindow::main()->m_render_mode == GL_RENDER ) 
//        _baseWindow.dropShadowRounded( 0.35, 0.1);
    
    glPushName(_id);
    
    //window widgets
    //border
    
    glLineWidth( 5.0 );
    drawBase(); //draw window background


    glLineWidth(1.0);

    stencilContent (); //set up content area stencil        
    drawStenciledContent(); //draw ( in stencil ) the window content
    
    glPushMatrix();
    
    _baseWindow.transform(); //base window transform
    //  _contentWindow.outlineQuad();// content boundary  
    glLineWidth(2);

    drawStatus();  //status information

    drawScrollBars(); //scrollbar interaction

    drawUILayer(); //button UI interface
            
    glPopMatrix();
    
    glPopName();

}
  void CursynthGui::drawControlStatus(const Control* control,
                                      bool midi_armed) {
    std::ostringstream midi_learn;
    if (midi_armed)
      midi_learn << "ARMED";
    else if (control->midi_learn())
      midi_learn << control->midi_learn();
    else
      midi_learn << "-";
    drawMidi(midi_learn.str());

    std::ostringstream status;
    if (control->display_strings().size()) {
      int display_index = static_cast<int>(control->current_value());
      status << control->display_strings()[display_index];
    }
    else
      status << control->current_value();
    drawStatus(status.str());
  }
Beispiel #8
0
gboolean refreshStats(GList *hosts)
{
 GList *ho;
 gboolean r = TRUE;
 static gboolean upd_pending = FALSE;
 gboolean n_upd_pending = FALSE;

 ho = g_list_first(hosts);

#ifdef FEAT_AUTOREF
 static gboolean do_autoref = TRUE;
 gint num_in_refresh = 0;
#endif
 while(ho) {
  HostNode *n = (HostNode *) ho->data;

  if(screen_get_sessions(n)) {
   if(n->category != C_SESSIONS) {
    n->category = C_SESSIONS;
    rebuilddl = TRUE;
   }
  }
  else {
   if(n->category == C_UPDATES_PENDING)
    n_upd_pending = TRUE;

   if (n->category == C_SESSIONS)
    n->category = C_REFRESH_REQUIRED;

   if(n->category == C_REFRESH_REQUIRED) {
    /* Try to get a lock for the host. */
    gint rsetlck = setLockForHost(n);

    /* We don't got the lock. */
    if(rsetlck == -1) {
     n->status|= HOST_STATUS_LOCKED;
     freePackages(n);
    }
    /* We got the lock. */
    else if (rsetlck == 0) {
     if(n->status & HOST_STATUS_LOCKED) {
      refreshStatsOfNode(n);
      /* n->status ^= HOST_STATUS_LOCKED; */
     } else {
      n->category = C_REFRESH;
      rebuilddl = TRUE;

      freePackages(n);

      if(ssh_cmd_refresh(n) == FALSE) {
       n->category = C_UNKNOWN;
      }
     }
    /* Something weird happend. */
    } else {
     n->category = C_UNKNOWN;
     rebuilddl = TRUE;
    }
   }
  }

#ifdef FEAT_AUTOREF
  if(n->category == C_REFRESH)
   num_in_refresh++;
#endif

  ho = g_list_next(ho);
 }

#ifdef FEAT_TCLFILTER
 applyFilter(hosts);
#endif

 if(n_upd_pending && !upd_pending)
  notifyUser();
 upd_pending = n_upd_pending;

#ifdef FEAT_AUTOREF
 if(cfg->auto_refresh) {
  if (num_in_refresh == 0) {
   if(do_autoref) {
    if (autoref_trigger_auto())
     drawStatus (_("Auto refresh triggered..."), FALSE);
    do_autoref = FALSE;
   }
  }
  else
   do_autoref = TRUE;
 }
#endif

 return(r);
}
Beispiel #9
0
/**
  Function called to refresh the view on canvas
*/
void CGameBoard::OnUpdate()
{
    Clear(sf::Color(195, 195, 195)); /* Grey */
    sf::Shape rightBorder = sf::Shape::Rectangle(510, 0, 630, 510, sf::Color(127, 127, 127));
    Draw(rightBorder);

    if (m_fpsRefreshTime.GetElapsedTime() >= 1.0f)
    {
        m_frameRate = 1.f / GetFrameTime();
        m_fpsRefreshTime.Reset();
    }
    drawMap();
    drawFPS();
    drawStatus();
    drawExplosions();
    drawPlayers();
    drawBonusCanvas();

    if (!m_gameBegin || !m_connected)
    {
        return;
    }

    /* Handling Event */
    CPlayer *me = m_playersList[0]; /* I am the first player of the list */
    float x = me->GetPosition().x;
    float y = me->GetPosition().y;
    std::string pos = QString("%1 %2").arg(me->GetPosition().x).arg(me->GetPosition().y)
                                      .toStdString();
    if (me->isDead())
    {
        return;
    }

    sf::Event event;
    while (GetEvent(event))
    {
        switch (event.Type)
        {
        case sf::Event::KeyPressed:
            if (event.Key.Code == sf::Key::Space)
            {
                plantBomb();
            }
            else if (event.Key.Code == sf::Key::E)
            {
                useSpecialBonus();
            }
            break;
        default:
            break;
        }
    }


    if (GetInput().IsKeyDown(sf::Key::Right) ||
        GetInput().IsKeyDown(sf::Key::D))
    {
        switch (me->getCollision(Right, m_map))
        {
        case Floor:
        case Bonus:
            if (me->getDirection() != Right)
            {
                m_networkManager->sendMovePacket(me->getNick(), Right, x, y);
                me->setDirection(Right);
            }
            break;
        case Bomb:
            if (me->getBonus(CBonus::BombPass) != NULL)
            {
                me->setDirection(Right);
            }
            else if (me->getBonus(CBonus::BombKick) != NULL)
            {
                QList<CBomb *>::iterator it;
                for (it = m_bombsList.begin(); it != m_bombsList.end(); ++it)
                {
                    CBomb *bomb = *it;
                    if (bomb->getX() == me->getX() + 1 && bomb->getY() == me->getY())
                    {
                        bomb->setDirection(CBomb::Right);
                        m_map.setBlock(bomb->getX(), bomb->getY(), Floor);
                        break;
                    }
                }
            }
            break;
        default:
            break;
        }

        if (me->IsPaused())
        {
            me->Play();
        }
    }
     else if (GetInput().IsKeyDown(sf::Key::Left) ||
              GetInput().IsKeyDown(sf::Key::Q))
     {
         switch (me->getCollision(Left, m_map))
         {
         case Floor:
         case Bonus:
              if (me->getDirection() != Left)
              {
                  me->setDirection(Left);
                  m_networkManager->sendMovePacket(me->getNick(), Left, x, y);
              }
              break;
         case Bomb:
              if (me->getBonus(CBonus::BombPass) != NULL)
              {
                  me->setDirection(Left);
              }
              else if (me->getBonus(CBonus::BombKick) != NULL)
              {
                  QList<CBomb *>::iterator it;
                  for (it = m_bombsList.begin(); it != m_bombsList.end(); ++it)
                  {
                      CBomb *bomb = *it;
                      if (bomb->getX() == me->getX() - 1 && bomb->getY() == me->getY())
                      {
                          bomb->setDirection(CBomb::Left);
                          m_map.setBlock(bomb->getX(), bomb->getY(), Floor);
                          break;
                      }
                  }
              }
              break;
         default:
              break;
         }

         if (me->IsPaused())
         {
             me->Play();
         }
     }
     else if (GetInput().IsKeyDown(sf::Key::Down) ||
              GetInput().IsKeyDown(sf::Key::S))
     {
         switch (me->getCollision(Down, m_map))
         {
         case Floor:
         case Bonus:
             if (me->getDirection() != Down)
              {
                   me->setDirection(Down);
                   m_networkManager->sendMovePacket(me->getNick(), Down, x, y);
              }
             else if (me->getBonus(CBonus::BombKick) != NULL)
             {
                 QList<CBomb *>::iterator it;
                 for (it = m_bombsList.begin(); it != m_bombsList.end(); ++it)
                 {
                     CBomb *bomb = *it;
                     if (bomb->getX() == me->getX() && bomb->getY() == me->getY() + 1)
                     {
                         bomb->setDirection(CBomb::Down);
                         m_map.setBlock(bomb->getX(), bomb->getY(), Floor);
                         break;
                     }
                 }
             }
             break;
         case Bomb:
             if (me->getBonus(CBonus::BombPass) != NULL)
             {
                 me->setDirection(Down);
             }
             break;
         default:
             break;
         }

         if (me->IsPaused())
         {
             me->Play();
         }

     }
     else if (GetInput().IsKeyDown(sf::Key::Up) ||
              GetInput().IsKeyDown(sf::Key::Z))
     {
         switch (me->getCollision(Up, m_map))
         {
         case Floor:
         case Bonus:
               if (me->getDirection() != Up)
               {
                    m_networkManager->sendMovePacket(me->getNick(), Up, x, y);
                    me->setDirection(Up);
               }
               break;
         case Bomb:
               if (me->getBonus(CBonus::BombPass) != NULL)
               {
                   me->setDirection(Up);
               }
               else if (me->getBonus(CBonus::BombKick) != NULL)
               {
                   QList<CBomb *>::iterator it;
                   for (it = m_bombsList.begin(); it != m_bombsList.end(); ++it)
                   {
                       CBomb *bomb = *it;
                       if (bomb->getX() == me->getX() && bomb->getY() == me->getY() - 1)
                       {
                           bomb->setDirection(CBomb::Up);
                           m_map.setBlock(bomb->getX(), bomb->getY(), Floor);
                           break;
                       }
                   }
               }
               break;
         default:
             break;
         }

         if (me->IsPaused())
         {
             me->Play();
         }

     }
     else
     {
         if (me->getDirection() != Stopped && me->getElapsedTime() >= me->getStopTime())
         {
             me->setDirection(Stopped);
             m_networkManager->sendMovePacket(me->getNick(), Stopped, x, y);
             me->Pause();
         }
     }
}