Skip to content

Commit 7a34b9c

Browse files
committed
xrGame,xrEngine,xrCore,xrEditor: remove dinput defines & linkage
1 parent 50c2977 commit 7a34b9c

File tree

9 files changed

+11
-151
lines changed

9 files changed

+11
-151
lines changed

src/editors/xrEditor/entry_point.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ void UIThreadProc(void*)
2828
#ifdef XR_X64
2929
Device.m_sdlWnd = (SDL_Window *)windowIDE->View().GetViewHandle().ToInt64();
3030
#else
31-
Device.m_hWnd = (HWND)windowIDE->View().GetViewHandle().ToInt32();
31+
Device.m_sdlWnd = (SDL_Window*)windowIDE->View().GetViewHandle().ToInt32();
3232
#endif
3333
VERIFY(Device.m_sdlWnd != nullptr);
3434

src/xrCore/Debug/DXGetErrorDescription.inl

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -143,73 +143,6 @@ switch (hr)
143143
CHK_ERR(DDERR_NODRIVERSUPPORT, "The driver does not enumerate display mode refresh rates.")
144144
CHK_ERR(DDERR_DEVICEDOESNTOWNSURFACE, "Surfaces created by one direct draw device cannot be used directly by another direct draw device.")
145145

146-
147-
// -------------------------------------------------------------
148-
// dinput.h error codes
149-
// -------------------------------------------------------------
150-
//CHK_ERR(DI_OK, "DI_OK")
151-
//CHK_ERR(DI_NOTATTACHED, "DI_NOTATTACHED")
152-
//CHK_ERR(DI_BUFFEROVERFLOW, "DI_BUFFEROVERFLOW")
153-
//CHK_ERR(DI_PROPNOEFFECT, "DI_PROPNOEFFECT")
154-
//CHK_ERR(DI_NOEFFECT, "DI_NOEFFECT")
155-
//CHK_ERR(DI_POLLEDDEVICE, "DI_POLLEDDEVICE")
156-
//CHK_ERR(DI_DOWNLOADSKIPPED, "DI_DOWNLOADSKIPPED")
157-
//CHK_ERR(DI_EFFECTRESTARTED, "DI_EFFECTRESTARTED")
158-
//CHK_ERR(DI_SETTINGSNOTSAVED_ACCESSDENIED, "DI_SETTINGSNOTSAVED_ACCESSDENIED")
159-
//CHK_ERR(DI_SETTINGSNOTSAVED_DISKFULL, "DI_SETTINGSNOTSAVED_DISKFULL")
160-
//CHK_ERR(DI_TRUNCATED, "DI_TRUNCATED")
161-
//CHK_ERR(DI_TRUNCATEDANDRESTARTED, "DI_TRUNCATEDANDRESTARTED")
162-
//CHK_ERR(DI_WRITEPROTECT, "DI_WRITEPROTECT")
163-
CHK_ERR(DIERR_OLDDIRECTINPUTVERSION, "The application requires a newer version of DirectInput.")
164-
//CHK_ERR(DIERR_GENERIC, "DIERR_GENERIC")
165-
//CHK_ERR(DIERR_OLDDIRECTINPUTVERSION, "DIERR_OLDDIRECTINPUTVERSION")
166-
CHK_ERR(DIERR_BETADIRECTINPUTVERSION, "The application was written for an unsupported prerelease version of DirectInput.")
167-
CHK_ERR(DIERR_BADDRIVERVER, "The object could not be created due to an incompatible driver version or mismatched or incomplete driver components.")
168-
//CHK_ERR(DIERR_DEVICENOTREG, "DIERR_DEVICENOTREG")
169-
//CHK_ERR(DIERR_NOTFOUND, "The requested object does not exist.")
170-
//CHK_ERR(DIERR_OBJECTNOTFOUND, "DIERR_OBJECTNOTFOUND")
171-
//CHK_ERR(DIERR_INVALIDPARAM, "DIERR_INVALIDPARAM")
172-
//CHK_ERR(DIERR_NOINTERFACE, "DIERR_NOINTERFACE")
173-
//CHK_ERR(DIERR_GENERIC, "DIERR_GENERIC")
174-
//CHK_ERR(DIERR_OUTOFMEMORY, "DIERR_OUTOFMEMORY")
175-
//CHK_ERR(DIERR_UNSUPPORTED, "DIERR_UNSUPPORTED")
176-
CHK_ERR(DIERR_NOTINITIALIZED, "This object has not been initialized")
177-
CHK_ERR(DIERR_ALREADYINITIALIZED, "This object is already initialized")
178-
//CHK_ERR(DIERR_NOAGGREGATION, "DIERR_NOAGGREGATION")
179-
//CHK_ERR(DIERR_OTHERAPPHASPRIO, "DIERR_OTHERAPPHASPRIO")
180-
CHK_ERR(DIERR_INPUTLOST, "Access to the device has been lost. It must be re-acquired.")
181-
CHK_ERR(DIERR_ACQUIRED, "The operation cannot be performed while the device is acquired.")
182-
CHK_ERR(DIERR_NOTACQUIRED, "The operation cannot be performed unless the device is acquired.")
183-
//CHK_ERR(DIERR_READONLY, "DIERR_READONLY")
184-
//CHK_ERR(DIERR_HANDLEEXISTS, "DIERR_HANDLEEXISTS")
185-
CHK_ERR(DIERR_INSUFFICIENTPRIVS, "Unable to IDirectInputJoyConfig_Acquire because the user does not have sufficient privileges to change the joystick configuration. & An invalid media type was specified")
186-
CHK_ERR(DIERR_DEVICEFULL, "The device is full. & An invalid media subtype was specified.")
187-
CHK_ERR(DIERR_MOREDATA, "Not all the requested information fit into the buffer. & This object can only be created as an aggregated object.")
188-
CHK_ERR(DIERR_NOTDOWNLOADED, "The effect is not downloaded. & The enumerator has become invalid.")
189-
CHK_ERR(DIERR_HASEFFECTS, "The device cannot be reinitialized because there are still effects attached to it. & At least one of the pins involved in the operation is already connected.")
190-
CHK_ERR(DIERR_NOTEXCLUSIVEACQUIRED, "The operation cannot be performed unless the device is acquired in DISCL_EXCLUSIVE mode. & This operation cannot be performed because the filter is active.")
191-
CHK_ERR(DIERR_INCOMPLETEEFFECT, "The effect could not be downloaded because essential information is missing. For example, no axes have been associated with the effect, or no type-specific information has been created. & One of the specified pins supports no media types.")
192-
CHK_ERR(DIERR_NOTBUFFERED, "Attempted to read buffered device data from a device that is not buffered. & There is no common media type between these pins.")
193-
CHK_ERR(DIERR_EFFECTPLAYING, "An attempt was made to modify parameters of an effect while it is playing. Not all hardware devices support altering the parameters of an effect while it is playing. & Two pins of the same direction cannot be connected together.")
194-
CHK_ERR(DIERR_UNPLUGGED, "The operation could not be completed because the device is not plugged in. & The operation cannot be performed because the pins are not connected.")
195-
CHK_ERR(DIERR_REPORTFULL, "SendDeviceData failed because more information was requested to be sent than can be sent to the device. Some devices have restrictions on how much data can be sent to them. (For example, there might be a limit on the number of buttons that can be pressed at once.) & No sample buffer allocator is available.")
196-
CHK_ERR(DIERR_MAPFILEFAIL, "A mapper file function failed because reading or writing the user or IHV settings file failed. & A run-time error occurred.")
197-
198-
// -------------------------------------------------------------
199-
// dinputd.h error codes
200-
// -------------------------------------------------------------
201-
CHK_ERR(DIERR_NOMOREITEMS, "No more items.")
202-
CHK_ERR(DIERR_DRIVERFIRST, "Device driver-specific codes. Unless the specific driver has been precisely identified, no meaning should be attributed to these values other than that the driver originated the error.")
203-
CHK_ERR(DIERR_DRIVERFIRST+1, "DIERR_DRIVERFIRST+1")
204-
CHK_ERR(DIERR_DRIVERFIRST+2, "DIERR_DRIVERFIRST+2")
205-
CHK_ERR(DIERR_DRIVERFIRST+3, "DIERR_DRIVERFIRST+3")
206-
CHK_ERR(DIERR_DRIVERFIRST+4, "DIERR_DRIVERFIRST+4")
207-
CHK_ERR(DIERR_DRIVERFIRST+5, "DIERR_DRIVERFIRST+5")
208-
CHK_ERR(DIERR_DRIVERLAST, "Device installer errors.")
209-
CHK_ERR(DIERR_INVALIDCLASSINSTALLER, "Registry entry or DLL for class installer invalid or class installer not found.")
210-
CHK_ERR(DIERR_CANCELLED, "The user cancelled the install operation. & The stream already has allocated samples and the surface doesn't match the sample format.")
211-
CHK_ERR(DIERR_BADINF, "The INF file for the selected device could not be found or is invalid or is damaged. & The specified purpose ID can't be used for the call.")
212-
213146
// -------------------------------------------------------------
214147
// d3d9.h error codes
215148
// -------------------------------------------------------------

