Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1150


Ignore:
Timestamp:
Apr 23, 2008, 11:40:40 PM (16 years ago)
Author:
dumenim
Message:

either i'm wrong or the hud is. it seems to create a segfault in startRenderLoop, don't know if only in network branch. there are some std::couts commented with 3 / (blue :-) and the hud calls are commented out too. now it goes a bit further untill the next segfault.

Location:
code/branches/network2/src
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/network2/src/network/ClientConnection.cc

    r1098 r1150  
    164164        COUT(5) << "Cl.Con: receiver-Thread while loop: got new packet" << std::endl;
    165165        if ( !processData(&event) ) COUT(2) << "Current packet was not pushed to packetBuffer -> ev ongoing SegFault" << std::endl;
     166        COUT(5) << "Cl.Con: processed Data in receiver-thread while loop" << std::endl;
    166167        break;
    167168      case ENET_EVENT_TYPE_DISCONNECT:
  • code/branches/network2/src/network/diffTest.cc

    r1098 r1150  
    1111#include "ConnectionManager.h"
    1212#include "ClientInformation.h"
     13#include "Synchronisable.h"
    1314#include <boost/thread/thread.hpp>
    1415#include <boost/bind.hpp>
     
    614615//### end packetbuffer test stuff ###
    615616
     617void testSynchronisable() {
     618  Synchronisable* synchtest;
     619  unsigned char* data = new unsigned char[100];
     620  for( int i=0; i<100; i++ ) {
     621    data[i] = i%10;
     622  }
     623  //synchtest->registerVar( (const void*)data, 100, network::DATA );
     624}
     625
     626//#########################################################################
     627//### this stuff is only a loop to chose one of the prev test functions ###
     628//#########################################################################
    616629void displayModes() {
    617630  std::cout << "mode datalength: length of data array to create" << std::endl;
     
    629642  std::cout << "\t-5 -> only half as long and ever %10 == 0 index is different" << std::endl;
    630643}
    631 
     644/**
    632645int main( int argc, char* argv[] ) {
    633646  int a,b,c,n;
     
    699712  }
    700713  return 0;
    701 }
    702 /**
     714}*/
     715
    703716int main() {
    704717  std::cout << "############### START TEST (quit q) ###############" << std::endl;
    705   testClientInformation( 10 );
    706 }*/
     718  testSynchronisable();
     719}
     720
     721//#########################################################################
     722//### the prev loop is only to chose one prev prev test functions       ###
     723//#########################################################################
  • code/branches/network2/src/orxonox/Orxonox.cc

    r1132 r1150  
    333333
    334334    //setupInputSystem();
    335 
     335    std::cout << "STARTING RENDERLOOP" << std::endl;
    336336    startRenderLoop();
    337337  }
     
    416416  void Orxonox::startRenderLoop()
    417417  {
     418    ///std::cout << "ON LINE 418 IN Orxonox.cc on frame " << std::endl;
    418419    InputBuffer* ib = new InputBuffer();
    419420    InputManager::getSingleton().feedInputBuffer(ib);
     
    423424    ib->registerListener(console, &Testconsole::execute, '\n', false);
    424425    ib->registerListener(console, &Testconsole::hintandcomplete, '\t', true);
    425     ib->registerListener(console, &Testconsole::clear, '§', true);
     426    ib->registerListener(console, &Testconsole::clear, '', true);
    426427    ib->registerListener(console, &Testconsole::removeLast, '\b', true);
    427428    ib->registerListener(console, &Testconsole::exit, (char)0x1B, true);
     
    435436    Ogre::Root& ogreRoot = Ogre::Root::getSingleton();
    436437
    437 
     438    ///std::cout << "ON LINE 437 IN Orxonox.cc" << std::endl;
    438439    // Contains the times of recently fired events
    439440    // eventTimes[4] is the list for the times required for the fps counter
     
    450451      timer_ = new Ogre::Timer();
    451452    timer_->reset();
    452 
     453    ///std::cout << "ON LINE 452 IN Orxonox.cc" << std::endl;
     454    int counter = 0;
    453455          while (!bAbort_)
    454456          {
     
    456458      // This calls the WindowEventListener objects.
    457459      Ogre::WindowEventUtilities::messagePump();
    458 
     460      ///std::cout << "ON LINE 459 IN Orxonox.cc on frame " << counter << std::endl;
    459461      // get current time
    460462      unsigned long now = timer_->getMilliseconds();
     
    466468      evt.timeSinceLastEvent = calculateEventTime(now, eventTimes[0]);
    467469      evt.timeSinceLastFrame = calculateEventTime(now, eventTimes[1]);
     470      ///std::cout << "ON LINE 468 IN Orxonox.cc on frame " << counter << std::endl;
    468471
    469472      // show the current time in the HUD
    470       orxonoxHUD_->setTime((int)now, 0);
    471       if (eventTimes[3].back() - eventTimes[3].front() != 0)
    472         orxonoxHUD_->setRocket1((int)(20000.0f/(eventTimes[3].back() - eventTimes[3].front())));
    473 
     473      ///### THE FOLLOWING HUD STUFF SEEMS TO CREATE SEGFAULT IN NETWORK
     474      ///orxonoxHUD_->setTime((int)now, 0);
     475      ///std::cout << "ON LINE 473 IN Orxonox.cc on frame " << counter << std::endl;
     476      ///if (eventTimes[3].back() - eventTimes[3].front() != 0)
     477        ///orxonoxHUD_->setRocket1((int)(20000.0f/(eventTimes[3].back() - eventTimes[3].front())));
     478      ///std::cout << "ON LINE 476 IN Orxonox.cc on frame " << counter << std::endl;
    474479      // Iterate through all Tickables and call their tick(dt) function
    475480      for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; ++it)
    476481        it->tick((float)evt.timeSinceLastFrame * this->timefactor_);
     482      ///std::cout << "ON LINE 476 IN Orxonox.cc on frame " << counter << std::endl;
    477483
    478484      // don't forget to call _fireFrameStarted in ogre to make sure
     
    493499      // again, just to be sure ogre works fine
    494500      ogreRoot._fireFrameEnded(evt);
     501      counter++;
    495502          }
    496503  }
Note: See TracChangeset for help on using the changeset viewer.