Skip to content

Commit

Permalink
finalized best optimization choices in project file, added notation t…
Browse files Browse the repository at this point in the history
…o changed section of source files, extended/updated documentation, and properly implemented the resource script after changing from VC++2008 Express Edition to Professional
  • Loading branch information
VolsandJezuz committed Oct 14, 2015
1 parent 79fad81 commit 8cfb4fa
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 18 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,6 @@ RInput.sln
RInput.suo
RInput.vcproj.*
Release/
versioninfo.aps
.gitconfig
.gitignore
21 changes: 14 additions & 7 deletions README
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
RInput Library v1.33 by Vols and Jezuz
RInput Library v1.34 by Vols and Jezuz
--------------------------------------
RInput allows you to override low definition windows mouse input (accurate untill 400cpi) with high definition mouse input (raw input, which is more accurate for high cpi mice). This is certainly useful for older games as those engines only support low definition windows mouse input.

Requirements:
--------------------------------------
- OS: Windows XP or later
- CPU: Intel Pentium 4 or later; or, AMD Opteron, Athlon 64 or later
- Microsoft Visual C++ 2008 Redistributable - x86 9.0.21022.218 or later (included in RInput release downloads starting with v1.34)

Note:
--------------------------------------
This is a fork of RInput Library v1.31 as originally authored by abort. x64 architecture support was never added by him, but here are some notes on what would need to be changed to accomplish this, in case someone is interested:
Expand All @@ -11,11 +17,12 @@ This is a fork of RInput Library v1.31 as originally authored by abort. x64 arch

