mirror of
https://github.com/ZDoom/raze-gles.git
synced 2025-02-03 20:30:58 +00:00
paletteGetClosestColor: I think these < should be <=
git-svn-id: https://svn.eduke32.com/eduke32@8489 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
0a7f5f558a
commit
221e7a6b85
1 changed files with 2 additions and 2 deletions
|
@ -113,7 +113,7 @@ int32_t paletteGetClosestColorUpToIndex(int32_t const r, int32_t const g, int32_
|
||||||
for (; i < k; i++)
|
for (; i < k; i++)
|
||||||
if (col == (colmatchresults[i] & 0x00ffffff)) { mindist = i; break; }
|
if (col == (colmatchresults[i] & 0x00ffffff)) { mindist = i; break; }
|
||||||
|
|
||||||
if (mindist != -1 && colmatchresults[mindist]>>24 < (unsigned)lastokcol)
|
if (mindist != -1 && colmatchresults[mindist]>>24 <= (unsigned)lastokcol)
|
||||||
return colmatchresults[mindist]>>24;
|
return colmatchresults[mindist]>>24;
|
||||||
|
|
||||||
skip:
|
skip:
|
||||||
|
@ -173,7 +173,7 @@ int32_t paletteGetClosestColorUpToIndexNoCache(int32_t r, int32_t g, int32_t b,
|
||||||
|
|
||||||
mindist = INT32_MAX;
|
mindist = INT32_MAX;
|
||||||
|
|
||||||
for (bssize_t i = 0; i < lastokcol; ++i)
|
for (bssize_t i = 0; i <= lastokcol; ++i)
|
||||||
{
|
{
|
||||||
char const * const pal1 = (char const *)&colmatch_palette[i*3];
|
char const * const pal1 = (char const *)&colmatch_palette[i*3];
|
||||||
int dist = gdist[pal1[1]+g];
|
int dist = gdist[pal1[1]+g];
|
||||||
|
|
Loading…
Reference in a new issue