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

@ -23,6 +23,7 @@
#define VIEWPORTELEMENTBINDING_H
#include "viewport.h"
#include "sharedstate.h"
#include "binding-util.h"
#include "binding-types.h"
@ -39,8 +40,6 @@ RB_METHOD(viewportElementGetViewport)
return rb_iv_get(self, "viewport");
}
#ifdef RGSS2
template<class C>
RB_METHOD(viewportElementSetViewport)
{
@ -63,8 +62,6 @@ RB_METHOD(viewportElementSetViewport)
return viewportObj;
}
#endif
template<class C>
static C *
viewportElementInitialize(int argc, VALUE *argv, VALUE self)
@ -98,9 +95,10 @@ viewportElementBindingInit(VALUE klass)
_rb_define_method(klass, "viewport", viewportElementGetViewport<C>);
#ifdef RGSS2
if (rgssVer >= 2)
{
_rb_define_method(klass, "viewport=", viewportElementSetViewport<C>);
#endif
}
}
#endif // VIEWPORTELEMENTBINDING_H