From 6a455731c730c29bfd34397a58928c8720edbc87 Mon Sep 17 00:00:00 2001 From: "rem..om" Date: Sun, 2 Dec 2012 15:48:15 +0000 Subject: [PATCH] Cinematic, made sure an event is properly initialized when added during playback git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10017 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- engine/src/core/com/jme3/cinematic/Cinematic.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/engine/src/core/com/jme3/cinematic/Cinematic.java b/engine/src/core/com/jme3/cinematic/Cinematic.java index dd01bca19..9aed688db 100644 --- a/engine/src/core/com/jme3/cinematic/Cinematic.java +++ b/engine/src/core/com/jme3/cinematic/Cinematic.java @@ -258,12 +258,15 @@ public class Cinematic extends AbstractCinematicEvent implements AppState { timeLine.addKeyFrameAtTime(timeStamp, keyFrame); } keyFrame.cinematicEvents.add(cinematicEvent); - cinematicEvents.add(cinematicEvent); + cinematicEvents.add(cinematicEvent); + if(isInitialized()){ + cinematicEvent.initEvent(null, this); + } return keyFrame; } /** - * removes the first occurence found of the given cinematicEvent. + * removes the first occurrence found of the given cinematicEvent. * * @param cinematicEvent the cinematicEvent to remove * @return true if the element has been removed @@ -279,7 +282,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState { } /** - * removes the first occurence found of the given cinematicEvent for the given time stamp. + * removes the first occurrence found of the given cinematicEvent for the given time stamp. * @param timeStamp the timestamp when the cinematicEvent has been added * @param cinematicEvent the cinematicEvent to remove * @return true if the element has been removed @@ -290,7 +293,7 @@ public class Cinematic extends AbstractCinematicEvent implements AppState { } /** - * removes the first occurence found of the given cinematicEvent for the given keyFrame + * removes the first occurrence found of the given cinematicEvent for the given keyFrame * @param keyFrame the keyFrame returned by the addCinematicEvent method. * @param cinematicEvent the cinematicEvent to remove * @return true if the element has been removed