Skip to content

Commit

Permalink
Misc updates
Browse files Browse the repository at this point in the history
 - Update copyright to 2019
 - Update Init logs
 - Simplify LoadLibrary
 - Fix IDirectType switche statements
  • Loading branch information
elishacloud committed Feb 15, 2019
1 parent eb92904 commit 584f62c
Show file tree
Hide file tree
Showing 26 changed files with 44 additions and 39 deletions.
2 changes: 1 addition & 1 deletion BuildNo.rc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
#define BUILD_NUMBER 13
#define BUILD_NUMBER 14
2 changes: 1 addition & 1 deletion IDirectInputDeviceX.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion IDirectInputEffect.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion IDirectInputEnum.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
12 changes: 1 addition & 11 deletions IDirectInputTypes.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down Expand Up @@ -27,20 +27,15 @@ DWORD ConvertDevTypeTo7(DWORD dwDevType)
{
case DI8DEVTYPE_DEVICE:
return DIDEVTYPE_DEVICE;
break;
case DI8DEVTYPE_MOUSE:
return DIDEVTYPE_MOUSE;
break;
case DI8DEVTYPE_KEYBOARD:
return DIDEVTYPE_KEYBOARD;
break;
case DI8DEVTYPE_JOYSTICK:
case DI8DEVTYPE_GAMEPAD:
return DIDEVTYPE_JOYSTICK;
break;
default:
return dwDevType;
break;
}
}

Expand All @@ -50,18 +45,13 @@ DWORD ConvertDevTypeTo8(DWORD dwDevType)
{
case DIDEVTYPE_DEVICE:
return DI8DEVTYPE_DEVICE;
break;
case DIDEVTYPE_MOUSE:
return DI8DEVTYPE_MOUSE;
break;
case DIDEVTYPE_KEYBOARD:
return DI8DEVTYPE_KEYBOARD;
break;
case DIDEVTYPE_JOYSTICK:
return DI8DEVTYPE_GAMEPAD;
break;
default:
return dwDevType;
break;
}
}
3 changes: 2 additions & 1 deletion IDirectInputX.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down Expand Up @@ -104,6 +104,7 @@ HRESULT m_IDirectInputX::CreateDeviceEx(REFGUID rguid, REFIID riid, T *ppvObj, L

if (SUCCEEDED(hr))
{
AddRef();
genericQueryInterface(riid, (LPVOID *)ppvObj);
}

Expand Down
2 changes: 1 addition & 1 deletion InterfaceQuery.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion License.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
15 changes: 15 additions & 0 deletions Logging/License.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
/**
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
* Permission is granted to anyone to use this software for any purpose, including commercial
* applications, and to alter it and redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you must not claim that you wrote the
* original software. If you use this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
* 2. Altered source versions must be plainly marked as such, and must not be misrepresented as
* being the original software.
* 3. This notice may not be removed or altered from any source distribution.
*/
2 changes: 1 addition & 1 deletion Logging/Logging.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ Delete the `dinput.dll` files from the game's directory. You can also delete the
There are no configuration options for dinputto8.

### License
Copyright (C) 2018 Elisha Riedlinger
Copyright (C) 2019 Elisha Riedlinger

This software is provided 'as-is', without any express or implied warranty. In no event will the author(s) be held liable for any damages arising from the use of this software. Permission is granted to anyone to use this software for any purpose, including commercial applications, and to alter it and redistribute it freely, subject to the following restrictions:

Expand Down
2 changes: 1 addition & 1 deletion Versions/IDirectInput2A.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion Versions/IDirectInput2W.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion Versions/IDirectInput7A.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion Versions/IDirectInput7W.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion Versions/IDirectInputA.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion Versions/IDirectInputDevice2A.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion Versions/IDirectInputDevice2W.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion Versions/IDirectInputDevice7A.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion Versions/IDirectInputDevice7W.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion Versions/IDirectInputDeviceA.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion Versions/IDirectInputDeviceW.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion Versions/IDirectInputW.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
2 changes: 1 addition & 1 deletion Versions/License.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down
9 changes: 4 additions & 5 deletions dinputto8.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* Copyright (C) 2018 Elisha Riedlinger
* Copyright (C) 2019 Elisha Riedlinger
*
* This software is provided 'as-is', without any express or implied warranty. In no event will the
* authors be held liable for any damages arising from the use of this software.
Expand Down Expand Up @@ -44,17 +44,16 @@ void InitDinput8()
// Init logs
#ifdef NOLOGGING
Logging::EnableLogging = false;
#endif
#else
Logging::Open("dinput.log");
Logging::Log() << "Starting dinputto8 v" << APP_VERSION;
Logging::LogComputerManufacturer();
Logging::LogOSVersion();
Logging::LogProcessNameAndPID();
#endif

// Load dll
char path[MAX_PATH];
strcpy_s(path, "dinput8.dll");
HMODULE dinput8dll = LoadLibraryA(path);
HMODULE dinput8dll = LoadLibraryA("dinput8.dll");

// Get function addresses
m_pDirectInput8Create = (DirectInput8CreateProc)GetProcAddress(dinput8dll, "DirectInput8Create");
Expand Down
2 changes: 1 addition & 1 deletion resource.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
#define APP_REVISION 0
#define APP_COMPANYNAME "Sadrate Presents"
#define APP_DESCRPTION "Converts DirectInput 1-7 (dinput.dll) to DirectInput 8 (dinput8.dll) for older games."
#define APP_COPYRIGHT "Copyright (C) 2018 Elisha Riedlinger"
#define APP_COPYRIGHT "Copyright (C) 2019 Elisha Riedlinger"
#define APP_ORIGINALVERSION "dinput.dll"
#define APP_INTERNALNAME "dinputto8"

Expand Down

0 comments on commit 584f62c

Please sign in to comment.