summaryrefslogtreecommitdiff
path: root/include/m_Do/m_Do_graphic.h
blob: 0f7bedeeccaf0e0dc05d88b4849ef4714a372c5f (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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
#ifndef M_DO_M_DO_GRAPHIC_H
#define M_DO_M_DO_GRAPHIC_H

#include "JSystem/JFramework/JFWDisplay.h"
#include "dolphin/mtx/mtx.h"
#include "m_Do/m_Do_mtx.h"

bool mDoGph_Create();
bool mDoGph_BeforeOfDraw();
bool mDoGph_AfterOfDraw();
bool mDoGph_Painter();
void mDoGph_BlankingON();
void mDoGph_BlankingOFF();
void mDoGph_setCaptureStep(s16 step);
void* mDoGph_getCaptureTextureBuffer();
void mDoGph_setCaptureCaptureFormat(u8 fmt);
void mDoGph_setCaptureTextureFormat(u8 fmt);
s16 mDoGph_getCaptureStep();
void mDoGph_CaptureCansel();

struct ResTIMG;

class mDoGph_gInf_c {
public:
    static void create();
    static void createHeap();
    static void* alloc(u32, int);
    static void free();
    static void fadeOut(f32, GXColor&);
#if VERSION == VERSION_DEMO
    static void onBlure() {
        mBlureFlag = true;
        setBlureMtx(cMtx_getIdentity());
    }
    static void onBlure(const Mtx mtx) {
        mBlureFlag = true;
        cMtx_copy(mtx, mBlureMtx);
    }
#else
    static void onBlure();
    static void onBlure(const Mtx);
#endif
    static void fadeOut(f32);
    static void calcFade();
    static void onMonotone();
    static void offMonotone();
    static void calcMonotone();

    static void setFader(JUTFader* fader) {
        JFWDisplay::getManager()->setFader(fader);
        mFader = fader;
    }

    static BOOL startFadeOut(int fadeTime) { return JFWDisplay::getManager()->startFadeOut(fadeTime); }
    static BOOL startFadeIn(int fadeTime) { return JFWDisplay::getManager()->startFadeIn(fadeTime); }
    static void setFadeColor(JUtility::TColor& color) { mFader->setColor(color); }
    static void setClearColor(JUtility::TColor color) { JFWDisplay::getManager()->setClearColor(color); }
    static void setBackColor(GXColor& color) { mBackColor = color; }
    static void endFrame() { JFWDisplay::getManager()->endFrame(); }
    static void offFade() { mFade = 0; }
    static u8 isFade() { return mFade; }
    static void offBlure() { mBlureFlag = false; }
    static bool isBlure() { return mBlureFlag; }
    static u8 getBlureRate() { return mBlureRate; }
    static void setBlureRate(u8 blurRate) { mBlureRate = blurRate; }
    static MtxP getBlureMtx() { return mBlureMtx; }
    static void setBlureMtx(const Mtx m) { cMtx_copy(m, mBlureMtx); }
    static void offAutoForcus() { mAutoForcus = false; }
    static void onAutoForcus() { mAutoForcus = true; }
    static BOOL isAutoForcus() { return mAutoForcus; }
    static void setTickRate(u32 rate) { JFWDisplay::getManager()->setTickRate(rate); }
    static void waitBlanking(int wait) { JFWDisplay::getManager()->waitBlanking(wait); }
    static BOOL isMonotone() { return mMonotone; }

    static ResTIMG* getFrameBufferTimg() { return mFrameBufferTimg; }
    static void* getFrameBufferTex() { return mFrameBufferTex; }
    static void* getZbufferTex() { return mZbufferTex; }
    static void setFadeRate(f32 rate) { mFadeRate = rate; }
    static f32 getFadeRate() { return mFadeRate; }
    static GXColor& getFadeColor() { return mFadeColor; }
    static GXColor& getBackColor() { return mBackColor; }
    static void beginRender() { JFWDisplay::getManager()->beginRender(); }
    static void endRender() { JFWDisplay::getManager()->endRender(); }
    static GXTexObj* getZbufferTexObj() { return &mZbufferTexObj; }
    static GXTexObj* getFrameBufferTexObj() { return &mFrameBufferTexObj; }
    static void fadeIn(f32 rate, GXColor& color) { fadeOut(-rate, color); }
    static u16 getFrameRate() { return JFWDisplay::getManager()->getFrameRate(); }
    static void setFrameRate(u16 framerate) { JFWDisplay::getManager()->setFrameRate(framerate); }
    static s16 getMonotoneRate() { return mMonotoneRate; }
    static void setMonotoneRate(s16 rate) { mMonotoneRate = rate; }
    static void setMonotoneRateSpeed(s16 speed) { mMonotoneRateSpeed = speed; }

    static void alloc32(u32) {}
    static void getFrameBufferMemory() {}
    static void getFrameBufferSize() {}

    static GXTexObj mFrameBufferTexObj;
    static GXTexObj mZbufferTexObj;
    static Mtx mBlureMtx;
    static GXColor mBackColor;
    static GXColor mFadeColor;
    static JUTFader* mFader;
    static ResTIMG* mFrameBufferTimg;
    static void* mFrameBufferTex;
    static void* mZbufferTex;
    static f32 mFadeRate;
    static f32 mFadeSpeed;
    static bool mBlureFlag;
    static u8 mBlureRate;
    static u8 mFade;
    static bool mAutoForcus;
    static u8 mMonotone;
    static s16 mMonotoneRate;
    static s16 mMonotoneRateSpeed;
    static JKRHeap * mHeap[2];
    static u8 mCurrentHeap;
};

extern mDoGph_gInf_c g_mDoGph_graphicInfo;

#endif /* M_DO_M_DO_GRAPHIC_H */