-
Notifications
You must be signed in to change notification settings - Fork 2
/
DXinit.h
135 lines (117 loc) · 3.12 KB
/
DXinit.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#pragma once
#ifndef DXINIT_H
#define DXINIT_H
#include "export.h"
#include "non_win32.h"
#include "my_dx.h"
struct DxZBufferContext
{
i32 mNumEntries;
DDPIXELFORMAT mEntry[8];
};
struct DXVideoModeContext
{
i32 mNumEntries;
DDSURFACEDESC2 mSurfaces[64];
u8 mFlags[64];
};
struct SVideoMode
{
DWORD dwWidth;
DWORD dwHeight;
u8 field_8;
};
struct DXContextEntry
{
GUID mGUID;
D3DDEVICEDESC7 mDeviceDesc;
char *pDescription;
};
struct DXContext
{
i32 mNumEntries;
DXContextEntry mEntry[8];
};
EXPORT extern i32 gLowGraphics;
EXPORT extern void* gLowGraphicsRelated;
EXPORT void DXINIT_GetCurrentResolution(int *, int *);
EXPORT void AUDIOGROUPS_GetGroup(char *);
EXPORT void DXINIT_DirectX8(HWND, HINSTANCE,u32);
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);
EXPORT HRESULT WINAPI MyD3DEnumCallback(LPSTR,LPSTR, LPD3DDEVICEDESC7, LPVOID);
EXPORT BOOL WINAPI MyDDEnumCallback(GUID*, LPSTR, LPSTR, LPVOID, HMONITOR);
EXPORT void displayD3DError(long,char *,i32);
EXPORT void displayDIError(long,char *,i32);
EXPORT void displayDSError(long,char *,i32);
EXPORT void enumDisplayModes(void);
EXPORT HRESULT WINAPI enumerateModesCB(LPDDSURFACEDESC2,void *);
EXPORT HRESULT WINAPI enumerateZBuffersCB(DDPIXELFORMAT *,void *);
EXPORT void getNextNumber(char *,i32 *);
EXPORT u8 initDirect3D7(u32);
EXPORT void initDirectDraw7(HWND);
EXPORT void initDirectInput8(HINSTANCE);
EXPORT void initDirectSound8(HWND);
EXPORT void shutdownDirect3D7(i32);
EXPORT void shutdownDirectInput8(void);
EXPORT void shutdownDirectSound8(void);
EXPORT void gsub_5027A0(void);
EXPORT extern u32 gColorCount;
EXPORT extern LPDIRECTINPUT8 gDirectInputRelated;
EXPORT extern LPDIRECTSOUND8 g_pDS;
#define DISPLAY_DI_ERROR(x) displayDIError(x, __FILE__, __LINE__)
#define DISPLAY_DS_ERROR(x) displayDSError(x, __FILE__, __LINE__)
#define DISPLAY_D3D_ERROR(x) displayD3DError(x, __FILE__, __LINE__)
#define DI_ERROR_LOG_AND_QUIT(x) {\
if (x)\
{\
DISPLAY_DI_ERROR(x);\
if (FAILED(hr))\
{\
DXINIT_ShutDown();\
exit(hr);\
}\
}\
}
#define DS_ERROR_LOG_AND_QUIT(x) {\
if (x)\
{\
DISPLAY_DS_ERROR(x);\
if (FAILED(hr))\
{\
DXINIT_ShutDown();\
exit(hr);\
}\
}\
}
#define D3D_ERROR_LOG_AND_QUIT(x) {\
if (x)\
{\
DISPLAY_D3D_ERROR(x);\
if (FAILED(hr))\
{\
DXINIT_ShutDown();\
exit(hr);\
}\
}\
}
EXPORT extern LPDIRECT3DDEVICE7 g_D3DDevice7;
EXPORT extern i32 gDxOptionRelated;
EXPORT extern LPDIRECTDRAWSURFACE7 g_pDDS_SaveScreen;
EXPORT extern RECT gRect;
EXPORT extern LPDIRECTDRAWSURFACE7 g_pDDS_Scene;
EXPORT extern D3DDEVICEDESC7 gD3DDevCaps;
void validate_DXContext(void);
void validate_DXContextEntry(void);
void validate_SVideoMode(void);
void validate_DXVideoModeContext(void);
void validate_DxZBufferContext(void);
#endif