home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 7297 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: canopus.cc.umanitoba.ca!umpaul18
  2. From: umpaul18@cc.umanitoba.ca (Kenneth Paulson)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: unsigned long addition question(GDS)
  5. Date: 14 Apr 1996 03:26:12 GMT
  6. Organization: University of Manitoba, Winnipeg, Manitoba, Canada
  7. Message-ID: <4kpr8k$pfi@canopus.cc.umanitoba.ca>
  8. References: <1052.6674T364T2106@infi.net>
  9. NNTP-Posting-Host: mira.cc.umanitoba.ca
  10.  
  11. In article <1052.6674T364T2106@infi.net>, DHopkins <dhopkins@infi.net> wrote:
  12. >I'm using Gamesmith with SAS/C and have run into a complete
  13. >blank in my math knowledge. GDS uses an 8-bit color table
  14. >eg. 0x00rrggbb. Usually, I just ignore this type of stuff
  15. >but now it's hit me square in the face.
  16. >
  17. >I want to do a screen fade and figured that I'd use the
  18. >gs_SetRGB function to fade each color. the Commodore
  19. >version of SetRGB32 lets you enter a value for r, g, and b.
  20. >But gs_SetRGB only has 1 variable for the color, and it
  21. >has r,g,b embedded in it.(like I said, 0x00rrggbb). How
  22. >can I subtract from just r,g or b?
  23.  
  24. Probably the easiest way to do this would be to keep the red, green, and 
  25. blue components separate for whatever processing you want to do to them, and
  26. then slap the together, something like:
  27. rgb=(red<<16)|(green<<8)|blue
  28.  
  29. (I *think* those values are right, I'm tired though...)
  30.  
  31. Then you're left with a single GDS-friendly value.
  32.  
  33. Stay Casual,
  34.  
  35. Ken
  36.  
  37.