ruby-sdl-ffi 0.3 → 0.4

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.
@@ -1,3 +1,40 @@
1
+ ------------------------------------------------------------
2
+ Author: John Croisant <jacius@gmail.com>
3
+ Date: Sun Mar 6 15:39:55 2011 -0600
4
+
5
+ Ruby-SDL-FFI 0.4 released.
6
+
7
+ M NEWS.rdoc
8
+ M README.rdoc
9
+ M ruby-sdl-ffi.gemspec
10
+
11
+ ------------------------------------------------------------
12
+ Author: John Croisant <jacius@gmail.com>
13
+ Date: Sun Mar 6 15:37:01 2011 -0600
14
+
15
+ Added in-file credits for Bart Leusink's contributions.
16
+
17
+ M lib/ruby-sdl-ffi/sdl/mac.rb
18
+ M lib/ruby-sdl-ffi/sdl/video.rb
19
+
20
+ ------------------------------------------------------------
21
+ Author: Bart Leusink <bartleusink@gmail.com>
22
+ Date: Mon Jan 31 23:05:01 2011 +0100
23
+
24
+ Added SDL::SaveBMP and SDL::LoadBMP
25
+
26
+ Fixes https://github.com/rubygame/ruby-sdl-ffi/issues#issue/2
27
+
28
+ M lib/ruby-sdl-ffi/sdl/video.rb
29
+
30
+ ------------------------------------------------------------
31
+ Author: Bart Leusink <bartleusink@gmail.com>
32
+ Date: Sat Jan 22 14:10:10 2011 +0100
33
+
34
+ Fixed making the current process a front process on OSX
35
+
36
+ M lib/ruby-sdl-ffi/sdl/mac.rb
37
+
1
38
  ------------------------------------------------------------
2
39
  Author: John Croisant <jacius@gmail.com>
3
40
  Date: Sun Aug 8 00:03:34 2010 -0500
data/NEWS.rdoc CHANGED
@@ -1,5 +1,15 @@
1
1
  = NEWS
2
2
 
3
+ == Ruby-SDL-FFI 0.4
4
+
5
+ * Fixed the display window not gaining focus on Mac OS X 10.6.
6
+ Thanks to Bart Leusink for fixing this.
7
+
8
+ * Added SDL::SaveBMP and SDL::LoadBMP methods. These were convenience
9
+ macros defined in the SDL headers. They have been reimplemented as
10
+ Ruby methods by Bart Leusink.
11
+
12
+
3
13
 
4
14
  == Ruby-SDL-FFI 0.3
5
15
 
@@ -1,12 +1,12 @@
1
1
 
2
2
  = Ruby-SDL-FFI
3
3
 
4
- Version:: 0.3
5
- Date:: 2010-08-08
4
+ Version:: 0.4
5
+ Date:: 2011-03-06
6
6
 
7
7
  Homepage:: http://github.com/jacius/ruby-sdl-ffi/
8
8
  Author:: John Croisant <jacius@gmail.com>
9
- Copyright:: 2009, 2010 John Croisant
9
+ Copyright:: 2009-2011 John Croisant
10
10
 
11
11
 
12
12
  == Description
@@ -62,7 +62,7 @@ Ruby-SDL-FFI may work with older versions, but hasn't been tried on them.
62
62
 
63
63
  Ruby-SDL-FFI is licensed under the following terms (the "MIT License"):
64
64
 
65
- Copyright (c) 2009, 2010 John Croisant
65
+ Copyright (c) 2009-2011 John Croisant
66
66
 
67
67
  Permission is hereby granted, free of charge, to any person obtaining
68
68
  a copy of this software and associated documentation files (the
@@ -25,6 +25,12 @@
25
25
  # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26
26
  # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
27
  #
28
+ #
29
+ # Contributions:
30
+ #
31
+ # - Bart Leusink, 2011-01-22:
32
+ # Fixed the display window not gaining focus on Mac OS X 10.6.
33
+ #
28
34
  #++
29
35
 
30
36
  #--
@@ -418,16 +424,16 @@ if FFI::Platform.mac? and ($0 != "rsdl") and \
418
424
  layout :highLongOfPSN, :ulong, :lowLongOfPSN, :ulong
419
425
  end
420
426
 
421
- # Some relevant constants (but not part of the same enum)
422
- KCurrentProcess = 2
423
427
  KProcessTransformToForegroundApplication = 1
424
428
 
429
+ func :GetCurrentProcess, [:pointer], :long
425
430
  func :TransformProcessType, [:pointer, :long], :long
426
431
  func :SetFrontProcess, [:pointer], :long
427
432
 
428
433
  # Does the magic to make the current process a front process.
429
434
  def self.make_current_front
430
- current = ProcessSerialNumber.new( [0, KCurrentProcess] )
435
+ current = ProcessSerialNumber.new( [0, 0] )
436
+ GetCurrentProcess( current )
431
437
  TransformProcessType(current,KProcessTransformToForegroundApplication)
432
438
  SetFrontProcess( current )
433
439
  end
@@ -25,6 +25,12 @@
25
25
  # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
26
26
  # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27
27
  #
28
+ #
29
+ # Contributions:
30
+ #
31
+ # - Bart Leusink, 2011-01-31:
32
+ # Implemented SDL::SaveBMP and SDL::LoadBMP
33
+ #
28
34
  #++
29
35
 
30
36
 
@@ -402,6 +408,15 @@ module SDL
402
408
  sdl_func :SaveBMP_RW, [ :pointer, :pointer, :int ], :int
403
409
 
404
410
 
411
+ def self.LoadBMP( file )
412
+ return LoadBMP_RW( RWFromFile( file, "rb" ), 1 )
413
+ end
414
+
415
+ def self.SaveBMP( surface, file )
416
+ return SaveBMP_RW( surface, RWFromFile( file, "wb" ), 1 )
417
+ end
418
+
419
+
405
420
  sdl_func :SetColorKey, [ :pointer, :uint32, :uint32 ], :int
406
421
  sdl_func :SetAlpha, [ :pointer, :uint32, :uint8 ], :int
407
422
 
metadata CHANGED
@@ -1,12 +1,12 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-sdl-ffi
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 3
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 3
9
- version: "0.3"
8
+ - 4
9
+ version: "0.4"
10
10
  platform: ruby
11
11
  authors:
12
12
  - John Croisant
@@ -14,7 +14,7 @@ autorequire:
14
14
  bindir: bin
15
15
  cert_chain: []
16
16
 
17
- date: 2010-08-08 00:00:00 -05:00
17
+ date: 2011-03-06 00:00:00 -06:00
18
18
  default_executable:
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
@@ -73,7 +73,7 @@ files:
73
73
  - lib/ruby-sdl-ffi/gfx/imagefilter.rb
74
74
  - lib/ruby-sdl-ffi/gfx.rb
75
75
  - ChangeLog.txt
76
- has_rdoc: true
76
+ has_rdoc: false
77
77
  homepage: http://github.com/jacius/ruby-sdl-ffi/
78
78
  licenses: []
79
79