03-09-2005, 06:50 AM
This raises a question for me too...
I have no experience with pointers. :roll:
Is it possible to allocate memory for these variables on the fly?
Basically, all the arrays that have 50 members...
..need to be allocated to Num_Surfaces instead of 50, but I don't know how to do it. Is it even possible to do that using pointers, and how confusing would the code be? This isn't all either... I have alot of stuff in my program that would benefit from this. If it's even possible that is.
I have no experience with pointers. :roll:
Is it possible to allocate memory for these variables on the fly?
Code:
Type ObjType
IdNum as Integer
VertCnt as Integer
FaceCnt as Integer
Num_Surfaces as Integer
Start_Id(1 to 50) as Integer
End_Id(1 to 50) as Integer
Surface_Id(1 to 50) as Integer
Transparent(1 to 50) as BYTE
Textured(1 to 50) as Byte
Collidable(1 to 50) as Byte
RGBA(1 to 25, 3) as Single
Ambient(1 to 50, 3) as Single
Diffuse(1 to 50, 3) as Single
Specular(1 to 50, 3) as Single
Emission(1 to 50, 3) as Single
Shininess(1 to 50) as Single
Angle_X as Integer
Angle_Y as Integer
Angle_Z as Integer
IsDynamic as Byte
Trans as Vector3DType
TransSpd as Vector3DType
Num_Targets as Integer
CurTarg as Integer
Target(1 to 10) as Vector3DType
TargSpd(1 to 10) as Vector3DType
End Type
Dim Entity(1 to Total_Entities) as ObjType
Basically, all the arrays that have 50 members...
Code:
Start_Id(1 to 50) as Integer
End_Id(1 to 50) as Integer
Surface_Id(1 to 50) as Integer
..need to be allocated to Num_Surfaces instead of 50, but I don't know how to do it. Is it even possible to do that using pointers, and how confusing would the code be? This isn't all either... I have alot of stuff in my program that would benefit from this. If it's even possible that is.