Actually load the radar colours. Based on patch by Watermelon. Also check
that we have sufficient data in buffer to read next colour first. git-svn-id: svn+ssh://svn.gna.org/svn/warzone/trunk@2324 4a71c877-e1ca-e34f-864e-861f7616d084master
parent
bc3f5a9073
commit
73e6fec796
|
@ -118,16 +118,16 @@ void texLoad(const char *fileName)
|
|||
j = 0; // place in buffer
|
||||
do {
|
||||
uint8_t r, g, b;
|
||||
int cnt;
|
||||
int cnt = 0;
|
||||
|
||||
k = sscanf(buffer, "%2hhx%2hhx%2hhx%n", &r, &g, &b, &cnt);
|
||||
k = sscanf(buffer + j, "%2hhx%2hhx%2hhx%n", &r, &g, &b, &cnt);
|
||||
j += cnt;
|
||||
if (k >= 3)
|
||||
{
|
||||
radarColour(i, r, g, b);
|
||||
}
|
||||
i++; // next tile
|
||||
} while (k >= 3 && j < size);
|
||||
} while (k >= 3 && j + 6 < size);
|
||||
free(buffer);
|
||||
|
||||
/* Now load the actual tiles */
|
||||
|
|
Loading…
Reference in New Issue