Cloning
DescriptionRGSS objects can be cloned. The question is which of them can be cloned and which can't.
Every object that can be cloned needs to have a rb_initialize_copy method defined. Declare the method in the header, define the method in the source file and add it to the interface of the class.
PriorityHigh.
PrerequisitesNone
AssignedBlizzard
Everything elseFor reference you can take a look at how Bitmap was done.
If you are unsure how to implement rb_initialize_copy for a specific class, just leave a comment with "// TODO - cloning" and I will take care of that.
You should first try in the original RGSS to call clone for every RGSS class to see if it works and if it's defined.
Wasn't this already included in this (http://forum.chaos-project.com/index.php/topic,9220.0.html) task?
I made a special task because nobody was attending to that task. :P
Basically the other task is done except that the rd_initialize_copy method wasn't implemented.
*coughs*
Quote from: Blizzard on July 30, 2011, 06:41:07 am
*cough* <_<;
Is this task done? I removed the rb_initialize_copy method from the list because it is part of another class.
Quote from: Blizzard on August 09, 2011, 11:18:51 am
*coughs*
I have some cough medicine if you need any.
rb_initialize_copy still needs to be implemented. :P
The thing is that the Color needs it in order to fix the current text color bug.
EDIT: Can somebody at least check out which RGSS classes are clone-able? I'll take care of the rest.
I know color is for sure. Tone, plane, viewport? I would honestly test all classes but I'm in the worst environment for a computer nerd right now.
In the middle of a forest? D:
I'm more worried about the Renderable classes. I think they aren't clone-able. The simple classes are all clone-able (Color, Tone, Font).
Bitmaps can be cloned. I remember doing it while testing out graphics. I was applying effects to bitmaps and then when I realized I had to clone the graphic to its own id so the effect wouldn't be applied to that one graphic globally. I think Sprite is even clone-able.
I'm just on a password protected computer, the owner keeps changing passwords so I can't install anything, so I can't pop open RMXP and do a test on several classes....*remembers portable RMXP*
I know bitmaps can be cloned. That's already implemented.
As I said, I'm not sure about the renderable classes, because we had to implement them in an unusual way and probably Enterbrain had to do so as well. Because of that simple cloning might not work well. So somebody simply needs to test it. *pokes all scripters at the forum*
ow quit poking me :naughty:
I was right, Renderables cannot be cloned. And cloning Viewport crashes the whole Game.exe. That one won't happen in ARC.