source: GTP/trunk/App/Games/Jungle_Rumble/src/ResourceManager.h @ 1378

Revision 1378, 1.4 KB checked in by giegl, 18 years ago (diff)

GTPD - Jungle Rumble - integrate into GTP SVN structure

Line 
1#pragma once
2#include <boost/shared_ptr.hpp>
3#include "Node.h"
4#include "Renderer.h"
5#include "Object3d.h"
6#include "Vector.h"
7#include "fmod.h"
8//
9#include "Scene.h"
10
11#define SPTR boost::shared_ptr
12
13class ResourceManager
14{
15
16public:
17        ResourceManager(void);
18        ~ResourceManager(void);
19       
20        void cleanUpResources(bool endOfGame);
21
22        //Free Used Resources of Node
23        void freeUsedResources(SPTR<Node> node);
24        void freeUsedResources(SPTR<Renderer> renderer);
25        void setGameManager(GameManager *manager);
26
27        void OnLostDevice();
28        void OnDestroyDevice();
29
30        bool loadXModel(std::string filename, Object3d *myObject);
31        IDirect3DTexture9* loadTexture(std::string filename, bool alwaysNeeded = false);
32        FSOUND_SAMPLE* loadSound(std::string filename, bool loadAsLoop);
33
34private:
35        struct modelResources
36        {
37                std::string filename;
38                LPD3DXMESH myMesh;
39                DWORD NumMaterials;
40                DWORD *adjacencyInfo;
41                std::vector<D3DMATERIAL9> Materials;
42                std::vector<IDirect3DTexture9*> Textures;
43                Vector minBBox;
44                Vector maxBBox;
45        };
46
47        struct textureResources
48        {
49                std::string filename;
50                IDirect3DTexture9* texture;
51                bool alwaysNeeded;
52        };
53
54        struct soundResources
55        {
56                std::string filename;
57                FSOUND_SAMPLE* soundSample;
58                bool loadedForLoop;
59        };
60
61   
62        GameManager *gameManager;
63
64        std::vector<modelResources> resourceVector;
65        std::vector<textureResources> textureVector;
66        std::vector<soundResources> soundVector;
67};
68
Note: See TracBrowser for help on using the repository browser.