Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 346


Ignore:
Timestamp:
Nov 29, 2007, 4:21:30 PM (17 years ago)
Author:
rgrieder
Message:
  • adjusted the entire source to compile under windows visual studio too:
  • added some ugly conversions
  • changed some illegal code pieces (gcc however accepted it)
  • added a few files from reto's framework to evade linker errors (no more dynamic linking)
  • inserted some 'return true' to justify the return type
  • excluded the levelLoader in the orxonox.cc (couldn't make it work, parsing error)
  • wrote about 5 code #branches to compensate for missing usleep() under windows
Location:
code/branches/FICN
Files:
7 added
19 edited

Legend:

Unmodified
Added
Removed
  • code/branches/FICN

    • Property svn:ignore set to
      FICN.sln
      FICN.ncb
      FICN.vcproj
      FICN.vcproj.RGRIEDERT60.rgrieder.user
      FICN.suo
      obj
  • code/branches/FICN/bin

    • Property svn:ignore set to
      benixonox
  • code/branches/FICN/src/loader/LevelLoader.cc

    r341 r346  
    1515        dir.append("/");
    1616        dir.append(file);       
    17         rootNode = XMLNode::openFileHelper(dir.c_str(),"WorldDataFile");
     17        rootNode = XMLNode::openFileHelper((const wchar_t*)dir.c_str(),(const wchar_t*)"WorldDataFile");
    1818        // TODO: Error handling
    1919
    2020        // Assing general level infos to class variables
    21         this->name_ = rootNode.getChildNode("name").getText();
    22         this->description_ = rootNode.getChildNode("description").getText();
    23         this->image_ = rootNode.getChildNode("image").getText();
     21        this->name_ = (const char*)rootNode.getChildNode((const wchar_t*)"name").getText();
     22        this->description_ = (const char*)rootNode.getChildNode((const wchar_t*)"description").getText();
     23        this->image_ = (const char*)rootNode.getChildNode((const wchar_t*)"image").getText();
    2424 
    2525        this->loadingScreen();
    2626 
    2727  // Assign sub-nodes
    28   if (rootNode.nChildNode("LightManager")==1)
     28  if (rootNode.nChildNode((const wchar_t*)"LightManager")==1)
    2929  {
    3030        // Init Luightmanager...
  • code/branches/FICN/src/loader/Light.cc

    r341 r346  
    99               
    1010        }
     11
     12  Light::~Light()
     13  {
     14  }
    1115       
    1216        Light::Light(XMLNode xml)
     
    1822        {
    1923                // Here comes the tricky part... convert strings to int
    20                 const char* diffuse = xml.getAttribute("diffuse-color");
    21                 const char* coor = xml.getAttribute("abs-coor");
     24                const char* diffuse = (const char*)xml.getAttribute((const wchar_t*)"diffuse-color");
     25                const char* coor = (const char*)xml.getAttribute((const wchar_t*)"abs-coor");
    2226        }
    2327}
  • code/branches/FICN/src/loader/Light.h

    r341 r346  
    77namespace light
    88{
    9         class Light()
     9        class Light
    1010        {
    1111        public:     
  • code/branches/FICN/src/loader/LightManager.cc

    r341 r346  
    77        LightManager::LightManager()
    88        {
    9                 vector<Light> this->elements_ = new vector<Light>;
     9    std::vector<Light> elements_ = *(new std::vector<Light>);
    1010        }
    1111       
     
    1414                if (!xml.isEmpty())
    1515                {
    16                         int nLights = xml.nChildNode("light");
     16                        int nLights = xml.nChildNode((const wchar_t*)"light");
    1717                        for (int i=0; i<nLights;i++)
    1818                        {
    19                                 Light l = new Light(xml.getChildNode("light",i));
    20                                 this->elements_.append(l);
     19                                Light l = *(new Light(xml.getChildNode((const wchar_t*)"light",i)));
     20        this->elements_.insert(elements_.end(),l);
    2121                        }
    2222                }               
  • code/branches/FICN/src/loader/LightManager.h

    r341 r346  
    99namespace light
    1010{
    11         class LightManager()
     11        class LightManager
    1212        {     
    1313        public:
     
    2020                float ambient_g_;
    2121                float ambient_b_;
    22                 vector<Light> elements_;
     22    std::vector<Light> elements_;
    2323        };
    2424}
  • code/branches/FICN/src/network/ClientConnection.cc

    r337 r346  
    1212#include "ClientConnection.h"
    1313
     14// workaround for usleep(int) under windows
     15#ifdef WIN32
     16#include "winbase.h"
     17#endif
     18
    1419namespace network{
    1520
    16   boost::thread_group network_threads;
     21  static boost::thread_group network_threads;
    1722
    1823  ClientConnection::ClientConnection(int port, std::string address){
     
    3439  bool ClientConnection::waitEstablished(int milisec){
    3540    for(int i=0; i<=milisec && !established; i++)
     41// under windows, use Sleep(milliseconds) instead of usleep(microseconds)
     42#ifdef WIN32
     43      Sleep(1);
     44#else
    3645      usleep(1000);
     46#endif
    3747    return established;
    3848  }
  • code/branches/FICN/src/network/GameStateManager.cc

    r337 r346  
    106106  }
    107107 
    108  
     108  return true;
    109109}
    110110
     
    115115 */
    116116// orxonox::Iterator<Synchronisable> removeObject(orxonox::Iterator<Synchronisable> it){
    117 void removeObject(orxonox::Iterator<Synchronisable> &it){
     117void GameStateManager::removeObject(orxonox::Iterator<Synchronisable> &it){
    118118  orxonox::Iterator<Synchronisable> temp=it;
    119119  ++it;
  • code/branches/FICN/src/network/GameStateManager.h

    r337 r346  
    4444  bool loadSnapshot(GameState state);
    4545private:
    46   bool removeObject(orxonox::Iterator<Synchronisable> it);
     46  void removeObject(orxonox::Iterator<Synchronisable> &it);
    4747
    4848};
  • code/branches/FICN/src/network/PacketBufferTest.cc

    r337 r346  
    1414    p.data=i*i;
    1515    std::cout << i << ": pushing " << p.data << std::endl;
    16     test.push(p);
     16    test.push((ENetEvent*)&p);
    1717  }
    1818  std::cout << std::endl << "queue.print()" << std::endl;
    1919  test.print();
    2020  while(!test.isEmpty()){
    21     int i=test.pop().data;
     21    int i = (int)test.pop()->data;
    2222    std::cout << "We popped the value " << i << std::endl;
    2323  }
  • code/branches/FICN/src/network/PacketBufferTestExt.cc

    r337 r346  
    77
    88using namespace network;
     9
     10// workaround for usleep(int) under windows
     11#ifdef WIN32
     12#include "winbase.h"
     13#endif
    914
    1015
     
    1823ENET_PACKET_FLAG_RELIABLE);
    1924    std::cout << i << ": pushing " << packet->data << std::endl;
    20     test->push(packet);
     25    test->push((ENetEvent*)packet);
    2126    if(i==5)
     27// under windows, use Sleep(milliseconds) instead of usleep(microseconds)
     28#ifdef WIN32
     29      Sleep(200);
     30#else
    2231      usleep(200000);
     32#endif
    2333  }
    2434  test->setClosed(true);
  • code/branches/FICN/src/network/Synchronisable.cc

    r337 r346  
    2121{
    2222  datasize=0;
    23   registerAllVariables();
     23  //registerAllVariables();
    2424}
    2525
  • code/branches/FICN/src/network/Synchronisable.h

    r337 r346  
    5252  int getSize();
    5353  bool updateData(syncData vars);
    54   virtual void registerAllVariables();
     54  virtual void registerAllVariables() = 0;
    5555
    5656private:
  • code/branches/FICN/src/network/dummyclient.cc

    r337 r346  
    88#include <enet/enet.h>
    99#include "PacketManager.h"
     10
     11// workaround for usleep(int) under windows
     12#ifdef WIN32
     13#include "winbase.h"
     14#endif
     15
    1016
    1117using namespace std;
     
    6773      cout << "failed sending" << endl;
    6874    }
     75// under windows, use Sleep(milliseconds) instead of usleep(microseconds)
     76#ifdef WIN32
     77    Sleep(1000);
     78#else
    6979    usleep(1000000);
     80#endif
    7081  }
    7182
  • code/branches/FICN/src/network/dummyserver.cc

    r341 r346  
    99#include "ConnectionManager.h"
    1010#include "PacketManager.h"
     11
     12// workaround for usleep(int) under windows
     13#ifdef WIN32
     14#include "winbase.h"
     15#endif
     16
    1117
    1218using namespace network;
     
    2329  while(!quit){
    2430    if(server.queueEmpty())
     31// under windows, use Sleep(milliseconds) instead of usleep(microseconds)
     32// Warning: Sleep(1) is ten times longer than usleep(100)!
     33#ifdef WIN32
     34      Sleep(1);
     35#else
    2536      usleep(100);
     37#endif
    2638    else{
    2739      ENetAddress addr;
  • code/branches/FICN/src/orxonox/core/Identifier.h

    r258 r346  
    88#include "Factory.h"
    99
    10 #define HIERARCHY_VERBOSE false
     10#define HIERARCHY_VERBOSE 0
    1111
    1212
  • code/branches/FICN/src/orxonox/objects/test3.cc

    r258 r346  
    3333        testandcout(test1->usefullClass3isA(Class(Test2)));
    3434        testandcout(test1->usefullClass3isA(Class(Test3)));
     35
     36        return true;
    3537    }
    3638
     
    5052        testandcout(test2->usefullClass3isA(Class(Test2)));
    5153        testandcout(test2->usefullClass3isA(Class(Test3)));
     54
     55        return true;
    5256    }
    5357}
  • code/branches/FICN/src/orxonox/orxonox.cc

    r341 r346  
    3333#include <Ogre.h>
    3434#include <OIS/OIS.h>
    35 #include <CEGUI/CEGUI.h>
    36 #include <OgreCEGUIRenderer.h>
     35//#include <CEGUI/CEGUI.h>
     36//#include <OgreCEGUIRenderer.h>
    3737
    3838#include <string>
     
    209209      OIS::Mouse *mMouse;
    210210      OIS::InputManager *mInputManager;
    211       CEGUI::OgreCEGUIRenderer *mRenderer;
    212       CEGUI::System *mSystem;
     211      //CEGUI::OgreCEGUIRenderer *mRenderer;
     212      //CEGUI::System *mSystem;
    213213      OrxExitListener *mListener;
    214214
     
    271271      {
    272272
    273       string levelFile = "sp_level_moonstation.oxw";
    274       loader::LevelLoader* loader = new loader::LevelLoader(levelFile);
     273      //string levelFile = "sp_level_moonstation.oxw";
     274      //loader::LevelLoader* loader = new loader::LevelLoader(levelFile);
    275275    }
    276276
Note: See TracChangeset for help on using the changeset viewer.