Quote:
First question --- where does "map" come from in your print function??
Sorry heres my class definition:
Code:
class BitText
{
private:
char* data;
char* map;
Uint32 col;
public:
BitText(const char*, const char*);
void Print(Uint16, Uint16, const char*);
};
map holds all the characters displayable in order. EG: 0123456789ABCDEF....etc.
data holds the mask data. EG: "mprtxpm" is the data to display the number 0.
Quote:
In BitText::BitText() . . .
Code:
map = new char[len];
len+1 perhaps?
Yeah forgot about that.
Quote:
I like
Code:
col = (unsigned long)-1;
Now youre just showing off :p
Quote:
Calculating strlen() is expensive, consider moving the calculation outside of the for loop and storing it in a variable.
Oh. I dident think it recalculated it each loop. Best move it out I guess.
Quote:
It seems to me that this is simpler:
Code:
for(pos = 0; map[pos]; pos ++)
if(map[pos] == text[i]) break;
ptr = data + pos * 7;
But wheres 'i' gone then?
Cheers.