mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 14:53:52 +00:00
Add full-screen option
This commit is contained in:
@@ -10,6 +10,8 @@
|
||||
#include "PLKeyEncoding.h"
|
||||
#include "Externs.h"
|
||||
#include "Environ.h"
|
||||
#include "HostDisplayDriver.h"
|
||||
#include "IGpDisplayDriver.h"
|
||||
#include "IOStream.h"
|
||||
#include "House.h"
|
||||
#include "WindowManager.h"
|
||||
@@ -215,6 +217,10 @@ void ReadInPrefs (void)
|
||||
doPrettyMap = false;
|
||||
doBitchDialogs = true;
|
||||
|
||||
IGpDisplayDriver *displayDriver = PortabilityLayer::HostDisplayDriver::GetInstance();
|
||||
if (!displayDriver->IsFullScreen())
|
||||
displayDriver->RequestToggleFullScreen(0);
|
||||
|
||||
modulePrefs.Dispose();
|
||||
}
|
||||
|
||||
|
@@ -41,9 +41,10 @@
|
||||
#define kScaleResolutionItem 10
|
||||
#define kUseICCProfileItem 11
|
||||
#define kDoColorFadeItem 12
|
||||
#define kBorder2Item 13
|
||||
#define kBorder3Item 14
|
||||
#define kDispDefault 15
|
||||
#define kFullScreenItem 13
|
||||
#define kBorder2Item 14
|
||||
#define kBorder3Item 15
|
||||
#define kDispDefault 16
|
||||
|
||||
// Sound dialog
|
||||
#define kSofterItem 4
|
||||
@@ -106,7 +107,7 @@ Str15 tempLeftStr, tempRightStr, tempBattStr, tempBandStr;
|
||||
long tempLeftMap, tempRightMap, tempBattMap, tempBandMap;
|
||||
short whichCtrl, wasDepthPref;
|
||||
Boolean wasFade, wasIdle, wasPlay, wasTransit, wasZooms, wasBackground;
|
||||
Boolean wasEscPauseKey, wasDemos, wasAutoScale, wasUseICCProfile, nextRestartChange, wasErrorCheck, needResolutionReset;
|
||||
Boolean wasEscPauseKey, wasDemos, wasAutoScale, wasUseICCProfile, nextRestartChange, wasErrorCheck, wasFullscreenPref, needResolutionReset;
|
||||
Boolean wasPrettyMap, wasBitchDialogs;
|
||||
|
||||
extern short numNeighbors, isDepthPref, maxFiles, willMaxFiles;
|
||||
@@ -917,6 +918,9 @@ void DisplayUpdate (Dialog *theDialog)
|
||||
SetDialogItemValue(theDialog, k32BitColorItem, wasDepthPref == 32);
|
||||
SetDialogItemValue(theDialog, kScaleResolutionItem, (short)isAutoScale);
|
||||
SetDialogItemValue(theDialog, kUseICCProfileItem, (short)isUseICCProfile);
|
||||
|
||||
wasFullscreenPref = PortabilityLayer::HostDisplayDriver::GetInstance()->IsFullScreen();
|
||||
SetDialogItemValue(theDialog, kFullScreenItem, wasFullscreenPref);
|
||||
|
||||
FrameDisplayIcon(theDialog, StdColors::Red());
|
||||
FrameDialogItemC(theDialog, kBorder1Item, kRedOrangeColor8);
|
||||
@@ -1089,6 +1093,11 @@ void DoDisplayPrefs (void)
|
||||
wasUseICCProfile = !wasUseICCProfile;
|
||||
SetDialogItemValue(prefDlg, kUseICCProfileItem, (short)wasUseICCProfile);
|
||||
break;
|
||||
|
||||
case kFullScreenItem:
|
||||
wasFullscreenPref = !wasFullscreenPref;
|
||||
SetDialogItemValue(prefDlg, kFullScreenItem, (short)wasFullscreenPref);
|
||||
break;
|
||||
|
||||
case kDispDefault:
|
||||
FrameDisplayIcon(prefDlg, StdColors::White());
|
||||
@@ -1334,6 +1343,14 @@ void DoSettingsMain (void)
|
||||
nextRestartChange = false;
|
||||
}
|
||||
|
||||
IGpDisplayDriver *displayDriver = PortabilityLayer::HostDisplayDriver::GetInstance();
|
||||
|
||||
if (displayDriver->IsFullScreen() != (wasFullscreenPref != 0))
|
||||
{
|
||||
displayDriver->RequestToggleFullScreen(0);
|
||||
needResolutionReset = false;
|
||||
}
|
||||
|
||||
if (needResolutionReset)
|
||||
{
|
||||
PortabilityLayer::HostDisplayDriver::GetInstance()->RequestResetVirtualResolution();
|
||||
|
Reference in New Issue
Block a user