mirror of
https://github.com/kanjitalk755/macemu.git
synced 2025-01-03 01:29:43 +00:00
BII: fix gamma ramp
This commit is contained in:
parent
d851a65548
commit
7313b0284c
@ -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;
|
||||
};
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user