Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Code Snippets / BitShifting

Author
Message
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 21st Oct 2002 01:29
oki i posted this in the forum earlier however might actually seen by those who will know what to do with it here



basically for finding out the values of Bits based on position - best used with memblocks
Anata aru kowagaru no watashi! http://members.lycos.co.uk/TimeSaga/smile/wack.gif[/img]
DSG
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location: Hampshire, England
Posted: 23rd Oct 2002 01:43
There is no need to write you own bit shift functions - DBP uses the '<<' and '>>' operators for left and right bit shifts respectively:



Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 23rd Oct 2002 03:49
But DB doesn't have it

Anata aru kowagaru no watashi!
The Wendigo
21
Years of Service
User Offline
Joined: 13th Sep 2002
Location: A hole near the base of a tree in the US
Posted: 27th Oct 2002 00:34
That's great if you need bit shifting, but I was taught that the point of bitshifting is for speed. Your code is still just as slow though. I guess it would be nice for DB.

1.00 GHZ processor, 256 MB RAM, GeForce 3 64MB, SB Live!, 8 cans of soda per day
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 27th Oct 2002 00:51
actually increases the speed of the operations it performs, especially on larger numbers suchas 32/64bit
also allows for much easier reading of values without complex calculations, but yeah a little too slow compaired to DBpro's but as DBpro is simply using C bitshifting, i can't compete speed wise in an interpreter language

tell ya what gimme about 20mins i'll see about making blending code - i'll also include GuyS's which is the fastest one to date in DB
see which one comes out ontop speed wise (^_^)

Anata aru kowagaru no watashi!
Shadow Robert
21
Years of Service
User Offline
Joined: 22nd Sep 2002
Location: Hertfordshire, England
Posted: 27th Oct 2002 04:59
oki a little more time... got wrapped up in Ciyanna again
just started, thought i'd add some standard windows functions as well - compile some arrays and such
then finally get onto the tech test.

As its about Blending decided to make it an alpha blend menu like one WebDext showed me a while ago from blitz.
DBpro would do it like lightning so don't judge it against DBpro

Anata aru kowagaru no watashi!

Login to post a reply

Server time is: 2024-04-24 17:52:09
Your offset time is: 2024-04-24 17:52:09