Merge separate RGSS version build configs into one

Setup active RGSS version at runtime. Desired version can be
specified via config, or as default, auto detected from the game
files. This removes the need to build specifically for each
version, which should help packaging a lot.

This also greatly reduces the danger of introducing code that
wouldn't compile on all RGSS version paths (as certain code paths
were completely ifdef'd out).

This can be optimized more, eg. not compiling shaders that aren't
needed in the active version.
This commit is contained in:
Jonas Kulla 2014-08-28 23:11:10 +02:00
parent b1981055e1
commit 55f1542c76
41 changed files with 460 additions and 465 deletions

View file

@ -61,10 +61,11 @@ RB_METHOD(fontInitialize)
f->setColor(new Color(*f->getColor()));
wrapProperty(self, f->getColor(), "color", ColorType);
#ifdef RGSS3
if (rgssVer >= 3)
{
f->setOutColor(new Color(*f->getOutColor()));
wrapProperty(self, f->getOutColor(), "out_color", ColorType);
#endif
}
if (NIL_P(name))
name = rb_iv_get(rb_obj_class(self), "default_name");
@ -92,10 +93,11 @@ RB_METHOD(fontInitializeCopy)
f->setColor(new Color(*f->getColor()));
wrapProperty(self, f->getColor(), "color", ColorType);
#ifdef RGSS3
if (rgssVer >= 3)
{
f->setOutColor(new Color(*f->getOutColor()));
wrapProperty(self, f->getOutColor(), "out_color", ColorType);
#endif
}
return self;
}
@ -166,16 +168,10 @@ RB_METHOD(FontSetName)
DEF_PROP_I(Font, Size)
DEF_PROP_B(Font, Bold)
DEF_PROP_B(Font, Italic)
DEF_PROP_OBJ(Font, Color, Color, "color")
#ifdef RGSS2
DEF_PROP_B(Font, Shadow)
#endif
#ifdef RGSS3
DEF_PROP_B(Font, Outline)
DEF_PROP_OBJ(Font, Color, Color, "color")
DEF_PROP_OBJ(Font, Color, OutColor, "out_color")
#endif
#define DEF_KLASS_PROP(Klass, type, PropName, param_t_s, value_fun) \
RB_METHOD(Klass##Get##PropName) \
@ -195,12 +191,7 @@ DEF_PROP_OBJ(Font, Color, OutColor, "out_color")
DEF_KLASS_PROP(Font, int, DefaultSize, "i", rb_fix_new)
DEF_KLASS_PROP(Font, bool, DefaultBold, "b", rb_bool_new)
DEF_KLASS_PROP(Font, bool, DefaultItalic, "b", rb_bool_new)
#ifdef RGSS2
DEF_KLASS_PROP(Font, bool, DefaultShadow, "b", rb_bool_new)
#endif
#ifdef RGSS3
DEF_KLASS_PROP(Font, bool, DefaultOutline, "b", rb_bool_new)
RB_METHOD(FontGetDefaultOutColor)
@ -221,7 +212,6 @@ RB_METHOD(FontSetDefaultOutColor)
return colorObj;
}
#endif
RB_METHOD(FontGetDefaultName)
{
@ -285,14 +275,16 @@ fontBindingInit()
INIT_KLASS_PROP_BIND(Font, DefaultItalic, "default_italic");
INIT_KLASS_PROP_BIND(Font, DefaultColor, "default_color");
#ifdef RGSS2
if (rgssVer >= 2)
{
INIT_KLASS_PROP_BIND(Font, DefaultShadow, "default_shadow");
#endif
}
#ifdef RGSS3
if (rgssVer >= 3)
{
INIT_KLASS_PROP_BIND(Font, DefaultOutline, "default_outline");
INIT_KLASS_PROP_BIND(Font, DefaultOutColor, "default_out_color");
#endif
}
rb_define_class_method(klass, "exist?", fontDoesExist);
@ -305,12 +297,14 @@ fontBindingInit()
INIT_PROP_BIND(Font, Italic, "italic");
INIT_PROP_BIND(Font, Color, "color");
#ifdef RGSS2
if (rgssVer >= 2)
{
INIT_PROP_BIND(Font, Shadow, "shadow");
#endif
}
#ifdef RGSS3
if (rgssVer >= 3)
{
INIT_PROP_BIND(Font, Outline, "outline");
INIT_PROP_BIND(Font, OutColor, "out_color");
#endif
}
}