gosu 0.10.3 → 0.10.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gosu/Version.hpp +2 -2
- data/ext/gosu/gosu_wrap.cxx +31 -261
- data/lib/gosu/patches.rb +16 -2
- data/rdoc/gosu.rb +33 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c9a5aa832c214694948d1497c7d182fa4caa3806
|
4
|
+
data.tar.gz: bd5f1f05958bfc3af859d04aac6f146661a804d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52b41e5f71ea792d58b66f617808610dc9b6a45ceeb92c00aabe4a6fee159318b6eb93206a19168869b88b5e0ccc6700eea552ad2464381b9e3481e18c69bc97
|
7
|
+
data.tar.gz: 2aecc9ff1c3a8c39fb1de3826ea1ff15603c6da12ca9dc9827e372822393a098ab76942801049634a9466786a646fae1b013107c84fbbba3277f77af78a20817
|
data/Gosu/Version.hpp
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
|
4
4
|
#define GOSU_MAJOR_VERSION 0
|
5
5
|
#define GOSU_MINOR_VERSION 10
|
6
|
-
#define GOSU_POINT_VERSION
|
7
|
-
#define GOSU_VERSION "0.10.
|
6
|
+
#define GOSU_POINT_VERSION 4
|
7
|
+
#define GOSU_VERSION "0.10.4"
|
8
8
|
|
9
9
|
#define GOSU_COPYRIGHT_NOTICE \
|
10
10
|
"This software uses the following third-party libraries:\n" \
|
data/ext/gosu/gosu_wrap.cxx
CHANGED
@@ -2742,7 +2742,7 @@ SWIG_From_float (float value)
|
|
2742
2742
|
return SWIG_From_double (value);
|
2743
2743
|
}
|
2744
2744
|
|
2745
|
-
SWIGINTERN Gosu::Image *
|
2745
|
+
SWIGINTERN Gosu::Image *new_Gosu_Image(VALUE source,VALUE options=0){
|
2746
2746
|
Gosu::Bitmap bmp;
|
2747
2747
|
Gosu::loadBitmap(bmp, source);
|
2748
2748
|
|
@@ -2792,37 +2792,6 @@ SWIGINTERN Gosu::Image *new_Gosu_Image__SWIG_0(VALUE source,VALUE options=0){
|
|
2792
2792
|
|
2793
2793
|
return new Gosu::Image(bmp, srcX, srcY, srcWidth, srcHeight, flags);
|
2794
2794
|
}
|
2795
|
-
|
2796
|
-
SWIGINTERN int
|
2797
|
-
SWIG_AsVal_bool (VALUE obj, bool *val)
|
2798
|
-
{
|
2799
|
-
if (obj == Qtrue) {
|
2800
|
-
if (val) *val = true;
|
2801
|
-
return SWIG_OK;
|
2802
|
-
} else if (obj == Qfalse) {
|
2803
|
-
if (val) *val = false;
|
2804
|
-
return SWIG_OK;
|
2805
|
-
} else {
|
2806
|
-
int res = 0;
|
2807
|
-
if (SWIG_AsVal_int (obj, &res) == SWIG_OK) {
|
2808
|
-
if (val) *val = res ? true : false;
|
2809
|
-
return SWIG_OK;
|
2810
|
-
}
|
2811
|
-
}
|
2812
|
-
return SWIG_TypeError;
|
2813
|
-
}
|
2814
|
-
|
2815
|
-
SWIGINTERN Gosu::Image *new_Gosu_Image__SWIG_1(Gosu::Window &window,VALUE source,bool tileable=false){
|
2816
|
-
Gosu::Bitmap bmp;
|
2817
|
-
Gosu::loadBitmap(bmp, source);
|
2818
|
-
return new Gosu::Image(bmp, tileable ? Gosu::ifTileable : Gosu::ifSmooth);
|
2819
|
-
}
|
2820
|
-
SWIGINTERN Gosu::Image *new_Gosu_Image__SWIG_2(Gosu::Window &window,VALUE source,bool tileable,unsigned int srcX,unsigned int srcY,unsigned int srcWidth,unsigned int srcHeight){
|
2821
|
-
Gosu::Bitmap bmp;
|
2822
|
-
Gosu::loadBitmap(bmp, source);
|
2823
|
-
return new Gosu::Image(bmp, srcX, srcY, srcWidth, srcHeight,
|
2824
|
-
tileable ? Gosu::ifTileable : Gosu::ifSmooth);
|
2825
|
-
}
|
2826
2795
|
SWIGINTERN void Gosu_Image_drawAsQuad(Gosu::Image *self,double x1,double y1,Gosu::Color c1,double x2,double y2,Gosu::Color c2,double x3,double y3,Gosu::Color c3,double x4,double y4,Gosu::Color c4,Gosu::ZPos z,Gosu::AlphaMode mode=Gosu::amDefault){
|
2827
2796
|
self->getData().draw(x1, y1, c1, x2, y2, c2, x3, y3, c3, x4, y4, c4, z, mode);
|
2828
2797
|
}
|
@@ -2934,6 +2903,26 @@ SWIGINTERN std::vector< Gosu::Image > Gosu_Image_loadTiles__SWIG_0(VALUE source,
|
|
2934
2903
|
}
|
2935
2904
|
return Gosu::loadTiles(bmp, tileWidth, tileHeight, flags);
|
2936
2905
|
}
|
2906
|
+
|
2907
|
+
SWIGINTERN int
|
2908
|
+
SWIG_AsVal_bool (VALUE obj, bool *val)
|
2909
|
+
{
|
2910
|
+
if (obj == Qtrue) {
|
2911
|
+
if (val) *val = true;
|
2912
|
+
return SWIG_OK;
|
2913
|
+
} else if (obj == Qfalse) {
|
2914
|
+
if (val) *val = false;
|
2915
|
+
return SWIG_OK;
|
2916
|
+
} else {
|
2917
|
+
int res = 0;
|
2918
|
+
if (SWIG_AsVal_int (obj, &res) == SWIG_OK) {
|
2919
|
+
if (val) *val = res ? true : false;
|
2920
|
+
return SWIG_OK;
|
2921
|
+
}
|
2922
|
+
}
|
2923
|
+
return SWIG_TypeError;
|
2924
|
+
}
|
2925
|
+
|
2937
2926
|
SWIGINTERN std::vector< Gosu::Image > Gosu_Image_loadTiles__SWIG_1(Gosu::Window &window,VALUE source,int tileWidth,int tileHeight,bool tileable){
|
2938
2927
|
Gosu::Bitmap bmp;
|
2939
2928
|
Gosu::loadBitmap(bmp, source);
|
@@ -6430,81 +6419,6 @@ fail:
|
|
6430
6419
|
}
|
6431
6420
|
|
6432
6421
|
|
6433
|
-
SWIGINTERN VALUE
|
6434
|
-
_wrap_new_Image__SWIG_0(int argc, VALUE *argv, VALUE self) {
|
6435
|
-
VALUE arg1 = (VALUE) 0 ;
|
6436
|
-
VALUE arg2 = (VALUE) 0 ;
|
6437
|
-
const char *classname SWIGUNUSED = "Gosu::Image";
|
6438
|
-
Gosu::Image *result = 0 ;
|
6439
|
-
|
6440
|
-
if ((argc < 1) || (argc > 2)) {
|
6441
|
-
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
6442
|
-
}
|
6443
|
-
arg1 = argv[0];
|
6444
|
-
if (argc > 1) {
|
6445
|
-
arg2 = argv[1];
|
6446
|
-
}
|
6447
|
-
{
|
6448
|
-
try {
|
6449
|
-
result = (Gosu::Image *)new_Gosu_Image__SWIG_0(arg1,arg2);
|
6450
|
-
DATA_PTR(self) = result;
|
6451
|
-
SWIG_RubyAddTracking(result, self);
|
6452
|
-
} catch (const std::exception& e) {
|
6453
|
-
SWIG_exception(SWIG_RuntimeError, e.what());
|
6454
|
-
}
|
6455
|
-
}
|
6456
|
-
return self;
|
6457
|
-
fail:
|
6458
|
-
return Qnil;
|
6459
|
-
}
|
6460
|
-
|
6461
|
-
|
6462
|
-
SWIGINTERN VALUE
|
6463
|
-
_wrap_new_Image__SWIG_1(int argc, VALUE *argv, VALUE self) {
|
6464
|
-
Gosu::Window *arg1 = 0 ;
|
6465
|
-
VALUE arg2 = (VALUE) 0 ;
|
6466
|
-
bool arg3 = (bool) false ;
|
6467
|
-
void *argp1 = 0 ;
|
6468
|
-
int res1 = 0 ;
|
6469
|
-
bool val3 ;
|
6470
|
-
int ecode3 = 0 ;
|
6471
|
-
const char *classname SWIGUNUSED = "Gosu::Image";
|
6472
|
-
Gosu::Image *result = 0 ;
|
6473
|
-
|
6474
|
-
if ((argc < 2) || (argc > 3)) {
|
6475
|
-
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
6476
|
-
}
|
6477
|
-
res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Gosu__Window, 0 );
|
6478
|
-
if (!SWIG_IsOK(res1)) {
|
6479
|
-
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window &","Image", 1, argv[0] ));
|
6480
|
-
}
|
6481
|
-
if (!argp1) {
|
6482
|
-
SWIG_exception_fail(SWIG_ValueError, Ruby_Format_TypeError("invalid null reference ", "Gosu::Window &","Image", 1, argv[0]));
|
6483
|
-
}
|
6484
|
-
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
6485
|
-
arg2 = argv[1];
|
6486
|
-
if (argc > 2) {
|
6487
|
-
ecode3 = SWIG_AsVal_bool(argv[2], &val3);
|
6488
|
-
if (!SWIG_IsOK(ecode3)) {
|
6489
|
-
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","Image", 3, argv[2] ));
|
6490
|
-
}
|
6491
|
-
arg3 = static_cast< bool >(val3);
|
6492
|
-
}
|
6493
|
-
{
|
6494
|
-
try {
|
6495
|
-
result = (Gosu::Image *)new_Gosu_Image__SWIG_1(*arg1,arg2,arg3);
|
6496
|
-
DATA_PTR(self) = result;
|
6497
|
-
SWIG_RubyAddTracking(result, self);
|
6498
|
-
} catch (const std::exception& e) {
|
6499
|
-
SWIG_exception(SWIG_RuntimeError, e.what());
|
6500
|
-
}
|
6501
|
-
}
|
6502
|
-
return self;
|
6503
|
-
fail:
|
6504
|
-
return Qnil;
|
6505
|
-
}
|
6506
|
-
|
6507
|
-
|
6508
6422
|
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
|
6509
6423
|
SWIGINTERN VALUE
|
6510
6424
|
_wrap_Image_allocate(VALUE self) {
|
@@ -6523,69 +6437,22 @@ _wrap_Image_allocate(VALUE self) {
|
|
6523
6437
|
|
6524
6438
|
|
6525
6439
|
SWIGINTERN VALUE
|
6526
|
-
|
6527
|
-
|
6440
|
+
_wrap_new_Image(int argc, VALUE *argv, VALUE self) {
|
6441
|
+
VALUE arg1 = (VALUE) 0 ;
|
6528
6442
|
VALUE arg2 = (VALUE) 0 ;
|
6529
|
-
bool arg3 ;
|
6530
|
-
unsigned int arg4 ;
|
6531
|
-
unsigned int arg5 ;
|
6532
|
-
unsigned int arg6 ;
|
6533
|
-
unsigned int arg7 ;
|
6534
|
-
void *argp1 = 0 ;
|
6535
|
-
int res1 = 0 ;
|
6536
|
-
bool val3 ;
|
6537
|
-
int ecode3 = 0 ;
|
6538
|
-
unsigned int val4 ;
|
6539
|
-
int ecode4 = 0 ;
|
6540
|
-
unsigned int val5 ;
|
6541
|
-
int ecode5 = 0 ;
|
6542
|
-
unsigned int val6 ;
|
6543
|
-
int ecode6 = 0 ;
|
6544
|
-
unsigned int val7 ;
|
6545
|
-
int ecode7 = 0 ;
|
6546
6443
|
const char *classname SWIGUNUSED = "Gosu::Image";
|
6547
6444
|
Gosu::Image *result = 0 ;
|
6548
6445
|
|
6549
|
-
if ((argc <
|
6550
|
-
rb_raise(rb_eArgError, "wrong # of arguments(%d for
|
6551
|
-
}
|
6552
|
-
res1 = SWIG_ConvertPtr(argv[0], &argp1, SWIGTYPE_p_Gosu__Window, 0 );
|
6553
|
-
if (!SWIG_IsOK(res1)) {
|
6554
|
-
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "Gosu::Window &","Image", 1, argv[0] ));
|
6446
|
+
if ((argc < 1) || (argc > 2)) {
|
6447
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
6555
6448
|
}
|
6556
|
-
|
6557
|
-
|
6449
|
+
arg1 = argv[0];
|
6450
|
+
if (argc > 1) {
|
6451
|
+
arg2 = argv[1];
|
6558
6452
|
}
|
6559
|
-
arg1 = reinterpret_cast< Gosu::Window * >(argp1);
|
6560
|
-
arg2 = argv[1];
|
6561
|
-
ecode3 = SWIG_AsVal_bool(argv[2], &val3);
|
6562
|
-
if (!SWIG_IsOK(ecode3)) {
|
6563
|
-
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "bool","Image", 3, argv[2] ));
|
6564
|
-
}
|
6565
|
-
arg3 = static_cast< bool >(val3);
|
6566
|
-
ecode4 = SWIG_AsVal_unsigned_SS_int(argv[3], &val4);
|
6567
|
-
if (!SWIG_IsOK(ecode4)) {
|
6568
|
-
SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned int","Image", 4, argv[3] ));
|
6569
|
-
}
|
6570
|
-
arg4 = static_cast< unsigned int >(val4);
|
6571
|
-
ecode5 = SWIG_AsVal_unsigned_SS_int(argv[4], &val5);
|
6572
|
-
if (!SWIG_IsOK(ecode5)) {
|
6573
|
-
SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "unsigned int","Image", 5, argv[4] ));
|
6574
|
-
}
|
6575
|
-
arg5 = static_cast< unsigned int >(val5);
|
6576
|
-
ecode6 = SWIG_AsVal_unsigned_SS_int(argv[5], &val6);
|
6577
|
-
if (!SWIG_IsOK(ecode6)) {
|
6578
|
-
SWIG_exception_fail(SWIG_ArgError(ecode6), Ruby_Format_TypeError( "", "unsigned int","Image", 6, argv[5] ));
|
6579
|
-
}
|
6580
|
-
arg6 = static_cast< unsigned int >(val6);
|
6581
|
-
ecode7 = SWIG_AsVal_unsigned_SS_int(argv[6], &val7);
|
6582
|
-
if (!SWIG_IsOK(ecode7)) {
|
6583
|
-
SWIG_exception_fail(SWIG_ArgError(ecode7), Ruby_Format_TypeError( "", "unsigned int","Image", 7, argv[6] ));
|
6584
|
-
}
|
6585
|
-
arg7 = static_cast< unsigned int >(val7);
|
6586
6453
|
{
|
6587
6454
|
try {
|
6588
|
-
result = (Gosu::Image *)
|
6455
|
+
result = (Gosu::Image *)new_Gosu_Image(arg1,arg2);
|
6589
6456
|
DATA_PTR(self) = result;
|
6590
6457
|
SWIG_RubyAddTracking(result, self);
|
6591
6458
|
} catch (const std::exception& e) {
|
@@ -6598,103 +6465,6 @@ fail:
|
|
6598
6465
|
}
|
6599
6466
|
|
6600
6467
|
|
6601
|
-
SWIGINTERN VALUE _wrap_new_Image(int nargs, VALUE *args, VALUE self) {
|
6602
|
-
int argc;
|
6603
|
-
VALUE argv[7];
|
6604
|
-
int ii;
|
6605
|
-
|
6606
|
-
argc = nargs;
|
6607
|
-
if (argc > 7) SWIG_fail;
|
6608
|
-
for (ii = 0; (ii < argc); ++ii) {
|
6609
|
-
argv[ii] = args[ii];
|
6610
|
-
}
|
6611
|
-
if ((argc >= 1) && (argc <= 2)) {
|
6612
|
-
int _v;
|
6613
|
-
_v = (argv[0] != 0);
|
6614
|
-
if (_v) {
|
6615
|
-
if (argc <= 1) {
|
6616
|
-
return _wrap_new_Image__SWIG_0(nargs, args, self);
|
6617
|
-
}
|
6618
|
-
_v = (argv[1] != 0);
|
6619
|
-
if (_v) {
|
6620
|
-
return _wrap_new_Image__SWIG_0(nargs, args, self);
|
6621
|
-
}
|
6622
|
-
}
|
6623
|
-
}
|
6624
|
-
if ((argc >= 2) && (argc <= 3)) {
|
6625
|
-
int _v;
|
6626
|
-
void *vptr = 0;
|
6627
|
-
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Window, 0);
|
6628
|
-
_v = SWIG_CheckState(res);
|
6629
|
-
if (_v) {
|
6630
|
-
_v = (argv[1] != 0);
|
6631
|
-
if (_v) {
|
6632
|
-
if (argc <= 2) {
|
6633
|
-
return _wrap_new_Image__SWIG_1(nargs, args, self);
|
6634
|
-
}
|
6635
|
-
{
|
6636
|
-
int res = SWIG_AsVal_bool(argv[2], NULL);
|
6637
|
-
_v = SWIG_CheckState(res);
|
6638
|
-
}
|
6639
|
-
if (_v) {
|
6640
|
-
return _wrap_new_Image__SWIG_1(nargs, args, self);
|
6641
|
-
}
|
6642
|
-
}
|
6643
|
-
}
|
6644
|
-
}
|
6645
|
-
if (argc == 7) {
|
6646
|
-
int _v;
|
6647
|
-
void *vptr = 0;
|
6648
|
-
int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_Gosu__Window, 0);
|
6649
|
-
_v = SWIG_CheckState(res);
|
6650
|
-
if (_v) {
|
6651
|
-
_v = (argv[1] != 0);
|
6652
|
-
if (_v) {
|
6653
|
-
{
|
6654
|
-
int res = SWIG_AsVal_bool(argv[2], NULL);
|
6655
|
-
_v = SWIG_CheckState(res);
|
6656
|
-
}
|
6657
|
-
if (_v) {
|
6658
|
-
{
|
6659
|
-
int res = SWIG_AsVal_unsigned_SS_int(argv[3], NULL);
|
6660
|
-
_v = SWIG_CheckState(res);
|
6661
|
-
}
|
6662
|
-
if (_v) {
|
6663
|
-
{
|
6664
|
-
int res = SWIG_AsVal_unsigned_SS_int(argv[4], NULL);
|
6665
|
-
_v = SWIG_CheckState(res);
|
6666
|
-
}
|
6667
|
-
if (_v) {
|
6668
|
-
{
|
6669
|
-
int res = SWIG_AsVal_unsigned_SS_int(argv[5], NULL);
|
6670
|
-
_v = SWIG_CheckState(res);
|
6671
|
-
}
|
6672
|
-
if (_v) {
|
6673
|
-
{
|
6674
|
-
int res = SWIG_AsVal_unsigned_SS_int(argv[6], NULL);
|
6675
|
-
_v = SWIG_CheckState(res);
|
6676
|
-
}
|
6677
|
-
if (_v) {
|
6678
|
-
return _wrap_new_Image__SWIG_2(nargs, args, self);
|
6679
|
-
}
|
6680
|
-
}
|
6681
|
-
}
|
6682
|
-
}
|
6683
|
-
}
|
6684
|
-
}
|
6685
|
-
}
|
6686
|
-
}
|
6687
|
-
|
6688
|
-
fail:
|
6689
|
-
Ruby_Format_OverloadedError( argc, 7, "Image.new",
|
6690
|
-
" Image.new(VALUE source, VALUE options)\n"
|
6691
|
-
" Image.new(Gosu::Window &window, VALUE source, bool tileable)\n"
|
6692
|
-
" Image.new(Gosu::Window &window, VALUE source, bool tileable, unsigned int srcX, unsigned int srcY, unsigned int srcWidth, unsigned int srcHeight)\n");
|
6693
|
-
|
6694
|
-
return Qnil;
|
6695
|
-
}
|
6696
|
-
|
6697
|
-
|
6698
6468
|
SWIGINTERN VALUE
|
6699
6469
|
_wrap_Image_draw_as_quad(int argc, VALUE *argv, VALUE self) {
|
6700
6470
|
Gosu::Image *arg1 = (Gosu::Image *) 0 ;
|
@@ -11169,8 +10939,8 @@ SWIGEXPORT void Init_gosu(void) {
|
|
11169
10939
|
SWIG_RubyInitializeTrackings();
|
11170
10940
|
rb_define_const(mGosu, "MAJOR_VERSION", SWIG_From_int(static_cast< int >(0)));
|
11171
10941
|
rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(10)));
|
11172
|
-
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(
|
11173
|
-
rb_define_const(mGosu, "VERSION", SWIG_FromCharPtr("0.10.
|
10942
|
+
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(4)));
|
10943
|
+
rb_define_const(mGosu, "VERSION", SWIG_FromCharPtr("0.10.4"));
|
11174
10944
|
rb_define_const(mGosu, "GOSU_COPYRIGHT_NOTICE", SWIG_FromCharPtr("This software uses the following third-party libraries:\n\nGosu, http://www.libgosu.org, MIT License, http://opensource.org/licenses/MIT\nSDL 2, http://www.libsdl.org, MIT License, http://opensource.org/licenses/MIT\nlibsndfile, http://www.mega-nerd.com/libsndfile, GNU LGPL 3, http://www.gnu.org/copyleft/lesser.html\nOpenAL Soft, http://kcat.strangesoft.net/openal.html, GNU LGPL 2, http://www.gnu.org/licenses/old-licenses/lgpl-2.0.html\n"));
|
11175
10945
|
rb_define_module_function(mGosu, "milliseconds", VALUEFUNC(_wrap_milliseconds), -1);
|
11176
10946
|
rb_define_module_function(mGosu, "random", VALUEFUNC(_wrap_random), -1);
|
data/lib/gosu/patches.rb
CHANGED
@@ -25,8 +25,22 @@ module Gosu::Button
|
|
25
25
|
end
|
26
26
|
|
27
27
|
# Backwards compatibility:
|
28
|
-
#
|
28
|
+
# Passing a Window to initialize and from_text has been deprecated in Gosu 0.9.
|
29
29
|
class Gosu::Image
|
30
|
+
alias initialize_without_window initialize
|
31
|
+
|
32
|
+
def initialize(*args)
|
33
|
+
if args[0].is_a? Gosu::Window then
|
34
|
+
if args.size == 7 then
|
35
|
+
initialize_without_window args[1], :tileable => args[2], :rect => args[3..-1]
|
36
|
+
else
|
37
|
+
initialize_without_window args[1], :tileable => args[2]
|
38
|
+
end
|
39
|
+
else
|
40
|
+
initialize_without_window(*args)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
30
44
|
class << self
|
31
45
|
alias from_text_without_window from_text
|
32
46
|
end
|
@@ -44,7 +58,7 @@ class Gosu::Image
|
|
44
58
|
end
|
45
59
|
|
46
60
|
# Backwards compatibility:
|
47
|
-
# Passing a Window Sample#initialize has been deprecated in Gosu 0.7.17.
|
61
|
+
# Passing a Window to Sample#initialize has been deprecated in Gosu 0.7.17.
|
48
62
|
class Gosu::Sample
|
49
63
|
alias initialize_without_window initialize
|
50
64
|
|
data/rdoc/gosu.rb
CHANGED
@@ -390,14 +390,38 @@ module Gosu
|
|
390
390
|
# @option options [true, false] :tileable (false) if true, the Image will not have soft edges when scaled
|
391
391
|
# @option options [true, false] :retro (false) if true, the image will not be interpolated when it is scaled up or down. When :retro it set, :tileable has no effect.
|
392
392
|
#
|
393
|
-
# @overload
|
394
|
-
# @overload
|
393
|
+
# @overload load_tiles(source, tile_width, tile_height, options = {})
|
394
|
+
# @overload load_tiles(window, source, tile_width, tile_height, tileable)
|
395
395
|
#
|
396
396
|
# (Passing a Window reference is not necessary anymore, please use the first overload from now on.)
|
397
397
|
#
|
398
398
|
# @see https://github.com/gosu/gosu/wiki/Basic-Concepts#tileability Tileability explained in the Gosu Wiki
|
399
399
|
def self.load_tiles(source, tile_width, tile_height, options = {}); end
|
400
400
|
|
401
|
+
##
|
402
|
+
# EXPERIMENTAL - MAY DISAPPEAR WITHOUT WARNING.
|
403
|
+
#
|
404
|
+
# Returns an image that is a smaller, rectangular view of this {Image}.
|
405
|
+
#
|
406
|
+
# This is a very fast operation, and no new textures are allocated.
|
407
|
+
# If you update this {Image} or the {#subimage} using {#insert}, the other {Image} will be affected as well.
|
408
|
+
#
|
409
|
+
# This method can be used to load texture atlases created with third-party tools.
|
410
|
+
# The texture atlas must be a power of two (512x512 or 1024x1024) and loaded with :tileable => true.
|
411
|
+
# The individual {Image}s can then be loaded efficiently with {#subimage}.
|
412
|
+
# {#gl_tex_info} will work on a {#subimage}.
|
413
|
+
#
|
414
|
+
# Caveats:
|
415
|
+
# * {#subimage} only works if the image lives on a single texture.
|
416
|
+
# If the image was too large and had to be split up into several OpenGL textures, subimage will return nil (same as {#gl_tex_info}).
|
417
|
+
# * If you stretch or rotate a {#subimage}, the pixels adjacent to it might bleed into it, as Gosu does not manage the 'tileability' of subimages.
|
418
|
+
#
|
419
|
+
# If you find a good way to use {#subimage}, please let us know on the forum and we can make this a part of Gosu's stable interface.
|
420
|
+
# Thank you!
|
421
|
+
#
|
422
|
+
# @return [Image?] an image that represents a portion of the containing image
|
423
|
+
def subimage(left, top, width, height); end
|
424
|
+
|
401
425
|
# @!endgroup
|
402
426
|
|
403
427
|
# @!group Drawing an image
|
@@ -744,15 +768,17 @@ module Gosu
|
|
744
768
|
def show; end
|
745
769
|
|
746
770
|
##
|
747
|
-
# EXPERIMENTAL - MAY DISAPPEAR WITHOUT WARNING
|
748
|
-
#
|
749
|
-
#
|
771
|
+
# EXPERIMENTAL - MAY DISAPPEAR WITHOUT WARNING.
|
772
|
+
#
|
773
|
+
# Performs a single step in the main loop.
|
774
|
+
# This can be useful for integrating Gosu with other libraries that have their own main loop, e.g. Ruby/Tk.
|
750
775
|
#
|
751
776
|
# See: https://www.libgosu.org/cgi-bin/mwf/topic_show.pl?tid=1218
|
752
777
|
#
|
753
|
-
# If you find a good way to use
|
778
|
+
# If you find a good way to use {#tick}, please let us know on the forum and we can make this a part of Gosu's stable interface.
|
779
|
+
# Thank you!
|
754
780
|
#
|
755
|
-
# @return [true, false] whether the Window should still be shown after this tick
|
781
|
+
# @return [true, false] whether the {Window} should still be shown after this tick
|
756
782
|
def tick; end
|
757
783
|
|
758
784
|
##
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gosu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.10.
|
4
|
+
version: 0.10.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Julian Raschke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
2D game development library.
|