From bb65891a4a14d7a766066c398214af4e8a9ba791 Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sat, 21 May 2016 12:35:51 -0500 Subject: [PATCH] Use shadowing and fast port optimizations for QuickDraw. This should cause a bit of a speedup, although it wasn't really noticeable in my tests. --- vncdisplay.cc | 4 +--- vncview.cc | 10 +++------- vncview.rez | 2 +- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/vncdisplay.cc b/vncdisplay.cc index ee99fe3..ae8103b 100644 --- a/vncdisplay.cc +++ b/vncdisplay.cc @@ -121,7 +121,7 @@ static void ChangeResolution(int rez) { if (dpSpace == NULL) dpSpace = NewHandle(0x0300, userid(), attrLocked|attrFixed|attrNoCross|attrBank, 0x00000000); - QDStartUp((Word) *dpSpace, (rez == 640) ? 0x87 : 0x00, 0, userid()); + QDStartUp((Word) *dpSpace, (rez == 640) ? 0xC087 : 0xC000, 0, userid()); /* SCB 0x87 gives 640 mode with our custom gray palette */ GrafOff(); QDAuxStartUp(); @@ -359,5 +359,3 @@ void ConnectedEventLoop (void) { } } } - - diff --git a/vncview.cc b/vncview.cc index 9d89080..7325f55 100644 --- a/vncview.cc +++ b/vncview.cc @@ -122,9 +122,6 @@ static void DoAbout (void) { ***************************************************************/ static void DoNewConnection (void) { - unsigned int masterSCB; - - masterSCB = GetMasterSCB(); MakeThisCtlTarget(GetCtlHandleFromID(newConnWindow, linServer)); ShowWindow(newConnWindow); SelectWindow(newConnWindow); @@ -345,10 +342,9 @@ static void InitScreen (void) { 0x0000, 0x0555, 0x0AAA, 0x0FFF, 0x0000, 0x0555, 0x0AAA, 0x0FFF }; - /* Apple menu uses color tables 1 through 6 */ - SetColorTable(7, &gray640Colors); - SetAllSCBs(0x87); /* 640 mode with gray640Colors */ - InitPalette(); /* Restore Apple Menu colors */ + /* Apple menu uses color tables 1 through 6. + * We set SCBs for color table 7 in StartUpTools or QDStartUp. */ + SetColorTable(7, &gray640Colors); } static void Quit (void) { diff --git a/vncview.rez b/vncview.rez index 19c727a..27a32a2 100644 --- a/vncview.rez +++ b/vncview.rez @@ -73,7 +73,7 @@ /*- Tools ------------------------------------------------------*/ resource rToolStartup(1) { - mode640, + $C087, /* mode640 + fFastPortAware + fUseShadowing + color table 7 */ { 3, $0302, /* Misc Tool */ 4, $0307, /* QuickDraw II */