Path: chuka.playstation.co.uk!news From: "Alex Herbert" Newsgroups: scee.yaroze.programming.2d_graphics,scee.yaroze.beginners Subject: Re: Setting Multiple Bits in GsSPRITE Date: Sun, 28 Feb 1999 19:56:33 -0000 Organization: PlayStation Net Yaroze (SCEE) Lines: 38 Message-ID: <7bc7e3$abn5@chuka.playstation.co.uk> References: <7bb6h9$9po30@chuka.playstation.co.uk> NNTP-Posting-Host: th-usr00-56.ndirect.co.uk X-Newsreader: Microsoft Outlook Express 4.72.3110.1 X-MimeOLE: Produced By Microsoft MimeOLE V4.72.3110.3 Xref: chuka.playstation.co.uk scee.yaroze.programming.2d_graphics:912 scee.yaroze.beginners:731 Rikki Prince wrote in message <7bb6h9$9po30@chuka.playstation.co.uk>... >To set the Semi-transparency rate in a GsSPRITE structure, can I use >attribute |= (3<<28); to set 1.0xBack+0.25xForward, and therefore >attribute |= (2<<28); for 1.0xBack-1.0xForward? Yep, that's fine. >Or do I have to use >attribute |= (1<<28); >attribute |= (1<<29); for 1.0xBack+0.25xForward I'd avoid doing it in multiple statements. If you do need to set multiple bits, it would be neater to compund the statements like: attribute |=(1<<28) | (1<<29); as you can be sure that the compiler will evaluate the complete expression at compile time. Personally, I'd do it like: attribute |= 0x50000000; but then I love hex. At the end of the day, it doesn't matter much. Use whichever way makes most sense to you - at the end of the day it will compile into similar code, if not idenical. >and >attribute |= (1<<29); for 1.0xBack-1.0xForward? > >Thanks in advance to anyone who can help >Rikki > > Herbs