ruby_rpg 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +7 -0
  2. data/bin/import +44 -0
  3. data/lib/ruby_rpg.rb +3 -0
  4. metadata +135 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: '091ac79469c6f30641eb943a28fea1673a8f15d427e0e42cb3825f9110d42719'
4
+ data.tar.gz: 22ad396c27d72861b99dae48a6d5382938cf6c74bc25601affb6887d58803ec4
5
+ SHA512:
6
+ metadata.gz: 7dcbf059515494fe55af96aa36ce7e24aa356b5f6e1ac6df7b774f0007b3398286fdf5d6df9a142765f0abfe3b356d905609ae9128e252870ee1859c7c4c04ac
7
+ data.tar.gz: 533db8ed264ab194621bc24900213d19ec3a926dbc2642bf47fdfb96aae9f4cd025c8a5ef61be536ce1d839742e68640cbd9afefad54fc0d709fbcf778b39484
data/bin/import ADDED
@@ -0,0 +1,44 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ # frozen_string_literal: true
4
+
5
+ require_relative '../lib/engine/importers/font_importer'
6
+ require_relative '../lib/engine/importers/obj_importer'
7
+ require_relative '../lib/engine/importers/obj_file'
8
+ require_relative '../lib/engine/path'
9
+ require_relative '../lib/engine/tangent_calculator'
10
+
11
+ require 'fileutils'
12
+ require "rmagick"
13
+ require "matrix"
14
+
15
+ assets_path = ARGV[0]
16
+
17
+ puts "importing assets from #{assets_path}"
18
+ FileUtils.mkdir_p(File.join(assets_path, '_imported'))
19
+
20
+ fonts = Dir.glob("#{assets_path}/**/*.ttf")
21
+ puts "found #{fonts.size} fonts"
22
+ fonts.each do |font|
23
+ puts "importing #{font}"
24
+ destination_image = (font.delete_prefix(assets_path)).gsub(/\.ttf$/, '.png')
25
+ destination_font_metrics = (font.delete_prefix(assets_path)).gsub(/\.ttf$/, '.json')
26
+
27
+ destination_path = File.join(assets_path, '_imported', destination_image)
28
+ destination_font_metrics_file = File.join(assets_path, '_imported', destination_font_metrics)
29
+
30
+ puts " -> #{destination_path}, #{destination_font_metrics_file}"
31
+ Engine::FontImporter.new(font, destination_path, destination_font_metrics_file).import
32
+ end
33
+
34
+ obj_files = Dir.glob("#{assets_path}/**/*.obj")
35
+ puts "found #{obj_files.size} obj files"
36
+ obj_files.each do |obj_file|
37
+ puts "importing #{obj_file}"
38
+ destination_vertex = (obj_file.delete_prefix(assets_path)).gsub(/\.obj$/, '.vertex_data')
39
+ destination_index = (obj_file.delete_prefix(assets_path)).gsub(/\.obj$/, '.index_data')
40
+ destination_vertex_path = File.join(assets_path, '_imported', destination_vertex)
41
+ destination_index_path = File.join(assets_path, '_imported', destination_index)
42
+ puts " -> #{destination_vertex_path}, #{destination_index_path}"
43
+ Engine::ObjImporter.new(obj_file.gsub(".obj", ""), destination_vertex_path, destination_index_path).import
44
+ end
data/lib/ruby_rpg.rb ADDED
@@ -0,0 +1,3 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'engine/engine'
metadata ADDED
@@ -0,0 +1,135 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: ruby_rpg
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Max Hatfull
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2024-10-27 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: opengl-bindings2
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '2.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: concurrent-ruby
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - ">="
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - ">="
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: os
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - ">="
46
+ - !ruby/object:Gem::Version
47
+ version: '0'
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - ">="
53
+ - !ruby/object:Gem::Version
54
+ version: '0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: matrix
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '0.3'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '0.3'
69
+ - !ruby/object:Gem::Dependency
70
+ name: chunky_png
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '1.4'
76
+ type: :runtime
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '1.4'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rmagick
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '6.0'
90
+ - - ">="
91
+ - !ruby/object:Gem::Version
92
+ version: 6.0.1
93
+ type: :runtime
94
+ prerelease: false
95
+ version_requirements: !ruby/object:Gem::Requirement
96
+ requirements:
97
+ - - "~>"
98
+ - !ruby/object:Gem::Version
99
+ version: '6.0'
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: 6.0.1
103
+ description: A Ruby game engine using OpenGL and GLFW
104
+ email: max.hatfull@gmail.com
105
+ executables:
106
+ - import
107
+ extensions: []
108
+ extra_rdoc_files: []
109
+ files:
110
+ - bin/import
111
+ - lib/ruby_rpg.rb
112
+ homepage: https://github.com/rubyrpg/ruby_rpg
113
+ licenses:
114
+ - MIT
115
+ metadata: {}
116
+ post_install_message:
117
+ rdoc_options: []
118
+ require_paths:
119
+ - lib
120
+ required_ruby_version: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - ">="
123
+ - !ruby/object:Gem::Version
124
+ version: 3.3.1
125
+ required_rubygems_version: !ruby/object:Gem::Requirement
126
+ requirements:
127
+ - - ">="
128
+ - !ruby/object:Gem::Version
129
+ version: '0'
130
+ requirements: []
131
+ rubygems_version: 3.5.9
132
+ signing_key:
133
+ specification_version: 4
134
+ summary: A game engine written in Ruby
135
+ test_files: []