ScummVM API documentation
floor.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
#ifndef SLUDGE_FLOOR_H
22
#define SLUDGE_FLOOR_H
23
24
namespace
Common
{
25
struct
Point
;
26
class
SeekableReadStream;
27
class
WriteStream;
28
}
29
30
namespace
Sludge
{
31
32
class
SludgeEngine;
33
struct
OnScreenPerson;
34
35
struct
FloorPolygon
{
36
int
numVertices;
37
int
*vertexID;
38
};
39
40
struct
Floor
{
41
int
originalNum;
42
Common::Point
*vertex;
43
int
numPolygons;
44
FloorPolygon
*polygon;
45
int
**matrix;
46
};
47
48
class
FloorManager
{
49
public
:
50
FloorManager
(
SludgeEngine
*vm);
51
~
FloorManager
();
52
53
bool
init();
54
void
kill();
55
56
void
setFloorNull();
57
bool
setFloor(
int
fileNum);
58
void
drawFloor();
59
int
inFloor(
int
x,
int
y);
60
bool
isFloorNoPolygon() {
return
!_currentFloor || _currentFloor->numPolygons == 0; }
61
62
// For Person collision detection
63
bool
handleClosestPoint(
int
&setX,
int
&setY,
int
&setPoly);
64
bool
doBorderStuff(
OnScreenPerson
*moveMe);
65
66
// Save & load
67
void
save(
Common::WriteStream
*stream);
68
bool
load(
Common::SeekableReadStream
*stream);
69
70
private
:
71
Floor
*_currentFloor;
72
SludgeEngine
*_vm;
73
74
bool
getMatchingCorners(
FloorPolygon
&,
FloorPolygon
&,
int
&,
int
&);
75
bool
closestPointOnLine(
int
&closestX,
int
&closestY,
int
x1,
int
y1,
int
x2,
int
y2,
int
xP,
int
yP);
76
bool
pointInFloorPolygon(
FloorPolygon
&floorPoly,
int
x,
int
y);
77
bool
polysShareSide(
FloorPolygon
&a,
FloorPolygon
&b);
78
void
dumpFloor(
int
fileNum);
79
};
80
81
}
// End of namespace Sludge
82
83
#endif
Sludge::OnScreenPerson
Definition:
people.h:76
Common::WriteStream
Definition:
stream.h:77
Point
Definition:
display_client.h:58
Common::SeekableReadStream
Definition:
stream.h:745
Sludge::SludgeEngine
Definition:
sludge.h:68
Sludge
Definition:
builtin.h:27
Common
Definition:
algorithm.h:29
Common::Point
Definition:
rect.h:45
Sludge::Floor
Definition:
floor.h:40
Sludge::FloorPolygon
Definition:
floor.h:35
Sludge::FloorManager
Definition:
floor.h:48
engines
sludge
floor.h
Generated on Thu Nov 21 2024 09:19:05 for ScummVM API documentation by
1.8.13