SMG-Decomp
A decompilation of Super Mario Galaxy 1
Loading...
Searching...
No Matches
ValueControl.cpp
1#include "Game/Util/ValueControl.hpp"
2
3ValueControl::ValueControl(int a1) {
4 _0 = 0;
5 _4 = a1;
6 _8 = 1;
7}
8
9void ValueControl::setDirToOne() {
10 _8 = 1;
11}
12
13void ValueControl::setDirToOneResetFrame() {
14 _8 = 1;
15 resetFrame();
16}
17
18void ValueControl::setDirToZero() {
19 _8 = -1;
20}
21
22void ValueControl::setDirToZeroResetFrame() {
23 _8 = -1;
24 resetFrame();
25}
26
27/*
28void ValueControl::update() {
29 if (_8 > 0 && _0 != _4 || ((-_8 & ~_8) >= 0) && _0) {
30 _0 += _8;
31 }
32}
33*/
34
35void ValueControl::setZero() {
36 _8 = -1;
37 resetFrame();
38 _0 = 0;
39}
40
41void ValueControl::setOne() {
42 _8 = 1;
43 resetFrame();
44 _0 = _4;
45}
46
47void ValueControl::resetFrame() {
48 if (_8 > 0) {
49 _0 = 0;
50 }
51 else {
52 _0 = _4;
53 }
54}