[Finished] [RGSS] RGSSError Implementations in Renderable Subclasses

Started by Blizzard, April 08, 2011, 02:49:15 am

Previous topic - Next topic

Blizzard

RGSSError Implementations in Renderable Subclasses




Description

We have a Renderable class that provides some basic functionality for all the classes that can be rendered and are visible on the screen. These instances can be disposed manually and the majority of the methods of those classes cannot be accessed once it has been disposed. To prevent this access, an RGSSError is thrown (i.e. raised in Ruby language). These throws/raises need to be implemented.



Priority

Low.



Prerequisites

RGSS::Sprite Implementation
RGSS::Viewport Implementation
RGSS::Plane Implementation
RGSS::Window Implementation
RGSS::Tilemap Implementation



Assigned

ForeverZer0



Everything else

Check out how I have implemented the raising of RGSSError in Bitmap::rb_initialize in case the dimensions are less than 1x1.
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

I'll see what I can do with this.
I spent a while trying to throw as many errors as I could with these classes, might as well try to catch some.   :P

I know, I know, corny humor.
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

Actually that was clever. xD
Even though the prerequisite tasks haven't been done yet, feel free to start working already since as good as all methods have been interface already.
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

May 12, 2011, 12:07:45 am #3 Last Edit: May 12, 2011, 02:09:13 am by ForeverZer0
I also did RGSS::Bitmap. I wasn't sure why it wasn't on the list, but I figured it should be.
If that's a problem, I'll revert it back.

EDIT:
I think its done. Some various notes that may or not be of interest

  • RGSS::Plane was unaffected because all of its functions were inherited, I did add a "#include RGSSError.h" to it, but only cause I was unsure if was required or not. I'll remove it if it is useless.

  • The way it stands right now, a reference to @autotiles of a disposed Tilemap instance will cause an error. Although this is how I think it should have been, RMXP did not have this behavior. I don't see how/why this would need to be referenced, so let me know and I'll add in Exception handling there too.

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

It's not a Renderable subclass, but yeah, it's good you did it anyway.
You can remove the header inclusion.

Actually it shouldn't throw an error. Just because a renderable object containing a source (Bitmap instance in this case) cannot be accessed anymore, doesn't mean that the source cannot be accessed anymore. The same goes for Sprite and similar classes. You can still access Sprite#bitmap even after you disposed the sprite (you just can't use Sprite#bitmap=).
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

Okay, removed header.
Moving this one to "Finished".
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.