ScummVM API documentation
loader.h
1 /* ScummVM - Graphic Adventure Engine
2  *
3  * ScummVM is the legal property of its developers, whose names
4  * are too numerous to list here. Please refer to the COPYRIGHT
5  * file distributed with this source distribution.
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  *
20  */
21 
22 #ifndef WATCHMAKER_LOADER_H
23 #define WATCHMAKER_LOADER_H
24 
25 #include "watchmaker/t3d.h"
26 #include "watchmaker/types.h"
27 #include "watchmaker/work_dirs.h"
28 
29 namespace Watchmaker {
30 
31 #define SCALEFACTOR 1.0f//(1.0f/7.0f)
32 
33 #define MAX_MIRRORS 10
34 
35 #define T3D_GENERATESHADOWMAPS (1<<0) //Generate shadow maps
36 #define T3D_NOLIGHTMAPS (1<<1) //view without lightmaps
37 #define T3D_NORECURSION (1<<2) //do not recurse sub-rooms mirrors, reflections
38 #define T3D_HALFTEXTURESIZE (1<<3) //Half the texture dimension when load .t3d texture
39 #define T3D_FULLSCREEN (1<<4) //run in fullscreen
40 #define T3D_FASTRENDERING (1<<5) //render shadow/light maps with minimum dimension
41 #define T3D_OUTDOORLIGHTS (1<<6) //load .oli files for outdoor lights informations
42 #define T3D_NOVOLUMETRICLIGHTS (1<<7) //do not load .vol file
43 #define T3D_NOBOUNDS (1<<8) //do not load .vol file
44 #define T3D_NOCAMERAS (1<<9) //do not load .vol file
45 #define T3D_NONEXCLUSIVEMOUSE (1<<10) // mouse is not in exclusive mode
46 #define T3D_RECURSIONLEVEL1 (1<<12) // one recursion level only
47 #define T3D_SKY (1<<13) // if the sky is visible
48 #define T3D_PRELOAD_RXT (1<<14) // preload extern
49 #define T3D_STATIC_SET0 (1<<15) // static loaded elements
50 #define T3D_STATIC_SET1 (1<<16) // static loaded elements
51 #define T3D_NOSHADOWS (1<<17) // do not calc shadows
52 #define T3D_NOICONS (1<<18) // do not load icons
53 #define T3D_NOSOUND (1<<19) // do not use sound system
54 #define T3D_PRELOADBASE (1<<20) // preload basic elements
55 #define T3D_NOMUSIC (1<<21) // do not use music system
56 #define T3D_DEBUGMODE (1<<22) // debug mode
57 #define T3D_FASTFILE (1<<23) // fastfile
58 #define T3D_HIPOLYPLAYERS (1<<24) // hipoly players (darrell e victoria hipoly)
59 #define T3D_HIPOLYCHARACTERS (1<<25) // hipoly characters (gli abitanti del castello hipoly)
60 
61 // TODO: Unglobalize
62 extern t3dV3F CharCorrection;
63 extern t3dF32 CurFloorY;
64 extern int32 t3dCurTime, t3dCurOliSet;
65 
66 struct RecStruct {
67  Common::String name;
68  t3dBODY *b = nullptr;
69  uint32 Flags = 0;
70 };
71 
72 void t3dOptimizeMaterialList(t3dBODY *b);
73 void t3dFinalizeMaterialList(t3dBODY *b);
74 void t3dPrecalcLight(t3dBODY *b, unsigned char *sun);
75 void t3dLoadSky(WGame &game, t3dBODY *b);
76 
77 Common::String constructPath(const Common::String &prefix, const Common::String &filename, const char *suffix = nullptr);
78 
79 class RoomManager {
80 public:
81  virtual ~RoomManager() {}
82  virtual void addToLoadList(t3dMESH *m, const Common::String &pname, uint32 LoaderFlags) = 0;
83  virtual t3dBODY* loadRoom(const Common::String &pname, t3dBODY *b, uint16 *NumBody, uint32 LoaderFlags) = 0;
84  static RoomManager *create(WGame *game);
85  virtual t3dBODY *getRoomIfLoaded(const Common::String &roomname) = 0;
86  virtual t3dMESH *linkMeshToStr(Init &init, const Common::String &str) = 0;
87  virtual void hideRoomMeshesMatching(const Common::String &pname) = 0;
88  virtual void releaseBody(const Common::String &name, const Common::String &altName) = 0;
89  virtual void releaseLoadedFiles(uint32 exceptFlag) = 0;
90  virtual t3dBODY *checkIfAlreadyLoaded(const Common::String &Name) = 0;
91  virtual Common::Array<t3dBODY*> getLoadedFiles() = 0;
92 };
93 
94 } // End of namespace Watchmaker
95 
96 #endif // WATCHMAKER_LOADER_H
Definition: 2d_stuff.h:30
Definition: str.h:59
Definition: array.h:52
Definition: globvar.h:199
Definition: loader.h:66
Definition: loader.h:79
Definition: t3d_body.h:32
Definition: t3d_mesh.h:30
Definition: game.h:55