[Finished] [RGSS] Fix Incorrect Definitions

Started by Blizzard, March 27, 2011, 06:12:17 am

Previous topic - Next topic

Blizzard

March 27, 2011, 06:12:17 am Last Edit: September 10, 2011, 03:25:57 am by Blizzard
Fix Incorrect Definitions




Description

While 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





Priority

High.



Prerequisites

Ruby/C++ Interfaces (finished)



Assigned

ForeverZer0



Everything else

Double check if everything is ok. Double checking is pretty much what this task is.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

G_G


Blizzard

You can finish this task now. It should be fairly easy.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Blizzard

F0, I am reassigning this task to you.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

April 15, 2011, 06:31:47 pm #4 Last Edit: April 17, 2011, 03:30:27 pm by ForeverZer0
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);
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

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.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

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 *
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

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?
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

April 20, 2011, 02:32:31 am #10 Last Edit: April 20, 2011, 02:34:00 am by ForeverZer0
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.
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Blizzard

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?
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

ForeverZer0

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. :'(
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Ryex

as I understood it it works exactly like sprite dose If you don't give it a viewport.
I no longer keep up with posts in the forum very well. If you have a question or comment, about my work, or in general I welcome PM's. if you make a post in one of my threads and I don't reply with in a day or two feel free to PM me and point it out to me.<br /><br />DropBox, the best free file syncing service there is.<br />