feat(profile): add region code

This commit is contained in:
phaneron 2024-09-20 00:13:32 -04:00
parent e2b08911e9
commit da8d47619c
21 changed files with 762 additions and 6 deletions

View file

@ -10,4 +10,10 @@ typedef struct name##__ { \
}* name
#endif
DECLARE_STRUCT(CHandleObject);
struct CHandleObject {
int32_t m_refcount;
};
#endif

View file

@ -18,7 +18,11 @@ struct CGxDeviceD3d {
IDirect3DDevice9* m_d3dDevice;
D3DCAPS9 m_d3dCaps;
int32_t m_d3dIsHwDevice;
uint32_t unk3AB4[11];
int32_t m_d3dNVAPI;
uint32_t unk3AB8;
uint32_t unk3ABC;
uint32_t m_d3dStereoHandle;
uint32_t unk3AC4[7];
IDirect3DVertexDeclaration9* m_d3dVertexDecl[14];
D3DDISPLAYMODE m_desktopDisplayMode;
int32_t m_inScene;

View file

@ -199,7 +199,8 @@ struct CGxDevice {
int32_t m_windowVisible;
int32_t intF64;
int32_t intF68;
int32_t intF6C;
// Invented name, though seems to have the same place as CGxDeviceD3d::m_d3dNeedsReset
int32_t m_needsUpdate;
CBoundingBox m_viewport;
C44Matrix m_projection;
C44Matrix m_projNative;

View file

@ -36,9 +36,12 @@
#include "gx/batch.h"
#include "gx/d3d9.h"
#include "screen/layer.h"
#include "storm/array.h"
#include "storm/list.h"
#include "storm/hash.h"
#include "storm/region.h"
#include "tempest/box.h"
#include "tempest/matrix.h"

View file

@ -0,0 +1,24 @@
#ifndef SCREEN_LAYER_H
#define SCREEN_LAYER_H
#include "storm/list.h"
#include "common/handle.h"
#include "storm/region/rect.h"
DECLARE_HANDLE(HLAYER);
DECLARE_STRUCT(CILayer);
STORM_TS_LIST(CILayer);
struct CILayer {
CHandleObject b_base;
RECTF rect;
RECTF visible;
float zorder;
uint32_t flags;
void* param;
void (*paintfunc)(void*, RECTF*, RECTF*, float);
TSLink_CILayer zorderlink;
};
#endif

View file

@ -0,0 +1,9 @@
#ifndef STORM_REGION_H
#define STORM_REGION_H
#include "storm/region/found_param.h"
#include "storm/region/rect.h"
#include "storm/region/source.h"
#include "storm/region/region.h"
#endif

View file

@ -0,0 +1,14 @@
#ifndef STORM_REGION_FOUND_PARAM_H
#define STORM_REGION_FOUND_PARAM_H
#include "storm/array.h"
DECLARE_STRUCT(FOUNDPARAM);
struct FOUNDPARAM {
void* param;
int32_t sequence;
};
STORM_TS_GROWABLE_ARRAY(FOUNDPARAM);
#endif

View file

@ -0,0 +1,16 @@
#ifndef STORM_REGION_RECT_H
#define STORM_REGION_RECT_H
#include "storm/array.h"
DECLARE_STRUCT(RECTF);
struct RECTF {
float left;
float bottom;
float right;
float top;
};
STORM_TS_GROWABLE_ARRAY(RECTF);
#endif

View file

@ -0,0 +1,31 @@
#ifndef STORM_REGION_REGION_H
#define STORM_REGION_REGION_H
#include "common/handle.h"
#include "storm/hash.h"
#include "storm/region/source.h"
#include "storm/region/rect.h"
#include "storm/region/found_param.h"
DECLARE_HANDLE(HSRGN);
DECLARE_HANDLE(HLOCKEDRGN);
DECLARE_STRUCT(RGN);
DECLARE_STRUCT(CSRgn);
STORM_TS_HASH(RGN, HASHKEY_NONE);
struct RGN {
TSHashObject_RGN_HASHKEY_NONE b_base;
TSGrowableArray_SOURCE source;
TSGrowableArray_RECTF combined;
TSGrowableArray_FOUNDPARAM foundparams;
RECTF foundparamsrect;
int32_t sequence;
int32_t dirty;
};
struct CSRgn {
HSRGN m_handle;
};
#endif

View file

@ -0,0 +1,17 @@
#ifndef STORM_REGION_SOURCE_H
#define STORM_REGION_SOURCE_H
#include "storm/array.h"
#include "storm/region/rect.h"
DECLARE_STRUCT(SOURCE);
struct SOURCE {
RECTF rect;
void* param;
int32_t sequence;
uint32_t flags;
};
STORM_TS_GROWABLE_ARRAY(SOURCE);
#endif