src/xrCore/Debug/DXGetErrorString.inl

Lines changed: 0 additions & 67 deletions
Original file line numberDiff line numberDiff line change
@@ -3048,73 +3048,6 @@ switch (hr)
30483048
CHK_ERRA(DDERR_NODRIVERSUPPORT)
30493049
CHK_ERRA(DDERR_DEVICEDOESNTOWNSURFACE)
30503050

3051-
// -------------------------------------------------------------
3052-
// dinput.h error codes
3053-
// -------------------------------------------------------------
3054-
//CHK_ERRA(DI_OK)
3055-
//CHK_ERRA(DI_NOTATTACHED)
3056-
//CHK_ERRA(DI_BUFFEROVERFLOW)
3057-
//CHK_ERRA(DI_PROPNOEFFECT)
3058-
//CHK_ERRA(DI_NOEFFECT)
3059-
//CHK_ERRA(DI_POLLEDDEVICE)
3060-
//CHK_ERRA(DI_DOWNLOADSKIPPED)
3061-
//CHK_ERRA(DI_EFFECTRESTARTED)
3062-
//CHK_ERRA(DI_SETTINGSNOTSAVED_ACCESSDENIED)
3063-
//CHK_ERRA(DI_SETTINGSNOTSAVED_DISKFULL)
3064-
//CHK_ERRA(DI_TRUNCATED)
3065-
//CHK_ERRA(DI_TRUNCATEDANDRESTARTED)
3066-
//CHK_ERRA(DI_WRITEPROTECT)
3067-
CHK_ERR(DIERR_INSUFFICIENTPRIVS, "DIERR_INSUFFICIENTPRIVS & VFW_E_INVALIDMEDIATYPE")
3068-
CHK_ERR(DIERR_DEVICEFULL, "DIERR_DEVICEFULL & VFW_E_INVALIDSUBTYPE & DMO_E_INVALIDSTREAMINDEX")
3069-
CHK_ERR(DIERR_MOREDATA, "DIERR_MOREDATA & VFW_E_NEED_OWNER & DMO_E_INVALIDTYPE")
3070-
CHK_ERR(DIERR_NOTDOWNLOADED, "DIERR_NOTDOWNLOADED & VFW_E_ENUM_OUT_OF_SYNC & DMO_E_TYPE_NOT_SET")
3071-
CHK_ERR(DIERR_HASEFFECTS, "DIERR_HASEFFECTS & VFW_E_ALREADY_CONNECTED & DMO_E_NOTACCEPTING")
3072-
CHK_ERR(DIERR_NOTEXCLUSIVEACQUIRED, "DIERR_NOTEXCLUSIVEACQUIRED & VFW_E_FILTER_ACTIVE & DMO_E_TYPE_NOT_ACCEPTED")
3073-
CHK_ERR(DIERR_INCOMPLETEEFFECT, "DIERR_INCOMPLETEEFFECT & VFW_E_NO_TYPES & DMO_E_NO_MORE_ITEMS")
3074-
CHK_ERR(DIERR_NOTBUFFERED, "DIERR_NOTBUFFERED & VFW_E_NO_ACCEPTABLE_TYPES")
3075-
CHK_ERR(DIERR_EFFECTPLAYING, "DIERR_EFFECTPLAYING & VFW_E_INVALID_DIRECTION")
3076-
CHK_ERR(DIERR_UNPLUGGED, "DIERR_UNPLUGGED & VFW_E_NOT_CONNECTED")
3077-
CHK_ERR(DIERR_REPORTFULL, "DIERR_REPORTFULL & VFW_E_NO_ALLOCATOR")
3078-
CHK_ERR(DIERR_MAPFILEFAIL, "DIERR_MAPFILEFAIL & VFW_E_RUNTIME_ERROR")
3079-
//CHK_ERRA(DIERR_OLDDIRECTINPUTVERSION)
3080-
//CHK_ERRA(DIERR_GENERIC)
3081-
//CHK_ERRA(DIERR_OLDDIRECTINPUTVERSION)
3082-
//CHK_ERRA(DIERR_BETADIRECTINPUTVERSION)
3083-
//CHK_ERRA(DIERR_BADDRIVERVER)
3084-
//CHK_ERRA(DIERR_DEVICENOTREG)
3085-
//CHK_ERRA(DIERR_NOTFOUND)
3086-
//CHK_ERRA(DIERR_OBJECTNOTFOUND)
3087-
//CHK_ERRA(DIERR_INVALIDPARAM)
3088-
//CHK_ERRA(DIERR_NOINTERFACE)
3089-
//CHK_ERRA(DIERR_GENERIC)
3090-
//CHK_ERRA(DIERR_OUTOFMEMORY)
3091-
//CHK_ERRA(DIERR_UNSUPPORTED)
3092-
//CHK_ERRA(DIERR_NOTINITIALIZED)
3093-
//CHK_ERRA(DIERR_ALREADYINITIALIZED)
3094-
//CHK_ERRA(DIERR_NOAGGREGATION)
3095-
//CHK_ERRA(DIERR_OTHERAPPHASPRIO)
3096-
//CHK_ERRA(DIERR_INPUTLOST)
3097-
//CHK_ERRA(DIERR_ACQUIRED)
3098-
//CHK_ERRA(DIERR_NOTACQUIRED)
3099-
//CHK_ERRA(DIERR_READONLY)
3100-
//CHK_ERRA(DIERR_HANDLEEXISTS)
3101-
3102-
3103-
// -------------------------------------------------------------
3104-
// dinputd.h error
3105-
// -------------------------------------------------------------
3106-
//CHK_ERRA(DIERR_NOMOREITEMS)
3107-
CHK_ERRA(DIERR_DRIVERFIRST)
3108-
CHK_ERR(DIERR_DRIVERFIRST+1, "DIERR_DRIVERFIRST+1")
3109-
CHK_ERR(DIERR_DRIVERFIRST+2, "DIERR_DRIVERFIRST+2")
3110-
CHK_ERR(DIERR_DRIVERFIRST+3, "DIERR_DRIVERFIRST+3")
3111-
CHK_ERR(DIERR_DRIVERFIRST+4, "DIERR_DRIVERFIRST+4")
3112-
CHK_ERR(DIERR_DRIVERFIRST+5, "DIERR_DRIVERFIRST+5")
3113-
CHK_ERRA(DIERR_DRIVERLAST)
3114-
CHK_ERR(DIERR_INVALIDCLASSINSTALLER, "DIERR_INVALIDCLASSINSTALLER")
3115-
CHK_ERR(DIERR_CANCELLED, "DIERR_CANCELLED & MS_E_SAMPLEALLOC")
3116-
CHK_ERRA(DIERR_BADINF)
3117-
31183051
// -------------------------------------------------------------
31193052
// d3d9.h error codes
31203053
// -------------------------------------------------------------

