Twilight Princess
Decompilation of The Legend of Zelda: Twilight Princess
Loading...
Searching...
No Matches
m_Do_graphic.h
Go to the documentation of this file.
1#ifndef M_DO_M_DO_GRAPHIC_H
2#define M_DO_M_DO_GRAPHIC_H
3
4#include "JSystem/JFramework/JFWDisplay.h"
5#include "m_Do/m_Do_mtx.h"
6#include "global.h"
7
8#define FB_WIDTH_BASE (608)
9#define FB_HEIGHT_BASE (448)
10#if WIDESCREEN_SUPPORT
11#define FB_WIDTH (640)
12#define FB_HEIGHT (456)
13#else
14#define FB_WIDTH FB_WIDTH_BASE
15#define FB_HEIGHT FB_HEIGHT_BASE
16#endif
17
18int mDoGph_Create();
19void mDoGph_drawFilterQuad(s8 param_0, s8 param_1);
20
21struct ResTIMG;
22class JKRSolidHeap;
24public:
25 class bloom_c {
26 public:
27 bloom_c() { m_buffer = NULL; }
28 void create();
29 void remove();
30 void draw();
31
32 u8 getEnable() { return mEnable; }
33 void setEnable(u8 i_enable) { mEnable = i_enable; }
36 void setPoint(u8 i_point) { mPoint = i_point; }
37 void setBlureSize(u8 i_size) { mBlureSize = i_size; }
38 void setBlureRatio(u8 i_ratio) { mBlureRatio = i_ratio; }
39 void setBlendColor(GXColor i_color) { mBlendColor = i_color; }
40 void setMonoColor(GXColor i_color) { mMonoColor = i_color; }
41 void setMode(u8 i_mode) { mMode = i_mode; }
42 void* getBuffer() { return m_buffer; }
43 u8 getPoint() { return mPoint; }
44 u8 getBlureSize() { return mBlureSize; }
45 u8 getBlureRatio() { return mBlureRatio; }
46
47 /* 0x00 */ GXColor mBlendColor;
48 /* 0x04 */ GXColor mMonoColor;
49 /* 0x08 */ u8 mEnable;
50 /* 0x09 */ u8 mMode;
51 /* 0x0A */ u8 mPoint;
52 /* 0x0B */ u8 mBlureSize;
53 /* 0x0C */ u8 mBlureRatio;
54 /* 0x10 */ void* m_buffer;
55 };
56
57 #if PLATFORM_WII || PLATFORM_SHIELD
58 class csr_c {
59 public:
60 virtual ~csr_c() {}
61 virtual void draw(f32, f32) = 0;
62 virtual bool isPointer();
63
64 static void particleExecute();
65 static u32 getBlurID() { return m_blurID; }
66
67 static u32 m_blurID;
71 };
72
73 static void entryBaseCsr(csr_c*);
74 static void releaseCsr(void);
75 static void entryCsr(csr_c*);
76 #endif
77
78 static void create();
79 static void beginRender();
80 static void fadeOut(f32);
81 static void fadeOut(f32, _GXColor&);
82 static void fadeIn(f32 fadeSpeed, _GXColor& fadeColor) {
83 fadeOut(-fadeSpeed, fadeColor);
84 }
85 static void fadeOut_f(f32, _GXColor&);
86 static void onBlure(const Mtx);
87 static void onBlure();
88 static void calcFade();
89
90 static void fadeIn(f32 fadeSpeed) {
91 fadeOut(-fadeSpeed);
92 }
93
94 static JUTFader* getFader() { return mFader; }
95 static void setFader(JUTFader* fader) {
96 JFWDisplay::getManager()->setFader(fader);
97 mFader = fader;
98 }
99
100 static int startFadeOut(int param_0) { return JFWDisplay::getManager()->startFadeOut(param_0); }
101 static int startFadeIn(int param_0) { return JFWDisplay::getManager()->startFadeIn(param_0); }
102 static void setFadeColor(JUtility::TColor& color) { mFader->setColor(color); }
103 static void setClearColor(JUtility::TColor color) { JFWDisplay::getManager()->setClearColor(color); }
104 static void setBackColor(GXColor& color) { mBackColor = color; }
105 static void endFrame() { JFWDisplay::getManager()->endFrame(); }
106 static void offFade() { mFade = 0; }
107 static u8 isFade() { return mFade; }
108 static void fadeIn_f(f32 i_fadeSpeed, _GXColor& i_fadeColor) { fadeOut_f(-i_fadeSpeed, i_fadeColor); }
109 static void offBlure() { mBlureFlag = false; }
110 static u8 isBlure() { return mBlureFlag; }
111 static void setBlureRate(u8 i_rate) { mBlureRate = i_rate; }
112 static u8 getBlureRate() { return mBlureRate; }
113 static MtxP getBlureMtx() { return mBlureMtx; }
114 static void offAutoForcus() { mAutoForcus = 0; }
115 static BOOL isAutoForcus() { return mAutoForcus; }
116 static void setTickRate(u32 rate) { JFWDisplay::getManager()->setTickRate(rate); }
117 static void waitBlanking(int wait) { JFWDisplay::getManager()->waitBlanking(wait); }
118
119 static void setBlureMtx(const Mtx m) {
121 }
122
123 static f32 getWidthF() {
124 #if WIDESCREEN_SUPPORT
125 return m_widthF;
126 #else
127 return FB_WIDTH;
128 #endif
129 }
130
131 static f32 getHeightF() {
132 #if WIDESCREEN_SUPPORT
133 return m_heightF;
134 #else
135 return FB_HEIGHT;
136 #endif
137 }
138
139 static f32 getWidth() { return FB_WIDTH; }
140 static f32 getHeight() { return FB_HEIGHT; }
141
142 static f32 getMinYF() {
143 #if WIDESCREEN_SUPPORT
144 return m_minYF;
145 #else
146 return 0.0f;
147 #endif
148 }
149
150 static f32 getMinXF() {
151 #if WIDESCREEN_SUPPORT
152 return m_minXF;
153 #else
154 return 0.0f;
155 #endif
156 }
157
158 static f32 getMaxYF() {
159 #if WIDESCREEN_SUPPORT
160 return m_maxYF;
161 #else
162 return FB_HEIGHT;
163 #endif
164 }
165
166 static f32 getMaxXF() {
167 #if WIDESCREEN_SUPPORT
168 return m_maxXF;
169 #else
170 return FB_WIDTH;
171 #endif
172 }
173
174 static f32 getAspect() {
175 #if WIDESCREEN_SUPPORT
176 return m_aspect;
177 #else
178 return 1.3571428f;
179 #endif
180 }
181
182 static int getMinY() {
183 #if WIDESCREEN_SUPPORT
184 return m_minY;
185 #else
186 return 0;
187 #endif
188 }
189
190 static int getMinX() {
191 #if WIDESCREEN_SUPPORT
192 return m_minX;
193 #else
194 return 0;
195 #endif
196 }
197
198 static int getMaxY() {
199 #if WIDESCREEN_SUPPORT
200 return m_maxY;
201 #else
202 return FB_HEIGHT;
203 #endif
204 }
205
206 static int getMaxX() {
207 #if WIDESCREEN_SUPPORT
208 return m_maxX;
209 #else
210 return FB_WIDTH;
211 #endif
212 }
213
214 static ResTIMG* getFrameBufferTimg() { return mFrameBufferTimg; }
215 static ResTIMG* getZbufferTimg() { return mZbufferTimg; }
216 static void* getFrameBufferTex() { return mFrameBufferTex; }
217 static void* getZbufferTex() { return mZbufferTex; }
218 static void setFadeRate(f32 rate) { mFadeRate = rate; }
219 static f32 getFadeRate() { return mFadeRate; }
220 static bloom_c* getBloom() { return &m_bloom; }
221 static GXColor& getFadeColor() { return mFadeColor; }
222 static GXColor& getBackColor() { return mBackColor; }
223 static void endRender() { JFWDisplay::getManager()->endRender(); }
226 static void setFrameRate(u16 i_rate) { JFWDisplay::getManager()->setFrameRate(i_rate); }
227
228 static int getFrameBufferSize() {
229 #define RoundUp16b(x) (u16)(((u16)(x) + 16 - 1) & ~(16 - 1))
230 return RoundUp16b(JFWDisplay::getManager()->getEfbWidth()) * JFWDisplay::getManager()->getEfbHeight() * 2;
231 }
232
233 static void* getFrameBufferMemory() {
234 return JFWDisplay::getManager()->getXfbManager()->getDisplayingXfb();
235 }
236
237 static f32 getInvScale() {
238 #if WIDESCREEN_SUPPORT
239 return m_invScale;
240 #else
241 return 1.0f;
242 #endif
243 }
244
245 static f32 getScale() {
246 #if WIDESCREEN_SUPPORT
247 return m_scale;
248 #else
249 return 1.0f;
250 #endif
251 }
252
253 #if WIDESCREEN_SUPPORT
254 static void setTvSize();
255
256 static void onWide();
257 static void offWide();
258 static u8 isWide();
259
260 static void onWideZoom();
261 static void offWideZoom();
262 static BOOL isWideZoom();
263
264 static void setWideZoomProjection(Mtx44& m);
265 static void setWideZoomLightProjection(Mtx& m);
266 #endif
267
271 static Mtx mBlureMtx;
272 static GXColor mBackColor;
273 static GXColor mFadeColor;
274 static JUTFader* mFader;
275 static ResTIMG* mFrameBufferTimg;
276 static void* mFrameBufferTex;
277 static ResTIMG* mZbufferTimg;
278 static void* mZbufferTex;
279 static f32 mFadeRate;
280 static f32 mFadeSpeed;
281 static u8 mBlureFlag;
282 static u8 mBlureRate;
283 static u8 mFade;
284 static bool mAutoForcus;
285
286 #if PLATFORM_SHIELD
287 static JKRHeap* getHeap() {
288 return m_heap;
289 }
290
291 static void setHeap(JKRSolidHeap* i_heap) {
292 m_heap = (JKRHeap*)i_heap;
293 }
294
295 static JKRHeap* m_heap;
296 #endif
297
298 #if PLATFORM_WII || PLATFORM_SHIELD
299 static void resetDimming();
300
302 static csr_c* m_csr;
303
307 #endif
308
309 #if WIDESCREEN_SUPPORT
310 static u8 mWide;
311 static u8 mWideZoom;
312 static ResTIMG* m_fullFrameBufferTimg;
315
316 static f32 m_aspect;
317 static f32 m_scale;
318 static f32 m_invScale;
319
320 static f32 m_minXF;
321 static f32 m_minYF;
322 static int m_minX;
323 static int m_minY;
324
325 static f32 m_maxXF;
326 static f32 m_maxYF;
327 static int m_maxX;
328 static int m_maxY;
329
330 static int m_width;
331 static int m_height;
332 static f32 m_heightF;
333 static f32 m_widthF;
334 #endif
335};
336
337#endif /* M_DO_M_DO_GRAPHIC_H */
struct _GXColor GXColor
Definition c_cc_d.h:12
Definition m_Do_graphic.h:25
GXColor * getBlendColor()
Definition m_Do_graphic.h:35
void setMonoColor(GXColor i_color)
Definition m_Do_graphic.h:40
u8 mBlureRatio
Definition m_Do_graphic.h:53
void draw()
Definition m_Do_graphic.cpp:1114
GXColor * getMonoColor()
Definition m_Do_graphic.h:34
u8 mPoint
Definition m_Do_graphic.h:51
void setBlendColor(GXColor i_color)
Definition m_Do_graphic.h:39
void remove()
Definition m_Do_graphic.cpp:1106
void * m_buffer
Definition m_Do_graphic.h:54
u8 mMode
Definition m_Do_graphic.h:50
void create()
Definition m_Do_graphic.cpp:1091
void setMode(u8 i_mode)
Definition m_Do_graphic.h:41
GXColor mBlendColor
Definition m_Do_graphic.h:47
u8 mBlureSize
Definition m_Do_graphic.h:52
u8 getEnable()
Definition m_Do_graphic.h:32
u8 mEnable
Definition m_Do_graphic.h:49
void setBlureRatio(u8 i_ratio)
Definition m_Do_graphic.h:38
void setPoint(u8 i_point)
Definition m_Do_graphic.h:36
u8 getPoint()
Definition m_Do_graphic.h:43
GXColor mMonoColor
Definition m_Do_graphic.h:48
void setEnable(u8 i_enable)
Definition m_Do_graphic.h:33
void setBlureSize(u8 i_size)
Definition m_Do_graphic.h:37
u8 getBlureSize()
Definition m_Do_graphic.h:44
bloom_c()
Definition m_Do_graphic.h:27
void * getBuffer()
Definition m_Do_graphic.h:42
u8 getBlureRatio()
Definition m_Do_graphic.h:45
Definition m_Do_graphic.h:58
virtual bool isPointer()
virtual void draw(f32, f32)=0
virtual ~csr_c()
Definition m_Do_graphic.h:60
static u32 getBlurID()
Definition m_Do_graphic.h:65
static u32 m_blurID
Definition m_Do_graphic.h:67
static cXyz m_oldEffPos
Definition m_Do_graphic.h:68
static void particleExecute()
Definition m_Do_graphic.cpp:476
static cXyz m_oldOldEffPos
Definition m_Do_graphic.h:69
static cXyz m_nowEffPos
Definition m_Do_graphic.h:70
Definition m_Do_graphic.h:23
static bloom_c * getBloom()
Definition m_Do_graphic.h:220
static ResTIMG * m_fullFrameBufferTimg
Definition m_Do_graphic.h:312
static f32 getInvScale()
Definition m_Do_graphic.h:237
static int m_height
Definition m_Do_graphic.h:331
static int getFrameBufferSize()
Definition m_Do_graphic.h:228
static csr_c * m_csr
Definition m_Do_graphic.h:302
static void setFadeRate(f32 rate)
Definition m_Do_graphic.h:218
static void onBlure()
Definition m_Do_graphic.cpp:375
static f32 m_minYF
Definition m_Do_graphic.h:321
static void releaseCsr(void)
Definition m_Do_graphic.cpp:679
static ResTIMG * getZbufferTimg()
Definition m_Do_graphic.h:215
static ResTIMG * mFrameBufferTimg
Definition m_Do_graphic.h:275
static f32 m_maxXF
Definition m_Do_graphic.h:325
static u8 mBlureFlag
Definition m_Do_graphic.h:281
static f32 getMinYF()
Definition m_Do_graphic.h:142
static f32 m_invScale
Definition m_Do_graphic.h:318
static void setBlureMtx(const Mtx m)
Definition m_Do_graphic.h:119
static f32 m_minXF
Definition m_Do_graphic.h:320
static void * mZbufferTex
Definition m_Do_graphic.h:278
static MtxP getBlureMtx()
Definition m_Do_graphic.h:113
static cXyz m_oldOldEffPos
Definition m_Do_graphic.h:306
static int startFadeIn(int param_0)
Definition m_Do_graphic.h:101
static u8 mBlureRate
Definition m_Do_graphic.h:282
static void setHeap(JKRSolidHeap *i_heap)
Definition m_Do_graphic.h:291
static void setFrameRate(u16 i_rate)
Definition m_Do_graphic.h:226
static u8 isWide()
Definition m_Do_graphic.cpp:581
static GXTexObj * getFrameBufferTexObj()
Definition m_Do_graphic.h:225
static int getMaxY()
Definition m_Do_graphic.h:198
static int m_minY
Definition m_Do_graphic.h:323
static int getMaxX()
Definition m_Do_graphic.h:206
static csr_c * m_baseCsr
Definition m_Do_graphic.h:301
static GXTexObj mZbufferTexObj
Definition m_Do_graphic.h:269
static void fadeIn(f32 fadeSpeed, _GXColor &fadeColor)
Definition m_Do_graphic.h:82
static u8 isFade()
Definition m_Do_graphic.h:107
static GXColor mBackColor
Definition m_Do_graphic.h:269
static int startFadeOut(int param_0)
Definition m_Do_graphic.h:100
static JKRHeap * m_heap
Definition m_Do_graphic.h:295
static cXyz m_oldEffPos
Definition m_Do_graphic.h:305
static GXTexObj m_fullFrameBufferTexObj
Definition m_Do_graphic.h:314
static void setFadeColor(JUtility::TColor &color)
Definition m_Do_graphic.h:102
static void endRender()
Definition m_Do_graphic.h:223
static void waitBlanking(int wait)
Definition m_Do_graphic.h:117
static f32 getWidthF()
Definition m_Do_graphic.h:123
static void setBackColor(GXColor &color)
Definition m_Do_graphic.h:104
static u8 getBlureRate()
Definition m_Do_graphic.h:112
static GXTexObj * getZbufferTexObj()
Definition m_Do_graphic.h:224
static f32 getFadeRate()
Definition m_Do_graphic.h:219
static void setFader(JUTFader *fader)
Definition m_Do_graphic.h:95
static JUTFader * mFader
Definition m_Do_graphic.h:274
static void fadeOut(f32, _GXColor &)
static void setBlureRate(u8 i_rate)
Definition m_Do_graphic.h:111
static void beginRender()
Definition m_Do_graphic.cpp:338
static GXColor & getBackColor()
Definition m_Do_graphic.h:222
static void setTickRate(u32 rate)
Definition m_Do_graphic.h:116
static u8 mWide
Definition m_Do_graphic.h:310
static int m_maxY
Definition m_Do_graphic.h:328
static ResTIMG * mZbufferTimg
Definition m_Do_graphic.h:277
static f32 getAspect()
Definition m_Do_graphic.h:174
static void entryBaseCsr(csr_c *)
Definition m_Do_graphic.cpp:669
static JKRHeap * getHeap()
Definition m_Do_graphic.h:287
static f32 m_scale
Definition m_Do_graphic.h:317
static int m_minX
Definition m_Do_graphic.h:322
static void endFrame()
Definition m_Do_graphic.h:105
static void setWideZoomLightProjection(Mtx &m)
Definition m_Do_graphic.cpp:631
static cXyz m_nowEffPos
Definition m_Do_graphic.h:304
static f32 m_aspect
Definition m_Do_graphic.h:316
static f32 mFadeRate
Definition m_Do_graphic.h:279
static f32 getScale()
Definition m_Do_graphic.h:245
static void offBlure()
Definition m_Do_graphic.h:109
static f32 getHeight()
Definition m_Do_graphic.h:140
static void * getFrameBufferTex()
Definition m_Do_graphic.h:216
static void setTvSize()
Definition m_Do_graphic.cpp:535
static void setClearColor(JUtility::TColor color)
Definition m_Do_graphic.h:103
static void onWide()
Definition m_Do_graphic.cpp:557
static f32 m_maxYF
Definition m_Do_graphic.h:326
static void resetDimming()
Definition m_Do_graphic.cpp:356
static void offFade()
Definition m_Do_graphic.h:106
static GXTexObj mFrameBufferTexObj
Definition m_Do_graphic.h:268
static void fadeOut(f32)
Definition m_Do_graphic.cpp:402
static void * getFrameBufferMemory()
Definition m_Do_graphic.h:233
static int m_width
Definition m_Do_graphic.h:330
static GXColor & getFadeColor()
Definition m_Do_graphic.h:221
static bloom_c m_bloom
Definition m_Do_graphic.h:270
static f32 m_heightF
Definition m_Do_graphic.h:332
static u8 isBlure()
Definition m_Do_graphic.h:110
static void offWideZoom()
Definition m_Do_graphic.cpp:573
static void * getZbufferTex()
Definition m_Do_graphic.h:217
static f32 m_widthF
Definition m_Do_graphic.h:333
static void * mFrameBufferTex
Definition m_Do_graphic.h:276
static f32 mFadeSpeed
Definition m_Do_graphic.h:280
static f32 getHeightF()
Definition m_Do_graphic.h:131
static ResTIMG * getFrameBufferTimg()
Definition m_Do_graphic.h:214
static GXColor mFadeColor
Definition m_Do_graphic.h:271
static void create()
Definition m_Do_graphic.cpp:281
static void fadeIn(f32 fadeSpeed)
Definition m_Do_graphic.h:90
static Mtx mBlureMtx
Definition m_Do_graphic.h:271
static void entryCsr(csr_c *)
Definition m_Do_graphic.cpp:675
static void fadeOut_f(f32, _GXColor &)
Definition m_Do_graphic.cpp:368
static int getMinX()
Definition m_Do_graphic.h:190
static JUTFader * getFader()
Definition m_Do_graphic.h:94
static bool mAutoForcus
Definition m_Do_graphic.h:284
static f32 getMinXF()
Definition m_Do_graphic.h:150
static void offWide()
Definition m_Do_graphic.cpp:563
static int getMinY()
Definition m_Do_graphic.h:182
static void * m_fullFrameBufferTex
Definition m_Do_graphic.h:313
static f32 getWidth()
Definition m_Do_graphic.h:139
static f32 getMaxYF()
Definition m_Do_graphic.h:158
static u8 mFade
Definition m_Do_graphic.h:283
static BOOL isAutoForcus()
Definition m_Do_graphic.h:115
static u8 mWideZoom
Definition m_Do_graphic.h:311
static BOOL isWideZoom()
Definition m_Do_graphic.cpp:577
static f32 getMaxXF()
Definition m_Do_graphic.h:166
static void setWideZoomProjection(Mtx44 &m)
Definition m_Do_graphic.cpp:585
static void offAutoForcus()
Definition m_Do_graphic.h:114
static void fadeIn_f(f32 i_fadeSpeed, _GXColor &i_fadeColor)
Definition m_Do_graphic.h:108
static void onWideZoom()
Definition m_Do_graphic.cpp:569
static void calcFade()
Definition m_Do_graphic.cpp:444
static int m_maxX
Definition m_Do_graphic.h:327
static void wait(b_gos_class *i_this)
Definition d_a_b_gos.cpp:70
int mDoGph_Create()
Definition m_Do_graphic.cpp:2121
void mDoGph_drawFilterQuad(s8 param_0, s8 param_1)
Definition m_Do_graphic.cpp:1077
struct _GXTexObj GXTexObj
Definition m_Do_lib.h:6
void cMtx_copy(const Mtx src, Mtx dst)
Definition m_Do_mtx.h:98
Definition c_xyz.h:7