rubysdl 2.0.1 → 2.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/NEWS.en +36 -0
- data/NEWS.ja +36 -0
- data/README.en +1 -1
- data/README.ja +1 -1
- data/doc-en/Makefile +1 -1
- data/doc-en/cdrom.rsd +31 -0
- data/doc-en/event.rsd +6 -2
- data/doc-en/font.rsd +141 -4
- data/doc-en/general.rsd +14 -0
- data/doc-en/init.rsd +3 -3
- data/doc-en/mixer.rsd +68 -0
- data/doc-en/mpeg.rsd +24 -0
- data/doc-en/sdlskk.rsd +5 -0
- data/doc-en/video.rsd +35 -0
- data/doc-en/wm.rsd +6 -0
- data/doc/cdrom.rsd +29 -0
- data/doc/event.rsd +5 -2
- data/doc/font.rsd +250 -4
- data/doc/general.rsd +12 -0
- data/doc/mixer.rsd +68 -0
- data/doc/mpeg.rsd +24 -0
- data/doc/sdlskk.rsd +5 -1
- data/doc/video.rsd +35 -0
- data/doc/wm.rsd +10 -0
- data/extconf.rb +9 -0
- data/lib/rubysdl_aliases.rb +9 -0
- data/lib/sdl.rb +19 -32
- data/rubysdl.h +37 -4
- data/rubysdl_cdrom.c +14 -1
- data/rubysdl_event.c +14 -0
- data/rubysdl_image.c +1 -1
- data/rubysdl_joystick.c +0 -1
- data/rubysdl_kanji.c +86 -11
- data/rubysdl_main.c +8 -1
- data/rubysdl_mixer.c +17 -4
- data/rubysdl_sdlskk.c +19 -0
- data/rubysdl_sge_video.c +44 -12
- data/rubysdl_smpeg.c +7 -2
- data/rubysdl_time.c +13 -1
- data/rubysdl_ttf.c +92 -13
- data/rubysdl_video.c +10 -4
- data/rubysdl_wm.c +9 -3
- data/sample/font.rb +1 -0
- data/sample/load_from_io.rb +2 -2
- data/sample/plaympeg.rb +1 -5
- metadata +3 -3
data/rubysdl_video.c
CHANGED
@@ -237,7 +237,7 @@ static VALUE Screen_s_open(VALUE klass,VALUE w,VALUE h,VALUE bpp,
|
|
237
237
|
screen=SDL_SetVideoMode(NUM2INT(w),NUM2INT(h),NUM2INT(bpp),
|
238
238
|
NUM2UINT(flags));
|
239
239
|
if( screen==NULL ){
|
240
|
-
rb_raise(eSDLError,"
|
240
|
+
rb_raise(eSDLError,"Couldn't set %dx%d %d bpp video mode: %s",
|
241
241
|
NUM2INT(w),NUM2INT(h),NUM2INT(bpp),SDL_GetError());
|
242
242
|
}
|
243
243
|
return Screen_create(screen);
|
@@ -340,7 +340,7 @@ static VALUE Surface_s_createFrom(VALUE klass,VALUE pixels,VALUE w,
|
|
340
340
|
SDL_Surface *surface;
|
341
341
|
void* pixel_data;
|
342
342
|
|
343
|
-
|
343
|
+
SafeStringValue(pixels);
|
344
344
|
pixel_data = ALLOC_N(char, RSTRING_LEN(pixels));
|
345
345
|
memcpy(pixel_data,RSTRING_PTR(pixels),RSTRING_LEN(pixels));
|
346
346
|
|
@@ -359,7 +359,7 @@ static VALUE Surface_s_loadBMP(VALUE klass,VALUE filename)
|
|
359
359
|
{
|
360
360
|
SDL_Surface *image;
|
361
361
|
rb_secure(4);
|
362
|
-
|
362
|
+
ExportFilenameStringValue(filename);
|
363
363
|
|
364
364
|
image = SDL_LoadBMP(RSTRING_PTR(filename));
|
365
365
|
if(image == NULL){
|
@@ -398,7 +398,7 @@ static VALUE Surface_s_loadBMPFromString(VALUE class, VALUE str)
|
|
398
398
|
static VALUE Surface_saveBMP(VALUE self,VALUE filename)
|
399
399
|
{
|
400
400
|
rb_secure(4);
|
401
|
-
|
401
|
+
ExportFilenameStringValue(filename);
|
402
402
|
if( SDL_SaveBMP(Get_SDL_Surface(self), RSTRING_PTR(filename))==-1 ){
|
403
403
|
rb_raise(eSDLError,"cannot save %s: %s",RSTRING_PTR(filename),SDL_GetError());
|
404
404
|
}
|
@@ -413,6 +413,11 @@ static VALUE Surface_destroy(VALUE self)
|
|
413
413
|
sur->surface = NULL;
|
414
414
|
return Qnil;
|
415
415
|
}
|
416
|
+
static VALUE Surface_destroyed(VALUE self)
|
417
|
+
{
|
418
|
+
Surface* sur = GetSurface(self);
|
419
|
+
return INT2BOOL(sur->surface == NULL);
|
420
|
+
}
|
416
421
|
|
417
422
|
static VALUE Surface_format(VALUE self)
|
418
423
|
{
|
@@ -823,6 +828,7 @@ VALUE rubysdl_init_video(VALUE mSDL)
|
|
823
828
|
|
824
829
|
rb_define_method(cSurface,"saveBMP",Surface_saveBMP,1);
|
825
830
|
rb_define_method(cSurface,"destroy",Surface_destroy,0);
|
831
|
+
rb_define_method(cSurface,"destroyed?",Surface_destroyed,0);
|
826
832
|
rb_define_method(cSurface,"displayFormat",Surface_displayFormat,0);
|
827
833
|
rb_define_method(cSurface,"displayFormatAlpha",Surface_displayFormatAlpha,0);
|
828
834
|
rb_define_method(cSurface,"setColorKey",Surface_setColorKey,2);
|
data/rubysdl_wm.c
CHANGED
@@ -25,14 +25,19 @@ static VALUE WM_s_caption(VALUE mod)
|
|
25
25
|
|
26
26
|
rb_secure(4);
|
27
27
|
SDL_WM_GetCaption(&title, &icon);
|
28
|
+
#ifdef ENABLE_M17N
|
29
|
+
return rb_ary_new3(2,
|
30
|
+
ENC_STR_NEW2(title, utf8_enc),
|
31
|
+
ENC_STR_NEW2(icon, utf8_enc));
|
32
|
+
#else
|
28
33
|
return rb_ary_new3(2, rb_str_new2(title), rb_str_new2(icon));
|
34
|
+
#endif
|
29
35
|
}
|
30
36
|
static VALUE WM_s_setCaption(VALUE mod, VALUE title, VALUE icon)
|
31
37
|
{
|
32
38
|
rb_secure(4);
|
33
|
-
|
34
|
-
|
35
|
-
|
39
|
+
ExportStringValueToEnc(title, utf8_enc);
|
40
|
+
ExportStringValueToEnc(icon, utf8_enc);
|
36
41
|
SDL_WM_SetCaption(RSTRING_PTR(title), RSTRING_PTR(icon));
|
37
42
|
return Qnil;
|
38
43
|
}
|
@@ -68,4 +73,5 @@ void rubysdl_init_WM(VALUE mSDL)
|
|
68
73
|
rb_define_const(mWM, "GRAB_QUERY", INT2NUM(SDL_GRAB_QUERY));
|
69
74
|
rb_define_const(mWM, "GRAB_OFF", INT2NUM(SDL_GRAB_OFF));
|
70
75
|
rb_define_const(mWM, "GRAB_ON", INT2NUM(SDL_GRAB_ON));
|
76
|
+
|
71
77
|
}
|
data/sample/font.rb
CHANGED
data/sample/load_from_io.rb
CHANGED
@@ -16,9 +16,9 @@ SDL::WM::setCaption('from_str.rb','from_str.rb')
|
|
16
16
|
|
17
17
|
str = File.read("icon.bmp")
|
18
18
|
img = SDL::Surface.loadBMPFromIO(StringIO.new(str))
|
19
|
-
img2 = File.open("icon.bmp"){|f| SDL::Surface.loadBMPFromIO(f) }
|
19
|
+
img2 = File.open("icon.bmp", "rb"){|f| SDL::Surface.loadBMPFromIO(f) }
|
20
20
|
img3 = Zlib::GzipReader.open("icon.bmp.gz"){|f| SDL::Surface.loadBMPFromIO(f) }
|
21
|
-
img4 = File.open("icon.png"){|f| SDL::Surface.loadFromIO(f) }
|
21
|
+
img4 = File.open("icon.png", "rb"){|f| SDL::Surface.loadFromIO(f) }
|
22
22
|
|
23
23
|
mus = SDL::Mixer::Music.loadFromString(File.read("track01.ogg"))
|
24
24
|
wav = File.open('sample.wav'){|f| SDL::Mixer::Wave.loadFromIO(f) }
|
data/sample/plaympeg.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rubysdl
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ohbayashi Ippei
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date:
|
12
|
+
date: 2009-03-17 00:00:00 +09:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -145,7 +145,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
145
|
requirements: []
|
146
146
|
|
147
147
|
rubyforge_project:
|
148
|
-
rubygems_version: 1.0
|
148
|
+
rubygems_version: 1.2.0
|
149
149
|
signing_key:
|
150
150
|
specification_version: 2
|
151
151
|
summary: The simple ruby extension library to use SDL
|