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-861f7616d084
master
Per Inge Mathisen 2007-08-02 22:34:33 +00:00
parent bc3f5a9073
commit 73e6fec796
1 changed files with 3 additions and 3 deletions

View File

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