assimp-ffi 0.1.6 → 0.1.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5df26f6192dcf235b945984cf065ce55e166c67ab36347919847d802d9c9c043
4
- data.tar.gz: cb82f85404159973ab6d31d181b7595e9b2d67bba1ee3e03e809f92c86640526
3
+ metadata.gz: bcb6604bdbc664925b80b68d5b3203cf8537fe2150e23c898596d6a10bf08c1c
4
+ data.tar.gz: e6f525ebf5fde40bcaccd55967a9ad956c29bb8de91082132289dedf0a37c4b6
5
5
  SHA512:
6
- metadata.gz: 07fd1e1b78d4229b92c2eeb0d58861111cf747422579380447930450512f1d0505503e8ffe5fa690c34b11e7f348243b721784f786331c607ec02751545c25b7
7
- data.tar.gz: 661ea340f42fd455565565adee1d73ff846274a6da4a3e042d18b4e168e137904e88f5606ac402cfa541a2364befcad8452c6d362b6e3e35d9f5e7d01294d52a
6
+ metadata.gz: 582359516d534c53f70edcbf8daa1af8226545f8fefa711c4dcdec316261234cb9cc64994fd55d19d53181453930034756eac348094ccfb30236fe08f042a51a
7
+ data.tar.gz: 2158ce8875ebbdafbc2ebd17595ff1709db1f5ff7ce988ed294a7af9d1c8845d31d9af17fe7431c7b3381ba1d547f4f3627fb21778d103e5b5e5d07ccfd8ad0f
data/lib/assimp/defs.rb CHANGED
@@ -10,6 +10,9 @@ module Assimp
10
10
  typedef :uint, :ai_uint
11
11
  end
12
12
 
13
+ typedef :int32, :ai_int32
14
+ typedef :uint32, :ai_uint32
15
+
13
16
  MATH_PI = 3.141592653589793238462643383279
14
17
  MATH_TWO_PI = MATH_PI * 2.0
15
18
  MATH_HALF_PI = MATH_PI * 0.5
data/lib/assimp/export.rb CHANGED
@@ -17,7 +17,7 @@ module Assimp
17
17
 
18
18
  attach_function :aiGetExportFormatCount, [], :size_t
19
19
  attach_function :aiGetExportFormatDescription, [:size_t], ExportFormatDesc.ptr
20
- attach_function :aiReleaseExportFormatDescription, [ExportFormatDesc.ptr], :void
20
+ attach_function :aiReleaseExportFormatDescription, [:pointer], :void
21
21
 
22
22
  def self.export_format_descriptions
23
23
  count = Assimp::aiGetExportFormatCount
@@ -27,7 +27,7 @@ module Assimp
27
27
  end
28
28
 
29
29
  attach_function :aiCopyScene, [Scene.ptr, :pointer], :void
30
- attach_function :aiFreeScene, [Scene.ptr], :void
30
+ attach_function :aiFreeScene, [:pointer], :void
31
31
  attach_function :aiExportScene, [Scene.ptr, :string, :string, PostProcessSteps], Return
32
32
  attach_function :aiExportSceneEx, [Scene.ptr, :string, :string, FileIO.ptr, PostProcessSteps], Return
33
33
 
@@ -53,6 +53,6 @@ module Assimp
53
53
  end
54
54
 
55
55
  attach_function :aiExportSceneToBlob, [Scene.ptr, :string, PostProcessSteps], :pointer #ExportDataBlob.ptr
56
- attach_function :aiReleaseExportBlob, [ExportDataBlob.ptr], :void
56
+ attach_function :aiReleaseExportBlob, [:pointer], :void
57
57
 
58
58
  end
data/lib/assimp/import.rb CHANGED
@@ -234,7 +234,7 @@ module Assimp
234
234
  s
235
235
  end
236
236
 
237
- attach_function :aiReleaseImport, [Scene.by_ref], :void
237
+ attach_function :aiReleaseImport, [:pointer], :void
238
238
  attach_function :aiIsExtensionSupported, [:string], :bool
239
239
 
240
240
  def self.extension_supported?(extension)
data/lib/assimp/types.rb CHANGED
@@ -35,28 +35,52 @@ module Assimp
35
35
  end
36
36
  end
37
37
 
38
- class String #< FFI::Struct
39
- extend StructAccessors
40
- MAXLEN = 1024
41
- layout :length, :size_t,
42
- :data, [:char, MAXLEN]
43
- struct_attr_reader :length
38
+ if version >= Version::new(5,0,0)
39
+ class String #< FFI::Struct
40
+ extend StructAccessors
41
+ MAXLEN = 1024
42
+ layout :length, :ai_uint32,
43
+ :data, [:char, MAXLEN]
44
+ struct_attr_reader :length
44
45
 
45
- def data
46
- (pointer + Assimp.find_type(:size_t).size).read_string(length)
47
- end
46
+ def data
47
+ (pointer + 4).read_string(length)
48
+ end
48
49
 
49
- def data=(str)
50
- sz = str.bytesize
51
- raise "String too long #{sz} > #{MAXLEN-1}!" if sz > MAXLEN-1
52
- self[:length] = sz
53
- (pointer + Assimp.find_type(:size_t).size).write_string(str+"\x00")
54
- end
50
+ def data=(str)
51
+ sz = str.bytesize
52
+ raise "String too long #{sz} > #{MAXLEN-1}!" if sz > MAXLEN-1
53
+ self[:length] = sz
54
+ (pointer + 4).write_string(str+"\x00")
55
+ end
55
56
 
56
- def to_s
57
- data
57
+ def to_s
58
+ data
59
+ end
58
60
  end
61
+ else
62
+ class String #< FFI::Struct
63
+ extend StructAccessors
64
+ MAXLEN = 1024
65
+ layout :length, :size_t,
66
+ :data, [:char, MAXLEN]
67
+ struct_attr_reader :length
59
68
 
69
+ def data
70
+ (pointer + Assimp.find_type(:size_t).size).read_string(length)
71
+ end
72
+
73
+ def data=(str)
74
+ sz = str.bytesize
75
+ raise "String too long #{sz} > #{MAXLEN-1}!" if sz > MAXLEN-1
76
+ self[:length] = sz
77
+ (pointer + Assimp.find_type(:size_t).size).write_string(str+"\x00")
78
+ end
79
+
80
+ def to_s
81
+ data
82
+ end
83
+ end
60
84
  end
61
85
 
62
86
  Return = enum( :return, [ :SUCCESS, :FAILURE, -1, :OUTOFMEMORY, -3 ] )
@@ -9,6 +9,6 @@ module Assimp
9
9
  def to_s
10
10
  "<#{x}, #{y}>"
11
11
  end
12
- end
12
+ end
13
13
 
14
14
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: assimp-ffi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brice Videau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-10 00:00:00.000000000 Z
11
+ date: 2023-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: 1.9.19
33
33
  description: FFI bindings of Assimp (Open Asset Import Library bindings) for version
34
34
  4.1.0 onward
35
- email: brice.videau@imag.fr
35
+ email: brice.videau@gmail.com
36
36
  executables: []
37
37
  extensions: []
38
38
  extra_rdoc_files: []
@@ -83,8 +83,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
83
83
  - !ruby/object:Gem::Version
84
84
  version: '0'
85
85
  requirements: []
86
- rubyforge_project:
87
- rubygems_version: 2.7.6
86
+ rubygems_version: 3.1.2
88
87
  signing_key:
89
88
  specification_version: 4
90
89
  summary: Open Asset Import Library bindings