Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "liquidfun"
version = "0.8.0"
version = "0.8.1"
authors = ["Richard Janicek <r@janicek.co>"]
description = "Rust bindings for LiquidFun."
license = "MIT"
Expand All @@ -15,4 +15,4 @@ gcc = "0.3"

[dependencies]
bitflags = "0.3"
libc = "0.2"
libc = "0.2"
4 changes: 2 additions & 2 deletions src/box2d/collision/shapes/polygon_shape.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ enum B2PolygonShape {}

extern {
fn b2PolygonShape_Delete(ptr: *mut B2PolygonShape);
fn b2PolygonShape_GetVertex(ptr: *mut B2PolygonShape, index: Int32) -> &Vec2;
fn b2PolygonShape_GetVertex(ptr: &B2PolygonShape, index: Int32) -> &Vec2;
fn b2PolygonShape_GetVertexCount(ptr: *const B2PolygonShape) -> Int32;
fn b2PolygonShape_New() -> *mut B2PolygonShape;
fn b2PolygonShape_SetAsBox(ptr: *mut B2PolygonShape, hx: Float32, hy: Float32);
Expand Down Expand Up @@ -49,7 +49,7 @@ impl PolygonShape {
/// Get a vertex by index.
pub fn get_vertex(&self, index: i32) -> &Vec2 {
unsafe {
b2PolygonShape_GetVertex(self.ptr, index)
b2PolygonShape_GetVertex(&*self.ptr, index)
}
}

Expand Down
5 changes: 2 additions & 3 deletions src/box2d/dynamics/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,13 @@ extern {
fn b2Body_GetAngle(this: *mut B2Body) -> Float32;
fn b2Body_GetFixtureList(this: *mut B2Body) -> *mut B2Fixture;
fn b2Body_GetNext(this: *mut B2Body) -> *mut B2Body;
fn b2Body_GetPosition(this: *mut B2Body) -> &Vec2;
fn b2Body_GetPosition(this: &B2Body) -> &Vec2;
fn b2Body_GetUserData(this: *const B2Body) -> usize;
fn b2Body_GetWorld(this: *const B2Body) -> *mut B2World;
fn b2Body_GetLocalPoint(this: *const B2Body, worldPoint: &Vec2) -> Vec2;
}

/// A rigid body. These are created via b2World::CreateBody.
#[allow(raw_pointer_derive)]
#[derive(Clone, Debug)]
pub struct Body {
pub ptr: *mut B2Body
Expand Down Expand Up @@ -189,7 +188,7 @@ impl Body {
/// @return the world position of the body's origin.
pub fn get_position(&self) -> &Vec2 {
unsafe {
b2Body_GetPosition(self.ptr)
b2Body_GetPosition(&*self.ptr)
}
}

Expand Down
1 change: 0 additions & 1 deletion src/box2d/dynamics/fixture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,6 @@ extern {
/// such as friction, collision filters, etc.
/// Fixtures are created via b2Body::CreateFixture.
/// @warning you cannot reuse fixtures.
#[allow(raw_pointer_derive)]
#[derive(Clone)]
pub struct Fixture {
pub ptr: *mut B2Fixture
Expand Down
1 change: 0 additions & 1 deletion src/box2d/dynamics/joints/revolute_joint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ extern {
/// a joint limit that specifies a lower and upper angle. You can use a motor
/// to drive the relative rotation about the shared point. A maximum motor torque
/// is provided so that infinite forces are not generated.
#[allow(raw_pointer_derive)]
#[derive(Clone, Debug)]
pub struct RevoluteJoint {
pub ptr: *mut B2RevoluteJoint
Expand Down
1 change: 0 additions & 1 deletion src/box2d/particle/particle_color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ extern {


/// Small color object for each particle
#[allow(raw_pointer_derive)]
#[derive(Clone)]
pub struct ParticleColor {
pub ptr: *mut B2ParticleColor
Expand Down
1 change: 0 additions & 1 deletion src/box2d/particle/particle_group.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
pub enum B2ParticleGroup {}

/// A group of particles. b2ParticleGroup::CreateParticleGroup creates these.
#[allow(raw_pointer_derive)]
#[derive(Clone)]
pub struct ParticleGroup {
pub ptr: *mut B2ParticleGroup
Expand Down
1 change: 0 additions & 1 deletion src/box2d/particle/particle_system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ extern {
fn b2ParticleSystem_GetPositionBuffer(ps: *mut B2ParticleSystem) -> *mut Vec2;
}

#[allow(raw_pointer_derive)]
#[derive(Clone)]
pub struct ParticleSystem {
pub ptr: *mut B2ParticleSystem
Expand Down