-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #38 from dumganhar/jsb2.0-box2d
Hack box2d for jsb2.0
- Loading branch information
Showing
7 changed files
with
49 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#include "b2ObjectDestroyNotifier.h" | ||
|
||
static b2ObjectDestroyNotifer __objectDestroyNotifier = nullptr; | ||
|
||
void b2SetObjectDestroyNotifier(b2ObjectDestroyNotifer notifier) | ||
{ | ||
__objectDestroyNotifier = notifier; | ||
} | ||
|
||
void b2NotifyObjectDestroyed(void* obj, b2ObjectType type, const char* typeName) | ||
{ | ||
if (__objectDestroyNotifier != nullptr) | ||
{ | ||
__objectDestroyNotifier(obj, type, typeName); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#pragma once | ||
|
||
enum class b2ObjectType | ||
{ | ||
CONTACT, | ||
CIRCLE_SHAPE, | ||
EDGE_SHAPE, | ||
POLYGON_SHAPE, | ||
CHAIN_SHAPE, | ||
FIXTURE, | ||
JOIN, | ||
BODY | ||
}; | ||
|
||
typedef void (*b2ObjectDestroyNotifer)(void*, b2ObjectType, const char*); | ||
|
||
void b2SetObjectDestroyNotifier(b2ObjectDestroyNotifer notifier); | ||
void b2NotifyObjectDestroyed(void* obj, b2ObjectType type, const char* typeName); |