ScummVM API documentation
item_relative_gump.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_GUMPS_ITEMRELATIVEGUMP_H
23 #define ULTIMA8_GUMPS_ITEMRELATIVEGUMP_H
24 
25 #include "ultima/ultima8/gumps/gump.h"
26 #include "ultima/ultima8/misc/classtype.h"
27 
28 namespace Ultima {
29 namespace Ultima8 {
30 
34 class ItemRelativeGump : public Gump {
35 protected:
36  int32 _ix, _iy;
37 
38 public:
39  ENABLE_RUNTIME_CLASSTYPE()
40 
42  ItemRelativeGump(int32 x, int32 y, int32 width, int32 height, uint16 owner, uint32 flags = 0, int32 layer = LAYER_NORMAL);
43  ~ItemRelativeGump() override;
44 
45  void InitGump(Gump *newparent, bool take_focus = true) override;
46 
47  // Paint the Gump (RenderSurface is relative to parent).
48  // Calls PaintThis and PaintChildren.
49  void Paint(RenderSurface *, int32 lerp_factor, bool scaled) override;
50 
51  void ParentToGump(int32 &px, int32 &py,
52  PointRoundDir r = ROUND_TOPLEFT) override;
53  void GumpToParent(int32 &gx, int32 &gy,
54  PointRoundDir r = ROUND_TOPLEFT) override;
55 
56  void Move(int32 x, int32 y) override;
57 
58  bool loadData(Common::ReadStream *rs, uint32 version);
59 protected:
60  void saveData(Common::WriteStream *ws) override;
61 
62  virtual void GetItemLocation(int32 lerp_factor);
63 
65  void MoveOnScreen();
66 };
67 
68 } // End of namespace Ultima8
69 } // End of namespace Ultima
70 
71 #endif
void InitGump(Gump *newparent, bool take_focus=true) override
void Move(int32 x, int32 y) override
Move this gump.
Definition: stream.h:77
void GumpToParent(int32 &gx, int32 &gy, PointRoundDir r=ROUND_TOPLEFT) override
Convert a gump point to parent relative point.
void Paint(RenderSurface *, int32 lerp_factor, bool scaled) override
Definition: render_surface.h:40
Definition: gump.h:47
Definition: detection.h:27
void ParentToGump(int32 &px, int32 &py, PointRoundDir r=ROUND_TOPLEFT) override
Convert a parent relative point to a gump point.
Definition: item_relative_gump.h:34
Definition: stream.h:385
void MoveOnScreen()
Move Gump so that it totally overlaps parent.