.:: Bots United ::.  
filebase forums discord server github wiki web
cubebot epodbot fritzbot gravebot grogbot hpbbot ivpbot jkbotti joebot
meanmod podbotmm racc rcbot realbot sandbot shrikebot soulfathermaps yapb

Go Back   .:: Bots United ::. > Developer's Farm > SDK Programming discussions > Half-Life 1 SDK
Half-Life 1 SDK For developments focused around Half-Life (and its mods) Half-Life

Reply
 
Thread Tools
topcolor to rgb
Old
  (#1)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default topcolor to rgb - 18-04-2004

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?
  
Reply With Quote
Re: topcolor to rgb
Old
  (#2)
sPlOrYgOn
<-- He did it.
 
sPlOrYgOn's Avatar
 
Status: Offline
Posts: 1,558
Join Date: Jan 2004
Location: Los Angeles, California, USA, North America, Earth, Solar System, Milky Way.
Default Re: topcolor to rgb - 18-04-2004

Code:
iColor = (int)(fColor * 255);
  
Reply With Quote
Re: topcolor to rgb
Old
  (#3)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: topcolor to rgb - 19-04-2004

Thanks, that worked good although the yellow turns to red.
I'll figure it out later on.
  
Reply With Quote
Re: topcolor to rgb
Old
  (#4)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: topcolor to rgb - 19-04-2004

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
  
Reply With Quote
Re: topcolor to rgb
Old
  (#5)
sfx1999
Member
 
sfx1999's Avatar
 
Status: Offline
Posts: 534
Join Date: Jan 2004
Location: Pittsburgh, PA, USA
Default Re: topcolor to rgb - 20-04-2004

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.
  
Reply With Quote
Re: topcolor to rgb
Old
  (#6)
Pierre-Marie Baty
Roi de France
 
Pierre-Marie Baty's Avatar
 
Status: Offline
Posts: 5,049
Join Date: Nov 2003
Location: 46°43'60N 0°43'0W 0.187A
Default Re: topcolor to rgb - 21-04-2004

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.



RACC home - Bots-United: beer, babies & bots (especially the latter)
"Learn to think by yourself, else others will do it for you."
  
Reply With Quote
Re: topcolor to rgb
Old
  (#7)
Lazy
Member
 
Lazy's Avatar
 
Status: Offline
Posts: 236
Join Date: Jan 2004
Location: Toronto, Ontario, Canada
Default Re: topcolor to rgb - 21-04-2004

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*
  
Reply With Quote
Re: topcolor to rgb
Old
  (#8)
botman
Super Moderator
 
Status: Offline
Posts: 280
Join Date: Jan 2004
Location: Plano, TX
Default Re: topcolor to rgb - 21-04-2004

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

botman
  
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
vBulletin Skin developed by: vBStyles.com