ScummVM API documentation
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
52namespace Cruise {
53
54enum 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
64enum 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
77extern gfxEntryStruct* linkedMsgList;
78
79extern int buttonDown;
80extern int selectDown;
81extern int menuDown;
82
83bool delphineUnpack(byte *dst, const byte *src, int len);
84int findHighColor();
85ovlData3Struct *getOvlData3Entry(int32 scriptNumber, int32 param);
86ovlData3Struct *scriptFunc1Sub2(int32 scriptNumber, int32 param);
87void resetFileEntry(int32 entryNumber);
88uint8 *mainProc14(uint16 overlay, uint16 idx);
89void printInfoBlackBox(const char *string);
90void waitForPlayerInput();
91void loadPackedFileToMem(int fileIdx, uint8 * buffer);
92int getNumObjectsByClass(int scriptIdx, int param);
93void resetFileEntryRange(int param1, int param2);
94int getProcParam(int overlayIdx, int param2, const char * name);
95void changeScriptParamInList(int param1, int param2, scriptInstanceStruct * pScriptInstance, int newValue, int param3);
96uint8 *getDataFromData3(ovlData3Struct * ptr, int param);
97void removeExtension(const char *name, char *buffer, size_t ln);
98void resetPtr2(scriptInstanceStruct * ptr);
99void getFileExtension(const char *name, char *buffer, size_t ln);
100void *allocAndZero(int size);
101void freeStuff2();
102void mainLoop();
103void getMouseStatus(int16 *pMouseVar, int16 *pMouseX, int16 *pMouseButton, int16 *pMouseY);
104bool testMask(int x, int y, unsigned char* pData, int stride);
105menuElementSubStruct *getSelectedEntryInMenu(menuStruct *pMenu);
106void closeAllMenu();
107int removeFinishedScripts(scriptInstanceStruct *ptrHandle);
108void initBigVar3();
109void resetActorPtr(actorStruct *ptr);
110void removeAllScripts(scriptInstanceStruct *ptrHandle);
111
112void MemoryList();
113void *MemoryAlloc(uint32 size, bool clearFlag, int32 lineNum, const char *fname);
114void 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:202
Definition: actor.h:25