Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
b7e19e4a
Commit
b7e19e4a
authored
Jul 10, 2017
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
user32: Implement LR_MONOCHROME for loading cursors.
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
51fea220
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
15 deletions
+20
-15
cursoricon.c
dlls/user32/cursoricon.c
+20
-15
No files found.
dlls/user32/cursoricon.c
View file @
b7e19e4a
...
...
@@ -559,7 +559,7 @@ static BOOL CURSORICON_GetResIconEntry( LPCVOID dir, DWORD size, int n,
static
int
CURSORICON_FindBestCursor
(
LPCVOID
dir
,
DWORD
size
,
fnGetCIEntry
get_entry
,
int
width
,
int
height
,
int
depth
,
UINT
loadflags
)
{
int
i
,
maxwidth
,
maxheight
,
cx
,
cy
,
bits
,
bestEntry
=
-
1
;
int
i
,
maxwidth
,
maxheight
,
maxbits
,
cx
,
cy
,
bits
,
bestEntry
=
-
1
;
if
(
loadflags
&
LR_DEFAULTSIZE
)
{
...
...
@@ -573,22 +573,22 @@ static int CURSORICON_FindBestCursor( LPCVOID dir, DWORD size, fnGetCIEntry get_
return
0
;
}
/* Double height to account for AND and XOR masks */
height
*=
2
;
/* First find the largest one smaller than or equal to the requested size*/
maxwidth
=
maxheight
=
0
;
maxwidth
=
maxheight
=
maxbits
=
0
;
for
(
i
=
0
;
get_entry
(
dir
,
size
,
i
,
&
cx
,
&
cy
,
&
bits
);
i
++
)
{
if
((
cx
<=
width
)
&&
(
cy
<=
height
)
&&
(
cx
>
maxwidth
)
&&
(
cy
>
maxheight
))
if
(
cx
>
width
||
cy
>
height
)
continue
;
if
(
cx
<
maxwidth
||
cy
<
maxheight
)
continue
;
if
(
loadflags
&
LR_MONOCHROME
)
{
bestEntry
=
i
;
maxwidth
=
cx
;
maxheight
=
cy
;
if
(
maxbits
&&
bits
>=
maxbits
)
continue
;
}
else
if
(
bits
<=
maxbits
)
continue
;
bestEntry
=
i
;
maxwidth
=
cx
;
maxheight
=
cy
;
maxbits
=
bits
;
}
if
(
bestEntry
!=
-
1
)
return
bestEntry
;
...
...
@@ -597,13 +597,18 @@ static int CURSORICON_FindBestCursor( LPCVOID dir, DWORD size, fnGetCIEntry get_
maxwidth
=
maxheight
=
255
;
for
(
i
=
0
;
get_entry
(
dir
,
size
,
i
,
&
cx
,
&
cy
,
&
bits
);
i
++
)
{
if
(((
cx
<
maxwidth
)
&&
(
cy
<
maxheight
))
||
(
bestEntry
==
-
1
))
if
(
cx
>
maxwidth
||
cy
>
maxheight
)
continue
;
if
(
loadflags
&
LR_MONOCHROME
)
{
bestEntry
=
i
;
maxwidth
=
cx
;
maxheight
=
cy
;
if
(
maxbits
&&
bits
>=
maxbits
)
continue
;
}
else
if
(
bits
<=
maxbits
)
continue
;
bestEntry
=
i
;
maxwidth
=
cx
;
maxheight
=
cy
;
maxbits
=
bits
;
}
if
(
bestEntry
==
-
1
)
bestEntry
=
0
;
return
bestEntry
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment