gosu 1.1.0.pre1 → 1.1.0.pre2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/gosu/swig_patches.rb +11 -7
- data/src/RubyGosu.cxx +89 -100
- data/src/RubyGosu.h +1 -0
- data/src/TrueTypeFontWin.cpp +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 70dc24184a235da8dc66f4bac07da231b87ab9f4a7469d06331ba048da6bc5b6
|
4
|
+
data.tar.gz: 0fab031220b2912e66d29e53e1c4dbee51823e042b75927e31415bca59056ac3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59567c7edd20676430b16a27f260fb64f6309d992215cf5f3e22cf8311d39a263945836b040ebd46cb9ee4e0e9a430a0cc1f84d35fc8b3ea8f1ca4b79b170bb6
|
7
|
+
data.tar.gz: 31afdb7a4465c4c59002a2a044202b43803db915c9ae6940fb87606b51e9907707591db591d6baa60c1aadf89104a045a12bfdeb81e7c80bed76dfb9d8284709
|
data/lib/gosu/swig_patches.rb
CHANGED
@@ -3,16 +3,20 @@
|
|
3
3
|
# compatible, but I just call protected_update etc. in the Ruby wrapper so I can add this
|
4
4
|
# custom debugging help:
|
5
5
|
class Gosu::Window
|
6
|
-
alias_method :
|
6
|
+
alias_method :initialize_with_bitmask, :initialize
|
7
7
|
|
8
|
-
def initialize
|
9
|
-
|
10
|
-
|
8
|
+
def initialize(width, height, *args)
|
9
|
+
$gosu_gl_blocks = nil
|
10
|
+
|
11
|
+
if args.first.is_a? Hash
|
12
|
+
flags = 0
|
13
|
+
flags |= 1 if args.first[:fullscreen]
|
14
|
+
flags |= 2 if args.first[:resizable]
|
15
|
+
flags |= 4 if args.first[:borderless]
|
16
|
+
initialize_with_bitmask(width, height, flags, args.first[:update_interval] || 16.666666)
|
11
17
|
else
|
12
|
-
|
18
|
+
initialize_with_bitmask(width, height, args[0] ? 1 : 0, args[1] || 16.666666)
|
13
19
|
end
|
14
|
-
$gosu_gl_blocks = nil
|
15
|
-
initialize_with_options_hash width, height, options
|
16
20
|
end
|
17
21
|
|
18
22
|
%w(update draw needs_redraw? needs_cursor?
|
data/src/RubyGosu.cxx
CHANGED
@@ -3218,45 +3218,6 @@ SWIGINTERN void Gosu_TextInput_set_selection_start(Gosu::TextInput *self,VALUE s
|
|
3218
3218
|
std::string prefix = StringValueCStr(rb_prefix);
|
3219
3219
|
self->set_selection_start(std::min(prefix.length(), self->text().length()));
|
3220
3220
|
}
|
3221
|
-
SWIGINTERN Gosu::Window *new_Gosu_Window(VALUE self,int width,int height,VALUE options=0){
|
3222
|
-
unsigned flags = 0;
|
3223
|
-
double update_interval = 16.666666;
|
3224
|
-
|
3225
|
-
if (options) {
|
3226
|
-
Check_Type(options, T_HASH);
|
3227
|
-
|
3228
|
-
VALUE keys = rb_funcall(options, rb_intern("keys"), 0, NULL);
|
3229
|
-
int keys_size = NUM2INT(rb_funcall(keys, rb_intern("size"), 0, NULL));
|
3230
|
-
|
3231
|
-
for (int i = 0; i < keys_size; ++i) {
|
3232
|
-
VALUE key = rb_ary_entry(keys, i);
|
3233
|
-
const char* key_string = Gosu::cstr_from_symbol(key);
|
3234
|
-
|
3235
|
-
VALUE value = rb_hash_aref(options, key);
|
3236
|
-
if (!strcmp(key_string, "fullscreen")) {
|
3237
|
-
if (RTEST(value)) flags |= Gosu::WF_FULLSCREEN;
|
3238
|
-
}
|
3239
|
-
else if (!strcmp(key_string, "resizable")) {
|
3240
|
-
if (RTEST(value)) flags |= Gosu::WF_RESIZABLE;
|
3241
|
-
}
|
3242
|
-
else if (!strcmp(key_string, "borderless")) {
|
3243
|
-
if (RTEST(value)) flags |= Gosu::WF_BORDERLESS;
|
3244
|
-
}
|
3245
|
-
else if (!strcmp(key_string, "update_interval")) {
|
3246
|
-
update_interval = NUM2DBL(value);
|
3247
|
-
}
|
3248
|
-
else {
|
3249
|
-
static bool issued_warning = false;
|
3250
|
-
if (!issued_warning) {
|
3251
|
-
issued_warning = true;
|
3252
|
-
rb_warn("Unknown keyword argument: :%s", key_string);
|
3253
|
-
}
|
3254
|
-
}
|
3255
|
-
}
|
3256
|
-
}
|
3257
|
-
|
3258
|
-
return new Gosu::Window(width, height, flags, update_interval);
|
3259
|
-
}
|
3260
3221
|
SWIGINTERN void Gosu_Window_set_width(Gosu::Window *self,unsigned int width){
|
3261
3222
|
self->resize(width, self->height(), self->fullscreen());
|
3262
3223
|
}
|
@@ -3339,6 +3300,12 @@ std::string SwigDirector_TextInput::filter(std::string text) const {
|
|
3339
3300
|
}
|
3340
3301
|
|
3341
3302
|
|
3303
|
+
SwigDirector_Window::SwigDirector_Window(VALUE self,int width,int height,unsigned int window_flags,double update_interval): Gosu::Window(width, height, window_flags, update_interval), Swig::Director(self) {
|
3304
|
+
|
3305
|
+
}
|
3306
|
+
|
3307
|
+
|
3308
|
+
|
3342
3309
|
SwigDirector_Window::~SwigDirector_Window() {
|
3343
3310
|
}
|
3344
3311
|
|
@@ -9213,6 +9180,89 @@ fail:
|
|
9213
9180
|
|
9214
9181
|
static swig_class SwigClassWindow;
|
9215
9182
|
|
9183
|
+
SWIGINTERN VALUE
|
9184
|
+
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
|
9185
|
+
_wrap_Window_allocate(VALUE self)
|
9186
|
+
#else
|
9187
|
+
_wrap_Window_allocate(int argc, VALUE *argv, VALUE self)
|
9188
|
+
#endif
|
9189
|
+
{
|
9190
|
+
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Gosu__Window);
|
9191
|
+
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
|
9192
|
+
rb_obj_call_init(vresult, argc, argv);
|
9193
|
+
#endif
|
9194
|
+
return vresult;
|
9195
|
+
}
|
9196
|
+
|
9197
|
+
|
9198
|
+
SWIGINTERN VALUE
|
9199
|
+
_wrap_new_Window(int argc, VALUE *argv, VALUE self) {
|
9200
|
+
VALUE arg1 = (VALUE) 0 ;
|
9201
|
+
int arg2 ;
|
9202
|
+
int arg3 ;
|
9203
|
+
unsigned int arg4 = (unsigned int) Gosu::WF_WINDOWED ;
|
9204
|
+
double arg5 = (double) 16.666666 ;
|
9205
|
+
int val2 ;
|
9206
|
+
int ecode2 = 0 ;
|
9207
|
+
int val3 ;
|
9208
|
+
int ecode3 = 0 ;
|
9209
|
+
unsigned int val4 ;
|
9210
|
+
int ecode4 = 0 ;
|
9211
|
+
double val5 ;
|
9212
|
+
int ecode5 = 0 ;
|
9213
|
+
const char *classname SWIGUNUSED = "Gosu::Window";
|
9214
|
+
Gosu::Window *result = 0 ;
|
9215
|
+
|
9216
|
+
if ((argc < 2) || (argc > 4)) {
|
9217
|
+
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
9218
|
+
}
|
9219
|
+
arg1 = self;
|
9220
|
+
ecode2 = SWIG_AsVal_int(argv[0], &val2);
|
9221
|
+
if (!SWIG_IsOK(ecode2)) {
|
9222
|
+
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Window", 2, argv[0] ));
|
9223
|
+
}
|
9224
|
+
arg2 = static_cast< int >(val2);
|
9225
|
+
ecode3 = SWIG_AsVal_int(argv[1], &val3);
|
9226
|
+
if (!SWIG_IsOK(ecode3)) {
|
9227
|
+
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","Window", 3, argv[1] ));
|
9228
|
+
}
|
9229
|
+
arg3 = static_cast< int >(val3);
|
9230
|
+
if (argc > 2) {
|
9231
|
+
ecode4 = SWIG_AsVal_unsigned_SS_int(argv[2], &val4);
|
9232
|
+
if (!SWIG_IsOK(ecode4)) {
|
9233
|
+
SWIG_exception_fail(SWIG_ArgError(ecode4), Ruby_Format_TypeError( "", "unsigned int","Window", 4, argv[2] ));
|
9234
|
+
}
|
9235
|
+
arg4 = static_cast< unsigned int >(val4);
|
9236
|
+
}
|
9237
|
+
if (argc > 3) {
|
9238
|
+
ecode5 = SWIG_AsVal_double(argv[3], &val5);
|
9239
|
+
if (!SWIG_IsOK(ecode5)) {
|
9240
|
+
SWIG_exception_fail(SWIG_ArgError(ecode5), Ruby_Format_TypeError( "", "double","Window", 5, argv[3] ));
|
9241
|
+
}
|
9242
|
+
arg5 = static_cast< double >(val5);
|
9243
|
+
}
|
9244
|
+
{
|
9245
|
+
try {
|
9246
|
+
if ( strcmp(rb_obj_classname(self), classname) != 0 ) {
|
9247
|
+
/* subclassed */
|
9248
|
+
result = (Gosu::Window *)new SwigDirector_Window(arg1,arg2,arg3,arg4,arg5);
|
9249
|
+
} else {
|
9250
|
+
result = (Gosu::Window *)new Gosu::Window(arg2,arg3,arg4,arg5);
|
9251
|
+
}
|
9252
|
+
|
9253
|
+
DATA_PTR(self) = result;
|
9254
|
+
SWIG_RubyAddTracking(result, self);
|
9255
|
+
}
|
9256
|
+
catch (const std::exception& e) {
|
9257
|
+
SWIG_exception(SWIG_RuntimeError, e.what());
|
9258
|
+
}
|
9259
|
+
}
|
9260
|
+
return self;
|
9261
|
+
fail:
|
9262
|
+
return Qnil;
|
9263
|
+
}
|
9264
|
+
|
9265
|
+
|
9216
9266
|
SWIGINTERN void
|
9217
9267
|
free_Gosu_Window(void *self) {
|
9218
9268
|
Gosu::Window *arg1 = (Gosu::Window *)self;
|
@@ -10210,67 +10260,6 @@ fail:
|
|
10210
10260
|
}
|
10211
10261
|
|
10212
10262
|
|
10213
|
-
SWIGINTERN VALUE
|
10214
|
-
#ifdef HAVE_RB_DEFINE_ALLOC_FUNC
|
10215
|
-
_wrap_Window_allocate(VALUE self)
|
10216
|
-
#else
|
10217
|
-
_wrap_Window_allocate(int argc, VALUE *argv, VALUE self)
|
10218
|
-
#endif
|
10219
|
-
{
|
10220
|
-
VALUE vresult = SWIG_NewClassInstance(self, SWIGTYPE_p_Gosu__Window);
|
10221
|
-
#ifndef HAVE_RB_DEFINE_ALLOC_FUNC
|
10222
|
-
rb_obj_call_init(vresult, argc, argv);
|
10223
|
-
#endif
|
10224
|
-
return vresult;
|
10225
|
-
}
|
10226
|
-
|
10227
|
-
|
10228
|
-
SWIGINTERN VALUE
|
10229
|
-
_wrap_new_Window(int argc, VALUE *argv, VALUE self) {
|
10230
|
-
VALUE arg1 = (VALUE) 0 ;
|
10231
|
-
int arg2 ;
|
10232
|
-
int arg3 ;
|
10233
|
-
VALUE arg4 = (VALUE) 0 ;
|
10234
|
-
int val2 ;
|
10235
|
-
int ecode2 = 0 ;
|
10236
|
-
int val3 ;
|
10237
|
-
int ecode3 = 0 ;
|
10238
|
-
const char *classname SWIGUNUSED = "Gosu::Window";
|
10239
|
-
Gosu::Window *result = 0 ;
|
10240
|
-
|
10241
|
-
if ((argc < 2) || (argc > 3)) {
|
10242
|
-
rb_raise(rb_eArgError, "wrong # of arguments(%d for 2)",argc); SWIG_fail;
|
10243
|
-
}
|
10244
|
-
arg1 = self;
|
10245
|
-
ecode2 = SWIG_AsVal_int(argv[0], &val2);
|
10246
|
-
if (!SWIG_IsOK(ecode2)) {
|
10247
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "int","Window", 2, argv[0] ));
|
10248
|
-
}
|
10249
|
-
arg2 = static_cast< int >(val2);
|
10250
|
-
ecode3 = SWIG_AsVal_int(argv[1], &val3);
|
10251
|
-
if (!SWIG_IsOK(ecode3)) {
|
10252
|
-
SWIG_exception_fail(SWIG_ArgError(ecode3), Ruby_Format_TypeError( "", "int","Window", 3, argv[1] ));
|
10253
|
-
}
|
10254
|
-
arg3 = static_cast< int >(val3);
|
10255
|
-
if (argc > 2) {
|
10256
|
-
arg4 = argv[2];
|
10257
|
-
}
|
10258
|
-
{
|
10259
|
-
try {
|
10260
|
-
result = (Gosu::Window *)new_Gosu_Window(arg1,arg2,arg3,arg4);
|
10261
|
-
DATA_PTR(self) = result;
|
10262
|
-
SWIG_RubyAddTracking(result, self);
|
10263
|
-
}
|
10264
|
-
catch (const std::exception& e) {
|
10265
|
-
SWIG_exception(SWIG_RuntimeError, e.what());
|
10266
|
-
}
|
10267
|
-
}
|
10268
|
-
return self;
|
10269
|
-
fail:
|
10270
|
-
return Qnil;
|
10271
|
-
}
|
10272
|
-
|
10273
|
-
|
10274
10263
|
SWIGINTERN VALUE
|
10275
10264
|
_wrap_Window_widthe___(int argc, VALUE *argv, VALUE self) {
|
10276
10265
|
Gosu::Window *arg1 = (Gosu::Window *) 0 ;
|
data/src/RubyGosu.h
CHANGED
@@ -28,6 +28,7 @@ public:
|
|
28
28
|
class SwigDirector_Window : public Gosu::Window, public Swig::Director {
|
29
29
|
|
30
30
|
public:
|
31
|
+
SwigDirector_Window(VALUE self,int width,int height,unsigned int window_flags=Gosu::WF_WINDOWED,double update_interval=16.666666);
|
31
32
|
virtual ~SwigDirector_Window();
|
32
33
|
virtual void show();
|
33
34
|
virtual bool tick();
|
data/src/TrueTypeFontWin.cpp
CHANGED
@@ -32,8 +32,8 @@ const unsigned char* Gosu::ttf_data_by_name(const string& font_name, unsigned fo
|
|
32
32
|
LOGFONT logfont = {
|
33
33
|
0, 0, 0, 0,
|
34
34
|
(font_flags & Gosu::FF_BOLD) ? FW_BOLD : FW_NORMAL,
|
35
|
-
(font_flags & Gosu::FF_ITALIC) ?
|
36
|
-
(font_flags & Gosu::FF_UNDERLINE) ?
|
35
|
+
static_cast<BYTE>((font_flags & Gosu::FF_ITALIC) ? TRUE : FALSE),
|
36
|
+
static_cast<BYTE>((font_flags & Gosu::FF_UNDERLINE) ? TRUE : FALSE),
|
37
37
|
0 /* no strikethrough */,
|
38
38
|
ANSI_CHARSET, OUT_OUTLINE_PRECIS, CLIP_DEFAULT_PRECIS, ANTIALIASED_QUALITY,
|
39
39
|
DEFAULT_PITCH
|