Finished documentation

Finished documentation on sprite physics and joints
Fixed some bugs in sprite physics
Added safety checks for joint types
Added code to free up joints when a canvas is destroyed
This commit is contained in:
n00b
2024-10-28 22:22:33 -04:00
parent 8f1b72a8e2
commit 2a580f9686
113 changed files with 1485 additions and 882 deletions

View File

@@ -28,6 +28,7 @@
#include "rc_sprite2D.h"
#include "rc_spritelib.h"
#include "rc_tilelib.h"
#include "rc_joints.h"
#include <irrtheora.h>
using namespace irr;
@@ -987,6 +988,16 @@ void rc_canvasClose(int canvas_id)
rc_canvas[canvas_id].physics2D.world = NULL;
for(int i = 0; i < rc_joint.size(); i++)
{
if(rc_joint[i].canvas == canvas_id)
{
rc_joint[i].canvas = -1;
rc_joint[i].joint = NULL;
rc_joint[i].active = false;
}
}
//sprites are destroyed when the world is deleted so I just to set the active attribute to false and set the body to NULL
for(int i = 0; i < rc_canvas[canvas_id].sprite.size(); i++)
{