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
6
#include "
../math/arithmetic.h
"
7
8
namespace
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
arithmetic.h
nw4hbm::ut::Rect
Definition
Rect.h:11
nw4hbm::ut::Rect::GetWidth
f32 GetWidth() const
Definition
Rect.h:21
nw4hbm::ut::Rect::Normalize
void Normalize()
Definition
Rect.h:32
nw4hbm::ut::Rect::Rect
Rect(f32 l, f32 t, f32 r, f32 b)
Definition
Rect.h:14
nw4hbm::ut::Rect::left
f32 left
Definition
Rect.h:44
nw4hbm::ut::Rect::~Rect
~Rect()
Definition
Rect.h:16
nw4hbm::ut::Rect::SetWidth
void SetWidth(f32 width)
Definition
Rect.h:18
nw4hbm::ut::Rect::GetHeight
f32 GetHeight() const
Definition
Rect.h:22
nw4hbm::ut::Rect::SetHeight
void SetHeight(f32 height)
Definition
Rect.h:19
nw4hbm::ut::Rect::bottom
f32 bottom
Definition
Rect.h:47
nw4hbm::ut::Rect::top
f32 top
Definition
Rect.h:45
nw4hbm::ut::Rect::right
f32 right
Definition
Rect.h:46
nw4hbm::ut::Rect::MoveTo
void MoveTo(f32 x, f32 y)
Definition
Rect.h:24
nw4hbm::ut::Rect::Rect
Rect()
Definition
Rect.h:13
r
r
Definition
e_acos.c:105
t
t
Definition
e_asin.c:100
x
double x double x
Definition
e_atan2.c:58
y
double x double y
Definition
e_atan2.c:58
f32
float f32
Definition
types.h:25
types.h
nw4hbm::math::FSelect
f32 FSelect(register f32 cond, register f32 ifPos, register f32 ifNeg)
Definition
arithmetic.h:47
nw4hbm
Definition
HBMAnmController.h:6
src
revolution
homebuttonLib
nw4hbm
ut
Rect.h
Generated by
1.12.0