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:
parent
1b4d47b690
commit
d1b2e10489
|
@ -82,12 +82,12 @@ const unsigned char coltab640[] = {
|
||||||
/* 11111 */ 0xAA,0xAA,0xAA,0xAA,0xFF,0xFF,0xFF,0xFF
|
/* 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)
|
BOOLEAN MakeBigColorTables (unsigned int iters)
|
||||||
{
|
{
|
||||||
static unsigned int i = 0;
|
static unsigned int i = 0;
|
||||||
unsigned int iMax = i + iters;
|
unsigned int iMax = i + iters;
|
||||||
if (iMax < i) /* Deal with wraparound */
|
if (iMax <= i) /* Deal with wraparound */
|
||||||
iMax = 0;
|
iMax = 0;
|
||||||
|
|
||||||
/* The addressing scheme here depends on the IIgs's little-endianness */
|
/* The addressing scheme here depends on the IIgs's little-endianness */
|
||||||
|
|
|
@ -84,7 +84,7 @@ void DoConnect (void) {
|
||||||
|
|
||||||
if (colorTablesComplete == FALSE) {
|
if (colorTablesComplete == FALSE) {
|
||||||
DisplayConnectStatus("\pGenerating color tables...", FALSE);
|
DisplayConnectStatus("\pGenerating color tables...", FALSE);
|
||||||
MakeBigColorTables(65536);
|
MakeBigColorTables(0);
|
||||||
colorTablesComplete = TRUE;
|
colorTablesComplete = TRUE;
|
||||||
CloseConnectStatusWindow();
|
CloseConnectStatusWindow();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue