Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 1021 for code/trunk


Ignore:
Timestamp:
Apr 10, 2008, 5:03:34 PM (17 years ago)
Author:
bknecht
Message:

merged back that script-branch

Location:
code/trunk
Files:
4 deleted
60 edited
27 copied

Legend:

Unmodified
Added
Removed
  • code/trunk/CMakeLists.txt

    r790 r1021  
    7171FIND_PACKAGE(OggVorbis)
    7272FIND_PACKAGE(ZLIB)
     73FIND_PACKAGE(Lua)
     74#FIND_PACKAGE(ToLua)
    7375
    7476#Sets the search paths for the linking
    75 LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR} ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR} ${ENet_LIBRARY} ${Boost_LIBRARY_DIRS} ${Zlib_LIBRARY_DIR} core objects loader network weapon classHierarchy audio)
     77LINK_DIRECTORIES(${OGRE_LIB_DIR} ${OIS_LIB_DIR} ${CEGUI_LIB_DIR} ${CEGUI_OGRE_LIB_DIR} ${ENet_LIBRARY} ${Boost_LIBRARY_DIRS} ${Zlib_LIBRARY_DIR} ${Lua_LIBRARIES} core objects loader network weapon classHierarchy audio)
    7678#Sets the search path for include files
    77 INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR} ${ENet_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${OPENAL_INCLUDE_DIR} ${ALUT_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR})
     79INCLUDE_DIRECTORIES(${OGRE_INCLUDE_DIR} ${OIS_INCLUDE_DIR} ${CEGUI_INCLUDE_DIR} ${CEGUI_OGRE_INCLUDE_DIR} ${ENet_INCLUDE_DIR} ${Boost_INCLUDE_DIRS} ${OPENAL_INCLUDE_DIR} ${ALUT_INCLUDE_DIR} ${VORBIS_INCLUDE_DIR} ${OGG_INCLUDE_DIR} ${Lua_INCLUDE_DIR})
    7880
    7981#Set the execution directory
  • code/trunk/bin/levels/sample.oxw

    r1010 r1021  
    88                        <ogg src="tha_silent_partner_-_void" />
    99                </ambient>
    10   </audio>
     10  </audio>
     11
    1112-->
    1213
     
    2324<NPC position="100,0,400" scale="1" mesh="razor.mesh"/>
    2425
    25 <!--
    26 <Model name="starship" position="200,0,500" scale="10" mesh="starship.mesh" yawpitchroll="-90,-90,0" />
    27 <Model name="drone" position="-200,0,500" scale="10" mesh="drone.mesh" yawpitchroll="-90,-90,0">
     26<!--Model name="starship" position="200,0,500" scale="10" mesh="starship.mesh" yawpitchroll="-90,-90,0" /-->
     27<!--Model name="drone" position="-200,0,500" scale="10" mesh="drone.mesh" yawpitchroll="-90,-90,0">
    2828  <attached>
    2929    <Model name="drone2" position="200,-100,-500" scale="10" mesh="drone.mesh" yawpitchroll="-90,-90,0">
     
    3333    </Model>
    3434  </attached>
    35 </Model>
    36 -->
     35</Model -->
    3736
    3837<Model position="-200,1000,500" scale="10" mesh="hoover_body.mesh" yawpitchroll="-90,-90,0" />
     
    4241<Model position="-200,1000,500" scale="10" mesh="hoover_turbine.mesh" yawpitchroll="-90,-90,0" />
    4342
    44     <Model position="-16779,42,11043" scale="95" mesh="ast2.mesh" rotationAxis="0.281711,0.152518,0" rotationRate="27" />
    45     <Model position="12893,-1583,-17939" scale="48" mesh="ast1.mesh" rotationAxis="0.0597998,0.923364,0" rotationRate="36" />
    46     <Model position="-2107,259,-19814" scale="29" mesh="ast4.mesh" rotationAxis="0.298639,0.96907,0" rotationRate="32" />
    47     <Model position="-9583,-2284,-19904" scale="33" mesh="ast5.mesh" rotationAxis="0,0.675659,0.0196445" rotationRate="44" />
    48     <Model position="-19597,-15494,3163" scale="37" mesh="ast5.mesh" rotationAxis="0.477996,0,0.048639" rotationRate="23" />
    49     <Model position="-182,6442,-4496" scale="25" mesh="ast5.mesh" rotationAxis="0.142225,0,0.154393" rotationRate="37" />
    50     <Model position="1004,-19639,-13744" scale="21" mesh="ast1.mesh" rotationAxis="0.974865,0.299775,0" rotationRate="29" />
    51     <Model position="-13204,-10191,-1555" scale="31" mesh="ast1.mesh" rotationAxis="0.41675,0,0.385001" rotationRate="42" />
    52     <Model position="-1843,12203,2346" scale="81" mesh="ast5.mesh" rotationAxis="0.221171,0,0.331917" rotationRate="41" />
    53     <Model position="-1560,-1443,-17416" scale="68" mesh="ast1.mesh" rotationAxis="0.653787,0.00935241,0" rotationRate="44" />
    54     <Model position="-7723,18661,3363" scale="94" mesh="ast5.mesh" rotationAxis="0.450345,0,0.417313" rotationRate="29" />
    55     <Model position="-8122,5764,16342" scale="45" mesh="ast4.mesh" rotationAxis="0.268558,0,0.089161" rotationRate="30" />
    56     <Model position="17575,-14054,-16710" scale="80" mesh="ast1.mesh" rotationAxis="0,0.615899,0.571064" rotationRate="18" />
    57     <Model position="-15304,-17381,4149" scale="32" mesh="ast6.mesh" rotationAxis="0.015051,0,0.764924" rotationRate="10" />
    58     <Model position="5587,2382,-13876" scale="49" mesh="ast4.mesh" rotationAxis="0.501173,0.208012,0" rotationRate="27" />
    59     <Model position="12167,-12466,-3364" scale="29" mesh="ast3.mesh" rotationAxis="0.897424,0.896971,0" rotationRate="21" />
    60     <Model position="3157,12173,4070" scale="78" mesh="ast2.mesh" rotationAxis="0.496178,0.760223,0" rotationRate="36" />
    61     <Model position="-13948,-6497,18368" scale="96" mesh="ast3.mesh" rotationAxis="0,0.0655793,0.17843" rotationRate="47" />
    62     <Model position="9304,-16367,-8429" scale="112" mesh="ast3.mesh" rotationAxis="0,0.220054,0.123838" rotationRate="10" />
    63     <Model position="-19293,9147,5573" scale="97" mesh="ast6.mesh" rotationAxis="0,0.0590435,0.200379" rotationRate="27" />
    64     <Model position="-13022,13902,19960" scale="67" mesh="ast6.mesh" rotationAxis="0,0.637161,0.286825" rotationRate="22" />
    65     <Model position="16898,12368,4477" scale="41" mesh="ast3.mesh" rotationAxis="0.962958,0,0.0295571" rotationRate="30" />
    66     <Model position="6687,12586,-11721" scale="33" mesh="ast2.mesh" rotationAxis="0.596958,0.326804,0" rotationRate="24" />
    67     <Model position="15066,11759,5229" scale="47" mesh="ast5.mesh" rotationAxis="0,0.993547,0.7269" rotationRate="45" />
    68     <Model position="7329,-9876,2203" scale="78" mesh="ast4.mesh" rotationAxis="0,0.170628,0.522448" rotationRate="31" />
    69     <Model position="-9132,9542,-14753" scale="20" mesh="ast6.mesh" rotationAxis="0.578006,0.738023,0" rotationRate="47" />
    70     <Model position="12958,2638,9476" scale="107" mesh="ast2.mesh" rotationAxis="0.815402,0.549519,0" rotationRate="42" />
    71     <Model position="3327,-10549,9196" scale="102" mesh="ast3.mesh" rotationAxis="0.403431,0,0.392179" rotationRate="43" />
    72     <Model position="-8947,15802,-16153" scale="72" mesh="ast3.mesh" rotationAxis="0,0.863891,0.789231" rotationRate="28" />
    73     <Model position="-5340,12944,14528" scale="108" mesh="ast2.mesh" rotationAxis="0.91406,0.865657,0" rotationRate="34" />
    74     <Model position="5107,5365,-5004" scale="75" mesh="ast6.mesh" rotationAxis="0,0.663461,0.406224" rotationRate="13" />
    75     <Model position="-6998,18403,8238" scale="70" mesh="ast6.mesh" rotationAxis="0.550689,0,0.834949" rotationRate="41" />
    76     <Model position="-9089,7495,-15512" scale="59" mesh="ast6.mesh" rotationAxis="0.0784585,0,0.580422" rotationRate="16" />
    77     <Model position="-6698,19465,14091" scale="70" mesh="ast5.mesh" rotationAxis="0,0.0536133,0.663091" rotationRate="48" />
    78     <Model position="-9943,9390,19361" scale="115" mesh="ast3.mesh" rotationAxis="0.745415,0.302601,0" rotationRate="25" />
    79     <Model position="9341,-6947,7223" scale="49" mesh="ast1.mesh" rotationAxis="0.0217983,0.829754,0" rotationRate="40" />
    80     <Model position="10259,8970,-7673" scale="70" mesh="ast3.mesh" rotationAxis="0,0.705347,0.0544375" rotationRate="30" />
    81     <Model position="4538,-17169,-15829" scale="119" mesh="ast4.mesh" rotationAxis="0.659901,0,0.6408" rotationRate="42" />
    82     <Model position="7746,-9746,14917" scale="89" mesh="ast4.mesh" rotationAxis="0.579678,0,0.632015" rotationRate="46" />
    83     <Model position="-4550,1554,11166" scale="49" mesh="ast1.mesh" rotationAxis="0.805799,0.905452,0" rotationRate="25" />
    84     <Model position="-4571,-14392,14887" scale="20" mesh="ast2.mesh" rotationAxis="0.163796,0.62884,0" rotationRate="38" />
    85     <Model position="18390,-19165,-6118" scale="28" mesh="ast2.mesh" rotationAxis="0.386394,0,0.290423" rotationRate="39" />
    86     <Model position="-19119,8707,-11377" scale="119" mesh="ast1.mesh" rotationAxis="0.912683,0,0.722097" rotationRate="17" />
    87     <Model position="-15827,6956,-3785" scale="32" mesh="ast1.mesh" rotationAxis="0.901503,0,0.548708" rotationRate="29" />
    88     <Model position="1956,-13954,18055" scale="59" mesh="ast1.mesh" rotationAxis="0,0.0523992,0.756846" rotationRate="15" />
    89     <Model position="2197,-13870,-11528" scale="92" mesh="ast2.mesh" rotationAxis="0.469413,0,0.742143" rotationRate="13" />
    90     <Model position="7377,6656,5591" scale="64" mesh="ast6.mesh" rotationAxis="0,0.599119,0.890718" rotationRate="36" />
    91     <Model position="16123,8784,-7928" scale="50" mesh="ast6.mesh" rotationAxis="0.648018,0,0.522075" rotationRate="41" />
    92     <Model position="-12751,-2191,-11527" scale="94" mesh="ast2.mesh" rotationAxis="0,0.715065,0.332238" rotationRate="36" />
    93     <Model position="18020,-16499,18874" scale="31" mesh="ast6.mesh" rotationAxis="0,0.0608362,0.523216" rotationRate="13" />
    94     <Model position="-15807,-7678,16780" scale="37" mesh="ast1.mesh" rotationAxis="0,0.658659,0.0366738" rotationRate="18" />
    95     <Model position="-17711,-14807,13817" scale="82" mesh="ast6.mesh" rotationAxis="0.16894,0,0.131653" rotationRate="10" />
    96     <Model position="-4428,5259,9741" scale="66" mesh="ast6.mesh" rotationAxis="0.424995,0.0971331,0" rotationRate="39" />
    97     <Model position="1682,8250,263" scale="34" mesh="ast2.mesh" rotationAxis="0,0.509205,0.22658" rotationRate="35" />
    98     <Model position="13624,-5594,12058" scale="61" mesh="ast5.mesh" rotationAxis="0,0.786326,0.21092" rotationRate="41" />
    99     <Model position="-5772,8251,15090" scale="89" mesh="ast6.mesh" rotationAxis="0.446662,0,0.039521" rotationRate="46" />
    100     <Model position="18732,8386,-17834" scale="115" mesh="ast3.mesh" rotationAxis="0.484641,0.0994628,0" rotationRate="29" />
    101     <Model position="-4662,-13023,1337" scale="116" mesh="ast3.mesh" rotationAxis="0.575875,0.380544,0" rotationRate="34" />
    102     <Model position="3193,-18575,-13293" scale="55" mesh="ast3.mesh" rotationAxis="0,0.562414,0.669598" rotationRate="23" />
    103     <Model position="-18127,15281,-9961" scale="59" mesh="ast5.mesh" rotationAxis="0,0.430401,0.690096" rotationRate="20" />
    104     <Model position="-3978,-10245,108" scale="80" mesh="ast4.mesh" rotationAxis="0,0.0821224,0.236512" rotationRate="25" />
    105     <Model position="-11319,-12567,5192" scale="109" mesh="ast2.mesh" rotationAxis="0.39942,0,0.537407" rotationRate="24" />
    106     <Model position="-4977,-3230,-7025" scale="34" mesh="ast2.mesh" rotationAxis="0,0.464353,0.474219" rotationRate="31" />
    107     <Model position="10069,-14931,15176" scale="97" mesh="ast6.mesh" rotationAxis="0.173174,0.520451,0" rotationRate="26" />
    108     <Model position="2766,-16062,-10919" scale="78" mesh="ast4.mesh" rotationAxis="0.521386,0,0.717508" rotationRate="36" />
    109     <Model position="-9128,12247,2916" scale="67" mesh="ast2.mesh" rotationAxis="0.347868,0.717047,0" rotationRate="28" />
    110     <Model position="6440,-16563,-18432" scale="36" mesh="ast5.mesh" rotationAxis="0.265539,0,0.71717" rotationRate="35" />
    111     <Model position="12669,-1534,2196" scale="71" mesh="ast2.mesh" rotationAxis="0,0.472099,0.464159" rotationRate="40" />
    112     <Model position="172,-18075,11429" scale="108" mesh="ast5.mesh" rotationAxis="0.0320382,0.32207,0" rotationRate="16" />
    113     <Model position="2426,8901,-3677" scale="114" mesh="ast5.mesh" rotationAxis="0.778803,0.0691138,0" rotationRate="46" />
    114     <Model position="-4576,-13668,14863" scale="40" mesh="ast6.mesh" rotationAxis="0.979052,0.428032,0" rotationRate="30" />
    115     <Model position="9222,-15457,4825" scale="24" mesh="ast6.mesh" rotationAxis="0,0.106496,0.409635" rotationRate="38" />
    116     <Model position="-3613,-4696,-13838" scale="82" mesh="ast4.mesh" rotationAxis="0.676407,0,0.69673" rotationRate="16" />
    117     <Model position="12743,-1674,8050" scale="78" mesh="ast3.mesh" rotationAxis="0.161952,0.389888,0" rotationRate="19" />
    118     <Model position="3398,-19196,10512" scale="96" mesh="ast1.mesh" rotationAxis="0,0.799917,0.520012" rotationRate="38" />
    119     <Model position="-2837,-9264,-11236" scale="97" mesh="ast4.mesh" rotationAxis="0.892116,0,0.048004" rotationRate="22" />
    120     <Model position="13220,-13790,-9710" scale="90" mesh="ast5.mesh" rotationAxis="0,0.931551,0.148539" rotationRate="19" />
    121     <Model position="-9560,19189,2493" scale="24" mesh="ast2.mesh" rotationAxis="0.169182,0.962125,0" rotationRate="22" />
    122     <Model position="-18545,-13577,5941" scale="92" mesh="ast4.mesh" rotationAxis="0,0.145122,0.499773" rotationRate="24" />
    123     <Model position="-12874,-481,7016" scale="89" mesh="ast4.mesh" rotationAxis="0,0.878644,0.744372" rotationRate="31" />
    124     <Model position="5290,-11553,-15958" scale="103" mesh="ast4.mesh" rotationAxis="0,0.0858311,0.860834" rotationRate="26" />
    125     <Model position="-18189,19019,16471" scale="72" mesh="ast4.mesh" rotationAxis="0,0.206421,0.423981" rotationRate="33" />
    126     <Model position="13736,17565,-4338" scale="72" mesh="ast1.mesh" rotationAxis="0.647033,0,0.0993164" rotationRate="26" />
    127     <Model position="-11103,-18306,17096" scale="112" mesh="ast6.mesh" rotationAxis="0.938456,0.184833,0" rotationRate="17" />
    128     <Model position="16665,322,-13614" scale="57" mesh="ast5.mesh" rotationAxis="0,0.850806,0.942188" rotationRate="30" />
    129     <Model position="-13234,-5004,-19934" scale="100" mesh="ast6.mesh" rotationAxis="0.712244,0.214422,0" rotationRate="30" />
    130     <Model position="2334,-2954,-17614" scale="50" mesh="ast5.mesh" rotationAxis="0.62725,0,0.646295" rotationRate="22" />
    131     <Model position="16214,-12149,-6186" scale="72" mesh="ast1.mesh" rotationAxis="0,0.6434,0.0914027" rotationRate="40" />
    132     <Model position="-11746,15630,-12814" scale="92" mesh="ast1.mesh" rotationAxis="0.0516508,0,0.534206" rotationRate="31" />
    133     <Model position="19389,-8340,17620" scale="96" mesh="ast5.mesh" rotationAxis="0.806963,0.925497,0" rotationRate="19" />
    134     <Model position="12269,18075,5380" scale="103" mesh="ast6.mesh" rotationAxis="0,0.685539,0.0816417" rotationRate="38" />
    135     <Model position="16499,13080,-14830" scale="58" mesh="ast3.mesh" rotationAxis="0.776935,0.430662,0" rotationRate="21" />
    136     <Model position="14398,-9629,16663" scale="90" mesh="ast2.mesh" rotationAxis="0.405098,0.0716397,0" rotationRate="31" />
    137     <Model position="16021,-8497,-11384" scale="73" mesh="ast1.mesh" rotationAxis="0.284874,0.262371,0" rotationRate="22" />
    138     <Model position="-12197,19157,-5268" scale="46" mesh="ast6.mesh" rotationAxis="0.301399,0,0.852104" rotationRate="42" />
    139     <Model position="3523,-10238,-17036" scale="58" mesh="ast3.mesh" rotationAxis="0.408875,0,0.896493" rotationRate="32" />
    140     <Model position="-9942,2328,437" scale="47" mesh="ast6.mesh" rotationAxis="0.391488,0.552897,0" rotationRate="18" />
    141     <Model position="-5089,13146,2485" scale="115" mesh="ast3.mesh" rotationAxis="0,0.77605,0.0301674" rotationRate="46" />
    142     <Model position="-3325,16428,-42" scale="59" mesh="ast4.mesh" rotationAxis="0.80208,0.306772,0" rotationRate="11" />
    143     <Model position="-8399,370,12441" scale="58" mesh="ast4.mesh" rotationAxis="0,0.673135,0.940884" rotationRate="46" />
    144     <Model position="12101,13398,-15098" scale="58" mesh="ast2.mesh" rotationAxis="0.168778,0,0.0517661" rotationRate="38" />
    145     <Model position="-2875,-11869,11008" scale="55" mesh="ast3.mesh" rotationAxis="0,0.248125,0.642059" rotationRate="40" />
    146     <Model position="1690,-9053,14913" scale="52" mesh="ast4.mesh" rotationAxis="0.454649,0.81489,0" rotationRate="23" />
    147     <Model position="17507,7536,-8757" scale="29" mesh="ast3.mesh" rotationAxis="0.947894,0,0.283392" rotationRate="41" />
    148     <Model position="-1623,-12605,-14277" scale="58" mesh="ast3.mesh" rotationAxis="0,0.253805,0.162647" rotationRate="46" />
    149     <Model position="-4045,-535,-14585" scale="88" mesh="ast4.mesh" rotationAxis="0.257327,0,0.894532" rotationRate="24" />
    150     <Model position="-9199,715,4150" scale="117" mesh="ast5.mesh" rotationAxis="0.359984,0,0.231855" rotationRate="18" />
    151     <Model position="3202,-6145,19403" scale="97" mesh="ast6.mesh" rotationAxis="0,0.470211,0.784929" rotationRate="11" />
    152     <Model position="127,-9694,1418" scale="62" mesh="ast1.mesh" rotationAxis="0.0974775,0.108828,0" rotationRate="33" />
    153     <Model position="-1033,-8523,14218" scale="89" mesh="ast1.mesh" rotationAxis="0.483568,0,0.581196" rotationRate="14" />
    154     <Model position="-28,-1140,7779" scale="47" mesh="ast2.mesh" rotationAxis="0.0572967,0.588805,0" rotationRate="25" />
    155     <Model position="-2434,-17785,-6679" scale="104" mesh="ast2.mesh" rotationAxis="0,0.458048,0.639973" rotationRate="37" />
    156     <Model position="4260,8520,-1144" scale="51" mesh="ast3.mesh" rotationAxis="0.403191,0,0.167267" rotationRate="33" />
    157     <Model position="-3288,-10630,-16957" scale="111" mesh="ast4.mesh" rotationAxis="0.451879,0.909329,0" rotationRate="34" />
    158     <Model position="9481,13063,8871" scale="74" mesh="ast6.mesh" rotationAxis="0.962342,0,0.728256" rotationRate="12" />
    159     <Model position="-13869,-19298,8075" scale="107" mesh="ast4.mesh" rotationAxis="0.989258,0,0.644457" rotationRate="38" />
    160     <Model position="946,11917,5191" scale="109" mesh="ast5.mesh" rotationAxis="0.495949,0,0.243745" rotationRate="20" />
    161     <Model position="7633,-4709,8785" scale="77" mesh="ast2.mesh" rotationAxis="0.167179,0,0.393167" rotationRate="10" />
    162     <Model position="-19647,-5229,19334" scale="48" mesh="ast6.mesh" rotationAxis="0.358825,0.560023,0" rotationRate="20" />
    163     <Model position="-17999,8929,-15681" scale="112" mesh="ast3.mesh" rotationAxis="0,0.243106,0.553743" rotationRate="37" />
    164     <Model position="8866,-1606,7639" scale="23" mesh="ast4.mesh" rotationAxis="0,0.605223,0.587725" rotationRate="31" />
    165     <Model position="-11575,15941,-9048" scale="32" mesh="ast4.mesh" rotationAxis="0.0341828,0.453673,0" rotationRate="45" />
    166     <Model position="13969,15246,-7756" scale="109" mesh="ast5.mesh" rotationAxis="0.755033,0,0.296033" rotationRate="20" />
    167     <Model position="-2325,19875,-19124" scale="86" mesh="ast2.mesh" rotationAxis="0.966503,0.242477,0" rotationRate="12" />
    168     <Model position="10304,19403,4335" scale="77" mesh="ast4.mesh" rotationAxis="0,0.00236773,0.681625" rotationRate="47" />
    169     <Model position="18514,-3055,13163" scale="78" mesh="ast5.mesh" rotationAxis="0,0.515333,0.653287" rotationRate="43" />
    170     <Model position="5789,11308,15861" scale="37" mesh="ast5.mesh" rotationAxis="0,0.382628,0.808718" rotationRate="45" />
    171     <Model position="-2178,6872,18230" scale="77" mesh="ast2.mesh" rotationAxis="0.297912,0,0.219303" rotationRate="31" />
    172     <Model position="7070,-4542,19838" scale="105" mesh="ast5.mesh" rotationAxis="0.687377,0.740396,0" rotationRate="22" />
    173     <Model position="-12823,16872,9832" scale="58" mesh="ast1.mesh" rotationAxis="0.58246,0,0.787929" rotationRate="20" />
    174     <Model position="2918,6409,8922" scale="68" mesh="ast1.mesh" rotationAxis="0.17433,0,0.826748" rotationRate="39" />
    175     <Model position="-8622,5979,-8353" scale="36" mesh="ast5.mesh" rotationAxis="0.0687289,0.268192,0" rotationRate="46" />
    176     <Model position="5979,-7415,3301" scale="31" mesh="ast6.mesh" rotationAxis="0,0.0143773,0.425826" rotationRate="46" />
    177     <Model position="-7788,19257,6317" scale="106" mesh="ast2.mesh" rotationAxis="0,0.266194,0.403447" rotationRate="39" />
    178     <Model position="12192,-12550,8480" scale="60" mesh="ast1.mesh" rotationAxis="0,0.734682,0.846663" rotationRate="25" />
    179     <Model position="440,17184,-7600" scale="113" mesh="ast4.mesh" rotationAxis="0.449652,0,0.149964" rotationRate="24" />
    180     <Model position="-12127,-16899,-8417" scale="110" mesh="ast6.mesh" rotationAxis="0,0.650716,0.368006" rotationRate="11" />
    181     <Model position="-9670,-7112,18003" scale="30" mesh="ast5.mesh" rotationAxis="0,0.139076,0.954704" rotationRate="14" />
    182     <Model position="-12697,177,7300" scale="75" mesh="ast3.mesh" rotationAxis="0.266301,0.479015,0" rotationRate="42" />
    183     <Model position="8585,-11163,10773" scale="88" mesh="ast4.mesh" rotationAxis="0.466253,0,0.430903" rotationRate="47" />
    184     <Model position="11710,-10481,-1554" scale="86" mesh="ast1.mesh" rotationAxis="0,0.964012,0.587305" rotationRate="35" />
    185     <Model position="-2643,-17331,-997" scale="77" mesh="ast1.mesh" rotationAxis="0.156293,0,0.663295" rotationRate="39" />
    186     <Model position="19531,-19531,-12541" scale="24" mesh="ast2.mesh" rotationAxis="0,0.848482,0.338155" rotationRate="17" />
    187     <Model position="7408,8762,3078" scale="26" mesh="ast5.mesh" rotationAxis="0.993064,0.489089,0" rotationRate="21" />
    188     <Model position="-14555,8711,8121" scale="20" mesh="ast6.mesh" rotationAxis="0.831339,0,0.151149" rotationRate="32" />
    189     <Model position="13295,-1765,5131" scale="26" mesh="ast1.mesh" rotationAxis="0,0.357794,0.743133" rotationRate="30" />
    190     <Model position="-19884,7732,-1186" scale="115" mesh="ast3.mesh" rotationAxis="0.958775,0,0.669833" rotationRate="23" />
    191     <Model position="18179,-17940,-19923" scale="20" mesh="ast5.mesh" rotationAxis="0.878644,0,0.217331" rotationRate="44" />
    192     <Model position="300,-9529,2789" scale="51" mesh="ast3.mesh" rotationAxis="0.54208,0,0.14456" rotationRate="37" />
    193     <Model position="14279,-9293,-11689" scale="114" mesh="ast3.mesh" rotationAxis="0,0.601114,0.645571" rotationRate="33" />
    194     <Model position="-14721,-14492,-18237" scale="76" mesh="ast3.mesh" rotationAxis="0.261656,0.207217,0" rotationRate="28" />
    195     <Model position="-1436,16914,6450" scale="73" mesh="ast1.mesh" rotationAxis="0.0323497,0,0.291569" rotationRate="28" />
    196     <Model position="19533,5238,-16963" scale="65" mesh="ast5.mesh" rotationAxis="0.0116926,0.373665,0" rotationRate="18" />
    197     <Model position="13828,8837,-12011" scale="111" mesh="ast5.mesh" rotationAxis="0,0.153227,0.382767" rotationRate="22" />
    198     <Model position="-18321,8723,2799" scale="49" mesh="ast6.mesh" rotationAxis="0.96622,0.89771,0" rotationRate="30" />
    199     <Model position="-15854,16336,11058" scale="103" mesh="ast2.mesh" rotationAxis="0.0964953,0,0.375937" rotationRate="27" />
    200     <Model position="-18187,-9952,-18073" scale="22" mesh="ast6.mesh" rotationAxis="0.61819,0.17807,0" rotationRate="33" />
    201     <Model position="-15558,-3796,17538" scale="113" mesh="ast2.mesh" rotationAxis="0.384199,0,0.383805" rotationRate="15" />
    202     <Model position="1366,12633,14581" scale="97" mesh="ast6.mesh" rotationAxis="0.930072,0,0.824122" rotationRate="22" />
    203     <Model position="-17562,12612,-2860" scale="85" mesh="ast1.mesh" rotationAxis="0.872863,0,0.10971" rotationRate="45" />
    204     <Model position="-6467,11186,272" scale="43" mesh="ast4.mesh" rotationAxis="0,0.12058,0.8878" rotationRate="32" />
    205     <Model position="-9182,-5778,-18432" scale="72" mesh="ast4.mesh" rotationAxis="0,0.317,0.972754" rotationRate="28" />
    206     <Model position="-2685,2227,-7017" scale="75" mesh="ast1.mesh" rotationAxis="0.00795897,0.859802,0" rotationRate="13" />
    207     <Model position="202,2704,7869" scale="94" mesh="ast5.mesh" rotationAxis="0,0.0867517,0.971227" rotationRate="49" />
    208     <Model position="3157,2393,4862" scale="45" mesh="ast2.mesh" rotationAxis="0.143034,0,0.945654" rotationRate="46" />
    209     <Model position="17734,11752,-2817" scale="37" mesh="ast3.mesh" rotationAxis="0.380276,0,0.284309" rotationRate="16" />
    210     <Model position="5533,9168,-2009" scale="23" mesh="ast5.mesh" rotationAxis="0,0.59324,0.275897" rotationRate="28" />
    211     <Model position="-5583,14555,-13629" scale="99" mesh="ast2.mesh" rotationAxis="0.246217,0,0.279914" rotationRate="12" />
    212     <Model position="5755,18319,-13966" scale="111" mesh="ast1.mesh" rotationAxis="0.945343,0.981593,0" rotationRate="19" />
    213     <Model position="-506,19330,10258" scale="57" mesh="ast2.mesh" rotationAxis="0.156282,0.449472,0" rotationRate="28" />
    214     <Model position="-18180,10800,-19387" scale="111" mesh="ast4.mesh" rotationAxis="0,0.138856,0.558955" rotationRate="46" />
    215     <Model position="-19442,9153,6667" scale="65" mesh="ast3.mesh" rotationAxis="0.496782,0,0.891285" rotationRate="18" />
    216     <Model position="-1991,12109,-18981" scale="39" mesh="ast1.mesh" rotationAxis="0.251609,0.291046,0" rotationRate="16" />
    217     <Model position="3016,6118,758" scale="102" mesh="ast4.mesh" rotationAxis="0.0817345,0.394506,0" rotationRate="36" />
    218     <Model position="-5930,6728,8780" scale="57" mesh="ast6.mesh" rotationAxis="0.266048,0.376193,0" rotationRate="19" />
    219     <Model position="-747,-11495,13870" scale="44" mesh="ast3.mesh" rotationAxis="0.414018,0,0.750772" rotationRate="21" />
    220     <Model position="305,-7504,9849" scale="83" mesh="ast1.mesh" rotationAxis="0.984976,0,0.0811671" rotationRate="25" />
    221     <Model position="4685,-10642,-2497" scale="85" mesh="ast6.mesh" rotationAxis="0.415558,0.751553,0" rotationRate="27" />
    222     <Model position="17354,16699,2394" scale="44" mesh="ast1.mesh" rotationAxis="0.693572,0.147356,0" rotationRate="35" />
    223     <Model position="9192,-17477,-14279" scale="61" mesh="ast2.mesh" rotationAxis="0.461486,0,0.928585" rotationRate="41" />
    224     <Model position="8023,-15706,-19451" scale="98" mesh="ast6.mesh" rotationAxis="0,0.000410601,0.90886" rotationRate="23" />
    225     <Model position="-4958,16296,-4095" scale="109" mesh="ast1.mesh" rotationAxis="0.533062,0,0.249216" rotationRate="47" />
    226     <Model position="843,16586,-13247" scale="36" mesh="ast6.mesh" rotationAxis="0,0.594639,0.732396" rotationRate="38" />
    227     <Model position="19074,8315,17723" scale="95" mesh="ast2.mesh" rotationAxis="0.966402,0,0.119558" rotationRate="44" />
    228     <Model position="-12490,734,18210" scale="35" mesh="ast4.mesh" rotationAxis="0.0976298,0.455641,0" rotationRate="24" />
    229     <Model position="-11940,6896,-17968" scale="33" mesh="ast1.mesh" rotationAxis="0,0.77757,0.432964" rotationRate="39" />
    230     <Model position="-2941,-2680,-17184" scale="54" mesh="ast2.mesh" rotationAxis="0.350042,0,0.659718" rotationRate="22" />
    231     <Model position="-9114,5177,-14254" scale="69" mesh="ast1.mesh" rotationAxis="0.65862,0.380363,0" rotationRate="27" />
    232     <Model position="-7909,1216,-6815" scale="44" mesh="ast2.mesh" rotationAxis="0,0.031546,0.392351" rotationRate="31" />
    233     <Model position="1091,-3609,53" scale="27" mesh="ast1.mesh" rotationAxis="0.702045,0.669888,0" rotationRate="17" />
    234     <Model position="8211,-10441,-7536" scale="30" mesh="ast3.mesh" rotationAxis="0,0.792689,0.311823" rotationRate="17" />
    235     <Model position="1533,8849,17655" scale="38" mesh="ast6.mesh" rotationAxis="0,0.742122,0.71549" rotationRate="49" />
    236     <Model position="6546,-5931,9791" scale="71" mesh="ast1.mesh" rotationAxis="0.373001,0,0.854548" rotationRate="47" />
    237     <Model position="14884,-14921,13589" scale="20" mesh="ast4.mesh" rotationAxis="0,0.874073,0.518839" rotationRate="28" />
    238     <Model position="-4888,1727,-581" scale="40" mesh="ast1.mesh" rotationAxis="0,0.612156,0.58926" rotationRate="49" />
    239     <Model position="16617,1806,15260" scale="28" mesh="ast1.mesh" rotationAxis="0.437493,0,0.353516" rotationRate="27" />
    240     <Model position="17792,4774,-5272" scale="101" mesh="ast3.mesh" rotationAxis="0,0.916476,0.853167" rotationRate="46" />
    241     <Model position="12856,255,-5396" scale="47" mesh="ast6.mesh" rotationAxis="0,0.18605,0.637593" rotationRate="26" />
    242     <Model position="-17573,-12764,13494" scale="107" mesh="ast5.mesh" rotationAxis="0.573851,0,0.982895" rotationRate="16" />
    243     <Model position="19722,-1137,-18060" scale="71" mesh="ast5.mesh" rotationAxis="0.273151,0.392637,0" rotationRate="34" />
    244     <Model position="12155,-1739,-17329" scale="31" mesh="ast2.mesh" rotationAxis="0,0.891737,0.832436" rotationRate="22" />
    245     <Model position="-4996,-11586,-15279" scale="119" mesh="ast2.mesh" rotationAxis="0,0.123074,0.209338" rotationRate="16" />
    246     <Model position="-13104,865,-611" scale="57" mesh="ast3.mesh" rotationAxis="0.393178,0,0.345322" rotationRate="18" />
    247     <Model position="15005,-9877,15622" scale="97" mesh="ast1.mesh" rotationAxis="0,0.152896,0.0210835" rotationRate="25" />
    248     <Model position="17583,9888,16829" scale="76" mesh="ast2.mesh" rotationAxis="0,0.947973,0.28026" rotationRate="15" />
    249     <Model position="-5279,15909,15382" scale="82" mesh="ast1.mesh" rotationAxis="0,0.499884,0.773145" rotationRate="18" />
    250     <Model position="-5938,14646,17243" scale="56" mesh="ast6.mesh" rotationAxis="0,0.0967167,0.348338" rotationRate="16" />
    251     <Model position="19518,17215,-1274" scale="119" mesh="ast1.mesh" rotationAxis="0.223859,0,0.252346" rotationRate="44" />
    252     <Model position="-16237,-17619,-6745" scale="65" mesh="ast6.mesh" rotationAxis="0.0241466,0.491285,0" rotationRate="39" />
    253     <Model position="12763,1468,-3165" scale="78" mesh="ast3.mesh" rotationAxis="0.800474,0.278164,0" rotationRate="37" />
    254     <Model position="13946,-7517,13683" scale="92" mesh="ast1.mesh" rotationAxis="0.142206,0.894399,0" rotationRate="40" />
    255     <Model position="-5491,-1084,-11117" scale="84" mesh="ast2.mesh" rotationAxis="0.174864,0,0.298694" rotationRate="14" />
    256     <Model position="2799,9189,7344" scale="54" mesh="ast3.mesh" rotationAxis="0.330476,0.71494,0" rotationRate="31" />
    257     <Model position="-18445,-17042,3296" scale="110" mesh="ast6.mesh" rotationAxis="0,0.320011,0.644437" rotationRate="20" />
    258     <Model position="-15377,5559,-12082" scale="26" mesh="ast4.mesh" rotationAxis="0,0.451157,0.102375" rotationRate="20" />
    259     <Model position="-2331,-14260,17200" scale="85" mesh="ast5.mesh" rotationAxis="0.0446891,0.515642,0" rotationRate="37" />
    260     <Model position="-9613,-4258,4537" scale="103" mesh="ast1.mesh" rotationAxis="0.820812,0.60695,0" rotationRate="13" />
    261     <Model position="-6169,19264,-4878" scale="69" mesh="ast3.mesh" rotationAxis="0,0.585115,0.235653" rotationRate="32" />
    262     <Model position="8717,-16685,9115" scale="37" mesh="ast4.mesh" rotationAxis="0.0512168,0.899599,0" rotationRate="15" />
    263     <Model position="18826,17155,4947" scale="84" mesh="ast4.mesh" rotationAxis="0.204495,0,0.838098" rotationRate="48" />
    264     <Model position="7971,3645,-9858" scale="65" mesh="ast3.mesh" rotationAxis="0.348379,0,0.384062" rotationRate="19" />
    265     <Model position="9202,8689,-6795" scale="37" mesh="ast4.mesh" rotationAxis="0.826781,0,0.641626" rotationRate="40" />
    266     <Model position="-12115,6664,5786" scale="105" mesh="ast1.mesh" rotationAxis="0.794331,0.43244,0" rotationRate="40" />
    267     <Model position="17142,15709,-8725" scale="57" mesh="ast5.mesh" rotationAxis="0,0.561188,0.300935" rotationRate="36" />
    268     <Model position="1991,-11949,-15733" scale="68" mesh="ast1.mesh" rotationAxis="0,0.390655,0.623811" rotationRate="41" />
    269     <Model position="-6787,1792,287" scale="71" mesh="ast6.mesh" rotationAxis="0.161019,0.130015,0" rotationRate="36" />
    270     <Model position="-7223,-13574,-11873" scale="24" mesh="ast4.mesh" rotationAxis="0.792203,0,0.177188" rotationRate="38" />
     43<?lua
     44for i = 1, 226, 1
     45do ?>
     46  <Model position="<?lua print(math.random(-19597, 18732))?>, <?lua print(math.random(-19597, 18732)) ?>, <?lua print(math.random(-19597, 18732)) ?>" scale="<?lua print(math.random( 20, 119)) ?>" mesh="ast<?lua print(i%6 + 1) ?>.mesh" rotationAxis="<?lua print(math.random()) ?>, <?lua print(math.random()) ?>, <?lua print(math.random()) ?>" rotationRate="<?lua print(math.random(16, 44)) ?>" />
     47<?lua
     48end
     49?>
  • code/trunk/bin/plugins.cfg-init

    r790 r1021  
    22
    33# Define plugin folder
    4 PluginFolder=/usr/lib/OGRE
     4PluginFolder=/usr/local/lib/OGRE
    55
    66# Define plugins
  • code/trunk/src/audio/AudioManager.cc

    r790 r1021  
    4242        AudioManager::~AudioManager()
    4343        {
    44                 for (unsigned int i=0;i<=bgSounds.size();i++)
     44                for (unsigned int i=0;i<bgSounds.size();i++)
    4545                {
    4646                        bgSounds[i].release();
     
    8484        }
    8585
    86         void AudioManager::update()
     86        void AudioManager::tick(float dt)
    8787        {
    8888                if (bgSounds.size() > 0)
  • code/trunk/src/audio/AudioManager.h

    r790 r1021  
    33
    44#include "AudioIncludes.h"
     5
     6#include "core/Tickable.h"
    57
    68#include "AudioPrereqs.h"
     
    1214namespace audio
    1315{
    14         class _AudioExport AudioManager
     16  class _AudioExport AudioManager : public orxonox::Tickable
    1517        {
    1618        public:
     
    3739
    3840                // Update
    39                 void update();
     41                void tick(float dt);
    4042
    4143                void ambientAdd(std::string file);
  • code/trunk/src/network/Client.cc

    r790 r1021  
    184184    while(!(client_connection.queueEmpty())){
    185185      packet = client_connection.getPacket();
    186       //std::cout << "tick packet size " << packet->dataLength << std::endl;
     186      COUT(5) << "tick packet size " << packet->dataLength << std::endl;
    187187      elaborate(packet, 0); // ================= i guess we got to change this .... (client_ID is always same = server)
    188188    }
     
    191191
    192192  void Client::processGamestate( GameStateCompressed *data){
     193    int id = data->id;
     194    COUT(5) << "received gamestate id: " << data->id << std::endl;
    193195    gamestate.pushGameState(data);
    194     std::cout << "received gamestate id: " << data->id << std::endl;
    195     client_connection.addPacket(pck_gen.acknowledgement(data->id));
     196    client_connection.addPacket(pck_gen.acknowledgement(id));
    196197    client_connection.sendPackets();
    197198    return;
     
    203204    if(id!=NULL)
    204205      id->setNetworkID(clid->clid);
     206    COUT(4) << "received and set network id: " << clid->clid << "; classname: " << clid->message << std::endl;
    205207    return;
    206208  }
    207209
    208210  void Client::processChat( chat *data){
    209     std::cout << "Server: " << data->message << std::endl;
     211    COUT(0) << "Server: " << data->message << std::endl;
    210212  }
    211213
  • code/trunk/src/network/Client.h

    r790 r1021  
    1717
    1818#include "NetworkPrereqs.h"
     19
     20#include "core/Tickable.h"
    1921#include "ClientConnection.h"
    2022#include "PacketManager.h"
    2123#include "GameStateClient.h"
    2224//#include "NetworkFrameListener.h"
     25
    2326
    2427
     
    3235  *
    3336  */
    34   class _NetworkExport Client : PacketDecoder{
     37  class _NetworkExport Client : PacketDecoder, public orxonox::Tickable{
    3538  public:
    3639    Client();
  • code/trunk/src/network/ClientConnection.cc

    r790 r1021  
    4343
    4444#include "util/Sleep.h"
     45#include "orxonox/core/Debug.h"
    4546#include "ClientConnection.h"
    4647
     
    159160      case ENET_EVENT_TYPE_CONNECT:
    160161      case ENET_EVENT_TYPE_RECEIVE:
    161         //std::cout << "got packet" << std::endl;
     162        COUT(5) << "receiver-Thread: got new packet" << std::endl;
    162163        processData(&event);
    163164        break;
     
    215216
    216217  bool ClientConnection::processData(ENetEvent *event) {
    217     //std::cout << "got packet, pushing to queue" << std::endl;
     218    COUT(5) << "got packet, pushing to queue" << std::endl;
    218219    // just add packet to the buffer
    219220    // this can be extended with some preprocessing
  • code/trunk/src/network/ConnectionManager.cc

    r790 r1021  
    257257
    258258  void ConnectionManager::syncClassid(int clientID) {
    259     int i=0;
     259    unsigned int network_id=0;
    260260    std::string classname;
    261     bool abort=false;
    262261    orxonox::Identifier *id;
    263     while(!abort){
    264       id = ID(i);
    265       std::cout << "syncid: " << i << ", ID(id): " << id << std::endl;
    266       if(id == NULL){
    267         if(i!=0)
    268           abort=true;
    269         else{
    270           ++i;
    271           continue;
    272         }
    273       }
    274       else{
    275         classname = id->getName();
    276         addPacket(packet_gen.clid( i, classname ),clientID);
    277       }
    278       ++i;
     262    std::map<std::string, orxonox::Identifier*>::const_iterator it = orxonox::Factory::getFactoryBegin();
     263    while(it != orxonox::Factory::getFactoryEnd()){
     264      id = (*it).second;
     265      if(id == NULL)
     266        continue;
     267      classname = id->getName();
     268      network_id = id->getNetworkID();
     269      COUT(4) << "network_id: " << network_id << ", classname: " << classname << std::endl;
     270     
     271      addPacket(packet_gen.clid( (int)network_id, classname ), clientID);
     272     
     273      ++it;
    279274    }
    280275    sendPackets();
    281276  }
    282277
     278 
     279 
     280  void ConnectionManager::addClientsObjectID( int clientID, int objectID ) {
     281    COUT(4) << "ship of client: " << clientID << ": " << objectID << " mapped" << std::endl;
     282    clientsShip.insert( std::make_pair( clientID, objectID ) );
     283  }
     284
     285  int ConnectionManager::getClientsShipID( int clientID ) {
     286    return clientsShip[clientID];
     287  }
     288
     289  int ConnectionManager::getObjectsClientID( int objectID ) {
     290    std::map<int, int>::iterator iter = clientsShip.begin();
     291    while( iter != clientsShip.end() ) {
     292      if( iter->second == objectID ) return iter->first;
     293    }
     294    return -99;
     295  }
     296
     297  void ConnectionManager::deleteClientIDReg( int clientID ) {
     298    clientsShip.erase( clientID );
     299  }
     300
     301  void ConnectionManager::deleteObjectIDReg( int objectID ) {
     302    std::map<int, int>::iterator iter = clientsShip.begin();
     303    while( iter != clientsShip.end() ) {
     304      if( iter->second == objectID ) break;
     305    }
     306    clientsShip.erase( iter->first );
     307  }
     308 
    283309}
  • code/trunk/src/network/ConnectionManager.h

    r790 r1021  
    1414
    1515#include <string>
     16#include <map>
    1617// enet library for networking support
    1718#include <enet/enet.h>
     
    7374    bool quit; // quit-variable (communication with threads)
    7475    ClientInformation *head_;
     76   
     77    //functions to map what object every clients uses
     78    std::map<int, int> clientsShip;
     79    void addClientsObjectID( int clientID, int objectID );
     80    int getClientsShipID( int clientID );
     81    int getObjectsClientID( int objectID );
     82    void deleteClientIDReg( int clientID );
     83    void deleteObjectIDReg( int objectID );
    7584  };
    7685
  • code/trunk/src/network/GameStateClient.cc

    r871 r1021  
    4040
    4141  bool GameStateClient::pushGameState(GameStateCompressed *compstate) {
     42    GameState *gs;
    4243    if(compstate->diffed)
    43       return loadSnapshot(decode(reference, *compstate));
     44      gs = decode(reference, compstate);
    4445    else
    45       return loadSnapshot(decode(*compstate));
     46      gs = decode(compstate);
     47    if(gs)
     48      return loadSnapshot(gs);
     49    COUT(4) << "could not use gamestate sent by server" << std::endl;
     50    return false;
    4651  }
    4752
     
    6166  * @param state a GameState struct containing the size of the gamestate and a pointer linking to a flat list (returned by getSnapshot)
    6267  */
    63   bool GameStateClient::loadSnapshot(GameState state) {
    64     unsigned char *data=state.data;
    65     std::cout << "loadSnapshot: loading gs: " << state.id << std::endl;
     68  bool GameStateClient::loadSnapshot(GameState *state) {
     69    unsigned char *data=state->data;
     70    COUT(4) << "loadSnapshot: loading gs: " << state->id << std::endl;
    6671    // get the start of the Synchronisable list
    6772    orxonox::Iterator<Synchronisable> it=orxonox::ObjectList<Synchronisable>::start();
    6873    syncData sync;
    6974    // loop as long as we have some data ;)
    70     while(data < state.data+state.size){
     75    while(data < state->data+state->size){
    7176      // prepare the syncData struct
    7277      sync.length = (int)*data;
     
    8287        // bad luck ;)
    8388        // delete the synchronisable (obviously seems to be deleted on the server)
    84         while(it && it->objectID!=sync.objectID){
     89        while(it && it->objectID!=sync.objectID)
    8590          removeObject(it);
    86         }
    87         if(it==0){
    88           std::cout << "classid: " << sync.classID << ", name: " << ID(sync.classID)->getName() << std::endl;
    89           Synchronisable *no = (Synchronisable*)(ID(sync.classID)->fabricate());
     91       
     92       
     93        if(!it){
     94          COUT(5) << "classid: " << sync.classID << ", name: " << ID((unsigned int) sync.classID)->getName() << std::endl;
     95          Synchronisable *no = (Synchronisable*)(ID((unsigned int) sync.classID)->fabricate());
    9096          no->objectID=sync.objectID;
    9197          no->classID=sync.classID;
     
    9399          // update data and create object/entity...
    94100          if( !no->updateData(sync) && !no->create() )
    95             COUT(0) << "We couldn't create/update the object: " << sync.objectID << std::endl;
     101            COUT(1) << "We couldn't create/update the object: " << sync.objectID << std::endl;
    96102          ++it;
    97103        }
     
    99105        // we have our object
    100106        if(! it->updateData(sync))
    101           std::cout << "We couldn't update objectID: " \
     107          COUT(1) << "We couldn't update objectID: " \
    102108          << sync.objectID << "; classID: " << sync.classID << std::endl;
    103109      }
     
    108114  }
    109115
    110   GameState GameStateClient::diff(GameState a, GameState b) {
    111     unsigned char *ap = a.data, *bp = b.data;
     116  GameState *GameStateClient::undiff(GameState *a, GameState *b) {
     117    unsigned char *ap = a->data, *bp = b->data;
    112118    int of=0; // pointers offset
    113119    int dest_length=0;
    114     if(a.size>=b.size)
    115       dest_length=a.size;
     120    if(a->size>=b->size)
     121      dest_length=a->size;
    116122    else
    117       dest_length=b.size;
     123      dest_length=b->size;
    118124    unsigned char *dp = (unsigned char *)malloc(dest_length*sizeof(unsigned char));
    119     while(of<a.size && of<b.size){
     125    while(of<a->size && of<b->size){
    120126      *(dp+of)=*(ap+of)^*(bp+of); // do the xor
    121127      ++of;
    122128    }
    123     if(a.size!=b.size){ // do we have to fill up ?
     129    if(a->size!=b->size){ // do we have to fill up ?
    124130      unsigned char n=0;
    125       if(a.size<b.size){
     131      if(a->size<b->size){
    126132        while(of<dest_length){
    127133          *(dp+of)=n^*(bp+of);
     
    137143    // should be finished now
    138144    // FIXME: is it true or false now? (struct has changed, producing warnings)
    139     GameState r = {b.id, dest_length, true, dp};
     145    GameState *r = new GameState;
     146    r->id = b->id;
     147    r->size = dest_length;
     148    r->diffed = false;
     149    r->data = dp;
    140150    return r;
    141151  }
    142152
    143   GameState GameStateClient::decompress(GameStateCompressed a) {
    144     int normsize = a.normsize;
    145     int compsize = a.compsize;
     153  GameState *GameStateClient::decompress(GameStateCompressed *a) {
     154    int normsize = a->normsize;
     155    int compsize = a->compsize;
    146156    int bufsize;
    147157    if(normsize < compsize)
     
    154164    //std::cout << "gamestateclient" << std::endl;
    155165    //std::cout << "normsize " << a.normsize << " compsize " << a.compsize << " " << bufsize << std::endl;
    156     retval = uncompress( dest, &length, a.data, (uLong)compsize );
     166    retval = uncompress( dest, &length, a->data, (uLong)compsize );
    157167    //std::cout << "length " << length << std::endl;
    158168    switch ( retval ) {
    159       case Z_OK: std::cout << "successfully decompressed" << std::endl; break;
    160       case Z_MEM_ERROR: std::cout << "not enough memory available" << std::endl; break;
    161       case Z_BUF_ERROR: std::cout << "not enough memory available in the buffer" << std::endl; break;
    162       case Z_DATA_ERROR: std::cout << "data corrupted" << std::endl; break;
     169      case Z_OK: COUT(4) << "successfully decompressed" << std::endl; break;
     170      case Z_MEM_ERROR: COUT(1) << "not enough memory available" << std::endl; return NULL;
     171      case Z_BUF_ERROR: COUT(2) << "not enough memory available in the buffer" << std::endl; return NULL;
     172      case Z_DATA_ERROR: COUT(2) << "data corrupted" << std::endl; return NULL;
    163173    }
    164174
    165     GameState gamestate;
    166     gamestate.id = a.id;
    167     gamestate.size = normsize;
    168     gamestate.data = dest;
    169     gamestate.diffed = a.diffed;
     175    GameState *gamestate = new GameState;
     176    gamestate->id = a->id;
     177    gamestate->size = normsize;
     178    gamestate->data = dest;
     179    gamestate->diffed = a->diffed;
     180   
     181    delete a->data; //delete compressed data
     182    delete a; //we do not need the old (struct) gamestate anymore
    170183
    171184    return gamestate;
    172185  }
    173186
    174   GameState GameStateClient::decode(GameState a, GameStateCompressed x) {
    175     GameState t = decompress(x);
    176     return diff(a, t);
     187  GameState *GameStateClient::decode(GameState *a, GameStateCompressed *x) {
     188    GameState *t = decompress(x);
     189    return undiff(a, t);
    177190  }
    178191
    179   GameState GameStateClient::decode(GameStateCompressed x) {
    180     GameState t = decompress(x);
     192  GameState *GameStateClient::decode(GameStateCompressed *x) {
     193    GameState *t = decompress(x);
    181194    return t;
    182195  }
  • code/trunk/src/network/GameStateClient.h

    r790 r1021  
    2525    bool pushGameState(GameStateCompressed *compstate);
    2626  private:
    27     bool loadSnapshot(GameState state);
    28     GameState diff(GameState a, GameState b);
    29     GameState decompress(GameStateCompressed a);
    30     GameState decode(GameState a, GameStateCompressed x);
    31     GameState decode(GameStateCompressed x);
     27    bool loadSnapshot(GameState *state);
     28    GameState *undiff(GameState *a, GameState *b);
     29    GameState *decompress(GameStateCompressed *a);
     30    GameState *decode(GameState *a, GameStateCompressed *x);
     31    GameState *decode(GameStateCompressed *x);
    3232    void removeObject(orxonox::Iterator<Synchronisable> &it);
    3333
    34     GameState reference;
     34    GameState *reference;
    3535  };
    3636
  • code/trunk/src/network/GameStateManager.cc

    r871 r1021  
    4343
    4444#include "core/CoreIncludes.h"
     45
    4546#include "ClientInformation.h"
    4647#include "Synchronisable.h"
     
    6566  }
    6667
    67   GameStateCompressed GameStateManager::popGameState(int clientID) {
     68  GameStateCompressed *GameStateManager::popGameState(int clientID) {
    6869    int gID = head_->findClient(clientID)->getGamestateID();
    69     std::cout << "popgamestate: sending gstate id: " << id << "diffed from: " << gID << std::endl;
     70    COUT(4) << "popgamestate: sending gstate id: " << id << "diffed from: " << gID << std::endl;
    7071    if(gID!=GAMESTATEID_INITIAL){
    7172      GameState *client = gameStateMap[gID];
     
    100101    GameState *retval=new GameState; //return value
    101102    retval->id=id++;
    102     std::cout << "producing gamestate with id: " << retval->id << std::endl;
     103    COUT(4) << "producing gamestate with id: " << retval->id << std::endl;
    103104    // reserve a little memory and increase it later on
    104     //COUT(2) << "mallocing" << std::endl;
     105    COUT(5) << "mallocing" << std::endl;
    105106    retval->data = (unsigned char*)malloc(memsize);
    106     //COUT(2) << "malloced" << std::endl;
     107    COUT(5) << "malloced" << std::endl;
    107108
    108109    // offset of memory functions
     
    113114      //get size of the synchronisable
    114115      tempsize=it->getSize();
    115       //std::cout << "size of temp gamestate: " << tempsize << std::endl;
     116//       COUT(5) << "size of temp gamestate: " << tempsize << std::endl;
    116117      //COUT(2) << "size of synchronisable: " << tempsize << std::endl;
    117118      // add place for data and 3 ints (length,classid,objectid)
     
    137138      offset+=tempsize+3*sizeof(int);
    138139    }
     140    COUT(5) << "Gamestate size: " << totalsize << std::endl;
    139141    retval->size=totalsize;
    140142    return retval;
    141143  }
    142144
    143   GameStateCompressed GameStateManager::encode(GameState *a, GameState *b) {
     145  GameStateCompressed *GameStateManager::encode(GameState *a, GameState *b) {
    144146    //GameState r = diff(a,b);
    145147    //r.diffed = true;
    146     GameState r = *b;
    147     r.diffed = false;
    148     return compress_(&r);
    149   }
    150 
    151   GameStateCompressed GameStateManager::encode(GameState *a) {
     148    GameState *r = b;
     149    r->diffed = false;
     150    return compress_(r);
     151  }
     152
     153  GameStateCompressed *GameStateManager::encode(GameState *a) {
    152154    a->diffed=false;
    153155    return compress_(a);
    154156  }
    155157
    156   GameState GameStateManager::diff(GameState *a, GameState *b) {
     158  GameState *GameStateManager::diff(GameState *a, GameState *b) {
    157159    unsigned char *ap = a->data, *bp = b->data;
    158160    int of=0; // pointers offset
     
    181183      }
    182184    }
    183     // should be finished now
    184     // FIXME: is it true or false now? (struct has changed, producing warnings)
    185     GameState r = {b->id, dest_length, true, dp};
     185   
     186    GameState *r = new GameState;
     187    r->id = b->id;
     188    r->size = dest_length;
     189    r->diffed = true;
     190    r->data = dp;
    186191    return r;
    187192  }
    188193
    189   GameStateCompressed GameStateManager::compress_(GameState *a) {
    190     //COUT(2) << "compressing gamestate" << std::endl;
     194  GameStateCompressed *GameStateManager::compress_(GameState *a) {
     195    COUT(5) << "compressing gamestate" << std::endl;
    191196    int size = a->size;
    192197    uLongf buffer = (uLongf)((a->size + 12)*1.01)+1;
     
    198203
    199204    switch ( retval ) {
    200       case Z_OK: std::cout << "successfully compressed" << std::endl; break;
    201       case Z_MEM_ERROR: std::cout << "not enough memory available" << std::endl; break;
    202       case Z_BUF_ERROR: std::cout << "not enough memory available in the buffer" << std::endl; break;
    203       case Z_DATA_ERROR: std::cout << "decompress: data corrupted" << std::endl; break;
    204     }
    205 
    206     GameStateCompressed compressedGamestate;
    207     compressedGamestate.compsize = buffer;
    208     //std::cout << "compressedGamestate.compsize = buffer; " << buffer << std::endl;
    209     compressedGamestate.normsize = size;
    210     //std::cout << "compressedGamestate.normsize = size; " << size << std::endl;
    211     compressedGamestate.id = a->id;
    212     compressedGamestate.data = dest;
    213     compressedGamestate.diffed = a->diffed;
     205      case Z_OK: COUT(5) << "successfully compressed" << std::endl; break;
     206      case Z_MEM_ERROR: COUT(1) << "not enough memory available in gamestate.compress" << std::endl;
     207      return NULL;
     208      case Z_BUF_ERROR: COUT(2) << "not enough memory available in the buffer in gamestate.compress" << std::endl;
     209      return NULL;
     210      case Z_DATA_ERROR: COUT(2) << "decompress: data corrupted in gamestate.compress" << std::endl;
     211      return NULL;
     212    }
     213
     214    GameStateCompressed *compressedGamestate = new GameStateCompressed;
     215    compressedGamestate->compsize = buffer;
     216//     std::cout << "compressedGamestate.compsize = buffer; " << buffer << std::endl;
     217    compressedGamestate->normsize = size;
     218//     std::cout << "compressedGamestate.normsize = size; " << size << std::endl;
     219    compressedGamestate->id = a->id;
     220    compressedGamestate->data = dest;
     221    compressedGamestate->diffed = a->diffed;
    214222
    215223    return compressedGamestate;
  • code/trunk/src/network/GameStateManager.h

    r790 r1021  
    4343    ~GameStateManager();
    4444    void update();
    45     GameStateCompressed popGameState(int clientID);
     45    GameStateCompressed *popGameState(int clientID);
    4646    void ackGameState(int clientID, int gamestateID);
    4747    int id;
    4848  private:
    4949    GameState *getSnapshot(int id);
    50     GameStateCompressed encode(GameState *a, GameState *b);
    51     GameStateCompressed encode(GameState *a);
    52     GameState diff(GameState *a, GameState *b);
    53     GameStateCompressed compress_(GameState *a);
     50    GameStateCompressed *encode(GameState *a, GameState *b);
     51    GameStateCompressed *encode(GameState *a);
     52    GameState *diff(GameState *a, GameState *b);
     53    GameStateCompressed *compress_(GameState *a);
    5454    bool deleteUnusedGameState(int gamestateID);
    5555
  • code/trunk/src/network/PacketDecoder.cc

    r790 r1021  
    3838#include "PacketTypes.h"
    3939#include "PacketManager.h"
     40#include "orxonox/core/Debug.h"
    4041
    4142namespace network
    4243{
    43   using namespace std;
    4444
    4545  PacketDecoder::PacketDecoder(){}
     
    5252  {
    5353    int client = clientId;
    54     cout << "clientId: " << client << endl; //control cout, not important, just debugging info
     54    COUT(5) << "clientId: " << client << std::endl; //control cout, not important, just debugging info
    5555    int id = (int)*packet->data; //the first 4 bytes are always the enet packet id
    56     std::cout << "packet id: " << id << std::endl;
    57     std::cout << "packet size inside packetdecoder: " << packet->dataLength << std::endl;
     56    COUT(5) << "packet id: " << id << std::endl;
     57//     COUT(5) << "packet size inside packetdecoder: " << packet->dataLength << std::endl;
    5858    switch( id ) {
    5959  case ACK:
     
    9393
    9494
    95     std::cout << "got ack id: " << a->id << std::endl;
     95    COUT(5) << "got ack id: " << a->id << std::endl;
    9696    processAck( a, clientId ); //debug info
    9797
     
    144144  void PacketDecoder::gstate( ENetPacket* packet )
    145145  {
    146     GameStateCompressed* currentState = new GameStateCompressed;
     146    GameStateCompressed* currentState = NULL;
     147    currentState = new GameStateCompressed;
     148    if(currentState == NULL){
     149      COUT(3) << "could not generate new GameStateCompressed" << std::endl;
     150      return;
     151    }
    147152    //since it's not alowed to use void* for pointer arithmetic
    148     unsigned char* data = (unsigned char*)packet->data;
     153    unsigned char* data = (unsigned char *)(packet->data);
    149154    //copy the GameStateCompressed id into the struct, which is located at second place data+sizeof( int )
    150155    //memcpy( (void*)&(currentState->id), (const void*)(data+sizeof( int )), sizeof( int ) );
    151     currentState->id = (int)*(data+sizeof(int));
    152     std::cout << "id: " << currentState->id << std::endl;
     156    //currentState->id = *((int *)packet->data+sizeof(int));
     157    memcpy( (void*)&(currentState->id), (const void*)(packet->data+1*sizeof( int )), sizeof( int) );
     158    COUT(5) << "decoder: received gs id: " << currentState->id << std::endl;
     159//     std::cout << "id: " << currentState->id << std::endl;
    153160    //copy the size of the GameStateCompressed compressed data into the new GameStateCompressed struct, located at 3th
    154161    //position of the data stream, data+2*sizeof( int )
    155     memcpy( (void*)&(currentState->compsize), (const void*)(data+2*sizeof( int )), sizeof( int) );
     162    memcpy( (void*)&(currentState->compsize), (const void*)(packet->data+2*sizeof( int )), sizeof( int) );
    156163    //currentState->compsize = (int)*(data+2*sizeof(int));
    157     std::cout << "compsize: " << currentState->compsize << std::endl;
     164//     std::cout << "compsize: " << currentState->compsize << std::endl;
    158165    //size of uncompressed data
    159     memcpy( (void*)&(currentState->normsize), (const void*)(data+3*sizeof( int )), sizeof( int ) );
     166    memcpy( (void*)&(currentState->normsize), (const void*)(packet->data+3*sizeof( int )), sizeof( int ) );
    160167    //currentState->normsize = (int)*(data+3*sizeof(int));
    161     std::cout << "normsize. " << currentState->normsize << std::endl;
     168//     std::cout << "normsize. " << currentState->normsize << std::endl;
    162169    //since the packetgenerator was changed, due to a new parameter, change this function too
    163     memcpy( (void*)&(currentState->diffed), (const void*)(data+4*sizeof(int)), sizeof(bool));
     170    memcpy( (void*)&(currentState->diffed), (const void*)(packet->data+4*sizeof(int)), sizeof(bool));
    164171    //currentState->diffed = (bool)*(data+4*sizeof(int));
    165     std::cout << "diffed: " << currentState->diffed << std::endl;
     172//     std::cout << "diffed: " << currentState->diffed << std::endl;
    166173    //since data is not allocated, because it's just a pointer, allocate it with size of gamestatedatastream
     174    if(currentState->compsize==0)
     175      COUT(2) << "compsize is 0" << std::endl;
    167176    currentState->data = (unsigned char*)(malloc( currentState->compsize ));
    168177    if(currentState->data==NULL)
    169       std::cout << "memory leak" << std::endl;
     178      COUT(2) << "Gamestatepacket-decoder: memory leak" << std::endl;
    170179    //copy the GameStateCompressed data
    171180    //std::cout << "packet size (enet): " << packet->dataLength << std::endl;
    172181    //std::cout << "totallen: " << 4*sizeof(int)+sizeof(bool)+currentState->compsize << std::endl;
    173     memcpy( (void*)(currentState->data), (const void*)(data+4*sizeof( int ) + sizeof(bool)), currentState->compsize );
    174 
    175     //clean memory
    176     enet_packet_destroy( packet );
    177     //run processGameStateCompressed
    178     //TODO: not yet implemented!
     182    memcpy( (void*)(currentState->data), (const void*)(packet->data+4*sizeof( int ) + sizeof(bool)), currentState->compsize );
     183
     184    //clean memory
     185    enet_packet_destroy( packet );
    179186    processGamestate(currentState);
    180187  }
     
    189196    void *data  = (void *)cid->message;
    190197    memcpy(data, (const void*)(packet->data+3*sizeof(int)), cid->length);
    191     std::cout << "classid: " << cid->clid << ", name: " << cid->message << std::endl;
     198    COUT(4) << "classid: " << cid->clid << ", name: " << cid->message << std::endl;
    192199    enet_packet_destroy( packet );
    193200    processClassid(cid);
     
    223230  void PacketDecoder::printAck( ack* data )
    224231  {
    225     cout << "data id: " << data->id << endl;
    226     cout << "data:    " << data->a << endl;
     232    COUT(5) << "data id: " << data->id << std::endl;
     233    COUT(5) << "data:    " << data->a << std::endl;
    227234  }
    228235
    229236  void PacketDecoder::printMouse( mouse* data )
    230237  {
    231     cout << "data id: " << data->id << endl;
    232     cout << "data:    " << data->x << " " << data->y << endl;
     238    COUT(5) << "data id: " << data->id << std::endl;
     239    COUT(5) << "data:    " << data->x << " " << data->y << std::endl;
    233240  }
    234241
    235242  void PacketDecoder::printKey( keyboard* data )
    236243  {
    237     cout << "data id: " << data->id << endl;
    238     cout << "data:    " << (char)data->press << endl;
     244    COUT(5) << "data id: " << data->id << std::endl;
     245    COUT(5) << "data:    " << (char)data->press << std::endl;
    239246  }
    240247
     
    242249  {
    243250    if(clientId!=CLIENTID_CLIENT)
    244       cout << "client: " << clientId << endl;
    245     cout << "data id: " << data->id << endl;
    246     cout << "data:    " << data->message << endl;
     251      COUT(5) << "client: " << clientId << std::endl;
     252    COUT(5) << "data id: " << data->id << std::endl;
     253    COUT(5) << "data:    " << data->message << std::endl;
    247254  }
    248255
    249256  void PacketDecoder::printGamestate( GameStateCompressed* data )
    250257  {
    251     cout << "id of GameStateCompressed:   " << data->id << endl;
    252     cout << "size of GameStateCompressed: " << data->compsize << endl;
     258    COUT(5) << "id of GameStateCompressed:   " << data->id << std::endl;
     259    COUT(5) << "size of GameStateCompressed: " << data->compsize << std::endl;
    253260  }
    254261
    255262  void PacketDecoder::printClassid( classid *cid)
    256263  {
    257     cout << "id of classid:    " << cid->id << endl;
    258     cout << "size of classid:  " << cid->length << endl;
    259     cout << "ID of classid:    " << cid->clid <<endl;
    260     cout << "data of classid:  " << cid->message <<endl;
     264    COUT(5) << "id of classid:    " << cid->id << std::endl;
     265    COUT(5) << "size of classid:  " << cid->length << std::endl;
     266    COUT(5) << "ID of classid:    " << cid->clid << std::endl;
     267    COUT(5) << "data of classid:  " << cid->message << std::endl;
    261268  }
    262269
  • code/trunk/src/network/PacketGenerator.cc

    r790 r1021  
    5050  ENetPacket* PacketGenerator::acknowledgement( int state, int reliable )
    5151  {
    52     std::cout << "generating new acknowledgement, id: " << state << std::endl;
     52    COUT(4) << "generating new acknowledgement, id: " << state << std::endl;
    5353    ack* ackreq = new ack;
    5454    ackreq->id = ACK;
     
    6363  ENetPacket* PacketGenerator::mousem( double x, double y, int reliable )
    6464  {
    65     std::cout << "generating new mouse" << std::endl;
     65    COUT(4) << "generating new mouse" << std::endl;
    6666    mouse* mousemove = new mouse;
    6767    mousemove->id = MOUSE;
     
    7777  ENetPacket* PacketGenerator::keystrike( char press, int reliable )
    7878  {
    79     std::cout << "generating new keyboard" << std::endl;
     79    COUT(4) << "generating new keyboard" << std::endl;
    8080    keyboard* key = new keyboard;
    8181    key->id = KEYBOARD;
  • code/trunk/src/network/PacketManager.h

    r790 r1021  
    44#include <string>
    55#include <enet/enet.h>
     6
     7#include "core/CoreIncludes.h"
    68
    79#include "NetworkPrereqs.h"
     
    6567    virtual void processGamestate(GameStateCompressed *state);
    6668    virtual void processAck( ack *data, int clientID);
    67     void processClassid( classid *cid);
     69    virtual void processClassid( classid *cid);
    6870    //virtual void processAck( ack *data);
    6971
  • code/trunk/src/network/Server.cc

    r790 r1021  
    1818#include "ClientInformation.h"
    1919//#include "NetworkFrameListener.h"
     20#include "util/Sleep.h"
    2021#include "Server.h"
    2122
     
    112113    processQueue();
    113114    updateGamestate();
     115
     116    sleep(1); // TODO remove
    114117    return;
    115118  }
     
    134137    gamestates->update();
    135138    //std::cout << "updated gamestate, sending it" << std::endl;
    136     sendGameState();
     139    //if(clients->getGamestateID()!=GAMESTATEID_INITIAL)
     140      sendGameState();
    137141    //std::cout << "sent gamestate" << std::endl;
    138142  }
     
    142146  */
    143147  bool Server::sendGameState() {
    144     std::cout << "starting gamestate" << std::endl;
     148    COUT(5) << "starting sendGameState" << std::endl;
    145149    ClientInformation *temp = clients;
    146150    bool added=false;
     
    151155      }
    152156      if( !(temp->getSynched()) ){
    153         std::cout << "not sending gamestate" << std::endl;
     157        COUT(5) << "not sending gamestate" << std::endl;
    154158        temp=temp->next();
    155159        continue;
    156160      }
    157       std::cout << "doing gamestate" << std::endl;
     161      COUT(5) << "doing gamestate gamestate preparation" << std::endl;
    158162      int gid = temp->getGamestateID();
    159163      int cid = temp->getID();
    160       std::cout << "server, got acked ID: " << gid << std::endl;
    161       GameStateCompressed *gs = &(gamestates->popGameState(cid)); // FIXME: taking address of temporary, check if correct
     164      COUT(5) << "server, got acked (gamestate) ID: " << gid << std::endl;
     165      GameStateCompressed *gs = gamestates->popGameState(cid);
     166      if(gs==NULL){
     167        COUT(2) << "could not generate gamestate" << std::endl;
     168        return false;
     169      }
    162170      //std::cout << "adding gamestate" << std::endl;
    163171      connection->addPacket(packet_gen.gstate(gs), cid);
     
    168176    if(added)
    169177      return connection->sendPackets();
    170     else
    171       return false;
     178    COUT(5) << "had no gamestates to send" << std::endl;
     179    return false;
    172180  }
    173181
    174182  void Server::processAck( ack *data, int clientID) {
     183    COUT(5) << "processing ack from client: " << clientID << "; ack-id: " << data->id << std::endl;
    175184    clients->findClient(clientID)->setGamestateID(data->a);
    176185  }
  • code/trunk/src/network/Server.h

    r790 r1021  
    1616#include <string>
    1717
     18#include "NetworkPrereqs.h"
     19
     20#include "core/Tickable.h"
    1821#include "PacketManager.h"
    19 #include "NetworkPrereqs.h"
     22
     23
    2024
    2125namespace network
     
    2529  * It implements all functions necessary for a Server
    2630  */
    27   class _NetworkExport Server : public PacketDecoder{
     31  class _NetworkExport Server : public PacketDecoder, public orxonox::Tickable{
    2832  public:
    2933    Server();
  • code/trunk/src/network/Synchronisable.h

    r871 r1021  
    5656    int getSize();
    5757    bool updateData(syncData vars);
    58     void registerAllVariables();
     58    virtual void registerAllVariables()=0;
    5959    virtual bool create()=0;
    6060  protected:
  • code/trunk/src/network/dummyclient3.cc

    r790 r1021  
    1313  network::PacketGenerator pck;
    1414  const int PORT = 55556;
    15   std::cout << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << std::endl;
     15  COUT(0) << "Enter address of the server xxx.xxx.xxx.xxx (enter for localhost)" << std::endl;
    1616  std::string str;
    1717  std::getline(std::cin, str);
    18   std::cout << "You entered: " << str << std::endl;
     18  COUT(3) << "You entered: " << str << std::endl;
    1919  if(str.compare("")==0)
    2020    str="127.0.0.1";
     
    2222  Client client( str, PORT );
    2323  if ( client.establishConnection() )
    24     std::cout << "connection established" << std::endl;
    25   else std::cout << "problems establishing connection" << std::endl;
     24    COUT(3) << "connection established" << std::endl;
     25  else COUT(0) << "problems establishing connection" << std::endl;
    2626  char message[10000];
    2727  char signs[] = "abcdefghijklmnopqrstuvwxy";
  • code/trunk/src/orxonox/CMakeLists.txt

    r871 r1021  
    11SET( ORXONOX_SRC_FILES
    22  GraphicsEngine.cc
     3  InputEventListener.cc
     4  InputHandler.cc
    35  Main.cc
    46  Orxonox.cc
    5   objects/Tickable.cc
    6   SpaceshipSteering.cc
     7#  SpaceshipSteering.cc
    78  hud/HUD.cc
    89  particle/ParticleInterface.cc
  • code/trunk/src/orxonox/GraphicsEngine.cc

    r790 r1021  
    3333
    3434#include <OgreRoot.h>
     35#include <OgreException.h>
    3536#include <OgreConfigFile.h>
    3637#include <OgreTextureManager.h>
     38#include <OgreRenderWindow.h>
    3739
     40#include "core/CoreIncludes.h"
    3841#include "core/Debug.h"
    3942#include "GraphicsEngine.h"
     
    4649  GraphicsEngine::GraphicsEngine()
    4750  {
     51    RegisterObject(GraphicsEngine);
     52    //this->bOverwritePath_ = false;
     53    this->setConfigValues();
    4854    // set to standard values
    4955    this->configPath_ = "";
    50     this->dataPath_ = "";
    51     scene_ = NULL;
     56    this->root_ = 0;
     57    this->scene_ = 0;
     58    this->renderWindow_ = 0;
    5259  }
    5360
     
    5562  GraphicsEngine::~GraphicsEngine()
    5663  {
     64    if (!this->root_)
     65      delete this->root_;
     66  }
     67
     68  void GraphicsEngine::setConfigValues()
     69  {
     70    SetConfigValue(dataPath_, dataPath_).description("relative path to media data");
     71
    5772  }
    5873
     
    6681    root_ = new Root(NULL, configPath_ + "ogre.cfg", configPath_ + "Ogre.log");
    6782#endif*/
    68 #if defined(_DEBUG) && defined(WIN32)
     83#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC && defined(_DEBUG)
    6984    std::string plugin_filename = "plugins_d.cfg";
    7085#else
     
    87102  }
    88103
    89   bool GraphicsEngine::load()
     104  bool GraphicsEngine::load(std::string dataPath)
    90105  {
     106    // temporary overwrite of dataPath, change ini file for permanent change
     107    if( dataPath != "" )
     108      dataPath_ = dataPath;
    91109    loadRessourceLocations(this->dataPath_);
    92110    if (!root_->restoreConfig() && !root_->showConfigDialog())
     
    95113  }
    96114
    97   void GraphicsEngine::startRender()
     115  void GraphicsEngine::initialise()
    98116  {
    99     root_->initialise(true, "OrxonoxV2");
     117    this->renderWindow_ = root_->initialise(true, "OrxonoxV2");
    100118    TextureManager::getSingleton().setDefaultNumMipmaps(5);
     119    //TODO: Do NOT load all the groups, why are we doing that? And do we really do that? initialise != load...
    101120    ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    102121  }
     
    131150  }
    132151
     152  /**
     153    Returns the window handle of the render window.
     154    At least the InputHandler uses this to create the OIS::InputManager
     155    @return The window handle of the render window
     156  */
     157  size_t GraphicsEngine::getWindowHandle()
     158  {
     159    if (this->renderWindow_)
     160    {
     161      Ogre::RenderWindow *renderWindow = this->root_->getAutoCreatedWindow();
     162      size_t windowHnd = 0;
     163      renderWindow->getCustomAttribute("WINDOW", &windowHnd);
     164      return windowHnd;
     165    }
     166    else
     167      return 0;
     168  }
     169
     170  /**
     171    Get the width of the current render window
     172    @return The width of the current render window
     173  */
     174  int GraphicsEngine::getWindowWidth() const
     175  {
     176    if (this->renderWindow_)
     177    {
     178      return this->renderWindow_->getWidth();
     179    }
     180    else
     181      return 0;
     182  }
     183
     184  /**
     185    Get the height of the current render window
     186    @return The height of the current render window
     187  */
     188  int GraphicsEngine::getWindowHeight() const
     189  {
     190    if (this->renderWindow_)
     191    {
     192      return this->renderWindow_->getHeight();
     193    }
     194    else
     195      return 0;
     196  }
    133197
    134198}
  • code/trunk/src/orxonox/GraphicsEngine.h

    r790 r1021  
    1010#include <string>
    1111
     12#include <OgrePrerequisites.h>
    1213#include <OgreRoot.h>
    1314#include <OgreSceneManager.h>
    1415
    1516#include "OrxonoxPrereqs.h"
     17#include "core/OrxonoxClass.h"
    1618
    1719
     
    2123   * graphics engine manager class
    2224 */
    23   class _OrxonoxExport GraphicsEngine {
     25  class _OrxonoxExport GraphicsEngine : public OrxonoxClass
     26  {
    2427    public:
    2528      GraphicsEngine();
    2629      inline void setConfigPath(std::string path) { this->configPath_ = path; };
    2730      // find a better way for this
    28       inline Ogre::Root* getRoot() { return root_; };
     31      //inline Ogre::Root* getRoot() { return root_; };
     32      void setConfigValues();
    2933      void setup();
    30       bool load();
     34      bool load(std::string path);
    3135      void loadRessourceLocations(std::string path);
    3236      Ogre::SceneManager* getSceneManager();
    33       void startRender();
     37      void initialise();
     38
     39      // several window properties
     40      Ogre::RenderWindow* getRenderWindow() { return this->renderWindow_; }
     41      size_t getWindowHandle();
     42      int getWindowWidth() const;
     43      int getWindowHeight() const;
     44
     45      // Ogre Root access for Orxonox
     46      void frameStarted(Ogre::FrameEvent &evt)
     47      { if (root_) root_->_fireFrameStarted(evt); }
     48      void frameEnded  (Ogre::FrameEvent &evt)
     49      { if (root_) root_->_fireFrameEnded(evt);   }
     50      void renderOneFrame()
     51      { if (root_) root_->_updateAllRenderTargets(); }
    3452
    3553      virtual ~GraphicsEngine();
     54
    3655    private:
    3756      Ogre::Root*         root_;        //!< Ogre's root
     
    3958      std::string         dataPath_;    //!< path to data file
    4059      Ogre::SceneManager* scene_;       //!< scene manager of the game
     60      Ogre::RenderWindow* renderWindow_;//!< the current render window
     61      //bool               bOverwritePath_; //!< overwrites path
    4162
    4263  };
  • code/trunk/src/orxonox/Main.cc

    r790 r1021  
    2727
    2828 /**
    29  @file  Main.cc
    30  @brief main file handling most of the machine specific code
     29 @file
     30 @brief Entry point of the program. Platform specific code.
    3131  */
    3232
    3333#include "OrxonoxStableHeaders.h"
    3434
    35 #include <OgrePlatform.h>
    36 #include <OgreException.h>
     35#include <exception>
    3736
    38 
     37#include "OrxonoxPlatform.h"
    3938#include "core/SignalHandler.h"
    4039#include "Orxonox.h"
    4140
    4241using namespace orxonox;
    43 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
     42#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE
    4443#include <CoreFoundation/CoreFoundation.h>
    4544
     
    7271#endif
    7372
    74 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 && !defined( __MINGW32__ )
    75 #ifndef WIN32_LEAN_AND_MEAN
    76 #define WIN32_LEAN_AND_MEAN
    77 #endif
    78 #include "windows.h"
    79   INT WINAPI WinMain(HINSTANCE hInst, HINSTANCE, LPSTR strCmdLine, INT)
    80   {
    81     // something like this would be less hacky
    82     // maybe one can work with trailing '\0'
    83     // or maybe use string based functions
    84     // I was unable to test it without working windows version
    85     char* cmd = strCmdLine;
    86     int argc = 2;
    87     int i;
    88     int j;
    89     for(i = 0; cmd[i] != NULL; i++)
    90     {
    91       if(cmd[i] == ' ') argc++;
    92     }
    93     char **argv = new char*[argc];
    94     for (j = 0; j < argc; j++)
    95     {
    96       argv[j] = new char[i];
    97     }
    98     j = 1;
    99     int k = 0;
    100     for(int i = 0; cmd[i] != NULL; i++)
    101     {
    102       if(cmd[i] != ' ') {
    103         argv[j][k] = cmd[i];
    104         k++;
    105       }
    106       else {
    107         argv[j][k] = '\0';
    108         k = 0;
    109         j++;
    110       }
    111     }
    112     argv[j][k] = '\0';
    113     argv[0] = "BeniXonox.exe";
    114     //char *argv[2];
    115     //argv[0] = "asdfProgram";
    116     //argv[1] =  strCmdLine;
    117     //int argc = 2;
     73int main(int argc, char **argv)
     74{
     75  try {
     76    SignalHandler::getInstance()->doCatch(argv[0], "orxonox.log");
     77    Orxonox* orx = Orxonox::getSingleton();
     78
     79#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_APPLE
     80    orx->init(argc, argv, macBundlePath());
    11881#else
    119   int main(int argc, char **argv)
    120   {
    121 #endif
    122     try {
    123       srand(time(0));  //initaialize RNG; TODO check if it works on win
    124       SignalHandler::getInstance()->doCatch(argv[0], "orxonox.log");
    125       Orxonox* orx = Orxonox::getSingleton();
    126 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    127       orx->init(argc, argv, macBundlePath());
    128       orx->start();
    129 #else
    130 /*
    131 for (int i = 0; i < 500; i++)
    132 {
    133 int x = rand() % 40000 - 20000;
    134 int y = rand() % 40000 - 20000;
    135 int z = rand() % 40000 - 20000;
    136 
    137 int scale = rand() % 100 + 20;
    138 
    139 int version = rand() % 6 + 1;
    140 
    141 float rotx = float(rand()) / RAND_MAX;
    142 float roty = float(rand()) / RAND_MAX;
    143 float rotz = float(rand()) / RAND_MAX;
    144 
    145 int axis = rand() % 3 + 1;
    146 
    147 if (axis == 1)
    148   rotx = 0;
    149 if (axis == 2)
    150   roty = 0;
    151 if (axis == 3)
    152   rotz = 0;
    153 
    154 int rotation = rand() % 40 + 10;
    155 
    156 //    <Model position="1000,1500,0" scale="50" mesh="ast1.mesh" rotationAxis="0,1.25,0" rotationRate="70" />
    157 std::cout << "    <Model position=\"" << x << "," << y << "," << z << "\" scale=\"" << scale << "\" mesh=\"ast" << version << ".mesh\" rotationAxis=\"" << rotx << "," << roty << "," << rotz << "\" rotationRate=\"" << rotation << "\" />" << std::endl;
    158 
    159 
    160 }
    161 */
    162       orx->init(argc, argv, "");
    163       orx->start();
    164 #endif
    165     }
    166     catch (Ogre::Exception& e) {
    167 #if OGRE_PLATFORM == OGRE_PLATFORM_WIN32 && !defined( __MINGW32__ )
    168       MessageBoxA(NULL, e.getFullDescription().c_str(),
    169             "An exception has occured!", MB_OK | MB_ICONERROR | MB_TASKMODAL);
    170 #else
    171       std::cerr << "Exception:\n";
    172       std::cerr << e.getFullDescription().c_str() << "\n";
    173 #endif
    174       return 1;
    175     }
    176     return 0;
    177   }
    178 
    179 #ifdef __cplusplus
    180 }
     82    orx->init(argc, argv, "");
    18183#endif
    18284
    183 
    184 /*int main(int argc, char **argv)
    185 {
    186   try
     85    orx->start();
     86    orx->destroy();
     87  }
     88  catch (std::exception &ex)
    18789  {
    188     SignalHandler::getInstance()->doCatch(argv[0], "orxonox.log");
    189     Orxonox* orx = Orxonox::getSingleton();
    190 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    191     orx->init(argc, argv, macBundlePath());
    192     orx->start();
    193 #else
    194     orx->init(argc, argv, "");
    195     orx->start();
    196 #endif
    197 
    198   }
    199   catch(Ogre::Exception& e)
    200   {
    201     fprintf(stderr, "An exception has occurred: %s\n",
    202             e.getFullDescription().c_str());
     90    std::cerr << "Exception:\n";
     91    std::cerr << ex.what() << "\n";
    20392    return 1;
    20493  }
     
    20796}
    20897
    209 */
     98#ifdef __cplusplus
     99}
     100#endif
  • code/trunk/src/orxonox/Orxonox.cc

    r871 r1021  
    3535
    3636//****** OGRE ******
    37 #include <OgreException.h>
    38 #include <OgreRoot.h>
     37//#include <OgreException.h>
    3938#include <OgreFrameListener.h>
    40 #include <OgreRenderWindow.h>
    41 #include <OgreTextureManager.h>
    42 #include <OgreResourceGroupManager.h>
    43 #include <OgreConfigFile.h>
    4439#include <OgreOverlay.h>
    4540#include <OgreOverlayManager.h>
    46 
    47 //****** OIS *******
    48 #include <OIS/OIS.h>
     41#include <OgreTimer.h>
     42#include <OgreWindowEventUtilities.h>
    4943
    5044//****** STD *******
    51 #include <iostream>
    52 #include <exception>
     45//#include <iostream>
     46//#include <exception>
     47#include <deque>
    5348
    5449//***** ORXONOX ****
    5550//misc
    56 #include "util/Sleep.h"
    57 
    58 // loader and audio
    59 //#include "loader/LevelLoader.h"
     51//#include "util/Sleep.h"
     52
     53// audio
    6054#include "audio/AudioManager.h"
    6155
     
    6357#include "network/Server.h"
    6458#include "network/Client.h"
    65 #include "network/NetworkFrameListener.h"
     59network::Client *client_g;
     60network::Server *server_g;
    6661
    6762// objects
    68 #include "objects/Tickable.h"
     63#include "core/ArgReader.h"
     64#include "core/Debug.h"
     65#include "core/Factory.h"
     66#include "core/Loader.h"
     67#include "core/Tickable.h"
     68#include "hud/HUD.h"
    6969#include "tools/Timer.h"
    70 #include "objects/NPC.h"
    71 #include "core/ArgReader.h"
    72 #include "core/Factory.h"
    73 #include "core/Debug.h"
    74 #include "core/Loader.h"
    75 #include "hud/HUD.h"
    7670#include "objects/weapon/BulletManager.h"
    77 #include "GraphicsEngine.h"
     71
     72#include "InputHandler.h"
    7873
    7974#include "Orxonox.h"
     
    8176namespace orxonox
    8277{
    83    // put this in a seperate Class or solve the problem in another fashion
    84   class OrxListener : public Ogre::FrameListener
    85   {
    86     public:
    87       OrxListener(OIS::Keyboard *keyboard, audio::AudioManager*  auMan, gameMode mode)
    88       {
    89         mKeyboard = keyboard;
    90         mode_=mode;
    91         auMan_ = auMan;
    92       }
    93 
    94       bool frameStarted(const Ogre::FrameEvent& evt)
    95       {
    96         auMan_->update();
    97         updateAI();
    98 
    99         if(mode_ == PRESENTATION)
    100           server_g->tick(evt.timeSinceLastFrame);
    101         else if(mode_ == CLIENT)
    102           client_g->tick(evt.timeSinceLastFrame);
    103 
    104         usleep(10);
    105 
    106         mKeyboard->capture();
    107         return !mKeyboard->isKeyDown(OIS::KC_ESCAPE);
    108       }
    109 
    110       void updateAI()
    111       {
    112         for(Iterator<NPC> it = ObjectList<NPC>::start(); it; ++it)
    113         {
    114           it->update();
    115         }
    116       }
    117 
    118     private:
    119       gameMode mode_;
    120       OIS::Keyboard *mKeyboard;
    121       audio::AudioManager*  auMan_;
    122   };
    123 
    124   // init static singleton reference of Orxonox
    125   Orxonox* Orxonox::singletonRef_ = NULL;
     78  /**
     79    @brief Reference to the only instance of the class.
     80  */
     81  Orxonox *Orxonox::singletonRef_s = 0;
    12682
    12783  /**
     
    13187  {
    13288    this->ogre_ = new GraphicsEngine();
     89    this->timer_ = 0;
    13390    this->dataPath_ = "";
    134 //    this->loader_ = 0;
    13591    this->auMan_ = 0;
    136     this->singletonRef_ = 0;
    137     this->keyboard_ = 0;
    138     this->mouse_ = 0;
    139     this->inputManager_ = 0;
    140     this->frameListener_ = 0;
    141     this->root_ = 0;
     92    this->inputHandler_ = 0;
     93    //this->root_ = 0;
     94    // turn on frame smoothing by setting a value different from 0
     95    this->frameSmoothingTime_ = 0.0f;
     96    this->bAbort_ = false;
    14297  }
    14398
     
    147102  Orxonox::~Orxonox()
    148103  {
    149     // nothing to delete as for now
     104    // keep in mind: the order of deletion is very important!
     105    if (this->bulletMgr_)
     106      delete this->bulletMgr_;
     107    if (this->orxonoxHUD_)
     108      delete this->orxonoxHUD_;
     109    Loader::close();
     110    InputHandler::destroy();
     111    if (this->auMan_)
     112      delete this->auMan_;
     113    if (this->timer_)
     114      delete this->timer_;
     115    if (this->ogre_)
     116      delete this->ogre_;
     117
     118    if (client_g)
     119      delete client_g;
     120    if (server_g)
     121      delete server_g;
     122  }
     123
     124  /**
     125   * error kills orxonox
     126   */
     127  void Orxonox::abortImmediate(/* some error code */)
     128  {
     129    //TODO: destroy and destruct everything and print nice error msg
     130    delete this;
     131  }
     132
     133  /**
     134    Asks the mainloop nicely to abort.
     135  */
     136  void Orxonox::abortRequest()
     137  {
     138    bAbort_ = true;
     139  }
     140
     141  /**
     142   * @return singleton object
     143   */
     144  Orxonox* Orxonox::getSingleton()
     145  {
     146    if (!singletonRef_s)
     147      singletonRef_s = new Orxonox();
     148    return singletonRef_s;
     149    //static Orxonox theOnlyInstance;
     150    //return &theOnlyInstance;
     151  }
     152
     153  /**
     154    @brief Destroys the Orxonox singleton.
     155  */
     156  void Orxonox::destroy()
     157  {
     158    if (singletonRef_s)
     159      delete singletonRef_s;
     160    singletonRef_s = 0;
    150161  }
    151162
     
    153164   * initialization of Orxonox object
    154165   * @param argc argument counter
    155    * @param argv list of arguments
     166   * @param argv list of argumenst
    156167   * @param path path to config (in home dir or something)
    157168   */
     
    162173    //TODO: give config file to Ogre
    163174    std::string mode;
    164 //     if(argc>=2)
    165 //       mode = std::string(argv[1]);
    166 //     else
    167 //       mode = "";
     175
    168176    ArgReader ar = ArgReader(argc, argv);
    169177    ar.checkArgument("mode", mode, false);
    170178    ar.checkArgument("data", this->dataPath_, false);
    171179    ar.checkArgument("ip", serverIp_, false);
    172     //mode = "presentation";
    173     if(ar.errorHandling()) die();
    174     if(mode == std::string("server"))
     180    if(ar.errorHandling()) abortImmediate();
     181    if(mode == std::string("client"))
    175182    {
     183      mode_ = CLIENT;
     184      clientInit(path);
     185    }
     186    else if(mode== std::string("server")){
     187      mode_ = SERVER;
    176188      serverInit(path);
    177       mode_ = SERVER;
    178     }
    179     else if(mode == std::string("client"))
    180     {
    181       clientInit(path);
    182       mode_ = CLIENT;
    183     }
    184     else if(mode == std::string("presentation"))
    185     {
    186       serverInit(path);
    187       mode_ = PRESENTATION;
    188189    }
    189190    else{
     191      mode_ = STANDALONE;
    190192      standaloneInit(path);
    191       mode_ = STANDALONE;
    192193    }
    193194  }
    194195
    195   /**
    196    * start modules
    197    */
    198   void Orxonox::start()
    199   {
    200     //TODO: start modules
    201     ogre_->startRender();
    202     //TODO: run engine
    203     Factory::createClassHierarchy();
    204     createScene();
    205     setupScene();
    206     setupInputSystem();
    207     if(mode_!=CLIENT){ // remove this in future ---- presentation hack
    208     }
    209     else
    210       std::cout << "client here" << std::endl;
    211     createFrameListener();
    212     switch(mode_){
    213     case PRESENTATION:
    214       //ogre_->getRoot()->addFrameListener(new network::ServerFrameListener());
    215       //std::cout << "could not add framelistener" << std::endl;
    216       server_g->open();
    217       break;
    218     case CLIENT:
    219       client_g->establishConnection();
    220       break;
    221     case SERVER:
    222     case STANDALONE:
    223     default:
    224       break;
    225     }
    226     startRenderLoop();
    227   }
    228 
    229   /**
    230    * @return singleton object
    231    */
    232   Orxonox* Orxonox::getSingleton()
    233   {
    234     if (!singletonRef_)
    235       singletonRef_ = new Orxonox();
    236     return singletonRef_;
    237   }
    238 
    239   /**
    240    * error kills orxonox
    241    */
    242   void Orxonox::die(/* some error code */)
    243   {
    244     //TODO: destroy and destruct everything and print nice error msg
    245     delete this;
    246   }
    247 
    248   void Orxonox::standaloneInit(std::string path)
    249   {
     196  void Orxonox::serverInit(std::string path)
     197  {
     198    COUT(2) << "initialising server" << std::endl;
     199   
    250200    ogre_->setConfigPath(path);
    251201    ogre_->setup();
    252     root_ = ogre_->getRoot();
    253     if(!ogre_->load()) die(/* unable to load */);
    254 
    255     //defineResources();
    256     //setupRenderSystem();
    257     //createRenderWindow();
    258     //initializeResourceGroups();
    259     /*createScene();
    260     setupScene();
    261     setupInputSystem();
    262     createFrameListener();
    263     Factory::createClassHierarchy();
    264     startRenderLoop();*/
    265   }
    266 
    267   void Orxonox::playableServer(std::string path)
    268   {
    269     ogre_->setConfigPath(path);
    270     ogre_->setup();
    271     root_ = ogre_->getRoot();
    272     defineResources();
    273     setupRenderSystem();
    274     createRenderWindow();
    275     initializeResourceGroups();
    276     setupInputSystem();
    277     Factory::createClassHierarchy();
    278     createScene();
    279     setupScene();
    280     createFrameListener();
    281     try{
    282       server_g = new network::Server(); //!< add port and bindadress
    283       server_g->open(); //!< open server and create listener thread
    284       if(ogre_ && ogre_->getRoot())
    285         ogre_->getRoot()->addFrameListener(new network::ServerFrameListener()); // adds a framelistener for the server
    286       COUT(3) << "Info: network framelistener added" << std::endl;
    287     }
    288     catch(...)
    289     {
    290       COUT(1) << "Error: There was a problem initialising the server :(" << std::endl;
    291     }
    292     startRenderLoop();
    293   }
    294 
    295   void Orxonox::standalone(){
    296 
    297 
    298 
    299   }
    300 
    301   void Orxonox::serverInit(std::string path)
    302   {
    303     COUT(2) << "initialising server" << std::endl;
    304     ogre_->setConfigPath(path);
    305     ogre_->setup();
    306     server_g = new network::Server(); // FIXME add some settings if wanted
    307     if(!ogre_->load()) die(/* unable to load */);
    308     // FIXME add network framelistener
     202    //root_ = ogre_->getRoot();
     203    if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
     204   
     205    server_g = new network::Server();
    309206  }
    310207
    311208  void Orxonox::clientInit(std::string path)
    312209  {
    313     COUT(2) << "initialising client" << std::endl;
     210    COUT(2) << "initialising client" << std::endl;\
     211   
    314212    ogre_->setConfigPath(path);
    315213    ogre_->setup();
     
    317215      client_g = new network::Client();
    318216    else
    319       client_g = new network::Client(serverIp_, 55556);
    320     if(!ogre_->load()) die(/* unable to load */);
    321     ogre_->getRoot()->addFrameListener(new network::ClientFrameListener());
    322   }
    323 
    324   void Orxonox::defineResources()
    325   {
    326     std::string secName, typeName, archName;
    327     Ogre::ConfigFile cf;
    328 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    329     cf.load(macBundlePath() + "/Contents/Resources/resources.cfg");
    330 #else
    331     cf.load(dataPath_ + "resources.cfg");
    332 #endif
    333 
    334     Ogre::ConfigFile::SectionIterator seci = cf.getSectionIterator();
    335     while (seci.hasMoreElements())
    336     {
    337       secName = seci.peekNextKey();
    338       Ogre::ConfigFile::SettingsMultiMap *settings = seci.getNext();
    339       Ogre::ConfigFile::SettingsMultiMap::iterator i;
    340       for (i = settings->begin(); i != settings->end(); ++i)
    341       {
    342         typeName = i->first;
    343         archName = i->second;
    344 #if OGRE_PLATFORM == OGRE_PLATFORM_APPLE
    345         Ogre::ResourceGroupManager::getSingleton().addResourceLocation( std::string(macBundlePath() + "/" + archName), typeName, secName);
    346 #else
    347         Ogre::ResourceGroupManager::getSingleton().addResourceLocation( archName, typeName, secName);
    348 #endif
    349       }
     217      client_g = new network::Client(serverIp_, NETWORK_PORT);
     218    if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
     219  }
     220 
     221  void Orxonox::standaloneInit(std::string path)
     222  {
     223    COUT(2) << "initialising standalone mode" << std::endl;
     224   
     225    ogre_->setConfigPath(path);
     226    ogre_->setup();
     227    //root_ = ogre_->getRoot();
     228    if(!ogre_->load(this->dataPath_)) abortImmediate(/* unable to load */);
     229  }
     230 
     231  /**
     232   * start modules
     233   */
     234  void Orxonox::start()
     235  {
     236    switch(mode_){
     237    case CLIENT:
     238      clientStart();
     239      break;
     240    case SERVER:
     241      serverStart();
     242      break;
     243    default:
     244      standaloneStart();
    350245    }
    351246  }
    352 
    353   void Orxonox::setupRenderSystem()
    354   {
    355     if (!root_->restoreConfig() && !root_->showConfigDialog())
    356       throw Ogre::Exception(52, "User canceled the config dialog!", "OrxApplication::setupRenderSystem()");
    357   }
    358 
    359   void Orxonox::createRenderWindow()
    360   {
    361     root_->initialise(true, "OrxonoxV2");
    362   }
    363 
    364   void Orxonox::initializeResourceGroups()
    365   {
    366     Ogre::TextureManager::getSingleton().setDefaultNumMipmaps(5);
    367     Ogre::ResourceGroupManager::getSingleton().initialiseAllResourceGroups();
    368   }
    369 
    370   /**
    371    *
    372    * @param
    373    */
    374   void Orxonox::createScene(void)
    375   {
    376         // Init audio
     247 
     248  void Orxonox::clientStart(){
     249    ogre_->initialise();
     250    Factory::createClassHierarchy();
     251   
     252   
    377253    auMan_ = new audio::AudioManager();
    378254
    379255    bulletMgr_ = new BulletManager();
    380 
    381     // load this file from config
    382 //    loader_ = new loader::LevelLoader("sample.oxw");
    383 //    loader_->loadLevel();
    384     Level* startlevel = new Level("levels/sample.oxw");
    385     Loader::open(startlevel);
    386 
     256   
    387257    Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
    388258    HUD* orxonoxHud;
     
    391261    orxonoxHud->setEnergyDistr(20,20,60);
    392262    hudOverlay->show();
     263   
     264    client_g->establishConnection();
     265    client_g->tick(0);
     266   
     267   
     268    //setupInputSystem();
     269   
     270    startRenderLoop();
     271  }
     272 
     273  void Orxonox::serverStart(){
     274    //TODO: start modules
     275    ogre_->initialise();
     276    //TODO: run engine
     277    Factory::createClassHierarchy();
     278    createScene();
     279    setupInputSystem();
     280   
     281    server_g->open();
     282   
     283    startRenderLoop();
     284  }
     285 
     286  void Orxonox::standaloneStart(){
     287    //TODO: start modules
     288    ogre_->initialise();
     289    //TODO: run engine
     290    Factory::createClassHierarchy();
     291    createScene();
     292    setupInputSystem();
     293   
     294    startRenderLoop();
     295  }
     296
     297  void Orxonox::createScene(void)
     298  {
     299          // Init audio
     300    auMan_ = new audio::AudioManager();
     301
     302    bulletMgr_ = new BulletManager();
     303
     304    // load this file from config
     305    Level* startlevel = new Level("levels/sample.oxw");
     306    Loader::open(startlevel);
     307
     308    Ogre::Overlay* hudOverlay = Ogre::OverlayManager::getSingleton().getByName("Orxonox/HUD1.2");
     309    orxonoxHUD_ = new HUD();
     310    orxonoxHUD_->setEnergyValue(20);
     311    orxonoxHUD_->setEnergyDistr(20,20,60);
     312    hudOverlay->show();
    393313
    394314        /*
     
    396316    auMan_->ambientAdd("a2");
    397317    auMan_->ambientAdd("a3");
    398                                 //auMan->ambientAdd("ambient1");
    399     auMan_->ambientStart();*/
    400   }
    401 
    402 
    403   /**
    404    *
    405    */
    406   void Orxonox::setupScene()
    407   {
    408 //    SceneManager *mgr = ogre_->getSceneManager();
    409 
    410 
    411 //    SceneNode* node = (SceneNode*)mgr->getRootSceneNode()->getChild("OgreHeadNode");
    412 //     SceneNode *node = mgr->getRootSceneNode()->createChildSceneNode("OgreHeadNode", Vector3(0,0,0));
    413 
    414 
    415 /*
    416     particle::ParticleInterface *e = new particle::ParticleInterface(mgr,"engine","Orxonox/strahl");
    417     e->particleSystem_->setParameter("local_space","true");
    418     e->setPositionOfEmitter(0, Vector3(0,-10,0));
    419     e->setDirection(Vector3(0,0,-1));
    420     e->addToSceneNode(node);
    421 */
    422   }
    423 
    424 
     318    //auMan->ambientAdd("ambient1");
     319    auMan_->ambientStart();
     320  */
     321  }
     322
     323  /**
     324    @brief Calls the InputHandler which sets up the input devices.
     325    The render window width and height are used to set up the mouse movement.
     326  */
    425327  void Orxonox::setupInputSystem()
    426328  {
    427     size_t windowHnd = 0;
    428     std::ostringstream windowHndStr;
    429     OIS::ParamList pl;
    430 
    431     // fixes auto repeat problem
    432     #if defined OIS_LINUX_PLATFORM
    433       pl.insert(std::make_pair(std::string("XAutoRepeatOn"), std::string("true")));
    434     #endif
    435 
    436       Ogre::RenderWindow *win = ogre_->getRoot()->getAutoCreatedWindow();
    437     win->getCustomAttribute("WINDOW", &windowHnd);
    438     windowHndStr << windowHnd;
    439     pl.insert(std::make_pair(std::string("WINDOW"), windowHndStr.str()));
    440     inputManager_ = OIS::InputManager::createInputSystem(pl);
    441 
    442     try
     329    inputHandler_ = InputHandler::getSingleton();
     330    if (!inputHandler_->initialise(ogre_->getWindowHandle(),
     331          ogre_->getWindowWidth(), ogre_->getWindowHeight()))
     332      abortImmediate();
     333  }
     334
     335  /**
     336    Main loop of the orxonox game.
     337    This is a new solution, using the ogre engine instead of being used by it.
     338    An alternative solution would be to simply use the timer of the Root object,
     339    but that implies using Ogre in any case. There would be no way to test
     340    our code without the help of the root object.
     341    There's even a chance that we can dispose of the root object entirely
     342    in server mode.
     343    About the loop: The design is almost exactly like the one in ogre, so that
     344    if any part of ogre registers a framelisteners, it will still behave
     345    correctly. Furthermore I have taken over the time smoothing feature from
     346    ogre. If turned on (see orxonox constructor), it will calculate the dt_n by
     347    means of the recent most dt_n-1, dt_n-2, etc.
     348  */
     349  void Orxonox::startRenderLoop()
     350  {
     351    // use the ogre timer class to measure time.
     352    if (!timer_)
     353      timer_ = new Ogre::Timer();
     354    timer_->reset();
     355
     356    // Contains the times of recently fired events
     357    std::deque<unsigned long> eventTimes[3];
     358    // Clear event times
     359    for (int i = 0; i < 3; ++i)
     360      eventTimes[i].clear();
     361
     362          while (!bAbort_)
     363          {
     364                  // Pump messages in all registered RenderWindows
     365      Ogre::WindowEventUtilities::messagePump();
     366
     367      // get current time
     368      unsigned long now = timer_->getMilliseconds();
     369
     370      // create an event to pass to the frameStarted method in ogre
     371      Ogre::FrameEvent evt;
     372      evt.timeSinceLastEvent = calculateEventTime(now, eventTimes[0]);
     373      evt.timeSinceLastFrame = calculateEventTime(now, eventTimes[1]);
     374
     375      // show the current time in the HUD
     376      orxonoxHUD_->setTime((int)now, 0);
     377
     378      // Iterate through all Tickables and call their tick(dt) function
     379      for (Iterator<Tickable> it = ObjectList<Tickable>::start(); it; )
     380        (it++)->tick((float)evt.timeSinceLastFrame);
     381
     382      // don't forget to call _fireFrameStarted in ogre to make sure
     383      // everything goes smoothly
     384      ogre_->frameStarted(evt);
     385
     386      if (mode_ != SERVER)
     387        ogre_->renderOneFrame(); // only render in non-server mode
     388
     389      // get current time
     390      now = timer_->getMilliseconds();
     391
     392      // create an event to pass to the frameEnded method in ogre
     393      evt.timeSinceLastEvent = calculateEventTime(now, eventTimes[0]);
     394      evt.timeSinceLastFrame = calculateEventTime(now, eventTimes[2]);
     395
     396      // again, just to be sure ogre works fine
     397      ogre_->frameEnded(evt);
     398          }
     399  }
     400
     401  /**
     402    Method for calculating the average time between recently fired events.
     403    Code directly taken from OgreRoot.cc
     404    @param now The current time in ms.
     405    @param type The type of event to be considered.
     406  */
     407  float Orxonox::calculateEventTime(unsigned long now, std::deque<unsigned long> &times)
     408  {
     409    // Calculate the average time passed between events of the given type
     410    // during the last mFrameSmoothingTime seconds.
     411
     412    times.push_back(now);
     413
     414    if(times.size() == 1)
     415      return 0;
     416
     417    // Times up to mFrameSmoothingTime seconds old should be kept
     418    unsigned long discardThreshold =
     419      static_cast<unsigned long>(frameSmoothingTime_ * 1000.0f);
     420
     421    // Find the oldest time to keep
     422    std::deque<unsigned long>::iterator it = times.begin(),
     423      end = times.end()-2; // We need at least two times
     424    while(it != end)
    443425    {
    444       keyboard_ = static_cast<OIS::Keyboard*>(inputManager_->createInputObject(OIS::OISKeyboard, false));
    445       mouse_ = static_cast<OIS::Mouse*>(inputManager_->createInputObject(OIS::OISMouse, true));
     426      if (now - *it > discardThreshold)
     427        ++it;
     428      else
     429        break;
    446430    }
    447     catch (const OIS::Exception &e)
    448     {
    449       throw new Ogre::Exception(42, e.eText, "OrxApplication::setupInputSystem");
    450     }
    451   }
    452 
    453   // FIXME we actually want to do this differently...
    454   void Orxonox::createFrameListener()
    455   {
    456     TickFrameListener* TickFL = new TickFrameListener();
    457     ogre_->getRoot()->addFrameListener(TickFL);
    458 
    459     TimerFrameListener* TimerFL = new TimerFrameListener();
    460     ogre_->getRoot()->addFrameListener(TimerFL);
    461 
    462     //if(mode_!=CLIENT) // FIXME just a hack ------- remove this in future
    463       frameListener_ = new OrxListener(keyboard_, auMan_, mode_);
    464     ogre_->getRoot()->addFrameListener(frameListener_);
    465   }
    466 
    467   void Orxonox::startRenderLoop()
    468   {
    469     // FIXME
    470     // this is a hack!!!
    471     // the call to reset the mouse clipping size should probably be somewhere
    472     // else, however this works for the moment.
    473     unsigned int width, height, depth;
    474     int left, top;
    475     ogre_->getRoot()->getAutoCreatedWindow()->getMetrics(width, height, depth, left, top);
    476 
    477     if(mode_!=CLIENT){
    478       const OIS::MouseState &ms = mouse_->getMouseState();
    479       ms.width = width;
    480       ms.height = height;
    481     }
    482     ogre_->getRoot()->startRendering();
     431
     432    // Remove old times
     433    times.erase(times.begin(), it);
     434
     435    return (float)(times.back() - times.front()) / ((times.size()-1) * 1000);
     436  }
     437
     438  /**
     439    @brief Test method for the InputHandler.
     440    But: Is actually responsible for catching an exit event..
     441  */
     442  void Orxonox::eventOccured(InputEvent &evt)
     443  {
     444    if (evt.id == 1)
     445      this->abortRequest();
    483446  }
    484447}
  • code/trunk/src/orxonox/Orxonox.h

    r871 r1021  
    1111
    1212#include <OgrePrerequisites.h>
    13 #include <OIS/OISPrereqs.h>
     13//#include <OIS/OISPrereqs.h>
    1414
    1515#include "OrxonoxPrereqs.h"
    16 //#include "loader/LoaderPrereqs.h"
    1716#include "audio/AudioPrereqs.h"
    1817
    1918#include "GraphicsEngine.h"
     19#include "InputEventListener.h"
    2020
    2121
     
    2525
    2626  enum gameMode{
    27     STANDALONE,
    2827    SERVER,
    2928    CLIENT,
    30     PRESENTATION
     29    STANDALONE
    3130  };
    3231
    33   class _OrxonoxExport Orxonox
     32  class _OrxonoxExport Orxonox : public InputEventListener
    3433  {
    3534    public:
     
    3736      void start();
    3837      // not sure if this should be private
    39       void die(/* some error code */);
     38      void abortImmediate(/* some error code */);
     39      void abortRequest();
     40      inline Ogre::SceneManager*  getSceneManager()        { return ogre_->getSceneManager(); };
     41      inline GraphicsEngine*      getOgrePointer()         { return ogre_; };
     42      inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
     43      inline BulletManager*       getBulletMgr()           { return this->bulletMgr_; }
     44
    4045      static Orxonox* getSingleton();
    41       inline Ogre::SceneManager* getSceneManager()         { return ogre_->getSceneManager(); };
    42       inline GraphicsEngine* getOgrePointer()              { return ogre_; };
    43       inline audio::AudioManager* getAudioManagerPointer() { return auMan_; };
    44       inline OIS::Keyboard* getKeyboard()                  { return this->keyboard_; }
    45       inline OIS::Mouse* getMouse()                        { return this->mouse_; }
    46       inline BulletManager* getBulletMgr()                 { return this->bulletMgr_; }
     46      static void destroy();
    4747
    48     private:
     48   private:
     49      // don't mess with singletons
    4950      Orxonox();
    50       virtual ~Orxonox();
     51      Orxonox(Orxonox& instance);
     52      Orxonox& operator=(const Orxonox& instance);
     53      ~Orxonox();
     54
    5155      // init functions
    5256      void serverInit(std::string path);
    5357      void clientInit(std::string path);
    5458      void standaloneInit(std::string path);
     59
    5560      // run functions
    56       void playableServer(std::string path);
    57       void standalone();
    58       void defineResources();
    59       void setupRenderSystem();
    60       void createRenderWindow();
    61       void initializeResourceGroups();
    62       void createScene(void);
    63       void setupScene();
     61      void serverStart();
     62      void clientStart();
     63      void standaloneStart();
     64
     65      void createScene();
    6466      void setupInputSystem();
    65       void createFrameListener();
    6667      void startRenderLoop();
     68      float calculateEventTime(unsigned long, std::deque<unsigned long>&);
     69
     70      void eventOccured(InputEvent &evt);
    6771
    6872    private:
    6973      GraphicsEngine*       ogre_;          //!< our dearest graphics engine <3
    7074      std::string           dataPath_;      //!< path to data
    71 //      loader::LevelLoader*  loader_;        //!< level loader builds the scene
    7275      audio::AudioManager*  auMan_;         //!< audio manager
    7376      BulletManager*        bulletMgr_;     //!< Keeps track of the thrown bullets
    74       static Orxonox*       singletonRef_;
    75       OIS::Keyboard*        keyboard_;
    76       OIS::Mouse*           mouse_;
    77       OIS::InputManager*    inputManager_;
    78       OrxListener*          frameListener_;
    79       Ogre::Root*           root_;
     77      InputHandler*         inputHandler_;  //!< Handles input with key bindings
     78      Ogre::Root*           root_;          //!< Holy grail of Ogre
     79      Ogre::Timer*          timer_;         //!< Main loop timer
     80      // TODO: make this a config-value by creating a config class for orxonox
     81      float                 frameSmoothingTime_;
     82      // little hack to actually show something dynamic in the HUD
     83      HUD*                  orxonoxHUD_;
     84      bool                  bAbort_;        //!< aborts the render loop if true
    8085
    8186      // this is used to identify the mode (server/client/...) we're in
    8287      gameMode              mode_;
    8388      std::string           serverIp_;
     89
     90      static Orxonox *singletonRef_s;
    8491  };
    8592}
  • code/trunk/src/orxonox/OrxonoxPlatform.h

    r890 r1021  
    210210//#   pragma warning (disable : 4503)
    211211
    212 // disable: "conversion from 'double' to 'float', possible loss of data
     212// disable: conversion from 'double' to 'float', possible loss of data
     213// disable: conversion from 'ogg_int64_t' to 'long', possible loss of data
     214// This has been dealt with in base_properties of the solution since the
     215// warning primarily occurs in library header files (which are mostly
     216// included before OrxonoxPlatform.h is)
    213217//#   pragma warning (disable : 4244)
    214218
     
    221225// disable: "<type> needs to have dll-interface to be used by clients'
    222226// Happens on STL member variables which are not public therefore is ok
     227// This has been dealt with in base_properties of the solution since the
     228// warning primarily occurs in library header files (which are mostly
     229// included before OrxonoxPlatform.h is)
    223230//#   pragma warning (disable : 4251)
     231
     232// disable: 'MultiTypeString' : multiple assignment operators specified
     233// Used in MultiType and works fine so far
     234#   pragma warning (disable : 4522)
    224235
    225236// disable: "non dll-interface class used as base for dll-interface class"
     
    252263
    253264
    254 // Create a logical xor operator
     265// Define the english written operators like and, or, xor
    255266#if ORXONOX_COMPILER == ORXONOX_COMPILER_MSVC
    256 #  define XOR ^
    257 #elif ORXONOX_COMPILER == ORXONOX_COMPILER_GCC
    258 #  define XOR xor
    259 #else
    260 #  define XOR ^
     267#  include <iso646.h>
    261268#endif
    262269
  • code/trunk/src/orxonox/OrxonoxPrereqs.h

    r790 r1021  
    6868  class Camera;
    6969  class GraphicsEngine;
     70  struct InputEvent;
     71  class InputEventListener;
     72  class InputHandler;
    7073  class Mesh;
    7174  class Model;
  • code/trunk/src/orxonox/OrxonoxStableHeaders.h

    r890 r1021  
    4141
    4242// not including the entire Ogre.h doesn't exceed the default heap size for pch
     43#ifndef WIN32_LEAN_AND_MEAN
     44// prevent Ogre from including winsock.h that messes with winsock2.h from enet
     45#  define WIN32_LEAN_AND_MEAN
     46#endif
    4347//#include <Ogre.h>
    4448#include <OgreBillboardSet.h>
    4549#include <OgreCamera.h>
     50#include <OgreColourValue.h>
    4651#include <OgreConfigFile.h>
    4752#include <OgreEntity.h>
     
    4954#include <OgreFrameListener.h>
    5055#include <OgreLight.h>
     56#include <OgreMath.h>
     57#include <OgreMatrix3.h>
    5158#include <OgreOverlay.h>
    5259#include <OgreOverlayElement.h>
     
    5663#include <OgrePlatform.h>
    5764#include <OgrePrerequisites.h>
     65#include <OgreQuaternion.h>
     66#include <OgreResourceGroupManager.h>
    5867#include <OgreRenderWindow.h>
    5968#include <OgreRoot.h>
     
    6271#include <OgreStringConverter.h>
    6372#include <OgreTextureManager.h>
     73#include <OgreTimer.h>
     74#include <OgreVector2.h>
     75#include <OgreVector3.h>
     76#include <OgreVector3.h>
    6477#include <OgreViewport.h>
     78#include <OgreWindowEventUtilities.h>
    6579
    6680#include <OIS/OIS.h>
     
    6882/**
    6983* Some of the not so stable header files.
    70 * But it's not very useful to include them anyway..
     84* It's not very useful to include them anyway..
    7185**/
    7286
    73 //#include "audio/AudioManager.h"
    74 
    75 //#include "core/CoreIncludes.h"
     87#include "core/CoreIncludes.h"
    7688#include "core/BaseObject.h"
    77 //#include "core/ArgReader.h"
     89#include "core/Tickable.h"
    7890#include "core/Error.h"
     91#include "core/Loader.h"
     92#include "core/XMLPort.h"
    7993
    8094#include "network/Synchronisable.h"
     
    97111#include "util/tinyxml/tinyxml.h"
    98112
    99 //#include "hud/HUD.h"
    100 //#include "loader/LevelLoader.h"
    101 //#include "objects/weapon/AmmunitionDump.h"
    102 //#include "objects/weapon/BarrelGun.h"
    103 //#include "objects/weapon/Bullet.h"
    104 //#include "objects/weapon/BulletManager.h"
    105 //#include "objects/weapon/WeaponStation.h"
    106 //#include "objects/Ambient.h"
    107 //#include "objects/Camera.h"
    108 //#include "objects/Explosion.h"
    109 //#include "objects/Fighter.h"
    110113#include "objects/Model.h"
    111 //#include "objects/NPC.h"
    112 //#include "objects/Projectile.h"
    113 //#include "objects/Skybox.h"
    114 //#include "objects/SpaceShipSteeringObject.h"
    115 #include "objects/Tickable.h"
    116114#include "objects/WorldEntity.h"
    117 //#include "particle/ParticleInterface.h"
    118 //#include "tools/BillboardSet.h"
    119 //#include "tools/Light.h"
    120 //#include "tools/Mesh.h"
    121 //#include "tools/Timer.h"
    122 //#include "GraphicsEngine.h"
    123 //#include "InputManager.h"
    124 //#include "Orxonox.h"
    125 //#include "SpaceshipSteering.h"
    126115
    127116#endif
  • code/trunk/src/orxonox/PrecompiledHeaderFiles.cc

    r790 r1021  
    2727
    2828/**
    29  @file  PrecompiledHeaderFiles.cc
     29 @file
    3030 @brief This file actually generates the precompiled header file
    3131 */
  • code/trunk/src/orxonox/core/BaseObject.cc

    r871 r1021  
    2727
    2828/**
    29     @file BaseObject.cc
     29    @file
    3030    @brief Implementation of the BaseObject class.
    3131*/
  • code/trunk/src/orxonox/core/CMakeLists.txt

    r871 r1021  
    1717  Executor.cc
    1818  XMLPort.cc
     19  Tickable.cc
     20  Script.cc
    1921)
    2022
     
    2426TARGET_LINK_LIBRARIES( core
    2527  util
     28  ${Lua_LIBRARIES}
    2629)
  • code/trunk/src/orxonox/core/ClassTreeMask.cc

    r890 r1021  
    592592        {
    593593            const Identifier* subclass = it->getClass();
    594             newmask.add(subclass, this->isIncluded(subclass) || other.isIncluded(subclass), false, false);
     594            newmask.add(subclass, this->isIncluded(subclass) or other.isIncluded(subclass), false, false);
    595595        }
    596596
     
    599599        {
    600600            const Identifier* subclass = it->getClass();
    601             newmask.add(subclass, this->isIncluded(subclass) || other.isIncluded(subclass), false, false);
     601            newmask.add(subclass, this->isIncluded(subclass) or other.isIncluded(subclass), false, false);
    602602        }
    603603
     
    623623        {
    624624            const Identifier* subclass = it->getClass();
    625             newmask.add(subclass, this->isIncluded(subclass) && other.isIncluded(subclass), false, false);
     625            newmask.add(subclass, this->isIncluded(subclass) and other.isIncluded(subclass), false, false);
    626626        }
    627627
     
    630630        {
    631631            const Identifier* subclass = it->getClass();
    632             newmask.add(subclass, this->isIncluded(subclass) && other.isIncluded(subclass), false, false);
     632            newmask.add(subclass, this->isIncluded(subclass) and other.isIncluded(subclass), false, false);
    633633        }
    634634
     
    737737        {
    738738            const Identifier* subclass = it->getClass();
    739             newmask.add(subclass, this->isIncluded(subclass) XOR other.isIncluded(subclass), false, false);
     739            newmask.add(subclass, this->isIncluded(subclass) xor other.isIncluded(subclass), false, false);
    740740        }
    741741
     
    744744        {
    745745            const Identifier* subclass = it->getClass();
    746             newmask.add(subclass, this->isIncluded(subclass) XOR other.isIncluded(subclass), false, false);
     746            newmask.add(subclass, this->isIncluded(subclass) xor other.isIncluded(subclass), false, false);
    747747        }
    748748
  • code/trunk/src/orxonox/core/DebugLevel.cc

    r871 r1021  
    9595
    9696        // Return a constant value while we're creating the object
    97         return 4;
     97        return 3;
    9898    }
    9999}
  • code/trunk/src/orxonox/core/Loader.cc

    r871 r1021  
    3333#include "Debug.h"
    3434#include "CoreIncludes.h"
     35#include "Script.h"
    3536
    3637#include "util/tinyxml/ticpp.h"
     
    107108        Loader::currentMask_s = level->getMask() * mask;
    108109
     110        // let Lua work this out:
     111        //Script* lua;
     112        /*Script::loadFile(level->getFile(), true);
     113        Script::init(Script::getLuaState());
     114        Script::run();*/
     115        Script* lua = Script::getInstance();
     116        lua->loadFile(level->getFile(), true);
     117        lua->run();
     118
    109119        try
    110120        {
     
    112122            COUT(3) << "Mask: " << Loader::currentMask_s << std::endl;
    113123
    114             ticpp::Document xmlfile(level->getFile());
    115             xmlfile.LoadFile();
     124            //ticpp::Document xmlfile(level->getFile());
     125            //xmlfile.LoadFile();
     126            //ticpp::Element myelement(*Script::getFileString());
     127            ticpp::Document xmlfile;
     128            //xmlfile.ToDocument();
     129            xmlfile.Parse(lua->getLuaOutput(), true);
    116130
    117131            for ( ticpp::Iterator<ticpp::Element> child = xmlfile.FirstChildElement(false); child != child.end(); child++ )
  • code/trunk/src/orxonox/objects/Camera.cc

    r790 r1021  
    66#include <OgreSceneManager.h>
    77#include <OgreSceneNode.h>
    8 #include <OgreRoot.h>
    98#include <OgreRenderWindow.h>
    109#include <OgreViewport.h>
     
    6968
    7069        // FIXME: unused var
    71         Ogre::Viewport* vp = orxonox::Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam);
     70        Ogre::Viewport* vp = orxonox::Orxonox::getSingleton()->getOgrePointer()->getRenderWindow()->addViewport(cam);
    7271
    7372
  • code/trunk/src/orxonox/objects/Fighter.cc

    r790 r1021  
    3737#include "util/tinyxml/tinyxml.h"
    3838#include "util/String2Number.h"
    39 #include "../core/CoreIncludes.h"
    40 #include "../Orxonox.h"
    41 #include "../particle/ParticleInterface.h"
     39#include "core/CoreIncludes.h"
     40#include "Orxonox.h"
     41#include "InputHandler.h"
     42#include "particle/ParticleInterface.h"
    4243#include "weapon/AmmunitionDump.h"
    4344#include "weapon/BarrelGun.h"
     
    207208
    208209            node->attachObject(cam);
    209             Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam);
     210            Orxonox::getSingleton()->getOgrePointer()->getRenderWindow()->addViewport(cam);
    210211        }
    211212    }
     
    254255        if (!this->setMouseEventCallback_)
    255256        {
    256             if (Orxonox::getSingleton()->getMouse())
     257            if (InputHandler::getSingleton()->getMouse())
    257258            {
    258                 Orxonox::getSingleton()->getMouse()->setEventCallback(this);
     259                InputHandler::getSingleton()->getMouse()->setEventCallback(this);
    259260                this->setMouseEventCallback_ = true;
    260261            }
     
    263264        WorldEntity::tick(dt);
    264265
    265         OIS::Keyboard* mKeyboard = Orxonox::getSingleton()->getKeyboard();
    266         OIS::Mouse* mMouse = Orxonox::getSingleton()->getMouse();
     266        OIS::Keyboard* mKeyboard = InputHandler::getSingleton()->getKeyboard();
     267        OIS::Mouse* mMouse = InputHandler::getSingleton()->getMouse();
    267268
    268269        mKeyboard->capture();
  • code/trunk/src/orxonox/objects/Model.cc

    r871 r1021  
    4444    {
    4545        RegisterObject(Model);
     46        registerAllVariables();
    4647    }
    4748
     
    6364    /**
    6465        @brief XML loading and saving.
    65         @param xmlelement The XML-element
     66    @p
     67    aram xmlelement The XML-element
    6668        @param loading Loading (true) or saving (false)
    6769        @return The XML-element
     
    8284
    8385    bool Model::create(){
     86      WorldEntity::create();
    8487      if(meshSrc_.compare("")!=0){
    8588        this->mesh_.setMesh(meshSrc_);
     
    8790        COUT(4) << "Loader: Created model" << std::endl;
    8891      }
    89       registerAllVariables();
    9092      return true;
    9193    }
    9294
    9395    void Model::registerAllVariables(){
    94 //      registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING);
     96      WorldEntity::registerAllVariables();
     97      registerVar(&meshSrc_, meshSrc_.length() + 1, network::STRING);
    9598    }
    9699}
  • code/trunk/src/orxonox/objects/Model.h

    r871 r1021  
    2222            bool create();
    2323
     24        protected:
     25            void registerAllVariables();
     26           
    2427        private:
    2528            std::string meshSrc_;
    2629            Mesh mesh_;
    27             void registerAllVariables();
    2830    };
    2931}
  • code/trunk/src/orxonox/objects/NPC.cc

    r790 r1021  
    8585  void NPC::tick(float dt)
    8686  {
    87 
     87    update();
    8888    this->setVelocity(0.995*this->getVelocity() + this->getAcceleration()*dt);
    8989    this->translate(this->getVelocity()*dt);
  • code/trunk/src/orxonox/objects/SpaceShip.cc

    r978 r1021  
    3939#include "util/String2Number.h"
    4040#include "util/Math.h"
    41 #include "../core/CoreIncludes.h"
    42 #include "../core/Debug.h"
    43 #include "../Orxonox.h"
    44 #include "../particle/ParticleInterface.h"
     41#include "core/CoreIncludes.h"
     42#include "core/Debug.h"
     43#include "Orxonox.h"
     44#include "InputHandler.h"
     45#include "particle/ParticleInterface.h"
    4546#include "Projectile.h"
    4647#include "core/XMLPort.h"
     
    5556    {
    5657        RegisterObject(SpaceShip);
     58        this->registerAllVariables();
    5759
    5860        this->setConfigValues();
     
    124126        this->brakeLoop(loop);
    125127*/
    126         this->init();
    127 
     128//         this->create();
     129
     130       
    128131        COUT(3) << "Info: SpaceShip was loaded" << std::endl;
    129132    }
     
    135138    }
    136139
     140    bool SpaceShip::create(){
     141      if(Model::create())
     142        this->init();
     143      else
     144        return false;
     145      return true;
     146    }
     147   
     148    void SpaceShip::registerAllVariables(){
     149      Model::registerAllVariables();
     150     
     151     
     152     
     153    }
     154   
    137155    void SpaceShip::init()
    138156    {
     
    202220    {
    203221        Model::loadParams(xmlElem);
     222        this->create();
    204223/*
    205224        if (xmlElem->Attribute("forward") && xmlElem->Attribute("rotateupdown") && xmlElem->Attribute("rotaterightleft") && xmlElem->Attribute("looprightleft"))
     
    267286
    268287        this->camNode_->attachObject(cam);
    269         Orxonox::getSingleton()->getOgrePointer()->getRoot()->getAutoCreatedWindow()->addViewport(cam);
     288        Orxonox::getSingleton()->getOgrePointer()->getRenderWindow()->addViewport(cam);
    270289    }
    271290
     
    400419        if (!this->setMouseEventCallback_)
    401420        {
    402             if (Orxonox::getSingleton()->getMouse())
     421            if (InputHandler::getSingleton()->getMouse())
    403422            {
    404                 Orxonox::getSingleton()->getMouse()->setEventCallback(this);
     423                InputHandler::getSingleton()->getMouse()->setEventCallback(this);
    405424                this->setMouseEventCallback_ = true;
    406425            }
     
    427446        }
    428447
    429         OIS::Keyboard* mKeyboard = Orxonox::getSingleton()->getKeyboard();
    430         OIS::Mouse* mMouse = Orxonox::getSingleton()->getMouse();
     448        OIS::Keyboard* mKeyboard = InputHandler::getSingleton()->getKeyboard();
     449        OIS::Mouse* mMouse = InputHandler::getSingleton()->getMouse();
    431450
    432451        mKeyboard->capture();
  • code/trunk/src/orxonox/objects/SpaceShip.h

    r978 r1021  
    2121            SpaceShip();
    2222            ~SpaceShip();
     23            bool create();
     24            void registerAllVariables();
    2325            void init();
    2426            void setConfigValues();
  • code/trunk/src/orxonox/objects/WorldEntity.cc

    r871 r1021  
    4949        RegisterObject(WorldEntity);
    5050
    51         if (Orxonox::getSingleton()->getSceneManager())
    52         {
    53             std::ostringstream name;
    54             name << (WorldEntity::worldEntityCounter_s++);
    55             this->setName("WorldEntity" + name.str());
    56             this->node_ = Orxonox::getSingleton()->getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName());
    57         }
    58         else
    59         {
    60             this->node_ = 0;
    61         }
     51        //create();
    6252
    6353        this->bStatic_ = true;
     
    6757        this->rotationRate_ = 0;
    6858        this->momentum_ = 0;
     59       
     60        if (Orxonox::getSingleton()->getSceneManager())
     61        {
     62          std::ostringstream name;
     63          name << (WorldEntity::worldEntityCounter_s++);
     64          this->setName("WorldEntity" + name.str());
     65          this->node_ = Orxonox::getSingleton()->getSceneManager()->getRootSceneNode()->createChildSceneNode(this->getName());
     66       
     67          registerAllVariables();
     68        }
     69        else
     70        {
     71          this->node_ = 0;
     72        }
    6973    }
    7074
     
    8993
    9094        BaseObject::loadParams(xmlElem);
     95        create();
    9196/*
    9297        if (xmlElem->Attribute("position"))
     
    185190    }
    186191
    187     bool WorldEntity::create(){
    188       registerAllVariables();
    189       return true;
    190     }
    191192
    192193    void WorldEntity::registerAllVariables()
    193194    {
    194 /*      // register coordinates
     195      // register coordinates
    195196      registerVar( (void*) &(this->getPosition().x), sizeof(this->getPosition().x), network::DATA);
    196197      registerVar( (void*) &(this->getPosition().y), sizeof(this->getPosition().y), network::DATA);
     
    200201      registerVar( (void*) &(this->getOrientation().x), sizeof(this->getOrientation().x), network::DATA);
    201202      registerVar( (void*) &(this->getOrientation().y), sizeof(this->getOrientation().y), network::DATA);
    202       registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA);*/
     203      registerVar( (void*) &(this->getOrientation().z), sizeof(this->getOrientation().z), network::DATA);
    203204      // not needed at the moment, because we don't have prediction yet
    204       /*// register velocity_
     205      // register velocity_
    205206      registerVar( (void*) &(this->getVelocity().x), sizeof(this->getVelocity().x), network::DATA);
    206207      registerVar( (void*) &(this->getVelocity().y), sizeof(this->getVelocity().y), network::DATA);
     
    210211      registerVar( (void*) &(this->getRotationAxis().x), sizeof(this->getRotationAxis().x), network::DATA);
    211212      registerVar( (void*) &(this->getRotationAxis().y), sizeof(this->getRotationAxis().y), network::DATA);
    212       registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA);*/
     213      registerVar( (void*) &(this->getRotationAxis().z), sizeof(this->getRotationAxis().z), network::DATA);
    213214    }
    214215
  • code/trunk/src/orxonox/objects/WorldEntity.h

    r871 r1021  
    1212//#include "util/tinyxml/tinyxml.h"
    1313#include "core/BaseObject.h"
    14 #include "Tickable.h"
     14#include "core/Tickable.h"
    1515#include "../tools/Mesh.h"
    1616
    1717namespace orxonox
    1818{
    19     class _OrxonoxExport WorldEntity : public BaseObject, public Tickable//, public network::Synchronisable
     19    class _OrxonoxExport WorldEntity : public BaseObject, public Tickable, public network::Synchronisable
    2020    {
    2121        public:
     
    2626            virtual void loadParams(TiXmlElement* xmlElem);
    2727            virtual void XMLPort(Element& xmlelement, bool loading);
    28             bool create();
     28            inline bool create(){ return true; }
    2929
    3030            void attachWorldEntity(WorldEntity* entity);
  • code/trunk/src/orxonox/objects/weapon/AmmunitionDump.cc

    r871 r1021  
    4545  {
    4646    RegisterObject(AmmunitionDump);
     47    registerAllVariables();
    4748
    4849    for (int i = 0; i < numberOfAmmos_; i++)
     
    114115    return stock_[id];
    115116  }
     117 
     118  void AmmunitionDump::registerAllVariables(){
     119    registerVar( &numberOfAmmos_, sizeof(int), network::DATA);
     120   
     121    for (int i = 0; i < numberOfAmmos_; i++)
     122    {
     123      registerVar(&stock_[i], sizeof(int), network::DATA);
     124      registerVar(&capacity_[i], sizeof(int), network::DATA);
     125    }
     126  }
    116127}
  • code/trunk/src/orxonox/objects/weapon/AmmunitionDump.h

    r871 r1021  
    6060  protected:
    6161    inline bool create() { return true; }
     62    void registerAllVariables();
    6263
    6364    int numberOfAmmos_;
  • code/trunk/src/orxonox/objects/weapon/BulletManager.cc

    r871 r1021  
    3939  {
    4040    RegisterObject(BulletManager);
     41    registerAllVariables();
    4142    bullets_ = new Bullet*[bulletsSize_];
    4243  }
     
    103104  }
    104105
     106  void BulletManager::registerAllVariables(){
     107    registerVar(&bulletsSize_, sizeof(int), network::DATA);
     108    registerVar(&bulletsIndex_, sizeof(int), network::DATA);
     109    // TODO we got a problem here:
     110    // there is no possibility (so far) to synchronise pointers to objects
     111  }
     112 
    105113}
  • code/trunk/src/orxonox/objects/weapon/BulletManager.h

    r871 r1021  
    3939#include "util/tinyxml/tinyxml.h"
    4040#include "core/BaseObject.h"
    41 #include "../Tickable.h"
     41#include "core/Tickable.h"
    4242
    4343namespace orxonox {
     
    6060  protected:
    6161    inline bool create() { return true; }
     62    void registerAllVariables();
    6263
    6364    // Bullet array
  • code/trunk/src/orxonox/particle/ParticleInterface.cc

    r910 r1021  
    6969  {
    7070    //Abgleichen der anderen Emitter an die Variabeln
    71     for (int i=0; i < numberOfEmitters_; i++) {
     71    for (int i=1; i < numberOfEmitters_; i++) {
    7272      particleSystem_->getEmitter(i)->setColour( colour_ );
    7373      particleSystem_->getEmitter(i)->setTimeToLive( distance_ );
     
    8484  }
    8585
    86   void ParticleInterface::setRate(float r)
     86  void ParticleInterface::setRate(int r)
    8787  {
    8888    rate_ = r;
     
    127127  Vector3 ParticleInterface::getPositionOfEmitter ( int emitterNr )
    128128  {
    129     return particleSystem_->getEmitter(emitterNr)->getPosition();
     129    return particleSystem_->getEmitter(0)->getPosition();
    130130  }
    131131
  • code/trunk/src/orxonox/particle/ParticleInterface.h

    r910 r1021  
    4848    void setVelocity( Real v );
    4949
    50     inline float getRate()
     50    inline int getRate()
    5151      { return rate_; };
    52     void setRate( float r );
     52    void setRate( int r );
    5353
    5454    inline Real getDistance()
     
    7171    Real distance_;
    7272    Real velocity_;
    73     float rate_;
     73    int rate_;
    7474    ColourValue colour_;
    7575    int numberOfEmitters_;
  • code/trunk/src/orxonox/tools/Timer.cc

    r890 r1021  
    4646        this->time_ = 0;
    4747    }
     48
     49    /**
     50        @brief Updates the timer before the frames are rendered.
     51    */
     52    void TimerBase::tick(float dt)
     53    {
     54        if (this->bActive_)
     55        {
     56            // If active: Decrease the timer by the duration of the last frame
     57            this->time_ -= dt;
     58
     59            if (this->time_ <= 0)
     60            {
     61                // It's time to call the function
     62                if (this->bLoop_)
     63                    // Q: Why '+=' and not '='? A: Think about it. It's more accurate like that. Seriously.
     64                    this->time_ += this->interval_;
     65                else
     66                    this->stopTimer(); // Stop the timer if we don't want to loop
     67
     68                this->run();
     69            }
     70        }
     71    }
     72
    4873}
  • code/trunk/src/orxonox/tools/Timer.h

    r871 r1021  
    5858#define _Timer_H__
    5959
    60 #include <OgreFrameListener.h>
    6160#include "../OrxonoxPrereqs.h"
     61#include "core/Tickable.h"
    6262
    6363namespace orxonox
    6464{
    6565    //! TimerBase is the parent of the Timer class.
    66     class _OrxonoxExport TimerBase : public OrxonoxClass
     66    class _OrxonoxExport TimerBase : public Tickable
    6767    {
    68         friend class TimerFrameListener;
    69 
    7068        public:
    7169            TimerBase();
     
    8381            /** @brief Returns true if the Timer is active (= not stoped, not paused). @return True = Time is active */
    8482            inline bool isActive() const { return this->bActive_; }
     83
     84            void tick(float dt);
    8585
    8686        protected:
     
    145145    };
    146146
    147     //! The TimerFrameListener manages all Timers in the game.
    148     class TimerFrameListener : public Ogre::FrameListener
    149     {
    150         private:
    151             /** @brief Gets called before a frame gets rendered. */
    152             bool frameStarted(const Ogre::FrameEvent &evt)
    153             {
    154                 // Iterate through all Timers
    155                 for (Iterator<TimerBase> it = ObjectList<TimerBase>::start(); it; )
    156                 {
    157                     if (it->isActive())
    158                     {
    159                         // If active: Decrease the timer by the duration of the last frame
    160                         it->time_ -= evt.timeSinceLastFrame;
    161 
    162                         if (it->time_ <= 0)
    163                         {
    164                             // It's time to call the function
    165                             if (it->bLoop_)
    166                                 it->time_ += it->interval_; // Q: Why '+=' and not '='? A: Think about it. It's more accurate like that. Seriously.
    167                             else
    168                                 it->stopTimer(); // Stop the timer if we don't want to loop
    169 
    170                             (it++)->run();
    171                         }
    172                         else
    173                             ++it;
    174                     }
    175                     else
    176                         ++it;
    177                 }
    178 
    179                 return FrameListener::frameStarted(evt);
    180             }
    181     };
    182147}
    183148
  • code/trunk/src/util/CMakeLists.txt

    r871 r1021  
    22
    33AUX_SOURCE_DIRECTORY(tinyxml TINYXML_SRC_FILES)
     4AUX_SOURCE_DIRECTORY(tolua TOLUA_SRC_FILES)
    45
    56SET (UTIL_SRC_FILES
     
    1112  MultiTypeMath.cc
    1213  ${TINYXML_SRC_FILES}
     14  ${TOLUA_SRC_FILES}
    1315)
    1416
  • code/trunk/src/util/Sleep.h

    r790 r1021  
    1 // hack for the usleep/Sleep problem
    2 #if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
     1/*
     2 *   ORXONOX - the hottest 3D action shooter ever to exist
     3 *
     4 *
     5 *   License notice:
     6 *
     7 *   This program is free software; you can redistribute it and/or
     8 *   modify it under the terms of the GNU General Public License
     9 *   as published by the Free Software Foundation; either version 2
     10 *   of the License, or (at your option) any later version.
     11 *
     12 *   This program is distributed in the hope that it will be useful,
     13 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 *   GNU General Public License for more details.
     16 *
     17 *   You should have received a copy of the GNU General Public License
     18 *   along with this program; if not, write to the Free Software
     19 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
     20 *
     21 *   Author:
     22 *      Reto Grieder
     23 *   Co-authors:
     24 *      ...
     25 *
     26 */
     27
     28/**
     29 @file  Sleep.h
     30 @brief Macros for using sleep() and usleep() under windows
     31 */
     32
     33#include "OrxonoxPlatform.h"
     34
     35#if ORXONOX_PLATFORM == ORXONOX_PLATFORM_WIN32
    336#  include <windows.h>
    4 #  define usleep(x) Sleep((x)/1000)
     37#  define usleep(x) Sleep((x) / 1000)
     38#  define msleep(x) Sleep(x)
     39#  define  sleep(x) Sleep((x) * 1000)
    540#else
    641#  include <unistd.h>
     42#  define msleep(x) uleep((x) * 1000)
    743#endif
  • code/trunk/visual_studio/base_properties.vsprops

    r890 r1021  
    1111                PreprocessorDefinitions="WIN32;__WIN32__;_WIN32;BOOST_ALL_DYN_LINK"
    1212                WarningLevel="3"
    13                 DisableSpecificWarnings="4267; 4244; 4251;4522"
     13                DisableSpecificWarnings="4244;4251"
    1414        />
    1515        <Tool
     
    3333        <UserMacro
    3434                Name="DependencyDir"
    35                 Value="$(RootDir)dependencies\"
     35                Value="D:\orxonox\dependencies\orxonox\"
    3636        />
    3737        <UserMacro
  • code/trunk/visual_studio/network_properties.vsprops

    r790 r1021  
    88        <Tool
    99                Name="VCCLCompilerTool"
    10                 PreprocessorDefinitions="NETWORK_SHARED_BUILD; WIN32_LEAN_AND_MEAN; ZLIB_WINAPI "
     10                PreprocessorDefinitions="NETWORK_SHARED_BUILD; ZLIB_WINAPI;WIN32_LEAN_AND_MEAN"
    1111        />
    1212        <Tool
  • code/trunk/visual_studio/orxonox_vc8.sln

    r890 r1021  
    1919                {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC}
    2020                {F101C2F0-1CB9-4A57-827B-6C399A99B28F} = {F101C2F0-1CB9-4A57-827B-6C399A99B28F}
    21         EndProjectSection
    22 EndProject
    23 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "loader", "vc8\loader.vcproj", "{E283910F-F911-40FB-A09D-D025CA821912}"
    24         ProjectSection(WebsiteProperties) = preProject
    25                 Debug.AspNetCompiler.Debug = "True"
    26                 Release.AspNetCompiler.Debug = "False"
    27         EndProjectSection
    28         ProjectSection(ProjectDependencies) = postProject
    29                 {2240ECD7-2F48-4431-8E1B-25466A384CCC} = {2240ECD7-2F48-4431-8E1B-25466A384CCC}
    3021        EndProjectSection
    3122EndProject
     
    8980                {271715F3-5B90-4110-A552-70C788084A86}.Release|Win32.ActiveCfg = Release|Win32
    9081                {271715F3-5B90-4110-A552-70C788084A86}.Release|Win32.Build.0 = Release|Win32
    91                 {E283910F-F911-40FB-A09D-D025CA821912}.Debug|Win32.ActiveCfg = Debug|Win32
    92                 {E283910F-F911-40FB-A09D-D025CA821912}.Release_SSE|Win32.ActiveCfg = Release_SSE|Win32
    93                 {E283910F-F911-40FB-A09D-D025CA821912}.Release_SSE2|Win32.ActiveCfg = Release_SSE2|Win32
    94                 {E283910F-F911-40FB-A09D-D025CA821912}.Release|Win32.ActiveCfg = Release|Win32
    9582                {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Debug|Win32.ActiveCfg = Debug|Win32
    9683                {35575B59-E1AE-40E8-89C4-2862B5B09B68}.Debug|Win32.Build.0 = Debug|Win32
  • code/trunk/visual_studio/vc8/core.vcproj

    r890 r1021  
    337337                        </File>
    338338                        <File
     339                                RelativePath="..\..\src\orxonox\core\Tickable.cc"
     340                                >
     341                        </File>
     342                        <File
    339343                                RelativePath="..\..\src\orxonox\core\XMLPort.cc"
    340344                                >
     
    447451                        </File>
    448452                        <File
     453                                RelativePath="..\..\src\orxonox\core\Tickable.h"
     454                                >
     455                        </File>
     456                        <File
    449457                                RelativePath="..\..\src\orxonox\core\XMLPort.h"
    450458                                >
  • code/trunk/visual_studio/vc8/orxonox.vcproj

    r890 r1021  
    285285                        </File>
    286286                        <File
     287                                RelativePath="..\..\src\orxonox\InputEventListener.cc"
     288                                >
     289                        </File>
     290                        <File
     291                                RelativePath="..\..\src\orxonox\InputHandler.cc"
     292                                >
     293                        </File>
     294                        <File
    287295                                RelativePath="..\..\src\orxonox\InputManager.cc"
    288296                                >
     297                                <FileConfiguration
     298                                        Name="Debug|Win32"
     299                                        ExcludedFromBuild="true"
     300                                        >
     301                                        <Tool
     302                                                Name="VCCLCompilerTool"
     303                                        />
     304                                </FileConfiguration>
    289305                        </File>
    290306                        <File
     
    572588                                </File>
    573589                                <File
    574                                         RelativePath="..\..\src\orxonox\objects\Tickable.cc"
    575                                         >
    576                                 </File>
    577                                 <File
    578590                                        RelativePath="..\..\src\orxonox\objects\WorldEntity.cc"
    579591                                        >
     
    633645                                <File
    634646                                        RelativePath="..\..\src\orxonox\tools\Timer.cc"
    635                                         >
    636                                 </File>
    637                         </Filter>
    638                         <Filter
    639                                 Name="loader"
    640                                 >
    641                                 <File
    642                                         RelativePath="..\..\src\loader\LevelLoader.cc"
    643647                                        >
    644648                                </File>
     
    655659                        </File>
    656660                        <File
     661                                RelativePath="..\..\src\orxonox\InputEvent.h"
     662                                >
     663                        </File>
     664                        <File
     665                                RelativePath="..\..\src\orxonox\InputEventListener.h"
     666                                >
     667                        </File>
     668                        <File
     669                                RelativePath="..\..\src\orxonox\InputHandler.h"
     670                                >
     671                        </File>
     672                        <File
    657673                                RelativePath="..\..\src\orxonox\InputManager.h"
    658674                                >
     
    743759                                <File
    744760                                        RelativePath="..\..\src\orxonox\objects\test3.h"
    745                                         >
    746                                 </File>
    747                                 <File
    748                                         RelativePath="..\..\src\orxonox\objects\Tickable.h"
    749761                                        >
    750762                                </File>
     
    807819                                <File
    808820                                        RelativePath="..\..\src\orxonox\tools\Timer.h"
    809                                         >
    810                                 </File>
    811                         </Filter>
    812                         <Filter
    813                                 Name="loader"
    814                                 >
    815                                 <File
    816                                         RelativePath="..\..\src\loader\LevelLoader.h"
    817                                         >
    818                                 </File>
    819                                 <File
    820                                         RelativePath="..\..\src\loader\LoaderPrereqs.h"
    821821                                        >
    822822                                </File>
Note: See TracChangeset for help on using the changeset viewer.