mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 03:59:36 +00:00
Add color fade
This commit is contained in:
@@ -156,10 +156,9 @@ void RedrawSplashScreen (void); // --- MainWindow.c
|
||||
void UpdateMainWindow (void);
|
||||
void OpenMainWindow (void);
|
||||
void CloseMainWindow (void);
|
||||
void ZoomBetweenWindows (void);
|
||||
void UpdateEditWindowTitle (void);
|
||||
void HandleMainClick (Point, Boolean);
|
||||
//void WashColorIn (void);
|
||||
void WashColorIn (void);
|
||||
|
||||
void CenterMapOnRoom (SInt16, SInt16); // --- Map.c
|
||||
Boolean ThisRoomVisibleOnMap (void);
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#include "Environ.h"
|
||||
#include "IOStream.h"
|
||||
#include "House.h"
|
||||
#include "WindowManager.h"
|
||||
|
||||
|
||||
#define kPrefsVersion 0x0035
|
||||
@@ -352,6 +353,10 @@ int gpAppMain()
|
||||
InitSrcRects();
|
||||
CreateOffscreens(); SpinCursor(2);
|
||||
OpenMainWindow();
|
||||
|
||||
if (isDoColorFade)
|
||||
PortabilityLayer::WindowManager::GetInstance()->SetWindowDesaturation(mainWindow, 1.0);
|
||||
|
||||
InitSound(); SpinCursor(2);
|
||||
InitMusic(); SpinCursor(2);
|
||||
BuildHouseList();
|
||||
@@ -366,17 +371,8 @@ int gpAppMain()
|
||||
// HideMenuBarOld();
|
||||
#endif
|
||||
|
||||
// if ((isDoColorFade) && (thisMac.isDepth == 8))
|
||||
// {
|
||||
// wasSeed = ExtractCTSeed((CGrafPtr)mainWindow);
|
||||
// WashColorIn();
|
||||
// ForceCTSeed((CGrafPtr)mainWindow, wasSeed);
|
||||
// }
|
||||
// if ((!thisMac.hasSM3) && (numSMWarnings < 3))
|
||||
// {
|
||||
// numSMWarnings++;
|
||||
// BitchAboutSM3();
|
||||
// }
|
||||
if (isDoColorFade)
|
||||
WashColorIn();
|
||||
|
||||
UpdateMainWindow();
|
||||
|
||||
|
||||
@@ -579,54 +579,20 @@ void HardDrawMainWindow (void)
|
||||
//-------------------------------------------------------------- WashColorIn
|
||||
// Slowly walks the palette from its gray luminance state to the full color<6F>
|
||||
// palette. In this way, color appears to slowly wash in.
|
||||
/*
|
||||
void WashColorIn (void)
|
||||
{
|
||||
#define kGray2ColorSteps 180
|
||||
GDHandle theDevice;
|
||||
long longDelta;
|
||||
short i, c;
|
||||
|
||||
theDevice = GetGDevice();
|
||||
SetGDevice(thisGDevice);
|
||||
|
||||
|
||||
for (i = 0; i < kGray2ColorSteps; i++)
|
||||
{
|
||||
for (c = 0; c < 256; c++)
|
||||
{
|
||||
if (c != 5)
|
||||
{
|
||||
longDelta = (((long)wasColors[c].rgb.red -
|
||||
(long)newColors[c].rgb.red) /
|
||||
(long)(kGray2ColorSteps - i)) + (long)newColors[c].rgb.red;
|
||||
newColors[c].rgb.red = (unsigned short)longDelta;
|
||||
|
||||
longDelta = (((long)wasColors[c].rgb.green -
|
||||
(long)newColors[c].rgb.green) /
|
||||
(long)(kGray2ColorSteps - i)) +
|
||||
(long)newColors[c].rgb.green;
|
||||
newColors[c].rgb.green = (unsigned short)longDelta;
|
||||
|
||||
longDelta = (((long)wasColors[c].rgb.blue -
|
||||
(long)newColors[c].rgb.blue) /
|
||||
(long)(kGray2ColorSteps - i)) +
|
||||
(long)newColors[c].rgb.blue;
|
||||
newColors[c].rgb.blue = (unsigned short)longDelta;
|
||||
}
|
||||
}
|
||||
SetEntries(0, 255, newColors);
|
||||
if (Button())
|
||||
PortabilityLayer::WindowManager::GetInstance()->SetWindowDesaturation(mainWindow, static_cast<float>(kGray2ColorSteps - i) / static_cast<float>(kGray2ColorSteps));
|
||||
|
||||
Delay(1, nullptr);
|
||||
if (PortabilityLayer::InputManager::GetInstance()->GetKeys()->m_mouse.Get(GpMouseButtons::kLeft))
|
||||
break;
|
||||
}
|
||||
|
||||
SetEntries(0, 255, wasColors);
|
||||
SetGDevice(theDevice);
|
||||
|
||||
RestoreColorsSlam();
|
||||
|
||||
if (wasColors != nil)
|
||||
DisposePtr((Ptr)wasColors);
|
||||
if (newColors != nil)
|
||||
DisposePtr((Ptr)newColors);
|
||||
|
||||
PortabilityLayer::WindowManager::GetInstance()->SetWindowDesaturation(mainWindow, 0.0f);
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user