ScummVM API documentation
ll_mesh.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_LL_MESH_H
23 #define WATCHMAKER_LL_MESH_H
24 
25 #include "watchmaker/t3d.h"
26 #include "watchmaker/globvar.h"
27 #include "watchmaker/work_dirs.h"
28 
29 namespace Watchmaker {
30 
31 uint8 t3dClipToSurface(Init &init, t3dV3F *pt);
32 void t3dLightChar(t3dMESH *mesh, t3dV3F *p);
33 void t3dProcessGolfSky(t3dMESH *gs);
34 void HideRoomMeshes(Init &init, t3dBODY *body);
35 void t3dUpdateArrow(t3dMESH *m, t3dF32 len);
36 bool t3dSetSpecialAnimFrame(WGame &game, const char *name, t3dMESH *mesh, int32 nf);
37 void ChangeMeshFlags(t3dMESH *m, int8 add, uint32 newflags);
38 void UpdateObjMesh(Init &init, int32 in);
39 void UpdateBoundingBox(t3dMESH *mesh);
40 void UpdateCharHead(int32 oc, t3dV3F *dir);
41 void SetMeshMaterialMovieFrame(t3dMESH *m, int8 op, int32 newframe);
42 void ChangeMeshMaterialFlag(t3dMESH *m, int8 add, uint32 newflag);
43 void ChangeHaloesStatus(t3dBODY *b, int8 op);
44 uint8 t3dVectMeshInters(t3dMESH *m, t3dV3F start, t3dV3F end, t3dV3F *inters);
45 void t3dLightRoom(Init &init, t3dBODY *b, t3dV3F *p, t3dF32 NearRange, t3dF32 FarRange, t3dF32 IperRange);
46 void t3dUpdateExplosion(t3dMESH *m, t3dF32 scale);
47 bool t3dMoveAndCheck1stCamera(t3dBODY *rr, t3dCAMERA *cc, t3dV3F *mm);
48 
49 // TODO: This could perhaps be PIMPLd, as we don't really need to expose the implementation.
50 struct SMeshModifier {
51  Common::String meshName;
52 private:
53  int32 Flags = 0;
54  uint32 AddFlags = 0;
55  uint32 RemoveFlags = 0;
56  uint32 AddMatFlags = 0;
57  uint32 RemoveMatFlags = 0;
58  int32 MatFrame = 0;
59  uint16 BndLevel = 0;
60  int8 HaloesStatus = 0;
61 public:
62  Common::String animName;
63  SMeshModifier() = default;
64  SMeshModifier(const char *name, int16 com, void *p);
66  void configure(const char *name, int16 com, void *p);
67  void modifyMesh(WGame &game, t3dMESH *mesh);
68  uint16 getBndLevel() const { return BndLevel; }
69  int32 getFlags() const { return Flags; }
70  int8 getHaloesStatus() const { return HaloesStatus; }
71 };
72 
74  SMeshModifier MMList[MAX_MODIFIED_MESH] = {};
75 public:
76  MeshModifiers() = default;
78  for (int i = 0; i < MAX_MODIFIED_MESH; i++) {
79  MMList[i] = SMeshModifier(stream);
80  }
81  }
82  void addMeshModifier(const Common::String &name, int16 com, void *p);
83  void applyAllMeshModifiers(WGame &game, t3dBODY *b);
84  void modifyMesh(WGame &game, t3dMESH *mesh);
85 };
86 
87 } // End of namespace Watchmaker
88 
89 #endif // WATCHMAKER_LL_MESH_H
Definition: 2d_stuff.h:30
Definition: str.h:59
Definition: ll_mesh.h:73
Definition: ll_mesh.h:50
Definition: stream.h:745
Graphics::Surface * scale(const Graphics::Surface &srcImage, int xSize, int ySize)
Definition: t3d_body.h:32
Definition: t3d_mesh.h:30
Definition: game.h:56