summaryrefslogtreecommitdiff
path: root/include/egg/core/eggColorFader.h
blob: 3b72c347bafe22f9baef8cd3d150fb73b6cb7b13 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#ifndef EGG_COLOR_FADER_H
#define EGG_COLOR_FADER_H

#include "common.h"
#include "egg/core/eggFader.h"
#include "egg/prim/eggBitFlag.h"

#include "nw4r/ut.h"

namespace EGG {

class ColorFader : public Fader {
public:
    // vtable at 0x00
    /* vt 0x08 */ virtual void setStatus(EStatus);
    /* vt 0x0C */ virtual EStatus getStatus() const {
        return mStatus;
    };
    /* vt 0x10 */ virtual bool fadeIn();
    /* vt 0x14 */ virtual bool fadeOut();
    /* vt 0x18 */ virtual bool calc();
    /* vt 0x1C */ virtual void draw();
    /* vt 0x20 */ virtual ~ColorFader() {}

public:
    /* 0x04 */ EStatus mStatus;
    /* 0x08 */ TBitFlag<u8> mFlags;
    /* 0x0A */ u16 mFrame;
    /* 0x0C */ u16 mFadeTimer;
    /* 0x0E */ u16 field_0x0E;
    /* 0x10 */ nw4r::ut::Color mColor;
    /* 0x14 */ f32 mStartX;
    /* 0x18 */ f32 mStartY;
    /* 0x1C */ f32 mEndX;
    /* 0x20 */ f32 mEndY;

public:
    ColorFader(f32 startX, f32 startY, f32 lengthX, f32 lengthY, nw4r::ut::Color color, EStatus status);
    void setFrame(u16 frame);
    void setColor(nw4r::ut::Color);
    float getWidth() const {
        return mEndX - mStartX;
    }
    float getHeight() const {
        return mEndY - mStartY;
    }
};

} // namespace EGG

#endif