Add ICC profile option

This commit is contained in:
elasota
2020-07-03 13:53:10 -04:00
parent 037994d0f7
commit 62427de092
19 changed files with 526 additions and 75 deletions

View File

@@ -31,7 +31,7 @@
#define kDisplay12Inch 2
#define kDisplay13Inch 3
extern Boolean isAutoScale;
extern Boolean isAutoScale, isUseICCProfile;
typedef struct
@@ -412,6 +412,8 @@ void HandleDepthSwitching (void)
}
thisMac.isDepth = isDepthPref;
PortabilityLayer::HostDisplayDriver::GetInstance()->SetUseICCProfile(isUseICCProfile != 0);
}
//-------------------------------------------------------------- CheckMemorySize

View File

@@ -118,6 +118,7 @@ typedef struct
Boolean wasDoAutoDemo, wasAutoScale;
Boolean wasDoBackground, wasHouseChecks;
Boolean wasPrettyMap, wasBitchDialogs;
Boolean wasUseICCProfile;
} prefsInfo;
//-------------------------------------------------------------- Prototypes
@@ -230,7 +231,8 @@ void CloseThisWindow (WindowPtr *);
// THREEWORDINLINE(0x4218, 0x10B8, 0x0260);
#endif
extern Boolean hasScrap, scrapIsARoom;
#include "GliderDefines.h"
#include "GliderStructs.h"

View File

@@ -15,7 +15,7 @@
#include "WindowManager.h"
#define kPrefsVersion 0x0037
#define kPrefsVersion 0x0038
void ReadInPrefs (void);
@@ -25,7 +25,7 @@ int main(int argc, const char **argv);
short isVolume, wasVolume;
short isDepthPref, dataResFile, numSMWarnings;
Boolean quitting, doZooms, quickerTransitions, isAutoScale;
Boolean quitting, doZooms, quickerTransitions, isAutoScale, isUseICCProfile;
extern Str31 highBanner;
@@ -127,6 +127,7 @@ void ReadInPrefs (void)
doAutoDemo = thePrefs.wasDoAutoDemo;
isEscPauseKey = thePrefs.wasEscPauseKey;
isAutoScale = thePrefs.wasAutoScale;
isUseICCProfile = thePrefs.wasUseICCProfile;
doBackground = thePrefs.wasDoBackground;
doPrettyMap = thePrefs.wasPrettyMap;
doBitchDialogs = thePrefs.wasBitchDialogs;
@@ -209,6 +210,7 @@ void ReadInPrefs (void)
doAutoDemo = true;
isEscPauseKey = false;
isAutoScale = true;
isUseICCProfile = true;
doBackground = false;
doPrettyMap = false;
doBitchDialogs = true;
@@ -303,6 +305,7 @@ void WriteOutPrefs (void)
thePrefs.wasDoAutoDemo = doAutoDemo;
thePrefs.wasEscPauseKey = isEscPauseKey;
thePrefs.wasAutoScale = isAutoScale;
thePrefs.wasUseICCProfile = isUseICCProfile;
thePrefs.wasDoBackground = doBackground;
thePrefs.wasPrettyMap = doPrettyMap;
thePrefs.wasBitchDialogs = doBitchDialogs;

View File

