Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
Rect.h
Go to the documentation of this file.
1#ifndef NW4HBM_RECT_H
2#define NW4HBM_RECT_H
3
4#include <revolution/types.h>
5
7
8namespace nw4hbm {
9 namespace ut {
10
11 class Rect {
12 public:
13 Rect() : left(), top(), right(), bottom() {}
14 Rect(f32 l, f32 t, f32 r, f32 b) : left(l), top(t), right(r), bottom(b) {}
15
16 ~Rect() {}
17
18 void SetWidth(f32 width) { right = left + width; }
19 void SetHeight(f32 height) { bottom = top + height; }
20
21 f32 GetWidth() const { return right - left; }
22 f32 GetHeight() const { return bottom - top; }
23
24 void MoveTo(f32 x, f32 y) {
25 right = x + GetWidth();
26 left = x;
27
28 bottom = y + GetHeight();
29 top = y;
30 }
31
32 void Normalize() {
33 f32 l = left;
34 f32 t = top;
35 f32 r = right;
36 f32 b = bottom;
37
38 left = math::FSelect(r - l, l, r);
39 right = math::FSelect(r - l, r, l);
40 top = math::FSelect(b - t, t, b);
41 bottom = math::FSelect(b - t, b, t);
42 }
43
44 /* 0x00 */ f32 left;
45 /* 0x04 */ f32 top;
46 /* 0x08 */ f32 right;
47 /* 0x0C */ f32 bottom;
48 }; // size = 0x10
49
50 }; // namespace ut
51}; // namespace nw4hbm
52
53#endif
Definition Rect.h:11
f32 GetWidth() const
Definition Rect.h:21
void Normalize()
Definition Rect.h:32
Rect(f32 l, f32 t, f32 r, f32 b)
Definition Rect.h:14
f32 left
Definition Rect.h:44
~Rect()
Definition Rect.h:16
void SetWidth(f32 width)
Definition Rect.h:18
f32 GetHeight() const
Definition Rect.h:22
void SetHeight(f32 height)
Definition Rect.h:19
f32 bottom
Definition Rect.h:47
f32 top
Definition Rect.h:45
f32 right
Definition Rect.h:46
void MoveTo(f32 x, f32 y)
Definition Rect.h:24
Rect()
Definition Rect.h:13
r
Definition e_acos.c:105
t
Definition e_asin.c:100
double x double x
Definition e_atan2.c:58
double x double y
Definition e_atan2.c:58
float f32
Definition types.h:25
f32 FSelect(register f32 cond, register f32 ifPos, register f32 ifNeg)
Definition arithmetic.h:47
Definition HBMAnmController.h:6