Posts: 3,368
Threads: 195
Joined: Jan 2003
Whether they are blank or not doesn't matter. They are still there. So it's X times Y. If you're starting from 0 (and you are), then it's X times Y minus one.
And, you shouldn't use PSET....
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 324
Threads: 12
Joined: Nov 2005
Look at:
HELP: GET (Graphics) Statement Details
stylin:
Posts: 488
Threads: 19
Joined: Sep 2005
well then would it be
DIM char% (256) or (128), im not really sur
Posts: 3,368
Threads: 195
Joined: Jan 2003
X*Y.....
You're using GET and PUT statements..... in screen 13. Each % variable in QB uses 16 bits... each one in the array gives the palette color numeric value...
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.
Posts: 488
Threads: 19
Joined: Sep 2005
meaning...
yes, i am usnig GET & PUT statements, in SCREEN 13, but that still doesn't tell me wat number to use for a 16x16 sprite, i can draw it fine, its just saving it into the memory using DIM, GET, and PUT
Posts: 1,774
Threads: 62
Joined: Aug 2003
You can use...
Code:
NumSprites * ((Width*Height)/2 +1)
I believe that was it anyway. It's been a while since I used QB.
Posts: 488
Threads: 19
Joined: Sep 2005
so if its 16x16, then (16*16)/2 + 1 = 129
therefore DIM char% (129)???
Posts: 1,845
Threads: 44
Joined: Aug 2002
The amount of bytes needed for a 16x16 8-bit image with 1 plane is:
width * height * Bpp * numplanes
16 * 16 * 1 * 1 = 256
There is a 4-byte PUT memoryheader, so the total amount of bytes needed is:
256+4=260
Since each integer is made up of 2 bytes, you need a total of
260/2 = 130 integers
Since in an array the subscript 0 counts too, you should define it indeed as
Code:
Dim Something(129) As Integer
Posts: 488
Threads: 19
Joined: Sep 2005
well i got it my way and its faster, not like ill have more then 1 plane or anything, thnx anyway
Posts: 3,368
Threads: 195
Joined: Jan 2003
bah I didn't know what I woz talking about. :-|
Peace cannot be obtained without war. Why? If there is already peace, it is unnecessary for war. If there is no peace, there is already war."
Visit www.neobasic.net to see rubbish in all its finest.