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
a660c790
Commit
a660c790
authored
Jun 03, 2000
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Moved DIB_FixColorsToLoadflags to cursoricon.c.
parent
48320f74
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
67 additions
and
67 deletions
+67
-67
bitmap.h
include/bitmap.h
+0
-1
dib.c
objects/dib.c
+0
-66
cursoricon.c
windows/cursoricon.c
+67
-0
No files found.
include/bitmap.h
View file @
a660c790
...
...
@@ -57,7 +57,6 @@ extern HBITMAP DIB_CreateDIBSection( HDC hdc, BITMAPINFO *bmi, UINT usage, LPVOI
extern
void
DIB_UpdateDIBSection
(
DC
*
dc
,
BOOL
toDIB
);
extern
void
DIB_DeleteDIBSection
(
BITMAPOBJ
*
bmp
);
extern
void
DIB_SelectDIBSection
(
DC
*
dc
,
BITMAPOBJ
*
bmp
);
extern
void
DIB_FixColorsToLoadflags
(
BITMAPINFO
*
bmi
,
UINT
loadflags
,
BYTE
pix
);
extern
HGLOBAL
DIB_CreateDIBFromBitmap
(
HDC
hdc
,
HBITMAP
hBmp
);
#endif
/* __WINE_BITMAP_H */
objects/dib.c
View file @
a660c790
...
...
@@ -931,72 +931,6 @@ void DIB_DeleteDIBSection( BITMAPOBJ *bmp )
}
/***********************************************************************
* DIB_FixColorsToLoadflags
*
* Change color table entries when LR_LOADTRANSPARENT or LR_LOADMAP3DCOLORS
* are in loadflags
*/
void
DIB_FixColorsToLoadflags
(
BITMAPINFO
*
bmi
,
UINT
loadflags
,
BYTE
pix
)
{
int
colors
;
COLORREF
c_W
,
c_S
,
c_F
,
c_L
,
c_C
;
int
incr
,
i
;
RGBQUAD
*
ptr
;
if
(
bmi
->
bmiHeader
.
biBitCount
>
8
)
return
;
if
(
bmi
->
bmiHeader
.
biSize
==
sizeof
(
BITMAPINFOHEADER
))
incr
=
4
;
else
if
(
bmi
->
bmiHeader
.
biSize
==
sizeof
(
BITMAPCOREHEADER
))
incr
=
3
;
else
{
WARN
(
"Wrong bitmap header size!
\n
"
);
return
;
}
colors
=
bmi
->
bmiHeader
.
biClrUsed
;
if
(
!
colors
&&
(
bmi
->
bmiHeader
.
biBitCount
<=
8
))
colors
=
1
<<
bmi
->
bmiHeader
.
biBitCount
;
c_W
=
GetSysColor
(
COLOR_WINDOW
);
c_S
=
GetSysColor
(
COLOR_3DSHADOW
);
c_F
=
GetSysColor
(
COLOR_3DFACE
);
c_L
=
GetSysColor
(
COLOR_3DLIGHT
);
if
(
loadflags
&
LR_LOADTRANSPARENT
)
{
switch
(
bmi
->
bmiHeader
.
biBitCount
)
{
case
1
:
pix
=
pix
>>
7
;
break
;
case
4
:
pix
=
pix
>>
4
;
break
;
case
8
:
break
;
default:
WARN
(
"(%d): Unsupported depth
\n
"
,
bmi
->
bmiHeader
.
biBitCount
);
return
;
}
if
(
pix
>=
colors
)
{
WARN
(
"pixel has color index greater than biClrUsed!
\n
"
);
return
;
}
if
(
loadflags
&
LR_LOADMAP3DCOLORS
)
c_W
=
c_F
;
ptr
=
(
RGBQUAD
*
)((
char
*
)
bmi
->
bmiColors
+
pix
*
incr
);
ptr
->
rgbBlue
=
GetBValue
(
c_W
);
ptr
->
rgbGreen
=
GetGValue
(
c_W
);
ptr
->
rgbRed
=
GetRValue
(
c_W
);
}
if
(
loadflags
&
LR_LOADMAP3DCOLORS
)
for
(
i
=
0
;
i
<
colors
;
i
++
)
{
ptr
=
(
RGBQUAD
*
)((
char
*
)
bmi
->
bmiColors
+
i
*
incr
);
c_C
=
RGB
(
ptr
->
rgbRed
,
ptr
->
rgbGreen
,
ptr
->
rgbBlue
);
if
(
c_C
==
RGB
(
128
,
128
,
128
))
{
ptr
->
rgbRed
=
GetRValue
(
c_S
);
ptr
->
rgbGreen
=
GetGValue
(
c_S
);
ptr
->
rgbBlue
=
GetBValue
(
c_S
);
}
else
if
(
c_C
==
RGB
(
192
,
192
,
192
))
{
ptr
->
rgbRed
=
GetRValue
(
c_F
);
ptr
->
rgbGreen
=
GetGValue
(
c_F
);
ptr
->
rgbBlue
=
GetBValue
(
c_F
);
}
else
if
(
c_C
==
RGB
(
223
,
223
,
223
))
{
ptr
->
rgbRed
=
GetRValue
(
c_L
);
ptr
->
rgbGreen
=
GetGValue
(
c_L
);
ptr
->
rgbBlue
=
GetBValue
(
c_L
);
}
}
}
/***********************************************************************
* DIB_CreateDIBFromBitmap
* Allocates a packed DIB and copies the bitmap data into it.
*/
...
...
windows/cursoricon.c
View file @
a660c790
...
...
@@ -2008,6 +2008,73 @@ BOOL WINAPI DrawIconEx( HDC hdc, INT x0, INT y0, HICON hIcon,
return
result
;
}
/***********************************************************************
* DIB_FixColorsToLoadflags
*
* Change color table entries when LR_LOADTRANSPARENT or LR_LOADMAP3DCOLORS
* are in loadflags
*/
static
void
DIB_FixColorsToLoadflags
(
BITMAPINFO
*
bmi
,
UINT
loadflags
,
BYTE
pix
)
{
int
colors
;
COLORREF
c_W
,
c_S
,
c_F
,
c_L
,
c_C
;
int
incr
,
i
;
RGBQUAD
*
ptr
;
if
(
bmi
->
bmiHeader
.
biBitCount
>
8
)
return
;
if
(
bmi
->
bmiHeader
.
biSize
==
sizeof
(
BITMAPINFOHEADER
))
incr
=
4
;
else
if
(
bmi
->
bmiHeader
.
biSize
==
sizeof
(
BITMAPCOREHEADER
))
incr
=
3
;
else
{
WARN_
(
resource
)(
"Wrong bitmap header size!
\n
"
);
return
;
}
colors
=
bmi
->
bmiHeader
.
biClrUsed
;
if
(
!
colors
&&
(
bmi
->
bmiHeader
.
biBitCount
<=
8
))
colors
=
1
<<
bmi
->
bmiHeader
.
biBitCount
;
c_W
=
GetSysColor
(
COLOR_WINDOW
);
c_S
=
GetSysColor
(
COLOR_3DSHADOW
);
c_F
=
GetSysColor
(
COLOR_3DFACE
);
c_L
=
GetSysColor
(
COLOR_3DLIGHT
);
if
(
loadflags
&
LR_LOADTRANSPARENT
)
{
switch
(
bmi
->
bmiHeader
.
biBitCount
)
{
case
1
:
pix
=
pix
>>
7
;
break
;
case
4
:
pix
=
pix
>>
4
;
break
;
case
8
:
break
;
default:
WARN_
(
resource
)(
"(%d): Unsupported depth
\n
"
,
bmi
->
bmiHeader
.
biBitCount
);
return
;
}
if
(
pix
>=
colors
)
{
WARN_
(
resource
)(
"pixel has color index greater than biClrUsed!
\n
"
);
return
;
}
if
(
loadflags
&
LR_LOADMAP3DCOLORS
)
c_W
=
c_F
;
ptr
=
(
RGBQUAD
*
)((
char
*
)
bmi
->
bmiColors
+
pix
*
incr
);
ptr
->
rgbBlue
=
GetBValue
(
c_W
);
ptr
->
rgbGreen
=
GetGValue
(
c_W
);
ptr
->
rgbRed
=
GetRValue
(
c_W
);
}
if
(
loadflags
&
LR_LOADMAP3DCOLORS
)
for
(
i
=
0
;
i
<
colors
;
i
++
)
{
ptr
=
(
RGBQUAD
*
)((
char
*
)
bmi
->
bmiColors
+
i
*
incr
);
c_C
=
RGB
(
ptr
->
rgbRed
,
ptr
->
rgbGreen
,
ptr
->
rgbBlue
);
if
(
c_C
==
RGB
(
128
,
128
,
128
))
{
ptr
->
rgbRed
=
GetRValue
(
c_S
);
ptr
->
rgbGreen
=
GetGValue
(
c_S
);
ptr
->
rgbBlue
=
GetBValue
(
c_S
);
}
else
if
(
c_C
==
RGB
(
192
,
192
,
192
))
{
ptr
->
rgbRed
=
GetRValue
(
c_F
);
ptr
->
rgbGreen
=
GetGValue
(
c_F
);
ptr
->
rgbBlue
=
GetBValue
(
c_F
);
}
else
if
(
c_C
==
RGB
(
223
,
223
,
223
))
{
ptr
->
rgbRed
=
GetRValue
(
c_L
);
ptr
->
rgbGreen
=
GetGValue
(
c_L
);
ptr
->
rgbBlue
=
GetBValue
(
c_L
);
}
}
}
/**********************************************************************
* BITMAP_Load
*/
...
...
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