Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
dfb41b35
Commit
dfb41b35
authored
Nov 05, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Nov 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Switch to a Nx4 tiling.
parent
67728733
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
39 additions
and
8 deletions
+39
-8
imagelist.c
dlls/comctl32/imagelist.c
+39
-8
No files found.
dlls/comctl32/imagelist.c
View file @
dfb41b35
...
...
@@ -84,28 +84,59 @@ static inline BOOL is_valid(HIMAGELIST himl)
return
himl
&&
himl
->
magic
==
IMAGELIST_MAGIC
;
}
/*
* An imagelist with N images is tiled like this:
*
* N/4 ->
*
* 4 048C..
* 159D..
* | 26AE.N
* V 37BF.
*/
#define TILE_COUNT 4
static
inline
UINT
imagelist_width
(
UINT
count
)
{
return
((
count
+
TILE_COUNT
-
1
)
/
TILE_COUNT
);
}
static
inline
void
imagelist_point_from_index
(
HIMAGELIST
himl
,
UINT
index
,
LPPOINT
pt
)
{
pt
->
x
=
index
*
himl
->
cx
;
pt
->
y
=
0
;
pt
->
x
=
(
index
/
TILE_COUNT
)
*
himl
->
cx
;
pt
->
y
=
(
index
%
TILE_COUNT
)
*
himl
->
cy
;
}
static
inline
void
imagelist_get_bitmap_size
(
HIMAGELIST
himl
,
UINT
count
,
UINT
cy
,
SIZE
*
sz
)
{
sz
->
cx
=
count
*
himl
->
cx
;
sz
->
cy
=
cy
;
sz
->
cx
=
imagelist_width
(
count
)
*
himl
->
cx
;
sz
->
cy
=
cy
*
TILE_COUNT
;
}
/*
* imagelist_copy_images()
*
* Copies a block of count images from offset src in the list to offset dest.
* Images are copied a row at at time. Assumes hdcSrc and hdcDest are different.
*/
static
inline
void
imagelist_copy_images
(
HIMAGELIST
himl
,
HDC
hdcSrc
,
HDC
hdcDest
,
UINT
src
,
UINT
count
,
UINT
dest
)
{
POINT
ptSrc
,
ptDest
;
SIZE
sz
;
UINT
i
;
imagelist_point_from_index
(
himl
,
src
,
&
ptSrc
);
imagelist_point_from_index
(
himl
,
dest
,
&
ptDest
);
imagelist_get_bitmap_size
(
himl
,
count
,
himl
->
cy
,
&
sz
);
BitBlt
(
hdcDest
,
ptSrc
.
x
,
ptSrc
.
y
,
sz
.
cx
,
sz
.
cy
,
hdcSrc
,
ptDest
.
x
,
ptDest
.
y
,
SRCCOPY
);
for
(
i
=
0
;
i
<
TILE_COUNT
;
i
++
)
{
imagelist_point_from_index
(
himl
,
src
+
i
,
&
ptSrc
);
imagelist_point_from_index
(
himl
,
dest
+
i
,
&
ptDest
);
sz
.
cx
=
himl
->
cx
*
imagelist_width
(
count
-
i
);
sz
.
cy
=
himl
->
cy
;
BitBlt
(
hdcDest
,
ptDest
.
x
,
ptDest
.
y
,
sz
.
cx
,
sz
.
cy
,
hdcSrc
,
ptSrc
.
x
,
ptSrc
.
y
,
SRCCOPY
);
}
}
/*************************************************************************
...
...
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