Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Multiple images of different sizes in one array
#1
Is it possible to have multiple images in one 2 dimisional array, that have different sizes?
size=9]"To announce that there must be no criticism of the president, or that we are to stand by the president, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public." -- Theodore Roosevelt[/size]
Reply
#2
yes, but you'd need a second array to contain array positions. For instance:

put (x, y), imgarray (imgindex(2))

The other option is to allocate a space large enough so that it encompasses each image, and then just mathematically figure where each one is:

put (x, y), imgarray (2 * 2000)

EDIT: just read more closely. No. you can't. you can create variable length strings in an array, but you can't use it with get/put.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#3
So I couldn't do:

Code:
[XXXX Image 1 XXXX|XX Image 2 XX| XXXXXX Image 3 XXXXX]

Where everything between [ and ] is the array, and the |s separate the images?
size=9]"To announce that there must be no criticism of the president, or that we are to stand by the president, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public." -- Theodore Roosevelt[/size]
Reply
#4
yeah, but it would be slow as hell to refer to because you have to scan the entire array for the delimeter. and you couldnt use one of the 255 colors. the easier way to just make two arrays, one being an index, with the element that contains the start of each image.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#5
Quote:yeah, but it would be slow as hell to refer to because you have to scan the entire array for the delimeter. and you couldnt use one of the 255 colors. the easier way to just make two arrays, one being an index, with the element that contains the start of each image.
'k, thanks. I think the reason one of my progs is so slow is that I'm loading an image, PUTting it, and then erasing it to save mem.
size=9]"To announce that there must be no criticism of the president, or that we are to stand by the president, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public." -- Theodore Roosevelt[/size]
Reply
#6
especially for this game, where any graphics can pop up at any time. if you have graphics sets, it makes sense to load only the ones that will appear....
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.
Reply
#7
... and my guess is you're loading new graphics from the file each time. yeah, if you need extra mem, i'd go with ems/xms.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply
#8
Quote:... and my guess is you're loading new graphics from the file each time.
Exactly. I tried it out, and that's why things have been going so slow.
size=9]"To announce that there must be no criticism of the president, or that we are to stand by the president, right or wrong, is not only unpatriotic and servile, but is morally treasonable to the American public." -- Theodore Roosevelt[/size]
Reply
#9
next, but the data space each image resides in has to be the same as for all other images, and it has to be large enough to hold your largest image.
ravelling Curmudgeon
(geocities sites require copying and pasting URLs.)
I liked spam better when it was something that came in a can.
Windows should be defenestrated.
Reply
#10
yeah. load one set each level, and if it takes up your near memory then try ems/xms and a sprite routine that lets you refer to addresses and offsets instead of array name.
i]"I know what you're thinking. Did he fire six shots or only five? Well, to tell you the truth, in all this excitement, I've kinda lost track myself. But being as this is a .44 Magnum ... you've got to ask yourself one question: 'Do I feel lucky?' Well, do ya punk?"[/i] - Dirty Harry
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)