blitz -> delphi.

BlitzPlus Forums/BlitzPlus Programming/blitz -> delphi.

smitty(Posted 2003) [#1]
gday all, i'm writing a kids art type app simultaneously in both blitz2d and delphi6. I want to use the firepaint routine that came with blitz2d but am having problems translating blitz's types into delphi variables. Blitz' types seem to be a sort of dynamic array(linked list?) in which records can be created during runtime. I can create an array of records in delphi but without the 'for each-next' i cant see an easy way of keeping track of each record without knowing beforehand how many records needed and the having to loop through the whole lot.. The delphi manual seems to suggest that pointers to records could be used to create a dynamic array but i cant seem to get my head around the idea. If anybody can give me any clues as to how to go about it i would be grateful.
thanks.
ps. if you use delphi then check out the gr32 gfx library.Unlike blitz2d it has alpha channel support.In my app i use the alpha channel to create masks for soft brushes just like photoshop. www.g32.org


ashmantle(Posted 2003) [#2]
Hi,

I haven't used Delphi in a long time, but I seem to recall that linked list could be constructed using records.. (without any arrays)

There's plenty of tutorials on linked lists on the net.. thats how I learned anyways ;)

here's a tutorial for C++, but its explained with pictures and stuff, so its easy to pick up ;)
http://www.gamedev.net/reference/articles/article1072.asp


smitty(Posted 2003) [#3]
thanks for that. makes things a bit clearer..


SJB(Posted 2003) [#4]
Make your types Classes in Delphi and use TList or TObjectList to store them. See Delphi help for more info.