Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 167 vs 168 for /trunk/Source Code/Scenes/NetworkScene/NetworkScene.cpp

Diff revisions: vs.
  @@ -21,10 +21,10 @@
21 21 }
22 22
23 23 void NetworkScene::processInput(){
24 - if(state()->_angleLR) renderState()->getCamera()->RotateX(state()->_angleLR);
25 - if(state()->_angleUD) renderState()->getCamera()->RotateY(state()->_angleUD);
26 - if(state()->_moveFB) renderState()->getCamera()->MoveForward(state()->_moveFB /5);
27 - if(state()->_moveLR) renderState()->getCamera()->MoveStrafe(state()->_moveLR /5);
24 + if(state()._angleLR) renderState().getCamera().rotateYaw(state()._angleLR);
25 + if(state()._angleUD) renderState().getCamera().rotatePitch(state()._angleUD);
26 + if(state()._moveFB) renderState().getCamera().moveForward(state()._moveFB);
27 + if(state()._moveLR) renderState().getCamera().moveStrafe(state()._moveLR);
28 28 }
29 29
30 30 void NetworkScene::processTasks(const U32 time){
  @@ -67,17 +67,17 @@
67 67 return Scene::preLoad();
68 68 }
69 69
70 - bool NetworkScene::load(const std::string& name){
70 + bool NetworkScene::load(const std::string& name, CameraManager* const cameraMgr){
71 71 std::string ipAdress = _paramHandler.getParam<std::string>("serverAddress");
72 72 std::string port = "443";
73 73 ASIOImpl::getInstance().init(ipAdress,port);
74 - ///Load scene resources
75 - SCENE_LOAD(name,true,true);
74 + //Load scene resources
75 + bool loadState = SCENE_LOAD(name,cameraMgr,true,true);
76 76
77 77 _paramHandler.setParam("serverResponse",std::string("waiting"));
78 78 addDefaultLight();
79 79 addDefaultSky();
80 - renderState()->getCamera()->setEye(vec3<F32>(0,30,-30));
80 + renderState().getCamera().setEye(vec3<F32>(0,30,-30));
81 81
82 82 return loadState;
83 83 }
  @@ -123,28 +123,28 @@
123 123 vec3<F32>(0.6f,0.2f,0.2f),
124 124 "Elapsed time: %5.0f",GETTIME());
125 125
126 - gui.addText("serverMessage", vec2<I32>(renderState()->cachedResolution().width / 4.0f,
127 - renderState()->cachedResolution().height / 1.6f),
126 + gui.addText("serverMessage", vec2<I32>(renderState().cachedResolution().width / 4.0f,
127 + renderState().cachedResolution().height / 1.6f),
128 128 Font::DIVIDE_DEFAULT,
129 129 vec3<F32>(0.5f,0.5f,0.2f),
130 130 "Server says: %s", "<< nothing yet >>");
131 131 gui.addText("statusText",
132 - vec2<I32>(renderState()->cachedResolution().width / 3.0f,
133 - renderState()->cachedResolution().height / 1.2f),
132 + vec2<I32>(renderState().cachedResolution().width / 3.0f,
133 + renderState().cachedResolution().height / 1.2f),
134 134 Font::DIVIDE_DEFAULT,
135 135 vec3<F32>(0.2f,0.5f,0.2f),
136 136 "");
137 137
138 - gui.addButton("getPing", "ping me", vec2<I32>(60 , renderState()->cachedResolution().height/1.1f),
138 + gui.addButton("getPing", "ping me", vec2<I32>(60 , renderState().cachedResolution().height/1.1f),
139 139 vec2<U32>(100,25),vec3<F32>(0.6f,0.6f,0.6f),
140 140 DELEGATE_BIND(&NetworkScene::test,this));
141 - gui.addButton("disconnect", "disconnect", vec2<I32>(180 , renderState()->cachedResolution().height/1.1f),
141 + gui.addButton("disconnect", "disconnect", vec2<I32>(180 , renderState().cachedResolution().height/1.1f),
142 142 vec2<U32>(100,25),vec3<F32>(0.5f,0.5f,0.5f),
143 143 DELEGATE_BIND(&NetworkScene::disconnect,this));
144 - gui.addButton("connect", "connect", vec2<I32>(300 , renderState()->cachedResolution().height/1.1f),
144 + gui.addButton("connect", "connect", vec2<I32>(300 , renderState().cachedResolution().height/1.1f),
145 145 vec2<U32>(100,25),vec3<F32>(0.65f,0.65f,0.65f),
146 146 DELEGATE_BIND(&NetworkScene::connect,this));
147 - gui.addButton("patch", "patch", vec2<I32>(420 , renderState()->cachedResolution().height/1.1f),
147 + gui.addButton("patch", "patch", vec2<I32>(420 , renderState().cachedResolution().height/1.1f),
148 148 vec2<U32>(100,25),vec3<F32>(0.65f,0.65f,0.65f),
149 149 DELEGATE_BIND(&NetworkScene::checkPatches,this));
150 150