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
3c914dc2
Commit
3c914dc2
authored
Jul 22, 2022
by
Jeff Smith
Committed by
Alexandre Julliard
Jul 25, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3drm: Fix components of palette when loading texture from 8-bit BMP file.
parent
b32acacb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
5 deletions
+8
-5
d3drm.c
dlls/d3drm/tests/d3drm.c
+5
-4
texture.c
dlls/d3drm/texture.c
+3
-1
No files found.
dlls/d3drm/tests/d3drm.c
View file @
3c914dc2
...
...
@@ -6189,9 +6189,9 @@ static char *create_bitmap(unsigned int w, unsigned int h, BOOL palettized)
{
for
(
i
=
0
;
i
<
256
;
++
i
)
{
info
->
bmiColors
[
i
].
rgbBlue
=
i
;
info
->
bmiColors
[
i
].
rgbGreen
=
i
;
info
->
bmiColors
[
i
].
rgbRed
=
i
;
info
->
bmiColors
[
i
].
rgbBlue
=
i
%
MOD_B
;
info
->
bmiColors
[
i
].
rgbGreen
=
i
%
MOD_G
;
info
->
bmiColors
[
i
].
rgbRed
=
i
%
MOD_R
;
}
}
ret
=
WriteFile
(
file
,
info
,
size
,
&
written
,
NULL
);
...
...
@@ -6317,7 +6317,8 @@ static void test_bitmap_data(unsigned int test_idx, const D3DRMIMAGE *img,
ok
(
img
->
palette_size
==
256
,
"Test %u: Got unexpected palette size %u.
\n
"
,
test_idx
,
img
->
palette_size
);
for
(
i
=
0
;
i
<
256
;
++
i
)
{
ok
(
img
->
palette
[
i
].
red
==
i
&&
img
->
palette
[
i
].
green
==
i
&&
img
->
palette
[
i
].
blue
==
i
,
ok
(
img
->
palette
[
i
].
red
==
i
%
MOD_R
&&
img
->
palette
[
i
].
green
==
i
%
MOD_G
&&
img
->
palette
[
i
].
blue
==
i
%
MOD_B
,
"Test %u: Got unexpected palette entry (%u) color 0x%02x%02x%02x.
\n
"
,
test_idx
,
i
,
img
->
palette
[
i
].
red
,
img
->
palette
[
i
].
green
,
img
->
palette
[
i
].
blue
);
ok
(
img
->
palette
[
i
].
flags
==
D3DRMPALETTE_READONLY
,
...
...
dlls/d3drm/texture.c
View file @
3c914dc2
...
...
@@ -219,9 +219,11 @@ static HRESULT d3drm_image_load_8(D3DRMIMAGE *image, const RGBQUAD *palette,
return
D3DRMERR_BADALLOC
;
}
memcpy
(
image
->
palette
,
palette
,
256
*
sizeof
(
*
image
->
palette
));
for
(
i
=
0
;
i
<
256
;
++
i
)
{
image
->
palette
[
i
].
red
=
palette
[
i
].
rgbRed
;
image
->
palette
[
i
].
green
=
palette
[
i
].
rgbGreen
;
image
->
palette
[
i
].
blue
=
palette
[
i
].
rgbBlue
;
image
->
palette
[
i
].
flags
=
D3DRMPALETTE_READONLY
;
}
...
...
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