Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Arguments with the PUT command
#1
ok i was looking threw the index in QB help and there was the arguments that you could add to the end of the put and i didnt quite understand them could you explain them better for me?
his world has been connected...
Tied to the darkness.
Soon to be completely eclipsed.
There is so very much to learn...
You understand so little.
A meaningless effort.
One who knows nothing can understand nothing.
-Ansem Bringer of darkness and creator of the heartless
Reply
#2
until you understand the way numbers are stored in binary, you cant understand what they really do. except pset, which puts the sprite over any background.

the other modes use bitwise operations (and, xor, etc..) on the bits of the picture with the bits of the background.

edit: ill add a small explanation

say a pixel in your sprite is color 35. that in binary (one byte) is

0 0 1 0 0 0 1 1


and say the backgroun is color 23

0 0 0 1 0 1 1 1


if you put it down as OR, its gonna OR those, bit by bit, lkie this


0 0 1 0 0 0 1 1 (35)
OR
0 0 0 1 0 1 1 1 (23)
-------------------
0 0 1 1 0 1 1 1 (55), so the color displayed will be 55

using AND


0 0 1 0 0 0 1 1 (35)
AND
0 0 0 1 0 1 1 1 (23)
-------------------
0 0 0 0 0 0 1 1 (3), so the color displayed will be 3
Reply
#3
ok so how does that help you use PUT if it changes your colors??
Reply
#4
read a tute on 'masking'

its actually bit masking
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)