GL - moving character

This commit is contained in:
lindaandersson 2014-02-12 11:35:34 +01:00
commit c1757eef21
31 changed files with 1523 additions and 764 deletions

View File

@ -1,212 +1,197 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="12.2">
<zoom_level>11</zoom_level>
<zoom_level>7</zoom_level>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>847</x>
<y>363</y>
<w>132</w>
<h>33</h>
<x>728</x>
<y>413</y>
<w>91</w>
<h>21</h>
</coordinates>
<panel_attributes>Graphics</panel_attributes>
<panel_attributes>Graphics &lt;&lt;module&gt;&gt;
bg=orange</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>561</x>
<y>363</y>
<w>132</w>
<h>33</h>
<x>546</x>
<y>413</y>
<w>84</w>
<h>21</h>
</coordinates>
<panel_attributes>Sound</panel_attributes>
<panel_attributes>Sound&lt;&lt;?&gt;&gt;</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>671</x>
<y>209</y>
<w>132</w>
<h>33</h>
<x>616</x>
<y>322</y>
<w>84</w>
<h>21</h>
</coordinates>
<panel_attributes>Physics</panel_attributes>
<panel_attributes>Physics &lt;&lt;module&gt;&gt;
bg=orange</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>858</x>
<y>132</y>
<w>121</w>
<h>33</h>
<x>735</x>
<y>238</y>
<w>77</w>
<h>21</h>
</coordinates>
<panel_attributes>Game client</panel_attributes>
<panel_attributes>Game client &lt;&lt;dll&gt;&gt;
bg=red</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>484</x>
<y>209</y>
<w>154</w>
<h>33</h>
<x>616</x>
<y>287</y>
<w>98</w>
<h>21</h>
</coordinates>
<panel_attributes>Gamelogic</panel_attributes>
<panel_attributes>Gamelogic &lt;&lt;dll&gt;&gt;
bg=red</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>506</x>
<y>132</y>
<w>121</w>
<h>33</h>
<x>504</x>
<y>238</y>
<w>84</w>
<h>21</h>
</coordinates>
<panel_attributes>Game server</panel_attributes>
<panel_attributes>Game server &lt;&lt;dll&gt;&gt;
bg=red</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>671</x>
<y>132</y>
<w>132</w>
<h>33</h>
<x>616</x>
<y>238</y>
<w>84</w>
<h>21</h>
</coordinates>
<panel_attributes>Network</panel_attributes>
<panel_attributes>Network &lt;&lt;module&gt;&gt;
bg=orange</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>704</x>
<y>363</y>
<w>132</w>
<h>33</h>
<x>637</x>
<y>413</y>
<w>84</w>
<h>21</h>
</coordinates>
<panel_attributes>Input</panel_attributes>
<panel_attributes>Input&lt;&lt;lib&gt;&gt;
bg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>495</x>
<y>55</y>
<w>176</w>
<h>44</h>
<x>714</x>
<y>182</y>
<w>98</w>
<h>28</h>
</coordinates>
<panel_attributes>DanBiasClientLauncher
<panel_attributes>GameLauncher &lt;&lt;exe&gt;&gt;
bg=green</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>880</x>
<y>132</y>
<w>54</w>
<h>252</h>
<x>749</x>
<y>238</y>
<w>34</w>
<h>188</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>33;231;33;209;33;33</additional_attributes>
<additional_attributes>21;175;21;161;21;21</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>583</x>
<y>132</y>
<w>351</w>
<h>252</h>
<x>560</x>
<y>238</y>
<w>223</w>
<h>188</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>33;231;33;209;330;209;330;33</additional_attributes>
<additional_attributes>21;175;21;161;210;161;210;21</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>528</x>
<y>132</y>
<w>54</w>
<h>98</h>
<x>525</x>
<y>238</y>
<w>146</w>
<h>62</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>33;77;33;33</additional_attributes>
<additional_attributes>133;49;133;35;21;35;21;21</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>594</x>
<y>110</y>
<w>98</w>
<h>54</h>
<x>567</x>
<y>224</y>
<w>62</w>
<h>34</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>77;33;33;33</additional_attributes>
<additional_attributes>49;21;21;21</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>605</x>
<y>187</y>
<w>87</w>
<h>54</h>
<x>637</x>
<y>287</y>
<w>34</w>
<h>48</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>66;33;33;33</additional_attributes>
<additional_attributes>21;35;21;21</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>737</x>
<y>132</y>
<w>197</w>
<h>252</h>
<x>658</x>
<y>238</y>
<w>125</w>
<h>188</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>33;231;33;209;176;209;176;33</additional_attributes>
<additional_attributes>21;175;21;161;112;161;112;21</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>770</x>
<y>110</y>
<w>109</w>
<h>54</h>
<x>679</x>
<y>224</y>
<w>69</w>
<h>34</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>33;33;88;33</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>880</x>
<y>66</y>
<w>54</w>
<h>87</h>
</coordinates>
<panel_attributes>lt=&gt;-</panel_attributes>
<additional_attributes>33;33;33;66</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>528</x>
<y>66</y>
<w>54</w>
<h>87</h>
</coordinates>
<panel_attributes>lt=&gt;-</panel_attributes>
<additional_attributes>33;33;33;66</additional_attributes>
<additional_attributes>21;21;56;21</additional_attributes>
</element>
<element>
<type>com.umlet.element.Package</type>
<coordinates>
<x>440</x>
<y>22</y>
<w>550</w>
<h>396</h>
<x>455</x>
<y>161</y>
<w>371</w>
<h>287</h>
</coordinates>
<panel_attributes>GameEngine</panel_attributes>
<additional_attributes/>
@ -214,21 +199,21 @@ bg=green</panel_attributes>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>880</x>
<y>363</y>
<w>54</w>
<h>164</h>
<x>749</x>
<y>413</y>
<w>34</w>
<h>104</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.</panel_attributes>
<additional_attributes>33;33;33;143</additional_attributes>
<additional_attributes>21;21;21;91</additional_attributes>
</element>
<element>
<type>com.umlet.element.Package</type>
<coordinates>
<x>891</x>
<y>506</y>
<w>319</w>
<h>220</h>
<x>756</x>
<y>504</y>
<w>203</w>
<h>140</h>
</coordinates>
<panel_attributes>Graphics</panel_attributes>
<additional_attributes/>
@ -236,10 +221,10 @@ bg=green</panel_attributes>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>902</x>
<y>539</y>
<w>297</w>
<h>176</h>
<x>763</x>
<y>525</y>
<w>189</w>
<h>112</h>
</coordinates>
<panel_attributes>&lt;&lt;interface&gt;&gt;
OysterGfx
@ -256,10 +241,10 @@ Release(resource :Model*) :void</panel_attributes>
<element>
<type>com.umlet.element.Package</type>
<coordinates>
<x>561</x>
<y>506</y>
<w>308</w>
<h>242</h>
<x>546</x>
<y>504</y>
<w>196</w>
<h>154</h>
</coordinates>
<panel_attributes>Input</panel_attributes>
<additional_attributes/>
@ -267,21 +252,21 @@ Release(resource :Model*) :void</panel_attributes>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>649</x>
<y>363</y>
<w>142</w>
<h>175</h>
<x>602</x>
<y>413</y>
<w>90</w>
<h>111</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.</panel_attributes>
<additional_attributes>121;33;121;154;33;154</additional_attributes>
<additional_attributes>77;21;77;98;21;98</additional_attributes>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>572</x>
<y>539</y>
<w>286</w>
<h>198</h>
<x>553</x>
<y>525</y>
<w>182</w>
<h>126</h>
</coordinates>
<panel_attributes>&lt;&lt;interface&gt;&gt;
RawInput
@ -299,32 +284,33 @@ Enable(Enable :bool) :void</panel_attributes>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>451</x>
<y>363</y>
<w>99</w>
<h>33</h>
<x>462</x>
<y>413</y>
<w>77</w>
<h>21</h>
</coordinates>
<panel_attributes>Window API</panel_attributes>
<panel_attributes>Window API&lt;&lt;lib&gt;&gt;
bg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>462</x>
<y>132</y>
<w>472</w>
<h>252</h>
<x>483</x>
<y>238</y>
<w>300</w>
<h>188</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>33;231;33;209;451;209;451;33</additional_attributes>
<additional_attributes>21;175;21;161;287;161;287;21</additional_attributes>
</element>
<element>
<type>com.umlet.element.Package</type>
<coordinates>
<x>176</x>
<y>506</y>
<w>374</w>
<h>242</h>
<x>301</x>
<y>504</y>
<w>238</w>
<h>154</h>
</coordinates>
<panel_attributes>Sound</panel_attributes>
<additional_attributes/>
@ -332,10 +318,10 @@ Enable(Enable :bool) :void</panel_attributes>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>187</x>
<y>539</y>
<w>352</w>
<h>121</h>
<x>308</x>
<y>525</y>
<w>224</w>
<h>77</h>
</coordinates>
<panel_attributes>&lt;&lt;interface&gt;&gt;
SoundWrapper
@ -349,10 +335,10 @@ Release(Resource :ResourceHandle*) :void</panel_attributes>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>187</x>
<y>693</y>
<w>352</w>
<h>44</h>
<x>308</x>
<y>623</y>
<w>224</w>
<h>28</h>
</coordinates>
<panel_attributes>&lt;&lt;API&gt;&gt;
--
@ -362,79 +348,152 @@ FMOD</panel_attributes>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>330</x>
<y>627</y>
<w>54</w>
<h>87</h>
<x>399</x>
<y>581</y>
<w>34</w>
<h>55</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.</panel_attributes>
<additional_attributes>33;66;33;33</additional_attributes>
<additional_attributes>21;42;21;21</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>286</x>
<y>363</y>
<w>362</w>
<h>175</h>
<x>371</x>
<y>413</y>
<w>230</w>
<h>111</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.</panel_attributes>
<additional_attributes>341;33;341;88;253;88;253;154;33;154</additional_attributes>
<additional_attributes>217;21;217;56;161;56;161;98;21;98</additional_attributes>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>781</x>
<y>55</y>
<w>198</w>
<h>44</h>
<x>476</x>
<y>329</y>
<w>84</w>
<h>28</h>
</coordinates>
<panel_attributes>DanBiasServerLauncher
<panel_attributes>Math &lt;&lt;lib&gt;&gt;
--
/Is used globaly/
bg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>539</x>
<y>238</y>
<w>237</w>
<h>125</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>21;112;224;112;224;21</additional_attributes>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>476</x>
<y>294</y>
<w>77</w>
<h>28</h>
</coordinates>
<panel_attributes>Misc &lt;&lt;lib&gt;&gt;
--
/Is used globaly/
bg=blue</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>539</x>
<y>273</y>
<w>90</w>
<h>76</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>21;63;56;63;56;21;77;21</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>105</x>
<y>168</y>
<w>245</w>
<h>140</h>
</coordinates>
<panel_attributes>/*HISTORY*/
--
10/2-2014
Renamed DanBiasClientLauncher -&gt; GameLauncher
Removed DanBiasServerLauncher - connected to GameClient
Added missing cconnections
Specified what type of box and added a colour
--
elementstyle=wordwrap
bg=gray
</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>749</x>
<y>189</y>
<w>34</w>
<h>62</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>21;49;21;21</additional_attributes>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>504</x>
<y>189</y>
<w>91</w>
<h>28</h>
</coordinates>
<panel_attributes>ServerUI &lt;&lt;exe&gt;&gt;
--
/template for future/
bg=green</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Class</type>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>671</x>
<y>253</y>
<w>132</w>
<h>33</h>
<x>525</x>
<y>196</y>
<w>34</w>
<h>55</h>
</coordinates>
<panel_attributes>Math</panel_attributes>
<additional_attributes/>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>21;42;21;21</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>770</x>
<y>132</y>
<w>153</w>
<h>164</h>
<x>539</x>
<y>308</y>
<w>90</w>
<h>48</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>33;143;132;143;132;33</additional_attributes>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>682</x>
<y>297</y>
<w>99</w>
<h>33</h>
</coordinates>
<panel_attributes>Misc</panel_attributes>
<additional_attributes/>
<additional_attributes>21;35;63;35;63;21;77;21</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>605</x>
<y>198</y>
<w>87</w>
<h>98</h>
<x>532</x>
<y>273</y>
<w>97</w>
<h>41</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>66;77;44;77;44;33;33;33</additional_attributes>
<additional_attributes>21;28;56;28;56;21;84;21</additional_attributes>
</element>
</diagram>

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="12.1">
<zoom_level>10</zoom_level>
<diagram program="umlet" version="12.2">
<zoom_level>8</zoom_level>
<element>
<id>UMLClass</id>
<coordinates>
<x>610</x>
<y>340</y>
<w>100</w>
<h>30</h>
<x>632</x>
<y>344</y>
<w>104</w>
<h>24</h>
</coordinates>
<panel_attributes>GameLobby
</panel_attributes>
@ -16,137 +16,100 @@
<element>
<id>UMLClass</id>
<coordinates>
<x>580</x>
<y>480</y>
<w>160</w>
<h>80</h>
<x>624</x>
<y>416</y>
<w>128</w>
<h>48</h>
</coordinates>
<panel_attributes>GameSession
--
/One instance of a game/
/including x number of/
/players./</panel_attributes>
/including n players./</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>620</x>
<y>340</y>
<w>60</w>
<h>160</h>
<x>664</x>
<y>344</y>
<w>40</w>
<h>88</h>
</coordinates>
<panel_attributes>lt=-&gt;&gt;&gt;&gt;</panel_attributes>
<additional_attributes>30;140;40;30</additional_attributes>
<additional_attributes>24;72;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>710</x>
<y>480</y>
<w>100</w>
<h>50</h>
<x>664</x>
<y>440</y>
<w>40</w>
<h>104</h>
</coordinates>
<panel_attributes>lt=&gt;&gt;&gt;&gt;-</panel_attributes>
<additional_attributes>80;30;30;30</additional_attributes>
<additional_attributes>24;88;24;24</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>600</x>
<y>180</y>
<w>120</w>
<h>120</h>
<x>40</x>
<y>120</y>
<w>368</w>
<h>344</h>
</coordinates>
<panel_attributes>GameServer</panel_attributes>
<panel_attributes>GameServerAPI &lt;&lt;singleton&gt;&gt;
--
{innerclass
+ServerInitDesc&lt;&lt;struct&gt;&gt;
--
serverName :char pointer
listenPort :int
bool broadcast :bool
ServerInitDesc() :void
innerclass}
{innerclass
+GameServerInfo&lt;&lt;struct&gt;&gt;
--
listenPort :unsigned int
serverIp :const char pointer
innerclass}
+static DanBiasServerReturn ServerInitiate(const ServerInitDesc&amp; desc);
+static ServerStart() :void
+static ServerStop() :void
+static ServerUpdate() :void
+static ServerGetInfo() :GameServerInfo
+static ServerIsRunning() :bool
+static GameSetMapId( val :const int&amp; ) :void
+static GameSetMaxClients( val :const int&amp; ) :void
+static GameSetGameMode(val :const int&amp;) :void
+static GameSetGameTime(val :const int&amp;) :void
+static GameGetMapId() :int
+static GameGetMaxClients() :int
+static GameGetGameMode() :int
+static GameGetGameTime() :int
+static GameGetGameName() :const char pointer
+static GameStart() :bool</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>630</x>
<y>270</y>
<w>50</w>
<h>90</h>
</coordinates>
<panel_attributes>lt=&gt;&gt;&gt;&gt;-</panel_attributes>
<additional_attributes>30;70;30;30</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>590</x>
<y>100</y>
<w>130</w>
<x>384</x>
<y>328</y>
<w>264</w>
<h>40</h>
</coordinates>
<panel_attributes>&lt;&lt;wrapper&gt;&gt;
DanBiasServerAPI</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>630</x>
<y>110</y>
<w>50</w>
<h>90</h>
</coordinates>
<panel_attributes>lt=&gt;&gt;&gt;&gt;-
</panel_attributes>
<additional_attributes>30;70;30;30</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>1060</x>
<y>330</y>
<w>120</w>
<h>50</h>
</coordinates>
<panel_attributes>NetworkSession</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>690</x>
<y>220</y>
<w>390</w>
<h>50</h>
</coordinates>
<panel_attributes>lt=-&lt;&lt;&lt;&lt;</panel_attributes>
<additional_attributes>30;30;370;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>680</x>
<y>320</y>
<w>400</w>
<h>50</h>
</coordinates>
<panel_attributes>lt=-&gt;&gt;&gt;&gt;&gt;</panel_attributes>
<additional_attributes>30;30;380;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>690</x>
<y>340</y>
<w>390</w>
<h>160</h>
</coordinates>
<panel_attributes>lt=-&gt;&gt;&gt;&gt;&gt;</panel_attributes>
<additional_attributes>30;140;40;40;370;30</additional_attributes>
<panel_attributes>lt=&gt;&gt;&gt;&gt;-</panel_attributes>
<additional_attributes>248;24;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Package</type>
<coordinates>
<x>460</x>
<y>640</y>
<w>120</w>
<h>50</h>
<x>440</x>
<y>424</y>
<w>96</w>
<h>40</h>
</coordinates>
<panel_attributes>GameLogicAPI
bg=blue</panel_attributes>
@ -155,21 +118,21 @@ bg=blue</panel_attributes>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>370</x>
<y>530</y>
<w>350</w>
<h>290</h>
<x>512</x>
<y>424</y>
<w>128</w>
<h>40</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.</panel_attributes>
<additional_attributes>90;150;30;270;330;240;240;30</additional_attributes>
<additional_attributes>24;24;112;24</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>790</x>
<y>500</y>
<w>100</w>
<h>30</h>
<x>624</x>
<y>528</y>
<w>144</w>
<h>24</h>
</coordinates>
<panel_attributes>GameClient</panel_attributes>
<additional_attributes/>
@ -177,21 +140,21 @@ bg=blue</panel_attributes>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>670</x>
<y>530</y>
<w>150</w>
<h>180</h>
<x>520</x>
<y>416</y>
<w>120</w>
<h>104</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.</panel_attributes>
<additional_attributes>130;160;30;30</additional_attributes>
<additional_attributes>24;88;64;88;64;24;104;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Package</type>
<coordinates>
<x>800</x>
<y>670</y>
<w>120</w>
<h>40</h>
<x>448</x>
<y>480</y>
<w>96</w>
<h>48</h>
</coordinates>
<panel_attributes>GameProtocols
bg=#aaaaa</panel_attributes>
@ -200,10 +163,10 @@ bg=#aaaaa</panel_attributes>
<element>
<type>com.umlet.element.Package</type>
<coordinates>
<x>1040</x>
<y>200</y>
<w>160</w>
<h>190</h>
<x>720</x>
<y>160</y>
<w>152</w>
<h>24</h>
</coordinates>
<panel_attributes>NetworkAPI
bg=#a21aff</panel_attributes>
@ -212,56 +175,84 @@ bg=#a21aff</panel_attributes>
<element>
<id>UMLClass</id>
<coordinates>
<x>1060</x>
<y>280</y>
<w>120</w>
<h>40</h>
<x>40</x>
<y>24</y>
<w>320</w>
<h>64</h>
</coordinates>
<panel_attributes>NetworkClient</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>1060</x>
<y>230</y>
<w>120</w>
<h>40</h>
</coordinates>
<panel_attributes>NetworkServer</panel_attributes>
<panel_attributes>/*HISTORY*/
--
10/2-2014
Restructured old
--
elementstyle=wordwrap
bg=gray</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>690</x>
<y>240</y>
<w>390</w>
<h>80</h>
<x>720</x>
<y>160</y>
<w>40</w>
<h>272</h>
</coordinates>
<panel_attributes>lt=-&gt;</panel_attributes>
<additional_attributes>30;30;200;30;200;60;370;60</additional_attributes>
<panel_attributes>lt=&lt;&lt;.</panel_attributes>
<additional_attributes>24;24;24;256</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>690</x>
<y>260</y>
<w>390</w>
<h>100</h>
<x>704</x>
<y>160</y>
<w>40</w>
<h>200</h>
</coordinates>
<panel_attributes>lt=-&lt;&lt;&lt;&lt;</panel_attributes>
<additional_attributes>30;30;180;30;180;80;370;80</additional_attributes>
<panel_attributes>lt=&lt;&lt;.</panel_attributes>
<additional_attributes>24;24;24;184</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>860</x>
<y>270</y>
<w>380</w>
<h>260</h>
<x>384</x>
<y>152</y>
<w>352</w>
<h>40</h>
</coordinates>
<panel_attributes>lt=&gt;&gt;&gt;-</panel_attributes>
<additional_attributes>320;30;360;30;360;230;30;240</additional_attributes>
<panel_attributes>lt=&lt;&lt;.</panel_attributes>
<additional_attributes>336;24;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>736</x>
<y>160</y>
<w>40</w>
<h>384</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.</panel_attributes>
<additional_attributes>24;24;24;368</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>520</x>
<y>480</y>
<w>136</w>
<h>64</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.</panel_attributes>
<additional_attributes>24;24;120;24;120;48</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>512</x>
<y>432</y>
<w>160</w>
<h>112</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;.</panel_attributes>
<additional_attributes>24;24;72;24;72;72;144;72;144;96</additional_attributes>
</element>
</diagram>

