Propagate error information from set_gamma_table.

This commit is contained in:
James Touton 2015-08-06 01:31:26 -07:00
parent 73f3af6c3b
commit 1d875960db
2 changed files with 5 additions and 5 deletions

View File

@ -209,7 +209,7 @@ private:
bool allocate_gamma_table(int size); bool allocate_gamma_table(int size);
// Set gamma table (0 = build linear ramp) // Set gamma table (0 = build linear ramp)
bool set_gamma_table(uint32 user_table); int16 set_gamma_table(uint32 user_table);
// Switch video mode // Switch video mode
void switch_mode(vector<video_mode>::const_iterator it, uint32 param, uint32 dce); void switch_mode(vector<video_mode>::const_iterator it, uint32 param, uint32 dce);

View File

@ -290,7 +290,7 @@ bool monitor_desc::allocate_gamma_table(int size)
* Set gamma table (0 = build linear ramp) * Set gamma table (0 = build linear ramp)
*/ */
bool monitor_desc::set_gamma_table(uint32 user_table) int16 monitor_desc::set_gamma_table(uint32 user_table)
{ {
if (user_table == 0) { // Build linear ramp, 256 entries if (user_table == 0) { // Build linear ramp, 256 entries
@ -340,7 +340,7 @@ bool monitor_desc::set_gamma_table(uint32 user_table)
if (IsDirectMode(*current_mode)) if (IsDirectMode(*current_mode))
load_ramp_palette(); load_ramp_palette();
return true; return noErr;
} }
@ -590,7 +590,7 @@ int16 monitor_desc::driver_control(uint16 code, uint32 param, uint32 dce)
case cscSetGamma: { // Set gamma table case cscSetGamma: { // Set gamma table
uint32 user_table = ReadMacInt32(param + csGTable); uint32 user_table = ReadMacInt32(param + csGTable);
D(bug(" SetGamma %08x\n", user_table)); D(bug(" SetGamma %08x\n", user_table));
return set_gamma_table(user_table) ? noErr : memFullErr; return set_gamma_table(user_table);
} }
case cscGrayPage: { // Fill page with dithered gray pattern case cscGrayPage: { // Fill page with dithered gray pattern
@ -627,7 +627,7 @@ int16 monitor_desc::driver_control(uint16 code, uint32 param, uint32 dce)
case cscSetGray: // Enable/disable luminance mapping case cscSetGray: // Enable/disable luminance mapping
D(bug(" SetGray %02x\n", ReadMacInt8(param + csMode))); D(bug(" SetGray %02x\n", ReadMacInt8(param + csMode)));
luminance_mapping = ReadMacInt8(param + csMode); luminance_mapping = ReadMacInt8(param + csMode) != 0;
return noErr; return noErr;
case cscSetInterrupt: // Enable/disable VBL case cscSetInterrupt: // Enable/disable VBL