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.
This commit is contained in:
Stephen Heumann 2016-05-21 00:23:48 -05:00
parent 1b4d47b690
commit d1b2e10489
2 changed files with 3 additions and 3 deletions

View File

@ -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 */

View File

@ -84,7 +84,7 @@ void DoConnect (void) {
if (colorTablesComplete == FALSE) {
DisplayConnectStatus("\pGenerating color tables...", FALSE);
MakeBigColorTables(65536);
MakeBigColorTables(0);
colorTablesComplete = TRUE;
CloseConnectStatusWindow();
}