Subversion Repository Public Repository

Divide-Framework

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

Diff Revisions 330 vs 331 for /trunk/Source Code/Scenes/TenisScene/TenisScene.cpp

Diff revisions: vs.
  @@ -32,7 +32,8 @@
32 32 void TenisScene::processGUI(const U64 deltaTime){
33 33 D32 FpsDisplay = 0.7;
34 34 if (_guiTimers[0] >= FpsDisplay){
35 - _GUI->modifyText("fpsDisplay", "FPS: %3.0f. FrameTime: %3.1f", ApplicationTimer::getInstance().getFps(), ApplicationTimer::getInstance().getFrameTime());
35 + _GUI->modifyText("fpsDisplay", "FPS: %3.0f. FrameTime: %3.1f",
36 + ApplicationTimer::getInstance().getFps(), ApplicationTimer::getInstance().getFrameTime());
36 37 _GUI->modifyText("RenderBinCount", "Number of items in Render Bin: %d", GFX_RENDER_BIN_SIZE);
37 38 _guiTimers[0] = 0.0;
38 39 }
  @@ -70,7 +71,9 @@
70 71 _applySideImpulse = false;
71 72 _sideImpulseFactor = 0;
72 73 WriteLock w_lock(_gameLock);
73 - _ballSGN->getComponent<PhysicsComponent>()->setPosition(vec3<F32>((random(0,10) >= 5) ? 3.0f : -3.0f, 0.2f, _lostTeam1 ? -7.0f : 7.0f));
74 + _ballSGN->getComponent<PhysicsComponent>()->setPosition(vec3<F32>((random(0,10) >= 5) ? 3.0f : -3.0f,
75 + 0.2f,
76 + _lostTeam1 ? -7.0f : 7.0f));
74 77 _directionTeam1ToTeam2 = !_lostTeam1;
75 78 _lostTeam1 = false;
76 79 s_gameStarted = true;
  @@ -285,22 +288,22 @@
285 288 player[2]->setSelectable(true);
286 289 player[3]->setSelectable(true);
287 290
288 - _aiPlayer1 = New AI::AIEntity(player[0]->getComponent<PhysicsComponent>()->getPosition(), "Player1");
289 - _aiPlayer2 = New AI::AIEntity(player[1]->getComponent<PhysicsComponent>()->getPosition(), "Player2");
290 - _aiPlayer3 = New AI::AIEntity(player[2]->getComponent<PhysicsComponent>()->getPosition(), "Player3");
291 - _aiPlayer4 = New AI::AIEntity(player[3]->getComponent<PhysicsComponent>()->getPosition(), "Player4");
291 + _aiPlayer1 = MemoryManager_NEW AI::AIEntity(player[0]->getComponent<PhysicsComponent>()->getPosition(), "Player1");
292 + _aiPlayer2 = MemoryManager_NEW AI::AIEntity(player[1]->getComponent<PhysicsComponent>()->getPosition(), "Player2");
293 + _aiPlayer3 = MemoryManager_NEW AI::AIEntity(player[2]->getComponent<PhysicsComponent>()->getPosition(), "Player3");
294 + _aiPlayer4 = MemoryManager_NEW AI::AIEntity(player[3]->getComponent<PhysicsComponent>()->getPosition(), "Player4");
292 295 _aiPlayer1->addSensor(AI::VISUAL_SENSOR);
293 296 _aiPlayer2->addSensor(AI::VISUAL_SENSOR);
294 297 _aiPlayer3->addSensor(AI::VISUAL_SENSOR);
295 298 _aiPlayer4->addSensor(AI::VISUAL_SENSOR);
296 299
297 - _aiPlayer1->addAISceneImpl(New AI::TenisSceneAISceneImpl(_ballSGN));
298 - _aiPlayer2->addAISceneImpl(New AI::TenisSceneAISceneImpl(_ballSGN));
299 - _aiPlayer3->addAISceneImpl(New AI::TenisSceneAISceneImpl(_ballSGN));
300 - _aiPlayer4->addAISceneImpl(New AI::TenisSceneAISceneImpl(_ballSGN));
300 + _aiPlayer1->addAISceneImpl(MemoryManager_NEW AI::TenisSceneAISceneImpl(_ballSGN));
301 + _aiPlayer2->addAISceneImpl(MemoryManager_NEW AI::TenisSceneAISceneImpl(_ballSGN));
302 + _aiPlayer3->addAISceneImpl(MemoryManager_NEW AI::TenisSceneAISceneImpl(_ballSGN));
303 + _aiPlayer4->addAISceneImpl(MemoryManager_NEW AI::TenisSceneAISceneImpl(_ballSGN));
301 304
302 - _team1 = New AI::AITeam(1);
303 - _team2 = New AI::AITeam(2);
305 + _team1 = MemoryManager_NEW AI::AITeam(1);
306 + _team2 = MemoryManager_NEW AI::AITeam(2);
304 307
305 308 if(state || continueOnErrors){
306 309 state = AI::AIManager::getInstance().registerEntity(0, _aiPlayer1);
  @@ -316,10 +319,10 @@
316 319 }
317 320 if(state || continueOnErrors){
318 321 //----------------------- AI controlled units (NPC's) ---------------------//
319 - _player1 = New NPC(player[0], _aiPlayer1);
320 - _player2 = New NPC(player[1], _aiPlayer2);
321 - _player3 = New NPC(player[2], _aiPlayer3);
322 - _player4 = New NPC(player[3], _aiPlayer4);
322 + _player1 = MemoryManager_NEW NPC(player[0], _aiPlayer1);
323 + _player2 = MemoryManager_NEW NPC(player[1], _aiPlayer2);
324 + _player3 = MemoryManager_NEW NPC(player[2], _aiPlayer3);
325 + _player4 = MemoryManager_NEW NPC(player[3], _aiPlayer4);
323 326
324 327 _player1->setMovementSpeed(1.45f);
325 328 _player2->setMovementSpeed(1.5f);
  @@ -338,16 +341,16 @@
338 341 AI::AIManager::getInstance().unregisterEntity(_aiPlayer2);
339 342 AI::AIManager::getInstance().unregisterEntity(_aiPlayer3);
340 343 AI::AIManager::getInstance().unregisterEntity(_aiPlayer4);
341 - MemoryManager::SAFE_DELETE( _aiPlayer1 );
342 - MemoryManager::SAFE_DELETE( _aiPlayer2 );
343 - MemoryManager::SAFE_DELETE( _aiPlayer3 );
344 - MemoryManager::SAFE_DELETE( _aiPlayer4 );
345 - MemoryManager::SAFE_DELETE( _player1 );
346 - MemoryManager::SAFE_DELETE( _player2 );
347 - MemoryManager::SAFE_DELETE( _player3 );
348 - MemoryManager::SAFE_DELETE( _player4 );
349 - MemoryManager::SAFE_DELETE( _team1 );
350 - MemoryManager::SAFE_DELETE( _team2 );
344 + MemoryManager::DELETE( _aiPlayer1 );
345 + MemoryManager::DELETE( _aiPlayer2 );
346 + MemoryManager::DELETE( _aiPlayer3 );
347 + MemoryManager::DELETE( _aiPlayer4 );
348 + MemoryManager::DELETE( _player1 );
349 + MemoryManager::DELETE( _player2 );
350 + MemoryManager::DELETE( _player3 );
351 + MemoryManager::DELETE( _player4 );
352 + MemoryManager::DELETE( _team1 );
353 + MemoryManager::DELETE( _team2 );
351 354 return Scene::deinitializeAI(continueOnErrors);
352 355 }
353 356