BII: fix gamma ramp

This commit is contained in:
kanjitalk755 2020-09-17 11:10:15 +09:00
parent d851a65548
commit 7313b0284c
3 changed files with 11 additions and 11 deletions

View File

@ -343,7 +343,7 @@ public:
// Called by the video driver to set the color palette (in indexed modes)
virtual void set_palette(uint8 *pal, int num) = 0;
// Called by the video driver to set the gamma table (in direct modes)
// Called by the video driver to set the gamma table
virtual void set_gamma(uint8 *gamma, int num) = 0;
};

View File

@ -205,8 +205,8 @@ private:
// Set palette to 50% gray
void set_gray_palette(void);
// Load gamma-corrected black-to-white ramp to palette for direct-color mode
void load_ramp_palette(void);
// Load gamma-corrected black-to-white ramp
void load_gamma_ramp(void);
// Allocate gamma table of specified size
bool allocate_gamma_table(int size);
@ -250,8 +250,10 @@ public:
virtual void switch_to_current_mode(void) = 0;
// Called by the video driver to set the color palette (in indexed modes)
// or the gamma table (in direct modes)
virtual void set_palette(uint8 *pal, int num) = 0;
// Called by the video driver to set the gamma table
virtual void set_gamma(uint8 *gamma, int num) = 0;
};
// Vector of pointers to available monitor descriptions, filled by VideoInit()

View File

@ -235,10 +235,10 @@ void monitor_desc::set_gray_palette(void)
/*
* Load gamma-corrected black-to-white ramp to palette for direct-color mode
* Load gamma-corrected black-to-white ramp
*/
void monitor_desc::load_ramp_palette(void)
void monitor_desc::load_gamma_ramp(void)
{
// Find tables for gamma correction
uint8 *red_gamma = NULL, *green_gamma = NULL, *blue_gamma = NULL;
@ -273,7 +273,7 @@ void monitor_desc::load_ramp_palette(void)
*p++ = blue;
}
set_palette(palette, num);
set_gamma(palette, num);
}
@ -354,8 +354,7 @@ int16 monitor_desc::set_gamma_table(uint32 user_table)
Mac2Mac_memcpy(gamma_table, user_table, size);
}
if (IsDirectMode(*current_mode))
load_ramp_palette();
load_gamma_ramp();
return noErr;
}
@ -636,8 +635,7 @@ int16 monitor_desc::driver_control(uint16 code, uint32 param, uint32 dce)
pat = ~pat;
}
if (IsDirectMode(*current_mode))
load_ramp_palette();
load_gamma_ramp();
return noErr;
}