2024-09-08 21:04:31 -04:00
|
|
|
#ifndef GX_DEVICE_H
|
|
|
|
|
#define GX_DEVICE_H
|
|
|
|
|
|
|
|
|
|
#include "system/types.h"
|
|
|
|
|
|
|
|
|
|
#include "storm/array.h"
|
2024-10-02 04:19:55 -04:00
|
|
|
#include "storm/array/uint16_t.h"
|
2024-09-08 21:04:31 -04:00
|
|
|
#include "storm/array/uint32_t.h"
|
2024-10-02 04:19:55 -04:00
|
|
|
#include "storm/array/c2vector.h"
|
|
|
|
|
#include "storm/array/c3vector.h"
|
|
|
|
|
#include "storm/array/cimvector.h"
|
2024-09-08 21:04:31 -04:00
|
|
|
|
|
|
|
|
#include "tempest/box.h"
|
|
|
|
|
#include "tempest/matrix.h"
|
|
|
|
|
#include "tempest/rect.h"
|
|
|
|
|
#include "tempest/vector.h"
|
|
|
|
|
|
|
|
|
|
#include "gx/types.h"
|
|
|
|
|
#include "gx/caps.h"
|
|
|
|
|
#include "gx/format.h"
|
|
|
|
|
#include "gx/state_bom.h"
|
|
|
|
|
#include "gx/shader.h"
|
|
|
|
|
#include "gx/matrix_stack.h"
|
|
|
|
|
#include "gx/buffer.h"
|
|
|
|
|
#include "gx/texture.h"
|
2024-11-30 07:43:24 -05:00
|
|
|
#include "gx/query.h"
|
2025-04-20 15:54:44 -04:00
|
|
|
#include "gx/emergencymem.h"
|
2024-09-08 21:04:31 -04:00
|
|
|
|
2024-11-27 01:59:15 -05:00
|
|
|
DECLARE_STRUCT(CGxAppRenderState);
|
|
|
|
|
DECLARE_STRUCT(CGxPushedRenderState);
|
|
|
|
|
DECLARE_STRUCT(ShaderConstants);
|
|
|
|
|
DECLARE_STRUCT(CGxDevice);
|
2024-11-30 07:43:24 -05:00
|
|
|
DECLARE_STRUCT(CGxDevice__TextureTarget);
|
2024-11-27 01:59:15 -05:00
|
|
|
DECLARE_STRUCT(CGxDevice__vtable);
|
2024-09-08 21:04:31 -04:00
|
|
|
|
2024-09-30 17:18:50 -04:00
|
|
|
typedef void (*DEVICERESTOREDCALLBACK)();
|
|
|
|
|
STORM_TS_GROWABLE_ARRAY(DEVICERESTOREDCALLBACK);
|
|
|
|
|
|
|
|
|
|
typedef void (*TEXTURERECREATIONCALLBACK)();
|
|
|
|
|
STORM_TS_GROWABLE_ARRAY(TEXTURERECREATIONCALLBACK);
|
|
|
|
|
|
2024-11-27 01:59:15 -05:00
|
|
|
typedef void (*STEREOCHANGEDCALLBACK)();
|
|
|
|
|
STORM_TS_GROWABLE_ARRAY(STEREOCHANGEDCALLBACK);
|
2024-09-30 17:18:50 -04:00
|
|
|
|
2024-09-08 21:04:31 -04:00
|
|
|
struct CGxAppRenderState {
|
|
|
|
|
CGxStateBom m_value;
|
|
|
|
|
uint32_t m_stackDepth;
|
|
|
|
|
int32_t m_dirty;
|
|
|
|
|
};
|
|
|
|
|
STORM_TS_FIXED_ARRAY(CGxAppRenderState);
|
|
|
|
|
|
|
|
|
|
struct CGxPushedRenderState {
|
|
|
|
|
EGxRenderState m_which;
|
|
|
|
|
CGxStateBom m_value;
|
|
|
|
|
uint32_t m_stackDepth;
|
|
|
|
|
};
|
|
|
|
|
STORM_TS_GROWABLE_ARRAY(CGxPushedRenderState);
|
|
|
|
|
|
|
|
|
|
struct ShaderConstants {
|
|
|
|
|
C4Vector constants[256];
|
|
|
|
|
uint32_t unk1;
|
|
|
|
|
uint32_t unk2;
|
|
|
|
|
};
|
|
|
|
|
|
2024-11-30 07:43:24 -05:00
|
|
|
struct CGxDevice__TextureTarget {
|
|
|
|
|
CGxTex* m_texture;
|
|
|
|
|
uint32_t m_plane;
|
|
|
|
|
void* m_apiSpecific;
|
|
|
|
|
};
|
|
|
|
|
|
2024-09-08 21:04:31 -04:00
|
|
|
// 84 functions
|
|
|
|
|
struct CGxDevice__vtable {
|
2024-11-27 01:59:15 -05:00
|
|
|
// void ITexMarkAsUpdated(CGxTex* texId);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_0_ITexMarkAsUpdated;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void IRsSendToHw(EGxRenderState rs);
|
2024-09-30 17:18:50 -04:00
|
|
|
// no base implementation
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_1_IRsSendToHw;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void ICursorCreate(const CGxFormat& format);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_2_ICursorCreate;
|
|
|
|
|
// void ICursorDestroy();
|
|
|
|
|
void* v_fn_3_ICursorDestroy;
|
|
|
|
|
// void ICursorDraw();
|
|
|
|
|
void* v_fn_4_ICursorDraw;
|
2024-09-30 17:18:50 -04:00
|
|
|
// This gets called when window is resized. It runs a list of callbacks in an array.
|
|
|
|
|
// two functions that are in this array (ONLY once in-game, not in login screen):
|
|
|
|
|
// * 007E7FE0
|
|
|
|
|
// * 00512920
|
|
|
|
|
// void NotifyOnDeviceRestored();
|
|
|
|
|
void* v_fn_5_NotifyOnDeviceRestored;
|
|
|
|
|
// void NotifyOnTextureRecreation();
|
|
|
|
|
void* v_fn_6_NotifyOnTextureRecreation;
|
2024-11-27 06:53:14 -05:00
|
|
|
// void NotifyOnStereoChanged();
|
|
|
|
|
void* v_fn_7_NotifyOnStereoChanged;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void `scalar deleting destructor'(uint32_t __flags)
|
2024-10-04 01:43:35 -04:00
|
|
|
void* v_fn_8_scalar_deleting_destructor;
|
2024-11-30 07:43:24 -05:00
|
|
|
// int32_t DeviceCreate(uintptr_t hwnd, const CGxFormat& format);
|
2024-10-02 04:19:55 -04:00
|
|
|
void* v_fn_9_DeviceCreate;
|
2024-11-27 01:59:15 -05:00
|
|
|
// int32_t DeviceCreate(long (*windowProc)(void*, uint32_t, uint32_t, int32_t), CGxFormat const& format);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_10_DeviceCreate;
|
|
|
|
|
// void DeviceDestroy();
|
|
|
|
|
void* v_fn_11_DeviceDestroy;
|
2024-10-02 04:19:55 -04:00
|
|
|
// void DeviceEvictResources();
|
|
|
|
|
void* v_fn_12_DeviceEvictResources;
|
2024-11-27 01:59:15 -05:00
|
|
|
// int32_t DeviceSetFormat(const CGxFormat& format);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_13_DeviceSetFormat;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void DeviceSetBaseMipLevel(uint32_t mipLevel);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_14_DeviceSetBaseMipLevel;
|
2024-11-30 07:43:24 -05:00
|
|
|
// void DeviceSetGamma(const CGxGammaRamp& ramp);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_15_DeviceSetGamma;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void DeviceSetGamma(float gamma);
|
2024-11-01 03:54:09 -04:00
|
|
|
void* v_fn_16_DeviceSetGamma;
|
2024-09-30 17:18:50 -04:00
|
|
|
// no base implementation
|
2024-11-01 03:54:09 -04:00
|
|
|
// void* DeviceWindow();
|
|
|
|
|
void* v_fn_17_DeviceWindow;
|
|
|
|
|
// void DeviceTakeScreenShot();
|
|
|
|
|
void* v_fn_18_DeviceTakeScreenShot;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void DeviceReadScreenShot(uint32_t& w, uint32_t& h, const CImVector*& pixels) */
|
2024-11-01 03:54:09 -04:00
|
|
|
void* v_fn_19_DeviceReadScreenShot;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void DeviceReadPixels(CiRect& rect, TSGrowableArray<CImVector>& pixels);
|
2024-11-01 03:54:09 -04:00
|
|
|
void* v_fn_20_DeviceReadPixels;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void DeviceReadDepths(CiRect& rect, TSGrowableArray<float>& depths);
|
2024-11-01 03:54:09 -04:00
|
|
|
void* v_fn_21_DeviceReadDepths;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void DeviceWM(EGxWM wm, int32_t param1, int32_t param2);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_22_DeviceWM;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void DeviceSetRenderTarget(EGxBuffer buffer, CGxTex* texture, uint32_t plane);
|
|
|
|
|
void* v_fn_23_DeviceSetRenderTarget;
|
|
|
|
|
// void v_fn_24(); DeviceReleaseDepthBuffer?
|
|
|
|
|
// d3d:
|
|
|
|
|
// this->m_d3dDevice->GetDepthStencilSurface(&PTR_00C6033C);
|
|
|
|
|
// PTR_00C6033C->Release();
|
|
|
|
|
void* v_fn_24;
|
|
|
|
|
// void v_fn_25(); DeviceResetDepthBuffer?
|
|
|
|
|
// d3d:
|
|
|
|
|
// this->m_d3dDevice->SetDepthStencilSurface(PTR_00C6033C);
|
|
|
|
|
void* v_fn_25;
|
|
|
|
|
// void v_fn_26(CGxTex* texId); DeviceResolveDepthBuffer(CGxTex*) seems to be the most logical candidate for this
|
|
|
|
|
// d3d:
|
|
|
|
|
// if (this->m_context) {
|
|
|
|
|
// if (texId &&
|
|
|
|
|
// (texId->m_needsCreation ||
|
|
|
|
|
// (texId->m_apiSpecificData == nullptr &&
|
|
|
|
|
// texId->m_apiSpecificData2 == nullptr)) {
|
|
|
|
|
// this->ITexCreate(texId);
|
|
|
|
|
// }
|
|
|
|
|
// this->m_d3dDevice->SetDepthStencilSurface(texId->m_apiSpecificData);
|
|
|
|
|
// }
|
|
|
|
|
// void DeviceResolveDepthBuffer(CGxTex* texId);
|
|
|
|
|
void* v_fn_26_DeviceResolveDepthBuffer;
|
|
|
|
|
// void DeviceCopyTex(CGxTex* a1, int32_t a2, CGxTex* a3, int32_t a4);
|
|
|
|
|
void* v_fn_27_DeviceCopyTex;
|
|
|
|
|
// void DeviceOverride(EGxOverride override, uint32_t value);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_28_DeviceOverride;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void AddDeviceRestoredCallback(DEVICERESTOREDCALLBACK callback);
|
2024-09-30 17:18:50 -04:00
|
|
|
void* v_fn_29_AddDeviceRestoredCallback;
|
2024-11-27 01:59:15 -05:00
|
|
|
// int32_t RemoveDeviceRestoredCallback(DEVICERESTOREDCALLBACK callback);
|
2024-09-30 17:18:50 -04:00
|
|
|
void* v_fn_30_RemoveDeviceRestoredCallback;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void AddTextureRecreationCallback(TEXTURERECREATIONCALLBACK callback);
|
2024-09-30 17:18:50 -04:00
|
|
|
void* v_fn_31_AddTextureRecreationCallback;
|
2024-11-27 01:59:15 -05:00
|
|
|
// int32_t RemoveTextureRecreationCallback(TEXTURERECREATIONCALLBACK callback);
|
2024-09-30 17:18:50 -04:00
|
|
|
void* v_fn_32_RemoveTextureRecreationCallback;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void AddStereoChangedCallback(STEREOCHANGEDCALLBACK callback);
|
|
|
|
|
void* v_fn_33_AddStereoChangedCallback;
|
|
|
|
|
// int32_t RemoveStereoChangeCallback(STEREOCHANGEDCALLBACK callback);
|
|
|
|
|
void* v_fn_34_RemoveStereoChangedCallback;
|
|
|
|
|
// void CapsWindowSize(CRect& dst);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_35_CapsWindowSize;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void CapsWindowSize(CRect& dst);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_36_CapsWindowSizeInScreenCoords;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void LogCrashInfo(char* buffer, uint32_t size);
|
|
|
|
|
void* v_fn_37_LogCrashInfo;
|
|
|
|
|
// void ScenePresent(uint32_t mask);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_38_ScenePresent;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void SceneClear(uint32_t mask, CImVector color);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_39_SceneClear;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void XformSetProjection(const C44Matrix& matrix);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_40_XformSetProjection;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void XformSetView(const C44Matrix& matrix);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_41_XformSetView;
|
2024-11-30 07:43:24 -05:00
|
|
|
// void Draw(CGxBatch* batch, int32_t indexed);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_42_Draw;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void PrimBegin(EGxPrim primType);
|
|
|
|
|
void* v_fn_43_PrimBegin;
|
|
|
|
|
// void PrimDrawElements();
|
|
|
|
|
void* v_fn_44_PrimDrawElements;
|
|
|
|
|
// void PrimVertex(const C3Vector& v);
|
|
|
|
|
void* v_fn_45_PrimVertex;
|
|
|
|
|
// void PrimTexCoord(uint32_t tmu, const C2Vector& t);
|
|
|
|
|
void* v_fn_46_PrimTexCoord;
|
|
|
|
|
// void PrimNormal(const C3Vector& n);
|
|
|
|
|
void* v_fn_47_PrimNormal;
|
|
|
|
|
// void PrimColor(const CImVector& c);
|
|
|
|
|
void* v_fn_48_PrimColor;
|
|
|
|
|
// void PrimPointSize(float s);
|
|
|
|
|
void* v_fn_49_PrimPointSize;
|
|
|
|
|
// void PrimeLineWidth(float w);
|
|
|
|
|
void* v_fn_50_PrimLineWidth;
|
|
|
|
|
// void MasterEnableSet(EGxMasterEnables state, int32_t enable);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_51_MasterEnableSet;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void PoolSizeSet(CGxPool* pool, uint32_t size);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_52_PoolSizeSet;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void PoolDestroy(CGxPool* pool);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_53_PoolDestroy;
|
2024-11-27 01:59:15 -05:00
|
|
|
// char* BufLock(CGxBuf* buf);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_54_BufLock;
|
2024-11-27 01:59:15 -05:00
|
|
|
// int32_t BufUnlock(CGxBuf* buf, uint32_t size);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_55_BufUnlock;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void BufData(CGxBuf* buf, const void* data, uint32_t size, uint32_t offset);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_56_BufData;
|
2024-11-27 01:59:15 -05:00
|
|
|
// int32_t TexCreate(EGxTexTarget target, uint32_t width, uint32_t height, uint32_t depth, EGxTexFormat format, EGxTexFormat dataFormat, CGxTexFlags flags, void* userArg, void (*userFunc)(EGxTexCommand, uint32_t, uint32_t, uint32_t, uint32_t, void*, uint32_t&, void const*&), const char* name, CGxTex*& texId);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_57_TexCreate;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void TexDestroy(CGxTex* texId);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_58_TexDestroy;
|
2024-11-30 07:43:24 -05:00
|
|
|
// int32_t TexCopy(CGxTex* a1, CGxTex* a2, const C2iVector& a3, const C2iVector& a4, uint32_t a5, uint32_t a6);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_59_TexCopy;
|
2024-11-27 01:59:15 -05:00
|
|
|
// bool TexStretch(CGxTex* a1, CGxTex* a2, const CiRect* a3, const CiRect* a4, uint32_t a5, uint32_t a6);
|
|
|
|
|
void* v_fn_60_TexStretch;
|
|
|
|
|
// void TexSetCacheSize(int32_t cacheSize);
|
|
|
|
|
void* v_fn_61_TexSetCacheSize;
|
|
|
|
|
// void QueryCreate(CGxQuery*& query, EGxQueryType queryType);
|
|
|
|
|
void* v_fn_62_QueryCreate;
|
2024-11-30 07:43:24 -05:00
|
|
|
// bool QueryDestroy(CGxQuery*& query);
|
2024-11-27 01:59:15 -05:00
|
|
|
void* v_fn_63_QueryDestroy;
|
|
|
|
|
// bool QueryBegin(CGxQuery* query);
|
|
|
|
|
void* v_fn_64_QueryBegin;
|
|
|
|
|
// bool QueryEnd(CGxQuery* query);
|
|
|
|
|
void* v_fn_65_QueryEnd;
|
|
|
|
|
// bool QueryGetParam(CGxQuery* query, EGxQueryParam param, uint32_t* data);
|
|
|
|
|
void* v_fn_66_QueryGetParam;
|
|
|
|
|
// bool QueryGetData(CGxQuery* query, uint32_t* data);
|
|
|
|
|
void* v_fn_67_QueryGetData;
|
2024-11-30 07:43:24 -05:00
|
|
|
// void ShaderCreate(CGxShader*[] shaders[], EGxShTarget target, const char* a3, const char* a4, int32_t permutations);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_68_ShaderCreate;
|
2024-11-30 07:43:24 -05:00
|
|
|
// void ShaderDestroy(CGxShader*& shader);
|
|
|
|
|
void* v_fn_69_ShaderDestroy;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void ShaderConstantsSet(EGxShTarget target, uint32_t index, const float* constraints, uint32_t count);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_70_ShaderConstantsSet;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void IShaderReload(CGxShader* shader, const char* a2, const char* a3);
|
|
|
|
|
void* v_fn_71_IShaderReload;
|
|
|
|
|
// void IShaderCreate(CGxShader* shader);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_72_IShaderCreate;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void CursorSetVisible(int32_t visible);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_73_CursorSetVisible;
|
2024-11-27 01:59:15 -05:00
|
|
|
// uint32_t* CursorLock();
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_74_CursorLock;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void CursorUnlock(uint32_t x, uint32_t y);
|
2024-09-08 21:04:31 -04:00
|
|
|
void* v_fn_75_CursorUnlock;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void StereoSetConvergence(float c);
|
2024-11-01 03:54:09 -04:00
|
|
|
void* v_fn_76_StereoSetConvergence;
|
2024-11-30 07:43:24 -05:00
|
|
|
// float StereoGetConvergence();
|
2024-11-01 03:54:09 -04:00
|
|
|
void* v_fn_77_StereoGetConvergence;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void StereoSetSeparation(float s);
|
2024-11-01 03:54:09 -04:00
|
|
|
void* v_fn_78_StereoSetSeparation;
|
|
|
|
|
// double StereoGetSeparation();
|
|
|
|
|
void* v_fn_79_StereoGetSeparation;
|
2024-09-08 21:04:31 -04:00
|
|
|
// bool StereoEnabled();
|
|
|
|
|
void* v_fn_80_StereoEnabled;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void DebugGroupBegin(const char* a1, char* a2);
|
2024-11-01 03:54:09 -04:00
|
|
|
void* v_fn_81_DebugGroupBegin;
|
|
|
|
|
// void DebugGroupEnd();
|
|
|
|
|
void* v_fn_82_DebugGroupEnd;
|
2024-11-27 01:59:15 -05:00
|
|
|
// void DebugEvent(const char* a1, char* a2);
|
2024-11-01 03:54:09 -04:00
|
|
|
void* v_fn_83_DebugEvent;
|
2024-09-08 21:04:31 -04:00
|
|
|
};
|
|
|
|
|
|
2024-11-27 01:59:15 -05:00
|
|
|
// this class is 14692 bytes in size
|
2024-09-08 21:04:31 -04:00
|
|
|
struct CGxDevice {
|
|
|
|
|
// pointer to struct CGxDevice__vtable
|
|
|
|
|
CGxDevice__vtable* v_vtable; // 0x0 (size: 0x4)
|
|
|
|
|
TSGrowableArray_CGxPushedRenderState m_pushedStates; // 0x4 (size: 0x14)
|
|
|
|
|
TSGrowableArray_uint32_t m_stackOffsets; // 0x18 (size: 0x14)
|
|
|
|
|
TSGrowableArray_EGxRenderState m_dirtyStates; // 0x2C (size: 0x14)
|
2024-11-27 01:59:15 -05:00
|
|
|
EGxPrim m_primType;
|
2024-11-30 07:43:24 -05:00
|
|
|
int32_t m_indexLocked;
|
|
|
|
|
int32_t m_vertexLocked;
|
2024-11-27 01:59:15 -05:00
|
|
|
int32_t m_inBeginEnd;
|
2024-10-02 04:19:55 -04:00
|
|
|
C3Vector m_primVertex;
|
|
|
|
|
C2Vector m_primTexCoord[8];
|
|
|
|
|
C3Vector m_primNormal;
|
|
|
|
|
CImVector m_primColor;
|
|
|
|
|
TSGrowableArray_C3Vector m_primVertexArray;
|
|
|
|
|
TSGrowableArray_C2Vector m_primTexCoordArray[8];
|
|
|
|
|
TSGrowableArray_C3Vector m_primNormalArray;
|
|
|
|
|
TSGrowableArray_CImVector m_primColorArray;
|
|
|
|
|
TSGrowableArray_uint16_t m_primIndexArray;
|
|
|
|
|
uint32_t m_primMask;
|
2024-09-08 21:04:31 -04:00
|
|
|
CRect m_defWindowRect; // 0x164 (size: 0x10)
|
|
|
|
|
CRect m_curWindowRect; // 0x174 (size: 0x10)
|
2024-11-01 03:54:09 -04:00
|
|
|
TSGrowableArray_DEVICERESTOREDCALLBACK m_deviceRestoredCallbacks; // 0x184
|
2024-09-30 17:18:50 -04:00
|
|
|
TSGrowableArray_TEXTURERECREATIONCALLBACK m_textureRecreationCallbacks;
|
2024-11-27 01:59:15 -05:00
|
|
|
TSGrowableArray_STEREOCHANGEDCALLBACK m_stereoChangedCallbacks; // check darwin @ 00a2b779
|
2024-09-08 21:04:31 -04:00
|
|
|
EGxApi m_api; // 0x1b4
|
|
|
|
|
uint32_t m_cpuFeatures;
|
|
|
|
|
CGxFormat m_format;
|
|
|
|
|
CGxCaps m_caps;
|
|
|
|
|
uint32_t m_baseMipLevel;
|
|
|
|
|
CGxGammaRamp m_gammaRamp;
|
|
|
|
|
CGxGammaRamp m_systemGammaRamp;
|
|
|
|
|
// TSHashTable_CGxShader_HASHKEY_STRI m_shaderList[GxShTargets_Last];
|
|
|
|
|
// TSHashTable_CGxShader_HASHKEY_STRI m_shaderList[6];
|
|
|
|
|
int32_t (*m_windowProc)(void* window, uint32_t message, uintptr_t wparam, intptr_t lparam);
|
|
|
|
|
int32_t m_context;
|
|
|
|
|
int32_t intF5C;
|
|
|
|
|
int32_t m_windowVisible;
|
|
|
|
|
int32_t intF64;
|
|
|
|
|
int32_t intF68;
|
2024-10-02 04:19:55 -04:00
|
|
|
// Invented name, though seems to have the same place as CGxDeviceD3d::m_d3dNeedsReset (Alpha)
|
|
|
|
|
int32_t m_needsReset;
|
2024-09-08 21:04:31 -04:00
|
|
|
CBoundingBox m_viewport;
|
|
|
|
|
C44Matrix m_projection;
|
|
|
|
|
C44Matrix m_projNative;
|
|
|
|
|
// CGxMatrixStack m_xforms[GxXforms_Last];
|
|
|
|
|
CGxMatrixStack m_xforms[11];
|
|
|
|
|
CGxMatrixStack m_texGen[8];
|
2024-11-27 01:59:15 -05:00
|
|
|
uint32_t unk24D0[102];
|
|
|
|
|
// uint32_t unk2536[60];
|
|
|
|
|
TSHashTable_CGxShader_HASHKEY_STRI m_shaderList[6];
|
2024-09-08 21:04:31 -04:00
|
|
|
uint32_t m_appMasterEnables;
|
|
|
|
|
uint32_t m_hwMasterEnables;
|
|
|
|
|
TSList_CGxPool m_poolList;
|
|
|
|
|
uint32_t unk276C[3];
|
|
|
|
|
// CGxBuf* m_bufLocked[GxPoolTargets_Last];
|
|
|
|
|
CGxBuf* m_bufLocked[2];
|
|
|
|
|
CGxPool* m_vertexPool;
|
|
|
|
|
CGxPool* m_indexPool;
|
|
|
|
|
// CGxBuf* m_streamBufs[GxPoolTargets_Last];
|
|
|
|
|
CGxBuf* m_streamBufs[2];
|
|
|
|
|
// CGxVertexAttrib m_primVertexFormatAttrib[GxVertexBufferFormats_Last];
|
|
|
|
|
CGxVertexAttrib m_primVertexFormatAttrib[14];
|
|
|
|
|
// CGxBuf* m_primVertexFormatBuf[GxVertexBufferFormats_Last];
|
|
|
|
|
CGxBuf* m_primVertexFormatBuf[14];
|
|
|
|
|
uint32_t m_primVertexMask;
|
|
|
|
|
uint32_t m_primVertexDirty;
|
|
|
|
|
EGxVertexBufferFormat m_primVertexFormat;
|
|
|
|
|
CGxBuf* m_primVertexBuf;
|
|
|
|
|
uint32_t m_primVertexSize;
|
|
|
|
|
CGxBuf* m_primIndexBuf;
|
|
|
|
|
int32_t m_primIndexDirty;
|
2025-04-20 15:54:44 -04:00
|
|
|
// EmergencyMem unk28C4[GxPoolTargets_Last];
|
|
|
|
|
EmergencyMem m_emergencyMem[2]; // 0x28C4
|
2024-09-08 21:04:31 -04:00
|
|
|
TSFixedArray_CGxAppRenderState m_appRenderStates;
|
|
|
|
|
TSFixedArray_CGxStateBom m_hwRenderStates;
|
2024-11-30 07:43:24 -05:00
|
|
|
uint32_t unk2904[3]; // 0x2904 (size 0xC)
|
|
|
|
|
CGxDevice__TextureTarget m_textureTarget[2];
|
|
|
|
|
TSExplicitList_CGxQuery m_queryList; // 0x2928
|
2024-11-27 06:53:14 -05:00
|
|
|
int32_t m_scrShotClick; // 0x2934
|
|
|
|
|
uint32_t m_scrShotWidth; // 0x2938
|
|
|
|
|
uint32_t m_scrShotHeight; // 0x293C
|
|
|
|
|
TSGrowableArray_CImVector m_scrShotPixels; // 0x2940
|
2024-09-08 21:04:31 -04:00
|
|
|
int32_t m_cursorVisible;
|
2024-11-30 07:43:24 -05:00
|
|
|
int32_t m_hwCursor; // 0x2954 (size 0x4)
|
2024-09-08 21:04:31 -04:00
|
|
|
uint32_t m_cursorHotspotX;
|
|
|
|
|
uint32_t m_cursorHotspotY;
|
2024-09-30 17:18:50 -04:00
|
|
|
uint32_t m_cursor[1024]; // 0x2960 (size 0x4)
|
2024-09-08 21:04:31 -04:00
|
|
|
CGxTex* m_cursorTexture; // 0x3960 (size 0x4)
|
|
|
|
|
float m_cursorDepth; // 0x3964 (size 0x4)
|
|
|
|
|
// 0x3968 == 14692 (the complete size of CGxDevice)
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
#endif
|