Ancurio / mkxp

Free Software implementation of the Ruby Game Scripting System (RGSS)
GNU General Public License v2.0
514 stars 131 forks source link

Default filename argument to Graphics.transition() should be "", not nil #108

Closed sorlok closed 9 years ago

sorlok commented 9 years ago

The second argument to Graphics.transition() should default to "", not nil. (This represents using the default shader.) Currently, if someone wants to call Graphics.transition(8, "", 100), the "" will cause mkxp to try to load a Bitmap named "", rather than defaulting to the default shader. (Using nil instead of "" will work in MKXP, but not RPG Maker.)

Suggest changing line 719 of graphics.cpp:

//from:
Bitmap *transMap = filename ? new Bitmap(filename) : 0;

//to:
Bitmap *transMap = (filename && strlen(filename)>0) ? new Bitmap(filename) : 0;
Ancurio commented 9 years ago

I don't think using nil should have worked in mkxp because it will still try to parse it as a string from the ruby side.

sorlok commented 9 years ago

Makes sense, thanks.