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.

The 20 Line Challenge / Bitwise Stripey Wallpaper [DBP/C]

Author
Message
Libervurto
12
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 20th Feb 2013 20:47 Edited at: 20th Feb 2013 20:49
I've been using this for a while as a backdrop for graphical programs, so I thought I'd share the code; it's very simple really.

Condensed to one line:


Decompressed still only 19 lines:

To run in DBC just change the && to &.

Phaelax
DBPro Master
15
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 21st Feb 2013 04:53
Neat, but there are faster ways of drawing it.

"You're all wrong. You're all idiots." ~Fluffy Rabbit
Libervurto
12
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 21st Feb 2013 13:27
In use I am copying it into a vertical strip then copying that across the screen, but that was over 20 lines. What is your idea?

Phaelax
DBPro Master
15
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 26th Feb 2013 11:08
Use box instead of dot. Lock the pixels while drawing. Or access the buffer directly: snippet

"You're all wrong. You're all idiots." ~Fluffy Rabbit
Libervurto
12
Years of Service
User Offline
Joined: 30th Jun 2006
Location: On Toast
Posted: 26th Feb 2013 17:30 Edited at: 26th Feb 2013 19:01
What! I had no idea you could do that! Thank you.

[edit]


Changing x and y to dwords removes half the bounds checking. I also tidied it up a bit and removed some assignments. Not sure how much "bitmap height()" and "bitmap width()" would slow it down but I don't like the idea of using globals is what is a very generic function.

[sidenote]
Any idea why when I post code on here the tabs are ridiculously huge?


Login to post a reply

Server time is: 2018-09-19 18:37:41
Your offset time is: 2018-09-19 18:37:41