diff options
| author | Julian Simioni <[email protected]> | 2016-03-13 13:29:56 -0400 |
|---|---|---|
| committer | Julian Simioni <[email protected]> | 2016-03-13 13:35:39 -0400 |
| commit | a6c277b24ef2df950a282fbe8df0d8f2f1ce3e9a (patch) | |
| tree | e932d065b27f453ed5bfc7689f408d770a65e9af /ext | |
| parent | 96823748c68c65d1d54df7b0d9336df080b62d58 (diff) | |
| download | ruby2d-a6c277b24ef2df950a282fbe8df0d8f2f1ce3e9a.tar.gz ruby2d-a6c277b24ef2df950a282fbe8df0d8f2f1ce3e9a.zip | |
Update simple2d usage to latest interface
Commit [890aa1c](https://github.com/simple2d/simple2d/commit/890aa1cdeacccac97d6512019f02e43d9fb1943d)
in simple2d makes some backwards-incompatible interface changes. This
should bring ruby2d back up to date with them.
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/ruby2d/ruby2d.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/ext/ruby2d/ruby2d.c b/ext/ruby2d/ruby2d.c index 790f83c..24baeb8 100644 --- a/ext/ruby2d/ruby2d.c +++ b/ext/ruby2d/ruby2d.c @@ -11,7 +11,7 @@ VALUE self; // Simple 2D window -Window *window; +S2D_Window *window; // Ruby data types static VALUE ruby2d_module; @@ -20,13 +20,13 @@ static VALUE c_data_klass; // Structures for Ruby 2D classes struct image_data { - Image img; + S2D_Image* img; }; struct text_data { - Text txt; + S2D_Text* txt; }; struct sound_data { - Sound snd; + S2D_Sound* snd; }; @@ -215,8 +215,8 @@ void render() { struct image_data *data; Data_Get_Struct(rb_iv_get(el, "@data"), struct image_data, data); - data->img.x = NUM2DBL(rb_iv_get(el, "@x")); - data->img.y = NUM2DBL(rb_iv_get(el, "@y")); + data->img->x = NUM2DBL(rb_iv_get(el, "@x")); + data->img->y = NUM2DBL(rb_iv_get(el, "@y")); S2D_DrawImage(data->img); } break; @@ -234,8 +234,8 @@ void render() { struct text_data *data; Data_Get_Struct(rb_iv_get(el, "@data"), struct text_data, data); - data->txt.x = NUM2DBL(rb_iv_get(el, "@x")); - data->txt.y = NUM2DBL(rb_iv_get(el, "@y")); + data->txt->x = NUM2DBL(rb_iv_get(el, "@x")); + data->txt->y = NUM2DBL(rb_iv_get(el, "@y")); S2D_DrawText(data->txt); } break; |
