rubysdl 2.1.1 → 2.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -278,6 +278,7 @@ Ruby/SDL
278
278
  * ((<SDL::PixelFormat#colorkey>)) -- Ʃ���ԥ�����Υԥ�������
279
279
  * ((<SDL::PixelFormat#alpha>)) -- �����ե������ΤΦ���
280
280
  * ((<SDL::PixelFormat#bpp>)) -- �����ե����γƥԥ������ɽ�魯�Τ˻Ȥ���ӥåȿ�
281
+ * ((<SDL::Surface#pitch>)) -- �����ե����γƥ������饤��ΥХ��ȿ�
281
282
  * ((<SDL::Surface.load>)) -- �����򥵡��ե����˥����ɤ��ޤ���
282
283
  * ((<SDL::Surface.load_from_io>)) -- Ruby��IO���֥������Ȥ�������򥵡��ե����˥����ɤ��ޤ���
283
284
  * ((<SDL::Surface#put_pixel>)) -- ���ꤷ�����֤�����񤭤ޤ���
@@ -406,6 +407,7 @@ Ruby/SDL
406
407
  * ((<SDL::Surface#pixels>)) -- �ºݤΥԥ�����ǡ������֤��ޤ�
407
408
  * ((<SDL::Surface#colorkey>)) -- Ʃ���ԥ�����Υԥ�������
408
409
  * ((<SDL::Surface#alpha>)) -- �����ե������ΤΦ���
410
+ * ((<SDL::Surface#pitch>)) -- �����ե����γƥ������饤��ΥХ��ȿ�
409
411
  * ((<SDL::Surface.load>)) -- �����򥵡��ե����˥����ɤ��ޤ���
410
412
  * ((<SDL::Surface.load_from_io>)) -- Ruby��IO���֥������Ȥ�������򥵡��ե����˥����ɤ��ޤ���
411
413
  * ((<SDL::Surface#put_pixel>)) -- ���ꤷ�����֤�����񤭤ޤ���
@@ -1829,6 +1831,16 @@ R,G,B
1829
1831
  �����ե����γƥԥ������ɽ�魯�Τ˻Ȥ���ӥåȿ����֤��ޤ���
1830
1832
  �̾�8��16��24��32�Τ����줫�Ǥ���
1831
1833
 
1834
+ --- SDL::Surface#pitch
1835
+
1836
+ �����ե����γƥ������饤��˻Ȥ���Х��ȿ����֤��ޤ���
1837
+ ((<SDL::Surface#pixels>)) ������������ǡ����β���ɬ�פȤʤ�ޤ���
1838
+ �����褽 ((<SDL::Surface#bpp>)) * ((<SDL::Surface#w>)) / 8 ���ͤȤʤ�ޤ�����
1839
+ �ѥǥ��󥰤Τ��ᾯ���������礭���ʤ��礬����ޤ���
1840
+
1841
+ ((<SDL::Surface#pixels>)) ��������ǡ����ΥХ��ȿ��� ((<SDL::Surface#h>)) * pitch ��
1842
+ �ʤ�ޤ���
1843
+
1832
1844
  --- SDL::Surface.load(filename)
1833
1845
 
1834
1846
  �����Υե�����򥵡��ե����˥����ɤ��ޤ���
@@ -4572,6 +4584,10 @@ Ruby/SDL
4572
4584
  * OggVorbis (.ogg) ogg/vorbis �饤�֥�꤬ɬ��
4573
4585
  * MP3 (.mp3) SMPEG �饤�֥�꤬ɬ��
4574
4586
 
4587
+ ���ߡ�MP3�κ����ˤ����꤬���뤳�Ȥ���ǧ����Ƥ��ޤ���
4588
+ �����餯SMPEG������ȹͤ�����ΤǤ�������������Ƥ��ޤ���
4589
+ OggVorbis������˻ȤäƤ���������
4590
+
4575
4591
  == SDL::Mixer
4576
4592
  audio��Ϣ�Υ��饹��ؿ�����ĥ⥸�塼��Ǥ���
4577
4593
 
@@ -186,7 +186,7 @@ static VALUE Dictionary_load(VALUE self, VALUE filename, VALUE users)
186
186
  {
187
187
  SDLSKK_Dictionary* dict = Get_SDLSKK_Dictionary(self);
188
188
  rb_secure(4);
189
- SafeStringValue(filename);
189
+ ExportFilenameStringValue(filename);
190
190
 
191
191
  if(!SDLSKK_Dict_load(dict, RSTRING_PTR(filename), RTEST(users)))
192
192
  rb_raise(eSDLError, "Couldn't load %s", RSTRING_PTR(filename));
@@ -198,7 +198,7 @@ static VALUE Dictionary_save(VALUE self, VALUE filename)
198
198
  {
199
199
  SDLSKK_Dictionary* dict = Get_SDLSKK_Dictionary(self);
200
200
  rb_secure(4);
201
- SafeStringValue(self);
201
+ ExportFilenameStringValue(filename);
202
202
 
203
203
  if(!SDLSKK_Dict_save_user_dict(dict, RSTRING_PTR(filename)))
204
204
  rb_raise(eSDLError, "Couldn't save %s", RSTRING_PTR(filename));
@@ -209,7 +209,7 @@ static VALUE RomKanaRuleTable_s_new(VALUE klass, VALUE table_file)
209
209
  {
210
210
  SDLSKK_RomKanaRuleTable* rule_table;
211
211
  rb_secure(4);
212
- SafeStringValue(table_file);
212
+ ExportFilenameStringValue(table_file);
213
213
 
214
214
  rule_table = SDLSKK_RomKanaRuleTable_new(RSTRING_PTR(table_file));
215
215
 
@@ -227,8 +227,8 @@ static VALUE Keybind_s_new(VALUE klass)
227
227
  static VALUE Keybind_set_key(VALUE self, VALUE key_str, VALUE cmd_str)
228
228
  {
229
229
  SDLSKK_Keybind_set_key(Get_SDLSKK_Keybind(self),
230
- StringValuePtr(key_str),
231
- StringValuePtr(cmd_str));
230
+ StringValueCStr(key_str),
231
+ StringValueCStr(cmd_str));
232
232
  return Qnil;
233
233
  }
234
234
 
@@ -240,7 +240,7 @@ static VALUE Keybind_set_default_key(VALUE self)
240
240
 
241
241
  static VALUE Keybind_unset_key(VALUE self, VALUE key_str)
242
242
  {
243
- SDLSKK_Keybind_unset_key(Get_SDLSKK_Keybind(self), StringValuePtr(key_str));
243
+ SDLSKK_Keybind_unset_key(Get_SDLSKK_Keybind(self), StringValueCStr(key_str));
244
244
  return Qnil;
245
245
  }
246
246
 
@@ -232,9 +232,14 @@ static VALUE Surface_drawBezier(int argc, VALUE* argv, VALUE self)
232
232
  int i;
233
233
 
234
234
  rb_secure(4);
235
- /* WARNING: ':' == '9' + 1
235
+ /* WARNING: third argument of rb_scan_args
236
+ should be 10-2, but rb_scan_args cannot accept such
237
+ an argument.
236
238
  */
237
- rb_scan_args(argc, argv, ":2",
239
+ if (argc < 10)
240
+ rb_raise(rb_eArgError, "wrong number of arguments (%d for 10)", argc);
241
+
242
+ rb_scan_args(argc, argv, "93",
238
243
  &coords_[0], &coords_[1],
239
244
  &coords_[2], &coords_[3],
240
245
  &coords_[4], &coords_[5],
@@ -454,7 +459,7 @@ static VALUE BMFont_textSize(VALUE self, VALUE text)
454
459
  SDL_Rect rect;
455
460
  SafeStringValue(text);
456
461
  rect = sge_BF_TextSize(Get_sge_bmpFont(self),
457
- RSTRING_PTR(text));
462
+ StringValueCStr(text));
458
463
  return rb_ary_new3(2, INT2FIX(rect.w), INT2FIX(rect.h));
459
464
  }
460
465
 
@@ -467,7 +472,7 @@ static VALUE BMFont_textout(VALUE self,
467
472
  SafeStringValue(string);
468
473
 
469
474
  sge_BF_textout(Get_SDL_Surface(surface), Get_sge_bmpFont(self),
470
- RSTRING_PTR(string), NUM2INT(x), NUM2INT(y));
475
+ StringValueCStr(string), NUM2INT(x), NUM2INT(y));
471
476
  return Qnil;
472
477
  }
473
478
 
@@ -92,7 +92,7 @@ static VALUE MPEG_s_load(VALUE klass, VALUE filename)
92
92
  char error_msg[2048];
93
93
 
94
94
  rb_secure(4);
95
- SafeStringValue(filename);
95
+ ExportFilenameStringValue(filename);
96
96
 
97
97
  smpeg = SMPEG_new(RSTRING_PTR(filename), NULL, 0);
98
98
  if( SMPEG_error(smpeg) ){
@@ -81,8 +81,8 @@ static VALUE Font_s_open(int argc, VALUE *argv, VALUE class)
81
81
 
82
82
  rb_secure(4);
83
83
  rb_scan_args( argc, argv, "21", &filename, &size, &index );
84
-
85
- SafeStringValue(filename);
84
+
85
+ ExportFilenameStringValue(filename);
86
86
 
87
87
  if(NIL_P(index))
88
88
  font = TTF_OpenFont(RSTRING_PTR(filename), NUM2INT(size));
@@ -143,7 +143,7 @@ static VALUE Font_textSize(VALUE self, VALUE text)
143
143
  #ifdef ENABLE_M17N
144
144
  text = rb_str_export_to_enc(text, utf8_enc);
145
145
  #endif
146
- TTF_SizeUTF8(Get_TTF_Font(self), RSTRING_PTR(text), &w, &h);
146
+ TTF_SizeUTF8(Get_TTF_Font(self), StringValueCStr(text), &w, &h);
147
147
  return rb_ary_new3(2, INT2FIX(w), INT2FIX(h));
148
148
  }
149
149
 
@@ -192,7 +192,7 @@ static VALUE render(VALUE self, VALUE text,
192
192
  text = rb_str_export_to_enc(text, utf8_enc);
193
193
  #endif
194
194
  surface = renderer(Get_TTF_Font(self),
195
- RSTRING_PTR(text),
195
+ StringValueCStr(text),
196
196
  rgb_to_SDL_Color(fgr, fgg, fgb),
197
197
  rgb_to_SDL_Color(bgr, bgg, bgb));
198
198
 
@@ -26,11 +26,11 @@ srand
26
26
  screen.fillRect rand(src_w-dst_w), rand(src_h-dst_h), dst_w, dst_h, color
27
27
  screen.updateRect 0,0,0,0
28
28
 
29
- while event = SDL::Event2.poll
29
+ while event = SDL::Event.poll
30
30
  case event
31
- when SDL::Event2::Quit
31
+ when SDL::Event::Quit
32
32
  exit
33
- when SDL::Event2::KeyDown
33
+ when SDL::Event::KeyDown
34
34
  exit if event.sym == SDL::Key::ESCAPE
35
35
  end
36
36
  end
@@ -19,6 +19,7 @@ screen.draw_circle(100,100,50,[87,87,87])
19
19
  screen.draw_circle(300,300,30,Red, true)
20
20
  screen.draw_circle(230, 300, 30, Red, true, true)
21
21
 
22
+ screen.draw_bezier(100, 100, 150, 200, 300, 150, 400, 200, 7, [255, 255,255], true, 128)
22
23
  screen.flip
23
24
 
24
25
  while true
metadata CHANGED
@@ -1,7 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysdl
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.1
4
+ prerelease: false
5
+ segments:
6
+ - 2
7
+ - 1
8
+ - 2
9
+ version: 2.1.2
5
10
  platform: ruby
6
11
  authors:
7
12
  - Ohbayashi Ippei
@@ -9,7 +14,7 @@ autorequire:
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-12-03 00:00:00 +09:00
17
+ date: 2012-04-08 00:00:00 +09:00
13
18
  default_executable:
14
19
  dependencies: []
15
20
 
@@ -131,21 +136,25 @@ rdoc_options: []
131
136
  require_paths:
132
137
  - lib
133
138
  required_ruby_version: !ruby/object:Gem::Requirement
139
+ none: false
134
140
  requirements:
135
141
  - - ">="
136
142
  - !ruby/object:Gem::Version
143
+ segments:
144
+ - 0
137
145
  version: "0"
138
- version:
139
146
  required_rubygems_version: !ruby/object:Gem::Requirement
147
+ none: false
140
148
  requirements:
141
149
  - - ">="
142
150
  - !ruby/object:Gem::Version
151
+ segments:
152
+ - 0
143
153
  version: "0"
144
- version:
145
154
  requirements: []
146
155
 
147
156
  rubyforge_project: rubysdl
148
- rubygems_version: 1.3.4
157
+ rubygems_version: 1.3.7
149
158
  signing_key:
150
159
  specification_version: 3
151
160
  summary: The simple ruby extension library to use SDL