Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Check for 5.3.1 ABI

  • Loading branch information...
commit 9d1a4ba74bb1e1ba4473dfc7f6e6996e3bbdb359 1 parent f1f91f8
@mieko mieko authored
Showing with 43 additions and 20 deletions.
  1. +43 −20 lib/chipmunk-ffi/body.rb
View
63 lib/chipmunk-ffi/body.rb
@@ -4,26 +4,49 @@ module CP
callback :cpBodyPositionFunc, [:pointer, CP_FLOAT], :void
class BodyStruct < NiceFFI::Struct
- layout(
- :velocity_func, :cpBodyVelocityFunc,
- :position_func, :cpBodyPositionFunc,
- :m, CP_FLOAT,
- :m_inv, CP_FLOAT,
- :i, CP_FLOAT,
- :i_inv, CP_FLOAT,
- :p, Vect,
- :v, Vect,
- :f, Vect,
- :a, CP_FLOAT,
- :w, CP_FLOAT,
- :t, CP_FLOAT,
- :rot, Vect,
- :data, :pointer,
- :v_limit, CP_FLOAT,
- :w_limit, CP_FLOAT,
- :v_bias, Vect,
- :w_bias, CP_FLOAT
- )
+ if CP::VERSION < '5.3.1'
+ layout(
+ :velocity_func, :cpBodyVelocityFunc,
+ :position_func, :cpBodyPositionFunc,
+ :m, CP_FLOAT,
+ :m_inv, CP_FLOAT,
+ :i, CP_FLOAT,
+ :i_inv, CP_FLOAT,
+ :p, Vect,
+ :v, Vect,
+ :f, Vect,
+ :a, CP_FLOAT,
+ :w, CP_FLOAT,
+ :t, CP_FLOAT,
+ :rot, Vect,
+ :data, :pointer,
+ :v_limit, CP_FLOAT,
+ :w_limit, CP_FLOAT,
+ :v_bias, Vect,
+ :w_bias, CP_FLOAT
+ )
+ else
+ layout(
+ :velocity_func, :cpBodyVelocityFunc,
+ :position_func, :cpBodyPositionFunc,
+ :m, CP_FLOAT,
+ :m_inv, CP_FLOAT,
+ :i, CP_FLOAT,
+ :i_inv, CP_FLOAT,
+ :p, Vect,
+ :v, Vect,
+ :f, Vect,
+ :a, CP_FLOAT,
+ :w, CP_FLOAT,
+ :t, CP_FLOAT,
+ :rot, Vect,
+ :v_limit, CP_FLOAT,
+ :w_limit, CP_FLOAT,
+ :data, :pointer,
+ :v_bias, Vect,
+ :w_bias, CP_FLOAT
+ )
+ end
def self.release(me)
# TODO is this right?
Please sign in to comment.
Something went wrong with that request. Please try again.