Building:
--------------------------------------
Compiled with Visual C++ 2008 Express Edition, though you may be able to get it to work with other versions or compilers (available for free @ https://go.microsoft.com/?linkid=7729279);
Compiled with Visual Studio 2008, though you may be able to get it to work with other versions or compilers (Visual C++ 2008 Express Edition is available for free @ https://go.microsoft.com/?linkid=7729279);
- Pick Dynamic Library (.dll) as the configuration type
- Compile using Multi-Byte Character Set
- Add the Microsoft SDK (I used v6.0A that came with VC++2008) folders as additional Include directory and additional linker library directory
- Add the Microsoft SDK (I used v6.0A that came with VS2008/VC++2008) folders as additional Include directory and additional linker library directory
- Compiled with Multi-threaded DLL runtime library for linking
- Set the Entry Point as DllMain
- Use x86 architecture for compiling (i.e., RInput does not support for x64 applications)
- MS Detours 1.5 header and library were acquired from http://home.comcast.net/~wiccaan/downloads/Detours.rar

Expand All @@ -32,7 +39,7 @@ Summary of the process by the original author:

Credits:
--------------------------------------
BuSheeZy - helping me understand Visual C++ IDE and Git
qsxcv - ideas for how to improve the mouse data handling and information about how mouse input works
about - original author
Dr3am - for the icons
- BuSheeZy - helping me understand Visual C++ IDE and Git
- qsxcv - ideas for how to improve the mouse data handling and information about how mouse input works
- about - original author
- Dr3am - for the icons
18 changes: 12 additions & 6 deletions README.mdown
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
# RInput Library v1.33 by Vols and Jezuz
# RInput Library v1.34 by Vols and Jezuz
RInput allows you to override low definition windows mouse input (accurate untill 400cpi) with high definition mouse input (raw input, which is more accurate for high cpi mice). This is certainly useful for older games as those engines only support low definition windows mouse input.

## Requirements
- OS: Windows XP or later
- CPU: Intel Pentium III or later; or, AMD Opteron, Athlon 64 or later
- Microsoft Visual C++ 2008 Redistributable - x86 9.0.21022.218 or later (included in RInput release downloads starting with v1.34)

## Note
This is a fork of RInput Library v1.31 as originally authored by abort. x64 architecture support was never added by him, but here are some notes on what would need to be changed to accomplish this, in case someone is interested:
- The detouring/hooking mechanism needs to support the x64 architectures. This is mainly due to the jumping mechanism for larger pointers. The jumps need to support the whole memory address span over 32-bit
Expand All @@ -11,8 +16,9 @@ This is a fork of RInput Library v1.31 as originally authored by abort. x64 arch
Compiled with Visual C++ 2008 Express Edition, though you may be able to get it to work with other versions or compilers (available for free @ https://go.microsoft.com/?linkid=7729279);
- Pick Dynamic Library (.dll) as the configuration type
- Compile using Multi-Byte Character Set
- Add the Microsoft SDK (I used v6.0A that came with VC++2008) folders as additional Include directory and additional linker library directory
- Add the Microsoft SDK (I used v6.0A that came with VS2008/VC++2008) folders as additional Include directory and additional linker library directory
- Compiled with Multi-threaded DLL runtime library for linking
- Set the Entry Point as DllMain
- Use x86 architecture for compiling (i.e., RInput does not support for x64 applications)
- MS Detours 1.5 header and library were acquired from http://home.comcast.net/~wiccaan/downloads/Detours.rar

Expand All @@ -27,7 +33,7 @@ Summary of the process by the original author:
6. The injector gives the user feedback, based on whether the event was raised or not

## Credits:
BuSheeZy - helping me understand Visual C++ IDE and Git
qsxcv - ideas for how to improve the mouse data handling and information about how mouse input works
about - original author
Dr3am - for the icons
- BuSheeZy - helping me understand Visual C++ IDE and Git
- qsxcv - ideas for how to improve the mouse data handling and information about how mouse input works
- about - original author
- Dr3am - for the icons
6 changes: 3 additions & 3 deletions RInput.vcproj
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
<Tool
Name="VCCLCompilerTool"
UseUnicodeResponseFiles="false"
AdditionalOptions="/Gs4096"
Optimization="2"
InlineFunctionExpansion="2"
EnableIntrinsicFunctions="true"
FavorSizeOrSpeed="1"
Expand All @@ -149,7 +149,7 @@
RuntimeLibrary="2"
BufferSecurityCheck="false"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="0"
EnableEnhancedInstructionSet="2"
FloatingPointModel="2"
TreatWChar_tAsBuiltInType="true"
ForceConformanceInForLoopScope="false"
Expand Down Expand Up @@ -182,7 +182,7 @@
UACExecutionLevel="0"
GenerateDebugInformation="false"
SubSystem="2"
LargeAddressAware="0"
LargeAddressAware="2"
TerminalServerAware="0"
OptimizeReferences="2"
EnableCOMDATFolding="0"
Expand Down
3 changes: 3 additions & 0 deletions rawinput.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,8 @@ bool CRawInput::initInput(WCHAR* pwszError)
{
// Set default coordinates
CRawInput::x = CRawInput::y = CRawInput::set_x = CRawInput::set_y = 0;

// Update from v1.31, with the initial raw input data accumulators set to the starting cursor position
LPPOINT defCor = new tagPOINT;
GetCursorPos(defCor);
CRawInput::set_x = defCor->x;
Expand Down Expand Up @@ -179,6 +181,7 @@ int __stdcall CRawInput::hGetCursorPos(LPPOINT lpPoint)
lpPoint->x = CRawInput::set_x + CRawInput::x;
lpPoint->y = CRawInput::set_y + CRawInput::y;

// raw input data accumulator resets have moved here from hSetCursorPos, so raw input data occurring between GetCursorPos/SetCursorPos paired calls is not lost
if (CRawInput::s)
{
CRawInput::x = 0;
Expand Down
4 changes: 4 additions & 0 deletions rawinput.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,12 @@ class CRawInput {
private:
static long x;
static long y;

// mouse data handling is now split between set_x/y (stores the SetCursorPos starting point) and x/y (accumulates the raw input data), which add together as the next GetCursorPos offset
static long set_x;
static long set_y;

// toggle so raw input data is not reset when SetCursorPos isn't called after GetCursorPos, which fixes the odd behavior RInput used to have in TF2's backpack and some game menus
static bool s;

static HWND hwndInput;
Expand Down
4 changes: 2 additions & 2 deletions versioninfo.h
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef _VERSIONINFO_H_
#define _VERSIONINFO_H_

#define RINPUTVER "v1.33"
#define RINPUTFVER 1,33
#define RINPUTVER "v1.34"
#define RINPUTFVER 1,34
#define IDI_ICON 101

#define RINPUTINT "RInput"
Expand Down

0 comments on commit 8cfb4fa

Please sign in to comment.