spidey-decomp/DXinit.h

136 lines
3.1 KiB
C
Raw Permalink Normal View History

2024-05-23 17:19:28 +00:00
#pragma once
#ifndef DXINIT_H
#define DXINIT_H
#include "export.h"
2024-08-23 22:24:56 +00:00
#include "non_win32.h"
2024-09-05 16:15:40 +00:00
#include "my_dx.h"
2024-08-04 16:19:59 +00:00
2024-09-09 17:25:42 +00:00
struct DxZBufferContext
{
i32 mNumEntries;
DDPIXELFORMAT mEntry[8];
};
2024-09-08 17:59:35 +00:00
struct DXVideoModeContext
{
i32 mNumEntries;
DDSURFACEDESC2 mSurfaces[64];
u8 mFlags[64];
};
struct SVideoMode
{
DWORD dwWidth;
DWORD dwHeight;
u8 field_8;
};
2024-09-08 16:00:36 +00:00
struct DXContextEntry
{
GUID mGUID;
D3DDEVICEDESC7 mDeviceDesc;
2024-09-08 16:00:36 +00:00
char *pDescription;
};
struct DXContext
{
i32 mNumEntries;
DXContextEntry mEntry[8];
};
2024-09-05 16:28:04 +00:00
EXPORT extern i32 gLowGraphics;
EXPORT extern void* gLowGraphicsRelated;
EXPORT void DXINIT_GetCurrentResolution(int *, int *);
2024-08-04 16:19:59 +00:00
EXPORT void AUDIOGROUPS_GetGroup(char *);
EXPORT void DXINIT_DirectX8(HWND, HINSTANCE,u32);
2024-08-04 16:19:59 +00:00
EXPORT void DXINIT_GetCurrentResolution(u32 *,u32 *);
EXPORT void DXINIT_GetNextColorDepth(u32);
EXPORT void DXINIT_GetNextResolution(u32 *,u32 *,u32,i32,bool);
EXPORT void DXINIT_GetPrevColorDepth(u32);
EXPORT void DXINIT_GetPrevResolution(u32 *,u32 *,u32,i32,bool);
EXPORT void DXINIT_SetDisplayOptions(u32,u32,u32,i32,i32);
EXPORT void DXINIT_ShutDown(void);
EXPORT void DXINIT_ZBufSupported(u32);
EXPORT void FreePushOffsets(void);
EXPORT void LoadPushOffsets(void);
2024-09-09 17:19:52 +00:00
EXPORT HRESULT WINAPI MyD3DEnumCallback(LPSTR,LPSTR, LPD3DDEVICEDESC7, LPVOID);
EXPORT BOOL WINAPI MyDDEnumCallback(GUID*, LPSTR, LPSTR, LPVOID, HMONITOR);
2024-08-04 16:19:59 +00:00
EXPORT void displayD3DError(long,char *,i32);
EXPORT void displayDIError(long,char *,i32);
EXPORT void displayDSError(long,char *,i32);
EXPORT void enumDisplayModes(void);
2024-09-08 17:02:17 +00:00
EXPORT HRESULT WINAPI enumerateModesCB(LPDDSURFACEDESC2,void *);
2024-09-09 17:25:42 +00:00
EXPORT HRESULT WINAPI enumerateZBuffersCB(DDPIXELFORMAT *,void *);
2024-08-04 16:19:59 +00:00
EXPORT void getNextNumber(char *,i32 *);
2024-09-07 17:01:31 +00:00
EXPORT u8 initDirect3D7(u32);
2024-08-23 22:24:56 +00:00
EXPORT void initDirectDraw7(HWND);
EXPORT void initDirectInput8(HINSTANCE);
EXPORT void initDirectSound8(HWND);
2024-08-04 16:19:59 +00:00
EXPORT void shutdownDirect3D7(i32);
EXPORT void shutdownDirectInput8(void);
EXPORT void shutdownDirectSound8(void);
2024-09-05 16:28:04 +00:00
EXPORT void gsub_5027A0(void);
2024-09-09 18:13:48 +00:00
EXPORT extern u32 gColorCount;
2024-09-07 17:29:24 +00:00
EXPORT extern LPDIRECTINPUT8 gDirectInputRelated;
2024-09-07 17:50:33 +00:00
EXPORT extern LPDIRECTSOUND8 g_pDS;
2024-09-07 17:01:31 +00:00
2024-09-06 17:00:50 +00:00
#define DISPLAY_DI_ERROR(x) displayDIError(x, __FILE__, __LINE__)
2024-09-07 17:50:33 +00:00
#define DISPLAY_DS_ERROR(x) displayDSError(x, __FILE__, __LINE__)
2024-09-08 16:51:59 +00:00
#define DISPLAY_D3D_ERROR(x) displayD3DError(x, __FILE__, __LINE__)
2024-09-06 17:00:50 +00:00
2024-09-07 17:29:24 +00:00
#define DI_ERROR_LOG_AND_QUIT(x) {\
if (x)\
{\
DISPLAY_DI_ERROR(x);\
if (FAILED(hr))\
{\
DXINIT_ShutDown();\
exit(hr);\
}\
}\
}
2024-09-07 17:50:33 +00:00
#define DS_ERROR_LOG_AND_QUIT(x) {\
if (x)\
{\
DISPLAY_DS_ERROR(x);\
2024-09-07 17:58:29 +00:00
if (FAILED(hr))\
{\
DXINIT_ShutDown();\
exit(hr);\
}\
2024-09-07 17:50:33 +00:00
}\
}
2024-09-08 16:51:59 +00:00
#define D3D_ERROR_LOG_AND_QUIT(x) {\
if (x)\
{\
DISPLAY_D3D_ERROR(x);\
if (FAILED(hr))\
{\
DXINIT_ShutDown();\
exit(hr);\
}\
}\
}
2024-09-10 14:24:05 +00:00
EXPORT extern LPDIRECT3DDEVICE7 g_D3DDevice7;
2024-09-10 15:02:05 +00:00
EXPORT extern i32 gDxOptionRelated;
2024-09-10 15:42:25 +00:00
EXPORT extern LPDIRECTDRAWSURFACE7 g_pDDS_SaveScreen;
EXPORT extern RECT gRect;
2024-09-10 15:48:42 +00:00
EXPORT extern LPDIRECTDRAWSURFACE7 g_pDDS_Scene;
2024-09-20 17:09:06 +00:00
EXPORT extern D3DDEVICEDESC7 gD3DDevCaps;
2024-09-10 14:24:05 +00:00
2024-09-08 16:00:36 +00:00
void validate_DXContext(void);
void validate_DXContextEntry(void);
2024-09-08 17:59:35 +00:00
void validate_SVideoMode(void);
void validate_DXVideoModeContext(void);
2024-09-09 17:25:42 +00:00
void validate_DxZBufferContext(void);
2024-09-08 16:00:36 +00:00
#endif