|
![]() |
#1 |
Senior Member
Professional user
Join Date: Nov 2003
Location: Eugene OR, USA
Posts: 212
|
![]()
take a look at:
Code:
List *VertList; for(loop...) { Vertex *temp_vert = new_vertex_set(x, y, z); list_add_item(&VertexList, temp_vert); } object_add_vertices(return_Object, VertexList); Code:
Exception occured in command load_file_select. Last Error(not necessarily the problem): The operation completed successfully. Code:
for(loop...) { Vertex *temp_vert = new_vertex_set(x, y, z); object_add_vertex(return_Object, temp_vert); } im trying to get my code to run faster. any help? --Phil |
![]() |
![]() |
![]() |
#2 |
Senior Member
Professional user
Join Date: Jun 2003
Location: British Columbia, Canada
Posts: 255
|
![]()
I assume vertlist and vertexlist are actually the same variable in your real code. I think the problem is your "List *" is used before you are giving it a new list object. Initialize the list (can't remember the function) and then use it.
Make sure to free the list afterwards... List management is a little awkward, I'm afraid. I don't remember the details right now, but I hope that helps a little. -- Jeff |
![]() |
![]() |
![]() |
#3 |
Senior Member
Professional user
Join Date: Nov 2003
Location: Eugene OR, USA
Posts: 212
|
![]()
ah ha, thanx ill try that.
and yes, i missed that code error. --Phil |
![]() |
![]() |
![]() |
#4 |
Administrator
Professional user
Join Date: Jun 2003
Posts: 4,541
|
![]()
You must set the list to NULL before you start - otherwise it looks like there's something in it already and it will mess up.
Use object_add_vertex_head for speed. Andy |
![]() |
![]() |
![]() |
#5 |
Senior Member
Professional user
Join Date: Nov 2003
Location: Eugene OR, USA
Posts: 212
|
![]()
thanx andy, that add_vertex_head makes it run much faster.
|
![]() |
![]() |
![]() |
Thread Tools | |
Display Modes | |
|
|