@@ -27,6 +27,8 @@
#define kSoundPrefsDialID 1018
#define kControlPrefsDialID 1023
#define kBrainsPrefsDialID 1024
// Display dialog
#define kDisplayButton 3
#define kSoundButton 4
#define kControlsButton 5
@@ -35,18 +37,23 @@
#define kDisplay3Item 4
#define kDisplay9Item 5
#define kBorder1Item 8
#define kDoColorFadeItem 9
#define k32BitColorItem 10
#define kScaleResolutionItem 11
#define kBorder2Item 12
#define kBorder3Item 13
#define kDispDefault 14
#define k32BitColorItem 9
#define kScaleResolutionItem 10
#define kUseICCProfileItem 11
#define kDoColorFadeItem 12
#define kBorder2Item 13
#define kBorder3Item 14
#define kDispDefault 15
// Sound dialog
#define kSofterItem 4
#define kLouderItem 5
#define kVolNumberItem 7
#define kIdleMusicItem 8
#define kPlayMusicItem 9
#define kSoundDefault 13
// Controls dialog
#define kRightControl 5
#define kLeftControl 6
#define kBattControl 7
@@ -54,6 +61,8 @@
#define kControlDefaults 13
#define kESCPausesRadio 14
#define kTABPausesRadio 15
// Brains dialog
#define kMaxFilesItem 5
#define kQuickTransitCheck 7
#define kDoZoomsCheck 8
@@ -97,11 +106,11 @@ Str15 tempLeftStr, tempRightStr, tempBattStr, tempBandStr;
long tempLeftMap, tempRightMap, tempBattMap, tempBandMap;
short whichCtrl, wasDepthPref;
Boolean wasFade, wasIdle, wasPlay, wasTransit, wasZooms, wasBackground;
Boolean wasEscPauseKey, wasDemos, wasAutoScale, nextRestartChange, wasErrorCheck, needResolutionReset;
Boolean wasEscPauseKey, wasDemos, wasAutoScale, wasUseICCProfile, nextRestartChange, wasErrorCheck, needResolutionReset;
Boolean wasPrettyMap, wasBitchDialogs;
extern short numNeighbors, isDepthPref, maxFiles, willMaxFiles;
extern Boolean isDoColorFade, isPlayMusicIdle, isAutoScale;
extern Boolean isDoColorFade, isPlayMusicIdle, isAutoScale, isUseICCProfile;
extern Boolean isHouseChecks, doBitchDialogs;
extern Boolean isEscPauseKey, failedMusic, isSoundOn, doBackground;
extern Boolean isMusicOn, quickerTransitions, doAutoDemo;
@@ -861,6 +870,7 @@ void DisplayDefaults (void)
wasDepthPref = kSwitchIfNeeded;
wasFade = true;
wasAutoScale = true;
wasUseICCProfile = true;
}
//-------------------------------------------------------------- FrameDisplayIcon
@@ -906,6 +916,7 @@ void DisplayUpdate (Dialog *theDialog)
SetDialogItemValue(theDialog, kDoColorFadeItem, (short)wasFade);
SetDialogItemValue(theDialog, k32BitColorItem, wasDepthPref == 32);
SetDialogItemValue(theDialog, kScaleResolutionItem, (short)isAutoScale);
SetDialogItemValue(theDialog, kUseICCProfileItem, (short)isUseICCProfile);
FrameDisplayIcon(theDialog, StdColors::Red());
FrameDialogItemC(theDialog, kBorder1Item, kRedOrangeColor8);
@@ -1005,6 +1016,7 @@ void DoDisplayPrefs (void)
wasFade = isDoColorFade;
wasDepthPref = isDepthPref;
wasAutoScale = isAutoScale;
wasUseICCProfile = isUseICCProfile;
leaving = false;
DisplayUpdate(prefDlg);
@@ -1022,6 +1034,7 @@ void DoDisplayPrefs (void)
needResolutionReset = true;
isDepthPref = wasDepthPref;
isAutoScale = wasAutoScale;
isUseICCProfile = wasUseICCProfile;
leaving = true;
break;
@@ -1072,6 +1085,11 @@ void DoDisplayPrefs (void)
SetDialogItemValue(prefDlg, kScaleResolutionItem, (short)wasAutoScale);
break;
case kUseICCProfileItem:
wasUseICCProfile = !wasUseICCProfile;
SetDialogItemValue(prefDlg, kUseICCProfileItem, (short)wasUseICCProfile);
break;
case kDispDefault:
FrameDisplayIcon(prefDlg, StdColors::White());
DisplayDefaults();
@@ -1321,6 +1339,8 @@ void DoSettingsMain (void)
PortabilityLayer::HostDisplayDriver::GetInstance()->RequestResetVirtualResolution();
needResolutionReset = false;
}
PortabilityLayer::HostDisplayDriver::GetInstance()->SetUseICCProfile(isUseICCProfile);
}
//-------------------------------------------------------------- BitchAboutChanges