.:: Bots United ::.

.:: Bots United ::. (http://forums.bots-united.com/index.php)
-   Half-Life 1 SDK (http://forums.bots-united.com/forumdisplay.php?f=33)
-   -   topcolor to rgb (http://forums.bots-united.com/showthread.php?t=1406)

Lazy 18-04-2004 09:43

topcolor to rgb
 
I have looked everywhere and I cannot find any examples for getting the rgb values of the player's topcolor.

Is there a way to get the rgb values from a color index?
Also, A way to convert the floating-point ( 0.0 - 1.0 ) rgb color format to the ( 0 - 255 ) integer rgb color format?

sPlOrYgOn 18-04-2004 10:32

Re: topcolor to rgb
 
Code:

iColor = (int)(fColor * 255);

Lazy 18-04-2004 23:18

Re: topcolor to rgb
 
Thanks, that worked good although the yellow turns to red.
I'll figure it out later on.

botman 19-04-2004 14:52

Re: topcolor to rgb
 
I believe the colors used for topcolor and bottomcolor come from the color palette in the palette.bmp file.

The palette.bmp file can be found in the valve\pak0.pak file in the gfx folder. The image isn't important (it's just a little face drawn in blue on a greenish grey background). It's the palette from that .bmp file that's used for color values from 0 to 255. For example, palette index 251 is bright red (R=255, B=0, G=0) and is used for blood in the engine.

botman

sfx1999 20-04-2004 22:10

Re: topcolor to rgb
 
That's odd, I looked at mine and there was a smiley face in it.

Are you sure it is not the palette.lmp file? I remember that format from Quake, I think.

Pierre-Marie Baty 21-04-2004 00:12

Re: topcolor to rgb
 
I extracted all my .PAK files and deleted them. My HL game runs without any .PAK file now. And I've deleted this smiley face long ago - the game still works just fine.

Lazy 21-04-2004 00:28

Re: topcolor to rgb
 
Actually, I think the only way to do it is making an array of vec3_t structures and assign them the proper rgb values for that index.

But, since theres no _easy_ way to do the other part of my experiment I stopped.
Then I added support for my TV tuner, but that stopped after I couldn't find a feasible way to display the grabbed images on the screen.
It's too bad since I got it to initialize and everything, *sigh*.

*Goes looking for more crazy ideas*

botman 21-04-2004 01:17

Re: topcolor to rgb
 
Perhaps it is using palette.lmp and palette.bmp is just a carry-over from the old Quake I source code.

botman


All times are GMT +2. The time now is 07:21.

Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.