View File

@ -1,13 +1,13 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="12.1">
<zoom_level>16</zoom_level>
<diagram program="umlet" version="12.2">
<zoom_level>6</zoom_level>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>560</x>
<y>80</y>
<w>176</w>
<h>80</h>
<x>198</x>
<y>300</y>
<w>66</w>
<h>30</h>
</coordinates>
<panel_attributes>&lt;&lt;interface&gt;&gt;
OysterResource</panel_attributes>
@ -16,23 +16,23 @@ OysterResource</panel_attributes>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>528</x>
<y>112</y>
<w>206</w>
<h>160</h>
<x>186</x>
<y>312</y>
<w>76</w>
<h>60</h>
</coordinates>
<panel_attributes>lt=&gt;&gt;
implements
</panel_attributes>
<additional_attributes>112;128;112;48</additional_attributes>
<additional_attributes>42;48;42;18</additional_attributes>
</element>
<element>
<type>com.umlet.element.Actor</type>
<coordinates>
<x>352</x>
<y>240</y>
<w>128</w>
<h>192</h>
<x>120</x>
<y>360</y>
<w>48</w>
<h>72</h>
</coordinates>
<panel_attributes>Dev</panel_attributes>
<additional_attributes/>
@ -40,22 +40,22 @@ implements
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>320</x>
<y>32</y>
<w>272</w>
<h>240</h>
<x>108</x>
<y>282</y>
<w>102</w>
<h>90</h>
</coordinates>
<panel_attributes>lt=&lt;.
interacts&gt;</panel_attributes>
<additional_attributes>240;80;96;80;96;208</additional_attributes>
<additional_attributes>90;30;36;30;36;78</additional_attributes>
</element>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>576</x>
<y>576</y>
<w>160</w>
<h>32</h>
<x>204</x>
<y>486</y>
<w>60</w>
<h>12</h>
</coordinates>
<panel_attributes>CustomLoader</panel_attributes>
<additional_attributes/>
@ -63,10 +63,10 @@ interacts&gt;</panel_attributes>
<element>
<type>com.umlet.element.Class</type>
<coordinates>
<x>576</x>
<y>528</y>
<w>160</w>
<h>32</h>
<x>204</x>
<y>468</y>
<w>60</w>
<h>12</h>
</coordinates>
<panel_attributes>
ByteLoader</panel_attributes>
@ -75,33 +75,33 @@ ByteLoader</panel_attributes>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>464</x>
<y>384</y>
<w>144</w>
<h>192</h>
<x>162</x>
<y>414</y>
<w>54</w>
<h>72</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-</panel_attributes>
<additional_attributes>80;48;48;48;48;160;112;160</additional_attributes>
<additional_attributes>30;18;18;18;18;60;42;60</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>368</x>
<y>384</y>
<w>266</w>
<h>240</h>
<x>126</x>
<y>414</y>
<w>98</w>
<h>90</h>
</coordinates>
<panel_attributes>lt=&lt;&lt;-
implements partly</panel_attributes>
<additional_attributes>176;48;144;48;144;208;208;208</additional_attributes>
<additional_attributes>66;18;54;18;54;78;78;78</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>544</x>
<y>240</y>
<w>208</w>
<h>128</h>
<x>192</x>
<y>360</y>
<w>78</w>
<h>48</h>
</coordinates>
<panel_attributes>--
&lt;&lt;interface&gt;&gt;
@ -115,10 +115,10 @@ halign=center</panel_attributes>
<element>
<id>UMLClass</id>
<coordinates>
<x>544</x>
<y>400</y>
<w>208</w>
<h>80</h>
<x>192</x>
<y>420</y>
<w>78</w>
<h>30</h>
</coordinates>
<panel_attributes>
OResource
@ -130,13 +130,171 @@ halign=center</panel_attributes>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>688</x>
<y>256</y>
<w>196</w>
<h>224</h>
<x>252</x>
<y>366</y>
<w>66</w>
<h>84</h>
</coordinates>
<panel_attributes>lt=&gt;&gt;&gt;&gt;
manages&gt;</panel_attributes>
<additional_attributes>64;192;112;192;112;48;64;48</additional_attributes>
<additional_attributes>18;72;36;72;36;18;18;18</additional_attributes>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>108</x>
<y>282</y>
<w>240</w>
<h>234</h>
</coordinates>
<panel_attributes>old
bg=gray</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>402</x>
<y>342</y>
<w>576</w>
<h>204</h>
</coordinates>
<panel_attributes>ResourceManager
--
+ ResourceManager() :void
+ ~ResourceManager() :void
+ HBYTEARRAY LoadBytes(const wchar_t filename[], ResourceType type, int customId = -1, bool force = false)
+ HRESOURCE LoadResource(const wchar_t filename[], LoadFunction loadFnc = 0, UnloadFunction unloadFnc = 0, int customId = -1, bool force = false)
+ HRESOURCE ReloadResource(const wchar_t filename[])
+ HRESOURCE ReloadResource(HRESOURCE&amp; resource)
+ void Clean()
+ void ReleaseResource(const HRESOURCE&amp; resource)
+ void ReleaseResource(const wchar_t filename[])
+ void SetResourceId(const HRESOURCE&amp; resource, unsigned int id)
+ void SetResourceId(const wchar_t filename[], unsigned int id)
+ ResourceType GetResourceType(const HRESOURCE&amp; resource)
+ ResourceType GetResourceType (const wchar_t filename[])
+ const wchar_t* GetResourceFilename(const HRESOURCE&amp; resource);
+ HRESOURCE GetResourceHandle(const wchar_t filename[])
+ int GetResourceId(const HRESOURCE&amp; resource);
+ int GetResourceId(const wchar_t filename[]);
--
- ResourceManager(const ResourceManager&amp; obj);
- const ResourceManager&amp; operator=(const ResourceManager&amp;);
- std::map&lt;std::wstring, ResourceData*&gt; resources;</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>390</x>
<y>198</y>
<w>600</w>
<h>360</h>
</coordinates>
<panel_attributes>Oyster &lt;&lt;namespace&gt;&gt;
--
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>396</x>
<y>222</y>
<w>588</w>
<h>330</h>
</coordinates>
<panel_attributes>Resource &lt;&lt;namespace&gt;&gt;
--
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>534</x>
<y>282</y>
<w>126</w>
<h>18</h>
</coordinates>
<panel_attributes>HRESOURCE: void* &lt;&lt;typedef&gt;&gt;</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>534</x>
<y>300</y>
<w>126</w>
<h>18</h>
</coordinates>
<panel_attributes>HBYTE: char &lt;&lt;typedef&gt;&gt;</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>534</x>
<y>318</y>
<w>126</w>
<h>18</h>
</coordinates>
<panel_attributes>HBYTEARRAY: char* &lt;&lt;typedef&gt;&gt;</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>534</x>
<y>246</y>
<w>264</w>
<h>18</h>
</coordinates>
<panel_attributes>UnloadFunction :void(*UnloadFunction)(void* loadedData) &lt;&lt;typedef&gt;&gt;</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>534</x>
<y>264</y>
<w>288</w>
<h>18</h>
</coordinates>
<panel_attributes>LoadFunction :void*(*LoadFunction)(const wchar_t filename[]) &lt;&lt;typedef&gt;&gt;</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>402</x>
<y>246</y>
<w>126</w>
<h>90</h>
</coordinates>
<panel_attributes>ResourceType &lt;&lt;enum&gt;&gt;
--
ResourceType_Byte_Raw
ResourceType_Byte_ANSI
ResourceType_Byte_UTF8
ResourceType_Byte_UNICODE
ResourceType_Byte_UTF16LE
ResourceType_CUSTOM
ResourceType_INVALID
</panel_attributes>
<additional_attributes/>
</element>
<element>
<id>UMLClass</id>
<coordinates>
<x>378</x>
<y>174</y>
<w>630</w>
<h>396</h>
</coordinates>
<panel_attributes>New
bg=green</panel_attributes>
<additional_attributes/>
</element>
</diagram>

