Add "smooth" property to graphics module

This is just a simple bind and addition of a “smooth” property in the
graphics module, to fix fatal issue #2
This commit is contained in:
Vinyl Darkscratch 2016-12-14 16:06:40 -08:00
parent 544fd78753
commit 0a1d9c570f
4 changed files with 12 additions and 0 deletions

View file

@ -198,6 +198,7 @@ RB_METHOD(graphicsPlayMovie)
DEF_GRA_PROP_I(FrameRate)
DEF_GRA_PROP_I(FrameCount)
DEF_GRA_PROP_I(Brightness)
DEF_GRA_PROP_B(Smooth)
DEF_GRA_PROP_B(Fullscreen)
DEF_GRA_PROP_B(ShowCursor)
@ -240,6 +241,8 @@ void graphicsBindingInit()
_rb_define_module_function(module, "play_movie", graphicsPlayMovie);
}
INIT_GRA_PROP_BIND( Smooth, "smooth" );
INIT_GRA_PROP_BIND( Fullscreen, "fullscreen" );
INIT_GRA_PROP_BIND( ShowCursor, "show_cursor" );
}

View file

@ -472,6 +472,7 @@ struct GraphicsPrivate
int frameRate;
int frameCount;
int brightness;
bool smooth;
FPSLimiter fpsLimiter;
@ -935,6 +936,13 @@ void Graphics::fadein(int duration)
}
}
DEF_ATTR_RD_SIMPLE(Graphics, Smooth, bool, p->smooth)
void Graphics::setSmooth(bool value)
{
p->smooth = value;
}
Bitmap *Graphics::snapToBitmap()
{
Bitmap *bitmap = new Bitmap(width(), height());

View file

@ -45,6 +45,7 @@ public:
DECL_ATTR( FrameRate, int )
DECL_ATTR( FrameCount, int )
DECL_ATTR( Brightness, int )
DECL_ATTR( Smooth, bool )
void wait(int duration);
void fadeout(int duration);