ScummVM API documentation
item_sorter.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 ULTIMA8_WORLD_ITEMSORTER_H
23#define ULTIMA8_WORLD_ITEMSORTER_H
24
25#include "common/rect.h"
26
27namespace Ultima {
28namespace Ultima8 {
29
30class MainShapeArchive;
31class Item;
32class RenderSurface;
33struct SortItem;
34struct Point3;
35
37 MainShapeArchive *_shapes;
38 Common::Rect32 _clipWindow;
39
40 SortItem *_items;
41 SortItem *_itemsTail;
42 SortItem *_itemsUnused;
43 SortItem *_painted;
44
45 int32 _camSx, _camSy;
46 int32 _sortLimit;
47 bool _sortLimitChanged;
48
49public:
50 ItemSorter(int capacity);
52
53 enum HitFace {
54 X_FACE, Y_FACE, Z_FACE
55 };
56
57 // Begin creating the display list
58 void BeginDisplayList(const Common::Rect32 &clipWindow, const Point3 &cam);
59
60 void AddItem(const Point3 &pt, uint32 shape_num, uint32 frame_num, uint32 item_flags, uint32 ext_flags, uint16 item_num = 0);
61 void AddItem(const Item *); // Add an Item. SetupLerp() MUST have been called
62
63 // Finishes the display list and Paints
64 void PaintDisplayList(RenderSurface *surf, bool item_highlight = false, bool showFootpads = false, int gridlines = 0);
65
66 // Trace and find an object. Returns objid.
67 // If face is non-NULL, also return the face of the 3d bbox (x,y) is on
68 uint16 Trace(int32 x, int32 y, HitFace *face = 0, bool item_highlight = false);
69
70 void IncSortLimit(int count);
71
72private:
73 bool PaintSortItem(RenderSurface *surf, SortItem *si, bool showFootpad, int gridlines);
74};
75
76} // End of namespace Ultima8
77} // End of namespace Ultima
78
79#endif
Definition: item.h:42
Definition: item_sorter.h:36
Definition: main_shape_archive.h:36
Definition: render_surface.h:37
Definition: rect.h:538
Definition: point3.h:30
Definition: sort_item.h:42