summaryrefslogtreecommitdiff
path: root/include/egg/gfx/eggCapTexture.h
blob: 820b0961e134e0f29c9ee223e4b50e5dde87c036 (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
52
53
54
55
56
57
58
#ifndef EGG_CAP_TEXTURE_H
#define EGG_CAP_TEXTURE_H

#include "egg/gfx/eggCpuTexture.h"
#include "rvl/GX/GXTypes.h"
namespace EGG {

struct CopyFilter {
    u8 values[7];
};

class CapTexture : public CpuTexture {
public:
    CapTexture() {}
    CapTexture(u16 width, u16 height, GXTexFmt texFmt) : CpuTexture(width, height, texFmt) {}
    CapTexture(const GXTexObj *pObj) : CpuTexture(pObj) {}

    virtual void configure() override; // at 0xC

    void capture(u16 x, u16 y, bool upscale, int format);
    void fn_8049D9D0(u8 arg);

    void setPixModeSync(bool enable) {
        if (enable) {
            mCapFlags |= 0x10;
        } else {
            mCapFlags &= ~0x10;
        }
    }

    void onCapFlag(u8 flag) {
        mCapFlags |= flag;
    }
    void offCapFlag(u8 flag) {
        mCapFlags &= ~flag;
    }

    void setClearColor(const GXColor &clr) {
        mClearColor = clr;
    }

    void setCopyFilter(const CopyFilter &filt) {
        mCopyFilterArg = filt;
    }

    static const CopyFilter VFILTER_BLUR;
    static const CopyFilter VFILTER_OFF;

private:
    /* 0x18 */ u8 mCapFlags;
    /* 0x19 */ GXColor mClearColor;
    /* 0x20 */ u32 field_0x20;
    /* 0x24 */ CopyFilter mCopyFilterArg;
};

} // namespace EGG

#endif