src/xrCore/Debug/dxerr.cpp

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,6 @@
2121
#include <d3d9.h>
2222
#include <mmreg.h>
2323
#include <dsound.h>
24-
#ifndef DIRECTINPUT_VERSION
25-
#define DIRECTINPUT_VERSION 0x800
26-
#endif
27-
#include <dinput.h>
28-
#include <dinputd.h>
2924
#endif
3025

3126
#define XAUDIO2_E_INVALID_CALL 0x88960001

src/xrEngine/stdafx.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
extern ENGINE_API CInifile* pGameIni;
3434

3535
#pragma comment(lib, "winmm.lib")
36-
#pragma comment(lib, "dinput8.lib")
3736
#pragma comment(lib, "dxguid.lib")
3837
// XXX: move to script engine headers
3938
#ifndef DEBUG

src/xrGame/ai/monsters/bloodsucker/bloodsucker.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -856,11 +856,11 @@ void CAI_Bloodsucker::debug_on_key(int key)
856856
{
857857
switch (key)
858858
{
859-
case DIK_MINUS:
859+
case SDL_SCANCODE_MINUS:
860860
Actor()->cam_Active()->Move(Random.randI(2) ? kRIGHT : kLEFT, PI_DIV_2);
861861
// set_alien_control(true);
862862
break;
863-
case DIK_EQUALS:
863+
case SDL_SCANCODE_EQUALS:
864864
Actor()->cam_Active()->Move(Random.randI(2) ? kUP : kDOWN, PI_DIV_2);
865865
// set_alien_control(false);
866866
break;

src/xrGame/ai/monsters/controller/controller.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ void CController::debug_on_key(int key)
763763
{
764764
switch (key)
765765
{
766-
case DIK_MINUS:
766+
case SDL_SCANCODE_MINUS:
767767
// m_sound_aura_left_channel.play_at_pos(Level().CurrentEntity(), Fvector().set(-1.f, 0.f, 1.f), sm_2D);
768768
// m_sound_aura_right_channel.play_at_pos(Level().CurrentEntity(), Fvector().set(1.f, 0.f, 1.f), sm_2D);
769769

@@ -786,7 +786,7 @@ void CController::debug_on_key(int key)
786786
//}
787787

788788
break;
789-
case DIK_EQUALS:
789+
case SDL_SCANCODE_EQUALS:
790790
P2.set(Actor()->Position());
791791
DBG().level_info(this).remove_item(1);
792792
DBG().level_info(this).add_item(P2, 0.5f, COLOR_GREEN, 1);

src/xrGame/ai/monsters/dog/dog.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -426,20 +426,20 @@ void CAI_Dog::debug_on_key(int key)
426426

427427
switch (key)
428428
{
429-
case DIK_1:
429+
case SDL_SCANCODE_1:
430430
Msg("Ohhhhhhhhhhhhhhh! Here it is!");
431431
// strafe left
432432
// com_man().seq_run(skel->ID_Cycle_Safe("stand_turn_ls_0"));
433433
break;
434-
case DIK_2:
434+
case SDL_SCANCODE_2:
435435
// strafe right
436436
com_man().seq_run(skel->ID_Cycle_Safe("stand_turn_ls_0"));
437437
break;
438-
case DIK_3:
438+
case SDL_SCANCODE_3:
439439
// threaten
440440
com_man().seq_run(skel->ID_Cycle_Safe("stand_threaten_0"));
441441
break;
442-
case DIK_0: Msg("Ohhhhhhhhhhhhhhh! Here it is!"); break;
442+
case SDL_SCANCODE_0: Msg("Ohhhhhhhhhhhhhhh! Here it is!"); break;
443443
}
444444
}
445445
#endif

src/xrGame/ai/monsters/zombie/zombie.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -225,10 +225,10 @@ void CZombie::debug_on_key(int key)
225225
{
226226
switch (key)
227227
{
228-
case DIK_MINUS: { fake_death_fall_down();
228+
case SDL_SCANCODE_MINUS: { fake_death_fall_down();
229229
}
230230
break;
231-
case DIK_EQUALS: { fake_death_stand_up();
231+
case SDL_SCANCODE_EQUALS: { fake_death_stand_up();
232232
}
233233
break;
234234
}

0 commit comments

Comments
 (0)