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.

DarkBASIC Professional Discussion / arrays and mesh memblocks

Author
Message
DrakeX
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location:
Posted: 9th Oct 2002 23:45
rather than posting 2 topics i'll just post 1:

Arrays

OK arrays. i'm sure that most of you by know know that they just aren't right in DBP. the dynamic array commands are just plain broken, there is no bounds checking, you can undim arrays that don't exist, and you can dim an array, undim it, and still access it. kinda scary.

Mesh Memblocks

ok... anyone mind explainig to me (1) why they changed the mesh memblock format, rendering all old mesh manipulation code obsolete, and (2) what the new "FVF" format is? there seems to be a command to modify the format of the mesh in the memblock but there is ZERO documentation on it.

anyone?
i'm looking at yooooou!
DrakeX
21
Years of Service
User Offline
Joined: 26th Aug 2002
Location:
Posted: 10th Oct 2002 06:31
well thanks or all your help, people

anyway, i went and figured out the new format myself, here it is for those still wondering:

header:
DWORD - FVF format, always seems to be 338.
DWORD - size (in bytes) of each vertex. with this format it's 36.
DWORD - number of vertices.

data:
each group of 3 vertices is considered to be a face.
for each vertex:
3 FLOATs: x,y,z position
3 FLOATs: normals
DWORD: 0xFFFFFFFF. i have no clue what it is but it has to be in there.
2 FLOATs: UV coordinates

there.

i'm looking at yooooou!
Milamber
21
Years of Service
User Offline
Joined: 27th Sep 2002
Location: Australia
Posted: 11th Oct 2002 19:42
In future, you could try giving the DBPro team at least a day to see your post before you get annoyed. They are a bit busy you know and the forums are hardly empty. You gave everyone less than 7 hours to respond if the indicator is correct. Also, other than the DBPro team, who may not even log on on a regular basis with patch 2 in the works, you have to wait for someone to be interested enough in the topic, or just checking through everything, to look at your post. Then they have to dig around and work things out for themselves first. Apart from the DBPro team, very few people would have that information at all, and you should give them a chance to dig it up before you put angry smilies in your post. But congrats on getting that format worked out. As for the arrays stuff, it probably just reserves a section of memory and gives you a pointer to it. This means that when you undim it, the data is still there until it gets written over, so the pointer can still access it. The pointer is obviously not being deleted, but it probably should be, to tidy things up. The undim command would therefore return the memory you reserved to unallocated, and if you try to undim an array that doesn't exist, maybe error handling just skips the statement (why would you try, anyway???). As for bounds checking, any error handling like that would slow down the code. Again, why would you try exceeding the bounds of the thing? Write good code, and you should have no problems. Just use some intelligence and you won't encounter problems.

System Specs: AMD Athlon 1700+ XP, GA-7VRX motherboard, 128MB DDR RAM, GeForce2 MX400 64MB VRAM

Login to post a reply

Server time is: 2024-04-20 07:31:14
Your offset time is: 2024-04-20 07:31:14