Changed ref_actor for animation callback to actor id

This commit is contained in:
n00b
2024-12-22 15:22:20 -05:00
parent 44eb4aa236
commit 070cbe2898
6 changed files with 9 additions and 7 deletions

View File

@@ -920,8 +920,9 @@ int main(int argc, char * argv[])
//DEBUG START //DEBUG START
//rc_filename = "/home/n00b/projects/bu/constraint_demo/main.bas"; //rc_filename = "/home/n00b/projects/bu/constraint_demo/main.bas";
rc_filename = "/home/n00b/Downloads/Tile Scrolling/main.bas"; //rc_filename = "/home/n00b/Downloads/Tile Scrolling/main.bas";
//rc_filename = "/home/n00b/Programs/RCBasic_v400_Linux64/examples/Constraint/main.bas"; //rc_filename = "/home/n00b/Programs/RCBasic_v400_Linux64/examples/Constraint/main.bas";
//rc_filename = "/home/n00b/Programs/RCBasic_v400_Linux64/examples/Simple 3D Platformer/main.bas";
//DEBUG END //DEBUG END
//enable_presets = true; //enable_presets = true;

View File

@@ -4453,7 +4453,7 @@ int main(int argc, char * argv[])
} }
else else
{ {
rc_intern_dirChange("/home/n00b/Programs/RCBasic_v400_Linux64/examples/Constraint/"); rc_intern_dirChange("/home/n00b/Programs/RCBasic_v400_Linux64/examples/Simple 3D Platformer/");
} }
#endif #endif
//--------------- //---------------

View File

@@ -311,7 +311,7 @@ int rc_createAnimatedActor(int mesh_id)
rc_actor[actor_id].current_animation_loop = 0; rc_actor[actor_id].current_animation_loop = 0;
rc_actor[actor_id].num_animation_loops = 0; rc_actor[actor_id].num_animation_loops = 0;
rc_animEndCallBack* anim_callback = new rc_animEndCallBack(); rc_animEndCallBack* anim_callback = new rc_animEndCallBack();
anim_callback->ref_actor = &rc_actor[actor_id]; anim_callback->ref_id = actor_id;
anim_callback->OnAnimationEnd(node); anim_callback->OnAnimationEnd(node);
node->setAnimationEndCallback(anim_callback); node->setAnimationEndCallback(anim_callback);
node->setLoopMode(false); node->setLoopMode(false);

View File

@@ -586,10 +586,11 @@ irr::core::array<int> rc_transition_actor;
class rc_animEndCallBack : public IAnimationEndCallBack class rc_animEndCallBack : public IAnimationEndCallBack
{ {
public: public:
rc_scene_node* ref_actor; int ref_id;
void OnAnimationEnd( IAnimatedMeshSceneNode *node) void OnAnimationEnd( IAnimatedMeshSceneNode *node)
{ {
rc_scene_node* ref_actor = &rc_actor[ref_id];
if(ref_actor->current_animation_loop < ref_actor->num_animation_loops || ref_actor->num_animation_loops < 0) if(ref_actor->current_animation_loop < ref_actor->num_animation_loops || ref_actor->num_animation_loops < 0)
{ {
//std::cout << "animating" << std::endl; //std::cout << "animating" << std::endl;

View File

@@ -2,7 +2,7 @@
#define RC_OS_DEFINES_H_INCLUDED #define RC_OS_DEFINES_H_INCLUDED
//USED FOR TESTING ONLY //USED FOR TESTING ONLY
#define RC_TESTING //#define RC_TESTING
//I am checking Android first since I think it also defines __linux__ //I am checking Android first since I think it also defines __linux__

View File

@@ -626,8 +626,8 @@ int rc_castRay2D_All(double from_x, double from_y, double to_x, double to_y)
rc_rayHit2D.clear(); rc_rayHit2D.clear();
RayCastCallback callback; RayCastCallback callback;
b2Vec2 point1(from_x, from_y); const b2Vec2 point1(from_x, from_y);
b2Vec2 point2(to_x, to_y); const b2Vec2 point2(to_x, to_y);
rc_canvas[rc_active_canvas].physics2D.world->RayCast(&callback, point1, point2); rc_canvas[rc_active_canvas].physics2D.world->RayCast(&callback, point1, point2);