From d1b2e104893e14075dc960de88feca51fd9daabc Mon Sep 17 00:00:00 2001 From: Stephen Heumann Date: Sat, 21 May 2016 00:23:48 -0500 Subject: [PATCH] Don't duplicatively regenerate color table entries. The logic for making sure the color table was complete before connecting was slightly broken due to wraparound, so it would cause all entries to be generated, re-generating any that already had been. This fixes it, which should make the initial connection process slightly faster on slow systems. --- colortables.cc | 4 ++-- vncsession.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/colortables.cc b/colortables.cc index 27ed613..c2e8783 100644 --- a/colortables.cc +++ b/colortables.cc @@ -82,12 +82,12 @@ const unsigned char coltab640[] = { /* 11111 */ 0xAA,0xAA,0xAA,0xAA,0xFF,0xFF,0xFF,0xFF }; -/* iters = number of iterations to do (must be > 0) */ +/* iters = number of iterations to do (0 means run to completion) */ BOOLEAN MakeBigColorTables (unsigned int iters) { static unsigned int i = 0; unsigned int iMax = i + iters; - if (iMax < i) /* Deal with wraparound */ + if (iMax <= i) /* Deal with wraparound */ iMax = 0; /* The addressing scheme here depends on the IIgs's little-endianness */ diff --git a/vncsession.cc b/vncsession.cc index 1ec94d6..17cf969 100644 --- a/vncsession.cc +++ b/vncsession.cc @@ -84,7 +84,7 @@ void DoConnect (void) { if (colorTablesComplete == FALSE) { DisplayConnectStatus("\pGenerating color tables...", FALSE); - MakeBigColorTables(65536); + MakeBigColorTables(0); colorTablesComplete = TRUE; CloseConnectStatusWindow(); }