Fix Incorrect Definitions
DescriptionWhile going through our current code, I have noticed that quite a few classes where the interface was not implemented properly. I have see a few methods where the parameter number is incorrect and I have noticed that some methods don't return the proper value. Make sure that:
- any method with optional parameters has -1 as argument number and the argument list is (int argc, VALUE* argv, VALUE self).
- setters return "value"
- rb_new returns always the result of Data_Make_Struct
- rb_initialize and rb_initialize_copy return self
- normal methods return Qnil (NOT self!), except if otherwise specified for specific methods
PriorityHigh.
PrerequisitesRuby/C++ Interfaces (http://forum.chaos-project.com/index.php/topic,8982.0.html) (finished)
AssignedForeverZer0
Everything elseDouble check if everything is ok. Double checking is pretty much what this task is.
I'll take this on.
You can finish this task now. It should be fairly easy.
F0, I am reassigning this task to you.
On it.
EDIT:
One quick question before I get too far ahead of myself.
I know to leave the names for single arguments as "value" for setters, but can I explain a little better in the definition what that "value" is?
example from Color:
/// @brief Sets the font's name.
/// @param[in] String Default name of the font.
static VALUE rb_setDefaultName(VALUE classe, VALUE value);
This:
/// @brief Sets the font's name.
/// @param[in] value Default name of the font.
static VALUE rb_setDefaultName(VALUE classe, VALUE value);
We omit the classe argument and the self argument because they are Ruby specific implementations.
Alrighty, just making sure.
I should have it committed by the end of the night. I have a little running around to do, then I'm gonna finish it before I go to bed.
Sounds good.
When you're done and after you have double checked everything, feel free to mark this task as completed and move it into the section for completed tasks.
Committed.
There are a couple minor things I cannot change as of yet, do to being incomplete.
- Plane initialize method should have way to call without a Viewport, and use a pointer instead of the object I think.
- Since Tilemap's unimplemented, the "rb_new" method does not return a Data_Make_Struct object. I was going to take a stab at it, but it would likely have resulted in an epic failure. I remember you saying that you wanted to use the Sprite class for it internally instead of basically a whole replica of Sprite with only some minor differences. Sadly, I am still kinda confused with some of the Rendering methods, etc. to help with that... :(
* Marks as finished and moves *
Don't worry about it. You did your task, I'll take care of the rest. xD
BTW, what do you mean with Plane? As far as I remember, you have to pass a viewport as argument. Or did you mean that is should have a C++ constructor?
I thought the viewport was optional, like how Sprite is, if I am remembering correctly. I could be wrong.
Currently the C++ code has no way to handle the class being instantized without a viewport passed.
* Goes to check it out
EDIT:
* Returns...
Yeah, it should be able to be called without no argument.
That's weird. How is it supposed to be drawn? Can you check out how it works in RMXP if you don't give it a Viewport?
Will do, but I am going to bed now. It is late-as-hell-o'clock where I am, and I have work in the morning. :'(
as I understood it it works exactly like sprite dose If you don't give it a viewport.