mirror of
https://github.com/ReactionQuake3/reaction.git
synced 2024-11-10 15:21:44 +00:00
IOQ3 commit 1941
This commit is contained in:
parent
33e83f20eb
commit
36b14c674b
1 changed files with 6 additions and 5 deletions
|
@ -137,6 +137,11 @@ void R_LoadJPG(const char *filename, unsigned char **pic, int *width, int *heigh
|
|||
|
||||
/* Step 4: set parameters for decompression */
|
||||
|
||||
/*
|
||||
* Make sure it always converts images to RGB color space. This will
|
||||
* automatically convert 8-bit greyscale images to RGB as well.
|
||||
*/
|
||||
|
||||
cinfo.out_color_space = JCS_RGB;
|
||||
|
||||
/* Step 5: Start decompressor */
|
||||
|
@ -195,14 +200,10 @@ void R_LoadJPG(const char *filename, unsigned char **pic, int *width, int *heigh
|
|||
|
||||
buf = out;
|
||||
|
||||
// If we are processing an 8-bit JPEG (greyscale), we'll have to convert
|
||||
// the greyscale values to RGBA.
|
||||
// Expand from RGB to RGBA
|
||||
sindex = pixelcount * cinfo.output_components;
|
||||
dindex = memcount;
|
||||
|
||||
// Only pixelcount number of bytes have been written.
|
||||
// Expand the color values over the rest of the buffer, starting
|
||||
// from the end.
|
||||
do
|
||||
{
|
||||
buf[--dindex] = 255;
|
||||
|
|
Loading…
Reference in a new issue