doomfire 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 67bdf9fa995a19a70b46f2707adc899ee31780968ffb9f1d0fe4544f6f225313
4
- data.tar.gz: 9d1234e1894955dd50614b9bbf85edcb0a2665980baac220fb23696568e27792
3
+ metadata.gz: 89b6b146226294362b53ab49479381e4fd58ebba7481ecfd1c8f2106ad8e1714
4
+ data.tar.gz: 9141d2f4f5ffcf4be8b4a3447db05a8b08158b916c9914184d3a48a4e26e4b21
5
5
  SHA512:
6
- metadata.gz: e596f6b9b137e0343a106a2ee6d9371389ad88c0877ebbe7f72a919ecd60488c0012afb71ee63fa6b3dc226607d37ca32ffeafe139114e14e328f6df37a0fb66
7
- data.tar.gz: f9e5d75205b31479ffffdb22014e2f965223dd58c9aa0fab17b5e7b5581b8ba2f5d2d932d3af3daa31b7892ad67563733e18ffc876276926403071f0273b253c
6
+ metadata.gz: 45a8f024ba820a3aca42ae5a64e6bef4a2cb2388f17a2f7174da05d4aa56cda344dcbea2b802275569969e6110f53097d5a1d3b8fa82d1c41da405812cdcd623
7
+ data.tar.gz: 16362cf09982cc961aab53e7034c2f0060a0272539300db4a08f6583635a1030e26d9047cd723033dd13027ad869697bb3f98c675bae5b17eba7d3ff80afacdb
data/CHANGELOG.md CHANGED
@@ -1,8 +1,14 @@
1
+ # 0.3.1
2
+
3
+ - [x] Updated documentation
4
+ - [x] Switched SDL window to 320x240
5
+ - [x] Don't explode if there's no libsDL2 installed
6
+
1
7
  # 0.3.0
2
8
 
3
- - [ ] SDL output in progress.
4
- - [ ] Improve SDL performance
5
- - [ ] https://stackoverflow.com/questions/20753726/rendering-pixels-from-array-of-rgb-values-in-sdl-1-2/36504803#36504803
9
+ - [x] SDL output in progress.
10
+ - [x] Improve SDL performance
11
+ - [x] Fixed accidental bug breaking terminal/spinner output
6
12
 
7
13
  # 0.2.0
8
14
 
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- doomfire (0.3.0)
4
+ doomfire (0.3.1)
5
5
  paint
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -55,6 +55,20 @@ end
55
55
 
56
56
  This will run the fire in a separate thread while your rake tasks works in the main thread, and at the end of the task it will gracefully extinguish the fire and clear the terminal.
57
57
 
58
+ ## SDL
59
+
60
+ Now with actual pixel manipulation! You can set the output to use the SDL2 library, which will put the output in a graphical window. It's a bit restricted right now to a small window and sometimes blows up, so I consider it a bit of an experiment.
61
+
62
+ You need [libSDL2](http://www.libsdl.org/download-2.0.php) installed on your system (most likely through Homebrew, apt or whatever your system uses). The doomfire executable script will complain if you don't have it.
63
+
64
+ $ brew install sdl2
65
+
66
+ Then you can run the executable:
67
+
68
+ $ doomfire --sdl
69
+
70
+ And the output should be shown in a separate window. Closing the window will end the program after a few seconds of the ending animation.
71
+
58
72
  ## Contributing
59
73
 
60
74
  Bug reports and pull requests are welcome on GitHub at https://github.com/marcinruszkiewicz/doomfire.
data/exe/doomfire CHANGED
@@ -21,4 +21,14 @@ OptionParser.new do |opts|
21
21
  end
22
22
  end.parse!
23
23
 
24
- options[:sdl] ? Doomfire::SDL.new.run : Doomfire::Terminal.new.run
24
+ if options[:sdl]
25
+ begin
26
+ require 'doomfire/ffi_sdl'
27
+ require 'doomfire/sdl'
28
+ Doomfire::SDL.new.run
29
+ rescue Fiddle::DLError
30
+ puts 'You need to install libSDL2 to use the SDL output.'
31
+ end
32
+ else
33
+ Doomfire::Terminal.new.run
34
+ end
data/lib/doomfire.rb CHANGED
@@ -3,7 +3,5 @@
3
3
  require 'doomfire/base'
4
4
  require 'doomfire/terminal'
5
5
  require 'doomfire/spinner'
6
- require 'doomfire/ffi_sdl'
7
- require 'doomfire/sdl'
8
6
  require 'doomfire/version'
9
7
  require 'doomfire/window_size'
@@ -21,7 +21,6 @@ module Doomfire
21
21
  SDL_QUIT = 0x100
22
22
  SDL_KEYDOWN = 0x300
23
23
  SDL_PIXELFORMAT_ARGB8888 = 372_645_892
24
- SDL_TEXTUREACCESS_STATIC = 0
25
24
  SDL_TEXTUREACCESS_STREAMING = 1
26
25
 
27
26
  SDL_Event = union [
data/lib/doomfire/sdl.rb CHANGED
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'pry'
4
-
5
3
  module Doomfire
6
4
  # Output to a separate SDL window
7
5
  class SDL < Base
@@ -89,14 +87,14 @@ module Doomfire
89
87
  end
90
88
 
91
89
  def prepare_output
92
- @fire_width = 640
93
- @fire_height = 480
90
+ @fire_width = 320
91
+ @fire_height = 240
94
92
 
95
93
  FFI_SDL.SDL_Init(FFI_SDL::SDL_INIT_VIDEO)
96
94
  @window = FFI_SDL.SDL_CreateWindow(
97
95
  'Doomfire.rb',
98
- FFI_SDL::SDL_WINDOWPOS_UNDEFINED,
99
- FFI_SDL::SDL_WINDOWPOS_UNDEFINED,
96
+ FFI_SDL::SDL_WINDOWPOS_CENTERED,
97
+ FFI_SDL::SDL_WINDOWPOS_CENTERED,
100
98
  @fire_width,
101
99
  @fire_height,
102
100
  FFI_SDL::SDL_WINDOW_OPENGL
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Doomfire
4
- VERSION = '0.3.0'
4
+ VERSION = '0.3.1'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: doomfire
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marcin Ruszkiewicz