gosu 0.7.32 → 0.7.33
Sign up to get free protection for your applications and to get access to all the features.
- data/Gosu/Version.hpp +2 -2
- data/GosuImpl/Graphics/BitmapGDIplus.cpp +4 -0
- data/GosuImpl/RubyGosu.swg +20 -10
- data/GosuImpl/RubyGosu_wrap.cxx +324 -196
- data/lib/gosu/swig_patches.rb +3 -2
- metadata +4 -4
data/Gosu/Version.hpp
CHANGED
@@ -3,8 +3,8 @@
|
|
3
3
|
|
4
4
|
#define GOSU_MAJOR_VERSION 0
|
5
5
|
#define GOSU_MINOR_VERSION 7
|
6
|
-
#define GOSU_POINT_VERSION
|
7
|
-
#define GOSU_VERSION "0.7.
|
6
|
+
#define GOSU_POINT_VERSION 33
|
7
|
+
#define GOSU_VERSION "0.7.33"
|
8
8
|
|
9
9
|
#define GOSU_COPYRIGHT_NOTICE \
|
10
10
|
"May contain `ogg', `vorbis' libraries (c) 2002-2008 Xiph.org Foundation" \
|
@@ -165,6 +165,8 @@ Gosu::Bitmap Gosu::loadImageFile(Reader reader)
|
|
165
165
|
|
166
166
|
void Gosu::saveImageFile(const Bitmap& bitmap, const std::wstring& filename)
|
167
167
|
{
|
168
|
+
requireGDIplus();
|
169
|
+
|
168
170
|
Bitmap input = bitmap;
|
169
171
|
if (boost::iends_with(filename, "bmp"))
|
170
172
|
unapplyColorKey(input, Color::FUCHSIA);
|
@@ -179,6 +181,8 @@ void Gosu::saveImageFile(const Bitmap& bitmap, const std::wstring& filename)
|
|
179
181
|
|
180
182
|
void Gosu::saveImageFile(const Bitmap& bitmap, Writer writer, const std::wstring& formatHint)
|
181
183
|
{
|
184
|
+
requireGDIplus();
|
185
|
+
|
182
186
|
Bitmap input = bitmap;
|
183
187
|
if (boost::iends_with(formatHint, "bmp"))
|
184
188
|
unapplyColorKey(input, Color::FUCHSIA);
|
data/GosuImpl/RubyGosu.swg
CHANGED
@@ -83,7 +83,9 @@
|
|
83
83
|
%typemap(in) Gosu::AlphaMode {
|
84
84
|
const char* cstr = Gosu::cstrFromSymbol($input);
|
85
85
|
|
86
|
-
if (!
|
86
|
+
if (!cstr)
|
87
|
+
SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol");
|
88
|
+
else if (!strcmp(cstr, "default"))
|
87
89
|
$1 = Gosu::amDefault;
|
88
90
|
else if (!strcmp(cstr, "additive"))
|
89
91
|
$1 = Gosu::amAdditive;
|
@@ -95,7 +97,9 @@
|
|
95
97
|
%typemap(in) Gosu::TextAlign {
|
96
98
|
const char* cstr = Gosu::cstrFromSymbol($input);
|
97
99
|
|
98
|
-
if (!
|
100
|
+
if (!cstr)
|
101
|
+
SWIG_exception_fail(SWIG_ValueError, "text align must be a symbol");
|
102
|
+
else if (!strcmp(cstr, "left"))
|
99
103
|
$1 = Gosu::taLeft;
|
100
104
|
else if (!strcmp(cstr, "center"))
|
101
105
|
$1 = Gosu::taCenter;
|
@@ -109,15 +113,19 @@
|
|
109
113
|
|
110
114
|
// Allow integral constants to be passed in place of Color values.
|
111
115
|
%typemap(in) Gosu::Color {
|
112
|
-
|
113
|
-
int res = SWIG_ConvertPtr($input, &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
114
|
-
if (!SWIG_IsOK(res))
|
115
|
-
// TODO: error checking
|
116
|
+
if (TYPE($input) == T_FIXNUM || TYPE($input) == T_BIGNUM)
|
116
117
|
$1 = Gosu::Color(NUM2UINT($input));
|
117
|
-
else if (!ptr)
|
118
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
119
118
|
else
|
120
|
-
|
119
|
+
{
|
120
|
+
void* ptr;
|
121
|
+
int res = SWIG_ConvertPtr($input, &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
122
|
+
if (!SWIG_IsOK(res))
|
123
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
124
|
+
else if (!ptr)
|
125
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
126
|
+
else
|
127
|
+
$1 = *reinterpret_cast<Gosu::Color*>(ptr);
|
128
|
+
}
|
121
129
|
}
|
122
130
|
|
123
131
|
// Allow integral constants to be passed in place of Color values.
|
@@ -291,7 +299,9 @@ namespace Gosu
|
|
291
299
|
}
|
292
300
|
|
293
301
|
const char* cstrFromSymbol(VALUE symbol) {
|
294
|
-
|
302
|
+
if (TYPE(symbol) != T_SYMBOL)
|
303
|
+
return 0; // to be caught by the caller
|
304
|
+
return rb_id2name(SYM2ID(symbol));
|
295
305
|
}
|
296
306
|
}
|
297
307
|
%}
|
data/GosuImpl/RubyGosu_wrap.cxx
CHANGED
@@ -2359,7 +2359,9 @@ namespace Gosu
|
|
2359
2359
|
}
|
2360
2360
|
|
2361
2361
|
const char* cstrFromSymbol(VALUE symbol) {
|
2362
|
-
|
2362
|
+
if (TYPE(symbol) != T_SYMBOL)
|
2363
|
+
return 0; // to be caught by the caller
|
2364
|
+
return rb_id2name(SYM2ID(symbol));
|
2363
2365
|
}
|
2364
2366
|
}
|
2365
2367
|
|
@@ -5152,26 +5154,34 @@ _wrap_interpolate(int argc, VALUE *argv, VALUE self) {
|
|
5152
5154
|
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
5153
5155
|
}
|
5154
5156
|
{
|
5155
|
-
|
5156
|
-
int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5157
|
-
if (!SWIG_IsOK(res))
|
5158
|
-
// TODO: error checking
|
5157
|
+
if (TYPE(argv[0]) == T_FIXNUM || TYPE(argv[0]) == T_BIGNUM)
|
5159
5158
|
arg1 = Gosu::Color(NUM2UINT(argv[0]));
|
5160
|
-
else if (!ptr)
|
5161
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5162
5159
|
else
|
5163
|
-
|
5160
|
+
{
|
5161
|
+
void* ptr;
|
5162
|
+
int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5163
|
+
if (!SWIG_IsOK(res))
|
5164
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
5165
|
+
else if (!ptr)
|
5166
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5167
|
+
else
|
5168
|
+
arg1 = *reinterpret_cast<Gosu::Color*>(ptr);
|
5169
|
+
}
|
5164
5170
|
}
|
5165
5171
|
{
|
5166
|
-
|
5167
|
-
int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5168
|
-
if (!SWIG_IsOK(res))
|
5169
|
-
// TODO: error checking
|
5172
|
+
if (TYPE(argv[1]) == T_FIXNUM || TYPE(argv[1]) == T_BIGNUM)
|
5170
5173
|
arg2 = Gosu::Color(NUM2UINT(argv[1]));
|
5171
|
-
else if (!ptr)
|
5172
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5173
5174
|
else
|
5174
|
-
|
5175
|
+
{
|
5176
|
+
void* ptr;
|
5177
|
+
int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5178
|
+
if (!SWIG_IsOK(res))
|
5179
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
5180
|
+
else if (!ptr)
|
5181
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5182
|
+
else
|
5183
|
+
arg2 = *reinterpret_cast<Gosu::Color*>(ptr);
|
5184
|
+
}
|
5175
5185
|
}
|
5176
5186
|
if (argc > 2) {
|
5177
5187
|
ecode3 = SWIG_AsVal_double(argv[2], &val3);
|
@@ -5205,26 +5215,34 @@ _wrap_multiply(int argc, VALUE *argv, VALUE self) {
|
|
5205
5215
|
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
5206
5216
|
}
|
5207
5217
|
{
|
5208
|
-
|
5209
|
-
int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5210
|
-
if (!SWIG_IsOK(res))
|
5211
|
-
// TODO: error checking
|
5218
|
+
if (TYPE(argv[0]) == T_FIXNUM || TYPE(argv[0]) == T_BIGNUM)
|
5212
5219
|
arg1 = Gosu::Color(NUM2UINT(argv[0]));
|
5213
|
-
else if (!ptr)
|
5214
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5215
5220
|
else
|
5216
|
-
|
5221
|
+
{
|
5222
|
+
void* ptr;
|
5223
|
+
int res = SWIG_ConvertPtr(argv[0], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5224
|
+
if (!SWIG_IsOK(res))
|
5225
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
5226
|
+
else if (!ptr)
|
5227
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5228
|
+
else
|
5229
|
+
arg1 = *reinterpret_cast<Gosu::Color*>(ptr);
|
5230
|
+
}
|
5217
5231
|
}
|
5218
5232
|
{
|
5219
|
-
|
5220
|
-
int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5221
|
-
if (!SWIG_IsOK(res))
|
5222
|
-
// TODO: error checking
|
5233
|
+
if (TYPE(argv[1]) == T_FIXNUM || TYPE(argv[1]) == T_BIGNUM)
|
5223
5234
|
arg2 = Gosu::Color(NUM2UINT(argv[1]));
|
5224
|
-
else if (!ptr)
|
5225
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5226
5235
|
else
|
5227
|
-
|
5236
|
+
{
|
5237
|
+
void* ptr;
|
5238
|
+
int res = SWIG_ConvertPtr(argv[1], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5239
|
+
if (!SWIG_IsOK(res))
|
5240
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
5241
|
+
else if (!ptr)
|
5242
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5243
|
+
else
|
5244
|
+
arg2 = *reinterpret_cast<Gosu::Color*>(ptr);
|
5245
|
+
}
|
5228
5246
|
}
|
5229
5247
|
{
|
5230
5248
|
try {
|
@@ -5550,22 +5568,28 @@ _wrap_Font_draw(int argc, VALUE *argv, VALUE self) {
|
|
5550
5568
|
}
|
5551
5569
|
if (argc > 6) {
|
5552
5570
|
{
|
5553
|
-
|
5554
|
-
int res = SWIG_ConvertPtr(argv[6], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5555
|
-
if (!SWIG_IsOK(res))
|
5556
|
-
// TODO: error checking
|
5571
|
+
if (TYPE(argv[6]) == T_FIXNUM || TYPE(argv[6]) == T_BIGNUM)
|
5557
5572
|
arg8 = Gosu::Color(NUM2UINT(argv[6]));
|
5558
|
-
else if (!ptr)
|
5559
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5560
5573
|
else
|
5561
|
-
|
5574
|
+
{
|
5575
|
+
void* ptr;
|
5576
|
+
int res = SWIG_ConvertPtr(argv[6], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5577
|
+
if (!SWIG_IsOK(res))
|
5578
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
5579
|
+
else if (!ptr)
|
5580
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5581
|
+
else
|
5582
|
+
arg8 = *reinterpret_cast<Gosu::Color*>(ptr);
|
5583
|
+
}
|
5562
5584
|
}
|
5563
5585
|
}
|
5564
5586
|
if (argc > 7) {
|
5565
5587
|
{
|
5566
5588
|
const char* cstr = Gosu::cstrFromSymbol(argv[7]);
|
5567
5589
|
|
5568
|
-
if (!
|
5590
|
+
if (!cstr)
|
5591
|
+
SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol");
|
5592
|
+
else if (!strcmp(cstr, "default"))
|
5569
5593
|
arg9 = Gosu::amDefault;
|
5570
5594
|
else if (!strcmp(cstr, "additive"))
|
5571
5595
|
arg9 = Gosu::amAdditive;
|
@@ -5673,22 +5697,28 @@ _wrap_Font_draw_rel(int argc, VALUE *argv, VALUE self) {
|
|
5673
5697
|
}
|
5674
5698
|
if (argc > 8) {
|
5675
5699
|
{
|
5676
|
-
|
5677
|
-
int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5678
|
-
if (!SWIG_IsOK(res))
|
5679
|
-
// TODO: error checking
|
5700
|
+
if (TYPE(argv[8]) == T_FIXNUM || TYPE(argv[8]) == T_BIGNUM)
|
5680
5701
|
arg10 = Gosu::Color(NUM2UINT(argv[8]));
|
5681
|
-
else if (!ptr)
|
5682
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5683
5702
|
else
|
5684
|
-
|
5703
|
+
{
|
5704
|
+
void* ptr;
|
5705
|
+
int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5706
|
+
if (!SWIG_IsOK(res))
|
5707
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
5708
|
+
else if (!ptr)
|
5709
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5710
|
+
else
|
5711
|
+
arg10 = *reinterpret_cast<Gosu::Color*>(ptr);
|
5712
|
+
}
|
5685
5713
|
}
|
5686
5714
|
}
|
5687
5715
|
if (argc > 9) {
|
5688
5716
|
{
|
5689
5717
|
const char* cstr = Gosu::cstrFromSymbol(argv[9]);
|
5690
5718
|
|
5691
|
-
if (!
|
5719
|
+
if (!cstr)
|
5720
|
+
SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol");
|
5721
|
+
else if (!strcmp(cstr, "default"))
|
5692
5722
|
arg11 = Gosu::amDefault;
|
5693
5723
|
else if (!strcmp(cstr, "additive"))
|
5694
5724
|
arg11 = Gosu::amAdditive;
|
@@ -5788,22 +5818,28 @@ _wrap_Font_draw_rot(int argc, VALUE *argv, VALUE self) {
|
|
5788
5818
|
}
|
5789
5819
|
if (argc > 7) {
|
5790
5820
|
{
|
5791
|
-
|
5792
|
-
int res = SWIG_ConvertPtr(argv[7], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5793
|
-
if (!SWIG_IsOK(res))
|
5794
|
-
// TODO: error checking
|
5821
|
+
if (TYPE(argv[7]) == T_FIXNUM || TYPE(argv[7]) == T_BIGNUM)
|
5795
5822
|
arg9 = Gosu::Color(NUM2UINT(argv[7]));
|
5796
|
-
else if (!ptr)
|
5797
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5798
5823
|
else
|
5799
|
-
|
5824
|
+
{
|
5825
|
+
void* ptr;
|
5826
|
+
int res = SWIG_ConvertPtr(argv[7], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
5827
|
+
if (!SWIG_IsOK(res))
|
5828
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
5829
|
+
else if (!ptr)
|
5830
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
5831
|
+
else
|
5832
|
+
arg9 = *reinterpret_cast<Gosu::Color*>(ptr);
|
5833
|
+
}
|
5800
5834
|
}
|
5801
5835
|
}
|
5802
5836
|
if (argc > 8) {
|
5803
5837
|
{
|
5804
5838
|
const char* cstr = Gosu::cstrFromSymbol(argv[8]);
|
5805
5839
|
|
5806
|
-
if (!
|
5840
|
+
if (!cstr)
|
5841
|
+
SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol");
|
5842
|
+
else if (!strcmp(cstr, "default"))
|
5807
5843
|
arg10 = Gosu::amDefault;
|
5808
5844
|
else if (!strcmp(cstr, "additive"))
|
5809
5845
|
arg10 = Gosu::amAdditive;
|
@@ -6335,22 +6371,28 @@ _wrap_Image_draw(int argc, VALUE *argv, VALUE self) {
|
|
6335
6371
|
}
|
6336
6372
|
if (argc > 5) {
|
6337
6373
|
{
|
6338
|
-
|
6339
|
-
int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6340
|
-
if (!SWIG_IsOK(res))
|
6341
|
-
// TODO: error checking
|
6374
|
+
if (TYPE(argv[5]) == T_FIXNUM || TYPE(argv[5]) == T_BIGNUM)
|
6342
6375
|
arg7 = Gosu::Color(NUM2UINT(argv[5]));
|
6343
|
-
else if (!ptr)
|
6344
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6345
6376
|
else
|
6346
|
-
|
6377
|
+
{
|
6378
|
+
void* ptr;
|
6379
|
+
int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6380
|
+
if (!SWIG_IsOK(res))
|
6381
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
6382
|
+
else if (!ptr)
|
6383
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6384
|
+
else
|
6385
|
+
arg7 = *reinterpret_cast<Gosu::Color*>(ptr);
|
6386
|
+
}
|
6347
6387
|
}
|
6348
6388
|
}
|
6349
6389
|
if (argc > 6) {
|
6350
6390
|
{
|
6351
6391
|
const char* cstr = Gosu::cstrFromSymbol(argv[6]);
|
6352
6392
|
|
6353
|
-
if (!
|
6393
|
+
if (!cstr)
|
6394
|
+
SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol");
|
6395
|
+
else if (!strcmp(cstr, "default"))
|
6354
6396
|
arg8 = Gosu::amDefault;
|
6355
6397
|
else if (!strcmp(cstr, "additive"))
|
6356
6398
|
arg8 = Gosu::amAdditive;
|
@@ -6433,54 +6475,72 @@ _wrap_Image_draw_mod(int argc, VALUE *argv, VALUE self) {
|
|
6433
6475
|
}
|
6434
6476
|
arg6 = static_cast< double >(val6);
|
6435
6477
|
{
|
6436
|
-
|
6437
|
-
int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6438
|
-
if (!SWIG_IsOK(res))
|
6439
|
-
// TODO: error checking
|
6478
|
+
if (TYPE(argv[5]) == T_FIXNUM || TYPE(argv[5]) == T_BIGNUM)
|
6440
6479
|
arg7 = Gosu::Color(NUM2UINT(argv[5]));
|
6441
|
-
else if (!ptr)
|
6442
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6443
6480
|
else
|
6444
|
-
|
6481
|
+
{
|
6482
|
+
void* ptr;
|
6483
|
+
int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6484
|
+
if (!SWIG_IsOK(res))
|
6485
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
6486
|
+
else if (!ptr)
|
6487
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6488
|
+
else
|
6489
|
+
arg7 = *reinterpret_cast<Gosu::Color*>(ptr);
|
6490
|
+
}
|
6445
6491
|
}
|
6446
6492
|
{
|
6447
|
-
|
6448
|
-
int res = SWIG_ConvertPtr(argv[6], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6449
|
-
if (!SWIG_IsOK(res))
|
6450
|
-
// TODO: error checking
|
6493
|
+
if (TYPE(argv[6]) == T_FIXNUM || TYPE(argv[6]) == T_BIGNUM)
|
6451
6494
|
arg8 = Gosu::Color(NUM2UINT(argv[6]));
|
6452
|
-
else if (!ptr)
|
6453
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6454
6495
|
else
|
6455
|
-
|
6496
|
+
{
|
6497
|
+
void* ptr;
|
6498
|
+
int res = SWIG_ConvertPtr(argv[6], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6499
|
+
if (!SWIG_IsOK(res))
|
6500
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
6501
|
+
else if (!ptr)
|
6502
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6503
|
+
else
|
6504
|
+
arg8 = *reinterpret_cast<Gosu::Color*>(ptr);
|
6505
|
+
}
|
6456
6506
|
}
|
6457
6507
|
{
|
6458
|
-
|
6459
|
-
int res = SWIG_ConvertPtr(argv[7], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6460
|
-
if (!SWIG_IsOK(res))
|
6461
|
-
// TODO: error checking
|
6508
|
+
if (TYPE(argv[7]) == T_FIXNUM || TYPE(argv[7]) == T_BIGNUM)
|
6462
6509
|
arg9 = Gosu::Color(NUM2UINT(argv[7]));
|
6463
|
-
else if (!ptr)
|
6464
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6465
6510
|
else
|
6466
|
-
|
6511
|
+
{
|
6512
|
+
void* ptr;
|
6513
|
+
int res = SWIG_ConvertPtr(argv[7], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6514
|
+
if (!SWIG_IsOK(res))
|
6515
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
6516
|
+
else if (!ptr)
|
6517
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6518
|
+
else
|
6519
|
+
arg9 = *reinterpret_cast<Gosu::Color*>(ptr);
|
6520
|
+
}
|
6467
6521
|
}
|
6468
6522
|
{
|
6469
|
-
|
6470
|
-
int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6471
|
-
if (!SWIG_IsOK(res))
|
6472
|
-
// TODO: error checking
|
6523
|
+
if (TYPE(argv[8]) == T_FIXNUM || TYPE(argv[8]) == T_BIGNUM)
|
6473
6524
|
arg10 = Gosu::Color(NUM2UINT(argv[8]));
|
6474
|
-
else if (!ptr)
|
6475
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6476
6525
|
else
|
6477
|
-
|
6526
|
+
{
|
6527
|
+
void* ptr;
|
6528
|
+
int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6529
|
+
if (!SWIG_IsOK(res))
|
6530
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
6531
|
+
else if (!ptr)
|
6532
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6533
|
+
else
|
6534
|
+
arg10 = *reinterpret_cast<Gosu::Color*>(ptr);
|
6535
|
+
}
|
6478
6536
|
}
|
6479
6537
|
if (argc > 9) {
|
6480
6538
|
{
|
6481
6539
|
const char* cstr = Gosu::cstrFromSymbol(argv[9]);
|
6482
6540
|
|
6483
|
-
if (!
|
6541
|
+
if (!cstr)
|
6542
|
+
SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol");
|
6543
|
+
else if (!strcmp(cstr, "default"))
|
6484
6544
|
arg11 = Gosu::amDefault;
|
6485
6545
|
else if (!strcmp(cstr, "additive"))
|
6486
6546
|
arg11 = Gosu::amAdditive;
|
@@ -6593,22 +6653,28 @@ _wrap_Image_draw_rot(int argc, VALUE *argv, VALUE self) {
|
|
6593
6653
|
}
|
6594
6654
|
if (argc > 8) {
|
6595
6655
|
{
|
6596
|
-
|
6597
|
-
int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6598
|
-
if (!SWIG_IsOK(res))
|
6599
|
-
// TODO: error checking
|
6656
|
+
if (TYPE(argv[8]) == T_FIXNUM || TYPE(argv[8]) == T_BIGNUM)
|
6600
6657
|
arg10 = Gosu::Color(NUM2UINT(argv[8]));
|
6601
|
-
else if (!ptr)
|
6602
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6603
6658
|
else
|
6604
|
-
|
6659
|
+
{
|
6660
|
+
void* ptr;
|
6661
|
+
int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6662
|
+
if (!SWIG_IsOK(res))
|
6663
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
6664
|
+
else if (!ptr)
|
6665
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6666
|
+
else
|
6667
|
+
arg10 = *reinterpret_cast<Gosu::Color*>(ptr);
|
6668
|
+
}
|
6605
6669
|
}
|
6606
6670
|
}
|
6607
6671
|
if (argc > 9) {
|
6608
6672
|
{
|
6609
6673
|
const char* cstr = Gosu::cstrFromSymbol(argv[9]);
|
6610
6674
|
|
6611
|
-
if (!
|
6675
|
+
if (!cstr)
|
6676
|
+
SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol");
|
6677
|
+
else if (!strcmp(cstr, "default"))
|
6612
6678
|
arg11 = Gosu::amDefault;
|
6613
6679
|
else if (!strcmp(cstr, "additive"))
|
6614
6680
|
arg11 = Gosu::amAdditive;
|
@@ -6940,15 +7006,19 @@ _wrap_Image_draw_as_quad(int argc, VALUE *argv, VALUE self) {
|
|
6940
7006
|
}
|
6941
7007
|
arg3 = static_cast< double >(val3);
|
6942
7008
|
{
|
6943
|
-
|
6944
|
-
int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6945
|
-
if (!SWIG_IsOK(res))
|
6946
|
-
// TODO: error checking
|
7009
|
+
if (TYPE(argv[2]) == T_FIXNUM || TYPE(argv[2]) == T_BIGNUM)
|
6947
7010
|
arg4 = Gosu::Color(NUM2UINT(argv[2]));
|
6948
|
-
else if (!ptr)
|
6949
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6950
7011
|
else
|
6951
|
-
|
7012
|
+
{
|
7013
|
+
void* ptr;
|
7014
|
+
int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
7015
|
+
if (!SWIG_IsOK(res))
|
7016
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
7017
|
+
else if (!ptr)
|
7018
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
7019
|
+
else
|
7020
|
+
arg4 = *reinterpret_cast<Gosu::Color*>(ptr);
|
7021
|
+
}
|
6952
7022
|
}
|
6953
7023
|
ecode5 = SWIG_AsVal_double(argv[3], &val5);
|
6954
7024
|
if (!SWIG_IsOK(ecode5)) {
|
@@ -6961,15 +7031,19 @@ _wrap_Image_draw_as_quad(int argc, VALUE *argv, VALUE self) {
|
|
6961
7031
|
}
|
6962
7032
|
arg6 = static_cast< double >(val6);
|
6963
7033
|
{
|
6964
|
-
|
6965
|
-
int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6966
|
-
if (!SWIG_IsOK(res))
|
6967
|
-
// TODO: error checking
|
7034
|
+
if (TYPE(argv[5]) == T_FIXNUM || TYPE(argv[5]) == T_BIGNUM)
|
6968
7035
|
arg7 = Gosu::Color(NUM2UINT(argv[5]));
|
6969
|
-
else if (!ptr)
|
6970
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6971
7036
|
else
|
6972
|
-
|
7037
|
+
{
|
7038
|
+
void* ptr;
|
7039
|
+
int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
7040
|
+
if (!SWIG_IsOK(res))
|
7041
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
7042
|
+
else if (!ptr)
|
7043
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
7044
|
+
else
|
7045
|
+
arg7 = *reinterpret_cast<Gosu::Color*>(ptr);
|
7046
|
+
}
|
6973
7047
|
}
|
6974
7048
|
ecode8 = SWIG_AsVal_double(argv[6], &val8);
|
6975
7049
|
if (!SWIG_IsOK(ecode8)) {
|
@@ -6982,15 +7056,19 @@ _wrap_Image_draw_as_quad(int argc, VALUE *argv, VALUE self) {
|
|
6982
7056
|
}
|
6983
7057
|
arg9 = static_cast< double >(val9);
|
6984
7058
|
{
|
6985
|
-
|
6986
|
-
int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
6987
|
-
if (!SWIG_IsOK(res))
|
6988
|
-
// TODO: error checking
|
7059
|
+
if (TYPE(argv[8]) == T_FIXNUM || TYPE(argv[8]) == T_BIGNUM)
|
6989
7060
|
arg10 = Gosu::Color(NUM2UINT(argv[8]));
|
6990
|
-
else if (!ptr)
|
6991
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
6992
7061
|
else
|
6993
|
-
|
7062
|
+
{
|
7063
|
+
void* ptr;
|
7064
|
+
int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
7065
|
+
if (!SWIG_IsOK(res))
|
7066
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
7067
|
+
else if (!ptr)
|
7068
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
7069
|
+
else
|
7070
|
+
arg10 = *reinterpret_cast<Gosu::Color*>(ptr);
|
7071
|
+
}
|
6994
7072
|
}
|
6995
7073
|
ecode11 = SWIG_AsVal_double(argv[9], &val11);
|
6996
7074
|
if (!SWIG_IsOK(ecode11)) {
|
@@ -7003,15 +7081,19 @@ _wrap_Image_draw_as_quad(int argc, VALUE *argv, VALUE self) {
|
|
7003
7081
|
}
|
7004
7082
|
arg12 = static_cast< double >(val12);
|
7005
7083
|
{
|
7006
|
-
|
7007
|
-
int res = SWIG_ConvertPtr(argv[11], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
7008
|
-
if (!SWIG_IsOK(res))
|
7009
|
-
// TODO: error checking
|
7084
|
+
if (TYPE(argv[11]) == T_FIXNUM || TYPE(argv[11]) == T_BIGNUM)
|
7010
7085
|
arg13 = Gosu::Color(NUM2UINT(argv[11]));
|
7011
|
-
else if (!ptr)
|
7012
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
7013
7086
|
else
|
7014
|
-
|
7087
|
+
{
|
7088
|
+
void* ptr;
|
7089
|
+
int res = SWIG_ConvertPtr(argv[11], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
7090
|
+
if (!SWIG_IsOK(res))
|
7091
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
7092
|
+
else if (!ptr)
|
7093
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
7094
|
+
else
|
7095
|
+
arg13 = *reinterpret_cast<Gosu::Color*>(ptr);
|
7096
|
+
}
|
7015
7097
|
}
|
7016
7098
|
ecode14 = SWIG_AsVal_double(argv[12], &val14);
|
7017
7099
|
if (!SWIG_IsOK(ecode14)) {
|
@@ -7022,7 +7104,9 @@ _wrap_Image_draw_as_quad(int argc, VALUE *argv, VALUE self) {
|
|
7022
7104
|
{
|
7023
7105
|
const char* cstr = Gosu::cstrFromSymbol(argv[13]);
|
7024
7106
|
|
7025
|
-
if (!
|
7107
|
+
if (!cstr)
|
7108
|
+
SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol");
|
7109
|
+
else if (!strcmp(cstr, "default"))
|
7026
7110
|
arg15 = Gosu::amDefault;
|
7027
7111
|
else if (!strcmp(cstr, "additive"))
|
7028
7112
|
arg15 = Gosu::amAdditive;
|
@@ -7191,7 +7275,9 @@ _wrap_Image_from_text7(int argc, VALUE *argv, VALUE self) {
|
|
7191
7275
|
{
|
7192
7276
|
const char* cstr = Gosu::cstrFromSymbol(argv[6]);
|
7193
7277
|
|
7194
|
-
if (!
|
7278
|
+
if (!cstr)
|
7279
|
+
SWIG_exception_fail(SWIG_ValueError, "text align must be a symbol");
|
7280
|
+
else if (!strcmp(cstr, "left"))
|
7195
7281
|
arg7 = Gosu::taLeft;
|
7196
7282
|
else if (!strcmp(cstr, "center"))
|
7197
7283
|
arg7 = Gosu::taCenter;
|
@@ -9246,15 +9332,19 @@ _wrap_Window_draw_line(int argc, VALUE *argv, VALUE self) {
|
|
9246
9332
|
}
|
9247
9333
|
arg3 = static_cast< double >(val3);
|
9248
9334
|
{
|
9249
|
-
|
9250
|
-
int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9251
|
-
if (!SWIG_IsOK(res))
|
9252
|
-
// TODO: error checking
|
9335
|
+
if (TYPE(argv[2]) == T_FIXNUM || TYPE(argv[2]) == T_BIGNUM)
|
9253
9336
|
arg4 = Gosu::Color(NUM2UINT(argv[2]));
|
9254
|
-
else if (!ptr)
|
9255
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9256
9337
|
else
|
9257
|
-
|
9338
|
+
{
|
9339
|
+
void* ptr;
|
9340
|
+
int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9341
|
+
if (!SWIG_IsOK(res))
|
9342
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
9343
|
+
else if (!ptr)
|
9344
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9345
|
+
else
|
9346
|
+
arg4 = *reinterpret_cast<Gosu::Color*>(ptr);
|
9347
|
+
}
|
9258
9348
|
}
|
9259
9349
|
ecode5 = SWIG_AsVal_double(argv[3], &val5);
|
9260
9350
|
if (!SWIG_IsOK(ecode5)) {
|
@@ -9267,15 +9357,19 @@ _wrap_Window_draw_line(int argc, VALUE *argv, VALUE self) {
|
|
9267
9357
|
}
|
9268
9358
|
arg6 = static_cast< double >(val6);
|
9269
9359
|
{
|
9270
|
-
|
9271
|
-
int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9272
|
-
if (!SWIG_IsOK(res))
|
9273
|
-
// TODO: error checking
|
9360
|
+
if (TYPE(argv[5]) == T_FIXNUM || TYPE(argv[5]) == T_BIGNUM)
|
9274
9361
|
arg7 = Gosu::Color(NUM2UINT(argv[5]));
|
9275
|
-
else if (!ptr)
|
9276
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9277
9362
|
else
|
9278
|
-
|
9363
|
+
{
|
9364
|
+
void* ptr;
|
9365
|
+
int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9366
|
+
if (!SWIG_IsOK(res))
|
9367
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
9368
|
+
else if (!ptr)
|
9369
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9370
|
+
else
|
9371
|
+
arg7 = *reinterpret_cast<Gosu::Color*>(ptr);
|
9372
|
+
}
|
9279
9373
|
}
|
9280
9374
|
if (argc > 6) {
|
9281
9375
|
ecode8 = SWIG_AsVal_double(argv[6], &val8);
|
@@ -9288,7 +9382,9 @@ _wrap_Window_draw_line(int argc, VALUE *argv, VALUE self) {
|
|
9288
9382
|
{
|
9289
9383
|
const char* cstr = Gosu::cstrFromSymbol(argv[7]);
|
9290
9384
|
|
9291
|
-
if (!
|
9385
|
+
if (!cstr)
|
9386
|
+
SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol");
|
9387
|
+
else if (!strcmp(cstr, "default"))
|
9292
9388
|
arg9 = Gosu::amDefault;
|
9293
9389
|
else if (!strcmp(cstr, "additive"))
|
9294
9390
|
arg9 = Gosu::amAdditive;
|
@@ -9361,15 +9457,19 @@ _wrap_Window_draw_triangle(int argc, VALUE *argv, VALUE self) {
|
|
9361
9457
|
}
|
9362
9458
|
arg3 = static_cast< double >(val3);
|
9363
9459
|
{
|
9364
|
-
|
9365
|
-
int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9366
|
-
if (!SWIG_IsOK(res))
|
9367
|
-
// TODO: error checking
|
9460
|
+
if (TYPE(argv[2]) == T_FIXNUM || TYPE(argv[2]) == T_BIGNUM)
|
9368
9461
|
arg4 = Gosu::Color(NUM2UINT(argv[2]));
|
9369
|
-
else if (!ptr)
|
9370
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9371
9462
|
else
|
9372
|
-
|
9463
|
+
{
|
9464
|
+
void* ptr;
|
9465
|
+
int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9466
|
+
if (!SWIG_IsOK(res))
|
9467
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
9468
|
+
else if (!ptr)
|
9469
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9470
|
+
else
|
9471
|
+
arg4 = *reinterpret_cast<Gosu::Color*>(ptr);
|
9472
|
+
}
|
9373
9473
|
}
|
9374
9474
|
ecode5 = SWIG_AsVal_double(argv[3], &val5);
|
9375
9475
|
if (!SWIG_IsOK(ecode5)) {
|
@@ -9382,15 +9482,19 @@ _wrap_Window_draw_triangle(int argc, VALUE *argv, VALUE self) {
|
|
9382
9482
|
}
|
9383
9483
|
arg6 = static_cast< double >(val6);
|
9384
9484
|
{
|
9385
|
-
|
9386
|
-
int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9387
|
-
if (!SWIG_IsOK(res))
|
9388
|
-
// TODO: error checking
|
9485
|
+
if (TYPE(argv[5]) == T_FIXNUM || TYPE(argv[5]) == T_BIGNUM)
|
9389
9486
|
arg7 = Gosu::Color(NUM2UINT(argv[5]));
|
9390
|
-
else if (!ptr)
|
9391
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9392
9487
|
else
|
9393
|
-
|
9488
|
+
{
|
9489
|
+
void* ptr;
|
9490
|
+
int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9491
|
+
if (!SWIG_IsOK(res))
|
9492
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
9493
|
+
else if (!ptr)
|
9494
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9495
|
+
else
|
9496
|
+
arg7 = *reinterpret_cast<Gosu::Color*>(ptr);
|
9497
|
+
}
|
9394
9498
|
}
|
9395
9499
|
ecode8 = SWIG_AsVal_double(argv[6], &val8);
|
9396
9500
|
if (!SWIG_IsOK(ecode8)) {
|
@@ -9403,15 +9507,19 @@ _wrap_Window_draw_triangle(int argc, VALUE *argv, VALUE self) {
|
|
9403
9507
|
}
|
9404
9508
|
arg9 = static_cast< double >(val9);
|
9405
9509
|
{
|
9406
|
-
|
9407
|
-
int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9408
|
-
if (!SWIG_IsOK(res))
|
9409
|
-
// TODO: error checking
|
9510
|
+
if (TYPE(argv[8]) == T_FIXNUM || TYPE(argv[8]) == T_BIGNUM)
|
9410
9511
|
arg10 = Gosu::Color(NUM2UINT(argv[8]));
|
9411
|
-
else if (!ptr)
|
9412
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9413
9512
|
else
|
9414
|
-
|
9513
|
+
{
|
9514
|
+
void* ptr;
|
9515
|
+
int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9516
|
+
if (!SWIG_IsOK(res))
|
9517
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
9518
|
+
else if (!ptr)
|
9519
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9520
|
+
else
|
9521
|
+
arg10 = *reinterpret_cast<Gosu::Color*>(ptr);
|
9522
|
+
}
|
9415
9523
|
}
|
9416
9524
|
if (argc > 9) {
|
9417
9525
|
ecode11 = SWIG_AsVal_double(argv[9], &val11);
|
@@ -9424,7 +9532,9 @@ _wrap_Window_draw_triangle(int argc, VALUE *argv, VALUE self) {
|
|
9424
9532
|
{
|
9425
9533
|
const char* cstr = Gosu::cstrFromSymbol(argv[10]);
|
9426
9534
|
|
9427
|
-
if (!
|
9535
|
+
if (!cstr)
|
9536
|
+
SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol");
|
9537
|
+
else if (!strcmp(cstr, "default"))
|
9428
9538
|
arg12 = Gosu::amDefault;
|
9429
9539
|
else if (!strcmp(cstr, "additive"))
|
9430
9540
|
arg12 = Gosu::amAdditive;
|
@@ -9504,15 +9614,19 @@ _wrap_Window_draw_quad(int argc, VALUE *argv, VALUE self) {
|
|
9504
9614
|
}
|
9505
9615
|
arg3 = static_cast< double >(val3);
|
9506
9616
|
{
|
9507
|
-
|
9508
|
-
int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9509
|
-
if (!SWIG_IsOK(res))
|
9510
|
-
// TODO: error checking
|
9617
|
+
if (TYPE(argv[2]) == T_FIXNUM || TYPE(argv[2]) == T_BIGNUM)
|
9511
9618
|
arg4 = Gosu::Color(NUM2UINT(argv[2]));
|
9512
|
-
else if (!ptr)
|
9513
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9514
9619
|
else
|
9515
|
-
|
9620
|
+
{
|
9621
|
+
void* ptr;
|
9622
|
+
int res = SWIG_ConvertPtr(argv[2], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9623
|
+
if (!SWIG_IsOK(res))
|
9624
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
9625
|
+
else if (!ptr)
|
9626
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9627
|
+
else
|
9628
|
+
arg4 = *reinterpret_cast<Gosu::Color*>(ptr);
|
9629
|
+
}
|
9516
9630
|
}
|
9517
9631
|
ecode5 = SWIG_AsVal_double(argv[3], &val5);
|
9518
9632
|
if (!SWIG_IsOK(ecode5)) {
|
@@ -9525,15 +9639,19 @@ _wrap_Window_draw_quad(int argc, VALUE *argv, VALUE self) {
|
|
9525
9639
|
}
|
9526
9640
|
arg6 = static_cast< double >(val6);
|
9527
9641
|
{
|
9528
|
-
|
9529
|
-
int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9530
|
-
if (!SWIG_IsOK(res))
|
9531
|
-
// TODO: error checking
|
9642
|
+
if (TYPE(argv[5]) == T_FIXNUM || TYPE(argv[5]) == T_BIGNUM)
|
9532
9643
|
arg7 = Gosu::Color(NUM2UINT(argv[5]));
|
9533
|
-
else if (!ptr)
|
9534
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9535
9644
|
else
|
9536
|
-
|
9645
|
+
{
|
9646
|
+
void* ptr;
|
9647
|
+
int res = SWIG_ConvertPtr(argv[5], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9648
|
+
if (!SWIG_IsOK(res))
|
9649
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
9650
|
+
else if (!ptr)
|
9651
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9652
|
+
else
|
9653
|
+
arg7 = *reinterpret_cast<Gosu::Color*>(ptr);
|
9654
|
+
}
|
9537
9655
|
}
|
9538
9656
|
ecode8 = SWIG_AsVal_double(argv[6], &val8);
|
9539
9657
|
if (!SWIG_IsOK(ecode8)) {
|
@@ -9546,15 +9664,19 @@ _wrap_Window_draw_quad(int argc, VALUE *argv, VALUE self) {
|
|
9546
9664
|
}
|
9547
9665
|
arg9 = static_cast< double >(val9);
|
9548
9666
|
{
|
9549
|
-
|
9550
|
-
int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9551
|
-
if (!SWIG_IsOK(res))
|
9552
|
-
// TODO: error checking
|
9667
|
+
if (TYPE(argv[8]) == T_FIXNUM || TYPE(argv[8]) == T_BIGNUM)
|
9553
9668
|
arg10 = Gosu::Color(NUM2UINT(argv[8]));
|
9554
|
-
else if (!ptr)
|
9555
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9556
9669
|
else
|
9557
|
-
|
9670
|
+
{
|
9671
|
+
void* ptr;
|
9672
|
+
int res = SWIG_ConvertPtr(argv[8], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9673
|
+
if (!SWIG_IsOK(res))
|
9674
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
9675
|
+
else if (!ptr)
|
9676
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9677
|
+
else
|
9678
|
+
arg10 = *reinterpret_cast<Gosu::Color*>(ptr);
|
9679
|
+
}
|
9558
9680
|
}
|
9559
9681
|
ecode11 = SWIG_AsVal_double(argv[9], &val11);
|
9560
9682
|
if (!SWIG_IsOK(ecode11)) {
|
@@ -9567,15 +9689,19 @@ _wrap_Window_draw_quad(int argc, VALUE *argv, VALUE self) {
|
|
9567
9689
|
}
|
9568
9690
|
arg12 = static_cast< double >(val12);
|
9569
9691
|
{
|
9570
|
-
|
9571
|
-
int res = SWIG_ConvertPtr(argv[11], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9572
|
-
if (!SWIG_IsOK(res))
|
9573
|
-
// TODO: error checking
|
9692
|
+
if (TYPE(argv[11]) == T_FIXNUM || TYPE(argv[11]) == T_BIGNUM)
|
9574
9693
|
arg13 = Gosu::Color(NUM2UINT(argv[11]));
|
9575
|
-
else if (!ptr)
|
9576
|
-
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9577
9694
|
else
|
9578
|
-
|
9695
|
+
{
|
9696
|
+
void* ptr;
|
9697
|
+
int res = SWIG_ConvertPtr(argv[11], &ptr, SWIGTYPE_p_Gosu__Color, 0);
|
9698
|
+
if (!SWIG_IsOK(res))
|
9699
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid value");
|
9700
|
+
else if (!ptr)
|
9701
|
+
SWIG_exception_fail(SWIG_ValueError, "invalid null reference of type Gosu::Color");
|
9702
|
+
else
|
9703
|
+
arg13 = *reinterpret_cast<Gosu::Color*>(ptr);
|
9704
|
+
}
|
9579
9705
|
}
|
9580
9706
|
if (argc > 12) {
|
9581
9707
|
ecode14 = SWIG_AsVal_double(argv[12], &val14);
|
@@ -9588,7 +9714,9 @@ _wrap_Window_draw_quad(int argc, VALUE *argv, VALUE self) {
|
|
9588
9714
|
{
|
9589
9715
|
const char* cstr = Gosu::cstrFromSymbol(argv[13]);
|
9590
9716
|
|
9591
|
-
if (!
|
9717
|
+
if (!cstr)
|
9718
|
+
SWIG_exception_fail(SWIG_ValueError, "alpha mode must be a symbol");
|
9719
|
+
else if (!strcmp(cstr, "default"))
|
9592
9720
|
arg15 = Gosu::amDefault;
|
9593
9721
|
else if (!strcmp(cstr, "additive"))
|
9594
9722
|
arg15 = Gosu::amAdditive;
|
@@ -11120,8 +11248,8 @@ SWIGEXPORT void Init_gosu(void) {
|
|
11120
11248
|
SWIG_RubyInitializeTrackings();
|
11121
11249
|
rb_define_const(mGosu, "MAJOR_VERSION", SWIG_From_int(static_cast< int >(0)));
|
11122
11250
|
rb_define_const(mGosu, "MINOR_VERSION", SWIG_From_int(static_cast< int >(7)));
|
11123
|
-
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(
|
11124
|
-
rb_define_const(mGosu, "VERSION", SWIG_FromCharPtr("0.7.
|
11251
|
+
rb_define_const(mGosu, "POINT_VERSION", SWIG_From_int(static_cast< int >(33)));
|
11252
|
+
rb_define_const(mGosu, "VERSION", SWIG_FromCharPtr("0.7.33"));
|
11125
11253
|
rb_define_const(mGosu, "GOSU_COPYRIGHT_NOTICE", SWIG_FromCharPtr("May contain `ogg\', `vorbis\' libraries (c) 2002-2008 Xiph.org Foundation\n\nRedistribution and use in source and binary forms, with or withoutmodification, are permitted provided that the following conditionsare met:\n\n- Redistributions of source code must retain the above copyrightnotice, this list of conditions and the following disclaimer.\n\n- Redistributions in binary form must reproduce the above copyrightnotice, this list of conditions and the following disclaimer in thedocumentation and/or other materials provided with the distribution.\n\n- Neither the name of the Xiph.org Foundation nor the names of itscontributors may be used to endorse or promote products derived fromthis software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS``AS IS\'\' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOTLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FORA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATIONOR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOTLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANYTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USEOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."));
|
11126
11254
|
rb_define_module_function(mGosu, "milliseconds", VALUEFUNC(_wrap_milliseconds), -1);
|
11127
11255
|
rb_define_module_function(mGosu, "random", VALUEFUNC(_wrap_random), -1);
|
data/lib/gosu/swig_patches.rb
CHANGED
@@ -11,7 +11,8 @@ class Gosu::Window
|
|
11
11
|
define_method "protected_#{callback}" do |*args|
|
12
12
|
begin
|
13
13
|
# Turn into a boolean result for needs_cursor? etc while we are at it.
|
14
|
-
|
14
|
+
# If there has been an exception, don't do anything as to not make matters worse.
|
15
|
+
defined?(@_exception) ? false : !!send(callback, *args)
|
15
16
|
rescue Exception => e
|
16
17
|
# Exit the message loop naturally, then re-throw
|
17
18
|
@_exception = e
|
@@ -25,7 +26,7 @@ class Gosu::Window
|
|
25
26
|
show_internal
|
26
27
|
# Try to format the message nicely, without any useless patching that we are
|
27
28
|
# doing here.
|
28
|
-
if @_exception then
|
29
|
+
if defined? @_exception then
|
29
30
|
if @_exception.backtrace.is_a? Array and not @_exception.backtrace.frozen? then
|
30
31
|
@_exception.backtrace.reject! { |line| line.include? 'lib/gosu/swig_patches.rb' }
|
31
32
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gosu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 65
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 33
|
10
|
+
version: 0.7.33
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Julian Raschke
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-06-
|
19
|
+
date: 2011-06-13 00:00:00 Z
|
20
20
|
dependencies: []
|
21
21
|
|
22
22
|
description: " 2D game development library.\n\n Gosu features easy to use and game-friendly interfaces to 2D graphics\n and text (accelerated by 3D hardware), sound samples and music as well as\n keyboard, mouse and gamepad/joystick input.\n\n Also includes demos for integration with RMagick, Chipmunk and Ruby-OpenGL.\n"
|