Skip to content

Commit 399301b

Browse files
committed
minor clean-up for win32 directx-using sources.
1 parent 20954a9 commit 399301b

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

‎engine/h2shared/in_win.c‎

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,21 @@
2222
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2323
*/
2424

25+
#ifndef __cplusplus
26+
#define CINTERFACE 1 /* for dinput.h */
27+
#endif
28+
29+
#ifdef __cplusplus
30+
#define GUID_REF(X) (X)
31+
#else
32+
#define GUID_REF(X) &(X)
33+
#endif
34+
2535
#include "quakedef.h"
2636
#include "winquake.h"
2737
#include <mmsystem.h>
38+
39+
#define DIRECTINPUT_VERSION 0x0300
2840
#include <dinput.h>
2941

3042
// mouse variables
@@ -99,9 +111,9 @@ static HRESULT (WINAPI *pDirectInputCreate)(HINSTANCE, DWORD, LPDIRECTINPUT*, LP
99111

100112
#else /* ! DX_DLSYM : linked to dinput */
101113

102-
#define diformat c_dfDIMouse
103-
#define pDirectInputCreate DirectInputCreateA
104-
#define Q_GUID_SysMouse GUID_SysMouse
114+
#define diformat c_dfDIMouse
115+
#define pDirectInputCreate DirectInputCreateA
116+
#define Q_GUID_SysMouse GUID_SysMouse
105117

106118
#endif /* DX_DLSYM */
107119

@@ -394,7 +406,7 @@ static qboolean IN_InitDInput (void)
394406
}
395407

396408
// obtain an interface to the system mouse device.
397-
hr = IDirectInput_CreateDevice(g_pdi, D3D_GUID(Q_GUID_SysMouse), &g_pMouse, NULL);
409+
hr = IDirectInput_CreateDevice(g_pdi, GUID_REF(Q_GUID_SysMouse), &g_pMouse, NULL);
398410
if (FAILED(hr))
399411
{
400412
Con_SafePrintf ("Couldn't open DI mouse device\n");

‎engine/h2shared/snd_dsound.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1818
*/
1919

20+
#define CINTERFACE 1 /* for dsound.h */
21+
2022
#include "quakedef.h"
2123
#include "snd_sys.h"
2224

@@ -25,6 +27,7 @@
2527
#include "winquake.h"
2628
#include "snd_dsound.h"
2729
#include <mmsystem.h>
30+
#define DIRECTSOUND_VERSION 0x0300
2831
#include <dsound.h>
2932

3033
static char s_ds_driver[] = "DirectSound";

‎engine/h2shared/winquake.h‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,21 +24,6 @@
2424
/* include windows.h here, because we need the data types */
2525
#include <windows.h>
2626

27-
/* required compatibility versions for directx components */
28-
#define DIRECTDRAW_VERSION 0x0300
29-
#define DIRECTSOUND_VERSION 0x0300
30-
#define DIRECTINPUT_VERSION 0x0300
31-
32-
#if !defined(__cplusplus) && !defined(CINTERFACE)
33-
#define CINTERFACE /* for directx macros. */
34-
#endif
35-
36-
#if defined(__cplusplus) /* for REFGUID */
37-
#define D3D_GUID(X) (X)
38-
#else
39-
#define D3D_GUID(X) &(X)
40-
#endif
41-
4227
extern HINSTANCE global_hInstance;
4328
extern int global_nCmdShow;
4429

0 commit comments

Comments
 (0)