gosu 0.7.24 → 0.7.25
Sign up to get free protection for your applications and to get access to all the features.
- data/Gosu/ButtonsMac.hpp +2 -2
- data/Gosu/ButtonsWin.hpp +4 -1
- data/Gosu/ButtonsX.hpp +2 -2
- data/Gosu/Color.hpp +47 -29
- data/Gosu/Graphics.hpp +1 -1
- data/Gosu/Version.hpp +2 -2
- data/GosuImpl/Graphics/BitmapPNG.cpp +1 -1
- data/GosuImpl/Graphics/BitmapTouch.mm +0 -4
- data/GosuImpl/Graphics/Color.cpp +1 -1
- data/GosuImpl/Graphics/Graphics.cpp +1 -1
- data/GosuImpl/Graphics/Texture.cpp +2 -72
- data/GosuImpl/Graphics/Texture.hpp +0 -2
- data/GosuImpl/InputMac.mm +39 -9
- data/GosuImpl/RubyGosu.swg +32 -15
- data/GosuImpl/RubyGosu_wrap.cxx +269 -84
- data/GosuImpl/RubyGosu_wrap.h +1 -1
- data/GosuImpl/WindowMac.mm +10 -8
- data/GosuImpl/WindowWin.cpp +1 -1
- data/examples/CptnRuby.rb +1 -7
- data/examples/OpenGLIntegration.rb +1 -7
- data/examples/RMagickIntegration.rb +1 -7
- data/examples/TextInput.rb +1 -7
- data/examples/Tutorial.rb +1 -7
- data/lib/gosu/patches.rb +22 -11
- data/lib/gosu.rb +0 -0
- metadata +4 -4
data/GosuImpl/RubyGosu_wrap.h
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
/* ----------------------------------------------------------------------------
|
2
2
|
* This file was automatically generated by SWIG (http://www.swig.org).
|
3
|
-
* Version
|
3
|
+
* Version 2.0.1
|
4
4
|
*
|
5
5
|
* This file is not intended to be easily readable and contains a number of
|
6
6
|
* coding conventions designed to improve portability and efficiency. Do not make
|
data/GosuImpl/WindowMac.mm
CHANGED
@@ -193,15 +193,12 @@ struct Gosu::Window::Impl
|
|
193
193
|
{
|
194
194
|
NSRect rect = NSMakeRect(0, 0, width, height);
|
195
195
|
unsigned style = NSTitledWindowMask | NSMiniaturizableWindowMask | NSClosableWindowMask;
|
196
|
-
window.reset([[GosuWindow alloc] initWithContentRect:
|
197
|
-
backing:NSBackingStoreBuffered defer:
|
196
|
+
window.reset([[GosuWindow alloc] initWithContentRect:rect styleMask:style
|
197
|
+
backing:NSBackingStoreBuffered defer:NO]);
|
198
198
|
[window.obj() retain]; // TODO: Why?
|
199
199
|
|
200
200
|
[window.obj() setContentView: [[GosuView alloc] init]];
|
201
|
-
|
202
201
|
[window.obj() center];
|
203
|
-
[window.obj() makeKeyAndOrderFront:nil];
|
204
|
-
[[window.obj() contentView] display];
|
205
202
|
}
|
206
203
|
|
207
204
|
static void doTick(Window& window);
|
@@ -287,9 +284,7 @@ Gosu::Window::Window(unsigned width, unsigned height, bool fullscreen,
|
|
287
284
|
realWidth *= factor, realHeight *= factor;
|
288
285
|
|
289
286
|
pimpl->createWindow(realWidth, realHeight);
|
290
|
-
|
291
287
|
// Tell context to draw on this window.
|
292
|
-
|
293
288
|
[pimpl->context.obj() setView:[pimpl->window.obj() contentView]];
|
294
289
|
}
|
295
290
|
|
@@ -314,6 +309,8 @@ Gosu::Window::Window(unsigned width, unsigned height, bool fullscreen,
|
|
314
309
|
[pimpl->window.obj() setDelegate: pimpl->forwarder.obj()];
|
315
310
|
[pimpl->window.obj() setInput: pimpl->input.get()];
|
316
311
|
[(GosuView*)[pimpl->window.obj() contentView] setInput: pimpl->input.get()];
|
312
|
+
// Finally, safely hide the window.
|
313
|
+
[pimpl->window.obj() orderOut:nil];
|
317
314
|
}
|
318
315
|
|
319
316
|
pimpl->interval = updateInterval;
|
@@ -377,11 +374,12 @@ void Gosu::Window::show()
|
|
377
374
|
// Start drawing in fullscreen
|
378
375
|
[pimpl->context.obj() setFullScreen];
|
379
376
|
}
|
377
|
+
else
|
378
|
+
[pimpl->window.obj() makeKeyAndOrderFront:nil];
|
380
379
|
|
381
380
|
NSTimer* timer = [NSTimer scheduledTimerWithTimeInterval: pimpl->interval / 1000.0
|
382
381
|
target:pimpl->forwarder.obj() selector:@selector(doTick:)
|
383
382
|
userInfo:nil repeats:YES];
|
384
|
-
update();
|
385
383
|
[NSApp run];
|
386
384
|
[timer invalidate];
|
387
385
|
|
@@ -392,6 +390,10 @@ void Gosu::Window::show()
|
|
392
390
|
CGDisplaySwitchToMode(kCGDirectMainDisplay, pimpl->savedMode);
|
393
391
|
CGDisplayRelease(kCGDirectMainDisplay);
|
394
392
|
}
|
393
|
+
else
|
394
|
+
{
|
395
|
+
[pimpl->window.obj() orderOut:nil];
|
396
|
+
}
|
395
397
|
}
|
396
398
|
|
397
399
|
void Gosu::Window::close()
|
data/GosuImpl/WindowWin.cpp
CHANGED
data/examples/CptnRuby.rb
CHANGED
@@ -25,13 +25,7 @@
|
|
25
25
|
# ...Enemies, a more sophisticated object system, weapons, title and credits
|
26
26
|
# screens...
|
27
27
|
|
28
|
-
|
29
|
-
# In case you use Gosu via rubygems.
|
30
|
-
require 'rubygems'
|
31
|
-
rescue LoadError
|
32
|
-
# In case you don't.
|
33
|
-
end
|
34
|
-
|
28
|
+
require 'rubygems'
|
35
29
|
require 'gosu'
|
36
30
|
include Gosu
|
37
31
|
|
@@ -3,13 +3,7 @@
|
|
3
3
|
# the block given to Window#gl, and that Gosu Images can be
|
4
4
|
# used as textures using the gl_tex_info call.
|
5
5
|
|
6
|
-
|
7
|
-
# In case you use Gosu via RubyGems.
|
8
|
-
require 'rubygems'
|
9
|
-
rescue LoadError
|
10
|
-
# In case you don't.
|
11
|
-
end
|
12
|
-
|
6
|
+
require 'rubygems'
|
13
7
|
require 'gosu'
|
14
8
|
require 'gl'
|
15
9
|
require 'glu'
|
@@ -11,13 +11,7 @@
|
|
11
11
|
# * The look of dead soldiers is, err, by accident. Soldier.png needs to be
|
12
12
|
# designed in a less obfuscated way :)
|
13
13
|
|
14
|
-
|
15
|
-
# In case you use Gosu via RubyGems.
|
16
|
-
require 'rubygems'
|
17
|
-
rescue LoadError
|
18
|
-
# In case you don't.
|
19
|
-
end
|
20
|
-
|
14
|
+
require 'rubygems'
|
21
15
|
require 'gosu'
|
22
16
|
require 'RMagick'
|
23
17
|
|
data/examples/TextInput.rb
CHANGED
@@ -18,13 +18,7 @@
|
|
18
18
|
# presented here is not mandatory! Gosu only aims to provide enough code for
|
19
19
|
# games (or intermediate UI toolkits) to be built upon it.
|
20
20
|
|
21
|
-
|
22
|
-
# In case you use Gosu via RubyGems.
|
23
|
-
require 'rubygems'
|
24
|
-
rescue LoadError
|
25
|
-
# In case you don't.
|
26
|
-
end
|
27
|
-
|
21
|
+
require 'rubygems'
|
28
22
|
require 'gosu'
|
29
23
|
|
30
24
|
class TextField < Gosu::TextInput
|
data/examples/Tutorial.rb
CHANGED
data/lib/gosu/patches.rb
CHANGED
@@ -39,17 +39,28 @@ end
|
|
39
39
|
|
40
40
|
# Color constants (SWIG messes up constants somehow)
|
41
41
|
class Gosu::Color
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
42
|
+
class Constant < Gosu::Color
|
43
|
+
private
|
44
|
+
def alpha=; end
|
45
|
+
def red=; end
|
46
|
+
def green=; end
|
47
|
+
def blue=; end
|
48
|
+
def hue=; end
|
49
|
+
def saturation=; end
|
50
|
+
def value=; end
|
51
|
+
end
|
52
|
+
|
53
|
+
NONE = Gosu::Color::Constant.new(0x00000000)
|
54
|
+
BLACK = Gosu::Color::Constant.new(0xff000000)
|
55
|
+
GRAY = Gosu::Color::Constant.new(0xff808080)
|
56
|
+
WHITE = Gosu::Color::Constant.new(0xffffffff)
|
57
|
+
AQUA = Gosu::Color::Constant.new(0xff00ffff)
|
58
|
+
RED = Gosu::Color::Constant.new(0xffff0000)
|
59
|
+
GREEN = Gosu::Color::Constant.new(0xff00ff00)
|
60
|
+
BLUE = Gosu::Color::Constant.new(0xff0000ff)
|
61
|
+
YELLOW = Gosu::Color::Constant.new(0xffffff00)
|
62
|
+
FUCHSIA = Gosu::Color::Constant.new(0xffff00ff)
|
63
|
+
CYAN = Gosu::Color::Constant.new(0xff00ffff)
|
53
64
|
end
|
54
65
|
|
55
66
|
# Instance methods for button_id_to_char and char_to_button_id
|
data/lib/gosu.rb
CHANGED
File without changes
|
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: 49
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 7
|
9
|
-
-
|
10
|
-
version: 0.7.
|
9
|
+
- 25
|
10
|
+
version: 0.7.25
|
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: 2010-
|
19
|
+
date: 2010-11-02 00:00:00 +01:00
|
20
20
|
default_executable:
|
21
21
|
dependencies: []
|
22
22
|
|