ScummVM API documentation
globvar.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_GLOBVAR_H
23 #define WATCHMAKER_GLOBVAR_H
24 
25 #include "watchmaker/struct.h"
26 #include "watchmaker/3d/t3d_mesh.h"
27 
28 namespace Watchmaker {
29 
30 #define MAX_PATH 256
31 
32 // GAME RECT
33 struct GameRect {
34  GameRect();
35  SRect _bigIconRect;
36  SRect _useIconRect;
37  SRect _quitGameRect;
38  SRect _closeInvRect;
39  SRect _playerInvRect;
40  SRect _invSaveRect;
41  SRect _invLoadRect;
42  SRect _invOptionsRect;
43  SRect _inv1Up;
44  SRect _inv1Down;
45  SRect _diag2Up;
46  SRect _diag2Down;
47  SRect _callOtherPlayerRect;
48 };
49 extern struct SD3DRect D3DRectsList[];
50 extern struct SD3DTriangle D3DTrianglesList[];
51 extern struct SD3DBitmap D3DBitmapsList[];
52 
53 // 2D INTERFACE
54 extern int32 MainDx, MainDy, MainBpp;
55 extern int32 IconsPics[MAX_ICONS];
56 extern int32 Console1, ConsoleFrecciaGiu, ConsoleFrecciaSu, Console2, Console3, Console4, Console5, Console6, ConsoleNoSwitchDar, ConsoleNoSwitchVic, ConsoleNoSave;
57 extern int32 ConsoleD1, ConsoleD2, StartPic, EndPic, NewLogImage, LoadingImage;
58 extern int32 CurMousePointer, MousePointerDefault, MousePointerPlus, TrecLogo;
59 extern int32 GopherMap, GopherPos[], GopherBall;
60 extern struct SRect MousePointerLim;
61 
62 // 3D INTERFACE
63 extern t3dF32 CurFloorY;
64 extern uint8 PlayerPos[];
65 extern uint8 PlayerGotoPos[];
66 extern uint8 ForcedCamera, FastWalk;
67 extern uint16 AnimAutoPush;
68 extern int32 CameraTargetObj, CameraTargetBone;
69 extern int32 TimeWalk, TimeAnim;
70 
71 // LOADER VARS
72 extern char LoaderName[];
73 extern char WmCfgName[];
74 extern uint32 LoaderFlags;
75 extern char WmGameDataPak_FilePath[];
76 
77 // INV VARS
78 struct InvVars {
79  t3dBODY *t3dIcons;
80  t3dMESH CameraDummy;
81  t3dCAMERA t3dIconCamera;
82  t3dM3X3F BigIconM;
83 };
84 
85 // MOUSE VARS
86 extern char ObjectUnderCursor[];
87 extern t3dV3F mPos;
88 
89 extern struct SPlayerStand PlayerStand[];
90 
91 // SENTENCES
92 extern char *ObjName[];
93 extern char *Sentence[];
94 extern char *SysSent[];
95 extern char *TooltipSent[];
96 extern struct SString TheString;
97 extern char CurDebugString[];
98 extern char TextLines[MAX_TEXT_LINES][MAX_TEXT_CHARS];
99 
100 extern t3dCHARACTER *Player;
101 extern t3dCHARACTER *Character[];
102 extern t3dCHARSTOPSTATUS CharStopStatus[];
103 extern t3dCHARACTER *Lanc33[];
104 extern t3dCHARACTER *Sfera34;
105 extern t3dCHARACTER *Palla50;
106 extern t3dCHARACTER *Freccia50;
107 extern t3dCHARACTER *GopherMark[];
108 extern t3dCHARACTER *Explode50;
109 extern t3dMESH *t3dGolfSky;
110 extern int32 Comb2D[], Comb2Q[], Comb19[], Comb1D[], Forno25, Frigo25, Comb31[], Comb33[], Comb42[], Comb44[], Comb45[];
111 extern uint8 bMoglieGym, bMoglieSangue, bNoPlayerSwitch;
112 
113 // MESSAGE SYSTEM
114 extern message *TheMessage;
115 
116 // GAME VARS
117 extern int32 CurObj;
118 extern int32 NextPortalObj;
119 extern int32 NextPortalAnim;
120 extern int32 FromFirstPersonAnim;
121 extern int32 ToFirstPersonSent;
122 extern int32 CurInvObj;
123 extern int32 BigInvObj;
124 extern int32 CurPlayer;
125 extern int32 CurDialog, CurMenu, CurDlgItem;
126 extern int32 CurSubMusic;
127 extern int32 CurAlternate[];
128 extern int32 CurGopher;
129 
130 extern uint32 TheTime;
131 extern uint32 NextRefresh, PaintTime, LoadTime;
132 extern t3dF32 CurFps, AvgFps;
133 extern t3dF32 FrameFactor;
134 
135 // INV
136 extern uint8 Inv[MAX_PLAYERS][MAX_ICONS_IN_INV];
137 extern uint8 InvLen[], InvBase[];
138 extern uint8 InvStatus;
139 extern uint8 Diag2Base;
140 
141 // USE WITH
142 extern int32 UseWith[];
143 
144 // SEMAFORI
145 extern uint8 bSomeOneSpeak;
146 extern uint8 bPlayerSpeak;
147 extern uint8 bUseWith;
148 extern uint8 bSkipTalk;
149 extern uint8 bFirstPerson;
150 extern uint8 bDialogActive;
151 extern uint8 bDialogMenuActive;
152 extern uint8 bMovingCamera;
153 extern uint8 bCutCamera;
154 extern uint8 bAllowCalcCamera;
155 extern uint8 bAnimWaitText;
156 extern uint8 bPlayerInAnim;
157 extern uint8 bFastWalk;
158 extern uint8 bNotSkippableWalk;
159 extern uint8 bNoFirstPersonSwitch;
160 extern uint8 bClock33;
161 extern uint8 bShowInfo;
162 extern uint8 bShowBoundingBox;
163 extern uint8 bShowPanels;
164 extern uint8 bForceWire;
165 extern uint8 bPauseAllAnims;
166 extern uint8 bT2DActive;
167 extern uint8 bGolfActive;
168 extern uint8 bGolfMode;
169 extern uint8 bIngnoreDIKeyboard;
170 extern uint8 bDisableDiary;
171 extern uint8 bCacciatore;
172 extern uint8 bDarkScreen;
173 extern uint8 bSaveDisabled;
174 extern uint8 bLockCamera;
175 extern uint8 bMiscLoaded;
176 extern uint8 bStartMenuActive;
177 extern uint8 bShowOnlyLoadWindow;
178 extern uint8 bSbCacciatorehowOnlyLoadWindow;
179 extern uint8 bNotSkippableSent;
180 extern uint8 bPorteEsternoBloccate;
181 extern uint8 bSuperView;
182 extern uint8 bSezioneLabirinto;
183 extern uint8 bPlayerSuBasamento;
184 extern uint8 bWideScreen;
185 extern uint8 bTitoliCodaStatic;
186 extern uint8 bTitoliCodaScrolling;
187 extern uint8 bDontPlaySteps;
188 extern uint8 bShowRoomDescriptions;
189 extern uint8 bShowExtraLocalizationStrings;
190 
191 // DIALOG VARS
192 extern uint8 UsedDlgMenu[MAX_PLAYERS][T3D_MAX_CHARACTERS][MAX_DLG_MENUS];
193 
194 struct Globals {
195  InvVars _invVars;
196 };
197 
198 // INIT
199 struct Init : public SerializableAsset {
210 
211  // Sentences?
213 
216 
217  Globals _globals;
218 
219  void loadFromStream(Common::SeekableReadStream &stream) {
220  warning("Init");
221  Room.loadFromStream(stream);
222  Obj.loadFromStream(stream);
223  InvObj.loadFromStream(stream);
224  Sound.loadFromStream(stream);
225  Music.loadFromStream(stream);
226  Anim.loadFromStream(stream);
227  Dialog.loadFromStream(stream);
228  Diary.loadFromStream(stream);
229  DlgMenu.loadFromStream(stream);
230  DlgItem.loadFromStream(stream);
231 
232  PDALog.loadFromStream(stream);
233 
234  uint16 numNames = stream.readUint16LE();
235  uint16 numRoles = stream.readUint16LE();
236  _creditsNames = SerializableDynamicArray<SCreditsName>(numNames);
237  _creditsRoles = SerializableDynamicArray<SCreditsRole>(numRoles);
238  _creditsNames.loadFromStream(stream);
239  _creditsRoles.loadFromStream(stream);
240 
241  treatCredits();
242  }
243 private:
244  void treatCredits() {
245  for (uint32 i = 0; i < _creditsNames.size(); i++) {
246  char *c = _creditsNames[i].name;
247  for (int k = 0; k < 32; k++, c++) {
248  (*c) ^= 0xA0;
249  }
250  }
251 
252  for (uint32 i = 0; i < _creditsRoles.size(); i++) {
253  char *c = _creditsRoles[i].role;
254  for (int k = 0; k < 48; k++, c++) {
255  (*c) ^= 0xC4;
256  }
257  }
258  }
259 };
260 
261 } // End of namespace Watchmaker
262 
263 #endif // WATCHMAKER_GLOBVAR_H
Definition: t3d.h:390
Definition: struct.h:437
Definition: struct.h:80
Definition: types3d.h:38
Definition: 2d_stuff.h:30
uint16 readUint16LE()
Definition: stream.h:459
void warning(MSVC_PRINTF const char *s,...) GCC_PRINTF(1
Definition: stream.h:745
Definition: globvar.h:199
Definition: struct.h:429
Definition: struct.h:33
Definition: struct.h:416
Definition: t3d.h:405
Definition: struct.h:502
Definition: t3d_body.h:32
Definition: globvar.h:33
Definition: struct.h:404
Definition: globvar.h:78
Definition: t3d_mesh.h:30
Definition: struct.h:365
Definition: t3d.h:213
Definition: struct.h:433
Definition: t3d.h:116
Definition: globvar.h:194