Chaos Project

Featured Projects => Advanced RPG Creator => ARC Reactor Engine => Topic started by: Blizzard on May 20, 2011, 12:17:48 pm

Title: [r257] Argument checks in Tone, Color and Font
Post by: Blizzard on May 20, 2011, 12:17:48 pm
In future, if there are questions about specific revisions or something like that, include it in a tag like I did.

Now to my question. I noticed that F0 added argument checks in rb_initialize using scan_args in Color, Tone and Font. Are they needed in Color and Tone? I made rb_initialize calls rb_set and that one already has the checks. Is there any particular reason for this?
Since I noticed a comment, I guess you're not sure yourself, F0. :P In any case, you should check out the problem in RMXP and ARC to see if there is any difference.

As for the Font, does Font.new without arguments work as well?
Title: Re: [r257] Argument checks in Tone, Color and Font
Post by: ForeverZer0 on May 20, 2011, 12:32:59 pm
Yes, I was slightly unsure if they belonged there.

As for the Font, now that you mention it, I did mess that up. I made it so that one argument is required, with one optional. I should have used "02", not "11". :P

I do have a couple questions on how to implement a few of these, mainly for methods that take only one required argument.
I see how to do it easy enough when argc and argv are defined, but I am unsure what value to use to replace argv for single arguments.

Could you make me one quick example? I'll do the rest after that. Example would be the setter for the bitmap in the sprite class or something.
Title: Re: [r257] Argument checks in Tone, Color and Font
Post by: Blizzard on May 21, 2011, 05:15:21 am
(int argc, VALUE* argv) is only necessary if you have optional arguments or you can call a method with different numbers of arguments.
If all arguments are required, you just put those arguments in there normally.
I'll be in IRC today so ask me there for the details.

I'll fix the thing with Font.