diff Engine/Spells/Spells.cpp @ 2541:a902abdfc7f2

1. Renamed class Game to class Engine. 2. Separated game logic as state of FSM from game logic as engine. 3. Found out that many UI screen initializers were optimized away, intially they all returned newly created window as separate object like it is done in CharacterUI_Initialize.
author a.parshin
date Sun, 10 May 2015 01:29:11 +0200
parents a77c34acdbc9
children 3121fb54a110
line wrap: on
line diff
--- a/Engine/Spells/Spells.cpp	Sat May 09 12:55:58 2015 +0200
+++ b/Engine/Spells/Spells.cpp	Sun May 10 01:29:11 2015 +0200
@@ -4,7 +4,8 @@
 
 #define _CRT_SECURE_NO_WARNINGS
 #include <stdlib.h>
-#include "../ErrorHandling.h"
+
+#include "Engine/Engine.h"
 
 #include "Spells.h"
 #include "Engine/Graphics/Overlays.h"
@@ -18,7 +19,6 @@
 #include "Engine/Graphics/Indoor.h"
 #include "Media/Audio/AudioPlayer.h"
 #include "Engine/Objects/Actor.h"
-#include "../Game.h"
 #include "stru6.h"
 
 
@@ -565,10 +565,10 @@
         if (pParty->pPlayers[i].IsWeak())
           return;
       pParty->pPartyBuffs[PARTY_BUFF_HASTE].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 * 128) * 0.033333335), skillMasteryPlusOne, 0, 0, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
       pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);//звук алтаря
       return;
     case SPELL_AIR_SHIELD:
@@ -602,10 +602,10 @@
           uSkill = 9;
           break;
       }
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
       v36 = pParty->uTimePlayed + (signed int)(signed __int64)((double)(v9 << 7) * 0.033333335);
       pParty->pPartyBuffs[uSkill].Apply(v36, skillMasteryPlusOne, v60, 0, 0);
       pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
@@ -615,10 +615,10 @@
         v38 = 600 * uSkill;
       else
         v38 = 60 * uSkill;
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
       v39 = (signed __int64)((double)(v38 << 7) * 0.033333335);
       v36 = pParty->uTimePlayed + v39;
       pParty->pPartyBuffs[PARTY_BUFF_IMMOLATION].Apply(v36, skillMasteryPlusOne, uSkill, 0, 0);
@@ -667,10 +667,10 @@
         uSkill = PARTY_BUFF_RESIST_BODY;
         break;
       }
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
       pParty->pPartyBuffs[uSkill].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)a6_4 * 4.2666669), skillMasteryPlusOne, v60, 0, 0);
       pAudioPlayer->PlaySound((SoundID)word_4EE088_sound_ids[uSpellID], 0, 0, fromx, fromy, 0, 0, 0);
       return;
@@ -690,10 +690,10 @@
         v43 = 4 * uSkill + 10;
         break;
       }
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
-      pGame->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 0);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 1);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 2);
+      pEngine->pStru6Instance->SetPlayerBuffAnim(uSpellID, 3);
       v39 = (signed __int64)((double)(v42 << 7) * 0.033333335);
       v36 = pParty->uTimePlayed + v39;
       pParty->pPartyBuffs[PARTY_BUFF_DAY_OF_GODS].Apply(v36, skillMasteryPlusOne, v43, 0, 0);