2022-10-09 05:13:17 +00:00
|
|
|
#ifndef _CGRAPHICS
|
|
|
|
#define _CGRAPHICS
|
2022-04-10 00:17:06 +00:00
|
|
|
|
|
|
|
#include "types.h"
|
|
|
|
|
2022-11-30 01:56:37 +00:00
|
|
|
#include "Kyoto/CTimeProvider.hpp"
|
2022-08-13 01:26:00 +00:00
|
|
|
#include "Kyoto/Graphics/CColor.hpp"
|
2022-11-30 01:56:37 +00:00
|
|
|
#include "Kyoto/Graphics/CLight.hpp"
|
|
|
|
#include "Kyoto/Graphics/CTevCombiners.hpp"
|
2022-12-06 23:32:47 +00:00
|
|
|
#include "Kyoto/Graphics/CTexture.hpp"
|
2022-12-01 05:58:57 +00:00
|
|
|
#include "Kyoto/Math/CMatrix4f.hpp"
|
2022-08-16 02:14:28 +00:00
|
|
|
#include "Kyoto/Math/CTransform4f.hpp"
|
2022-12-06 23:32:47 +00:00
|
|
|
#include "Kyoto/Math/CVector2i.hpp"
|
2022-09-18 06:05:46 +00:00
|
|
|
#include "Kyoto/Math/CVector3f.hpp"
|
2022-07-18 22:42:58 +00:00
|
|
|
|
2022-11-30 01:56:37 +00:00
|
|
|
#include "dolphin/gx.h"
|
|
|
|
#include "dolphin/mtx.h"
|
2022-07-02 05:30:04 +00:00
|
|
|
|
2022-11-27 00:26:12 +00:00
|
|
|
enum ERglFogMode {
|
|
|
|
kRFM_None = GX_FOG_NONE,
|
|
|
|
|
|
|
|
kRFM_PerspLin = GX_FOG_PERSP_LIN,
|
|
|
|
kRFM_PerspExp = GX_FOG_PERSP_EXP,
|
|
|
|
kRFM_PerspExp2 = GX_FOG_ORTHO_EXP2,
|
|
|
|
kRFM_PerspRevExp = GX_FOG_PERSP_REVEXP,
|
|
|
|
kRFM_PerspRevExp2 = GX_FOG_PERSP_REVEXP2,
|
|
|
|
|
|
|
|
kRFM_OrthoLin = GX_FOG_ORTHO_LIN,
|
|
|
|
kRFM_OrthoExp = GX_FOG_ORTHO_EXP,
|
|
|
|
kRFM_OrthoExp2 = GX_FOG_ORTHO_EXP2,
|
|
|
|
kRFM_OrthoRevExp = GX_FOG_ORTHO_REVEXP,
|
|
|
|
kRFM_OrthoRevExp2 = GX_FOG_ORTHO_REVEXP2,
|
|
|
|
};
|
|
|
|
|
2022-07-02 05:30:04 +00:00
|
|
|
enum ERglTevStage {
|
|
|
|
kTS_Stage0,
|
|
|
|
kTS_Stage1,
|
|
|
|
kTS_Stage2,
|
|
|
|
kTS_Stage3,
|
|
|
|
kTS_Stage4,
|
|
|
|
kTS_Stage5,
|
|
|
|
kTS_Stage6,
|
|
|
|
kTS_Stage7,
|
|
|
|
kTS_Stage8,
|
|
|
|
kTS_Stage9,
|
|
|
|
kTS_Stage10,
|
|
|
|
kTS_Stage11,
|
|
|
|
kTS_Stage12,
|
|
|
|
kTS_Stage13,
|
|
|
|
kTS_Stage14,
|
|
|
|
kTS_Stage15,
|
|
|
|
kTS_MaxStage,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ERglPrimitive {
|
2022-10-17 02:33:08 +00:00
|
|
|
kP_Quads = GX_QUADS,
|
|
|
|
kP_Triangles = GX_TRIANGLES,
|
|
|
|
kP_TriangleStrip = GX_TRIANGLESTRIP,
|
|
|
|
kP_TriangleFan = GX_TRIANGLEFAN,
|
|
|
|
kP_Lines = GX_LINES,
|
|
|
|
kP_LineStrip = GX_LINESTRIP,
|
|
|
|
kP_Points = GX_POINTS,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ERglBlendMode {
|
|
|
|
kBM_None = GX_BM_NONE,
|
|
|
|
kBM_Blend = GX_BM_BLEND,
|
|
|
|
kBM_Logic = GX_BM_LOGIC,
|
|
|
|
kBM_Subtract = GX_BM_SUBTRACT,
|
|
|
|
kBM_Max = GX_MAX_BLENDMODE,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ERglBlendFactor {
|
|
|
|
kBF_Zero = GX_BL_ZERO,
|
|
|
|
kBF_One = GX_BL_ONE,
|
|
|
|
kBF_SrcColor = GX_BL_SRCCLR,
|
|
|
|
kBF_InvSrcColor = GX_BL_INVSRCCLR,
|
|
|
|
kBF_SrcAlpha = GX_BL_SRCALPHA,
|
|
|
|
kBF_InvSrcAlpha = GX_BL_INVSRCALPHA,
|
|
|
|
kBF_DstAlpha = GX_BL_DSTALPHA,
|
|
|
|
kBF_InvDstAlpha = GX_BL_INVDSTALPHA,
|
|
|
|
kBF_DstColor = GX_BL_DSTCLR,
|
|
|
|
kBF_InvDstColor = GX_BL_INVDSTCLR,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ERglLogicOp {
|
|
|
|
kLO_Clear = GX_LO_CLEAR,
|
|
|
|
kLO_And = GX_LO_AND,
|
|
|
|
kLO_RevAnd = GX_LO_REVAND,
|
|
|
|
kLO_Copy = GX_LO_COPY,
|
|
|
|
kLO_InvAnd = GX_LO_INVAND,
|
|
|
|
kLO_NoOp = GX_LO_NOOP,
|
|
|
|
kLO_Xor = GX_LO_XOR,
|
|
|
|
kLO_Or = GX_LO_OR,
|
|
|
|
kLO_Nor = GX_LO_NOR,
|
|
|
|
kLO_Equiv = GX_LO_EQUIV,
|
|
|
|
kLO_Inv = GX_LO_INV,
|
|
|
|
kLO_RevOr = GX_LO_REVOR,
|
|
|
|
kLO_InvCopy = GX_LO_INVCOPY,
|
|
|
|
kLO_InvOr = GX_LO_INVOR,
|
|
|
|
kLO_NAnd = GX_LO_NAND,
|
|
|
|
kLO_Set = GX_LO_SET,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ERglAlphaFunc {
|
|
|
|
kAF_Never = GX_NEVER,
|
|
|
|
kAF_Less = GX_LESS,
|
|
|
|
kAF_Equal = GX_EQUAL,
|
|
|
|
kAF_LEqual = GX_LEQUAL,
|
|
|
|
kAF_Greater = GX_GREATER,
|
|
|
|
kAF_NEqual = GX_NEQUAL,
|
|
|
|
kAF_GEqual = GX_GEQUAL,
|
|
|
|
kAF_Always = GX_ALWAYS,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ERglAlphaOp {
|
|
|
|
kAO_And = GX_AOP_AND,
|
|
|
|
kAO_Or = GX_AOP_OR,
|
|
|
|
kAO_Xor = GX_AOP_XOR,
|
|
|
|
kAO_XNor = GX_AOP_XNOR,
|
|
|
|
kAO_Max = GX_MAX_ALPHAOP,
|
|
|
|
};
|
|
|
|
|
|
|
|
enum ERglEnum {
|
|
|
|
kE_Never = GX_NEVER,
|
|
|
|
kE_Less = GX_LESS,
|
|
|
|
kE_Equal = GX_EQUAL,
|
|
|
|
kE_LEqual = GX_LEQUAL,
|
|
|
|
kE_Greater = GX_GREATER,
|
|
|
|
kE_NEqual = GX_NEQUAL,
|
|
|
|
kE_GEqual = GX_GEQUAL,
|
|
|
|
kE_Always = GX_ALWAYS,
|
2022-07-02 05:30:04 +00:00
|
|
|
};
|
|
|
|
|
2022-11-02 03:52:49 +00:00
|
|
|
enum ERglCullMode {
|
|
|
|
kCM_None = GX_CULL_NONE,
|
|
|
|
kCM_Front = GX_CULL_FRONT,
|
|
|
|
kCM_Back = GX_CULL_BACK,
|
|
|
|
kCM_All = GX_CULL_ALL,
|
|
|
|
};
|
|
|
|
|
2022-11-30 01:56:37 +00:00
|
|
|
enum ERglLight {
|
|
|
|
kLight0,
|
|
|
|
kLight1,
|
|
|
|
kLight2,
|
|
|
|
kLight3,
|
|
|
|
kLight4,
|
|
|
|
kLight5,
|
|
|
|
kLight6,
|
|
|
|
kLight7,
|
|
|
|
kLightMax,
|
|
|
|
};
|
2022-11-07 00:20:46 +00:00
|
|
|
|
2022-12-02 05:19:15 +00:00
|
|
|
enum ERglTexOffset {
|
|
|
|
kTO_Zero = GX_TO_ZERO,
|
|
|
|
kTO_Sixteenth = GX_TO_SIXTEENTH,
|
|
|
|
kTO_Eighth = GX_TO_EIGHTH,
|
|
|
|
kTO_Fourth = GX_TO_FOURTH,
|
|
|
|
kTO_Half = GX_TO_HALF,
|
|
|
|
kTO_One = GX_TO_ONE,
|
|
|
|
};
|
|
|
|
|
2022-11-07 00:20:46 +00:00
|
|
|
struct CViewport {
|
|
|
|
int mLeft;
|
|
|
|
int mTop;
|
|
|
|
int mWidth;
|
|
|
|
int mHeight;
|
|
|
|
float mHalfWidth;
|
|
|
|
float mHalfHeight;
|
|
|
|
};
|
|
|
|
|
2022-11-30 01:56:37 +00:00
|
|
|
class COsContext;
|
2022-12-01 05:58:57 +00:00
|
|
|
class CTexture;
|
2022-10-01 06:19:09 +00:00
|
|
|
class CTimeProvider;
|
|
|
|
|
2022-12-01 05:58:57 +00:00
|
|
|
// TODO
|
2022-11-30 01:56:37 +00:00
|
|
|
typedef struct {
|
|
|
|
float x;
|
|
|
|
float y;
|
|
|
|
} Vec2, *Vec2Ptr;
|
|
|
|
|
2022-04-10 00:17:06 +00:00
|
|
|
class CGraphics {
|
|
|
|
public:
|
2022-11-30 01:56:37 +00:00
|
|
|
class CRenderState {
|
|
|
|
public:
|
|
|
|
CRenderState();
|
|
|
|
|
2022-12-02 19:35:58 +00:00
|
|
|
void Flush();
|
2022-11-30 01:56:37 +00:00
|
|
|
void ResetFlushAll();
|
2022-12-06 23:32:47 +00:00
|
|
|
int SetVtxState(const float* pos, const float* nrm, const uint* clr);
|
2022-12-02 19:35:58 +00:00
|
|
|
|
|
|
|
// In map this takes two args, but x4 is unused?
|
|
|
|
void Set(int v0) { x0_ = v0; }
|
2022-11-30 01:56:37 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
int x0_;
|
|
|
|
int x4_;
|
|
|
|
};
|
2022-12-02 19:35:58 +00:00
|
|
|
|
2022-11-30 01:56:37 +00:00
|
|
|
class CProjectionState {
|
|
|
|
public:
|
|
|
|
CProjectionState(bool persp, float left, float right, float top, float bottom, float near,
|
|
|
|
float far)
|
|
|
|
: x0_persp(persp)
|
|
|
|
, x4_left(left)
|
|
|
|
, x8_right(right)
|
|
|
|
, xc_top(top)
|
|
|
|
, x10_bottom(bottom)
|
|
|
|
, x14_near(near)
|
|
|
|
, x18_far(far) {}
|
|
|
|
|
2022-12-01 05:58:57 +00:00
|
|
|
bool IsPerspective() const { return x0_persp; }
|
|
|
|
float GetLeft() const { return x4_left; }
|
|
|
|
float GetRight() const { return x8_right; }
|
|
|
|
float GetTop() const { return xc_top; }
|
|
|
|
float GetBottom() const { return x10_bottom; }
|
2022-11-30 01:56:37 +00:00
|
|
|
float GetNear() const { return x14_near; }
|
|
|
|
float GetFar() const { return x18_far; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool x0_persp;
|
|
|
|
float x4_left;
|
|
|
|
float x8_right;
|
|
|
|
float xc_top;
|
|
|
|
float x10_bottom;
|
|
|
|
float x14_near;
|
|
|
|
float x18_far;
|
|
|
|
};
|
|
|
|
|
2022-12-06 23:32:47 +00:00
|
|
|
class CClippedScreenRect {
|
|
|
|
public:
|
|
|
|
CClippedScreenRect() : x0_valid(false) {}
|
|
|
|
CClippedScreenRect(int x, int y, int width, int height, int texWidth, float minU, float maxU,
|
|
|
|
float minV, float maxV)
|
|
|
|
: x0_valid(true)
|
|
|
|
, x4_x(x)
|
|
|
|
, x8_y(y)
|
|
|
|
, xc_width(width)
|
|
|
|
, x10_height(height)
|
|
|
|
, x14_texWidth(texWidth)
|
|
|
|
, x18_minU(minU)
|
|
|
|
, x1c_maxU(maxU)
|
|
|
|
, x20_minV(minV)
|
|
|
|
, x24_maxV(maxV) {}
|
|
|
|
|
|
|
|
bool IsValid() const { return x0_valid; }
|
|
|
|
int GetX() const { return x4_x; }
|
|
|
|
int GetY() const { return x8_y; }
|
|
|
|
int GetWidth() const { return xc_width; }
|
|
|
|
int GetHeight() const { return x10_height; }
|
|
|
|
int GetTexWidth() const { return x14_texWidth; }
|
|
|
|
float GetMinU() const { return x18_minU; }
|
|
|
|
float GetMaxU() const { return x1c_maxU; }
|
|
|
|
float GetMinV() const { return x20_minV; }
|
|
|
|
float GetMaxV() const { return x24_maxV; }
|
|
|
|
|
|
|
|
private:
|
|
|
|
bool x0_valid;
|
|
|
|
int x4_x;
|
|
|
|
int x8_y;
|
|
|
|
int xc_width;
|
|
|
|
int x10_height;
|
|
|
|
int x14_texWidth;
|
|
|
|
float x18_minU;
|
|
|
|
float x1c_maxU;
|
|
|
|
float x20_minV;
|
|
|
|
float x24_maxV;
|
|
|
|
};
|
|
|
|
|
2022-11-30 01:56:37 +00:00
|
|
|
static bool Startup(const COsContext& osContext, uint fifoSize, void* fifoBase);
|
|
|
|
static GXTexRegion* TexRegionCallback(const GXTexObj* obj, GXTexMapID id);
|
|
|
|
static void InitGraphicsVariables();
|
|
|
|
static void Shutdown();
|
|
|
|
static void InitGraphicsDefaults();
|
|
|
|
static void ConfigureFrameBuffer(const COsContext& osContext);
|
|
|
|
static void EnableLight(ERglLight light);
|
|
|
|
static void LoadLight(ERglLight light, const CLight& info);
|
2022-11-30 06:43:17 +00:00
|
|
|
static void SetLightState(uchar lights);
|
|
|
|
static void SetViewMatrix();
|
2022-12-01 05:58:57 +00:00
|
|
|
static void SetScissor(int left, int bottom, int width, int height);
|
2022-12-02 05:19:15 +00:00
|
|
|
static void SetLineWidth(float w, ERglTexOffset offs);
|
2022-12-01 05:58:57 +00:00
|
|
|
static void ClearBackAndDepthBuffers();
|
2022-11-30 01:56:37 +00:00
|
|
|
|
|
|
|
static void SetIdentityViewPointMatrix();
|
|
|
|
static void SetIdentityModelMatrix();
|
|
|
|
static void SetViewport(int left, int bottom, int width, int height);
|
|
|
|
static void SetPerspective(float fovy, float aspect, float znear, float zfar);
|
|
|
|
static void SetCopyClear(const CColor& color, float depth);
|
2022-12-01 05:58:57 +00:00
|
|
|
static void SetClearColor(const CColor& color);
|
2022-11-30 01:56:37 +00:00
|
|
|
static void SetDepthRange(float near, float far);
|
|
|
|
static void FlushProjection();
|
|
|
|
static void SetDefaultVtxAttrFmt();
|
2022-12-01 05:58:57 +00:00
|
|
|
static CMatrix4f GetPerspectiveProjectionMatrix();
|
|
|
|
static CMatrix4f CalculatePerspectiveMatrix(float fovy, float aspect, float znear, float zfar);
|
2022-12-02 19:35:58 +00:00
|
|
|
static void ResetGfxStates();
|
|
|
|
static void LoadDolphinSpareTexture(int width, int height, GXTexFmt fmt, void* data,
|
|
|
|
GXTexMapID texId);
|
|
|
|
static void LoadDolphinSpareTexture(int width, int height, GXCITexFmt fmt, GXTlut tlut,
|
|
|
|
void* data, GXTexMapID texId);
|
|
|
|
static void TickRenderTimings();
|
|
|
|
static const CProjectionState& GetProjectionState();
|
|
|
|
static void SetProjectionState(const CProjectionState& proj);
|
2022-12-06 23:32:47 +00:00
|
|
|
static CClippedScreenRect ClipScreenRectFromVS(const CVector3f& p1, const CVector3f& p2,
|
|
|
|
ETexelFormat fmt);
|
|
|
|
static CClippedScreenRect ClipScreenRectFromMS(const CVector3f& p1, const CVector3f& p2,
|
|
|
|
ETexelFormat fmt);
|
|
|
|
static CVector2i ProjectPoint(const CVector3f& point);
|
2022-12-02 19:35:58 +00:00
|
|
|
|
2022-12-01 16:11:09 +00:00
|
|
|
static float GetDepthNear() { return mDepthNear; }
|
|
|
|
static float GetDepthFar() { return mDepthFar; }
|
2022-11-30 01:56:37 +00:00
|
|
|
|
2022-11-24 00:41:55 +00:00
|
|
|
static bool IsBeginSceneClearFb();
|
2022-04-10 00:17:06 +00:00
|
|
|
static void SetIsBeginSceneClearFb(bool);
|
|
|
|
static void BeginScene();
|
|
|
|
static void EndScene();
|
2022-12-01 05:58:57 +00:00
|
|
|
static void SwapBuffers();
|
2022-07-02 05:30:04 +00:00
|
|
|
static void SetTevOp(ERglTevStage stage, const CTevCombiners::CTevPass& pass);
|
|
|
|
static void StreamBegin(ERglPrimitive primitive);
|
2022-11-17 04:56:21 +00:00
|
|
|
static void StreamColor(uint color);
|
2022-12-02 05:19:15 +00:00
|
|
|
static void StreamColor(float r, float g, float b, float a);
|
2022-07-02 05:30:04 +00:00
|
|
|
static void StreamColor(const CColor& color);
|
2022-10-09 05:37:23 +00:00
|
|
|
static void StreamTexcoord(float u, float v);
|
2022-12-02 05:19:15 +00:00
|
|
|
static void StreamTexcoord(const CVector2f& uv);
|
|
|
|
static void StreamVertex(float x, float y, float z);
|
2022-07-02 05:30:04 +00:00
|
|
|
static void StreamVertex(const CVector3f& vtx);
|
2022-12-02 05:19:15 +00:00
|
|
|
static void StreamVertex(const float* vtx);
|
|
|
|
static void StreamNormal(const float* nrm);
|
2022-07-02 05:30:04 +00:00
|
|
|
static void StreamEnd();
|
2022-12-01 05:58:57 +00:00
|
|
|
static void Render2D(const CTexture& tex, int x, int y, int w, int h, const CColor& col);
|
2022-12-02 19:35:58 +00:00
|
|
|
static void DrawPrimitive(ERglPrimitive primitive, const float* pos, const CVector3f& normal,
|
|
|
|
const CColor& col, int numVerts);
|
2022-12-01 05:58:57 +00:00
|
|
|
|
|
|
|
static void VideoPreCallback(u32 retraceCount);
|
|
|
|
static void VideoPostCallback(u32 retraceCount);
|
2022-08-16 02:14:28 +00:00
|
|
|
|
2022-11-07 00:20:46 +00:00
|
|
|
static const CViewport& GetViewport() { return mViewport; }
|
2022-11-30 01:56:37 +00:00
|
|
|
static const CVector3f& GetViewPoint() { return mViewPoint; }
|
2022-08-16 02:14:28 +00:00
|
|
|
static const CTransform4f& GetViewMatrix() { return mViewMatrix; }
|
2022-09-05 04:00:04 +00:00
|
|
|
static const CTransform4f& GetModelMatrix() { return mModelMatrix; }
|
2022-11-14 02:18:45 +00:00
|
|
|
static void SetViewPointMatrix(const CTransform4f&);
|
2022-10-31 16:19:28 +00:00
|
|
|
static void SetBrightness(float b) { mBrightness = b; }
|
2022-11-26 13:51:04 +00:00
|
|
|
static void SetOrtho(float left, float right, float top, float bottom, float znear, float zfar);
|
2022-09-05 04:00:04 +00:00
|
|
|
|
|
|
|
static float GetSecondsMod900();
|
2022-12-06 23:32:47 +00:00
|
|
|
static float GetFPS();
|
2022-09-14 05:53:26 +00:00
|
|
|
static void SetExternalTimeProvider(CTimeProvider* provider);
|
2022-10-04 19:58:17 +00:00
|
|
|
static void DisableAllLights();
|
2022-08-16 02:14:28 +00:00
|
|
|
|
2022-11-10 16:32:18 +00:00
|
|
|
static void SetAmbientColor(const CColor&);
|
2022-11-27 00:26:12 +00:00
|
|
|
static void SetFog(ERglFogMode mode, float startz, float endz, const CColor& color);
|
2022-11-10 16:32:18 +00:00
|
|
|
|
2022-10-17 02:33:08 +00:00
|
|
|
static void SetModelMatrix(const CTransform4f& xf);
|
2022-12-01 05:58:57 +00:00
|
|
|
static void SetAlphaCompare(ERglAlphaFunc comp0, uchar ref0, ERglAlphaOp op, ERglAlphaFunc comp1,
|
|
|
|
uchar ref1);
|
2022-10-17 02:33:08 +00:00
|
|
|
static void SetDepthWriteMode(bool test, ERglEnum comp, bool write);
|
2022-12-01 05:58:57 +00:00
|
|
|
static void SetBlendMode(ERglBlendMode mode, ERglBlendFactor src, ERglBlendFactor dst,
|
|
|
|
ERglLogicOp op);
|
|
|
|
static void SetCullMode(ERglCullMode cullMode);
|
|
|
|
static void SetTevStates(uchar);
|
2022-10-17 02:33:08 +00:00
|
|
|
|
2022-12-06 23:32:47 +00:00
|
|
|
static void SetUseVideoFilter(bool b);
|
|
|
|
static GXBool GetUseVideoFilter();
|
|
|
|
static int GetFrameCounter();
|
|
|
|
static void SetProgressiveMode(bool b);
|
|
|
|
static bool GetProgressiveMode();
|
|
|
|
static bool CanSetProgressiveMode();
|
|
|
|
static bool GetProgressiveDefault();
|
|
|
|
|
2022-10-31 16:19:28 +00:00
|
|
|
// Screen Position
|
2022-12-06 23:32:47 +00:00
|
|
|
static void GetScreenPosition(int* stretch, int* xOffset, int* yOffset);
|
|
|
|
static void SetScreenPosition(int stretch, int xOffset, int yOffset);
|
2022-10-31 16:19:28 +00:00
|
|
|
|
2022-12-02 17:33:10 +00:00
|
|
|
static const CTevCombiners::CTevPass& kEnvPassthru;
|
2022-10-17 02:33:08 +00:00
|
|
|
static CTevCombiners::CTevPass kEnvModulateConstColor;
|
|
|
|
static CTevCombiners::CTevPass kEnvConstColor;
|
|
|
|
static CTevCombiners::CTevPass kEnvModulate;
|
|
|
|
static CTevCombiners::CTevPass kEnvDecal;
|
|
|
|
static CTevCombiners::CTevPass kEnvBlend;
|
|
|
|
static CTevCombiners::CTevPass kEnvReplace;
|
|
|
|
static CTevCombiners::CTevPass kEnvModulateAlpha;
|
|
|
|
static CTevCombiners::CTevPass kEnvModulateColor;
|
2022-11-30 01:56:37 +00:00
|
|
|
static CTevCombiners::CTevPass kEnvModulateColorByAlpha;
|
2022-10-17 02:33:08 +00:00
|
|
|
|
2022-08-16 02:14:28 +00:00
|
|
|
private:
|
2022-12-02 05:19:15 +00:00
|
|
|
static void UpdateVertexDataStream();
|
|
|
|
static void ResetVertexDataStream(bool initial);
|
|
|
|
static void FlushStream();
|
|
|
|
static void FullRender();
|
|
|
|
|
2022-11-30 01:56:37 +00:00
|
|
|
static CRenderState sRenderState;
|
|
|
|
static VecPtr vtxBuffer;
|
|
|
|
static VecPtr nrmBuffer;
|
|
|
|
static Vec2Ptr txtBuffer0;
|
|
|
|
static Vec2Ptr txtBuffer1;
|
2022-12-02 05:19:15 +00:00
|
|
|
static uint* clrBuffer;
|
2022-11-30 01:56:37 +00:00
|
|
|
static bool mJustReset;
|
|
|
|
static ERglCullMode mCullMode;
|
|
|
|
static int mNumLightsActive;
|
|
|
|
static float mDepthNear;
|
|
|
|
static VecPtr mpVtxBuffer;
|
|
|
|
static VecPtr mpNrmBuffer;
|
|
|
|
static Vec2Ptr mpTxtBuffer0;
|
|
|
|
static Vec2Ptr mpTxtBuffer1;
|
2022-12-02 05:19:15 +00:00
|
|
|
static uint* mpClrBuffer;
|
2022-11-30 01:56:37 +00:00
|
|
|
static int mNumPrimitives;
|
|
|
|
static int mFrameCounter;
|
|
|
|
static float mFramesPerSecond;
|
|
|
|
static float mLastFramesPerSecond;
|
|
|
|
static int mNumBreakpointsWaiting;
|
|
|
|
static int mFlippingState;
|
|
|
|
static bool mLastFrameUsedAbove;
|
|
|
|
static bool mInterruptLastFrameUsedAbove;
|
|
|
|
static uchar mLightActive;
|
|
|
|
static uchar mLightsWereOn;
|
|
|
|
static void* mpFrameBuf1;
|
|
|
|
static void* mpFrameBuf2;
|
|
|
|
static void* mpCurrenFrameBuf;
|
|
|
|
static int mSpareBufferSize;
|
|
|
|
static void* mpSpareBuffer;
|
|
|
|
static int mSpareBufferTexCacheSize;
|
|
|
|
static GXTexRegionCallback mGXDefaultTexRegionCallback;
|
|
|
|
static void* mpFifo;
|
|
|
|
static GXFifoObj* mpFifoObj;
|
2022-12-02 19:35:58 +00:00
|
|
|
static uint mRenderTimings;
|
2022-11-30 01:56:37 +00:00
|
|
|
static float mSecondsMod900;
|
|
|
|
static CTimeProvider* mpExternalTimeProvider;
|
2022-12-06 23:32:47 +00:00
|
|
|
static int mScreenStretch;
|
|
|
|
static int mScreenPositionX;
|
|
|
|
static int mScreenPositionY;
|
2022-11-30 01:56:37 +00:00
|
|
|
|
|
|
|
static CVector3f kDefaultPositionVector;
|
|
|
|
static CVector3f kDefaultDirectionVector;
|
|
|
|
static CProjectionState mProj;
|
2022-08-16 02:14:28 +00:00
|
|
|
static CTransform4f mViewMatrix;
|
2022-09-05 04:00:04 +00:00
|
|
|
static CTransform4f mModelMatrix;
|
2022-11-30 01:56:37 +00:00
|
|
|
static CColor mClearColor;
|
|
|
|
static CVector3f mViewPoint;
|
2022-11-07 00:20:46 +00:00
|
|
|
static CViewport mViewport;
|
2022-11-30 01:56:37 +00:00
|
|
|
static ELightType mLightTypes[8];
|
|
|
|
static GXLightObj mLightObj[8];
|
|
|
|
static GXTexRegion mTexRegions[GX_MAX_TEXMAP];
|
|
|
|
static GXTexRegion mTexRegionsCI[GX_MAX_TEXMAP / 2];
|
|
|
|
static GXRenderModeObj mRenderModeObj;
|
|
|
|
static Mtx mGXViewPointMatrix;
|
|
|
|
static Mtx mGXModelMatrix;
|
|
|
|
static Mtx mGxModelView;
|
|
|
|
static Mtx mCameraMtx;
|
|
|
|
|
|
|
|
// .sdata
|
|
|
|
static bool mIsBeginSceneClearFb;
|
|
|
|
static ERglEnum mDepthFunc;
|
|
|
|
static ERglPrimitive mCurrentPrimitive;
|
|
|
|
static float mDepthFar;
|
|
|
|
static u32 mClearDepthValue; // = GX_MAX_Z24
|
|
|
|
static bool mIsGXModelMatrixIdentity;
|
|
|
|
static bool mFirstFrame;
|
2022-12-06 23:32:47 +00:00
|
|
|
static GXBool mUseVideoFilter;
|
2022-10-31 16:19:28 +00:00
|
|
|
static float mBrightness;
|
2022-12-06 23:32:47 +00:00
|
|
|
|
|
|
|
// .sdata2
|
|
|
|
static const GXTexMapID kSpareBufferTexMapID;
|
2022-04-10 00:17:06 +00:00
|
|
|
};
|
|
|
|
|
2022-10-09 05:13:17 +00:00
|
|
|
#endif // _CGRAPHICS
|