View File

@ -38,34 +38,6 @@ namespace DanBias
}
}
break;
case protocol_Gameplay_PlayerMovement:
{
Client::GameClientState::KeyInput* protocolData = new Client::GameClientState::KeyInput;
for(int i = 0; i< 6; i++)
{
protocolData->key[i] = p[i+1].value.netBool;
}
if(dynamic_cast<Client::GameState*>(gameClientState))
((Client::GameState*)gameClientState)->Protocol(protocolData);
delete protocolData;
protocolData = NULL;
}
break;
//case protocol_Gameplay_PlayerPosition:
// {
// Client::GameClientState::PlayerPos* protocolData = new Client::GameClientState::PlayerPos;
// for(int i = 0; i< 3; i++)
// {
// protocolData->playerPos[i] = p[i].value.netFloat;
// }
// if(dynamic_cast<Client::GameState*>(gameClientState))
// ((Client::GameState*)gameClientState)->Protocol(protocolData);
// delete protocolData;
// protocolData = NULL;
// }
// break;
case protocol_Gameplay_ObjectCreate:
{
Client::GameClientState::NewObj protocolData;// = new Client::GameClientState::NewObj;
@ -110,11 +82,24 @@ namespace DanBias
((Client::GameState*)gameClientState)->Protocol(&protocolData);
}
break;
case protocol_Gameplay_ObjectPositionRotation:
{
Client::GameClientState::ObjPos protocolData;
protocolData.object_ID = p[1].value.netInt;
for(int i = 0; i< 16; i++)
{
protocolData.worldPos[i] = p[i+2].value.netFloat;
}
if(dynamic_cast<Client::GameState*>(gameClientState))
((Client::GameState*)gameClientState)->Protocol(&protocolData);
}
break;
case protocol_Lobby_Create:
{
if(dynamic_cast<Client::LobbyState*>(gameClientState))
{
GameLogic::Protocol_LobbyCreateGame tp();
int id = p.Get(1).value.netInt;
std::string name = p.Get(19).value.netCharPtr;
Oyster::Math::Float4x4 w;

View File

@ -14,4 +14,4 @@ public:
void Init(ModelInitData modelInit);
};};};
#endif
#endif

View File

@ -15,4 +15,3 @@ public:
};};};
#endif

View File

@ -1,4 +1,3 @@
#include "C_StaticObj.h"
#include "DllInterfaces/GFXAPI.h"
using namespace DanBias::Client;

View File

@ -35,6 +35,11 @@ public:
};
struct KeyInput :public ProtocolStruct
{
/*
* key[0] =
*
*
*/
bool key[6];
};
struct PlayerPos :public ProtocolStruct

View File

