Woah woah...
Read it again
It is not the same what are you talking about. Look at this:
(255) * (31/255) = ~31
(255) * (255/31) = ~2097
i was comparing
* (31/255) and / (255/31)
Not what you wrote there..and im not accusing you of stealing my idea i just think its pointless to write the same thing.
I already gave the conversion [ / (255 / 31)] and then you posted practically the same thing.
And yeah i agree with you and that speed thing.
Ok well to get the value of the number in the range 0 to 31 you would do
Code:
texnum = bmpnum / (255 / 31)
* (31 / 255) is the same thing as / (255 / 31) and why are you guys posting crap when he already said he got it to work..
Because he said he did not know how to convert back.
he already figured it out without using that..look here
I ended up with this code:
texfs.Read(kolor, sizeof(kolor));
r := (kolor and $7C00) shr 10;
g := (kolor and $3E0) shr 5;
b := (kolor and $1F);
r := Round(r * (255 / 31));
g := Round(g * (255 / 31));
b := Round(b * (255 / 31));
destfs.Write(r, sizeof(r));
destfs.Write(g, sizeof(g));
destfs.Write(b, sizeof(b));
And it seems to be working fine . Thank you guys. You can find program on my new site.
Link: MaV's Page
Ok? So you understand what im saying now..?