ScummVM API documentation
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
cruise_main.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 CRUISE_CRUISE_MAIN_H
23 #define CRUISE_CRUISE_MAIN_H
24 
25 #include "common/scummsys.h"
26 #include "common/savefile.h"
27 
28 #include "cruise/overlay.h"
29 #include "cruise/object.h"
30 #include "cruise/ctp.h"
31 #include "cruise/actor.h"
32 #include "cruise/vars.h"
33 #include "cruise/font.h"
34 #include "cruise/volume.h"
35 #include "cruise/stack.h"
36 #include "cruise/script.h"
37 #include "cruise/various.h"
38 #include "cruise/function.h"
39 #include "cruise/saveload.h"
40 #include "cruise/linker.h"
41 #include "cruise/mouse.h"
42 #include "cruise/gfxModule.h"
43 #include "cruise/dataLoader.h"
44 #include "cruise/perso.h"
45 #include "cruise/menu.h"
46 
47 #include "cruise/background.h"
48 #include "cruise/backgroundIncrust.h"
49 
50 #include "cruise/mainDraw.h"
51 
52 namespace Cruise {
53 
54 enum MouseButton {
55  CRS_MB_LEFT = 1,
56  CRS_MB_RIGHT = 2,
57  CRS_MB_MIDDLE = 4,
58  CRS_MB_BOTH = CRS_MB_LEFT | CRS_MB_RIGHT
59 };
60 
61 /*#define DUMP_SCRIPT
62 #define DUMP_OBJECT*/
63 
64 enum ResType {
65  OBJ_TYPE_LINE = 0,
66  OBJ_TYPE_MASK = 1,
67  OBJ_TYPE_BGMASK = 2,
68  OBJ_TYPE_VIRTUAL = 3,
69  OBJ_TYPE_SPRITE = 4,
70  OBJ_TYPE_MESSAGE = 5,
71  OBJ_TYPE_SOUND = 6,
72  OBJ_TYPE_FONT = 7,
73  OBJ_TYPE_POLY = 8,
74  OBJ_TYPE_EXIT = 9
75 };
76 
77 extern gfxEntryStruct* linkedMsgList;
78 
79 extern int buttonDown;
80 extern int selectDown;
81 extern int menuDown;
82 
83 bool delphineUnpack(byte *dst, const byte *src, int len);
84 int findHighColor();
85 ovlData3Struct *getOvlData3Entry(int32 scriptNumber, int32 param);
86 ovlData3Struct *scriptFunc1Sub2(int32 scriptNumber, int32 param);
87 void resetFileEntry(int32 entryNumber);
88 uint8 *mainProc14(uint16 overlay, uint16 idx);
89 void printInfoBlackBox(const char *string);
90 void waitForPlayerInput();
91 void loadPackedFileToMem(int fileIdx, uint8 * buffer);
92 int getNumObjectsByClass(int scriptIdx, int param);
93 void resetFileEntryRange(int param1, int param2);
94 int getProcParam(int overlayIdx, int param2, const char * name);
95 void changeScriptParamInList(int param1, int param2, scriptInstanceStruct * pScriptInstance, int newValue, int param3);
96 uint8 *getDataFromData3(ovlData3Struct * ptr, int param);
97 void removeExtension(const char *name, char *buffer, size_t ln);
98 void resetPtr2(scriptInstanceStruct * ptr);
99 void getFileExtension(const char *name, char *buffer, size_t ln);
100 void *allocAndZero(int size);
101 void freeStuff2();
102 void mainLoop();
103 void getMouseStatus(int16 *pMouseVar, int16 *pMouseX, int16 *pMouseButton, int16 *pMouseY);
104 bool testMask(int x, int y, unsigned char* pData, int stride);
105 menuElementSubStruct *getSelectedEntryInMenu(menuStruct *pMenu);
106 void closeAllMenu();
107 int removeFinishedScripts(scriptInstanceStruct *ptrHandle);
108 void initBigVar3();
109 void resetActorPtr(actorStruct *ptr);
110 void removeAllScripts(scriptInstanceStruct *ptrHandle);
111 
112 void MemoryList();
113 void *MemoryAlloc(uint32 size, bool clearFlag, int32 lineNum, const char *fname);
114 void MemoryFree(void *v);
115 
116 #define mallocAndZero(size) MemoryAlloc(size, true, __LINE__, __FILE__)
117 #define MemAlloc(size) MemoryAlloc(size, false, __LINE__, __FILE__)
118 #define MemFree(v) MemoryFree(v)
119 
120 } // End of namespace Cruise
121 
122 #endif
MouseButton
Definition: events.h:183
Definition: actor.h:25