@ -10,12 +10,9 @@ using namespace Oyster::Math;
struct GameState::myData
{
myData(){}
//std::vector<C_Object*> object;
int modelCount;
Oyster::Network::NetworkClient* nwClient;
gameStateState state;
}privData;
GameState::GameState(void)
@ -24,6 +21,7 @@ GameState::GameState(void)
key_backward = false;
key_strafeRight = false;
key_strafeLeft = false;
timer = 0;
}
@ -49,12 +47,12 @@ bool GameState::Init(Oyster::Network::NetworkClient* nwClient)
}
GameState::gameStateState GameState::LoadGame()
{
Oyster::Graphics::Definitions::Pointlight plight;
plight.Pos = Float3(615, 0 ,5);
plight.Color = Float3(0.9f,0.7f,0.2f);
plight.Radius = 100;
plight.Bright = 0.5f;
Oyster::Graphics::API::AddLight(plight);
Oyster::Graphics::Definitions::Pointlight plight;
plight.Pos = Float3(615, 0 ,5);
plight.Color = Float3(0.9f,0.7f,0.2f);
plight.Radius = 100;
plight.Bright = 0.5f;
Oyster::Graphics::API::AddLight(plight);
plight.Pos = Float3(10,800,5);
plight.Color = Float3(0.9f,0.7f,0.3f);
plight.Radius = 300;
@ -78,6 +76,7 @@ GameState::gameStateState GameState::LoadGame()
//Oyster::Graphics::API::AddLight(plight);
// use level loader
//LoadModels("3bana.bias");
// hardcoded objects
LoadModels();
Float3 startPos = Float3(0,0,20.0f);
@ -105,7 +104,7 @@ bool GameState::LoadModels()
this->staticObjects.Push(new C_StaticObj());
this->staticObjects[this->staticObjects.Size() -1 ]->Init(modelData);
// add box model
modelData.position = Oyster::Math::Float3(0,0,0);
modelData.rotation = Oyster::Math::Quaternion::identity;
@ -341,7 +340,12 @@ GameClientState::ClientState GameState::Update(float deltaTime, InputClass* KeyI
// read server data
// update objects
{
readKeyInput(KeyInput);
timer += deltaTime;
if(timer > 0.03)
{
readKeyInput(KeyInput);
timer = 0;
}
camera->UpdateViewMatrix();
}
@ -394,20 +398,11 @@ bool GameState::Release()
void GameState::readKeyInput(InputClass* KeyInput)
{
bool send = false;
GameLogic::Protocol_PlayerMovement movePlayer;
movePlayer.bForward = false;
movePlayer.bBackward = false;
movePlayer.bLeft = false;
movePlayer.bRight = false;
if(KeyInput->IsKeyPressed(DIK_W))
{
if(!key_forward)
//if(!key_forward)
{
movePlayer.bForward = true;
send = true;
privData->nwClient->Send(GameLogic::Protocol_PlayerMovementForward());
key_forward = true;
}
}
@ -416,10 +411,9 @@ void GameState::readKeyInput(InputClass* KeyInput)
if(KeyInput->IsKeyPressed(DIK_S))
{
if(!key_backward)
//if(!key_backward)
{
movePlayer.bBackward = true;
send = true;
privData->nwClient->Send(GameLogic::Protocol_PlayerMovementBackward());
key_backward = true;
}
}
@ -428,10 +422,9 @@ void GameState::readKeyInput(InputClass* KeyInput)
if(KeyInput->IsKeyPressed(DIK_A))
{
if(!key_strafeLeft)
//if(!key_strafeLeft)
{
movePlayer.bLeft = true;
send = true;
privData->nwClient->Send(GameLogic::Protocol_PlayerMovementLeft());
key_strafeLeft = true;
}
}
@ -440,10 +433,9 @@ void GameState::readKeyInput(InputClass* KeyInput)
if(KeyInput->IsKeyPressed(DIK_D))
{
if(!key_strafeRight)
//if(!key_strafeRight)
{
movePlayer.bRight = true;
send = true;
privData->nwClient->Send(GameLogic::Protocol_PlayerMovementRight());
key_strafeRight = true;
}
}
@ -451,11 +443,6 @@ void GameState::readKeyInput(InputClass* KeyInput)
key_strafeRight = false;
if (privData->nwClient->IsConnected() && send)
{
privData->nwClient->Send(movePlayer);
}
//send delta mouse movement
if (KeyInput->IsMousePressed())
{
@ -488,6 +475,7 @@ void GameState::readKeyInput(InputClass* KeyInput)
}
else
key_Shoot = false;
if(KeyInput->IsKeyPressed(DIK_X))
{
if(!key_Shoot)
@ -502,6 +490,7 @@ void GameState::readKeyInput(InputClass* KeyInput)
}
else
key_Shoot = false;
if(KeyInput->IsKeyPressed(DIK_C))
{
if(!key_Shoot)
@ -522,9 +511,7 @@ void GameState::readKeyInput(InputClass* KeyInput)
{
if(!key_Jump)
{
GameLogic::Protocol_PlayerJump playerJump;
playerJump.hasJumped = true;
privData->nwClient->Send(playerJump);
privData->nwClient->Send(GameLogic::Protocol_PlayerJump());
key_Jump = true;
}
}
@ -564,42 +551,25 @@ void GameState::Protocol( ObjPos* pos )
{
world[i] = pos->worldPos[i];
}
//printf("pos for obj %d, ",pos->object_ID );
for (unsigned int i = 0; i < dynamicObjects.Size(); i++)
{
if(dynamicObjects[i]->GetId() == pos->object_ID)
{
//dynamicObjects[i]->setPos(Float3(world[12], world[13], world[14]));
dynamicObjects[i]->setWorld(world);
dynamicObjects[i]->setPos(Float3(world[0], world[1], world[2]));
dynamicObjects[i]->setRot(Quaternion(Float3(world[3], world[4], world[5]), world[6]));
//dynamicObjects[i]->setWorld(world);
if(dynamicObjects[i]->GetId() == myId) // playerobj
{
Float3 right = Float3(world[0], world[1], world[2]);
Float3 up = Float3(world[4], world[5], world[6]);
Float3 objForward = Float3(world[8], world[9], world[10]);
Float3 pos = Float3(world[12], world[13], world[14]);
Float3 cameraLook = camera->GetLook();
Float3 cameraUp = camera->GetUp();
/*Oyster::Math::Float3 newUp = cameraUp.Dot(up);
up *= newUp;
up.Normalize();
Oyster::Math::Float3 newLook = up.Cross(right);
newLook.Normalize();*/
//camera->setRight(right);
//camera->setUp(up);
//camera->setLook(objForward);
Float3 pos = dynamicObjects[i]->getPos();
Float3 up = dynamicObjects[i]->getWorld().v[1];
Float3 objForward = dynamicObjects[i]->getWorld().v[2];
up *= 2;
objForward *= -2;
Oyster::Math::Float3 cameraPos = pos + up + objForward;
camera->SetPosition(cameraPos);
//camera->UpdateViewMatrix();
camera->SetPosition(cameraPos);
}
}
}

View File

@ -96,7 +96,7 @@ GameClientState::ClientState LobbyState::Update(float deltaTime, InputClass* Key
{
if(!DanBias::GameServerAPI::GameStart())
{
//this->nwClient->Send(GameLogic::Protocol_LobbyStartGame());
}
}
}

View File

@ -204,6 +204,7 @@ GameClientState::ClientState LoginState::Update(float deltaTime, InputClass* Key
{
// game ip
nwClient->Connect(15152, "127.0.0.1");
//nwClient->Connect(15152, "83.254.217.248");
if (!nwClient->IsConnected())
{

View File

@ -36,6 +36,8 @@ namespace GameLogic
int GetTeamID() const override;
PLAYER_STATE GetState() const override;
Oyster::Math::Float3 GetPosition() override;
Oyster::Math::Quaternion GetRotation() override;
Oyster::Math::Float3 GetScale() override;
Oyster::Math::Float4x4 GetOrientation() override;
int GetID() const override;
OBJECT_TYPE GetObjectType() const override;
@ -50,6 +52,8 @@ namespace GameLogic
LevelData();
~LevelData();
Oyster::Math::Float3 GetPosition() override;
Oyster::Math::Quaternion GetRotation() override;
Oyster::Math::Float3 GetScale() override;
Oyster::Math::Float4x4 GetOrientation() override;
int GetID() const override;
OBJECT_TYPE GetObjectType() const override;

View File

@ -36,10 +36,22 @@ namespace GameLogic
public:
/********************************************************
* Gets players position
* @param playerID: ID of the player whos position you want
* @return Returns the players position
********************************************************/
virtual Oyster::Math::Float3 GetPosition() = 0;
/********************************************************
* Gets players rotation as quaternion
* @return Returns a quaternion
********************************************************/
virtual Oyster::Math::Quaternion GetRotation() = 0;
/********************************************************
* Gets players position
* @return Returns the player scale
********************************************************/
virtual Oyster::Math::Float3 GetScale() = 0;
/********************************************************
* Gets players current orientation
* @param playerID: ID of the player whos position you want

View File

@ -20,6 +20,14 @@ Oyster::Math::Float3 Game::LevelData::GetPosition()
//return this->level->GetCenter();
return Oyster::Math::Float3();
}
Oyster::Math::Quaternion Game::LevelData::GetRotation()
{
return Oyster::Math::Quaternion();
}
Oyster::Math::Float3 Game::LevelData::GetScale()
{
return Oyster::Math::Float3();
}
Oyster::Math::Float4x4 Game::LevelData::GetOrientation()
{
//return this->level->GetOrientation();

View File

@ -6,7 +6,7 @@ using namespace GameLogic;
Game::PlayerData::PlayerData()
{
//set some stats that are appropriate to a player
Oyster::Math::Float3 centerPosition = Oyster::Math::Float3(0,608,-5);
Oyster::Math::Float3 centerPosition = Oyster::Math::Float3(0,628,-25);
Oyster::Math::Float3 size = Oyster::Math::Float3(0.25f,1.0f,0.5f);
Oyster::Math::Float mass = 60;
Oyster::Math::Float restitutionCoeff = 0.5;
@ -48,6 +48,14 @@ Oyster::Math::Float3 Game::PlayerData::GetPosition()
{
return this->player->GetPosition();
}
Oyster::Math::Quaternion Game::PlayerData::GetRotation()
{
return this->player->GetRotation();
}
Oyster::Math::Float3 Game::PlayerData::GetScale()
{
return this->player->GetScale();
}
Oyster::Math::Float4x4 Game::PlayerData::GetOrientation()
{
return this->player->GetOrientation();

View File

@ -47,7 +47,7 @@ Object::Object(void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE
Object::Object(Oyster::Physics::ICustomBody *rigidBody ,void* collisionFuncBefore, void* collisionFuncAfter, OBJECT_TYPE type)
{
this->rigidBody = rigidBody;
this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_AfterCollisionResponse)collisionFuncAfter);
this->type = type;
this->objectID = GID();
}
@ -55,7 +55,7 @@ Object::Object(Oyster::Physics::ICustomBody *rigidBody ,void* collisionFuncBefor
Object::Object(Oyster::Physics::ICustomBody *rigidBody ,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter), Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type)
{
this->rigidBody = rigidBody;
this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_AfterCollisionResponse)collisionFuncAfter);
this->type = type;
this->objectID = GID();
}
@ -88,7 +88,7 @@ Oyster::Physics::ICustomBody* Object::GetRigidBody()
void Object::BeginFrame()
{
}
// update physic
void Object::EndFrame()
@ -105,37 +105,27 @@ void Object::setAfterCollisonFunc(Oyster::Physics::ICustomBody::SubscriptMessage
this->rigidBody->SetSubscription((Oyster::Physics::ICustomBody::EventAction_AfterCollisionResponse)(collisionFuncAfter));
}
Oyster::Math::Float3 Object::GetPosition()
{
Oyster::Physics::ICustomBody::State state;
state = this->rigidBody->GetState();
return state.centerPos;
}
Oyster::Math::Quaternion Object::GetRotation()
{
Oyster::Physics::ICustomBody::State state;
state = this->rigidBody->GetState();
return state.quaternion;
}
Oyster::Math::Float3 Object::GetScale()
{
Oyster::Physics::ICustomBody::State state;
state = this->rigidBody->GetState();
return Float3();
}
Oyster::Math::Float4x4 Object::GetOrientation()
{
Oyster::Physics::ICustomBody::State state;
state = this->rigidBody->GetState();
return state.GetOrientation();
}
Oyster::Math::Float3 Object::GetPosition()
{
return this->position;
}
Oyster::Math::Float3 Object::GetRotation()
{
return this->rotation;
}
Oyster::Math::Float3 Object::GetScaling()
{
return this->scale;
}
void Object::SetPosition(Oyster::Math::Float3 position)
{
this->position = position;
}
void Object::SetRotation(Oyster::Math::Float3 rotation)
{
this->rotation = rotation;
}
void Object::SetScaling(Oyster::Math::Float3 scale)
{
this->scale = scale;
}

View File

@ -25,20 +25,14 @@ namespace GameLogic
Object(Oyster::Physics::ICustomBody *rigidBody ,Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncBefore)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter), Oyster::Physics::ICustomBody::SubscriptMessage (*collisionFuncAfter)(Oyster::Physics::ICustomBody *proto,Oyster::Physics::ICustomBody *deuter,Oyster::Math::Float kineticEnergyLoss), OBJECT_TYPE type);
~Object(void);
// API overrides
OBJECT_TYPE GetObjectType() const;
OBJECT_TYPE GetObjectType() const override;
int GetID() const override;
Oyster::Math::Float3 GetPosition() override;
Oyster::Math::Quaternion GetRotation() override;
Oyster::Math::Float3 GetScale() override;
Oyster::Math::Float4x4 GetOrientation() override;
void setID(int id);
int GetID() const;
Oyster::Math::Float4x4 GetOrientation();
Oyster::Math::Float3 GetPosition();
Oyster::Math::Float3 GetRotation();
Oyster::Math::Float3 GetScaling();
void SetPosition(Oyster::Math::Float3 position);
void SetRotation(Oyster::Math::Float3 rotation);
void SetScaling(Oyster::Math::Float3 scale);
Oyster::Physics::ICustomBody* GetRigidBody();
void ApplyLinearImpulse(Oyster::Math::Float3 force);
@ -52,7 +46,7 @@ namespace GameLogic
static Oyster::Physics::ICustomBody::SubscriptMessage DefaultCollisionBefore(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj);
static Oyster::Physics::ICustomBody::SubscriptMessage DefaultCollisionAfter(Oyster::Physics::ICustomBody *rigidBodyLevel, Oyster::Physics::ICustomBody *obj, Oyster::Math::Float kineticEnergyLoss);
public: //TODO: Hax This should be private when level is dynamic
public: //HACK: This should be private when level is dynamic
OBJECT_TYPE type;
int objectID;
@ -62,11 +56,6 @@ namespace GameLogic
static const Game* gameInstance;
Oyster::Math::Float3 currLook;
Oyster::Math::Float3 newLook;
Oyster::Math::Float3 position;
Oyster::Math::Float3 rotation;
Oyster::Math::Float3 scale;
};
}

View File

@ -1,3 +1,8 @@
//////////////////////////////////////////////////////////
// Created 2013 //
// Dennis Andersen, Linda Andersson //
//////////////////////////////////////////////////////////
#ifndef GAMELOGIC_OBJECT_PROTOCOLS_H
#define GAMELOGIC_OBJECT_PROTOCOLS_H
@ -6,6 +11,7 @@
namespace GameLogic
{
//#define protocol_Gameplay_ObjectPickup 350
struct Protocol_ObjectPickup :public Oyster::Network::CustomProtocolObject
{
short object_ID;
@ -50,10 +56,11 @@ namespace GameLogic
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectDamage 351
struct Protocol_ObjectDamage :public Oyster::Network::CustomProtocolObject
{
int object_ID;
float health; //Precentage%
float healthLost; //Precentage%
Protocol_ObjectDamage()
{
@ -64,7 +71,7 @@ namespace GameLogic
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
object_ID = -1;
health = 0.0f;
healthLost = 0.0f;
}
Protocol_ObjectDamage(Oyster::Network::CustomNetProtocol& p)
{
@ -78,12 +85,12 @@ namespace GameLogic
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
object_ID = id;
health = hp;
healthLost = hp;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = object_ID;
this->protocol[2].value = health;
this->protocol[2].value = healthLost;
return protocol;
}
@ -91,51 +98,89 @@ namespace GameLogic
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectHealthStatus 352
struct Protocol_ObjectHealthStatus :public Oyster::Network::CustomProtocolObject
{
float currentHealth;
int id;
Protocol_ObjectHealthStatus()
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectHealthStatus;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->id = 0;
this->currentHealth = 0.0f;
}
Protocol_ObjectHealthStatus(int id, float health)
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectHealthStatus;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->id = id; this->currentHealth = health;
}
Protocol_ObjectHealthStatus(Oyster::Network::CustomNetProtocol& p)
{
this->id = p[1].value.netInt;
this->currentHealth = p[2].value.netFloat;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = this->id;
this->protocol[2].value = this->currentHealth;
return protocol;
}
private:
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectPosition 353
struct Protocol_ObjectPosition :public Oyster::Network::CustomProtocolObject
{
int object_ID;
float worldMatrix[16];
short object_ID;
float position[3];
Protocol_ObjectPosition()
{
this->protocol[0].value = protocol_Gameplay_ObjectPosition;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Short;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->protocol[3].type = Oyster::Network::NetAttributeType_Float;
this->protocol[4].type = Oyster::Network::NetAttributeType_Float;
for (int i = 2; i <= 17; i++)
{
this->protocol[i].type = Oyster::Network::NetAttributeType_Float;
}
object_ID = -1;
memset(&worldMatrix[0], 0, sizeof(float) * 16);
object_ID = 0;
memset(&position[0], 0, sizeof(float) * 3);
}
Protocol_ObjectPosition(Oyster::Network::CustomNetProtocol& p)
{
object_ID = p[1].value.netShort;
position[0] = p[2].value.netFloat;
position[1] = p[3].value.netFloat;
position[2] = p[4].value.netFloat;
}
Protocol_ObjectPosition(float m[16], int id)
Protocol_ObjectPosition(float v[3], int id)
{
this->protocol[0].value = protocol_Gameplay_ObjectPosition;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
for (int i = 2; i <= 17; i++)
{
this->protocol[i].type = Oyster::Network::NetAttributeType_Float;
}
this->protocol[1].type = Oyster::Network::NetAttributeType_Short;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->protocol[3].type = Oyster::Network::NetAttributeType_Float;
this->protocol[4].type = Oyster::Network::NetAttributeType_Float;
object_ID = id;
memcpy(&worldMatrix[0], &m[0], sizeof(float)*16);
memcpy(&position[0], &v[0], sizeof(float) * 3);
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = object_ID;
for (int i = 2; i <= 17; i++)
{
this->protocol[i].value = worldMatrix[i-2];
}
this->protocol[2].value = position[0];
this->protocol[3].value = position[1];
this->protocol[4].value = position[2];
return protocol;
}
@ -143,49 +188,202 @@ namespace GameLogic
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectScale 354
struct Protocol_ObjectScale :public Oyster::Network::CustomProtocolObject
{
short object_ID;
float position[3];
Protocol_ObjectScale()
{
this->protocol[0].value = protocol_Gameplay_ObjectScale;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Short;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->protocol[3].type = Oyster::Network::NetAttributeType_Float;
this->protocol[4].type = Oyster::Network::NetAttributeType_Float;
object_ID = 0;
memset(&position[0], 0, sizeof(float) * 3);
}
Protocol_ObjectScale(Oyster::Network::CustomNetProtocol& p)
{
object_ID = p[1].value.netShort;
position[0] = p[2].value.netFloat;
position[1] = p[3].value.netFloat;
position[2] = p[4].value.netFloat;
}
Protocol_ObjectScale(float v[3], int id)
{
this->protocol[0].value = protocol_Gameplay_ObjectScale;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Short;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->protocol[3].type = Oyster::Network::NetAttributeType_Float;
this->protocol[4].type = Oyster::Network::NetAttributeType_Float;
object_ID = id;
memcpy(&position[0], &v[0], sizeof(float) * 3);
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = object_ID;
this->protocol[2].value = position[0];
this->protocol[3].value = position[1];
this->protocol[4].value = position[2];
return protocol;
}
private:
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectRotation 355
struct Protocol_ObjectRotation :public Oyster::Network::CustomProtocolObject
{
short object_ID;
float position[3];
Protocol_ObjectRotation()
{
this->protocol[0].value = protocol_Gameplay_ObjectRotation;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Short;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->protocol[3].type = Oyster::Network::NetAttributeType_Float;
this->protocol[4].type = Oyster::Network::NetAttributeType_Float;
object_ID = 0;
memset(&position[0], 0, sizeof(float) * 3);
}
Protocol_ObjectRotation(Oyster::Network::CustomNetProtocol& p)
{
object_ID = p[1].value.netShort;
position[0] = p[2].value.netFloat;
position[1] = p[3].value.netFloat;
position[2] = p[4].value.netFloat;
}
Protocol_ObjectRotation(float v[3], int id)
{
this->protocol[0].value = protocol_Gameplay_ObjectRotation;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Short;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->protocol[3].type = Oyster::Network::NetAttributeType_Float;
this->protocol[4].type = Oyster::Network::NetAttributeType_Float;
object_ID = id;
memcpy(&position[0], &v[0], sizeof(float) * 3);
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = object_ID;
this->protocol[2].value = position[0];
this->protocol[3].value = position[1];
this->protocol[4].value = position[2];
return protocol;
}
private:
Oyster::Network::CustomNetProtocol protocol;
};
struct Protocol_ObjectPositionRotation :public Oyster::Network::CustomProtocolObject
{
short object_ID;
float position[3];
float rotation[3];
Protocol_ObjectPositionRotation()
{
this->protocol[0].value = protocol_Gameplay_ObjectPositionRotation;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Short;
//POSITION
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->protocol[3].type = Oyster::Network::NetAttributeType_Float;
this->protocol[4].type = Oyster::Network::NetAttributeType_Float;
//ROTATION
this->protocol[5].type = Oyster::Network::NetAttributeType_Float;
this->protocol[6].type = Oyster::Network::NetAttributeType_Float;
this->protocol[7].type = Oyster::Network::NetAttributeType_Float;
this->object_ID = 0;
memset(&this->position[0], 0, sizeof(float) * 3);
memset(&this->rotation[0], 0, sizeof(float) * 3);
}
Protocol_ObjectPositionRotation(Oyster::Network::CustomNetProtocol& p)
{
this->object_ID = p[1].value.netShort;
//POSITION
this->position[0] = p[2].value.netFloat;
this->position[1] = p[3].value.netFloat;
this->position[2] = p[4].value.netFloat;
//ROTATION
this->rotation[0] = p[5].value.netFloat;
this->rotation[1] = p[6].value.netFloat;
this->rotation[2] = p[7].value.netFloat;
}
Protocol_ObjectPositionRotation(float p[3], float r[3], int id)
{
this->protocol[0].value = protocol_Gameplay_ObjectPositionRotation;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Short;
//POSITION
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->protocol[3].type = Oyster::Network::NetAttributeType_Float;
this->protocol[4].type = Oyster::Network::NetAttributeType_Float;
//ROTATION
this->protocol[5].type = Oyster::Network::NetAttributeType_Float;
this->protocol[6].type = Oyster::Network::NetAttributeType_Float;
this->protocol[7].type = Oyster::Network::NetAttributeType_Float;
object_ID = id;
memcpy(&this->position[0], &p[0], sizeof(float) * 3);
memcpy(&this->rotation[0], &r[0], sizeof(float) * 3);
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = this->object_ID;
this->protocol[2].value = this->position[0];
this->protocol[3].value = this->position[1];
this->protocol[4].value = this->position[2];
this->protocol[5].value = this->rotation[0];
this->protocol[6].value = this->rotation[1];
this->protocol[7].value = this->rotation[2];
return protocol;
}
private:
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectEnabled 356
struct Protocol_ObjectEnable :public Oyster::Network::CustomProtocolObject
{
int object_ID;
float worldMatrix[16];
int objectID;
Protocol_ObjectEnable()
{
this->protocol[0].value = protocol_Gameplay_ObjectEnabled;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
for (int i = 2; i <= 17; i++)
{
this->protocol[i].type = Oyster::Network::NetAttributeType_Float;
}
object_ID = -1;
memset(&worldMatrix[0], 0, sizeof(float) * 16);
this->objectID = -1;
}
Protocol_ObjectEnable(int objectID)
{
this->protocol[0].value = protocol_Gameplay_ObjectEnabled;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->objectID = objectID;
}
Protocol_ObjectEnable(Oyster::Network::CustomNetProtocol& p)
{
}
Protocol_ObjectEnable(float m[16], int id)
{
this->protocol[0].value = protocol_Gameplay_ObjectEnabled;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
for (int i = 2; i <= 17; i++)
{ this->protocol[i].type = Oyster::Network::NetAttributeType_Float; }
object_ID = id;
memcpy(&worldMatrix[0], &m[0], sizeof(float)*16);
this->objectID = p[1].value.netInt;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = object_ID;
for (int i = 2; i <= 17; i++)
{
this->protocol[i].value = worldMatrix[i-2];
}
this->protocol[1].value = this->objectID;
return protocol;
}
@ -193,38 +391,39 @@ namespace GameLogic
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectDisabled 357
struct Protocol_ObjectDisable :public Oyster::Network::CustomProtocolObject
{
int object_ID;
float timer;
int objectID;
float seconds;
Protocol_ObjectDisable()
{
this->protocol[0].value = protocol_Gameplay_ObjectDisabled;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->objectID = 0;
this->seconds = 0.0f;
}
Protocol_ObjectDisable(Oyster::Network::CustomNetProtocol& p)
{
}
Protocol_ObjectDisable(int id, float time)
Protocol_ObjectDisable(int objctID, float seconds)
{
this->protocol[0].value = protocol_Gameplay_ObjectDisabled;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
object_ID = id;
timer = time;
this->objectID = objctID;
this->seconds = seconds;
}
Protocol_ObjectDisable(Oyster::Network::CustomNetProtocol& p)
{
this->objectID = p[1].value.netInt;
this->seconds = p[2].value.netFloat;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = object_ID;
this->protocol[2].value = timer;
this->protocol[1].value = this->objectID;
this->protocol[2].value = this->seconds;
return protocol;
}
@ -232,6 +431,7 @@ namespace GameLogic
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectCreate 358
struct Protocol_ObjectCreate :public Oyster::Network::CustomProtocolObject
{
//ObjectType type; //ie player, box or whatever
@ -304,6 +504,330 @@ namespace GameLogic
private:
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectCreatePlayer 359
struct Protocol_ObjectCreatePlayer :public Oyster::Network::CustomProtocolObject
{
//ObjectType type; //ie player, box or whatever
int object_ID;
int teamId;
std::string name;
std::string meshName;
float position[3];
float rotation[3];
float scale[3];
Protocol_ObjectCreatePlayer()
{
this->protocol[0].value = protocol_Gameplay_ObjectCreatePlayer;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
//PLAYER_ID
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
//TEAM_ID
this->protocol[2].type = Oyster::Network::NetAttributeType_Int;
//PLAYER-NAME
this->protocol[3].type = Oyster::Network::NetAttributeType_CharArray;
//MESH-NAME
this->protocol[4].type = Oyster::Network::NetAttributeType_CharArray;
//POSITION
this->protocol[5].type = Oyster::Network::NetAttributeType_Float;
this->protocol[6].type = Oyster::Network::NetAttributeType_Float;
this->protocol[7].type = Oyster::Network::NetAttributeType_Float;
//ROTATION
this->protocol[8].type = Oyster::Network::NetAttributeType_Float;
this->protocol[9].type = Oyster::Network::NetAttributeType_Float;
this->protocol[10].type = Oyster::Network::NetAttributeType_Float;
//SCALE
this->protocol[11].type = Oyster::Network::NetAttributeType_Float;
this->protocol[12].type = Oyster::Network::NetAttributeType_Float;
this->protocol[13].type = Oyster::Network::NetAttributeType_Float;
}
Protocol_ObjectCreatePlayer(Oyster::Network::CustomNetProtocol& p)
{
}
Protocol_ObjectCreatePlayer(float position[3], float rotation[3], float scale[3], int ObjectID, int teamID, std::string name, std::string meshName)
{
this->protocol[0].value = protocol_Gameplay_ObjectCreatePlayer;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
//PLAYER_ID
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
//TEAM_ID
this->protocol[2].type = Oyster::Network::NetAttributeType_Int;
//PLAYER-NAME
this->protocol[3].type = Oyster::Network::NetAttributeType_CharArray;
//MESH-NAME
this->protocol[4].type = Oyster::Network::NetAttributeType_CharArray;
//POSITION
this->protocol[5].type = Oyster::Network::NetAttributeType_Float;
this->protocol[6].type = Oyster::Network::NetAttributeType_Float;
this->protocol[7].type = Oyster::Network::NetAttributeType_Float;
//ROTATION
this->protocol[8].type = Oyster::Network::NetAttributeType_Float;
this->protocol[9].type = Oyster::Network::NetAttributeType_Float;
this->protocol[10].type = Oyster::Network::NetAttributeType_Float;
//SCALE
this->protocol[11].type = Oyster::Network::NetAttributeType_Float;
this->protocol[12].type = Oyster::Network::NetAttributeType_Float;
this->protocol[13].type = Oyster::Network::NetAttributeType_Float;
this->object_ID = ObjectID;
this->teamId = teamID;
this->name = name;
this->meshName = meshName;
memcpy(&this->position[0], &position[0], sizeof(float)*3);
memcpy(&this->rotation[0], &rotation[0], sizeof(float)*3);
memcpy(&this->scale[0], &scale[0], sizeof(float)*3);
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = this->object_ID;
this->protocol[2].value = this->teamId;
this->protocol.Set(3, this->name);
this->protocol.Set(4, this->meshName);
//POSITION
this->protocol[5].value = this->position[0];
this->protocol[6].value = this->position[1];
this->protocol[7].value = this->position[2];
//ROTATION
this->protocol[8].value = this->rotation[0];
this->protocol[9].value = this->rotation[1];
this->protocol[10].value = this->rotation[2];
//SCALE
this->protocol[11].value = this->scale[0];
this->protocol[12].value = this->scale[1];
this->protocol[13].value = this->scale[2];
return protocol;
}
private:
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectJoinTeam 360
struct Protocol_ObjectJoinTeam :public Oyster::Network::CustomProtocolObject
{
int objectID;
int teamID;
Protocol_ObjectJoinTeam()
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectJoinTeam;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->protocol[2].type = Oyster::Network::NetAttributeType_Int;
this->objectID = 0;
this->teamID = 0;
}
Protocol_ObjectJoinTeam(int objID, int teamID)
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectJoinTeam;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->protocol[2].type = Oyster::Network::NetAttributeType_Int;
this->objectID = objID;
this->teamID = teamID;
}
Protocol_ObjectJoinTeam(Oyster::Network::CustomNetProtocol& p)
{
this->objectID = p[1].value.netInt;
this->teamID = p[2].value.netInt;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = this->objectID;
this->protocol[2].value = this->teamID;
return protocol;
}
private:
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectLeaveTeam 361
struct Protocol_ObjectLeaveTeam :public Oyster::Network::CustomProtocolObject
{
int objectID;
Protocol_ObjectLeaveTeam()
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectLeaveTeam;
this->protocol[0].type = Oyster::Network::NetAttributeType_Int;
this->objectID = 0;
}
Protocol_ObjectLeaveTeam(int objectID)
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectLeaveTeam;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->objectID = objectID;
}
Protocol_ObjectLeaveTeam(Oyster::Network::CustomNetProtocol& p)
{
this->objectID = p[1].value.netInt;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = this->objectID;
return protocol;
}
private:
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectWeaponCooldown 362
struct Protocol_ObjectWeaponCooldown :public Oyster::Network::CustomProtocolObject
{
float seconds;
Protocol_ObjectWeaponCooldown()
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectWeaponCooldown;
this->protocol[1].type = Oyster::Network::NetAttributeType_Float;
this->seconds = 0.0f;
}
Protocol_ObjectWeaponCooldown(float seconds)
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectWeaponCooldown;
this->protocol[1].type = Oyster::Network::NetAttributeType_Float;
this->seconds = seconds;
}
Protocol_ObjectWeaponCooldown(Oyster::Network::CustomNetProtocol& p)
{
this->seconds = p[1].value.netFloat;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = this->seconds;
return protocol;
}
private:
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectWeaponEnergy 363
struct Protocol_ObjectWeaponEnergy :public Oyster::Network::CustomProtocolObject
{
float energy;
Protocol_ObjectWeaponEnergy()
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectWeaponEnergy;
this->protocol[1].type = Oyster::Network::NetAttributeType_Float;
this->energy = 0.0f;
}
Protocol_ObjectWeaponEnergy(float energy)
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectWeaponEnergy;
this->protocol[1].type = Oyster::Network::NetAttributeType_Float;
this->energy = energy;
}
Protocol_ObjectWeaponEnergy(Oyster::Network::CustomNetProtocol& p)
{
this->energy = p[1].value.netFloat;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = this->energy;
return protocol;
}
private:
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectRespawn 364
struct Protocol_ObjectRespawn :public Oyster::Network::CustomProtocolObject
{
float position[3];
Protocol_ObjectRespawn()
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectRespawn;
this->protocol[1].type = Oyster::Network::NetAttributeType_Float;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->protocol[3].type = Oyster::Network::NetAttributeType_Float;
memset(&this->position[0], 0, sizeof(float) * 3);
}
Protocol_ObjectRespawn(float position[3])
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectRespawn;
this->protocol[1].type = Oyster::Network::NetAttributeType_Float;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->protocol[3].type = Oyster::Network::NetAttributeType_Float;
memcpy(&this->position[0], &position[0], sizeof(float) * 3);
}
Protocol_ObjectRespawn(Oyster::Network::CustomNetProtocol& p)
{
this->position[0] = p[1].value.netFloat;
this->position[1] = p[2].value.netFloat;
this->position[2] = p[3].value.netFloat;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = this->position[0];
this->protocol[2].value = this->position[1];
this->protocol[3].value = this->position[2];
return protocol;
}
private:
Oyster::Network::CustomNetProtocol protocol;
};
//#define protocol_Gameplay_ObjectDie 365
struct Protocol_ObjectDie :public Oyster::Network::CustomProtocolObject
{
int objectID;
float seconds;
Protocol_ObjectDie()
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectDie;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->objectID = 0;
this->seconds = 0.0f;
}
Protocol_ObjectDie(int objectID, float seconds)
{
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[0].value.netShort = protocol_Gameplay_ObjectDie;
this->protocol[1].type = Oyster::Network::NetAttributeType_Int;
this->protocol[2].type = Oyster::Network::NetAttributeType_Float;
this->objectID = objectID;
this->seconds = seconds;
}
Protocol_ObjectDie(Oyster::Network::CustomNetProtocol& p)
{
this->objectID = p[1].value.netInt;
this->seconds = p[2].value.netFloat;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = this->objectID;
this->protocol[2].value = this->seconds;
return protocol;
}
private:
Oyster::Network::CustomNetProtocol protocol;
};
}
#endif // !GAMELOGIC_PLAYER_PROTOCOLS_H

View File

@ -8,56 +8,67 @@
#include <CustomNetProtocol.h>
#include "ProtocolIdentificationID.h"
#include <bitset>
//protocol_Gameplay_PlayerMovement 300
//protocol_Gameplay_PlayerMouseMovement 301
//protocol_Gameplay_PlayerChangeWeapon 302
namespace GameLogic
{
struct Protocol_PlayerMovement :public Oyster::Network::CustomProtocolObject
struct Protocol_PlayerMovementRight :public Oyster::Network::CustomProtocolObject
{
bool bForward;
bool bBackward;
bool bLeft;
bool bRight;
Protocol_PlayerMovement()
Protocol_PlayerMovementRight()
{
this->protocol[0].value = protocol_Gameplay_PlayerMovement;
this->protocol[0].value = protocol_Gameplay_PlayerMovementRight;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Bool;
this->protocol[2].type = Oyster::Network::NetAttributeType_Bool;
this->protocol[3].type = Oyster::Network::NetAttributeType_Bool;
this->protocol[4].type = Oyster::Network::NetAttributeType_Bool;
}
Protocol_PlayerMovement(Oyster::Network::CustomNetProtocol& p)
{
bForward = p[1].value.netBool;
bBackward = p[2].value.netBool;
bLeft = p[3].value.netBool;
bRight = p[4].value.netBool;
}
const Protocol_PlayerMovement& operator=(Oyster::Network::CustomNetProtocol& val)
{
bForward = val[1].value.netBool;
bBackward = val[2].value.netBool;
bLeft = val[3].value.netBool;
bRight = val[4].value.netBool;
return *this;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = bForward;
this->protocol[2].value = bBackward;
this->protocol[3].value = bLeft;
this->protocol[4].value = bRight;
{ return protocol; }
return protocol;
private:
Oyster::Network::CustomNetProtocol protocol;
};
struct Protocol_PlayerMovementLeft :public Oyster::Network::CustomProtocolObject
{
Protocol_PlayerMovementLeft()
{
this->protocol[0].value = protocol_Gameplay_PlayerMovementLeft;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
}
Oyster::Network::CustomNetProtocol GetProtocol() override { return protocol; }
private:
Oyster::Network::CustomNetProtocol protocol;
};
struct Protocol_PlayerMovementForward :public Oyster::Network::CustomProtocolObject
{
Protocol_PlayerMovementForward()
{
this->protocol[0].value = protocol_Gameplay_PlayerMovementForward;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
}
Oyster::Network::CustomNetProtocol GetProtocol() override { return protocol; }
private:
Oyster::Network::CustomNetProtocol protocol;
};
struct Protocol_PlayerMovementBackward :public Oyster::Network::CustomProtocolObject
{
Protocol_PlayerMovementBackward()
{
this->protocol[0].value = protocol_Gameplay_PlayerMovementBackward;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
}
Oyster::Network::CustomNetProtocol GetProtocol() override { return protocol; }
private:
Oyster::Network::CustomNetProtocol protocol;
};
struct Protocol_PlayerJump :public Oyster::Network::CustomProtocolObject
{
Protocol_PlayerJump()
{
this->protocol[0].value = protocol_Gameplay_PlayerJump;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
}
Oyster::Network::CustomNetProtocol GetProtocol() override { return protocol; }
private:
Oyster::Network::CustomNetProtocol protocol;
@ -65,7 +76,6 @@ namespace GameLogic
struct Protocol_PlayerLook :public Oyster::Network::CustomProtocolObject
{
float lookDirX;
float lookDirY;
float lookDirZ;
@ -180,35 +190,6 @@ namespace GameLogic
Oyster::Network::CustomNetProtocol protocol;
};
struct Protocol_PlayerJump :public Oyster::Network::CustomProtocolObject
{
bool hasJumped;
Protocol_PlayerJump()
{
this->protocol[0].value = protocol_Gameplay_PlayerJump;
this->protocol[0].type = Oyster::Network::NetAttributeType_Short;
this->protocol[1].type = Oyster::Network::NetAttributeType_Bool;
}
Protocol_PlayerJump(Oyster::Network::CustomNetProtocol& p)
{
hasJumped = p[1].value.netBool;
}
const Protocol_PlayerJump& operator=(Oyster::Network::CustomNetProtocol& val)
{
hasJumped = val[1].value.netBool;
return *this;
}
Oyster::Network::CustomNetProtocol GetProtocol() override
{
this->protocol[1].value = hasJumped;
return protocol;
}
private:
Oyster::Network::CustomNetProtocol protocol;
};
}
#endif // !GAMELOGIC_PLAYER_PROTOCOLS_H

View File

@ -41,17 +41,32 @@
/********* GAMEPLAY PROTOCOLS ***************************************************************************************************/
/***********[ 300 - 399 ]***********/
#define protocol_GameplayMIN 300
#define protocol_Gameplay_PlayerMovement 300
#define protocol_Gameplay_PlayerLookDir 301
#define protocol_Gameplay_PlayerChangeWeapon 302
#define protocol_Gameplay_PlayerShot 303
#define protocol_Gameplay_PlayerJump 304
#define protocol_Gameplay_ObjectPickup 305
#define protocol_Gameplay_ObjectDamage 306
#define protocol_Gameplay_ObjectPosition 307
#define protocol_Gameplay_ObjectEnabled 308
#define protocol_Gameplay_ObjectDisabled 309
#define protocol_Gameplay_ObjectCreate 310
#define protocol_Gameplay_PlayerMovementRight 300
#define protocol_Gameplay_PlayerMovementLeft 301
#define protocol_Gameplay_PlayerMovementForward 302
#define protocol_Gameplay_PlayerMovementBackward 303
#define protocol_Gameplay_PlayerLookDir 304
#define protocol_Gameplay_PlayerChangeWeapon 305
#define protocol_Gameplay_PlayerShot 306
#define protocol_Gameplay_PlayerJump 307
#define protocol_Gameplay_ObjectPickup 350
#define protocol_Gameplay_ObjectDamage 351
#define protocol_Gameplay_ObjectHealthStatus 352
#define protocol_Gameplay_ObjectPosition 353
#define protocol_Gameplay_ObjectScale 354
#define protocol_Gameplay_ObjectRotation 355
#define protocol_Gameplay_ObjectPositionRotation 356
#define protocol_Gameplay_ObjectEnabled 357
#define protocol_Gameplay_ObjectDisabled 358
#define protocol_Gameplay_ObjectCreate 359
#define protocol_Gameplay_ObjectCreatePlayer 360
#define protocol_Gameplay_ObjectJoinTeam 361
#define protocol_Gameplay_ObjectLeaveTeam 362
#define protocol_Gameplay_ObjectWeaponCooldown 363
#define protocol_Gameplay_ObjectWeaponEnergy 364
#define protocol_Gameplay_ObjectRespawn 365
#define protocol_Gameplay_ObjectDie 366
#define protocol_GameplayMAX 399

View File

@ -74,11 +74,14 @@ namespace DanBias
private:
void ParseProtocol ( Oyster::Network::CustomNetProtocol& p, DanBias::GameClient* c );
void Gameplay_PlayerMovement ( GameLogic::Protocol_PlayerMovement& p, DanBias::GameClient* c );
void Gameplay_PlayerMovementRight ( DanBias::GameClient* c );
void Gameplay_PlayerMovementLeft ( DanBias::GameClient* c );
void Gameplay_PlayerMovementBack ( DanBias::GameClient* c );
void Gameplay_PlayerMovementForth ( DanBias::GameClient* c );
void Gameplay_PlayerJump ( DanBias::GameClient* c );
void Gameplay_PlayerLookDir ( GameLogic::Protocol_PlayerLook& p, DanBias::GameClient* c );
void Gameplay_PlayerChangeWeapon ( GameLogic::Protocol_PlayerChangeWeapon& p, DanBias::GameClient* c );
void Gameplay_PlayerShot ( GameLogic::Protocol_PlayerShot& p, DanBias::GameClient* c );
void Gameplay_PlayerJump ( GameLogic::Protocol_PlayerJump& p, DanBias::GameClient* c );
void Gameplay_ObjectPickup ( GameLogic::Protocol_ObjectPickup& p, DanBias::GameClient* c );
void Gameplay_ObjectDamage ( GameLogic::Protocol_ObjectDamage& p, DanBias::GameClient* c );
void Gameplay_ObjectPosition ( GameLogic::Protocol_ObjectPosition& p, DanBias::GameClient* c );

View File

@ -85,7 +85,7 @@ namespace DanBias
void GameSession::ObjectMove(GameLogic::IObjectData* movedObject)
{
float dt = GameSession::gameSession->networkTimer.getElapsedSeconds();
//float dt = (float)GameSession::gameSession->networkTimer.getElapsedSeconds();
//Duh... This was causing alot of problems, it's in the wrong place...
//Need to figure out where to put this frame locker.
//We only need to send network packages when necessary, ie not 120 times per frame.
@ -93,16 +93,24 @@ namespace DanBias
//graphics update (60 fps) on the client side. To send more than this would be lost
//bandwidth.
//if( dt >= GameSession::gameSession->networkFrameTime )
{
GameSession::gameSession->networkTimer.reset();
GameLogic::IObjectData* obj = movedObject;
int id = obj->GetID();
Protocol_ObjectPosition p(obj->GetOrientation(), id);
//<<<<<<< HEAD
// {
// GameSession::gameSession->networkTimer.reset();
//
// GameLogic::IObjectData* obj = movedObject;
//
// int id = obj->GetID();
// Protocol_ObjectPosition p(obj->GetOrientation(), id);
// GameSession::gameSession->Send(p.GetProtocol());
// }
//=======
//{
// GameSession::gameSession->networkTimer.reset();
int id = movedObject->GetID();
//Protocol_ObjectPosition p(movedObject->GetPosition(), id);
Protocol_ObjectPositionRotation p(movedObject->GetPosition(), movedObject->GetRotation(), id);
GameSession::gameSession->Send(p.GetProtocol());
}
//}
}
void GameSession::ObjectDisabled( GameLogic::IObjectData* movedObject, float seconds )
{
@ -119,43 +127,64 @@ namespace DanBias
switch (p[0].value.netShort)
{
case protocol_Gameplay_PlayerMovement: this->Gameplay_PlayerMovement ( Protocol_PlayerMovement (p), c );
case protocol_Gameplay_PlayerMovementBackward: this->Gameplay_PlayerMovementBack ( c );
break;
case protocol_Gameplay_PlayerLookDir: this->Gameplay_PlayerLookDir ( Protocol_PlayerLook (p), c );
case protocol_Gameplay_PlayerMovementForward: this->Gameplay_PlayerMovementForth ( c );
break;
case protocol_Gameplay_PlayerChangeWeapon: this->Gameplay_PlayerChangeWeapon ( Protocol_PlayerChangeWeapon (p), c );
case protocol_Gameplay_PlayerMovementLeft: this->Gameplay_PlayerMovementLeft ( c );
break;
case protocol_Gameplay_PlayerShot: this->Gameplay_PlayerShot ( Protocol_PlayerShot (p), c );
case protocol_Gameplay_PlayerMovementRight: this->Gameplay_PlayerMovementRight ( c );
break;
case protocol_Gameplay_PlayerJump: this->Gameplay_PlayerJump ( Protocol_PlayerJump (p), c );
case protocol_Gameplay_PlayerJump: this->Gameplay_PlayerJump ( c );
break;
case protocol_Gameplay_ObjectPickup: this->Gameplay_ObjectPickup ( Protocol_ObjectPickup (p), c );
case protocol_Gameplay_PlayerLookDir: this->Gameplay_PlayerLookDir ( Protocol_PlayerLook (p), c );
break;
case protocol_Gameplay_ObjectDamage: this->Gameplay_ObjectDamage ( Protocol_ObjectDamage (p), c );
case protocol_Gameplay_PlayerChangeWeapon: this->Gameplay_PlayerChangeWeapon ( Protocol_PlayerChangeWeapon (p), c );
break;
case protocol_Gameplay_ObjectPosition: this->Gameplay_ObjectPosition ( Protocol_ObjectPosition (p), c );
case protocol_Gameplay_PlayerShot: this->Gameplay_PlayerShot ( Protocol_PlayerShot (p), c );
break;
case protocol_Gameplay_ObjectEnabled: this->Gameplay_ObjectEnabled ( Protocol_ObjectEnable (p), c );
case protocol_Gameplay_ObjectPickup: this->Gameplay_ObjectPickup ( Protocol_ObjectPickup (p), c );
break;
case protocol_Gameplay_ObjectDisabled: this->Gameplay_ObjectDisabled ( Protocol_ObjectDisable (p), c );
case protocol_Gameplay_ObjectDamage: this->Gameplay_ObjectDamage ( Protocol_ObjectDamage (p), c );
break;
case protocol_Gameplay_ObjectCreate: this->Gameplay_ObjectCreate ( Protocol_ObjectCreate (p), c );
case protocol_Gameplay_ObjectPosition: this->Gameplay_ObjectPosition ( Protocol_ObjectPosition (p), c );
break;
case protocol_General_Status: this->General_Status ( Protocol_General_Status (p), c );
case protocol_Gameplay_ObjectEnabled: this->Gameplay_ObjectEnabled ( Protocol_ObjectEnable (p), c );
break;
case protocol_General_Text: this->General_Text ( Protocol_General_Text (p), c );
case protocol_Gameplay_ObjectDisabled: this->Gameplay_ObjectDisabled ( Protocol_ObjectDisable (p), c );
break;
case protocol_Gameplay_ObjectCreate: this->Gameplay_ObjectCreate ( Protocol_ObjectCreate (p), c );
break;
case protocol_General_Status: this->General_Status ( Protocol_General_Status (p), c );
break;
case protocol_General_Text: this->General_Text ( Protocol_General_Text (p), c );
break;
}
}
void GameSession::Gameplay_PlayerMovement ( Protocol_PlayerMovement& p, DanBias::GameClient* c )
void GameSession::Gameplay_PlayerMovementBack ( DanBias::GameClient* c )
{
if(p.bForward) c->GetPlayer()->Move(GameLogic::PLAYER_MOVEMENT_FORWARD);
if(p.bBackward) c->GetPlayer()->Move(GameLogic::PLAYER_MOVEMENT_BACKWARD);
if(p.bLeft) c->GetPlayer()->Move(GameLogic::PLAYER_MOVEMENT_LEFT);
if(p.bRight) c->GetPlayer()->Move(GameLogic::PLAYER_MOVEMENT_RIGHT);
c->GetPlayer()->Move(GameLogic::PLAYER_MOVEMENT_BACKWARD);
}
void GameSession::Gameplay_PlayerLookDir ( Protocol_PlayerLook& p, DanBias::GameClient* c )
void GameSession::Gameplay_PlayerMovementForth ( DanBias::GameClient* c )
{
c->GetPlayer()->Move(GameLogic::PLAYER_MOVEMENT_FORWARD);
}
void GameSession::Gameplay_PlayerMovementLeft ( DanBias::GameClient* c )
{
c->GetPlayer()->Move(GameLogic::PLAYER_MOVEMENT_LEFT);
}
void GameSession::Gameplay_PlayerMovementRight ( DanBias::GameClient* c )
{
c->GetPlayer()->Move(GameLogic::PLAYER_MOVEMENT_RIGHT);
}
void GameSession::Gameplay_PlayerJump ( DanBias::GameClient* c )
{
c->GetPlayer()->Move(GameLogic::PLAYER_MOVEMENT_JUMP);
}
void GameSession::Gameplay_PlayerLookDir ( Protocol_PlayerLook& p, DanBias::GameClient* c )
{
Oyster::Math3D::Float4 lookDir;
lookDir.x = p.lookDirX;
@ -164,46 +193,44 @@ namespace DanBias
lookDir.w = p.deltaX;
c->GetPlayer()->Rotate(lookDir);
}
void GameSession::Gameplay_PlayerChangeWeapon ( Protocol_PlayerChangeWeapon& p, DanBias::GameClient* c )
void GameSession::Gameplay_PlayerChangeWeapon ( Protocol_PlayerChangeWeapon& p, DanBias::GameClient* c )
{
}
void GameSession::Gameplay_PlayerShot ( Protocol_PlayerShot& p, DanBias::GameClient* c )
void GameSession::Gameplay_PlayerShot ( Protocol_PlayerShot& p, DanBias::GameClient* c )
{
if(p.secondaryPressed) c->GetPlayer()->UseWeapon(GameLogic::WEAPON_USE_SECONDARY_PRESS);
if(p.primaryPressed) c->GetPlayer()->UseWeapon(GameLogic::WEAPON_USE_PRIMARY_PRESS);
if(p.utilityPressed) c->GetPlayer()->UseWeapon(GameLogic::WEAPON_USE_UTILLITY_PRESS);
}
void GameSession::Gameplay_PlayerJump ( Protocol_PlayerJump& p, DanBias::GameClient* c )
{
if(p.hasJumped) c->GetPlayer()->Move(GameLogic::PLAYER_MOVEMENT_JUMP);
}
void GameSession::Gameplay_ObjectPickup ( Protocol_ObjectPickup& p, DanBias::GameClient* c )
void GameSession::Gameplay_ObjectPickup ( Protocol_ObjectPickup& p, DanBias::GameClient* c )
{
}
void GameSession::Gameplay_ObjectDamage ( Protocol_ObjectDamage& p, DanBias::GameClient* c )
void GameSession::Gameplay_ObjectDamage ( Protocol_ObjectDamage& p, DanBias::GameClient* c )
{
}
void GameSession::Gameplay_ObjectPosition ( Protocol_ObjectPosition& p, DanBias::GameClient* c )
void GameSession::Gameplay_ObjectPosition ( Protocol_ObjectPosition& p, DanBias::GameClient* c )
{
}
void GameSession::Gameplay_ObjectEnabled ( Protocol_ObjectEnable& p, DanBias::GameClient* c )
void GameSession::Gameplay_ObjectEnabled ( Protocol_ObjectEnable& p, DanBias::GameClient* c )
{
}
void GameSession::Gameplay_ObjectDisabled ( Protocol_ObjectDisable& p, DanBias::GameClient* c )
void GameSession::Gameplay_ObjectDisabled ( Protocol_ObjectDisable& p, DanBias::GameClient* c )
{
}
void GameSession::Gameplay_ObjectCreate ( Protocol_ObjectCreate& p, DanBias::GameClient* c )
void GameSession::Gameplay_ObjectCreate ( Protocol_ObjectCreate& p, DanBias::GameClient* c )
{
}
void GameSession::General_Status ( Protocol_General_Status& p, DanBias::GameClient* c )
void GameSession::General_Status ( Protocol_General_Status& p, DanBias::GameClient* c )
{
switch (p.status)
{
@ -227,7 +254,7 @@ namespace DanBias
break;
}
}
void GameSession::General_Text ( Protocol_General_Text& p, DanBias::GameClient* c )
void GameSession::General_Text ( Protocol_General_Text& p, DanBias::GameClient* c )
{
printf("Message recieved from (%i):\t %s\n", c->GetClient()->GetID(), p.text.c_str());
}

View File

@ -149,10 +149,30 @@
<ClCompile Include="EventHandler\EventButtonCollection.cpp" />
<ClCompile Include="EventHandler\EventHandler.cpp" />
<ClCompile Include="Packing\Packing.cpp" />
<ClCompile Include="Resource\Loaders\ByteLoader.cpp" />
<ClCompile Include="Resource\Loaders\CustomLoader.cpp" />
<ClCompile Include="Resource\OResourceHandler.cpp" />
<ClCompile Include="Resource\OResource.cpp" />
<ClCompile Include="Resource\Loaders\ByteLoader.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="Resource\Loaders\CustomLoader.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="Resource\OResourceHandler.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="Resource\OResource.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="Resource\ResourceManager.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
@ -177,8 +197,18 @@
<ClInclude Include="PostBox\IPostBox.h" />
<ClInclude Include="PostBox\PostBox.h" />
<ClInclude Include="Queue.h" />
<ClInclude Include="Resource\OysterResource.h" />
<ClInclude Include="Resource\OResource.h" />
<ClInclude Include="Resource\OysterResource.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="Resource\OResource.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
</ClInclude>
<ClInclude Include="Resource\ResourceManager.h">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">false</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</ExcludedFromBuild>

View File

@ -13,6 +13,7 @@ namespace Oyster
typedef void* HRESOURCE;
typedef char HBYTE;
typedef HBYTE* HBYTEARRAY;
/** Typedef on a fuction required for custom unloading */
typedef void(*UnloadFunction)(void* loadedData);

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.