[1378] | 1 | #pragma once
|
---|
| 2 | #include "scene.h"
|
---|
| 3 | #include <string>
|
---|
| 4 | #include <list>
|
---|
| 5 | #include <vector>
|
---|
| 6 | #include "UserContactReport.h"
|
---|
| 7 | #include "UserTriggerReport.h"
|
---|
| 8 | #include "UserNotify.h"
|
---|
| 9 | #include "fmod.h"
|
---|
| 10 | #include "Bullet.h"
|
---|
| 11 | #include "Weapon.h"
|
---|
| 12 |
|
---|
| 13 | #define SPTR boost::shared_ptr
|
---|
| 14 |
|
---|
| 15 | class UserPlayer;
|
---|
| 16 | class Terrain;
|
---|
| 17 | class HUD;
|
---|
| 18 | class Ocean;
|
---|
| 19 | class SkyBox;
|
---|
| 20 | class Player;
|
---|
| 21 | class Goodie;
|
---|
| 22 | class SoundNode;
|
---|
| 23 |
|
---|
| 24 | class GameScene :
|
---|
| 25 | public Scene
|
---|
| 26 | {
|
---|
| 27 | public:
|
---|
| 28 | GameScene(void);
|
---|
| 29 | ~GameScene(void);
|
---|
| 30 |
|
---|
| 31 | virtual void initScene(GameManager &_manager);
|
---|
| 32 | void loadGame(std::string filename);
|
---|
| 33 | virtual void clearScene();
|
---|
| 34 | void setMaxEnemyCount(int maxEnemyCount);
|
---|
| 35 |
|
---|
| 36 | virtual void renderScene(float fElapsedTime);
|
---|
| 37 |
|
---|
| 38 | Terrain* getTerrain();
|
---|
| 39 | HUD* getHUD();
|
---|
| 40 | SkyBox *skybox;
|
---|
| 41 |
|
---|
| 42 | //Factory Stuff
|
---|
| 43 | static const int NODE_TERRAIN = 128;
|
---|
| 44 | static const int NODE_USERPLAYER = 256;
|
---|
| 45 | static const int NODE_AIPLAYER = 512;
|
---|
| 46 | static const int NODE_SIMPLEWEAPON = 1024;
|
---|
| 47 | static const int NODE_SIMPLEBULLET = 2048;
|
---|
| 48 | static const int NODE_SKYBOX = 4096;
|
---|
| 49 | static const int NODE_GOODIE = 8192;
|
---|
| 50 | static const int NODE_UNIVERSALWEAPON = 16384;
|
---|
| 51 | static const int NODE_OCEAN = 32768;
|
---|
| 52 | static const int NODE_HUD = 65536;
|
---|
| 53 | virtual Node* createNode(int type);
|
---|
| 54 | virtual Node* createNode(int type, Node &father);
|
---|
| 55 | virtual Node* createNode(int type, bool addDefaultRenderer);
|
---|
| 56 | virtual Node* createNode(int type, Node &father, bool addDefaultRenderer);
|
---|
| 57 | virtual Node* createNode(int type, Node &father, bool addDefaultRenderer, bool isReference);
|
---|
| 58 |
|
---|
| 59 | //Game Related
|
---|
| 60 | std::list<SPTR<Node> > playerList;
|
---|
| 61 | std::list<SPTR<Node> > goodieList;
|
---|
| 62 | std::list<SPTR<Node> > bulletList;
|
---|
| 63 | std::list<SPTR<Node> >* getPlayerList();
|
---|
| 64 | std::list<SPTR<Node> >* getGoodieList();
|
---|
| 65 |
|
---|
| 66 | UserPlayer *player;
|
---|
| 67 |
|
---|
| 68 | //PhysicStuff
|
---|
| 69 | void connectMaterialIds(int physicId, int xmlId);
|
---|
| 70 | int getPhysicMaterialId(int xmlId);
|
---|
| 71 | std::vector<int> materialXMLVector;
|
---|
| 72 | std::vector<int> materialPhysicVector;
|
---|
| 73 |
|
---|
| 74 | //GoodieStuff
|
---|
| 75 | float getRandomTime(float timeBase, float timeVariation);
|
---|
| 76 |
|
---|
| 77 | static const int TRIGGER_IMPACTPLAYER = 100;
|
---|
| 78 | static const int TRIGGER_IMPACTTERRAIN = 101;
|
---|
| 79 | static const int TRIGGER_IMPACTGOODIE = 102;
|
---|
| 80 | static const int TRIGGER_IMPACTOTHER = 103;
|
---|
| 81 | static const int TRIGGER_GOODIECATCH = 104;
|
---|
| 82 | static const int TRIGGER_IMPACTFIRE = 105;
|
---|
| 83 | static const int TRIGGER_IMPACTICE = 106;
|
---|
| 84 | static const int TRIGGER_CREATEPLAYER = 107;
|
---|
| 85 | static const int TRIGGER_CREATEMOREPLAYER= 108;
|
---|
| 86 |
|
---|
| 87 | virtual void cleanUpScene();
|
---|
| 88 | Bullet* cloneBulletFromReference(int type);
|
---|
| 89 | Weapon* cloneWeaponFromReference(int type);
|
---|
| 90 |
|
---|
| 91 | float getTerrainHeight(Vector v);
|
---|
| 92 | bool showFPS;
|
---|
| 93 |
|
---|
| 94 | //Reingehacktes zeug...rauslöschen
|
---|
| 95 | /*void toggleRaytraceRenderer();
|
---|
| 96 | Node* glasNode;
|
---|
| 97 | bool usingRaytracer;
|
---|
| 98 | Renderer* simpleRenderer;
|
---|
| 99 | Renderer* raytraceRenderer;*/
|
---|
| 100 |
|
---|
| 101 | void setChallengeDescription(std::string _description, float _descDuration);
|
---|
| 102 | bool aiPlayerFireEnable;
|
---|
| 103 |
|
---|
| 104 |
|
---|
| 105 | friend class GameSceneLoader;
|
---|
| 106 |
|
---|
| 107 | bool alreadyUsed;
|
---|
| 108 | void reduceHealthOnPlayers(Bullet* bullet);
|
---|
| 109 |
|
---|
[1382] | 110 | bool preparepaused;
|
---|
| 111 | bool currentlypaused;
|
---|
| 112 |
|
---|
[1378] | 113 | void hasWon();
|
---|
| 114 | protected:
|
---|
| 115 | SoundNode* sadSound;
|
---|
| 116 | SoundNode* happySound;
|
---|
| 117 |
|
---|
| 118 | bool resultVisible;
|
---|
| 119 |
|
---|
| 120 | bool won;
|
---|
| 121 | bool descSet;
|
---|
| 122 | std::string description;
|
---|
| 123 | std::string enemyModel; //Filename of the enemy for the AIPlayer creation!
|
---|
| 124 | float descDuration;
|
---|
| 125 |
|
---|
| 126 | bool recalcTransformations; //To Froze Screen when loosing
|
---|
| 127 |
|
---|
| 128 | Terrain *terrain;
|
---|
| 129 | HUD *hud;
|
---|
| 130 | Ocean *ocean;
|
---|
| 131 |
|
---|
| 132 | int cameraFixedCount;
|
---|
| 133 | int maxEnemyCount;
|
---|
| 134 |
|
---|
| 135 | Vector lookAtPoint;
|
---|
| 136 | Vector viewPoint;
|
---|
| 137 | Vector dLookAtPoint;
|
---|
| 138 | Vector dViewPoint;
|
---|
| 139 |
|
---|
| 140 | Object3d *obj;
|
---|
| 141 | float cnt;
|
---|
| 142 |
|
---|
| 143 | //Scene Description
|
---|
| 144 | std::string gameName;
|
---|
| 145 | float gameDuration;
|
---|
| 146 | int gameMode;
|
---|
| 147 |
|
---|
| 148 | //Reference Lists
|
---|
| 149 | std::vector<SPTR<Node> > refWeaponVector; //List of all Weapons
|
---|
| 150 | std::vector<SPTR<Node> > refBulletVector; //List of all Bullets
|
---|
| 151 |
|
---|
| 152 | void updateGameFirst();
|
---|
| 153 | void updateGameSecond();
|
---|
| 154 |
|
---|
| 155 | virtual void executeTrigger(SPTR<Trigger> trigger);
|
---|
| 156 |
|
---|
| 157 | UserContactReport userContactReport;
|
---|
| 158 | UserTriggerReport userTriggerReport;
|
---|
| 159 | UserNotify userNotify;
|
---|
| 160 |
|
---|
| 161 | //Backgroundmusic Stuff
|
---|
| 162 | /*FSOUND_STREAM *bgMusicStream;
|
---|
| 163 | int bgSoundChannel;
|
---|
| 164 | float bgSoundVolume;
|
---|
| 165 |
|
---|
| 166 | void setBackgroundSound(std::string filename);
|
---|
| 167 | void setBackgroundSoundVolume(float vol);
|
---|
| 168 | void playBackgroundSound();*/
|
---|
| 169 | //virtual void updateSoundNodeVolume();
|
---|
| 170 |
|
---|
| 171 | //fly around cam:
|
---|
| 172 | bool flyCamEnabled;
|
---|
| 173 |
|
---|
| 174 | void initWin();
|
---|
| 175 | void initLose();
|
---|
| 176 | float resultShowingTimer;
|
---|
| 177 |
|
---|
[1403] | 178 | bool ignoreKeys;
|
---|
[1378] | 179 | };
|
---|