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.

Code Snippets / DBC : Copy Object Function

Author
Message
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 29th Oct 2006 17:57 Edited at: 1st Nov 2006 17:38
I wrote this in response to a question so I thought It would be a good idea to post it here as well.

You can use the function copy_object() to make a duplicate of a loaded or created object. The only thing you have to consider is the texture. If you load or create the texture separately, then it can be applied to the newly created objects.

Fucntion:
copy_object(inobj,outobj,texture)

inobj = the original object number to be copied
outobj = the new object number that will be created
texture = the image number to use as the texture



Enjoy your day.
Sixty Squares
18
Years of Service
User Offline
Joined: 7th Jun 2006
Location: Somewhere in the world
Posted: 1st Nov 2006 03:20
Looks good! Just I would use a FreeMemblock() function kind of thing for the memblocks. Memblocks 1+2 may already be in use

Tutorials:
Array
Functions
Latch
18
Years of Service
User Offline
Joined: 23rd Jul 2006
Location:
Posted: 1st Nov 2006 17:39
@Sixty

Good idea!

Done and Done!

Enjoy your day.

Login to post a reply

Server time is: 2024-11-22 23:42:09
Your offset time is: 2024-11-22 23:42:09