assimp-ffi 0.1.6 → 0.1.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/assimp/defs.rb +3 -0
- data/lib/assimp/export.rb +3 -3
- data/lib/assimp/import.rb +1 -1
- data/lib/assimp/types.rb +41 -17
- data/lib/assimp/vector2.rb +1 -1
- metadata +4 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bcb6604bdbc664925b80b68d5b3203cf8537fe2150e23c898596d6a10bf08c1c
|
4
|
+
data.tar.gz: e6f525ebf5fde40bcaccd55967a9ad956c29bb8de91082132289dedf0a37c4b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 582359516d534c53f70edcbf8daa1af8226545f8fefa711c4dcdec316261234cb9cc64994fd55d19d53181453930034756eac348094ccfb30236fe08f042a51a
|
7
|
+
data.tar.gz: 2158ce8875ebbdafbc2ebd17595ff1709db1f5ff7ce988ed294a7af9d1c8845d31d9af17fe7431c7b3381ba1d547f4f3627fb21778d103e5b5e5d07ccfd8ad0f
|
data/lib/assimp/defs.rb
CHANGED
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, [
|
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, [
|
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, [
|
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, [
|
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
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
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
|
-
|
46
|
-
|
47
|
-
|
46
|
+
def data
|
47
|
+
(pointer + 4).read_string(length)
|
48
|
+
end
|
48
49
|
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
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
|
-
|
57
|
-
|
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 ] )
|
data/lib/assimp/vector2.rb
CHANGED
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.
|
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:
|
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@
|
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
|
-
|
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
|