gosu 0.8.6-x86-mingw32 → 0.8.7-x86-mingw32
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gosu/Audio.hpp +171 -171
- data/Gosu/Bitmap.hpp +96 -96
- data/Gosu/Color.hpp +204 -204
- data/Gosu/Directories.hpp +36 -36
- data/Gosu/Font.hpp +83 -83
- data/Gosu/Gosu.hpp +34 -34
- data/Gosu/Graphics.hpp +115 -115
- data/Gosu/GraphicsBase.hpp +110 -110
- data/Gosu/IO.hpp +269 -269
- data/Gosu/Image.hpp +122 -122
- data/Gosu/ImageData.hpp +61 -61
- data/Gosu/Input.hpp +149 -149
- data/Gosu/Inspection.hpp +14 -14
- data/Gosu/Math.hpp +135 -135
- data/Gosu/Platform.hpp +93 -93
- data/Gosu/Sockets.hpp +156 -156
- data/Gosu/TR1.hpp +56 -56
- data/Gosu/Text.hpp +71 -71
- data/Gosu/TextInput.hpp +70 -70
- data/Gosu/Utility.hpp +28 -28
- data/Gosu/Version.hpp +19 -19
- data/Gosu/Window.hpp +145 -145
- data/examples/ChipmunkIntegration.rb +275 -275
- data/examples/CptnRuby.rb +223 -223
- data/examples/GosuZen.rb +68 -68
- data/examples/MoreChipmunkAndRMagick.rb +155 -155
- data/examples/OpenGLIntegration.rb +225 -225
- data/examples/RMagickIntegration.rb +417 -417
- data/examples/TextInput.rb +154 -154
- data/examples/Tutorial.rb +130 -130
- data/examples/media/Beep.wav +0 -0
- data/examples/media/CptnRuby Map.txt b/data/examples/media/CptnRuby → Map.txt +0 -0
- data/examples/media/Explosion.wav +0 -0
- data/examples/media/Landscape.svg +9 -9
- data/examples/media/Space.png +0 -0
- data/examples/media/Star.png +0 -0
- data/examples/media/Starfighter.bmp +0 -0
- data/lib/1.8/gosu.so +0 -0
- data/lib/1.9/gosu.so +0 -0
- data/lib/2.0/gosu.so +0 -0
- data/lib/2.1/gosu.so +0 -0
- data/lib/FreeImage.dll +0 -0
- data/lib/OpenAL32.dll +0 -0
- data/lib/gosu.rb +19 -16
- data/lib/gosu/patches.rb +81 -81
- data/lib/gosu/preview.rb +143 -139
- data/lib/gosu/run.rb +11 -11
- data/lib/gosu/swig_patches.rb +60 -60
- data/lib/gosu/zen.rb +89 -89
- metadata +5 -5
data/lib/gosu/run.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
|
-
# Replace the load path
|
2
|
-
$LOAD_PATH.clear
|
3
|
-
$LOAD_PATH << File.dirname(__FILE__)[0..-6]
|
4
|
-
$LOAD_PATH << $LOAD_PATH[0] + '/lib'
|
5
|
-
# Ruby portions of Gosu
|
6
|
-
require 'gosu/patches'
|
7
|
-
require 'gosu/swig_patches'
|
8
|
-
# Let the application know it is being run from the Mac app wrapper.
|
9
|
-
OSX_EXECUTABLE = true
|
10
|
-
# Main application
|
11
|
-
require 'Main'
|
1
|
+
# Replace the load path
|
2
|
+
$LOAD_PATH.clear
|
3
|
+
$LOAD_PATH << File.dirname(__FILE__)[0..-6]
|
4
|
+
$LOAD_PATH << $LOAD_PATH[0] + '/lib'
|
5
|
+
# Ruby portions of Gosu
|
6
|
+
require 'gosu/patches'
|
7
|
+
require 'gosu/swig_patches'
|
8
|
+
# Let the application know it is being run from the Mac app wrapper.
|
9
|
+
OSX_EXECUTABLE = true
|
10
|
+
# Main application
|
11
|
+
require 'Main'
|
data/lib/gosu/swig_patches.rb
CHANGED
@@ -1,60 +1,60 @@
|
|
1
|
-
# SWIG workarounds
|
2
|
-
# These are offloaded into a separate file because rb_eval_string() is weird on Ruby 1.8.
|
3
|
-
|
4
|
-
# Exceptions in Window callbacks often get lost, this is especially annoying in draw/update.
|
5
|
-
# It is not clear whether this is a SWIG issue or if some stack frame is not exception
|
6
|
-
# compatible, but I just call protected_update etc. in the Ruby wrapper so I can add this
|
7
|
-
# custom debugging help:
|
8
|
-
class Gosu::Window
|
9
|
-
%w(update draw needs_redraw? needs_cursor?
|
10
|
-
lose_focus button_down button_up).each do |callback|
|
11
|
-
define_method "protected_#{callback}" do |*args|
|
12
|
-
begin
|
13
|
-
# If there has been an exception, don't do anything as to not make matters worse.
|
14
|
-
# Conveniently turn the return value into a boolean result (for needs_cursor? etc).
|
15
|
-
defined?(@_exception) ? false : !!send(callback, *args)
|
16
|
-
rescue Exception => e
|
17
|
-
# Exit the message loop naturally, then re-throw
|
18
|
-
@_exception = e
|
19
|
-
close
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
|
24
|
-
def protected_draw_2
|
25
|
-
protected_draw
|
26
|
-
$gosu_gl_blocks_2 = $gosu_gl_blocks
|
27
|
-
$gosu_gl_blocks = nil
|
28
|
-
end
|
29
|
-
|
30
|
-
def gl(*args, &block)
|
31
|
-
$gosu_gl_blocks ||= []
|
32
|
-
$gosu_gl_blocks << block
|
33
|
-
unsafe_gl(*args, &block)
|
34
|
-
end
|
35
|
-
|
36
|
-
alias show_internal show
|
37
|
-
def show
|
38
|
-
show_internal
|
39
|
-
# Try to format the message nicely, without any useless patching that we are
|
40
|
-
# doing here.
|
41
|
-
if defined? @_exception then
|
42
|
-
if @_exception.backtrace.is_a? Array and not @_exception.backtrace.frozen? then
|
43
|
-
@_exception.backtrace.reject! { |line| line.include? 'lib/gosu/swig_patches.rb' }
|
44
|
-
end
|
45
|
-
raise @_exception
|
46
|
-
end
|
47
|
-
end
|
48
|
-
end
|
49
|
-
|
50
|
-
# SWIG doesn't understand the C++ overloading, so we need this simple check in Ruby.
|
51
|
-
class Gosu::Image
|
52
|
-
def self.from_text(*args)
|
53
|
-
args.size == 4 ? from_text4(*args) : from_text7(*args)
|
54
|
-
end
|
55
|
-
end
|
56
|
-
|
57
|
-
# SWIG won't let me rename my method to '[]='.
|
58
|
-
class Gosu::Font
|
59
|
-
alias []= set_image
|
60
|
-
end
|
1
|
+
# SWIG workarounds
|
2
|
+
# These are offloaded into a separate file because rb_eval_string() is weird on Ruby 1.8.
|
3
|
+
|
4
|
+
# Exceptions in Window callbacks often get lost, this is especially annoying in draw/update.
|
5
|
+
# It is not clear whether this is a SWIG issue or if some stack frame is not exception
|
6
|
+
# compatible, but I just call protected_update etc. in the Ruby wrapper so I can add this
|
7
|
+
# custom debugging help:
|
8
|
+
class Gosu::Window
|
9
|
+
%w(update draw needs_redraw? needs_cursor?
|
10
|
+
lose_focus button_down button_up).each do |callback|
|
11
|
+
define_method "protected_#{callback}" do |*args|
|
12
|
+
begin
|
13
|
+
# If there has been an exception, don't do anything as to not make matters worse.
|
14
|
+
# Conveniently turn the return value into a boolean result (for needs_cursor? etc).
|
15
|
+
defined?(@_exception) ? false : !!send(callback, *args)
|
16
|
+
rescue Exception => e
|
17
|
+
# Exit the message loop naturally, then re-throw
|
18
|
+
@_exception = e
|
19
|
+
close
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
|
24
|
+
def protected_draw_2
|
25
|
+
protected_draw
|
26
|
+
$gosu_gl_blocks_2 = $gosu_gl_blocks
|
27
|
+
$gosu_gl_blocks = nil
|
28
|
+
end
|
29
|
+
|
30
|
+
def gl(*args, &block)
|
31
|
+
$gosu_gl_blocks ||= []
|
32
|
+
$gosu_gl_blocks << block
|
33
|
+
unsafe_gl(*args, &block)
|
34
|
+
end
|
35
|
+
|
36
|
+
alias show_internal show
|
37
|
+
def show
|
38
|
+
show_internal
|
39
|
+
# Try to format the message nicely, without any useless patching that we are
|
40
|
+
# doing here.
|
41
|
+
if defined? @_exception then
|
42
|
+
if @_exception.backtrace.is_a? Array and not @_exception.backtrace.frozen? then
|
43
|
+
@_exception.backtrace.reject! { |line| line.include? 'lib/gosu/swig_patches.rb' }
|
44
|
+
end
|
45
|
+
raise @_exception
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
50
|
+
# SWIG doesn't understand the C++ overloading, so we need this simple check in Ruby.
|
51
|
+
class Gosu::Image
|
52
|
+
def self.from_text(*args)
|
53
|
+
args.size == 4 ? from_text4(*args) : from_text7(*args)
|
54
|
+
end
|
55
|
+
end
|
56
|
+
|
57
|
+
# SWIG won't let me rename my method to '[]='.
|
58
|
+
class Gosu::Font
|
59
|
+
alias []= set_image
|
60
|
+
end
|
data/lib/gosu/zen.rb
CHANGED
@@ -1,89 +1,89 @@
|
|
1
|
-
require 'gosu/preview'
|
2
|
-
|
3
|
-
module Gosu
|
4
|
-
module Zen
|
5
|
-
|
6
|
-
@@window_args = [800, 600, {}]
|
7
|
-
@@options = {}
|
8
|
-
|
9
|
-
def window width, height, options = nil
|
10
|
-
if $window.nil?
|
11
|
-
@@window_args[0] = width
|
12
|
-
@@window_args[1] = height
|
13
|
-
@@window_args[2].merge! options if options
|
14
|
-
else
|
15
|
-
raise "window size can only be set before the window is created"
|
16
|
-
end
|
17
|
-
end
|
18
|
-
|
19
|
-
def set what, value
|
20
|
-
if $window.nil?
|
21
|
-
@@options[what.to_sym] = value
|
22
|
-
else
|
23
|
-
$window.send "#{what}=", value
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def init &body
|
28
|
-
ZenWindow.send :define_method, :init, &body
|
29
|
-
end
|
30
|
-
|
31
|
-
def button_down id = nil, &body
|
32
|
-
m = id ? "button_down_#{id}" : :button_down_other
|
33
|
-
ZenWindow.send :define_method, m, &body
|
34
|
-
end
|
35
|
-
|
36
|
-
def button_up id = nil, &body
|
37
|
-
m = id ? "button_up_#{id}" : :button_up_other
|
38
|
-
ZenWindow.send :define_method, m, &body
|
39
|
-
end
|
40
|
-
|
41
|
-
def update &body
|
42
|
-
ZenWindow.send :define_method, :update, &body
|
43
|
-
end
|
44
|
-
|
45
|
-
def draw &body
|
46
|
-
ZenWindow.send :define_method, :draw, &body
|
47
|
-
end
|
48
|
-
|
49
|
-
def run!
|
50
|
-
window = ZenWindow.new *@@window_args
|
51
|
-
@@options.each do |opt, value|
|
52
|
-
window.send "#{opt}=", value
|
53
|
-
end
|
54
|
-
window.show
|
55
|
-
end
|
56
|
-
|
57
|
-
def Zen.included mod
|
58
|
-
at_exit { run! unless $! }
|
59
|
-
end
|
60
|
-
|
61
|
-
end
|
62
|
-
|
63
|
-
class ZenWindow < Window
|
64
|
-
def initialize *args
|
65
|
-
super
|
66
|
-
init
|
67
|
-
end
|
68
|
-
|
69
|
-
def init
|
70
|
-
end
|
71
|
-
|
72
|
-
def button_down id
|
73
|
-
m = :"button_down_#{id}"
|
74
|
-
respond_to?(m) ? send(m) : button_down_other(id)
|
75
|
-
end
|
76
|
-
|
77
|
-
def button_up id
|
78
|
-
m = :"button_up_#{id}"
|
79
|
-
respond_to?(m) ? send(m) : button_up_other(id)
|
80
|
-
end
|
81
|
-
|
82
|
-
def button_down_other id
|
83
|
-
end
|
84
|
-
|
85
|
-
def button_up_other id
|
86
|
-
end
|
87
|
-
|
88
|
-
end
|
89
|
-
end
|
1
|
+
require 'gosu/preview'
|
2
|
+
|
3
|
+
module Gosu
|
4
|
+
module Zen
|
5
|
+
|
6
|
+
@@window_args = [800, 600, {}]
|
7
|
+
@@options = {}
|
8
|
+
|
9
|
+
def window width, height, options = nil
|
10
|
+
if $window.nil?
|
11
|
+
@@window_args[0] = width
|
12
|
+
@@window_args[1] = height
|
13
|
+
@@window_args[2].merge! options if options
|
14
|
+
else
|
15
|
+
raise "window size can only be set before the window is created"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
def set what, value
|
20
|
+
if $window.nil?
|
21
|
+
@@options[what.to_sym] = value
|
22
|
+
else
|
23
|
+
$window.send "#{what}=", value
|
24
|
+
end
|
25
|
+
end
|
26
|
+
|
27
|
+
def init &body
|
28
|
+
ZenWindow.send :define_method, :init, &body
|
29
|
+
end
|
30
|
+
|
31
|
+
def button_down id = nil, &body
|
32
|
+
m = id ? "button_down_#{id}" : :button_down_other
|
33
|
+
ZenWindow.send :define_method, m, &body
|
34
|
+
end
|
35
|
+
|
36
|
+
def button_up id = nil, &body
|
37
|
+
m = id ? "button_up_#{id}" : :button_up_other
|
38
|
+
ZenWindow.send :define_method, m, &body
|
39
|
+
end
|
40
|
+
|
41
|
+
def update &body
|
42
|
+
ZenWindow.send :define_method, :update, &body
|
43
|
+
end
|
44
|
+
|
45
|
+
def draw &body
|
46
|
+
ZenWindow.send :define_method, :draw, &body
|
47
|
+
end
|
48
|
+
|
49
|
+
def run!
|
50
|
+
window = ZenWindow.new *@@window_args
|
51
|
+
@@options.each do |opt, value|
|
52
|
+
window.send "#{opt}=", value
|
53
|
+
end
|
54
|
+
window.show
|
55
|
+
end
|
56
|
+
|
57
|
+
def Zen.included mod
|
58
|
+
at_exit { run! unless $! }
|
59
|
+
end
|
60
|
+
|
61
|
+
end
|
62
|
+
|
63
|
+
class ZenWindow < Window
|
64
|
+
def initialize *args
|
65
|
+
super
|
66
|
+
init
|
67
|
+
end
|
68
|
+
|
69
|
+
def init
|
70
|
+
end
|
71
|
+
|
72
|
+
def button_down id
|
73
|
+
m = :"button_down_#{id}"
|
74
|
+
respond_to?(m) ? send(m) : button_down_other(id)
|
75
|
+
end
|
76
|
+
|
77
|
+
def button_up id
|
78
|
+
m = :"button_up_#{id}"
|
79
|
+
respond_to?(m) ? send(m) : button_up_other(id)
|
80
|
+
end
|
81
|
+
|
82
|
+
def button_down_other id
|
83
|
+
end
|
84
|
+
|
85
|
+
def button_up_other id
|
86
|
+
end
|
87
|
+
|
88
|
+
end
|
89
|
+
end
|
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.8.
|
4
|
+
version: 0.8.7
|
5
5
|
platform: x86-mingw32
|
6
6
|
authors:
|
7
7
|
- Julian Raschke
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |2
|
14
14
|
2D game development library.
|
@@ -96,17 +96,17 @@ require_paths:
|
|
96
96
|
- lib
|
97
97
|
required_ruby_version: !ruby/object:Gem::Requirement
|
98
98
|
requirements:
|
99
|
-
- -
|
99
|
+
- - ">="
|
100
100
|
- !ruby/object:Gem::Version
|
101
101
|
version: '0'
|
102
102
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
103
|
requirements:
|
104
|
-
- -
|
104
|
+
- - ">="
|
105
105
|
- !ruby/object:Gem::Version
|
106
106
|
version: '0'
|
107
107
|
requirements: []
|
108
108
|
rubyforge_project:
|
109
|
-
rubygems_version: 2.4.
|
109
|
+
rubygems_version: 2.4.5
|
110
110
|
signing_key:
|
111
111
|
specification_version: 4
|
112
112
|
summary: 2D game development library.
|