Skip to content

Commit

Permalink
version 0.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
PandaTeemo committed Dec 13, 2017
1 parent 704913a commit 84af05a
Show file tree
Hide file tree
Showing 9 changed files with 57 additions and 21 deletions.
Binary file added bin/Yolo32.pdb
Binary file not shown.
2 changes: 1 addition & 1 deletion build/Installer32/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="YoloMouse" Language="1033" Version="0.9.0.0" Manufacturer="HaPpY" UpgradeCode="69ce184e-a676-4169-a124-e1ee073bd0e6">
<Product Id="*" Name="YoloMouse" Language="1033" Version="0.9.1.0" Manufacturer="HaPpY" UpgradeCode="69ce184e-a676-4169-a124-e1ee073bd0e6">

<Package Id="*" InstallerVersion="200" Compressed="yes" InstallPrivileges="elevated" InstallScope="perMachine" />
<WixVariable Id="WixUILicenseRtf" Value="$(var.SolutionDir)\..\etc\Eula.rtf" />
Expand Down
2 changes: 1 addition & 1 deletion build/Installer64/Product.wxs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
<Product Id="*" Name="YoloMouse" Language="1033" Version="0.9.0.0" Manufacturer="HaPpY" UpgradeCode="69ce184e-a676-4169-a124-e1ee073bd0e6">
<Product Id="*" Name="YoloMouse" Language="1033" Version="0.9.1.0" Manufacturer="HaPpY" UpgradeCode="69ce184e-a676-4169-a124-e1ee073bd0e6">

<Package Id="*" InstallerVersion="200" Compressed="yes" InstallPrivileges="elevated" InstallScope="perMachine" Platform="x64"/>
<WixVariable Id="WixUILicenseRtf" Value="$(var.SolutionDir)\..\etc\Eula.rtf" />
Expand Down
2 changes: 1 addition & 1 deletion build/YoloMouse.Loader/YoloMouse.Loader.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Text Include="..\..\..\todo.txt" />
<Text Include="..\..\..\Doc\todo.txt" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
Expand Down
2 changes: 1 addition & 1 deletion build/YoloMouse.Loader/YoloMouse.Loader.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@
</ResourceCompile>
</ItemGroup>
<ItemGroup>
<Text Include="..\..\..\todo.txt" />
<Text Include="..\..\..\Doc\todo.txt" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions build/YoloMouse.Share/YoloMouse.Share.vcxproj.user
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup />
</Project>
3 changes: 3 additions & 0 deletions source/YoloMouse/Dll/App.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,10 @@ namespace YoloMouse
{
// ignore null cursor
if( old_cursor == NULL )
{
_replace_cursor = NULL;
return;
}

// if cursor changing set refresh state
if( old_cursor != _last_cursor )
Expand Down
61 changes: 45 additions & 16 deletions source/YoloMouse/Dll/HandleCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ namespace YoloMouse
//-------------------------------------------------------------------------
Hash HandleCache::_CalculateHash( HCURSOR hcursor )
{
static const ULong HASH_BUFFER_LIMIT = KILOBYTES(8);

ICONINFO iconinfo = {0};
LONG count;
Byte buffer[HASH_BUFFER_LIMIT];
LONG buffer_limit;
Byte* buffer;
BITMAP bitmap;
HBITMAP hbitmap;
Hash hash = 0;

// require valid
if( hcursor == NULL )
Expand All @@ -67,23 +68,51 @@ namespace YoloMouse
return 0;
}

// get icon bitmap buffer
count = GetBitmapBits( iconinfo.hbmColor ? iconinfo.hbmColor : iconinfo.hbmMask, sizeof(buffer), buffer );
// select color else mask bitmap
hbitmap = iconinfo.hbmColor ? iconinfo.hbmColor : iconinfo.hbmMask;

// iconinfo cleanup
// get icon bitmap object
if( GetObject(hbitmap, sizeof(BITMAP), &bitmap) == 0 )
{
elog("HandleCache.CalculateHash.GetObject");
return 0;
}

// allocate buffer
buffer_limit = bitmap.bmWidthBytes * bitmap.bmHeight;
/*
TODO: this is a temporary hack added to 0.9.1 to make earlier 8k buffer
limit cursors semi backward compatible. remove in 2019.
*/
//HACK:begin
if( buffer_limit > KILOBYTES( 8 ) && buffer_limit <= KILOBYTES( 12 ) )
buffer_limit = KILOBYTES( 8 );
//HACK:end
buffer = new Byte[buffer_limit];

// if buffer created
if( buffer != nullptr )
{
// read icon bitmap pixel data
ULong buffer_count = GetBitmapBits( hbitmap, buffer_limit, buffer );

// log if failed
if( buffer_count == 0 )
elog("HandleCache.CalculateHash.GetBitmapBits");
// else generate hash
else
hash = Tools::Fnv164Hash(buffer, buffer_count);

// cleanup buffer
delete[] buffer;
}

// cleanup icon info
if( iconinfo.hbmColor )
DeleteObject(iconinfo.hbmColor);
if( iconinfo.hbmMask )
DeleteObject(iconinfo.hbmMask);

// fail if no bits read
if( count == 0 )
{
elog("HandleCache.CalculateHash.GetBitmapBits");
return 0;
}

// generate hash
return Tools::Fnv164Hash(buffer, count);
return hash;
}
}
2 changes: 1 addition & 1 deletion source/YoloMouse/Share/Constants.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ namespace YoloMouse

// numeric
//-------------------------------------------------------------------------
static const ULong APP_VERSION[] = { 0, 9, 0 };
static const ULong APP_VERSION[] = { 0, 9, 1 };
static const ULong APP_NAME_LIMIT = 64;
static const ULong LOG_MEMORY_LIMIT = KILOBYTES(8);
static const ULong LOADER_TARGET_LIMIT = 20;
Expand Down

0 comments on commit 84af05a

Please sign in to comment.