ScummVM API documentation
grid.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 SKY_GRID_H
23#define SKY_GRID_H
24
25
26#include "common/scummsys.h"
27#include "skydefs.h"
28
29namespace Sky {
30
31struct Compact;
32class Disk;
33class SkyCompact;
34
35class Grid {
36public:
37 Grid(Disk *pDisk, SkyCompact *skyCompact);
38 ~Grid();
39
40 // grid.asm routines
41 void loadGrids();
42 void removeObjectFromWalk(Compact *cpt);
43 void objectToWalk(Compact *cpt);
44
45 // function.asm
46 // note that this routine does the same as objectToWalk, it just doesn't get
47 // its x, y, width parameters from cpt.
48 void plotGrid(uint32 x, uint32 y, uint32 width, Compact *cpt);
49 // same here, it's basically the same as removeObjectFromWalk
50 void removeGrid(uint32 x, uint32 y, uint32 width, Compact *cpt);
51 uint8 *giveGrid(uint32 pScreen);
52
53private:
54 void objectToWalk(uint8 gridIdx, uint32 bitNum, uint32 width);
55 void removeObjectFromWalk(uint8 gridIdx, uint32 bitNum, uint32 width);
56 bool getGridValues(Compact *cpt, uint8 *resGrid, uint32 *resBitNum, uint32 *resWidth);
57 bool getGridValues(uint32 x, uint32 y, uint32 width, Compact *cpt, uint8 *resGrid, uint32 *resBitNum, uint32 *resWidth);
58
59 static int8 _gridConvertTable[];
60 uint8 *_gameGrids[TOT_NO_GRIDS];
61 Disk *_skyDisk;
62 SkyCompact *_skyCompact;
63};
64
65} // End of namespace Sky
66
67#endif //SKYGRID_H
Definition: disk.h:59
Definition: grid.h:35
Definition: compact.h:58
Definition: autoroute.h:28
Definition: struc.h:112